code: def remove_ignored_labels(docs, ignored):
      if not ignored:
          return docs
  
      ignored = set(ignored.split(","))
      # drop all labels which match something in ignored
      # otherwise leave everything the same
      new_docs = [
          (doc[0], [x for x in doc[1] if x["label"] not in ignored])
          for doc in docs
      ]
      return new_docs
  
file_path: stanza/stanza/utils/datasets/ner/convert_amt.py
imports: import argparse
  import copy
  import json
  from operator import itemgetter
  import sys
  from tqdm import tqdm
  import stanza
  from stanza.utils.datasets.ner.utils import write_sentences
  import stanza.utils.datasets.ner.prepare_ner_file
label_desc: Use image node_id 2 for calling a global function with example usage: remove_ignored_labels(docs, ignored) and returns: new_docs, docs