55566bc797a24f9a445fc30245f103229f5d5deb,python/ray/util/client/ray_client_helpers.py,,ray_start_client_server,#,8

Before Change


    server = ray_client_server.serve("localhost:50051")
    ray.connect("localhost:50051")
    try:
        yield ray
    finally:
        ray._inside_client_test = False
        ray.disconnect()
        server.stop(0)

After Change



@contextmanager
def ray_start_client_server():
    with ray_start_client_server_pair() as pair:
        client, server = pair
        yield client


@contextmanager
def ray_start_client_server_pair():
    ray._inside_client_test = True
    server = ray_client_server.serve("localhost:50051")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: ray-project/ray
Commit Name: 55566bc797a24f9a445fc30245f103229f5d5deb
Time: 2021-02-01
Author: me@barakmich.com
File Name: python/ray/util/client/ray_client_helpers.py
Class Name:
Method Name: ray_start_client_server


Project Name: deepmind/sonnet
Commit Name: bde4d188c147cb27b55c8b6c76bff14c0d490af8
Time: 2019-09-18
Author: tomhennigan@google.com
File Name: sonnet/src/replicator.py
Class Name: TpuReplicator
Method Name: scope


Project Name: deepmind/sonnet
Commit Name: c787becf4d41944658591ea63ff56e4661ebc3eb
Time: 2019-10-30
Author: tomhennigan@google.com
File Name: sonnet/src/replicator.py
Class Name: Replicator
Method Name: scope