code: def stop_func(s, v):
      if s is None:
          return (v, False)
  
      return (min(v, s), v > s)
  
file_path: neon/examples/early_stopping.py
imports: import os
  from neon.data import MNIST
  from neon.initializers import Gaussian
  from neon.layers import GeneralizedCost, Affine
  from neon.models import Model
  from neon.optimizers import GradientDescentMomentum
  from neon.transforms import Rectlin, Logistic, CrossEntropyBinary
  from neon.callbacks.callbacks import Callbacks
  from neon.util.argparser import NeonArgparser
label_desc: Use image node_id 1 for calling a global function with example usage: stop_func(s, v) and returns: min,  unknown, v,  False