def hasnested(container, *chain):
    """Checks if chain contains in container.

    Parameters
    ----------
    container: `collections.abc.Container`
    chain: tuple
        List of keywords.

    Returns
    -------
    out: bool
        True if `chain[0]` in container and `chain[1]` in `container[chain[0]]` etc.
        or if chain is empty, else False.
    """
    key, chain = chain[0], chain[1:]
    if key in container:
        return hasnested(container[key], *chain) if chain else True
    return False