code: def _global_mesh_defined() -> bool:
      """Checks if global xmap/pjit mesh resource environment is defined."""
      maps_env = maps.thread_resources.env
      return maps_env.physical_mesh.devices.shape != ()
  
imports: import functools
  import typing
  import jax
  from jax.experimental import maps
  from jax.sharding import Mesh, PartitionSpec
  from flax.experimental.nnx.nnx import variables
  from flax.experimental.nnx.nnx.pytreelib import TreeNode
  from flax.experimental.nnx.nnx.state import State
label_desc: Use image node_id 6 for calling a global function with example usage: _global_mesh_defined() and returns: unknown