def is_present(conf, atom):
    '''
    Tell if a given package or DEPEND atom is present in the configuration
    files tree.
    Warning: This only works if the configuration files tree is in the correct
    format (the one enforced by enforce_nice_config)

    CLI Example:

    .. code-block:: bash

        salt '*' portage_config.is_present unmask salt
    '''
    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 __HOLE__:
            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
dataset/ETHPy150Open saltstack/salt/salt/modules/portage_config.py/is_present