def set(self, name, value):
name = self._convert_name(name)<EOL>if ((name in _ELEMENTSFIELD or name == '<STR_LIT>') and<EOL>not isinstance(value, (list, tuple))):<EOL><INDENT>if isinstance(value, string_types):<EOL><INDENT>value = [v.strip() for v in value.split('<STR_LIT:U+002C>')]<EOL><DEDENT>else:<EOL><INDENT>value = []<EOL><DEDENT><DEDENT>elif (name in _LISTFIELDS and<EOL>not isinstance(value, (list, tuple))):<EOL><INDENT>if isinstance(value, string_types):<EOL><INDENT>value = [value]<EOL><DEDENT>else:<EOL><INDENT>value = []<EOL><DEDENT><DEDENT>if logger.isEnabledFor(logging.WARNING):<EOL><INDENT>project_name = self['<STR_LIT:Name>']<EOL>scheme = get_scheme(self.scheme)<EOL>if name in _PREDICATE_FIELDS and value is not None:<EOL><INDENT>for v in value:<EOL><INDENT>if not scheme.is_valid_matcher(v.split('<STR_LIT:;>')[<NUM_LIT:0>]):<EOL><INDENT>logger.warning(<EOL>'<STR_LIT>',<EOL>project_name, v, name)<EOL><DEDENT><DEDENT><DEDENT>elif name in _VERSIONS_FIELDS and value is not None:<EOL><INDENT>if not scheme.is_valid_constraint_list(value):<EOL><INDENT>logger.warning('<STR_LIT>',<EOL>project_name, value, name)<EOL><DEDENT><DEDENT>elif name in _VERSION_FIELDS and value is not None:<EOL><INDENT>if not scheme.is_valid_version(value):<EOL><INDENT>logger.warning('<STR_LIT>',<EOL>project_name, value, name)<EOL><DEDENT><DEDENT><DEDENT>if name in _UNICODEFIELDS:<EOL><INDENT>if name == '<STR_LIT>':<EOL><INDENT>value = self._remove_line_prefix(value)<EOL><DEDENT><DEDENT>self._fields[name] = value<EOL>
Control then set a metadata field.