code: def _serialize_effect(
      builder: flatbuffers.Builder, eff: core.Effect
  ) -> int:
      try:
          eff_replica = eff.__class__()
      except Exception:
          raise NotImplementedError(
              f"Effect {eff} must have a nullary constructor to be serializable"
          )
      try:
          hash_eff = hash(eff)
          hash_eff_replica = hash(eff_replica)
      except Exception:
          raise NotImplementedError(
              f"Effect {eff} must be hashable to be serializable"
          )
      if eff != eff_replica or hash_eff != hash_eff_replica:
          raise NotImplementedError(
              f"Effect {eff} must have a nullary class constructor that produces an "
              "equal effect object."
          )
      effect_type_name = str(eff.__class__)
      effect_type_name_offset = builder.CreateString(effect_type_name)
      ser_flatbuf.EffectStart(builder)
      ser_flatbuf.EffectAddTypeName(builder, effect_type_name_offset)
      return ser_flatbuf.ExportedEnd(builder)
  
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 13 for calling a global function with example usage: _serialize_effect(builder, eff) and returns: ser_flatbuf