code: def global_array_to_host_local_array(
      global_inputs: Any, global_mesh: jax.sharding.Mesh, pspecs: Any
  ):
      r"""Converts a global `jax.Array` to a host local `jax.Array`.
  
      You can use this function to transition to `jax.Array`. Using `jax.Array` with
      pjit has the same semantics of using GDA with pjit i.e. all `jax.Array`
      inputs to pjit should be globally shaped and the output from pjit will also
      be globally shaped jax.Array's
  
      You can use this function to convert the globally shaped `jax.Array` output
      from pjit to host local values again so that the transition to jax.Array can
      be a mechanical change. Example usage
  
      >> from jax.experimental import multihost_utils # doctest: +SKIP
      >>
      >> global_inputs = multihost_utils.host_local_array_to_global_array(host_local_inputs, global_mesh, in_pspecs) # doctest: +SKIP
      >>
      >> with mesh: # doctest: +SKIP
      >>   global_out = pjitted_fun(global_inputs) # doctest: +SKIP
      >>
      >> host_local_output = multihost_utils.global_array_to_host_local_array(global_out, mesh, out_pspecs) # doctest: +SKIP
  
      Args:
        global_inputs: A Pytree of global jax.Array's.
        global_mesh: A jax.sharding.Mesh object.
        pspecs: A Pytree of jax.sharding.PartitionSpec's.
      """
      flat_inps, out_tree = tree_flatten(global_inputs)
      out_pspecs = _flatten_pspecs(
          "output pspecs", out_tree, pjit_lib.hashable_pytree(pspecs)
      )
      out_flat = [
          global_array_to_host_local_array_p.bind(
              inp, global_mesh=global_mesh, pspec=o
          )
          for inp, o in safe_zip(flat_inps, out_pspecs)
      ]
      return tree_unflatten(out_tree, out_flat)
  
imports: from __future__ import annotations
  from functools import partial, lru_cache
  from typing import Optional
  import zlib
  from typing import Any
  import jax
  import jax.numpy
  from jax.tree_util import tree_flatten, tree_map, tree_unflatten
  from jax._src import core
  from jax._src.interpreters import ad
  from jax._src.interpreters import batching
  from jax._src.interpreters import mlir
  from jax._src import array
  from jax._src import sharding_impls
  from jax._src.interpreters import pxla
  from jax.interpreters import xla
  from jax._src import pjit
  from jax.experimental.pjit import pjit
  from jax.sharding import PartitionSpec
  from jax._src import distributed
  from jax._src.util import safe_zip
  import numpy
label_desc: Use image node_id 18 for calling a global function with example usage: global_array_to_host_local_array(global_inputs, global_mesh, pspecs) and returns: tree_unflatten