code: def test_percentile_early_stopping_strategy_validation(self) -> None:
      exp = get_branin_experiment()
  
      for i in range(5):
          trial = exp.new_trial().add_arm(
              arm=get_branin_arms(n=1, seed=i)[0]
          )
          trial.run()
          trial.mark_as(status=TrialStatus.COMPLETED)
  
      early_stopping_strategy = PercentileEarlyStoppingStrategy()
      idcs = set(exp.trials.keys())
      exp.attach_data(data=exp.fetch_data())
  
      # Non-MapData attached
      should_stop = early_stopping_strategy.should_stop_trials_early(
          trial_indices=idcs, experiment=exp
      )
      self.assertEqual(should_stop, {})
  
      exp = get_branin_experiment_with_timestamp_map_metric(rate=0.5)
      for i in range(5):
          trial = exp.new_trial().add_arm(
              arm=get_branin_arms(n=1, seed=i)[0]
          )
          trial.run()
  
      # No data attached
      should_stop = early_stopping_strategy.should_stop_trials_early(
          trial_indices=idcs, experiment=exp
      )
      self.assertEqual(should_stop, {})
  
      exp.attach_data(data=exp.fetch_data())
  
      # Not enough learning curves
      early_stopping_strategy = PercentileEarlyStoppingStrategy(
          min_curves=6,
      )
      should_stop = early_stopping_strategy.should_stop_trials_early(
          trial_indices=idcs, experiment=exp
      )
      self.assertEqual(should_stop, {})
  
      # Most recent progression below minimum
      early_stopping_strategy = PercentileEarlyStoppingStrategy(
          min_progression=3,
      )
      should_stop = early_stopping_strategy.should_stop_trials_early(
          trial_indices=idcs, experiment=exp
      )
      self.assertEqual(should_stop, {})
  
      # True objective metric name
      self.assertIsNone(
          early_stopping_strategy.true_objective_metric_name
      )  # default none
      early_stopping_strategy.true_objective_metric_name = (
          "true_obj_metric"
      )
      self.assertEqual(
          early_stopping_strategy.true_objective_metric_name,
          "true_obj_metric",
      )
  
imports: from typing import Any, Dict, Optional, Set
  import numpy
  import pandas
  from ax.core.base_trial import TrialStatus
  from ax.core.experiment import Experiment
  from ax.core.map_data import MapData
  from ax.early_stopping.strategies import BaseEarlyStoppingStrategy, ModelBasedEarlyStoppingStrategy, PercentileEarlyStoppingStrategy, ThresholdEarlyStoppingStrategy
  from ax.early_stopping.strategies.logical import AndEarlyStoppingStrategy, OrEarlyStoppingStrategy
  from ax.early_stopping.utils import align_partial_results
  from ax.exceptions.core import UnsupportedError
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import checked_cast
  from ax.utils.testing.core_stubs import get_branin_arms, get_branin_experiment, get_branin_experiment_with_timestamp_map_metric, get_experiment_with_multi_objective, get_test_map_data_experiment
  from pyre_extensions import none_throws
label_desc: Use image node_id 1 for calling the TestPercentileEarlyStoppingStrategy obj's underlying member method code with example usage: obj.test_percentile_early_stopping_strategy_validation() without return types