code: def pad_chunk(x, pad_idx=1, pad_first=True, seq_len=72, pad_len=10):
      "Pad `x` by adding padding by chunks of size `seq_len`"
      l = pad_len - x.shape[0]
      pad_chunk = x.new_zeros((l // seq_len) * seq_len) + pad_idx
      pad_res = x.new_zeros(l % seq_len) + pad_idx
      x1 = (
          torch.cat([pad_chunk, x, pad_res])
          if pad_first
          else torch.cat([x, pad_chunk, pad_res])
      )
      return retain_type(x1, x)
  
imports: from __future__ import annotations
  from ..torch_basics import *
  from ..data.all import *
  from .core import *
label_desc: Use image node_id 8 for calling a global function with example usage: pad_chunk(x, pad_idx, pad_first, seq_len, pad_len) and returns: retain_type