code: def get_ud_treebanks(udbase_dir, filtered=True):
      """
      Looks in udbase_dir for all the treebanks which have both train, dev, and test
      """
      treebanks = sorted(glob.glob(udbase_dir + "/UD_*"))
      # skip UD_English-GUMReddit as it is usually incorporated into UD_English-GUM
      treebanks = [os.path.split(t)[1] for t in treebanks]
      treebanks = [t for t in treebanks if t != "UD_English-GUMReddit"]
      if filtered:
          treebanks = [
              t
              for t in treebanks
              if (
                  find_treebank_dataset_file(
                      t, udbase_dir, "train", "conllu"
                  )
                  and
                  # this will be fixed using XV
                  # find_treebank_dataset_file(t, udbase_dir, "dev", "conllu") and
                  find_treebank_dataset_file(
                      t, udbase_dir, "test", "conllu"
                  )
              )
          ]
          treebanks = [
              t
              for t in treebanks
              if not mostly_underscores(
                  find_treebank_dataset_file(
                      t, udbase_dir, "train", "conllu"
                  )
              )
          ]
          # eliminate partial treebanks (fixed with XV) for which we only have 1000 words or less
          # if the train set is small and the test set is large enough, we'll flip them
          treebanks = [
              t
              for t in treebanks
              if (
                  find_treebank_dataset_file(
                      t, udbase_dir, "dev", "conllu"
                  )
                  or num_words_in_file(
                      find_treebank_dataset_file(
                          t, udbase_dir, "train", "conllu"
                      )
                  )
                  > 1000
                  or num_words_in_file(
                      find_treebank_dataset_file(
                          t, udbase_dir, "test", "conllu"
                      )
                  )
                  > 5000
              )
          ]
      return treebanks
  
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 12 for calling a global function with example usage: get_ud_treebanks(udbase_dir, filtered) and returns: treebanks