parameters: (keyvals)
return_statement: return vars
docstring: Parse variable assignments passed as arguments in the command line
docstring_summary: Parse variable assignments passed as arguments in the command line
docstring_tokens: Parse variable assignments passed as arguments in the command line
function: def parse_variables(keyvals):
    """Parse variable assignments passed as arguments in the command line"""
    kv_pattern = r'(%s)=(.*)$' % (ImpalaShell.VALID_VAR_NAME_PATTERN,)
    vars = {}
    if keyvals:
      for keyval in keyvals:
        match = re.match(kv_pattern, keyval)
        if not match:
          print('Error: Could not parse key-value "%s". ' % (keyval,) +
                'It must follow the pattern "KEY=VALUE".', file=sys.stderr)
          parser.print_help()
          raise FatalShellException()
        else:
          vars[match.groups()[0].upper()] = replace_variables(vars, match.groups()[1])
    return vars
function_tokens: def parse_variables ( keyvals ) : kv_pattern = r'(%s)=(.*)$' % ( ImpalaShell . VALID_VAR_NAME_PATTERN , ) vars = { } if keyvals : for keyval in keyvals : match = re . match ( kv_pattern , keyval ) if not match : print ( 'Error: Could not parse key-value "%s". ' % ( keyval , ) + 'It must follow the pattern "KEY=VALUE".' , file = sys . stderr ) parser . print_help ( ) raise FatalShellException ( ) else : vars [ match . groups ( ) [ 0 ] . upper ( ) ] = replace_variables ( vars , match . groups ( ) [ 1 ] ) return vars