code: def cloud_tpu_init() -> None:
      """Automatically sets Cloud TPU topology and other env vars.
  
      **This must be called before the TPU runtime is loaded, which happens as soon
      as JAX's C++ backend is loaded! I.e. call this before xla_bridge or xla_client
      is imported.**
  
      Safe to call in non-Cloud TPU environments.
  
      Some of these environment variables are used to tell the TPU runtime what kind
      of mesh topology to use. It assumes a single-host topology by default, so we
      manually set them here to default to the full pod slice if applicable.
  
      This will not set any env vars if a single topology-related env var is already
      set.
      """
      global running_in_cloud_tpu_vm
  
      # We assume we are in a correctly-configured Cloud TPU environment
      # if the following hold: a) libtpu is installed b) JAX_FORCE_TPU_INIT is set
      # Exit early if we're not running on Cloud TPU.
      libtpu_module = maybe_import_libtpu()
      if libtpu_module is None and not jax_force_tpu_init():
          return
  
      running_in_cloud_tpu_vm = True
  
      os.environ.setdefault("GRPC_VERBOSITY", "ERROR")
      os.environ.setdefault("JAX_PLATFORMS", "tpu,cpu")
      os.environ["TPU_ML_PLATFORM"] = "JAX"
      if hardware_utils.tpu_enhanced_barrier_supported():
          os.environ["LIBTPU_INIT_ARGS"] = (
              os.environ.get("LIBTPU_INIT_ARGS", "")
              + " --xla_tpu_use_enhanced_launch_barrier=true"
          )
  
      # TODO(skyewm): remove this warning at some point, say around Sept 2023.
      use_pjrt_c_api = os.environ.get("JAX_USE_PJRT_C_API_ON_TPU", None)
      if use_pjrt_c_api:
          warnings.warn(
              "JAX_USE_PJRT_C_API_ON_TPU no longer has an effect (the new TPU "
              "runtime is always enabled now). Unset the environment variable "
              "to disable this warning."
          )
  
      # Remove when minimum jaxlib version is >= 0.4.15
      os.environ["JAX_USE_PJRT_C_API_ON_TPU"] = "true"
  
imports: import os
  import warnings
  from jax._src import hardware_utils
label_desc: Use image node_id 3 for calling a global function with example usage: cloud_tpu_init() without return types