code: def get_mwt(*dep_datasets):
      """
      Get the ADP/DET MWTs from the UD dataset
  
      This class of MWT are expanded in the UD but not the constituencies
      """
      mwt_map = {}
      for dataset in dep_datasets:
          for sentence in dataset.sentences:
              for token in sentence.tokens:
                  if len(token.words) == 1:
                      continue
                  # words such as "accorgermene" we just skip over
                  # those are already expanded in the constituency dataset
                  # TODO: the clitics are actually expanded weirdly, maybe need to compensate for that
                  if token.words[0].upos in ("VERB", "AUX") and all(
                      word.upos == "PRON" for word in token.words[1:]
                  ):
                      continue
                  if token.text.lower() in EXCEPTIONS:
                      continue
                  if (
                      len(token.words) != 2
                      or token.words[0].upos != "ADP"
                      or token.words[1].upos != "DET"
                  ):
                      raise ValueError(
                          "Not sure how to handle this: {}".format(
                              token
                          )
                      )
                  expansion = (token.words[0].text, token.words[1].text)
                  if token.text in mwt_map:
                      if mwt_map[token.text] != expansion:
                          raise ValueError(
                              "Inconsistent MWT: {} -> {} or {}".format(
                                  token.text,
                                  expansion,
                                  mwt_map[token.text],
                              )
                          )
                      continue
                  # print("Expanding {} to {}".format(token.text, expansion))
                  mwt_map[token.text] = expansion
      return mwt_map
  
imports: from collections import defaultdict, deque, namedtuple
  import itertools
  import os
  import re
  import sys
  from tqdm import tqdm
  from stanza.models.constituency.tree_reader import read_trees, UnclosedTreeError, ExtraCloseTreeError
  from stanza.server import tsurgeon
  from stanza.utils.conll import CoNLL
  from stanza.utils.datasets.constituency.utils import SHARDS, write_dataset
  import stanza.utils.default_paths
label_desc: Use image node_id 8 for calling a global function with example usage: get_mwt() and returns: mwt_map