def find_key(d, nested_key):
    """Attempt to find key in dict, where key may be nested key1.key2..."""
    keys = nested_key.split('.')
    key = keys[0]

    return (d[key] if len(keys) == 1 and key in d else
            None if len(keys) == 1 and key not in d else
            None if not isinstance(d[key], dict) else
            find_key(d[key], '.'.join(keys[1:])) if key in d else
            None)