6f325b9135a729a403840866fcb5248d71f54645,service/server.py,BertServer,run,#BertServer#,47

Before Change


                worker, _, client = request[:3]
                if client == b"READY":
                    poller.register(self.frontend, zmq.POLLIN)
                    logger.info("registered!")
                    continue

                // parsing data size
                md = jsonapi.loads(request[-1])

After Change


                request = self.backend.recv_multipart()
                worker, _, client = request[:3]
                free_a_worker(worker)
                if client != b"READY" and len(request) > 3:
                    _, reply = request[3:]
                    X = np.frombuffer(memoryview(reply), dtype=md["dtype"])
                    finish_jobs[client].append(X.reshape(md["shape"]))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 2

Instances


Project Name: hanxiao/bert-as-service
Commit Name: 6f325b9135a729a403840866fcb5248d71f54645
Time: 2018-11-13
Author: hanhxiao@tencent.com
File Name: service/server.py
Class Name: BertServer
Method Name: run


Project Name: tensorpack/tensorpack
Commit Name: 02e53f72a70ac2ceb8dc5798b046277610418cf1
Time: 2020-08-24
Author: ppwwyyxx@users.noreply.github.com
File Name: tensorpack/train/trainers.py
Class Name: HorovodTrainer
Method Name: initialize


Project Name: NifTK/NiftyNet
Commit Name: 696c0bba5172aa702b46e36119cbf73776fcfeee
Time: 2018-11-22
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/engine/handler_model.py
Class Name: ModelRestorer
Method Name: restore_model


Project Name: microsoft/nni
Commit Name: 08af7771d1f1149f3da5a98bcdbf7e65abd409ba
Time: 2020-12-27
Author: Quanlu.Zhang@microsoft.com
File Name: nni/retiarii/strategies/tpe_strategy.py
Class Name: TPEStrategy
Method Name: run