code: def create_mask_and_seq_lens(episode_lens, T):
      mask = []
      seq_lens = []
      for episode_len in episode_lens:
          len_ = min(episode_len, T)
          seq_lens.append(len_)
          row = [1] * len_ + [0] * (T - len_)
          mask.append(row)
  
          # Handle sequence lengths greater than T.
          overflow = episode_len - T
          while overflow > 0:
              len_ = min(overflow, T)
              seq_lens.append(len_)
              extra_row = [1] * len_ + [0] * (T - len_)
              mask.append(extra_row)
              overflow -= T
  
      return np.array(mask, dtype=np.bool_), np.array(
          seq_lens, dtype=np.int32
      )
  
file_path: ray/rllib/connectors/learner/default_learner_connector.py
imports: from functools import partial
  from typing import Any, List, Optional
  import numpy
  import tree
  from ray.rllib.connectors.connector_v2 import ConnectorV2
  from ray.rllib.core.models.base import STATE_IN, STATE_OUT
  from ray.rllib.core.rl_module.rl_module import RLModule
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.numpy import convert_to_numpy
  from ray.rllib.utils.typing import EpisodeType
label_desc: Use image node_id 3 for calling a global function with example usage: create_mask_and_seq_lens(episode_lens, T) and returns: np,  np