code: def binarize_(
      bpe_dir,
      databin_dir,
      direction,
      spm_vocab=SPM_VOCAB,
      splits=["train", "test", "valid"],
  ):
      src, tgt = direction.split("-")
  
      try:
          shutil.rmtree(f"{databin_dir}", ignore_errors=True)
          os.mkdir(f"{databin_dir}")
      except OSError as error:
          print(error)
      cmds = [
          "fairseq-preprocess",
          f"--source-lang {src} --target-lang {tgt}",
          f"--destdir {databin_dir}/",
          f"--workers 8",
      ]
      if isinstance(spm_vocab, tuple):
          src_vocab, tgt_vocab = spm_vocab
          cmds.extend(
              [
                  f"--srcdict {src_vocab}",
                  f"--tgtdict {tgt_vocab}",
              ]
          )
      else:
          cmds.extend(
              [
                  f"--joined-dictionary",
                  f"--srcdict {spm_vocab}",
              ]
          )
      input_options = []
      if "train" in splits and glob.glob(f"{bpe_dir}/train.bpe*"):
          input_options.append(
              f"--trainpref {bpe_dir}/train.bpe",
          )
      if "valid" in splits and glob.glob(f"{bpe_dir}/valid.bpe*"):
          input_options.append(f"--validpref {bpe_dir}/valid.bpe")
      if "test" in splits and glob.glob(f"{bpe_dir}/test.bpe*"):
          input_options.append(f"--testpref {bpe_dir}/test.bpe")
      if len(input_options) > 0:
          cmd = " ".join(cmds + input_options)
          print(cmd)
          call(cmd)
  
file_path: fairseq/examples/multilingual/data_scripts/binarize.py
imports: import shutil
  import os, sys
  from subprocess import check_call, check_output
  import glob
  import argparse
  import shutil
  import pathlib
  import itertools
label_desc: Use image node_id 5 for calling a global function with example usage: binarize_(bpe_dir, databin_dir, direction, spm_vocab, splits) without return types