def is_present(conf, atom):
    if conf in SUPPORTED_CONFS:
        if not isinstance(atom, portage.dep.Atom):
            atom = portage.dep.Atom(atom, allow_wildcard=True)
        has_wildcard = '*' in atom

        package_file = _get_config_file(conf, str(atom))

        # wildcards are valid in confs
        if has_wildcard:
            match_list = set(atom)
        else:
            match_list = set(_porttree().dbapi.xmatch("match-all", atom))

        try:
            file_handler = salt.utils.fopen(package_file)
        except IOError:
            return False
        else:
            for line in file_handler:
                line = line.strip()
                line_package = line.split()[0]

                if has_wildcard:
                    if line_package == str(atom):
                        return True
                else:
                    line_list = _porttree().dbapi.xmatch("match-all", line_package)
                    if match_list.issubset(line_list):
                        return True
            return False
Tell if a given package or DEPEND atom is present in the configuration
dataset/ETHPy150Open saltstack/salt/salt/modules/portage_config.py/is_present