code: def function(inputs, outputs, updates=None, name=None):
      """
      Function simulates behaviour of the Theano's functions.
  
      Parameters
      ----------
      inputs : list
          List of input placeholders
  
      outputs : list, Tensor
          Output that has to be computed by the function
  
      updates : list or None
          List of the updates that has to be performed on the variables.
          The ``None`` value means that no updates will be applied at the
          end of the computation. Defaults to ``None``.
  
      name : str or None
          Defaults to ``None``.
  
      Returns
      -------
      function
      """
      if updates is None:
          updates = []
  
      session = tensorflow_session()
      tensorflow_updates = []
  
      # Ensure that all new values has been computed. Absence of these
      # checks might lead to the non-deterministic update behaviour.
      new_values = [
          val[1] for val in updates if isinstance(val, (list, tuple))
      ]
  
      # Make sure that all outputs has been computed
      with tf.control_dependencies(as_tuple(outputs, new_values)):
          for update in updates:
              if isinstance(update, (list, tuple)):
                  old_value, new_value = update
                  update = old_value.assign(new_value)
              tensorflow_updates.append(update)
  
          # Group variables in order to avoid output for the updates
          tensorflow_updates = tf.group(*tensorflow_updates)
  
      @wraps(function)
      def wrapper(*input_values):
          feed_dict = dict(zip(inputs, input_values))
          result, _ = session.run(
              [outputs, tensorflow_updates],
              feed_dict=feed_dict,
          )
          return result
  
      return wrapper
  
file_path: neupy/neupy/utils/tf_utils.py
imports: from functools import wraps
  import numpy
  import tensorflow
  from neupy.utils.misc import as_tuple
  from neupy.utils.processing import asfloat
label_desc: Use image node_id 1 for calling a global function with example usage: function(inputs, outputs, updates, name) and returns: wrapper, result