class_docstr: A stack of TraceableObjects.
class_docstr_tok: ["A","stack","of","TraceableObjects","."]
docstr: Add object to the stack and record its filename and line information.
  
  Args:
    obj: An object to store on the stack.
    offset: Integer.  If 0, the caller's stack frame is used.  If 1,
        the caller's caller's stack frame is used.
  
  Returns:
    TraceableObject.SUCCESS if appropriate stack information was found,
    TraceableObject.HEURISTIC_USED if the stack was smaller than expected,
    and TraceableObject.FAILURE if the stack was empty.
docstr_tok: ["Add","object","to","the","stack","and","record","its","filename","and","line","information",".","Args",":","obj",":","An","object","to","store","on","the","stack",".","offset",":","Integer",".","If","0",",","the","caller","'s","stack","frame","is","used",".","If","1",",","the","caller","'s","caller","'s","stack","frame","is","used",".","Returns",":","TraceableObject.SUCCESS","if","appropriate","stack","information","was","found",",","TraceableObject.HEURISTIC_USED","if","the","stack","was","smaller","than","expected",",","and","TraceableObject.FAILURE","if","the","stack","was","empty","."]
code: def push_obj(self, obj: T, offset: int = 0):
      """Add object to the stack and record its filename and line information.
  
      Args:
        obj: An object to store on the stack.
        offset: Integer.  If 0, the caller's stack frame is used.  If 1,
            the caller's caller's stack frame is used.
  
      Returns:
        TraceableObject.SUCCESS if appropriate stack information was found,
        TraceableObject.HEURISTIC_USED if the stack was smaller than expected,
        and TraceableObject.FAILURE if the stack was empty.
      """
      traceable_obj = TraceableObject(obj)
      self._stack.append(traceable_obj)
      # Offset is defined in "Args" as relative to the caller.  We are 1 frame
      # beyond the caller and need to compensate.
      return traceable_obj.set_filename_and_line_from_caller(offset + 1)
  
file_path: tensorflow/tensorflow/python/framework/traceable_stack.py
imports: from collections.abc import Iterator
  import inspect
  import types
  from typing import cast, Generic, Optional, TypeVar
label_desc: Use image node_id 2 for calling the TraceableStack obj's underlying member method code with example usage: obj.push_obj(obj, offset) and returns: traceable_obj