def test_stubs(args: argparse.Namespace, use_builtins_fixtures: bool=False) -> int:
    "This is stubtest! It's time to test the stubs!"
    allowlist = {entry: False for allowlist_file in args.allowlist for entry in get_allowlist_entries(allowlist_file)}
    allowlist_regexes = {entry: re.compile(entry) for entry in allowlist}
    generated_allowlist = set()
    modules = args.modules
    if args.check_typeshed:
        assert (not args.modules), 'Cannot pass both --check-typeshed and a list of modules'
        modules = get_typeshed_stdlib_modules(args.custom_typeshed_dir)
        annoying_modules = {'antigravity', 'this'}
        modules = [m for m in modules if (m not in annoying_modules)]
    assert modules, 'No modules to check'
    options = Options()
    options.incremental = False
    options.custom_typeshed_dir = args.custom_typeshed_dir
    options.config_file = args.mypy_config_file
    options.use_builtins_fixtures = use_builtins_fixtures
    if options.config_file:

        def set_strict_flags() -> None:
            return
        parse_config_file(options, set_strict_flags, options.config_file, sys.stdout, sys.stderr)
    try:
        modules = build_stubs(modules, options, find_submodules=(not args.check_typeshed))
    except RuntimeError:
        return 1
    exit_code = 0
    for module in modules:
        for error in test_module(module):
            if (args.ignore_missing_stub and error.is_missing_stub()):
                continue
            if (args.ignore_positional_only and error.is_positional_only_related()):
                continue
            if (error.object_desc in allowlist):
                allowlist[error.object_desc] = True
                continue
            is_allowlisted = False
            for w in allowlist:
                if allowlist_regexes[w].fullmatch(error.object_desc):
                    allowlist[w] = True
                    is_allowlisted = True
                    break
            if is_allowlisted:
                continue
            exit_code = 1
            if args.generate_allowlist:
                generated_allowlist.add(error.object_desc)
                continue
            print(error.get_description(concise=args.concise))
    if (not args.ignore_unused_allowlist):
        for w in allowlist:
            if ((not allowlist[w]) and (not allowlist_regexes[w].fullmatch(''))):
                exit_code = 1
                print('note: unused allowlist entry {}'.format(w))
    if args.generate_allowlist:
        for e in sorted(generated_allowlist):
            print(e)
        exit_code = 0
    return exit_code
This is stubtest! It's time to test the stubs!
def test_stubs(args: argparse.Namespace, use_builtins_fixtures: bool=False) -> int:
    
    allowlist = {entry: False for allowlist_file in args.allowlist for entry in get_allowlist_entries(allowlist_file)}
    allowlist_regexes = {entry: re.compile(entry) for entry in allowlist}
    generated_allowlist = set()
    modules = args.modules
    if args.check_typeshed:
        assert (not args.modules), 'Cannot pass both --check-typeshed and a list of modules'
        modules = get_typeshed_stdlib_modules(args.custom_typeshed_dir)
        annoying_modules = {'antigravity', 'this'}
        modules = [m for m in modules if (m not in annoying_modules)]
    assert modules, 'No modules to check'
    options = Options()
    options.incremental = False
    options.custom_typeshed_dir = args.custom_typeshed_dir
    options.config_file = args.mypy_config_file
    options.use_builtins_fixtures = use_builtins_fixtures
    if options.config_file:

        def set_strict_flags() -> None:
            return
        parse_config_file(options, set_strict_flags, options.config_file, sys.stdout, sys.stderr)
    try:
        modules = build_stubs(modules, options, find_submodules=(not args.check_typeshed))
    except RuntimeError:
        return 1
    exit_code = 0
    for module in modules:
        for error in test_module(module):
            if (args.ignore_missing_stub and error.is_missing_stub()):
                continue
            if (args.ignore_positional_only and error.is_positional_only_related()):
                continue
            if (error.object_desc in allowlist):
                allowlist[error.object_desc] = True
                continue
            is_allowlisted = False
            for w in allowlist:
                if allowlist_regexes[w].fullmatch(error.object_desc):
                    allowlist[w] = True
                    is_allowlisted = True
                    break
            if is_allowlisted:
                continue
            exit_code = 1
            if args.generate_allowlist:
                generated_allowlist.add(error.object_desc)
                continue
            print(error.get_description(concise=args.concise))
    if (not args.ignore_unused_allowlist):
        for w in allowlist:
            if ((not allowlist[w]) and (not allowlist_regexes[w].fullmatch())):
                exit_code = 1
                print('note: unused allowlist entry {}'.format(w))
    if args.generate_allowlist:
        for e in sorted(generated_allowlist):
            print(e)
        exit_code = 0
    return exit_code