code: def _get_batch_dim_helper(v: TensorStructType) -> int:
      """Tries to find the batch dimension size of v, or None."""
      if isinstance(v, dict):
          for u in v.values():
              return _get_batch_dim_helper(u)
      elif isinstance(v, tuple):
          return _get_batch_dim_helper(v[0])
      elif isinstance(v, RepeatedValues):
          return _get_batch_dim_helper(v.values)
      else:
          B = v.shape[0]
          if hasattr(B, "value"):
              B = B.value  # TensorFlow
          return B
  
file_path: ray/python/ray/rllib/models/repeated_values.py
imports: from typing import List
  from ray.rllib.utils.annotations import PublicAPI
  from ray.rllib.utils.typing import TensorType, TensorStructType
label_desc: Use image node_id 1 for calling a global function with example usage: _get_batch_dim_helper(v) and returns: _get_batch_dim_helper, _get_batch_dim_helper, _get_batch_dim_helper, B