code: def testSetFilenameAndLineFromCallerRespectsOffset(self):
      def call_set_filename_and_line_from_caller(t_obj):
          # We expect to retrieve the line number from _our_ caller.
          return t_obj.set_filename_and_line_from_caller(offset=1)
  
      t_obj = traceable_stack.TraceableObject(None)
      # Do not separate placeholder from the
      # call_set_filename_and_line_from_caller() call one line below it as it is
      # used to calculate the latter's line number.
      placeholder = lambda x: x
      result = call_set_filename_and_line_from_caller(t_obj)
  
      expected_lineno = inspect.getsourcelines(placeholder)[1] + 1
      self.assertEqual(expected_lineno, t_obj.lineno)
      self.assertEqual(t_obj.SUCCESS, result)
  
file_path: tensorflow-upstream/tensorflow/python/framework/traceable_stack_test.py
imports: from tensorflow.python.framework import test_util
  from tensorflow.python.framework import traceable_stack
  from tensorflow.python.platform import googletest
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 2 for calling the TraceableObjectTest obj's underlying member method code with example usage: obj.testSetFilenameAndLineFromCallerRespectsOffset() and returns: t_obj