def find_all_stacktraces(data):
 rv = []
 exc_container = data.get('sentry.interfaces.Exception')
 if exc_container:
  for exc in exc_container['values']:
   stacktrace = exc.get('stacktrace')
   if stacktrace:
    rv.append((stacktrace, exc))
 stacktrace = data.get('sentry.interfaces.Stacktrace')
 if stacktrace:
  rv.append((stacktrace, None))
 threads = data.get('threads')
 if threads:
  for thread in threads['values']:
   stacktrace = thread.get('stacktrace')
   if stacktrace:
    rv.append((stacktrace, thread))
 return rv

def find_all_stacktraces ( data ) : rv = [ ] exc_container = data . get ( 'sentry.interfaces.Exception' ) if exc_container : for exc in exc_container [ 'values' ] : stacktrace = exc . get ( 'stacktrace' ) if stacktrace : rv . append ( ( stacktrace , exc ) ) stacktrace = data . get ( 'sentry.interfaces.Stacktrace' ) if stacktrace : rv . append ( ( stacktrace , None ) ) threads = data . get ( 'threads' ) if threads : for thread in threads [ 'values' ] : stacktrace = thread . get ( 'stacktrace' ) if stacktrace : rv . append ( ( stacktrace , thread ) ) return rv
given a data dictionary from an event this returns all relevant stacktraces in a list .