def __init__( self, master: Optional[str] = None, user: Optional[str] = None, ): self._session = session.Session(master, user) userauth = api.authentication.Authentication.instance() configuration = Configuration() configuration.host = self._session._master.rstrip("/") configuration.username = userauth.token_store.get_active_user() configuration.api_key_prefix["Authorization"] = "Bearer" configuration.api_key["Authorization"] = userauth.get_session_token() self._experiments = ExperimentsApi(ApiClient(configuration)) self._internal = InternalApi(ApiClient(configuration)) self._trials = TrialsApi(ApiClient(configuration))
def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client