def get_env_dict(root_section):
env_lago = defaultdict(dict)<EOL>decider = re.compile(<EOL>(<EOL>r'<STR_LIT>'<EOL>r'<STR_LIT>'<EOL>r'<STR_LIT>'<EOL>).format(root_section.upper())<EOL>)<EOL>for key, value in os.environ.iteritems():<EOL><INDENT>match = decider.match(key)<EOL>if not match:<EOL><INDENT>continue<EOL><DEDENT>if not match.group('<STR_LIT:name>') or not value:<EOL><INDENT>warn(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(key)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>section = match.group('<STR_LIT>') or root_section<EOL>env_lago[section.lower()][match.group('<STR_LIT:name>').lower()] = value<EOL><DEDENT><DEDENT>return dict(env_lago)<EOL>
Read all Lago variables from the environment.
    The lookup format is:
    LAGO_VARNAME - will land into 'lago' section
    LAGO__SECTION1__VARNAME - will land into 'section1' section, notice
    the double '__'.
    LAGO__LONG_SECTION_NAME__VARNAME - will land into 'long_section_name'


    Returns:
        dict: dict of section configuration dicts

    Examples:
        >>> os.environ['LAGO_GLOBAL_VAR'] = 'global'
        >>> os.environ['LAGO__INIT__REPO_PATH'] = '/tmp/store'
        >>>
        >>> config.get_env_dict()
        {'init': {'repo_path': '/tmp/store'}, 'lago': {'global_var': 'global'}}