code: def _find_index_of_defining_frame(tb):
      """Return index in op.traceback with first 'useful' frame.
  
      This method reads through the stack stored in op.traceback looking for the
      innermost frame which (hopefully) belongs to the caller.  It accomplishes this
      by rejecting frames deemed to be part of the TensorFlow framework (by
      pattern matching the filename).
  
      Args:
        tb: A list of traceback frames (as from Operation.traceback).
  
      Returns:
        Integer index into op.traceback where the first non-TF file was found
        (innermost to outermost), or 0 (for the outermost stack frame) if all files
        came from TensorFlow.
      """
      # Index 0 of traceback is the outermost frame.
      size = len(tb)
      filenames = [frame.filename for frame in tb]
      # We process the filenames from the innermost frame to outermost.
      for idx, filename in enumerate(reversed(filenames)):
          is_framework = _is_framework_filename(filename)
          if not is_framework:
              # Consider this to be the defining frame.
              return size - idx - 1
      return 0
  
file_path: tensorflow-upstream/tensorflow/python/framework/error_interpolation.py
imports: import collections
  import os
  import re
  import site
  import traceback
  from tensorflow.python.util import tf_stack
label_desc: Use image node_id 7 for calling a global function with example usage: _find_index_of_defining_frame(tb) and returns: int, unknown