Return the number of failures in the window.
438636
def num_failures(self):
        
        min_time = time.time() - self.window

        while self.failures and self.failures[0] < min_time:
            self.failures.popleft()

        return len(self.failures)
382675
def number_of_values(self):
    """"""
    if not self._registry_key and self._registry:
      self._GetKeyFromRegistry()

    if self._registry_key:
      return self._registry_key.number_of_values

    return 0
1275964
def failure_format_traceback(self, fail):
        
        try:
            f = six.StringIO()
            fail.printTraceback(file=f)
            return f.getvalue()
        except Exception:
            return u"Failed to format failure traceback for '{0}'".format(fail)
232438
def getApplicationsErrorNameFromEnum(self, error):
        """"""

        fn = self.function_table.getApplicationsErrorNameFromEnum
        result = fn(error)
        return result
352314
def PrintErrorCounts(self):
    """"""
    for category, count in self.errors_by_category.iteritems():
      sys.stderr.write('Category \'%s\' errors found: %d\n' %
                       (category, count))
    sys.stderr.write('Total errors found: %d\n' % self.error_count)
302037
def retry_count(self):
        
        retries = len([i for i, result in enumerate(self.data) if result.retries_left > 0])
        return retries
721843
def error_per_row(self):
        """"""
        FLOW_lfom_error = np.zeros(self.n_rows)
        for i in range(self.n_rows):
            actual_flow = self.flow_actual(i, self.n_orifices_per_row)
            FLOW_lfom_error[i] = (((actual_flow - self.flow_ramp[i]) / self.flow_ramp[i]).to(u.dimensionless)).magnitude
        return FLOW_lfom_error
514125
def fetch_task_failures(self):
        
        error_file = os.path.join(self.tmp_dir, "job.err")
        if os.path.isfile(error_file):
            with open(error_file, "r") as f_err:
                errors = f_err.readlines()
        else:
            errors = ''
        return errors
1367727
private VarTupleSet getFailureTupleSet( RandSeq randSeq, FunctionInputDef inputDef)
    {
    List<Tuple> failureTuples = new ArrayList<Tuple>();

    for( VarDefIterator vars = new VarDefIterator( inputDef); vars.hasNext(); )
      {
      VarDef var = vars.next();
      for( Iterator<VarValueDef> failures = var.getFailureValues(); failures.hasNext(); )
        {
        failureTuples.add( new Tuple( new VarBindingDef( var, failures.next())));
        }
      }
    
    return new VarTupleSet( RandSeq.reorderIf( randSeq, failureTuples));
    }
625931
def failed(self, fail_on_warnings=True):
        """"""

        return bool(self.errors) or (fail_on_warnings and bool(self.warnings))
219480
def total_errors(self):
        

        child_errors = sum(len(tree) for _, tree in iteritems(self._contents))
        return len(self.errors) + child_errors
244470
def get_adjusted_error_count(self):
    
    p1 =  self._observable.get_attributable_length()
    p1 += self._unobservable.get_attributable_length()
    return p1
1011275
def printSummary(self, start, stop):
        """"""
        def renderResultType(type, number, is_failure):
            """Return a rendering like '2 failures'.

            :arg type: A singular label, like "failure"
            :arg number: The number of tests with a result of that type
            :arg is_failure: Whether that type counts as a failure

            """
            # I'd rather hope for the best with plurals than totally punt on
            # being Englishlike:
            ret = '%s %s%s' % (number, type, 's' if number != 1 else '')
            if is_failure and number:
                ret = self._term.bold(ret)
            return ret

        # Summarize the special cases:
        counts = [('test', self.testsRun, False),
                  ('failure', len(self.failures), True),
                  ('error', len(self.errors), True)]
        # Support custom errorclasses as well as normal failures and errors.
        # Lowercase any all-caps labels, but leave the rest alone in case there
        # are hard-to-read camelCaseWordBreaks.
        counts.extend([(label.lower() if label.isupper() else label,
                        len(storage),
                        is_failure)
                        for (storage, label, is_failure) in
                            self.errorClasses.values() if len(storage)])
        summary = (', '.join(renderResultType(*a) for a in counts) +
                   ' in %.1fs' % (stop - start))

        # Erase progress bar. Bash doesn't clear the whole line when printing
        # the prompt, leaving a piece of the bar. Also, the prompt may not be
        # at the bottom of the terminal.
        self.bar.erase()
        self.stream.writeln()
        if self.wasSuccessful():
            self.stream.write(self._term.bold_green('OK!  '))
        self.stream.writeln(summary)
252647
def success_count(self):
        
        return len([i for i, result in enumerate(self.data) if result.success])
738911
def n_failed(self):
        """"""
        return self._counters[JobStatus.failed] + self._counters[JobStatus.partial_failed]
358211
def _increment_fail_stat(self, item):
        '''
        
        '''
        if isinstance(item, dict):
            item['ts'] = time.time()
        elif isinstance(item, str):
            item = item + str(time.time())

        if 'fail' in self.stats_dict:
            self.logger.debug("Incremented fail stats")
            for key in self.stats_dict['fail']:
                if key == 'lifetime':
                    self.stats_dict['fail'][key].increment(item)
                else:
                    self.stats_dict['fail'][key].increment()
885658
def aggregate_failed(self) -> List:
        """"""
        categories = self.session.query(
            self.Job.name.label('name'),
            sqa.func.count(self.Job.id).label('count')
        ).filter(self.Job.status != 'cancelled').group_by(self.Job.name).all()
        data = [{'name': category.name, 'count': category.count} for category in categories]
        return data