'Is this frame worth displaying in python backtraces?
Examples:
- waiting on the GIL
- garbage-collecting
- within a CFunction
If it is, return a descriptive string
For other frames, return False'

def is_other_python_frame(self):

    if self.is_waiting_for_gil():
        return 'Waiting    for    the    GIL'
    if self.is_gc_collect():
        return 'Garbage-collecting'
    frame = self._gdbframe
    caller = frame.name()
    if (not caller):
        return False
    if (caller in ('_PyCFunction_FastCallDict', '_PyCFunction_FastCallKeywords')):
        arg_name = 'func'
        try:
            func = frame.read_var(arg_name)
            return str(func)
        except RuntimeError:
            return ('PyCFunction    invocation    (unable    to    read    %s)' % arg_name)
    if (caller == 'wrapper_call'):
        try:
            func = frame.read_var('wp')
            return str(func)
        except RuntimeError:
            return '<wrapper_call    invocation>'
    return False
