def class_name_for_data_type(data_type, ns=None):
assert is_user_defined_type(data_type) or is_alias(data_type),'<STR_LIT>' % type(data_type)<EOL>name = fmt_class(data_type.name)<EOL>if ns:<EOL><INDENT>return prefix_with_ns_if_necessary(name, data_type.namespace, ns)<EOL><DEDENT>return name<EOL>
Returns the name of the Python class that maps to a user-defined type.
The name is identical to the name in the spec.

If ``ns`` is set to a Namespace and the namespace of `data_type` does
not match, then a namespace prefix is added to the returned name.
For example, ``foreign_ns.TypeName``.