code: def collect_stats(data_dir: Path):
      stats = defaultdict(float)
      src_langs = []
      with open(data_dir / "text", "r") as fp:
          for line in fp:
              line = line.strip().split(maxsplit=1)[-1]
              duration = float(line.split("<")[-1][:-1])
              src = line.split(">")[0][1:]
              tgt = line.split("><")[1].split("_")[-1]
              if tgt == "asr":
                  tgt = src
              stats[(src, tgt)] += duration
              if src not in src_langs:
                  src_langs.append(src)
      return stats, sorted(src_langs)
  
imports: from argparse import ArgumentParser
  from collections import defaultdict
  from pathlib import Path
label_desc: Use image node_id 1 for calling a global function with example usage: collect_stats(data_dir) and returns: stats,  sorted