from typing import Dict
from typing import Set
from typing import Any


def axis_keys(D: Dict, axis: int) -> Set[Any]:
    """Return set of keys at given axis.

    Parameters
    -------------------------------
    D: Dict
        Dictionary to determine keys of.
    Axis:int
        Depth of keys.

    Returns
    -------------------------------
    The set of keys at given axis
    """
    return set.union(*[
        axis_keys(d, axis-1) for d in D.values()
    ]) if axis else set(D.keys())