

def get_stack(limit=10):
    if (not DEBUG):
        return ()
    frame = sys._getframe(1)
    lines = []
    while ((len(lines) < limit) and (frame is not None)):
        f_locals = frame.f_locals
        ndb_debug = f_locals.get('__ndb_debug__')
        if (ndb_debug != 'SKIP'):
            line = frame_info(frame)
            if (ndb_debug is not None):
                line += (' # ' + str(ndb_debug))
            lines.append(line)
        frame = frame.f_back
    return lines

dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/ndb/utils.py get_stack/original