def _is_package_in_list(module_name, list_packages, no_wheel=False):
    """
    determines of this package is the one for the given module_name

    @param      list_packages       list of packages names (list of wheel)
    @param      module_name         module name
    @param      no_wheel            skip wheels
    @return                         package name
    """
    module_name = module_name.lower()
    p = '.' in module_name
    if p:
        pp = module_name.replace('.', '_')
    d = '-' in module_name
    if d:
        pd = module_name.split('-')
        if len(pd[-1]) == 0:
            pd = '_'.join(pd[:-1]) + '-'
        else:
            pd = '_'.join(pd)
    for a in list_packages:
        al = a.lower()
        if no_wheel and al.endswith('.whl'):
            continue
        if module_name == 'python' and '.msi' not in a:
            continue
        if 'theme-' in al:
            al = al.split('theme-')
            al = al[0].replace('-', '_') + 'theme-' + al[1]
        if al.startswith(module_name):
            return a
        if p and al.startswith(pp):
            return a
        if d and al.startswith(pd):
            return a
    return None
