code: def front_pad_with_zero(arr: np.ndarray, max_seq_len: int):
      """Pad arr on the front/left with 0 up to max_seq_len."""
      length = arr.shape[0]
      pad_length = max_seq_len - length
      if pad_length > 0:
          return np.concatenate(
              [
                  np.zeros(
                      (pad_length, *arr.shape[1:]), dtype=arr.dtype
                  ),
                  arr,
              ],
              axis=0,
          )
      else:
          return arr
  
file_path: ray/rllib_contrib/dt/src/rllib_dt/dt/segmentation_buffer.py
imports: import logging
  import random
  from collections import defaultdict
  from typing import List
  import numpy
  from ray.rllib.evaluation.postprocessing import discount_cumsum
  from ray.rllib.policy.sample_batch import MultiAgentBatch, SampleBatch, concat_samples
  from ray.rllib.utils.typing import SampleBatchType
label_desc: Use image node_id 1 for calling a global function with example usage: front_pad_with_zero(arr, max_seq_len) and returns: np, arr