def _adjust(frames, srcpath):
    '''For each frame, find the function called in the
       source file near the line number from  addr2line
       and if found adjust the line number accordingly.
    '''
    def _cmp(f1, f2):
        if f1.file < f2.file:
            return -1
        if f1.file > f2.file:
            return +1
        return 0
     # sort frames by file
    frames.sort(_cmp)
     # cache source lines
    p, t, r = '', [], 0
    for f in frames:
        if f.call and f.call.name and f.file != '??':
             # get source file as lines
            p, t = _source(_which(f.file, srcpath), p, t)
            if t:  # find nearest line(s)
                n = _search(f.call.name, t, int(f.line.rstrip()))
                if n:  # adjust frame line
                    f.line = '+'.join([str(i) for i in n]) + '*' + os.linesep
                    r += len(n)
    return r  # number of adjustments
For each frame, find the function called in the
       source file near the line number from  addr2line
       and if found adjust the line number accordingly.
    
recipes/Python/534147_backtrace2line__stack_traces_source_file_name/recipe-534147.py