def check(self, strict=False):
self.set_metadata_version()<EOL>missing, warnings = [], []<EOL>for attr in ('<STR_LIT:Name>', '<STR_LIT>'):  <EOL><INDENT>if attr not in self:<EOL><INDENT>missing.append(attr)<EOL><DEDENT><DEDENT>if strict and missing != []:<EOL><INDENT>msg = '<STR_LIT>' % '<STR_LIT:U+002CU+0020>'.join(missing)<EOL>raise MetadataMissingError(msg)<EOL><DEDENT>for attr in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>if attr not in self:<EOL><INDENT>missing.append(attr)<EOL><DEDENT><DEDENT>if self['<STR_LIT>'] != '<STR_LIT>':<EOL><INDENT>return missing, warnings<EOL><DEDENT>scheme = get_scheme(self.scheme)<EOL>def are_valid_constraints(value):<EOL><INDENT>for v in value:<EOL><INDENT>if not scheme.is_valid_matcher(v.split('<STR_LIT:;>')[<NUM_LIT:0>]):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL><DEDENT>for fields, controller in ((_PREDICATE_FIELDS, are_valid_constraints),<EOL>(_VERSIONS_FIELDS,<EOL>scheme.is_valid_constraint_list),<EOL>(_VERSION_FIELDS,<EOL>scheme.is_valid_version)):<EOL><INDENT>for field in fields:<EOL><INDENT>value = self.get(field, None)<EOL>if value is not None and not controller(value):<EOL><INDENT>warnings.append('<STR_LIT>' % (field, value))<EOL><DEDENT><DEDENT><DEDENT>return missing, warnings<EOL>
Check if the metadata is compliant. If strict is True then raise if
        no Name or Version are provided