class_docstr: GenerationStrategy describes which model should be used to generate new
  points for which trials, enabling and automating use of different models
  throughout the optimization process. For instance, it allows to use one
  model for the initialization trials, and another one for all subsequent
  trials. In the general case, this allows to automate use of an arbitrary
  number of models to generate an arbitrary numbers of trials
  described in the `trials_per_model` argument.
  
  Args:
      nodes: A list of `GenerationNode`. Each `GenerationNode` in the list
          represents a single node in a `GenerationStrategy` which, when
          composed of `GenerationNodes`, can be conceptualized as a graph instead
          of a linear list. `TransitionCriterion` defined in each `GenerationNode`
          represent the edges in the `GenerationStrategy` graph. `GenerationNodes`
          are more flexible than `GenerationSteps` and new `GenerationStrategies`
          should use nodes. Notably, either, but not both, of `nodes` and `steps`
          must be provided.
      steps: A list of `GenerationStep` describing steps of this strategy.
      name: An optional name for this generaiton strategy. If not specified,
          strategy's name will be names of its nodes' models joined with '+'.
docstr: Produce the next points in the experiment. Additional kwargs passed to
  this method are propagated directly to the underlying model's `gen`, along
  with the `model_gen_kwargs` set on the current generation node.
  
  NOTE: Each generator run returned from this function must become a single
  trial on the experiment to comply with assumptions made in generation
  strategy. Do not split one generator run produced from generation strategy
  into multiple trials (never making a generator run into a trial is allowed).
  
  Args:
      experiment: Experiment, for which the generation strategy is producing
          a new generator run in the course of `gen`, and to which that
          generator run will be added as trial(s). Information stored on the
          experiment (e.g., trial statuses) is used to determine which model
          will be used to produce the generator run returned from this method.
      data: Optional data to be passed to the underlying model's `gen`, which
          is called within this method and actually produces the resulting
          generator run. By default, data is all data on the `experiment`.
      n: Integer representing how many arms should be in the generator run
          produced by this method. NOTE: Some underlying models may ignore
          the `n` and produce a model-determined number of arms. In that
          case this method will also output a generator run with number of
          arms that can differ from `n`.
      pending_observations: A map from metric name to pending
          observations for that metric, used by some models to avoid
          resuggesting points that are currently being evaluated.
docstr_tok: ["Produce","the","next","points","in","the","experiment",".","Additional","kwargs","passed","to","this","method","are","propagated","directly","to","the","underlying","model","'s","`","gen","`",",","along","with","the","`","model_gen_kwargs","`","set","on","the","current","generation","node",".","NOTE",":","Each","generator","run","returned","from","this","function","must","become","a","single","trial","on","the","experiment","to","comply","with","assumptions","made","in","generation","strategy",".","Do","not","split","one","generator","run","produced","from","generation","strategy","into","multiple","trials","(","never","making","a","generator","run","into","a","trial","is","allowed",")",".","Args",":","experiment",":","Experiment",",","for","which","the","generation","strategy","is","producing","a","new","generator","run","in","the","course","of","`","gen","`",",","and","to","which","that","generator","run","will","be","added","as","trial","(","s",")",".","Information","stored","on","the","experiment","(","e.g.",",","trial","statuses",")","is","used","to","determine","which","model","will","be","used","to","produce","the","generator","run","returned","from","this","method",".","data",":","Optional","data","to","be","passed","to","the","underlying","model","'s","`","gen","`",",","which","is","called","within","this","method","and","actually","produces","the","resulting","generator","run",".","By","default",",","data","is","all","data","on","the","`","experiment","`",".","n",":","Integer","representing","how","many","arms","should","be","in","the","generator","run","produced","by","this","method",".","NOTE",":","Some","underlying","models","may","ignore","the","`","n","`","and","produce","a","model-determined","number","of","arms",".","In","that","case","this","method","will","also","output","a","generator","run","with","number","of","arms","that","can","differ","from","`","n","`",".","pending_observations",":","A","map","from","metric","name","to","pending","observations","for","that","metric",",","used","by","some","models","to","avoid","resuggesting","points","that","are","currently","being","evaluated","."]
code: def gen(
      self,
      experiment: Experiment,
      data: Optional[Data] = None,
      n: int = 1,
      pending_observations: Optional[
          Dict[str, List[ObservationFeatures]]
      ] = None,
      **kwargs: Any,
  ) -> GeneratorRun:
      """Produce the next points in the experiment. Additional kwargs passed to
      this method are propagated directly to the underlying model's `gen`, along
      with the `model_gen_kwargs` set on the current generation node.
  
      NOTE: Each generator run returned from this function must become a single
      trial on the experiment to comply with assumptions made in generation
      strategy. Do not split one generator run produced from generation strategy
      into multiple trials (never making a generator run into a trial is allowed).
  
      Args:
          experiment: Experiment, for which the generation strategy is producing
              a new generator run in the course of `gen`, and to which that
              generator run will be added as trial(s). Information stored on the
              experiment (e.g., trial statuses) is used to determine which model
              will be used to produce the generator run returned from this method.
          data: Optional data to be passed to the underlying model's `gen`, which
              is called within this method and actually produces the resulting
              generator run. By default, data is all data on the `experiment`.
          n: Integer representing how many arms should be in the generator run
              produced by this method. NOTE: Some underlying models may ignore
              the `n` and produce a model-determined number of arms. In that
              case this method will also output a generator run with number of
              arms that can differ from `n`.
          pending_observations: A map from metric name to pending
              observations for that metric, used by some models to avoid
              resuggesting points that are currently being evaluated.
      """
      return self._gen_multiple(
          experiment=experiment,
          num_generator_runs=1,
          data=data,
          n=n,
          pending_observations=pending_observations,
          **kwargs,
      )[0]
  
imports: from __future__ import annotations
  from copy import deepcopy
  from functools import wraps
  from logging import Logger
  from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar
  import pandas
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.generation_strategy_interface import GenerationStrategyInterface
  from ax.core.generator_run import GeneratorRun
  from ax.core.observation import ObservationFeatures
  from ax.core.utils import extend_pending_observations, get_pending_observation_features_based_on_trial_status
  from ax.exceptions.core import DataRequiredError, UnsupportedError, UserInputError
  from ax.exceptions.generation_strategy import GenerationStrategyCompleted, GenerationStrategyMisconfiguredException
  from ax.modelbridge.base import ModelBridge
  from ax.modelbridge.generation_node import GenerationNode, GenerationStep
  from ax.modelbridge.model_spec import FactoryFunctionModelSpec
  from ax.modelbridge.registry import _extract_model_state_after_gen, ModelRegistryBase
  from ax.modelbridge.transition_criterion import TrialBasedCriterion
  from ax.utils.common.logger import _round_floats_for_logging, get_logger
  from ax.utils.common.typeutils import checked_cast, not_none
label_desc: Use image node_id 19 for calling the GenerationStrategy obj's underlying member method code with example usage: obj.gen(experiment, data, n, pending_observations) and returns: self