def find_nested_attr(config, attr):
    """
    Takes a config dictionary and an attribute string as input and tries to
    find the attribute in the dictionary. The attribute may use dots to
    indicate levels of depth within the dictionary.

    Example:
    find_nested_attr({'one': {'two': {'three': 3}}}, 'one.two.three')
    --> 3
    """
    obj = config.copy()
    for section in attr.split('.'):
        obj = obj[section]
    return obj
