def _ReadDictionary(filename):
    'Read environment variable from file.\n\n  File format:\n\n  It is intended (but not guaranteed) to follow standard docker format\n  [](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file)\n  but without capturing environment variables from host machine.\n  Lines starting by "#" character are comments.\n  Empty lines are ignored.\n  Below grammar production follow in EBNF format.\n\n  file = (whitespace* statement \'\\n\')*\n  statement = comment\n            | definition\n  whitespace = \' \'\n             | \'\\t\'\n  comment = \'#\' [^\\n]*\n  definition = [^#=\\n] [^= \\t\\n]* \'=\' [^\\n]*\n\n  Args:\n    filename: str, name of the file to read\n\n  Returns:\n    A dictionary mapping environment variable names to their values.\n  '
    env_vars = {}
    if (not filename):
        return env_vars
    with files.FileReader(filename) as f:
        for (i, line) in enumerate(f):
            line = line.strip()
            if ((len(line) <= 1) or (line[0] == '#')):
                continue
            assignment_op_loc = line.find('=')
            if (assignment_op_loc == (- 1)):
                raise calliope_exceptions.BadFileException('Syntax error in {}:{}: Expected VAR=VAL, got {}'.format(filename, i, line))
            env = line[:assignment_op_loc]
            val = line[(assignment_op_loc + 1):]
            if ((' ' in env) or ('\t' in env)):
                raise calliope_exceptions.BadFileException('Syntax error in {}:{} Variable name cannot contain whitespaces, got "{}"'.format(filename, i, env))
            env_vars[env] = val
    return env_vars
Read environment variable from file.

File format:

It is intended (but not guaranteed) to follow standard docker format
[](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file)
but without capturing environment variables from host machine.
Lines starting by "#" character are comments.
Empty lines are ignored.
Below grammar production follow in EBNF format.

file = (whitespace* statement '\n')*
statement = comment
          | definition
whitespace = ' '
           | '\t'
comment = '#' [^\n]*
definition = [^#=\n] [^= \t\n]* '=' [^\n]*

Args:
  filename: str, name of the file to read

Returns:
  A dictionary mapping environment variable names to their values.
def _ReadDictionary(filename):
    'Read environment variable from file.\n\n  File format:\n\n  It is intended (but not guaranteed) to follow standard docker format\n  [](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file)\n  but without capturing environment variables from host machine.\n  Lines starting by "#" character are comments.\n  Empty lines are ignored.\n  Below grammar production follow in EBNF format.\n\n  file = (whitespace* statement \'\\n\')*\n  statement = comment\n            | definition\n  whitespace = \' \'\n             | \'\\t\'\n  comment = \'#\' [^\\n]*\n  definition = [^#=\\n] [^= \\t\\n]* \'=\' [^\\n]*\n\n  Args:\n    filename: str, name of the file to read\n\n  Returns:\n    A dictionary mapping environment variable names to their values.\n  '
    env_vars = {}
    if (not filename):
        return env_vars
    with files.FileReader(filename) as f:
        for (i, line) in enumerate(f):
            line = line.strip()
            if ((len(line) <= 1) or (line[0] == '#')):
                continue
            assignment_op_loc = line.find('=')
            if (assignment_op_loc == (- 1)):
                raise calliope_exceptions.BadFileException('Syntax error in {}:{}: Expected VAR=VAL, got {}'.format(filename, i, line))
            env = line[:assignment_op_loc]
            val = line[(assignment_op_loc + 1):]
            if ((' ' in env) or ('\t' in env)):
                raise calliope_exceptions.BadFileException('Syntax error in {}:{} Variable name cannot contain whitespaces, got "{}"'.format(filename, i, env))
            env_vars[env] = val
    return env_vars