def recursive_get(d, attr, default=None, sep='.'):
    """
    Recursive getter with default dot separation
    :param d:
    :param attr:
    :param default:
    :param sep:
    :return:
    """
    if not isinstance(attr, str):
        return default
    if not isinstance(d, dict) or not dict:
        return default
    if sep:
        items = attr.split(sep)
    else:
        items = [attr]
    root = d
    for p in items:
        if p in root:
            root = root[p]
        else:
            return default
    return root
