MCPcopy Create free account
hub / github.com/modelscope/modelscope / is_ok

Function is_ok

modelscope/hub/errors.py:77–86  ·  view source on GitHub ↗

Check the request is ok Args: rsp (Response): The request response body Returns: bool: `True` if success otherwise `False`.

(rsp)

Source from the content-addressed store, hash-verified

75
76
77def is_ok(rsp):
78 """ Check the request is ok
79
80 Args:
81 rsp (Response): The request response body
82
83 Returns:
84 bool: `True` if success otherwise `False`.
85 """
86 return rsp['Code'] == HTTPStatus.OK and rsp['Success']
87
88
89def _decode_response_error(response: requests.Response):

Callers 4

createMethod · 0.90
getMethod · 0.90
deleteMethod · 0.90
listMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…