code: def _recursive_attribute_processor(
      attribute: AttributeProto,
      func: Callable[[GraphProto], Iterable[TensorProto]],
  ) -> Iterable[TensorProto]:
      """Create an iterator through processing ONNX model attributes with functor."""
      if attribute.type == AttributeProto.GRAPH:
          yield from func(attribute.g)
      if attribute.type == AttributeProto.GRAPHS:
          for graph in attribute.graphs:
              yield from func(graph)
  
imports: import os
  import re
  import sys
  import uuid
  from itertools import chain
  from typing import Callable, Iterable, Optional
  from onnx.onnx_pb import AttributeProto, GraphProto, ModelProto, TensorProto
label_desc: Use image node_id 8 for calling a global function with example usage: _recursive_attribute_processor(attribute, func) without return types