def get_dotted_val_in_dict(d, keys):
    """Searches dict d for element in keys.

    Args:
        d (dict): Dictionary to search
        keys (str): String containing element to search for

    Returns:
        Value found at the specified element if found, else None

    Examples:

        Search for the value of foo['bar'] in {'foo': {'bar': 1}}
        >>> get_dotted_val_in_dict({'foo': {'bar': 1}}, 'foo.bar')
        1

        Search for the value of foo['baz'] in {'foo': {'bar': 1}}
        >>> get_dotted_val_in_dict({'foo': {'bar': 1}}, 'foo.baz')
    """

    if "." in keys:
        key, rest = keys.split(".", 1)
        dval = d.get(key, {})
        if isinstance(dval, dict):
            return get_dotted_val_in_dict(dval, rest)
    else:
        if d.get(keys):
            return d[keys]