def _generate_custom_annotation_processors(self, ns, data_type, extra_annotations=()):
<EOL>dt, _, _ = unwrap(data_type)<EOL>if is_struct_type(dt) or is_union_type(dt):<EOL><INDENT>annotation_types_seen = set()<EOL>for annotation in get_custom_annotations_recursive(dt):<EOL><INDENT>if annotation.annotation_type not in annotation_types_seen:<EOL><INDENT>yield (annotation.annotation_type,<EOL>generate_func_call(<EOL>'<STR_LIT>',<EOL>args=[class_name_for_annotation_type(annotation.annotation_type, ns),<EOL>'<STR_LIT>']<EOL>))<EOL>annotation_types_seen.add(annotation.annotation_type)<EOL><DEDENT><DEDENT><DEDENT>elif is_list_type(dt):<EOL><INDENT>for annotation_type, recursive_processor in self._generate_custom_annotation_processors(<EOL>ns, dt.data_type):<EOL><INDENT>yield (annotation_type,<EOL>generate_func_call(<EOL>'<STR_LIT>',<EOL>args=[recursive_processor]<EOL>))<EOL><DEDENT><DEDENT>elif is_map_type(dt):<EOL><INDENT>for annotation_type, recursive_processor in self._generate_custom_annotation_processors(<EOL>ns, dt.value_data_type):<EOL><INDENT>yield (annotation_type,<EOL>generate_func_call(<EOL>'<STR_LIT>',<EOL>args=[recursive_processor]<EOL>))<EOL><DEDENT><DEDENT>for annotation in itertools.chain(get_custom_annotations_for_alias(data_type),<EOL>extra_annotations):<EOL><INDENT>yield (annotation.annotation_type,<EOL>generate_func_call(<EOL>'<STR_LIT>',<EOL>args=['<STR_LIT>', self._generate_custom_annotation_instance(ns, annotation)]<EOL>))<EOL><DEDENT>
Generates code that will run a custom function 'processor' on every
field with a custom annotation, no matter how deep (recursively) it
might be located in data_type (incl. in elements of lists or maps).
If extra_annotations is passed, it's assumed to be a list of custom
annotation applied directly onto data_type (e.g. because it's a field
in a struct).
Yields pairs of (annotation_type, code) where code is code that
evaluates to a function that should be executed with an instance of
data_type as the only parameter, and whose return value should replace
that instance.