code: def _deserialize_exported(
      exp: ser_flatbuf.Exported,
  ) -> export.Exported:
      serialization_version = exp.SerializationVersion()
      if serialization_version != _SERIALIZATION_VERSION:
          raise NotImplementedError(
              f"deserialize unsupported version {serialization_version}"
          )
  
      fun_name = exp.FunctionName().decode("utf-8")
      _, in_tree = tree_util.tree_flatten(
          _deserialize_pytreedef_to_pytree(exp.InTree())
      )
      in_avals = _deserialize_tuple(
          exp.InAvalsLength, exp.InAvals, _deserialize_aval
      )
      _, out_tree = tree_util.tree_flatten(
          _deserialize_pytreedef_to_pytree(exp.OutTree())
      )
      out_avals = _deserialize_tuple(
          exp.OutAvalsLength, exp.OutAvals, _deserialize_aval
      )
      nr_devices = exp.NrDevices()
      in_shardings = _deserialize_tuple(
          exp.InShardingsLength, exp.InShardings, _deserialize_sharding
      )
      out_shardings = _deserialize_tuple(
          exp.OutShardingsLength,
          exp.OutShardings,
          _deserialize_sharding,
      )
      lowering_platforms = _deserialize_tuple(
          exp.LoweringPlatformsLength,
          exp.LoweringPlatforms,
          lambda v: v.decode("utf-8"),
      )
      ordered_effects = _deserialize_tuple(
          exp.OrderedEffectsLength,
          exp.OrderedEffects,
          _deserialize_effect,
      )
      unordered_effects = _deserialize_tuple(
          exp.UnorderedEffectsLength,
          exp.UnorderedEffects,
          _deserialize_effect,
      )
      disabled_safety_checks = _deserialize_tuple(
          exp.DisabledChecksLength,
          exp.DisabledChecks,
          _deserialize_disabled_safety_check,
      )
  
      mlir_module_serialized = (
          exp.MlirModuleSerializedAsNumpy().tobytes()
      )
      mlir_module_serialization_version = (
          exp.MlirModuleSerializationVersion()
      )
      module_kept_var_idx = tuple(
          exp.ModuleKeptVarIdxAsNumpy().tolist()
      )
      uses_shape_polymorphism = exp.UsesShapePolymorphism()
  
      _get_vjp = None
      if vjp := exp.Vjp():
          _get_vjp = lambda _: _deserialize_exported(vjp)
  
      return export.Exported(
          fun_name=fun_name,
          in_tree=in_tree,
          in_avals=in_avals,
          out_tree=out_tree,
          out_avals=out_avals,
          nr_devices=nr_devices,
          in_shardings=in_shardings,
          out_shardings=out_shardings,
          lowering_platforms=lowering_platforms,
          ordered_effects=ordered_effects,
          unordered_effects=unordered_effects,
          disabled_safety_checks=disabled_safety_checks,
          mlir_module_serialized=mlir_module_serialized,
          mlir_module_serialization_version=mlir_module_serialization_version,
          module_kept_var_idx=module_kept_var_idx,
          uses_shape_polymorphism=uses_shape_polymorphism,
          _get_vjp=_get_vjp,
      )
  
imports: from typing import Callable, TypeVar
  from collections.abc import Sequence
  from jax._src import core
  from jax._src import dtypes
  from jax._src import effects
  from jax._src import tree_util
  from jax._src.lib import xla_client
  from jax.experimental.export import serialization_generated
  from jax.experimental.export import _export
  from jax.experimental import export
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: _deserialize_exported(exp) and returns: export