code: def split_and_pad_single_record(
      data: np._typing.NDArray, episode_lengths: List[int], T: int
  ):
      """See `split_and_pad`, but initial data has already been concatenated over episodes.
  
      Given an np.ndarray of data that is the result of a concatenation of data chunks
      coming from different episodes, the lengths of these episodes, as well as the
      maximum time dimension, split and possibly right-zero-pad this input data, such that
      the resulting shape of the returned np.ndarray is (B', T, ...), where B' is the
      number of generated sub-chunks and ... is the original shape of the data (excluding
      the batch dim). T is the size of the newly inserted time axis (on which zero-padding
      is applied if necessary).
  
      Args:
          data: The single np.ndarray input data to be split, zero-added, and reshaped.
          episode_lengths: The list of episode lengths, from which `data` was originally
              concat'd.
          T: The maximum number of timesteps on the T-axis in the resulting np.ndarray.
  
      Returns:
          A single np.ndarray, which contains the same data as `data`, but split into sub-
          chunks of max. size T (zero-padded if necessary at the end of individual
          episodes), then reshaped to (B', T, ...).
      """
      # Chop up `data` into chunks of max len=T, based on the lengths of the episodes
      # where this data came from.
      episodes_data = []
      idx = 0
      for episode_len in episode_lengths:
          episodes_data.append(data[idx : idx + episode_len])
          idx += episode_len
      # Send everything through `split_and_pad` to perform the actual splitting into
      # sub-chunks of max len=T and zero-padding.
      return split_and_pad(episodes_data, T)
  
imports: from typing import List, Tuple
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: split_and_pad_single_record(data, episode_lengths, T) and returns: split_and_pad