code: def split_maxlen(utt_group, min_len=10):
      # merge if
      out = []
      stack = []
      for utt in utt_group:
          if not stack or (utt.end - stack[0].start) < min_len:
              stack.append(utt)
              continue
  
          out.append(Segment(stack[0].start, stack[-1].end))
          stack = [utt]
  
      if len(stack):
          out.append(Segment(stack[0].start, stack[-1].end))
  
      return out
  
imports: import argparse
  import glob
  import json
  import math
  import os.path
  import re
  from pathlib import Path
  import numpy
  import soundfile
  import torch
  from pyannote.audio import Model, Pipeline
  from pyannote.audio.core.inference import Inference
  from pyannote.audio.pipelines import SpeakerDiarization
  from pyannote.audio.utils.signal import Binarize, binarize
  from pyannote.core import SlidingWindowFeature
  from pyannote.metrics.segmentation import Annotation, Segment
  from scipy.signal import medfilt2d
label_desc: Use image node_id 1 for calling a global function with example usage: split_maxlen(utt_group, min_len) and returns: out