code: def comp_avg_seg_dur(labs_list):
      n_frms = 0
      n_segs = 0
      for labs in labs_list:
          labs = np.array(labs)
          edges = np.zeros(len(labs)).astype(bool)
          edges[0] = True
          edges[1:] = labs[1:] != labs[:-1]
          n_frms += len(edges)
          n_segs += edges.astype(int).sum()
      return n_frms / n_segs
  
file_path: espnet/egs2/librispeech_100/asr2/pyscripts/feats/measure_teacher_quality.py
imports: import argparse
  import re
  from collections import Counter
  import numpy
  from tabulate import tabulate
  from espnet2.utils.types import str2bool
label_desc: Use image node_id 6 for calling a global function with example usage: comp_avg_seg_dur(labs_list) and returns: unknown