Get a type given its importable name.

    Parameters
    ----------
    task_name : `str`
        Name of the Python type, such as ``mypackage.MyClass``.

    Returns
    -------
    object
        The object.

def get_type(type_name):
    """Get a type given its importable name.

    Parameters
    ----------
    task_name : `str`
        Name of the Python type, such as ``mypackage.MyClass``.

    Returns
    -------
    object
        The object.
    """
    parts = type_name.split('.')
    if len(parts) < 2:
        raise SphinxError(
            'Type must be fully-qualified, '
            'of the form ``module.MyClass``. Got: {}'.format(type_name)
        )
    module_name = ".".join(parts[0:-1])
    name = parts[-1]
    return getattr(import_module(module_name), name)