def defaults():
    """
    Parse `/etc/blueprintignore` and `~/.blueprintignore` to build the
    default `Rules` object.
    """
    r = None

    # Check for a fresh cache of the complete blueprintignore(5) rules.
    if _mtime('/etc/blueprintignore') < _mtime(CACHE) \
    and _mtime(os.path.expanduser('~/.blueprintignore')) < _mtime(CACHE) \
    and _mtime(__file__) < _mtime(CACHE):
        try:
            r = Rules(json.load(open(CACHE)))
            logging.info('using cached blueprintignore(5) rules')
            return r
        except (OSError, __HOLE__):
            pass

    # Cache things that are ignored by default first.
    r = Rules({
        'file': IGNORE.items(),
        'package': [('apt', package, False) for package in _apt()] +
                   [('yum', package, False) for package in _yum()],
        'service': [('sysvinit', 'skeleton', False)],
        'source': [('/', False),
                   ('/usr/local', True)],
    })

    # Cache the patterns stored in the blueprintignore files.
    logging.info('parsing blueprintignore(5) rules')
    try:
        for pathname in ['/etc/blueprintignore',
                         os.path.expanduser('~/.blueprintignore')]:
            r.parse(open(pathname), negate=True)

    except IOError:
        pass

    # Store the cache to disk.
    f = _cache_open(CACHE, 'w')
    json.dump(r, f, indent=2, sort_keys=True)
    f.close()

    return r
dataset/ETHPy150Open devstructure/blueprint/blueprint/rules.py/defaults