code: def _get_backend_uncached(
      platform: None | str | xla_client.Client = None,
  ) -> xla_client.Client:
      # TODO(mattjj,skyewm): remove this input polymorphism after we clean up how
      # 'backend' values are handled
      if platform is not None and not isinstance(platform, str):
          return platform
  
      platform = (
          platform or _XLA_BACKEND.value or _PLATFORM_NAME.value or None
      )
  
      bs = backends()
      if platform is not None:
          platform = canonicalize_platform(platform)
          backend = bs.get(platform, None)
          if backend is None:
              if platform in _backend_errors:
                  raise RuntimeError(
                      f"Backend '{platform}' failed to initialize: "
                      f"{_backend_errors[platform]}. "
                      f"Available backends are {list(bs)}"
                  )
              raise RuntimeError(f"Unknown backend {platform}")
          return backend
      else:
          assert _default_backend is not None
          return _default_backend
  
imports: from __future__ import annotations
  from __future__ import annotations
  from collections.abc import Mapping
  import dataclasses
  from functools import lru_cache, partial
  import importlib
  import json
  import logging
  import os
  import pkgutil
  import platform
  import sys
  import threading
  from typing import Any, Callable, Union
  import warnings
  from jax._src import config
  from jax._src import distributed
  from jax._src import traceback_util
  from jax._src import util
  from jax._src import hardware_utils
  from jax._src.cloud_tpu_init import maybe_import_libtpu
  from jax._src.lib import cuda_versions
  from jax._src.lib import xla_client
  from jax._src.lib import xla_extension
  from jax._src.lib import xla_extension_version
label_desc: Use image node_id 22 for calling a global function with example usage: _get_backend_uncached(platform) and returns: platform, backend, _default_backend