ef498e8aa5cdfe09247d9c9efc7ef636378165c2,python/ray/serve/policy.py,PowerOfTwoPolicy,flush,#PowerOfTwoPolicy#Any#Any#,102

Before Change



                // Choose the backend that has a shorter queue.
                if (len(backend_queues[backend1]) <= len(
                        backend_queues[backend2])):
                    chosen_backend = backend1
                else:
                    chosen_backend = backend2

After Change


            if query.shard_key is None:
                rstate = np.random
            else:
                sha256_seed = sha256(query.shard_key.encode("utf-8"))
                seed = np.frombuffer(sha256_seed.digest(), dtype=np.uint32)
                rstate = np.random.RandomState(seed)

            chosen_backend = rstate.choice(
                self.backend_names, replace=False,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: ray-project/ray
Commit Name: ef498e8aa5cdfe09247d9c9efc7ef636378165c2
Time: 2020-05-15
Author: ed.nmi.oakes@gmail.com
File Name: python/ray/serve/policy.py
Class Name: PowerOfTwoPolicy
Method Name: flush


Project Name: streamlit/streamlit
Commit Name: 289da8733f1d0faa48c30867093f944da839e341
Time: 2019-09-28
Author: treuille@users.noreply.github.com
File Name: lib/streamlit/hello.py
Class Name:
Method Name: data_frame_demo


Project Name: google/deepvariant
Commit Name: bb8db448470551c15c9b0ddab573a0c8e2e6303a
Time: 2019-09-18
Author: cym@google.com
File Name: deepvariant/vcf_stats_vis.py
Class Name:
Method Name: _build_type_chart