def parse_configuration(node, base_config=None):
test_config = base_config<EOL>if not test_config:<EOL><INDENT>test_config = TestConfig()<EOL><DEDENT>node = lowercase_keys(flatten_dictionaries(node))  <EOL>for key, value in node.items():<EOL><INDENT>if key == u'<STR_LIT>':<EOL><INDENT>test_config.timeout = int(value)<EOL><DEDENT>elif key == u'<STR_LIT>':<EOL><INDENT>test_config.print_bodies = safe_to_bool(value)<EOL><DEDENT>elif key == u'<STR_LIT>':<EOL><INDENT>test_config.retries = int(value)<EOL><DEDENT>elif key == u'<STR_LIT>':<EOL><INDENT>if not test_config.variable_binds:<EOL><INDENT>test_config.variable_binds = dict()<EOL><DEDENT>test_config.variable_binds.update(flatten_dictionaries(value))<EOL><DEDENT>elif key == u'<STR_LIT>':<EOL><INDENT>flat = flatten_dictionaries(value)<EOL>gen_map = dict()<EOL>for generator_name, generator_config in flat.items():<EOL><INDENT>gen = parse_generator(generator_config)<EOL>gen_map[str(generator_name)] = gen<EOL><DEDENT>test_config.generators = gen_map<EOL><DEDENT><DEDENT>return test_config<EOL>
Parse input config to configuration information