code: def _fixed_getframes(etb, context=1, tb_offset=0):
      LNUM_POS, LINES_POS, INDEX_POS = 2, 4, 5
  
      records = fix_frame_records_filenames(
          inspect.getinnerframes(etb, context)
      )
  
      # If the error is at the console, don't build any context, since it would
      # otherwise produce 5 blank lines printed out (there is no file at the
      # console)
      rec_check = records[tb_offset:]
      try:
          rname = rec_check[0][1]
          if rname == "<ipython console>" or rname.endswith("<string>"):
              return rec_check
      except IndexError:
          pass
  
      aux = traceback.extract_tb(etb)
      assert len(records) == len(aux)
      for i, (file, lnum, _, _) in enumerate(aux):
          maybeStart = lnum - 1 - context // 2
          start = max(maybeStart, 0)
          end = start + context
          lines = linecache.getlines(file)[start:end]
          # pad with empty lines if necessary
          if maybeStart < 0:
              lines = (["\n"] * -maybeStart) + lines
          if len(lines) < context:
              lines += ["\n"] * (context - len(lines))
          buf = list(records[i])
          buf[LNUM_POS] = lnum
          buf[INDEX_POS] = lnum - 1 - start
          buf[LINES_POS] = lines
          records[i] = tuple(buf)
      return records[tb_offset:]
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/externals/joblib/format_stack.py
imports: import inspect
  import keyword
  import linecache
  import os
  import pydoc
  import sys
  import time
  import tokenize
  import traceback
label_desc: Use image node_id 5 for calling a global function with example usage: _fixed_getframes(etb, context, tb_offset) and returns: records, rec_check