code: def read_operations(operations_file):
      """
      Read operations from an operations file.
      Example operation format:
          - "copy\t{src_file} {tgt_file}" or "link\t{src_file} {tgt_file}"
          - "segment\t{src_file} (start,end) {tgt_file}" or "segment\t{src_file} (start,end,channelid) {tgt_file}"
      """
  
      operation_list = []
      src_root_dir = Path("")
      tgt_root_dir = Path("")
      with open(operations_file) as f:
          c = 0
          for line in f:
              if not line or line[0] == "#":
                  continue
              c += 1
              if line.startswith("src_root_dir:"):
                  assert (
                      c == 1
                  ), "expected src_root_dir in the first line"
                  src_root_dir = Path(line.split()[1])
                  continue
              elif line.startswith("tgt_root_dir:"):
                  assert (
                      c == 2
                  ), "expected tgt_root_dir in the second line"
                  tgt_root_dir = Path(line.split()[1])
                  continue
              op, items = line.strip().split("\t")
  
              assert (
                  op in OPERATIONS_LIST
              ), "expected operation in list: {OPERATIONS_LIST}, found '{op}'"
  
              if op == "segment":
                  src_file, seg, tgt_file = items.split()
                  src_file = src_root_dir / src_file
                  tgt_file = tgt_root_dir / tgt_file
                  operation_list.append((op, (src_file, seg, tgt_file)))
              else:
                  src_file, tgt_file = items.split()
                  src_file = src_root_dir / src_file
                  tgt_file = tgt_root_dir / tgt_file
                  operation_list.append((op, (src_file, tgt_file)))
  
      print(
          f"Read {len(operation_list)} operations from {operations_file}"
      )
  
      return operation_list
  
file_path: textlesslib/examples/expresso/dataset/processing/perform_operations.py
imports: import os
  import shutil
  from pathlib import Path
  from collections import defaultdict
  import scipy.io.wavfile
  from multiprocessing import Pool
  from tqdm import tqdm
  from time import time
label_desc: Use image node_id 1 for calling a global function with example usage: read_operations(operations_file) and returns: operation_list