code: def iterator(
      network_filter: str = "*", clear_sessions: bool = False
  ) -> Iterator[Model]:
      """Iterator over various neural networks. Networks can be filtered by name.
  
      :param network_filter: Names of the networks that should be part of the iterator.
          Use delimiter `:` to separate names, `*` as wildcard. Defaults to `*`.
      :type network_filter: str, optional
      :param clear_sessions: Flag that clears Keras backend session
          before loading each network, defaults to False.
      :type clear_sessions: bool, optional
      """
  
      networks = (
          _fetch_networks("trivia", trivia, network_filter)
          + _fetch_networks("mnist", mnist, network_filter)
          + _fetch_networks("imagenet", imagenet, network_filter)
      )
  
      for _module_name, (module, name) in networks:
          if clear_sessions:
              kbackend.clear_session()
          network: Model = getattr(module, name)()
          yield network
  
file_path: innvestigate/tests/networks/__init__.py
imports: from __future__ import annotations
  import fnmatch
  import types
  from typing import Iterator
  import tensorflow.keras.backend
  from innvestigate.backend.types import Model
  from tests.networks import imagenet, mnist, trivia
label_desc: Use image node_id 1 for calling a global function with example usage: iterator(network_filter, clear_sessions) without return types