code: def clean_trans(trans: str) -> str:
      trans = trans.split("\x15")[0]  # remove timestamp
      trans = trans.lower()
  
      # Precodes and postcodes
      trans = re.sub(r"\[[+-] \w+]?", "", trans)
  
      # Word errors
      # '[: put] [* p:w-ret]' '[: princess]'
      trans = re.sub(r"\[: .+?] \[\* \S+]", "", trans)
      trans = re.sub(r"\[: .+?]", "", trans)  # [: x [* n:uk]
      trans = re.sub(r"\[\* .+?]", "", trans)  # [* s:r-ret]
      trans = re.sub(r"\[\*]", "", trans)  # [*]
  
      # Interruption by other people
      trans = re.sub(r"\*\w+:[\w_]+", "", trans)  # *INV: thank_you
  
      # Comments, explanation, paralinguistic
      trans = re.sub(
          r"\[% .+?]", "", trans
      )  # [% mimics opening her eyes for the first time]
      trans = re.sub(r"\[= .+?]", "", trans)  # [= growling voice]
      trans = re.sub(r"\[=! [\w :_]+?]", "", trans)  # [=! laughing]
  
      # Retracing and repetition
      trans = re.sub(r"\[/+]", "", trans)
      # we shouldn't remove this but there is only one occurrence in UNH03b
      trans = re.sub(r"\[x \d]", "", trans)
  
      # Pauses
      trans = re.sub(r"\([\d:.]+\)", "", trans)  # (.) (..) (2:13.12)
  
      # Special utterance terminators
      trans = re.sub(
          r"\+[<+\",./?]+", "", trans
      )  # +... +..? +/. +/? +//. +//? +, ++ +"/. +" +". +<
  
      # Overlap precedes
      trans = re.sub(r"\[[<>]\d?]", "", trans)  # [<]   [<1]  [>]  [>2]
  
      # Special form markers (CHAT manual page 45)
      trans = re.sub(r"@\S+", "", trans)
  
      # Local events and gestures
      trans = re.sub(
          r"[<>]", "", trans
      )  # remove all <> before adding <xxx>
      # laughter
      trans = re.sub(r"&=laughs", "<LAU>", trans)
      trans = re.sub(r"&=chuckles", "<LAU>", trans)
      # '&=points:picture_1'  '&=clears:throat'  '&=twiddles'
      trans = re.sub(r"&=\w*[:\w]*", "", trans)
  
      # Fillers and fragments
      trans = re.sub(r"&-", "", trans)  # &-uh  &-um
      trans = re.sub(r"&\+?", "", trans)  # phonological fragment
  
      # Special words
      trans = re.sub(r"www|xxx", "", trans)
  
      # Other remaining punctuations
      trans = re.sub(r"[,?!;:\"“%‘”.�‡„$^↓↑≠()\[\]↫\x15+]", "", trans)
      # '_', '-', and multiple whitespaces are replaced with a single whitespace
      trans = re.sub(r"_|-| {2,}", " ", trans)
  
      return trans.strip()
  
imports: import os
  import re
  from argparse import ArgumentParser
  import pylangacq
  from data import get_utt, lang2lang_id, spk2aphasia_label
label_desc: Use image node_id 2 for calling a global function with example usage: clean_trans(trans) and returns: trans