code: def _add_extra_metadata_features(task_type, feature_metadata):
      """Add extra metadata features for the given task type.
  
      For question answering task, adds the question type feature.
  
      :param task_type: The task type.
      :type task_type: str
      :param feature_metadata: The feature metadata.
      :type feature_metadata: FeatureMetadata
      :return: The feature metadata with extra metadata features added.
      :rtype: FeatureMetadata
      """
      is_qa = task_type == ModelTask.QUESTION_ANSWERING
      categorical_features = feature_metadata.categorical_features
      is_cat_empty = categorical_features is None
      if is_qa and (
          is_cat_empty or _QUESTION_TYPE not in categorical_features
      ):
          feature_metadata = _feature_metadata_from_dict(
              feature_metadata.to_dict().copy()
          )
          if is_cat_empty:
              feature_metadata.categorical_features = []
          feature_metadata.categorical_features.append(_QUESTION_TYPE)
      return feature_metadata
  
imports: import json
  import logging
  import pickle
  import warnings
  from enum import Enum
  from pathlib import Path
  from typing import Any, List, Optional, Union
  import numpy
  import pandas
  from ml_wrappers import wrap_model
  from erroranalysis._internal.cohort_filter import FilterDataWithCohortFilters
  from raiutils.data_processing import convert_to_list, serialize_json_safe
  from raiutils.models import SKLearn, is_classifier
  from responsibleai._interfaces import Dataset, RAIInsightsData
  from responsibleai._internal.constants import ManagerNames, Metadata, SerializationAttributes
  from responsibleai.exceptions import UserConfigValidationException
  from responsibleai.feature_metadata import FeatureMetadata
  from responsibleai.rai_insights.rai_base_insights import RAIBaseInsights
  from responsibleai_text.common.constants import ModelTask
  from responsibleai_text.managers.error_analysis_manager import ErrorAnalysisManager
  from responsibleai_text.managers.explainer_manager import ExplainerManager
  from responsibleai_text.utils.feature_extractors import extract_features, get_text_columns
label_desc: Use image node_id 2 for calling a global function with example usage: _add_extra_metadata_features(task_type, feature_metadata) and returns: feature_metadata