class_docstr: Implements the median stopping rule as described in the Vizier paper:
  
  https://research.google.com/pubs/pub46180.html
  
  Args:
      time_attr: The training result attr to use for comparing time.
          Note that you can pass in something non-temporal such as
          `training_iteration` as a measure of progress, the only requirement
          is that the attribute should increase monotonically.
      metric: The training result objective value attribute. Stopping
          procedures will use this attribute. If None but a mode was passed,
          the `ray.tune.result.DEFAULT_METRIC` will be used per default.
      mode: One of {min, max}. Determines whether objective is
          minimizing or maximizing the metric attribute.
      grace_period: Only stop trials at least this old in time.
          The mean will only be computed from this time onwards. The units
          are the same as the attribute named by `time_attr`.
      min_samples_required: Minimum number of trials to compute median
          over.
      min_time_slice: Each trial runs at least this long before
          yielding (assuming it isn't stopped). Note: trials ONLY yield if
          there are not enough samples to evaluate performance for the
          current result AND there are other trials waiting to run.
          The units are the same as the attribute named by `time_attr`.
      hard_stop: If False, pauses trials instead of stopping
          them. When all other trials are complete, paused trials will be
          resumed and allowed to run FIFO.
class_docstr_tok: ["Implements","the","median","stopping","rule","as","described","in","the","Vizier","paper",":","https",":","\/\/research.google.com\/pubs\/pub46180.html","Args",":","time_attr",":","The","training","result","attr","to","use","for","comparing","time",".","Note","that","you","can","pass","in","something","non-temporal","such","as","`","training_iteration","`","as","a","measure","of","progress",",","the","only","requirement","is","that","the","attribute","should","increase","monotonically",".","metric",":","The","training","result","objective","value","attribute",".","Stopping","procedures","will","use","this","attribute",".","If","None","but","a","mode","was","passed",",","the","`","ray.tune.result.DEFAULT_METRIC","`","will","be","used","per","default",".","mode",":","One","of","{","min",",","max","}",".","Determines","whether","objective","is","minimizing","or","maximizing","the","metric","attribute",".","grace_period",":","Only","stop","trials","at","least","this","old","in","time",".","The","mean","will","only","be","computed","from","this","time","onwards",".","The","units","are","the","same","as","the","attribute","named","by","`","time_attr","`",".","min_samples_required",":","Minimum","number","of","trials","to","compute","median","over",".","min_time_slice",":","Each","trial","runs","at","least","this","long","before","yielding","(","assuming","it","is","n't","stopped",")",".","Note",":","trials","ONLY","yield","if","there","are","not","enough","samples","to","evaluate","performance","for","the","current","result","AND","there","are","other","trials","waiting","to","run",".","The","units","are","the","same","as","the","attribute","named","by","`","time_attr","`",".","hard_stop",":","If","False",",","pauses","trials","instead","of","stopping","them",".","When","all","other","trials","are","complete",",","paused","trials","will","be","resumed","and","allowed","to","run","FIFO","."]
code: def _running_mean(self, trial: Trial, time: float) -> np.ndarray:
      results = self._results[trial]
      # TODO(ekl) we could do interpolation to be more precise, but for now
      # assume len(results) is large and the time diffs are roughly equal
      scoped_results = [
          r
          for r in results
          if self._grace_period <= r[self._time_attr] <= time
      ]
      return np.mean([r[self._metric] for r in scoped_results])
  
imports: import collections
  import logging
  from typing import Dict, List, Optional, TYPE_CHECKING
  import numpy
  from ray.tune.result import DEFAULT_METRIC
  from ray.tune.experiment import Trial
  from ray.tune.schedulers.trial_scheduler import FIFOScheduler, TrialScheduler
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 10 for calling the MedianStoppingRule obj's underlying member method code with example usage: obj._running_mean(trial, time) and returns: np