code: def compile_func(inputs, outputs):
      if isinstance(inputs, list) == False:
          print("Wrapping the inputs in a list...")
          inputs = [inputs]
      assert isinstance(inputs, list)
  
      def func_to_return(inp):
          if len(inp) > len(inputs) and len(inputs) == 1:
              print("Wrapping the inputs in a list...")
              inp = [inp]
          assert len(inp) == len(inputs), (
              "length of provided list should be "
              + str(len(inputs))
              + " for tensors "
              + str(inputs)
              + " but got input of length "
              + str(len(inp))
          )
          feed_dict = {}
          for input_tensor, input_val in zip(inputs, inp):
              feed_dict[input_tensor] = input_val
          sess = get_session()
          return sess.run(outputs, feed_dict=feed_dict)
  
      return func_to_return
  
imports: from __future__ import division
  from __future__ import print_function
  from __future__ import absolute_import
  import sys
  import os
  import os.path
  import numpy
  from collections import namedtuple
  from collections import OrderedDict
  import json
  import deeplift
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: compile_func(inputs, outputs) and returns: func_to_return, sess