b7222818e9dd4d33ee933388e73a11ad8d0bf89b,tests/helper_functions.py,,score_model_in_sagemaker_docker_container,#Any#Any#,24
Before Change
print("connection attempt", i, "failed, server is not up yet")
assert proc.poll() is None, "scoring process died"
ping_status = requests.get(url="http://localhost:5000/ping")
print("server up, ping status", ping_status)
if ping_status.status_code != 200:
raise Exception("ping failed, server is not happy")
if type(data) == pd.DataFrame:
data = data.to_dict(orient="records")
y = requests.post(url="http://localhost:5000/invocations", json=data)
import json
return json.loads(y.content)
finally:
if proc.poll() is None:
proc.terminate()
print("captured output of the scoring process")
After Change
universal_newlines=True, env=env)
r = _score_proc(proc, 5000, data, "json").content
import json
return json.loads(r) // TODO: we should return pd.Dataframe the same as pyfunc serve
def pyfunc_serve_and_score_model(model_path, data):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: mlflow/mlflow
Commit Name: b7222818e9dd4d33ee933388e73a11ad8d0bf89b
Time: 2018-09-06
Author: 33237569+tomasatdatabricks@users.noreply.github.com
File Name: tests/helper_functions.py
Class Name:
Method Name: score_model_in_sagemaker_docker_container
Project Name: albermax/innvestigate
Commit Name: 29f961daaf4c3f464dea4563793fdf27d57be09a
Time: 2018-09-26
Author: work.alber.maximilian@gmail.com
File Name: innvestigate/analyzer/pattern_based.py
Class Name: PatternNet
Method Name: _create_analysis
Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 54286d5e125fdebf3fa6a82ee16e8172a2127402
Time: 2020-02-21
Author: saksena@google.com
File Name: perfkitbenchmarker/providers/aws/aws_dpb_emr.py
Class Name: AwsDpbEmr
Method Name: _CreateLogBucket