code: def get_squad_features(args, tokenizer, segment):
      """
      Get processed data features of SQuADExampls
  
      Parameters
      ----------
      args : argparse.Namespace
      tokenizer:
          Tokenizer instance
      segment: str
          train or dev
  
      Returns
      -------
      data_features
          The list of processed data features
      """
      data_cache_path = os.path.join(
          CACHE_PATH,
          "{}_{}_squad_{}.ndjson".format(
              segment, args.model_name, args.version
          ),
      )
      is_training = segment == "train"
      if os.path.exists(data_cache_path) and not args.overwrite_cache:
          data_features = []
          with open(data_cache_path, "r") as f:
              for line in f:
                  data_features.append(SquadFeature.from_json(line))
          logging.info(
              "Found cached data features, load from {}".format(
                  data_cache_path
              )
          )
      else:
          data_examples = get_squad_examples(
              args.data_dir, segment=segment, version=args.version
          )
          start = time.time()
          num_process = min(cpu_count(), 8)
          logging.info("Tokenize Data:")
          with Pool(num_process) as pool:
              data_features = pool.map(
                  functools.partial(
                      convert_squad_example_to_feature,
                      tokenizer=tokenizer,
                      is_training=is_training,
                  ),
                  data_examples,
              )
          logging.info(
              "Done! Time spent:{:.2f} seconds".format(
                  time.time() - start
              )
          )
          with open(data_cache_path, "w", encoding="utf-8") as f:
              for feature in data_features:
                  f.write(feature.to_json() + "\n")
  
      return data_features
  
imports: import os
  import json
  import time
  import logging
  import argparse
  import ast
  import functools
  import collections
  import dataclasses
  from dataclasses import dataclass
  from multiprocessing import Pool, cpu_count
  import mxnet
  import numpy
  from mxnet.lr_scheduler import PolyScheduler
  import gluonnlp.data.batchify
  from models import ModelForQABasic, ModelForQAConditionalV1
  from eval_utils import squad_eval
  from squad_utils import SquadFeature, get_squad_examples, convert_squad_example_to_feature
  from gluonnlp.models import get_backbone
  from gluonnlp.utils.misc import repeat, grouper, set_seed, init_comm, logging_config, parse_ctx
  from gluonnlp.initializer import TruncNorm
  from gluonnlp.data.sampler import SplitSampler
  from gluonnlp.utils.parameter import grad_global_norm, clip_grad_global_norm, count_parameters, deduplicate_param_dict
label_desc: Use image node_id 2 for calling a global function with example usage: get_squad_features(args, tokenizer, segment) and returns: data_features