code: def _load_client() -> OpenAI:  # type: ignore[reportUnusedFunction]
      global _client
  
      if _client is None:
          global api_type, azure_endpoint, azure_ad_token, api_version
  
          if azure_endpoint is None:
              azure_endpoint = _os.environ.get("AZURE_OPENAI_ENDPOINT")
  
          if azure_ad_token is None:
              azure_ad_token = _os.environ.get("AZURE_OPENAI_AD_TOKEN")
  
          if api_version is None:
              api_version = _os.environ.get("OPENAI_API_VERSION")
  
          if api_type is None:
              has_openai = _has_openai_credentials()
              has_azure = _has_azure_credentials()
              has_azure_ad = _has_azure_ad_credentials()
  
              if has_openai and (has_azure or has_azure_ad):
                  raise _AmbiguousModuleClientUsageError()
  
              if (
                  azure_ad_token is not None
                  or azure_ad_token_provider is not None
              ) and _os.environ.get("AZURE_OPENAI_API_KEY") is not None:
                  raise _AmbiguousModuleClientUsageError()
  
              if has_azure or has_azure_ad:
                  api_type = "azure"
              else:
                  api_type = "openai"
  
          if api_type == "azure":
              _client = _AzureModuleClient(  # type: ignore
                  api_version=api_version,
                  azure_endpoint=azure_endpoint,
                  api_key=api_key,
                  azure_ad_token=azure_ad_token,
                  azure_ad_token_provider=azure_ad_token_provider,
                  organization=organization,
                  base_url=base_url,
                  timeout=timeout,
                  max_retries=max_retries,
                  default_headers=default_headers,
                  default_query=default_query,
                  http_client=http_client,
              )
              return _client
  
          _client = _ModuleClient(
              api_key=api_key,
              organization=organization,
              base_url=base_url,
              timeout=timeout,
              max_retries=max_retries,
              default_headers=default_headers,
              default_query=default_query,
              http_client=http_client,
          )
          return _client
  
      return _client
  
imports: from __future__ import annotations
  import os
  from typing_extensions import override
  from .None import types
  from ._types import NoneType, Transport, ProxiesTypes
  from ._utils import file_from_path
  from ._client import Client, OpenAI, Stream, Timeout, Transport, AsyncClient, AsyncOpenAI, AsyncStream, RequestOptions
  from ._version import __title__, __version__
  from ._response import APIResponse, AsyncAPIResponse
  from ._exceptions import APIError, OpenAIError, ConflictError, NotFoundError, APIStatusError, RateLimitError, APITimeoutError, BadRequestError, APIConnectionError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, APIResponseValidationError
  from ._utils._logs import setup_logging
  from .lib import azure
  from .version import VERSION
  from .lib.azure import AzureOpenAI, AsyncAzureOpenAI
  from .lib._old_api import *
  import typing
  import typing_extensions
  import httpx
  from ._base_client import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES
  from ._module_client import beta, chat, audio, files, images, models, embeddings, completions, fine_tuning, moderations
label_desc: Use image node_id 4 for calling a global function with example usage: _load_client() and returns: _client, _client, _client