def validate_config_section(filename, config, section):
 if (not isinstance(config, dict)):
  raise ConfigurationError(u"In file '{filename}', {section} must be a mapping, not {type}.".format(filename=filename, section=section, type=anglicize_json_type(python_type_to_yaml_type(config))))
 for (key, value) in config.items():
  if (not isinstance(key, six.string_types)):
   raise ConfigurationError(u"In file '{filename}', the {section} name {name} must be a quoted string, i.e. '{name}'.".format(filename=filename, section=section, name=key))
  if (not isinstance(value, (dict, type(None)))):
   raise ConfigurationError(u"In file '{filename}', {section} '{name}' must be a mapping not {type}.".format(filename=filename, section=section, name=key, type=anglicize_json_type(python_type_to_yaml_type(value))))

def validate_config_section ( filename , config , section ) : if ( not isinstance ( config , dict ) ) : raise ConfigurationError ( u"In file '{filename}', {section} must be a mapping, not {type}." . format ( filename = filename , section = section , type = anglicize_json_type ( python_type_to_yaml_type ( config ) ) ) ) for ( key , value ) in config . items ( ) : if ( not isinstance ( key , six . string_types ) ) : raise ConfigurationError ( u"In file '{filename}', the {section} name {name} must be a quoted string, i.e. '{name}'." . format ( filename = filename , section = section , name = key ) ) if ( not isinstance ( value , ( dict , type ( None ) ) ) ) : raise ConfigurationError ( u"In file '{filename}', {section} '{name}' must be a mapping not {type}." . format ( filename = filename , section = section , name = key , type = anglicize_json_type ( python_type_to_yaml_type ( value ) ) ) )
validate the structure of a configuration section .