48373446ecf9ef563b02c360be347da02df09ce9,deeppavlov/utils/socket/socket.py,,handle_connection,#Any#Any#Any#Any#Any#,21
Before Change
if not lengths:
log.error("got empty request")
await loop.sock_sendall(conn, b"[]" )
return
elif len(lengths) > 1:
log.error("got several different batch sizes")
After Change
log.info(f"handling connection from {addr}")
conn.setblocking(False)
recv_data = b""
try:
while True:
chunk = await loop.run_in_executor(None, conn.recv, bufsize)
if chunk:
recv_data += chunk
else:
break
except BlockingIOError:
pass
try:
data = json.loads(recv_data)
except ValueError:
await wrap_error(conn, "request type is not json")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: deepmipt/DeepPavlov
Commit Name: 48373446ecf9ef563b02c360be347da02df09ce9
Time: 2019-08-05
Author: ignatov.fedor@gmail.com
File Name: deeppavlov/utils/socket/socket.py
Class Name:
Method Name: handle_connection
Project Name: hanxiao/bert-as-service
Commit Name: 208146e25347b8fe3fe57cd813b5e3880bbe4f9a
Time: 2019-01-16
Author: hanhxiao@tencent.com
File Name: server/bert_serving/server/helper.py
Class Name: BertRequestHandler
Method Name: do_POST
Project Name: RaRe-Technologies/gensim
Commit Name: 12110715c6e36f02d13bb82fd5382e7f9153686b
Time: 2019-02-12
Author: misha.penkov@gmail.com
File Name: gensim/models/_fasttext_bin.py
Class Name:
Method Name: _load_vocab