class_docstr: Base class for stack trace transformation functions.
class_docstr_tok: ["Base","class","for","stack","trace","transformation","functions","."]
code: def __enter__(self):
      # Any given instance is assumed to be used by a single thread, which reduces
      # expensive thread local lookups.
      if self._thread_key is None:
          self._thread_key = _get_thread_key()
      else:
          assert (
              self._thread_key == _get_thread_key()
          ), "Shared across threads?"
  
      stack = self._stack_dict[self._thread_key]
      self.parent = stack[-1]
      stack.append(self)
      self.update()
      return self
  
imports: import collections
  import inspect
  import threading
  from tensorflow.core.framework import graph_debug_info_pb2
  from tensorflow.python.util import _tf_stack
label_desc: Use image node_id 1 for calling the StackTraceTransform obj's underlying member method code with example usage: obj.__enter__() and returns: self