def validate_config(config):
    """
    Validates the extractor configuration file. Ensures that there are no duplicate field names, etc.

    :param config: The configuration file that contains the specification of the extractor
    :return: True if config is valid, else raises a exception that specifies the correction to be made

    """
    fields = [f for f in get_fields(config)]
    if len(fields) != len(set(fields)):
        raise InvalidConfigException(
            "Invalid configuration file - %d duplicate field names" % len(fields) - len(set(fields))
        )
    return True
Validates the extractor configuration file. Ensures that there are no duplicate field names, etc.

    :param config: The configuration file that contains the specification of the extractor
    :return: True if config is valid, else raises a exception that specifies the correction to be made