def selftest(options):
    count_failed = count_all = 0
    report = BaseReport(options)
    counters = report.counters
    checks = options.physical_checks + options.logical_checks
    for name, check, argument_names in checks:
        for line in check.__doc__.splitlines():
            line = line.lstrip()
            match = SELFTEST_REGEX.match(line)
            if match is None:
                continue
            code, source = match.groups()
            checker = Checker(None, options=options, report=report)
            for part in source.split(r'\n'):
                part = part.replace(r'\t', '\t')
                part = part.replace(r'\s', ' ')
                checker.lines.append(part + '\n')
            checker.check_all()
            error = None
            if code == 'Okay':
                if len(counters) > len(options.benchmark_keys):
                    codes = [key for key in counters
                             if key not in options.benchmark_keys]
                    error = "incorrectly found %s" % ', '.join(codes)
            elif not counters.get(code):
                error = "failed to find %s" % code
            # Keep showing errors for multiple tests
            for key in set(counters) - set(options.benchmark_keys):
                del counters[key]
            report.messages = {}
            count_all += 1
            if not error:
                if options.verbose:
                    print(("%s: %s" % (code, source)))
            else:
                count_failed += 1
                print(("%s: %s:" % (__file__, error)))
                for line in checker.lines:
                    print((line.rstrip()))
    return count_failed, count_all
Remove one or more resources from a Managed Source
dataset/ETHPy150Open kivy/plyer/plyer/tools/pep8checker/pep8.py/selftest--crossover with--dataset/ETHPy150Open datasift/datasift-python/datasift/managed_sources.py/Resource.remove