code: def get_flair_corpus(data_args):
      ner_task_mapping = {}
  
      for name, obj in inspect.getmembers(
          flair.datasets.sequence_labeling
      ):
          if inspect.isclass(obj) and name.startswith(
              ("NER", "CONLL", "WNUT")
          ):
              ner_task_mapping[name] = obj
  
      dataset_args = {}
      dataset_name = data_args.dataset_name
  
      if data_args.dataset_arguments:
          dataset_args = json.loads(data_args.dataset_arguments)
  
      if dataset_name not in ner_task_mapping:
          raise ValueError(
              f"Dataset name {dataset_name} is not a valid Flair datasets name!"
          )
  
      return ner_task_mapping[dataset_name](**dataset_args)
  
file_path: flair/examples/ner/run_ner.py
imports: import inspect
  import json
  import logging
  import os
  import sys
  from dataclasses import dataclass, field
  import torch
  from transformers import HfArgumentParser
  import flair
  from flair import set_seed
  from flair.embeddings import TransformerWordEmbeddings
  from flair.models import SequenceTagger
  from flair.trainers import ModelTrainer
label_desc: Use image node_id 1 for calling a global function with example usage: get_flair_corpus(data_args) and returns: ner_task_mapping