code: def parse_paracrawl_tmx(
      path_or_buffer,
      src_lang,
      tgt_lang,
      out_src_path,
      out_tgt_path,
      clean_space=True,
      filter_profanity=False,
  ):
      candidate_lang = {src_lang, tgt_lang}
      sent_num = 0
      if filter_profanity:
          src_profanity_filter = ProfanityFilter(langs=[src_lang])
          tgt_profanity_filter = ProfanityFilter(langs=[tgt_lang])
      has_src = False
      has_tgt = False
      src_sentence = None
      tgt_sentence = None
      f = _get_buffer(path_or_buffer)
      src_out_f = open(out_src_path, "w", encoding="utf-8")
      tgt_out_f = open(out_tgt_path, "w", encoding="utf-8")
      for i, (_, elem) in enumerate(ElementTree.iterparse(f)):
          if elem.tag == "tu":
              for tuv in elem.iterfind("tuv"):
                  lang = None
                  for k, v in tuv.items():
                      if k.endswith("}lang"):
                          assert v in candidate_lang, (
                              "Find language={} in data, which is not the same as either"
                              " the source/target languages={}/{}".format(
                                  v, src_lang, tgt_lang
                              )
                          )
                          lang = v
                          break
                  if lang is not None:
                      segs = tuv.findall("seg")
                      assert (
                          len(segs) == 1
                      ), "Invalid number of segments: {}".format(
                          len(segs)
                      )
                      if lang == src_lang:
                          assert not has_src
                          has_src = True
                          src_sentence = segs[0].text
                      else:
                          assert not has_tgt
                          has_tgt = True
                          tgt_sentence = segs[0].text
                      if has_src and has_tgt:
                          has_src, has_tgt = False, False
                          if clean_space:
                              # Merge the spaces
                              src_sentence = _clean_space(src_sentence)
                              tgt_sentence = _clean_space(tgt_sentence)
                          if filter_profanity:
                              if src_profanity_filter.match(
                                  src_sentence
                              ) or tgt_profanity_filter.match(
                                  tgt_sentence
                              ):
                                  continue
                          sent_num += 1
                          if sent_num % 500000 == 0:
                              print(
                                  "Processed {} sentences".format(
                                      sent_num
                                  )
                              )
                          src_out_f.write(src_sentence + "\n")
                          tgt_out_f.write(tgt_sentence + "\n")
              elem.clear()
      src_out_f.close()
      tgt_out_f.close()
      assert (
          has_src or has_tgt
      ), "The number of source and target sentences are not the same."
  
imports: from typing import List, Union, IO, AnyStr, Tuple, Optional
  import re
  import os
  import argparse
  import zipfile
  import shutil
  import functools
  import tarfile
  import gzip
  import json
  from xml.etree import ElementTree
  from gluonnlp.data.filtering import ProfanityFilter
  from gluonnlp.utils.misc import file_line_number, download, load_checksum_stats
  from gluonnlp.base import get_data_home_dir, get_repo_url
label_desc: Use image node_id 5 for calling a global function with example usage: parse_paracrawl_tmx(path_or_buffer, src_lang, tgt_lang, out_src_path, out_tgt_path, clean_space, filter_profanity) without return types