code: def iter_subclasses(cls, _seen=None, template_classes=[]):
      """
      Generator to iterate over all the subclasses of Model. Based on
  
      http://code.activestate.com/recipes/576949-find-all-subclasses-of-a-given-class/
  
      Yields class
      """
      if not isinstance(cls, type):
          raise TypeError(
              "itersubclasses must be called with "
              "new-style classes, not %.100r" % cls
          )
      if _seen is None:
          _seen = set()
      try:
          subs = cls.__subclasses__()
      except TypeError:  # fails only when cls is type
          subs = cls.__subclasses__(cls)
      for sub in subs:
          if sub not in _seen and sub.__name__ not in template_classes:
              _seen.add(sub)
              # we do not want to yield the templates, but we do want to
              # recurse on them
              yield sub
          for sub in iter_subclasses(sub, _seen, template_classes):
              yield sub
  
imports: import os
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: iter_subclasses(cls, _seen, template_classes) without return types