c4e273920f517b18c99fbabca49135dd6e30e683,python/ray/experimental/client/__init__.py,RayAPIStub,init,#RayAPIStub#,119

Before Change


        return _client_api is not None

    def init(self, *args, **kwargs):
        if _is_client_test_env():
            global _test_server
            import ray.experimental.client.server.server as ray_client_server
            _test_server, address_info = ray_client_server.init_and_serve(
                "localhost:50051", test_mode=True, *args, **kwargs)
            self.connect("localhost:50051")
            return address_info
        else:
            raise NotImplementedError(
                "Please call ray.connect() in client mode")


ray = RayAPIStub()

_test_server = None

After Change


        return self.api is not None

    def init(self, *args, **kwargs):
        if self._server is not None:
            raise Exception("Trying to start two instances of ray via client")
        import ray.experimental.client.server.server as ray_client_server
        self._server, address_info = ray_client_server.init_and_serve(
            "localhost:50051", *args, **kwargs)
        self.connect("localhost:50051")
        self._connected_with_init = True
        return address_info

    def shutdown(self, _exiting_interpreter=False):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: ray-project/ray
Commit Name: c4e273920f517b18c99fbabca49135dd6e30e683
Time: 2020-12-22
Author: me@barakmich.com
File Name: python/ray/experimental/client/__init__.py
Class Name: RayAPIStub
Method Name: init


Project Name: arnomoonens/yarll
Commit Name: de6ca4b8640d5be2acdfc326a8ce83917084ea5d
Time: 2017-03-25
Author: x-006@hotmail.com
File Name: async_knowledge_transfer.py
Class Name:
Method Name: main


Project Name: arnomoonens/yarll
Commit Name: de6ca4b8640d5be2acdfc326a8ce83917084ea5d
Time: 2017-03-25
Author: x-006@hotmail.com
File Name: knowledge_transfer.py
Class Name:
Method Name: main


Project Name: ray-project/ray
Commit Name: c4e273920f517b18c99fbabca49135dd6e30e683
Time: 2020-12-22
Author: me@barakmich.com
File Name: python/ray/experimental/client/__init__.py
Class Name: RayAPIStub
Method Name: init