code: def get_wandb_api_key() -> str:
      base_url = os.environ.get(
          "WANDB_BASE_URL", "https://api.wandb.ai"
      )
      api_key = os.environ.get("WANDB_API_KEY")
      if not api_key:
          auth = requests.utils.get_netrc_auth(base_url)
          if not auth:
              raise ValueError(
                  f"must configure api key by env or in netrc for {base_url}"
              )
          api_key = auth[-1]
      return api_key
  
imports: import os
  import requests
label_desc: Use image node_id 1 for calling a global function with example usage: get_wandb_api_key() and returns: api_key