code: def concat_files(
      split,
      src,
      tgt,
      extracted_folders,
      split_urls,
      path_patterns,
      to_folder,
      debug=False,
  ):
      #     if debug:
      #         print('extracted files to be filtered by patterns: ',
      #               '\n\t'.join(sorted(all_extracted_files(split, src, tgt, extracted_folders, split_urls))))
      for lang in [src, tgt]:
          to_file = f"{to_folder}/{split}.{src}-{tgt}.{lang}"
          s_src, s_tgt, s_lang = (
              src.split("_")[0],
              tgt.split("_")[0],
              lang.split("_")[0],
          )
          files = []
          for url in split_urls:
              if isinstance(url, tuple):
                  url, downloaded_file = url
              if str(url) not in extracted_folders:
                  print(f"warning: {url} not in extracted files")
              for extracted_file in set(
                  extracted_glob(
                      extracted_folders[str(url)],
                      path_patterns,
                      s_src,
                      s_tgt,
                      s_lang,
                  )
              ):
                  files.append(extracted_file)
          if len(files) == 0:
              print("warning: ", f"No files found for split {to_file}")
              continue
          files = sorted(set(files))
          print(f"concating {len(files)} files into {to_file}")
          cmd = ["cat"] + [f'"{f}"' for f in files] + [f">{to_file}"]
          cmd = " ".join(cmd)
          call(cmd, debug=debug)
  
imports: from typing import NamedTuple, List
  from urllib.parse import urlparse
  import os, sys
  import subprocess
  from subprocess import check_call, check_output
  import glob
  import wget
  import re
  import multiprocessing
  from functools import partial
  import pathlib
  from collections import OrderedDict
label_desc: Use image node_id 23 for calling a global function with example usage: concat_files(split, src, tgt, extracted_folders, split_urls, path_patterns, to_folder, debug) without return types