class_docstr: `MonitorMode` is a debug mode to easily step through function execution.
  
  Its default behavior is to behave like the 'FAST_RUN' mode. By providing
  either a `pre_func` (called before a node is executed) or a `post_func`
  (called after a node is executed) monitoring function, the user can inspect
  node behavior.
  
  A typical use case is to detect the introduction of NaN values in a graph.
  For an example of such a use case, see doc/tutorial/debug_faq.txt.
  
  Parameters
  ----------
  pre_func
      A function to call before executing a thunk, with arguments:
      - the thunk index
      - the Apply node
      - the thunk to be called
  post_func
      A function to call after executing a thunk, with the same three
      arguments as `pre_func`.
  optimizer
      The optimizer to use. One may use for instance 'fast_compile' to skip
      optimizations.
  linker
      DO NOT USE. This mode uses its own linker. The parameter is needed to
      allow selecting optimizers to use.
docstr: Create a new instance of this Mode.
  
  Keyword arguments can be provided for the linker, but they will be
  ignored, because MonitorMode needs to use its own linker.
code: def clone(self, link_kwargs=None, optimizer="", **kwargs):
      """
      Create a new instance of this Mode.
  
      Keyword arguments can be provided for the linker, but they will be
      ignored, because MonitorMode needs to use its own linker.
  
      """
      if optimizer == "":
          optimizer = self.provided_optimizer
      new_mode = type(self)(
          pre_func=self.pre_func,
          post_func=self.post_func,
          linker=None,
          optimizer=optimizer,
      )
      return new_mode
  
file_path: Theano/theano/compile/monitormode.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import theano
  from theano.compile.mode import Mode
label_desc: Use image node_id 5 for calling the MonitorMode obj's underlying member method code with example usage: obj.clone(link_kwargs, optimizer) and returns: new_mode