'Check if the metadata is compliant. If strict is True then raise if
no Name or Version are provided'

def check(self, strict=False):

    self.set_metadata_version()
    (missing, warnings) = ([], [])
    for attr in (u'Name', u'Version'):
        if (attr not in self):
            missing.append(attr)
    if (strict and (missing != [])):
        msg = (u'missing    required    metadata:    %s' % u',    '.join(missing))
        raise MetadataMissingError(msg)
    for attr in (u'Home-page', u'Author'):
        if (attr not in self):
            missing.append(attr)
    if (self[u'Metadata-Version'] != u'1.2'):
        return (missing, warnings)
    scheme = get_scheme(self.scheme)
    def are_valid_constraints(value):
        for v in value:
            if (not scheme.is_valid_matcher(v.split(u';')[0])):
                return False
        return True
    for (fields, controller) in ((_PREDICATE_FIELDS, are_valid_constraints), (_VERSIONS_FIELDS, scheme.is_valid_constraint_list), (_VERSION_FIELDS, scheme.is_valid_version)):
        for field in fields:
            value = self.get(field, None)
            if ((value is not None) and (not controller(value))):
                warnings.append((u'Wrong    value    for    %r:    %s' % (field, value)))
    return (missing, warnings)
