code: def iter_except(func, exception, first=None):
      """Yields results from a function repeatedly until an exception is raised.
  
      Converts a call-until-exception interface to an iterator interface.
      Like ``iter(func, sentinel)``, but uses an exception instead of a sentinel
      to end the loop.
  
          >>> l = [0, 1, 2]
          >>> list(iter_except(l.pop, IndexError))
          [2, 1, 0]
  
      """
      try:
          if first is not None:
              yield first()
          while 1:
              yield func()
      except exception:
          pass
  
imports: from collections import deque
  from itertools import chain, combinations, count, cycle, groupby, islice, repeat, starmap, tee
  import operator
  from random import randrange, sample, choice
  from six import PY2
  from six.moves import filter, filterfalse, map, range, zip, zip_longest
label_desc: Use image node_id 21 for calling a global function with example usage: iter_except(func, exception, first) without return types