code: def simple_extract_stack(f=None, limit=None, skips=[]):
      """This is traceback.extract_stack from python 2.7 with this change:
  
      - Comment the update of the cache.
      - Skip internal stack trace level.
  
      The update of the cache call os.stat to verify is the cache is up
      to date.  This take too much time on cluster.
  
      limit - The number of stack level we want to return. If None, mean
      all what we can.
  
      skips - partial path of stack level we don't want to keep and count.
          When we find one level that isn't skipped, we stop skipping.
  
      """
      if f is None:
          try:
              raise ZeroDivisionError
          except ZeroDivisionError:
              f = sys.exc_info()[2].tb_frame.f_back
      if limit is None:
          if hasattr(sys, "tracebacklimit"):
              limit = sys.tracebacklimit
      trace = []
      n = 0
      while f is not None and (limit is None or n < limit):
          lineno = f.f_lineno
          co = f.f_code
          filename = co.co_filename
          name = co.co_name
          #        linecache.checkcache(filename)
          line = linecache.getline(filename, lineno, f.f_globals)
          if line:
              line = line.strip()
          else:
              line = None
          f = f.f_back
  
          # Just skip inner level
          if len(trace) == 0:
              rm = False
              for p in skips:
                  # Julian: I added the 'tests' exception together with
                  # Arnaud.  Otherwise, we'd lose the stack trace during
                  # in our test cases (e.g. in test_opt.py). We're not
                  # sure this is the right way to do it though.
                  if p in filename and "tests" not in filename:
                      rm = True
                      break
              if rm:
                  continue
          trace.append((filename, lineno, name, line))
          n = n + 1
      trace.reverse()
      return trace
  
imports: from __future__ import absolute_import, print_function, division
  import linecache
  import sys
  import traceback
  import numpy
  from six import iteritems, integer_types, string_types, with_metaclass
  from six.moves import StringIO
  from theano import config
  from theano.compat import PY3
label_desc: Use image node_id 1 for calling a global function with example usage: simple_extract_stack(f, limit, skips) and returns: trace