class_docstr: Simulator for a backend deployment with concurrent dispatch and a queue.
class_docstr_tok: ["Simulator","for","a","backend","deployment","with","concurrent","dispatch","and","a","queue","."]
docstr: Look through running trials and see if any trials have completed
  since the last check. Such trials could have completed naturally (in
  this case, ``sim_completed_time`` is None) or have been given a artificial
  completion time (``sim_completed_time`` is not None) via early stopping.
  
  Args:
      timestamp: The current timestamp.
docstr_tok: ["Look","through","running","trials","and","see","if","any","trials","have","completed","since","the","last","check",".","Such","trials","could","have","completed","naturally","(","in","this","case",",","``","sim_completed_time","``","is","None",")","or","have","been","given","a","artificial","completion","time","(","``","sim_completed_time","``","is","not","None",")","via","early","stopping",".","Args",":","timestamp",":","The","current","timestamp","."]
code: def _update_completed(self, timestamp: float) -> List[SimTrial]:
      """Look through running trials and see if any trials have completed
      since the last check. Such trials could have completed naturally (in
      this case, ``sim_completed_time`` is None) or have been given a artificial
      completion time (``sim_completed_time`` is not None) via early stopping.
  
      Args:
          timestamp: The current timestamp.
      """
      completed_since_last = []
      new_running = []
      for trial in self._running:
          # pyre-fixme[58]: `+` is not supported for operand types
          #  `Optional[float]` and `float`.
          if timestamp >= trial.sim_start_time + trial.sim_runtime:
              completed_since_last.append(trial)
              trial.sim_completed_time = (
                  trial.sim_start_time
                  + trial.sim_runtime  # pyre-ignore[58]
              )
          elif (
              trial.sim_completed_time is not None
              and timestamp >= trial.sim_completed_time
          ):
              completed_since_last.append(trial)  # was early stopped
          else:
              new_running.append(trial)
      self._running = new_running
      self._completed.extend(completed_since_last)
      return completed_since_last
  
imports: import logging
  import random
  import time
  from dataclasses import dataclass
  from logging import Logger
  from typing import Dict, List, Optional
  from ax.core.base_trial import TrialStatus
  from ax.utils.common.logger import get_logger
label_desc: Use image node_id 19 for calling the BackendSimulator obj's underlying member method code with example usage: obj._update_completed(timestamp) and returns: completed_since_last