class_docstr: Class for a runner that works with the BackendSimulator.
class_docstr_tok: ["Class","for","a","runner","that","works","with","the","BackendSimulator","."]
docstr: Poll trial status from the ``BackendSimulator``. NOTE: The ``Scheduler``
  currently marks trials as running when they are created, but some of these
  trials may actually be in queued on the ``BackendSimulator``.
  
  Returns:
      A Dict mapping statuses to sets of trial indices.
docstr_tok: ["Poll","trial","status","from","the","``","BackendSimulator","``",".","NOTE",":","The","``","Scheduler","``","currently","marks","trials","as","running","when","they","are","created",",","but","some","of","these","trials","may","actually","be","in","queued","on","the","``","BackendSimulator","``",".","Returns",":","A","Dict","mapping","statuses","to","sets","of","trial","indices","."]
code: def poll_trial_status(
      self, trials: Iterable[BaseTrial]
  ) -> Dict[TrialStatus, Set[int]]:
      """Poll trial status from the ``BackendSimulator``. NOTE: The ``Scheduler``
      currently marks trials as running when they are created, but some of these
      trials may actually be in queued on the ``BackendSimulator``.
  
      Returns:
          A Dict mapping statuses to sets of trial indices.
      """
      self.simulator.update()
      trial_status = defaultdict(set)
      for trial in trials:
          t_index = trial.index
          status = self.simulator.lookup_trial_index_status(t_index)
          trial_status[status].add(t_index)
      return dict(trial_status)
  
file_path: Ax/ax/runners/simulated_backend.py
imports: from collections import defaultdict
  from typing import Any, Callable, Dict, Iterable, Optional, Set
  import numpy
  from ax.core.base_trial import BaseTrial, TrialStatus
  from ax.core.runner import Runner
  from ax.utils.testing.backend_simulator import BackendSimulator
label_desc: Use image node_id 2 for calling the SimulatedBackendRunner obj's underlying member method code with example usage: obj.poll_trial_status(trials) and returns: dict