@classmethod<EOL><INDENT>def create(cls, name_value, name_type):<DEDENT>
if isinstance(name_value, Name.NameValue):<EOL><INDENT>value = name_value<EOL><DEDENT>elif isinstance(name_value, str):<EOL><INDENT>value = cls.NameValue(name_value)<EOL><DEDENT>else:<EOL><INDENT>name = '<STR_LIT:Name>'<EOL>msg = exceptions.ErrorStrings.BAD_EXP_RECV<EOL>member = '<STR_LIT>'<EOL>raise TypeError(msg.format('<STR_LIT>'.format(name, member),<EOL>'<STR_LIT>', type(Name.NameValue),<EOL>type(name_value)))<EOL><DEDENT>if isinstance(name_type, Name.NameType):<EOL><INDENT>n_type = name_type<EOL><DEDENT>elif isinstance(name_type, Enum):<EOL><INDENT>n_type = cls.NameType(name_type)<EOL><DEDENT>else:<EOL><INDENT>name = '<STR_LIT:Name>'<EOL>msg = exceptions.ErrorStrings.BAD_EXP_RECV<EOL>member = '<STR_LIT>'<EOL>raise TypeError(msg.format('<STR_LIT>'.format(name, member),<EOL>'<STR_LIT>', type(Name.NameType),<EOL>type(name_type)))<EOL><DEDENT>return Name(name_value=value,<EOL>name_type=n_type)<EOL>
Returns a Name object, populated with the given value and type