code: def shrink_seq(examples, min_seq=None):
      length = examples["obs"].shape[-1]
  
      new_length = length // 2
  
      if min_seq is not None:
          if new_length < min_seq:
              return examples
  
      max_length = (
          np.max(examples["eval_mask"] * np.arange(0, length)) + 1
      )
  
      if max_length < new_length:
          examples["obs"] = examples["obs"][:, :new_length]
          examples["target"] = examples["target"][:, :new_length]
          examples["eval_mask"] = examples["eval_mask"][:, :new_length]
  
          return shrink_seq(examples, min_seq=min_seq)
      else:
          return examples
  
imports: from itertools import zip_longest
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: shrink_seq(examples, min_seq) and returns: shrink_seq, examples, examples