code: def or_(*constraints, **settings):  # XXX: not a decorator, should be?
      """create a constraint that is satisfied if any constraints are satisfied
  
      Inputs:
          constraints -- constraint functions
  
      Additional Inputs:
          maxiter -- maximum number of iterations to attempt to solve [default: 100]
          onexit -- function x' = f(x) to call on success [default: None]
          onfail -- function x' = f(x) to call on failure [default: None]
  
      NOTE:
          If a repeating cycle is detected, some of the inputs may be randomized.
      """
      import itertools as it
      import random as rnd
  
      n = len(constraints)
      if "maxiter" in settings:
          maxiter = settings["maxiter"] * n
          del settings["maxiter"]
      else:
          maxiter = 100 * n
      if "onexit" in settings:
          onexit = settings["onexit"]
          del settings["onexit"]
      else:
          onexit = None
      if "onfail" in settings:
          onfail = settings["onfail"]
          del settings["onfail"]
      else:
          onfail = None
  
      def _constraint(x):  # XXX: inefficient, rewrite without append
          x = [x.tolist() if hasattr(x, "tolist") else x[:]]
          # check if initial input is valid
          e = None
          for c in constraints:
              try:
                  ci = c(x[0][:])
              except ZeroDivisionError as exc:
                  e = exc
                  ci = x[0][:]  # XXX: do something else?
              except (TypeError, ValueError) as exc:
                  if exc.args[0].find("not supported") and exc.args[
                      0
                  ].rfind("'complex'"):
                      e = exc
                      ci = x[-1][:]  # XXX: do something else?
                  else:
                      raise exc
              x.append(ci.tolist() if hasattr(ci, "tolist") else ci)
              if x[-1] == x[0] and e is None:
                  return x[-1] if onexit is None else onexit(x[-1][:])
          # cycle constraints until there's no change
          _constraints = it.cycle(constraints)
          for j in range(n, maxiter):
              e = None
              try:
                  ci = next(_constraints)(x[-n][:])
              except ZeroDivisionError as exc:
                  e = exc
                  ci = x[-n][:]  # XXX: do something else?
              except (TypeError, ValueError) as exc:
                  if exc.args[0].find("not supported") and exc.args[
                      0
                  ].rfind("'complex'"):
                      e = exc
                      ci = x[-1][:]  # XXX: do something else?
                  else:
                      raise exc
              x.append(ci.tolist() if hasattr(ci, "tolist") else ci)
              if x[-1] == x[-(n + 1)] and e is None:
                  return x[-1] if onexit is None else onexit(x[-1][:])
              else:  # may be trapped in a rut... randomize
                  x[-1] = x[-rnd.randint(1, n)]
              if not j % (2 * n):
                  del x[:n]
          # give up #XXX: or fail with Error?
          return x[-1] if onfail is None else onfail(x[-1][:])
  
      cf = lambda x: _constraint(x)
      cfdoc = "\n-- OR --\n".join(
          c.__doc__ for c in constraints if c.__doc__
      )
      cfdoc = (
          "[ " + cfdoc + " ]" if cfdoc else cfdoc
      )  # XXX: can be [c] w/no OR
      cf.__doc__ = cfdoc.rstrip("\n")
      cf.__name__ = "constraint"
      return cf
  
imports: from mystic.math.measures import *
  from mystic.math import almostEqual
  from numpy import sum
  from numpy import asfarray, asarray, choose, zeros, ones, ndarray
  from numpy import shape, broadcast, empty, atleast_1d
  from numpy import round, abs
  from random import randrange, shuffle
  from numpy import array, intersect1d, inf, isnan, where, choose, clip
  from numpy.random import uniform, choice
  from numpy import maximum, minimum
  from numpy import round, abs
  from mystic.tools import synchronized, connected
  from mystic.math.discrete import product_measure
label_desc: Use image node_id 14 for calling a global function with example usage: or_() and returns: cf, unknown, unknown, unknown