# Path: ronin/utils/unicode.py



from .unicode import string, to_str
from inspect import isclass
    Imports a symbol based on its fully qualified name.
    
    :param name: symbol name
    :type name: str
    :returns: symbol
    :raises ImportError: if could not import the module
    :raises AttributeError: if could not find the symbol in the module
    """
    
    if name and ('.' in name):
        module_name, name = name.rsplit('.', 1)
        return getattr(__import__(module_name, fromlist=[name], level=0), name)
    raise ImportError('import not found: {}'.format(name))


def type_name(the_type):
    """
    Human-readable name of type(s). Built-in types will avoid the "__builtin__" prefix.

    Tuples are always handled as a join of "|". 
    
    :param the_type: type(s)
    :type the_type: type|(type)
    :returns: name of type(s)
    :rtype: str
    """

    if isinstance(the_type, tuple):
        return '|'.join([type_name(v) for v in the_type])    
    module = to_str(the_type.__module__)

# Path: ronin/utils/unicode.py



# Path: ronin/utils/types.py
from .unicode import string, to_str
from inspect import isclass

    Imports a symbol based on its fully qualified name.
    
    :param name: symbol name
    :type name: str
    :returns: symbol
    :raises ImportError: if could not import the module
    :raises AttributeError: if could not find the symbol in the module
    """
    
    if name and ('.' in name):
        module_name, name = name.rsplit('.', 1)
        return getattr(__import__(module_name, fromlist=[name], level=0), name)
    raise ImportError('import not found: {}'.format(name))


def type_name(the_type):
    """
    Human-readable name of type(s). Built-in types will avoid the "__builtin__" prefix.

    Tuples are always handled as a join of "|". 
    
    :param the_type: type(s)
    :type the_type: type|(type)
    :returns: name of type(s)
    :rtype: str
    """

    if isinstance(the_type, tuple):
        return '|'.join([type_name(v) for v in the_type])    
    module = to_str(the_type.__module__)

    name = to_str(the_type.__name__)