def load_filter(name, filename):
    if filename is None:
        home_path = os.getenv('HOME', '')
        conf_path = os.getenv('DOTSECRETS_DOTFILES_PATH',
                os.path.join(home_path, DOTFILES_PATH))
        filename = os.path.join(conf_path, DOTFILTERS_FILE)
    logger.debug("Opening file '%s'." % filename)
    with open(filename, 'r') as filters_file:
        for f in yaml.load_all(filters_file):
            if f.name == name:
                f.set_parent_rules()
                return f
    logger.warning("No filter named '%s' found, using copy filter." % name)
    return CopyFilter()
dataset/ETHPy150Open oohlaf/dotsecrets/dotsecrets/clean.py/load_filter/original