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","`","."]
docstr: Return a run, sweep, project or report from a path.
  
  Examples:
      ```
      project = api.from_path("my_project")
      team_project = api.from_path("my_team/my_project")
      run = api.from_path("my_team/my_project/runs/id")
      sweep = api.from_path("my_team/my_project/sweeps/id")
      report = api.from_path("my_team/my_project/reports/My-Report-Vm11dsdf")
      ```
  
  Arguments:
      path: (str) The path to the project, run, sweep or report
  
  Returns:
      A `Project`, `Run`, `Sweep`, or `BetaReport` instance.
  
  Raises:
      wandb.Error if path is invalid or the object doesn't exist
docstr_tok: ["Return","a","run",",","sweep",",","project","or","report","from","a","path",".","Examples",":","``","`","project","=","api.from_path","(","``","my_project","''",")","team_project","=","api.from_path","(","``","my_team\/my_project","''",")","run","=","api.from_path","(","``","my_team\/my_project\/runs\/id","''",")","sweep","=","api.from_path","(","``","my_team\/my_project\/sweeps\/id","''",")","report","=","api.from_path","(","``","my_team\/my_project\/reports\/My-Report-Vm11dsdf","''",")","``","`","Arguments",":","path",":","(","str",")","The","path","to","the","project",",","run",",","sweep","or","report","Returns",":","A","`","Project","`",",","`","Run","`",",","`","Sweep","`",",","or","`","BetaReport","`","instance",".","Raises",":","wandb.Error","if","path","is","invalid","or","the","object","does","n't","exist"]
code: def from_path(self, path):
      """Return a run, sweep, project or report from a path.
  
      Examples:
          ```
          project = api.from_path("my_project")
          team_project = api.from_path("my_team/my_project")
          run = api.from_path("my_team/my_project/runs/id")
          sweep = api.from_path("my_team/my_project/sweeps/id")
          report = api.from_path("my_team/my_project/reports/My-Report-Vm11dsdf")
          ```
  
      Arguments:
          path: (str) The path to the project, run, sweep or report
  
      Returns:
          A `Project`, `Run`, `Sweep`, or `BetaReport` instance.
  
      Raises:
          wandb.Error if path is invalid or the object doesn't exist
      """
      parts = path.strip("/ ").split("/")
      if len(parts) == 1:
          return self.project(path)
      elif len(parts) == 2:
          return self.project(parts[1], parts[0])
      elif len(parts) == 3:
          return self.run(path)
      elif len(parts) == 4:
          if parts[2].startswith("run"):
              return self.run(path)
          elif parts[2].startswith("sweep"):
              return self.sweep(path)
          elif parts[2].startswith("report"):
              if "--" not in parts[-1]:
                  if "-" in parts[-1]:
                      raise wandb.Error(
                          "Invalid report path, should be team/project/reports/Name--XXXX"
                      )
                  else:
                      parts[-1] = "--" + parts[-1]
              name, id = parts[-1].split("--")
              return public.BetaReport(
                  self.client,
                  {
                      "display_name": urllib.parse.unquote(
                          name.replace("-", " ")
                      ),
                      "id": id,
                      "spec": "{}",
                  },
                  parts[0],
                  parts[1],
              )
      raise wandb.Error(
          "Invalid path, should be TEAM/PROJECT/TYPE/ID where TYPE is runs, sweeps, or reports"
      )
  
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 15 for calling the Api obj's underlying member method code with example usage: obj.from_path(path) and returns: self, self, self, self, self, public