MCPcopy Create free account
hub / github.com/HumanSignal/label-studio / __init__

Method __init__

label_studio/ml/api_connector.py:52–65  ·  view source on GitHub ↗
(
        self, url, timeout=None, connection_timeout=None, max_retries=None, headers=None, auth_method=None, **kwargs
    )

Source from the content-addressed store, hash-verified

50 }
51
52 def __init__(
53 self, url, timeout=None, connection_timeout=None, max_retries=None, headers=None, auth_method=None, **kwargs
54 ):
55 self._url = url
56 self._timeout = timeout or TIMEOUT_DEFAULT
57 self._connection_timeout = connection_timeout or CONNECTION_TIMEOUT
58 self._headers = headers or {}
59 self._auth_method = auth_method
60
61 # TODO basic auth parameters must be required for auth_method == 'basic'
62 self._basic_auth = (kwargs.get('basic_auth_user'), kwargs.get('basic_auth_pass'))
63
64 self._max_retries = max_retries or self.MAX_RETRIES
65 self._sessions = {self._session_key(): self.create_session()}
66
67 def create_session(self):
68 session = requests.Session()

Callers

nothing calls this directly

Calls 3

_session_keyMethod · 0.95
create_sessionMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected