code: def batches_to_batch(
      cls, batches: t.Sequence[tf_ext.EagerTensor], batch_dim: int = 0
  ) -> t.Tuple[tf_ext.EagerTensor, list[int]]:
      batch: tf_ext.EagerTensor = tf.concat(batches, axis=batch_dim)
      # TODO: fix typing mismatch @larme
      indices: list[int] = list(
          itertools.accumulate(
              subbatch.shape[batch_dim] for subbatch in batches
          )
      )  # type: ignore
      indices = [0] + indices
      return batch, indices
  
imports: from __future__ import annotations
  import contextlib
  import itertools
  import logging
  import pickle
  import typing
  from types import ModuleType
  from typing import TYPE_CHECKING
  import bentoml
  from bentoml import Runnable
  from bentoml import Tag
  from bentoml.exceptions import MissingDependencyException
  from bentoml.exceptions import NotFound
  from bentoml.models import ModelContext
  from ..models.model import ModelSignature
  from ..models.model import PartialKwargsModelOptions
  from ..runner.container import DataContainer
  from ..runner.container import DataContainerRegistry
  from ..runner.container import Payload
  from ..types import LazyType
  from .utils.tensorflow import cast_py_args_to_tf_function_args
  from .utils.tensorflow import get_input_signatures_v2
  from .utils.tensorflow import get_output_signatures_v2
  from .utils.tensorflow import get_restorable_functions
  from .utils.tensorflow import get_tf_version
label_desc: Use image node_id 1 for calling the TensorflowTensorContainer obj's underlying member method code with example usage: obj.batches_to_batch(cls, batches, batch_dim) and returns: batch,  indices