import re


def exclude(path: str):
    """Does the path meet any rules for exclusion?"""
    EXCLUDES = {r'__.*__', r'/\.'}
    NO_LINKS = {r'\.xmf', r'\.h5', 'run'}
    return any(re.search(exclude, str(path)) for exclude in EXCLUDES.union(NO_LINKS))