def merge_all_config_sections_into_a_single_dict(desired_type: Type[T], config: ConfigParser, logger: Logger,
                                                 conversion_finder: ConversionFinder, **kwargs) -> Dict[str, Any]:
    """
    Helper method to convert a 'configparser' into a dictionary [property > value].
    Properties from all sections are collected. If the same key appears in several sections, an
    error will be thrown

    :param file_object:
    :return:
    """

    # convert the whole config to a dictionary by flattening all sections. If a key is found twice in two different
    # sections an error is raised
    results = dict()
    for section, props in config.items():
        for key, value in props.items():
            if key in results.keys():
                # find all sections where it appears
                sections_where_it_appears = [s for s, p in config.items() if key in p.keys()]
                raise MultipleKeyOccurenceInConfigurationError.create(key, sections_where_it_appears)
            else:
                results[key] = value

    return ConversionFinder.convert_collection_values_according_to_pep(results, desired_type, conversion_finder,
                                                                       logger, **kwargs)
def merge_all_config_sections_into_a_single_dict ( desired_type : Type [ T ] , config : ConfigParser , logger : Logger , conversion_finder : ConversionFinder , ** kwargs ) -> Dict [ str , Any ] : results = dict ( ) for section , props in config . items ( ) : for key , value in props . items ( ) : if key in results . keys ( ) : sections_where_it_appears = [ s for s , p in config . items ( ) if key in p . keys ( ) ] raise MultipleKeyOccurenceInConfigurationError . create ( key , sections_where_it_appears ) else : results [ key ] = value return ConversionFinder . convert_collection_values_according_to_pep ( results , desired_type , conversion_finder , logger , ** kwargs )
Helper method to convert a 'configparser' into a dictionary [property > value].
    Properties from all sections are collected. If the same key appears in several sections, an
    error will be thrown

    :param file_object:
    :return: