def nested_getattr(baseobject, attribute):
    """  Returns the value of an attribute of an object that is nested
    several layers deep.

    Parameters
    ----------
    baseobject : this seriously can be anything
        The top-level object
    attribute : string
        Any string of what you want.

    Returns
    -------
    output : object
        No telling what type it is. It depends on what you ask for.

    Examples
    --------
    >>> class Level_1:
    ...     a = 1
    >>> class Level_2:
    ...     b = Level_1()
    >>> x = Level_2()
    >>> nested_getattr(x, 'b.a')
    1

    """

    for attr in attribute.split("."):
        baseobject = getattr(baseobject, attr)
    return baseobject