def classes_in_namespaces_converter_with_compression(<EOL>reference_namespace={},<EOL>template_for_namespace="<STR_LIT>",<EOL>list_splitter_fn=_default_list_splitter,<EOL>class_extractor=_default_class_extractor,<EOL>extra_extractor=_default_extra_extractor):
<EOL>def class_list_converter(class_list_str):<EOL><INDENT>"""<STR_LIT>"""<EOL>if isinstance(class_list_str, str):<EOL><INDENT>class_str_list = list_splitter_fn(class_list_str)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>class InnerClassList(RequiredConfig):<EOL><INDENT>"""<STR_LIT>"""<EOL>required_config = Namespace()<EOL>subordinate_namespace_names = []<EOL>namespace_template = template_for_namespace<EOL>original_input = class_list_str.replace('<STR_LIT:\n>', '<STR_LIT>')<EOL>class_list = []<EOL>for namespace_index, class_list_element in enumerate(<EOL>class_str_list<EOL>):<EOL><INDENT>try:<EOL><INDENT>a_class = class_converter(<EOL>class_extractor(class_list_element)<EOL>)<EOL><DEDENT>except CannotConvertError:<EOL><INDENT>raise JobNotFoundError(class_list_element)<EOL><DEDENT>class_list.append((a_class.__name__, a_class))<EOL>namespace_name_dict = {<EOL>'<STR_LIT:name>': a_class.__name__,<EOL>'<STR_LIT:index>': namespace_index<EOL>}<EOL>namespace_name = template_for_namespace % namespace_name_dict<EOL>subordinate_namespace_names.append(namespace_name)<EOL>required_config.namespace(namespace_name)<EOL>a_class_namespace = required_config[namespace_name]<EOL>try:<EOL><INDENT>extra_options = extra_extractor(class_list_element)<EOL>a_class_namespace.update(extra_options)<EOL><DEDENT>except NotImplementedError:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>for k, v in a_class.get_required_config().items():<EOL><INDENT>if k not in reference_namespace:<EOL><INDENT>a_class_namespace[k] = v<EOL><DEDENT><DEDENT><DEDENT>except AttributeError:  <EOL><INDENT>pass<EOL><DEDENT><DEDENT>@classmethod<EOL>def to_str(cls):<EOL><INDENT>"""<STR_LIT>"""<EOL>return cls.original_input<EOL><DEDENT><DEDENT>return InnerClassList  <EOL><DEDENT>return class_list_converter<EOL>
parameters:
    template_for_namespace - a template for the names of the namespaces
                             that will contain the classes and their
                             associated required config options.  There are
                             two template variables available: %(name)s -
                             the name of the class to be contained in the
                             namespace; %(index)d - the sequential index
                             number of the namespace.
    list_converter - a function that will take the string list of classes
                     and break it up into a sequence if individual elements
    class_extractor - a function that will return the string version of
                      a classname from the result of the list_converter
    extra_extractor - a function that will return a Namespace of options
                      created from any extra information associated with
                      the classes returned by the list_converter function