code: def add_tag_trace(thing, user_line=None):
      """
      Add tag.trace to an node or variable.
  
      The argument is returned after being affected (inplace).
  
      Parameters
      ----------
      thing
          The object where we add .tag.trace.
      user_line
          The max number of user line to keep.
  
      Notes
      -----
      We also use config.traceback.limit for the maximum number of stack level
      we look.
  
      """
      if user_line is None:
          user_line = config.traceback.limit
  
      if user_line == -1:
          user_line = None
      skips = [
          "theano/tensor/",
          "theano\\tensor\\",
          "theano/compile/",
          "theano\\compile\\",
          "theano/gof/",
          "theano\\gof\\",
          "theano/scalar/basic.py",
          "theano\\scalar\\basic.py",
          "theano/sandbox/",
          "theano\\sandbox\\",
          "theano/scan_module/",
          "theano\\scan_module\\",
          "theano/sparse/",
          "theano\\sparse\\",
          "theano/typed_list/",
          "theano\\typed_list\\",
      ]
  
      if config.traceback.compile_limit > 0:
          skips = []
  
      tr = simple_extract_stack(limit=user_line, skips=skips)
      # Different python version use different sementic for
      # limit. python 2.7 include the call to extrack_stack. The -1 get
      # rid of it.
  
      if tr:
          thing.tag.trace = [tr]
      else:
          thing.tag.trace = tr
      return thing
  
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 2 for calling a global function with example usage: add_tag_trace(thing, user_line) and returns: thing