def cls_conf_from_config_dict(config, type_iter):
    """
    Helper function for getting the appropriate type and configuration
    sub-dictionary based on the provided "standard" SMQTK configuration
    dictionary format (see above module documentation).

    :param dict config:
        Configuration dictionary to draw from.

    :param collections.Iterable[type] type_iter:
        An iterable of class types to select from.

    :raises ValueError:
        This may be raised if:
            - type field not present in ``config``.
            - type field set to ``None``
            - type field did not match any available configuration in the given
              config.
            - Type field did not specify any implementation key.

    :return: Appropriate class type from ``type_iter`` that matches the
        configured type as well as the sub-dictionary from the configuration.
        From this return, ``type.from_config(config)`` should be callable.
    :rtype: (type, dict)
    """
    if 'type' not in config:
        raise ValueError(
            'Configuration dictionary given does not have an implementation type specification.'
            )
    conf_type_name = config['type']
    type_map = dict(map(lambda t: (t.__name__, t), type_iter))
    conf_type_options = set(config.keys()) - {'type'}
    if conf_type_name is None:
        raise ValueError('No implementation type specified. Options: %s' %
            list(conf_type_options))
    elif conf_type_name not in conf_type_options:
        raise ValueError(
            "Implementation type specified as '%s', but no configuration block was present for that type. Available configuration block options: %s"
             % (conf_type_name, list(conf_type_options)))
    elif conf_type_name not in type_map:
        raise ValueError(
            "Implementation type specified as '%s', but no plugin implementations are available for that type. Available implementation types options: %s"
             % (conf_type_name, list(type_map)))
    cls = type_map[conf_type_name]
    return cls, config[conf_type_name]
