d60fd8f7e3f98c6f473f21df83a9d6b33e5d69fa,tests/testTiledVolume.py,DataSetup,_start_server,#DataSetup#,164

Before Change


        self._start_server()
    
    def _start_server(self):
        with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
            sock.bind(("localhost", 8888))  // check if port 8888 is available

        original_cwd = os.getcwd()

After Change


        class Server(socketserver.TCPServer):
            // http://stackoverflow.com/questions/10613977/a-simple-python-server-using-simplehttpserver-and-socketserver-how-do-i-close-t
            allow_reuse_address = True
        server = Server(("localhost", port), Handler)
        import threading
        server_thread = threading.Thread(target=server.serve_forever)
        server_thread.start()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: ilastik/ilastik
Commit Name: d60fd8f7e3f98c6f473f21df83a9d6b33e5d69fa
Time: 2018-05-04
Author: fynn.beuttenmueller@iwr.uni-heidelberg.de
File Name: tests/testTiledVolume.py
Class Name: DataSetup
Method Name: _start_server


Project Name: vatlab/SoS
Commit Name: 65e9b2c80487b7ef22e61666936fe0606654c838
Time: 2018-03-23
Author: ben.bog@gmail.com
File Name: test/test_actions.py
Class Name:
Method Name: internet_on


Project Name: ilastik/ilastik
Commit Name: c1ddc5be6e6372efbd679c262ded09bff676157e
Time: 2018-11-26
Author: fynn.beuttenmueller@iwr.uni-heidelberg.de
File Name: tests/testTiledVolume.py
Class Name: DataSetup
Method Name: _start_server