def import_dotted_name(name):
    """Get an object by its "dotted name", a string representing its import
    location. The last dot can also be a colon instead.

    .. versionadded:: 0.6

    """
    name = str(name)
    if ':' in name:
        module, obj = name.split(':', 1)
    elif '.' in name:
        module, obj = name.rsplit('.', 1)
    else:
        return __import__(name, level=0)
    mod = __import__(module, fromlist=[obj], level=0)
    return getattr(mod, obj)