code: def test_get_pending_observation_features_based_on_trial_status(
      self,
  ) -> None:
      # Pending observations should be none if there aren't any as trial is
      # candidate.
      self.assertTrue(self.trial.status.is_candidate)
      self.assertIsNone(get_pending_status(self.experiment))
      self.trial.mark_staged()
      # Now that the trial is staged, it should become a pending trial on the
      # experiment and appear as pending for all metrics.
      self.assertEqual(
          get_pending_status(self.experiment),
          {
              "tracking": [self.obs_feat],
              "m2": [self.obs_feat],
              "m1": [self.obs_feat],
          },
      )
      # Same should be true for running trial.
      # NOTE: Can't mark a staged trial running unless it uses a runner that
      # specifically requires staging; hacking around that here since the marking
      # logic does not matter for this test.
      self.trial._status = TrialStatus.RUNNING
      # Now that the trial is staged, it should become a pending trial on the
      # experiment and appear as pending for all metrics.
      self.assertEqual(
          get_pending_status(self.experiment),
          {
              "tracking": [self.obs_feat],
              "m2": [self.obs_feat],
              "m1": [self.obs_feat],
          },
      )
      # When a trial is marked failed, it should no longer appear in pending.
      self.trial.mark_failed()
      self.assertIsNone(get_pending_status(self.experiment))
      # And if the trial is abandoned, it should always appear in pending features.
      self.trial._status = (
          TrialStatus.ABANDONED
      )  # Cannot re-mark a failed trial.
      self.assertEqual(
          get_pending_status(self.experiment),
          {
              "tracking": [self.obs_feat],
              "m2": [self.obs_feat],
              "m1": [self.obs_feat],
          },
      )
  
imports: from copy import deepcopy
  from unittest.mock import patch
  import numpy
  import pandas
  from ax.core.arm import Arm
  from ax.core.base_trial import TrialStatus
  from ax.core.data import Data
  from ax.core.generator_run import GeneratorRun
  from ax.core.metric import Metric
  from ax.core.objective import Objective
  from ax.core.observation import ObservationFeatures
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.outcome_constraint import OutcomeConstraint
  from ax.core.types import ComparisonOp
  from ax.core.utils import best_feasible_objective, extract_pending_observations, get_missing_metrics, get_missing_metrics_by_name, get_model_times, get_model_trace_of_times, get_pending_observation_features, get_pending_observation_features_based_on_trial_status, MissingMetrics
  from ax.utils.common.constants import Keys
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_experiment, get_hierarchical_search_space_experiment, get_robust_branin_experiment
  from pyre_extensions import none_throws
label_desc: Use image node_id 9 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_get_pending_observation_features_based_on_trial_status() without return types