code: def test_terminators(
      test, func=lambda x: x[0], info=False, verbose=False, disp=False
  ):
      res = test(
          lambda x, y: "", func, info, verbose
      )  # XXX: just check settings
      if disp:
          print(res)
      else:
          assert bool(res) in (True, False)
      res = test(VTR(), func, info)
      if disp:
          print("VTR():%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(VTR(inf), func, info)
      if disp:
          print("VTR(inf):%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(ChangeOverGeneration(), func, info)
      if disp:
          print("COG():%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(ChangeOverGeneration(generations=5), func, info)
      if disp:
          print("COG(gen=5):%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(NormalizedChangeOverGeneration(), func, info)
      if disp:
          print("NCOG():%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(
          NormalizedChangeOverGeneration(generations=5), func, info
      )
      if disp:
          print("NCOG(gen=5):%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(CandidateRelativeTolerance(), func, info)
      if disp:
          print("CTR():%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(CandidateRelativeTolerance(ftol=inf), func, info)
      if disp:
          print("CTR(ftol=inf):%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(CandidateRelativeTolerance(inf), func, info)
      if disp:
          print("CTR(inf):%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(SolutionImprovement(), func, info)
      if disp:
          print("SI():%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(SolutionImprovement(inf), func, info)
      if disp:
          print("SI(inf):%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(NormalizedCostTarget(), func, info)
      if disp:
          print("NCT():%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(NormalizedCostTarget(generations=5), func, info)
      if disp:
          print("NCT(gen=5):%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(NormalizedCostTarget(generations=None), func, info)
      if disp:
          print("NCT(gen=None):%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(NormalizedCostTarget(inf, inf), func, info)
      if disp:
          print("NCT(inf,inf):%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(VTRChangeOverGeneration(), func, info)
      if disp:
          print("VCOG():%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(VTRChangeOverGeneration(generations=5), func, info)
      if disp:
          print("VCOG(gen=5):%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(VTRChangeOverGeneration(inf), func, info)
      if disp:
          print("VCOG(inf):%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(PopulationSpread(), func, info)
      if disp:
          print("PS():%s" % res)
      else:
          assert bool(res) in (True, False)
      res = test(PopulationSpread(inf), func, info)
      if disp:
          print("PS(inf):%s" % res)
      else:
          assert bool(res) in (True, False)
      # print("GNT():%s" % test(GradientNormTolerance(), func, info))
      return
  
file_path: mystic/mystic/tests/test_termination.py
imports: from mystic.termination import *
  from numpy import inf
label_desc: Use image node_id 1 for calling a global function with example usage: test_terminators(test, func, info, verbose, disp) without return types