code: def convert_conllu_to_txt(
      tokenizer_dir, short_name, shards=("train", "dev", "test")
  ):
      """
      Uses the udtools perl script to convert a conllu file to txt
  
      TODO: switch to a python version to get rid of some perl dependence
      """
      for dataset in shards:
          output_conllu = (
              f"{tokenizer_dir}/{short_name}.{dataset}.gold.conllu"
          )
          output_txt = f"{tokenizer_dir}/{short_name}.{dataset}.txt"
  
          if not os.path.exists(output_conllu):
              # the perl script doesn't raise an error code for file not found!
              raise FileNotFoundError(
                  "Cannot convert %s as the file cannot be found"
                  % output_conllu
              )
          # use an external script to produce the txt files
          subprocess.check_output(
              f"perl {CONLLU_TO_TXT_PERL} {output_conllu} > {output_txt}",
              shell=True,
          )
  
imports: import argparse
  from enum import Enum
  import glob
  import logging
  import os
  import re
  import subprocess
  import sys
  from stanza.models.common.short_name_to_treebank import canonical_treebank_name
  import stanza.utils.datasets.prepare_tokenizer_data
  import stanza.utils.default_paths
label_desc: Use image node_id 1 for calling a global function with example usage: convert_conllu_to_txt(tokenizer_dir, short_name, shards) without return types