parameters: (self, graph_config, confidence_level)
return_statement: return confidence_level * mean_stderr < mean / 1000.0
docstring: Checks if the mean of the results for a given trace config is within
      0.1% of the true value with the specified confidence level.
  
      This assumes Gaussian distribution of the noise and based on
      https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule.
  
      Args:
        graph_config: An instance of GraphConfig.
        confidence_level: Number of standard deviations from the mean that all
            values must lie within. Typical values are 1, 2 and 3 and correspond
            to 68%, 95% and 99.7% probability that the measured value is within
            0.1% of the true value.
  
      Returns:
        True if specified confidence level have been achieved.
docstring_summary: Checks if the mean of the results for a given trace config is within
      0.1% of the true value with the specified confidence level.
docstring_tokens: Checks if the mean of the results for a given trace config is within 0 . 1% of the true value with the specified confidence level .
function: def HasEnoughRuns(self, graph_config, confidence_level):
      """Checks if the mean of the results for a given trace config is within
      0.1% of the true value with the specified confidence level.
  
      This assumes Gaussian distribution of the noise and based on
      https://en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule.
  
      Args:
        graph_config: An instance of GraphConfig.
        confidence_level: Number of standard deviations from the mean that all
            values must lie within. Typical values are 1, 2 and 3 and correspond
            to 68%, 95% and 99.7% probability that the measured value is within
            0.1% of the true value.
  
      Returns:
        True if specified confidence level have been achieved.
      """
      if not isinstance(graph_config, TraceConfig):
        return all(self.HasEnoughRuns(child, confidence_level)
                   for child in graph_config.children)
  
      trace = self.traces.get(graph_config.name, {})
      results = trace.get('results', [])
      logging.debug('HasEnoughRuns for %s', graph_config.name)
  
      if len(results) < MIN_RUNS_FOR_CONFIDENCE:
        logging.debug('  Ran %d times, need at least %d',
                      len(results), MIN_RUNS_FOR_CONFIDENCE)
        return False
  
      logging.debug('  Results: %d entries', len(results))
      mean = numpy.mean(results)
      mean_stderr = numpy.std(results) / numpy.sqrt(len(results))
      logging.debug('  Mean: %.2f, mean_stderr: %.2f', mean, mean_stderr)
      logging.info('>>> Confidence level is %.2f', mean / (1000.0 * mean_stderr))
      return confidence_level * mean_stderr < mean / 1000.0
function_tokens: def HasEnoughRuns ( self , graph_config , confidence_level ) : if not isinstance ( graph_config , TraceConfig ) : return all ( self . HasEnoughRuns ( child , confidence_level ) for child in graph_config . children ) trace = self . traces . get ( graph_config . name , { } ) results = trace . get ( 'results' , [ ] ) logging . debug ( 'HasEnoughRuns for %s' , graph_config . name ) if len ( results ) < MIN_RUNS_FOR_CONFIDENCE : logging . debug ( '  Ran %d times, need at least %d' , len ( results ) , MIN_RUNS_FOR_CONFIDENCE ) return False logging . debug ( '  Results: %d entries' , len ( results ) ) mean = numpy . mean ( results ) mean_stderr = numpy . std ( results ) / numpy . sqrt ( len ( results ) ) logging . debug ( '  Mean: %.2f, mean_stderr: %.2f' , mean , mean_stderr ) logging . info ( '>>> Confidence level is %.2f' , mean / ( 1000.0 * mean_stderr ) ) return confidence_level * mean_stderr < mean / 1000.0