def METHOD_NAME(self, type_or_type_name):
    """ Returns the full dotted path for a type.
    For example:
    from traits.api import HasTraits
    _get_type_name(HasTraits) == 'traits.has_traits.HasTraits'
    If the type is given as a string (e.g., for lazy loading), it is just
    returned.
    """
    if isinstance(type_or_type_name, str):
        type_name = type_or_type_name
    else:
        type_name = "{module}.{name}".format(
            module=type_or_type_name.__module__,
            name=type_or_type_name.__name__,
        )
    return type_name