code: def get_pending_observation_features_based_on_trial_status(
      experiment: Experiment,
      include_out_of_design_points: bool = False,
  ) -> Optional[Dict[str, List[ObservationFeatures]]]:
      """A faster analogue of ``get_pending_observation_features`` that makes
      assumptions about trials in experiment in order to speed up extraction
      of pending points.
  
      Assumptions:
  
      * All arms in all trials in ``STAGED,`` ``RUNNING`` and ``ABANDONED`` statuses
        are to be considered pending for all outcomes.
      * All arms in all trials in other statuses are to be considered not pending for
        all outcomes.
  
      This entails:
  
      * No actual data-fetching for trials to determine whether arms in them are pending
        for specific outcomes.
      * Even if data is present for some outcomes in ``RUNNING`` trials, their arms will
        still be considered pending for those outcomes.
  
      NOTE: This function should not be used to extract pending features in field
      experiments, where arms in running trials should not be considered pending if
      there is data for those arms.
  
      Args:
          experiment: Experiment, pending features on which we seek to compute.
  
      Returns:
          An optional mapping from metric names to a list of observation features,
          pending for that metric (i.e. do not have evaluation data for that metric).
          If there are no pending features for any of the metrics, return is None.
      """
      pending_features = defaultdict(list)
      for status in [
          TrialStatus.STAGED,
          TrialStatus.RUNNING,
          TrialStatus.ABANDONED,
      ]:
          for trial in experiment.trials_by_status[status]:
              for metric_name in experiment.metrics:
                  for arm in trial.arms:
                      if (
                          not include_out_of_design_points
                          and not experiment.search_space.check_membership(
                              arm.parameters
                          )
                      ):
                          continue
                      pending_features[metric_name].append(
                          ObservationFeatures.from_arm(
                              arm=arm,
                              trial_index=trial.index,
                              metadata=trial._get_candidate_metadata(
                                  arm_name=arm.name
                              ),
                          )
                      )
      return (
          dict(pending_features)
          if any(x for x in pending_features.values())
          else None
      )
  
imports: from collections import defaultdict
  from typing import Dict, Iterable, List, NamedTuple, Optional, Set, Tuple
  import numpy
  from ax.core.arm import Arm
  from ax.core.base_trial import BaseTrial, TrialStatus
  from ax.core.batch_trial import BatchTrial
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.generator_run import GeneratorRun
  from ax.core.objective import MultiObjective
  from ax.core.observation import ObservationFeatures
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.trial import Trial
  from ax.core.types import ComparisonOp
  from ax.utils.common.typeutils import not_none
  from pyre_extensions import none_throws
label_desc: Use image node_id 10 for calling a global function with example usage: get_pending_observation_features_based_on_trial_status(experiment, include_out_of_design_points) and returns: unknown