bc55eec660bebc333ded2a2f6097a001060a35ed,nni/experiment/rest.py,,get,#Any#Any#,11
Before Change
timeout = 20
def get(port: int, api: str) -> Any:
url = url_template.format(port, api)
resp = requests.get(url, timeout=timeout)
if not resp.ok:
_logger.error("rest request GET %s %s failed: %s %s", port, api, resp.status_code, resp.text)
resp.raise_for_status()
return resp.json()
def post(port: int, api: str, data: Any) -> Any:
url = url_template.format(port, api)
After Change
return resp.json()
def get(port: Optional[int], api: str) -> Any:
return request("get", port, api)
def post(port: Optional[int], api: str, data: Any) -> Any:
return request("post", port, api, data)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 13
Instances
Project Name: Microsoft/nni
Commit Name: bc55eec660bebc333ded2a2f6097a001060a35ed
Time: 2021-03-07
Author: 40699903+liuzhe-lz@users.noreply.github.com
File Name: nni/experiment/rest.py
Class Name:
Method Name: get
Project Name: Microsoft/nni
Commit Name: bc55eec660bebc333ded2a2f6097a001060a35ed
Time: 2021-03-07
Author: 40699903+liuzhe-lz@users.noreply.github.com
File Name: nni/experiment/rest.py
Class Name:
Method Name: post
Project Name: Microsoft/nni
Commit Name: bc55eec660bebc333ded2a2f6097a001060a35ed
Time: 2021-03-07
Author: 40699903+liuzhe-lz@users.noreply.github.com
File Name: nni/experiment/rest.py
Class Name:
Method Name: get
Project Name: Microsoft/nni
Commit Name: bc55eec660bebc333ded2a2f6097a001060a35ed
Time: 2021-03-07
Author: 40699903+liuzhe-lz@users.noreply.github.com
File Name: nni/experiment/rest.py
Class Name:
Method Name: put