code: def sample_interval(seqs, segment_size):
      "This function sample an interval of audio and code according to segment size."
      N = max([v.shape[-1] for v in seqs])
      seq_len = segment_size if segment_size > 0 else N
      hops = [N // v.shape[-1] for v in seqs]
      lcm = np.lcm.reduce(hops)
      interval_start = 0
      interval_end = N // lcm - seq_len // lcm
      start_step = random.randint(interval_start, interval_end)
  
      new_seqs = []
      for i, v in enumerate(seqs):
          start = start_step * (lcm // hops[i])
          end = (start_step + seq_len // lcm) * (lcm // hops[i])
          new_seqs += [v[..., start:end]]
  
      return new_seqs
  
imports: import sys
  import copy
  import random
  import pathlib
  from hyperpyyaml import load_hyperpyyaml
  import speechbrain
  from speechbrain.utils.data_utils import scalarize
  import torch
  import torchaudio
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: sample_interval(seqs, segment_size) and returns: new_seqs