code: def _serialize_aval(
      builder: flatbuffers.Builder, aval: core.AbstractValue
  ) -> int:
      aval_type = type(aval)
      if aval_type is core.ShapedArray:
          aval_kind = ser_flatbuf.AbstractValueKind.shapedArray
          shape_offsets = [
              builder.CreateString(str(d)) for d in aval.shape
          ]
          ser_flatbuf.AbstractValueStartShapeVector(
              builder, len(aval.shape)
          )
          for d in reversed(shape_offsets):
              builder.PrependUOffsetTRelative(d)
          shape_vector_offset = builder.EndVector()
  
          ser_flatbuf.AbstractValueStart(builder)
          ser_flatbuf.AbstractValueAddKind(builder, aval_kind)
          ser_flatbuf.AbstractValueAddShape(
              builder, shape_vector_offset
          )
          ser_flatbuf.AbstractValueAddDtype(
              builder, _dtype_to_dtype_kind[aval.dtype]
          )
          return ser_flatbuf.AbstractValueEnd(builder)
      else:
          raise NotImplementedError(
              f"serializing AbstractValue: {aval}"
          )
  
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 9 for calling a global function with example usage: _serialize_aval(builder, aval) and returns: ser_flatbuf