class_docstr: Used for querying the wandb server.
  
  Examples:
      Most common way to initialize
      >>> wandb.Api()
  
  Arguments:
      overrides: (dict) You can set `base_url` if you are using a wandb server
          other than https://api.wandb.ai.
          You can also set defaults for `entity`, `project`, and `run`.
class_docstr_tok: ["Used","for","querying","the","wandb","server",".","Examples",":","Most","common","way","to","initialize",">",">",">","wandb.Api","(",")","Arguments",":","overrides",":","(","dict",")","You","can","set","`","base_url","`","if","you","are","using","a","wandb","server","other","than","https",":","\/\/api.wandb.ai",".","You","can","also","set","defaults","for","`","entity","`",",","`","project","`",",","and","`","run","`","."]
code: def __init__(
      self,
      overrides=None,
      timeout: Optional[int] = None,
      api_key: Optional[str] = None,
  ) -> None:
      self.settings = InternalApi().settings()
      _overrides = overrides or {}
      self._api_key = api_key
      if (
          self.api_key is None
          and _thread_local_api_settings.cookies is None
      ):
          wandb.login(host=_overrides.get("base_url"))
      self.settings.update(_overrides)
      if "username" in _overrides and "entity" not in _overrides:
          wandb.termwarn(
              'Passing "username" to Api is deprecated. please use "entity" instead.'
          )
          self.settings["entity"] = _overrides["username"]
      self.settings["base_url"] = self.settings["base_url"].rstrip("/")
  
      self._viewer = None
      self._projects = {}
      self._runs = {}
      self._sweeps = {}
      self._reports = {}
      self._default_entity = None
      self._timeout = (
          timeout if timeout is not None else self._HTTP_TIMEOUT
      )
      auth = None
      if not _thread_local_api_settings.cookies:
          auth = ("api", self.api_key)
      proxies = self.settings.get("_proxies") or json.loads(
          os.environ.get("WANDB__PROXIES", "{}")
      )
      self._base_client = Client(
          transport=GraphQLSession(
              headers={
                  "User-Agent": self.user_agent,
                  "Use-Admin-Privileges": "true",
                  **(_thread_local_api_settings.headers or {}),
              },
              use_json=True,
              # this timeout won't apply when the DNS lookup fails. in that case, it will be 60s
              # https://bugs.python.org/issue22889
              timeout=self._timeout,
              auth=auth,
              url="%s/graphql" % self.settings["base_url"],
              cookies=_thread_local_api_settings.cookies,
              proxies=proxies,
          )
      )
      self._client = RetryingClient(self._base_client)
  
imports: import json
  import logging
  import os
  import urllib
  from typing import TYPE_CHECKING, Any, Dict, Optional
  import requests
  from wandb_gql import Client, gql
  from wandb_gql.client import RetryError
  import wandb
  from wandb import env, util
  from wandb.apis import public
  from wandb.apis.internal import Api
  from wandb.apis.normalize import normalize_exceptions
  from wandb.apis.public.const import RETRY_TIMEDELTA
  from wandb.sdk.internal.thread_local_settings import _thread_local_api_settings
  from wandb.sdk.launch.utils import LAUNCH_DEFAULT_PROJECT
  from wandb.sdk.lib import retry, runid
  from wandb.sdk.lib.gql_request import GraphQLSession
label_desc: Use image node_id 1 to create a new Api object  with example: obj = Api(overrides, timeout, api_key)