code: def build_combined_spanish_dataset(paths, model_type, dataset):
      """
      es_combined is AnCora and GSD put together
  
      TODO: remove features which aren't shared between datasets
      TODO: consider mixing in PUD?
      """
      udbase_dir = paths["UDBASE"]
      tokenizer_dir = paths["TOKENIZE_DATA_DIR"]
      handparsed_dir = paths["HANDPARSED_DIR"]
      if dataset == "train":
          treebanks = ["UD_Spanish-AnCora", "UD_Spanish-GSD"]
          sents = []
          for treebank in treebanks:
              conllu_file = common.find_treebank_dataset_file(
                  treebank, udbase_dir, dataset, "conllu", fail=True
              )
              new_sents = read_sentences_from_conllu(conllu_file)
              if treebank.endswith("GSD"):
                  new_sents = replace_semicolons(new_sents)
              sents.extend(new_sents)
  
          extra_spanish = os.path.join(
              handparsed_dir, "spanish-mwt", "spanish.mwt"
          )
          if not os.path.exists(extra_spanish):
              raise FileNotFoundError(
                  "Cannot find the extra dataset 'spanish.mwt' which includes various multi-words retokenized, expected {}".format(
                      extra_italian
                  )
              )
          extra_sents = read_sentences_from_conllu(extra_spanish)
          sents.extend(extra_sents)
      else:
          conllu_file = common.find_treebank_dataset_file(
              "UD_Spanish-AnCora",
              udbase_dir,
              dataset,
              "conllu",
              fail=True,
          )
          sents = read_sentences_from_conllu(conllu_file)
  
      return sents
  
imports: import argparse
  import glob
  import os
  import random
  import re
  import tempfile
  from collections import Counter
  from stanza.models.common.constant import treebank_to_short_name
  import stanza.utils.datasets.common
  from stanza.utils.datasets.common import read_sentences_from_conllu, write_sentences_to_conllu, INT_RE, MWT_RE, MWT_OR_COPY_RE
  import stanza.utils.datasets.tokenization.convert_ml_cochin
  import stanza.utils.datasets.tokenization.convert_my_alt
  import stanza.utils.datasets.tokenization.convert_vi_vlsp
  import stanza.utils.datasets.tokenization.convert_th_best
  import stanza.utils.datasets.tokenization.convert_th_lst20
  import stanza.utils.datasets.tokenization.convert_th_orchid
label_desc: Use image node_id 30 for calling a global function with example usage: build_combined_spanish_dataset(paths, model_type, dataset) and returns: sents