def METHOD_NAME(licenses, requirements):
    errors = []
    items = list(licenses.keys())
    items.sort()
    for item in items:
        if item not in [r.lower() for r in requirements.keys()] and item != 'awx':
            errors.append(" license file %s does not correspond to an existing requirement; it should be removed." % (licenses[item]['filename'],))
            continue
        # uWSGI has a linking exception
        if licenses[item]['gpl'] and item != 'uwsgi':
            errors.append(" license for %s is GPL. This software cannot be used." % (item,))
        if licenses[item]['source_required']:
            version = requirements[item]['version']
            if version != licenses[item]['source_version']:
                errors.append(" embedded source for %s is %s instead of the required version %s" % (item, licenses[item]['source_version'], version))
        elif licenses[item]['source_version']:
            errors.append(" embedded source version %s for %s is included despite not being needed" % (licenses[item]['source_version'], item))
    items = list(requirements.keys())
    items.sort()
    for item in items:
        if item.lower() not in licenses.keys():
            errors.append(" license for requirement %s is missing" % (item,))
    return errors