code: def choose_charlm(
      language, dataset, charlm, language_charlms, dataset_charlms
  ):
      """
      charlm == "default" means the default charlm for this dataset or language
      charlm == None is no charlm
      """
      default_charlm = language_charlms.get(language, None)
      specific_charlm = dataset_charlms.get(language, {}).get(
          dataset, None
      )
  
      if charlm is None:
          return None
      elif charlm != "default":
          return charlm
      elif dataset in dataset_charlms.get(language, {}):
          # this way, a "" or None result gets honored
          # thus treating "not in the map" as a way for dataset_charlms to signal to use the default
          return specific_charlm
      elif default_charlm:
          return default_charlm
      else:
          return None
  
imports: import argparse
  import glob
  import logging
  import os
  import pathlib
  import sys
  import tempfile
  from enum import Enum
  from stanza.resources.default_packages import default_charlms, lemma_charlms, pos_charlms, depparse_charlms, TRANSFORMERS, TRANSFORMER_LAYERS
  from stanza.models.common.constant import treebank_to_short_name
  from stanza.models.common.utils import ud_scores
  from stanza.resources.common import download, DEFAULT_MODEL_DIR, UnknownLanguageError
  from stanza.utils.datasets import common
  import stanza.utils.default_paths
  from stanza.utils import conll18_ud_eval
label_desc: Use image node_id 12 for calling a global function with example usage: choose_charlm(language, dataset, charlm, language_charlms, dataset_charlms) and returns: None, charlm, specific_charlm, default_charlm, None