def _inflate_dotted(input_dict):
    """Convert flat dict with dotted key notation into nested dict.

    Given a flat dict with dotted keys for nested items, e.g.
        >>> input_dict = {'spam.eggs': 23, 'answer': 42}

    create a nested dict
        >>> output_dict = _inflate_dotted(input_dict)
        >>> output_dict == {'spam': {'eggs': 23}, 'answer': 42}
        True

    Args:
        dict: Flat dict with dotted key notation.

    Returns:
        dict: Nested dict.
    """
    output_dict = {}
    for key, value in input_dict.items():
        ref = output_dict
        parts = key.split('.')
        for part in parts[:-1]:
            if part not in ref:
                ref[part] = {}
            ref = ref[part]
        ref[parts[-1]] = value
    return output_dict