code: def _register_simplify_fn(fn):
      """Wraps and registers simplification functions.
  
      A simplification function takes as input an expression and possible
      some other args/kwargs, and returns either None (if it did not find
      anything to do at this node) or a simplified version of the graph
      below this node.
  
      The wrapped function will repeatedly apply this simplification
      function to all nodes of the graph until it stops doing anything.
      """
  
      def wrapped(expr, *args, **kwargs):
          result = fn(expr, *args, **kwargs)
          if result is None:
              did_something = False
              new_args = []
              for i in expr[1:]:
                  did_something_i, new_arg = wrapped(i)
                  did_something = did_something or did_something_i
                  new_args.append(new_arg)
              return did_something, (expr[0],) + tuple(new_args)
          else:
              return True, result
  
      def repeat_wrapped(expr, *args, **kwargs):
          did_something = False
          did_something_i = True
          while did_something_i:
              did_something_i, expr = wrapped(expr, *args, **kwargs)
              did_something = did_something or did_something_i
          return did_something, expr
  
      _simplify_fns.append(repeat_wrapped)
      return repeat_wrapped
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
label_desc: Use image node_id 6 for calling a global function with example usage: _register_simplify_fn(fn) and returns: repeat_wrapped, did_something,  expr, did_something,  unknown, True,  result