def _trace_data(start, obj, cmd, vids, **kwargs):
    if not _get_trace_local():
        return None

    if not _trace_check_limits(obj, cmd, vids):
        return None

    elapse = time.time() - start

    if not coro.has_local(CORO_LOCAL_TDATA):
        coro.set_local(CORO_LOCAL_TDATA, {})
        
    data = coro.get_local(CORO_LOCAL_TDATA)
    data = data.setdefault(obj, {})

    look = not isinstance(vids, (list, tuple)) and 1 or len(vids)

    data[cmd] = sum_tuple(data.get(cmd, (0, 0, 0)), (elapse, look, 1))

    if _get_trace_local() > ACCESS_TRACE_DEBUG:
        stack = pyinfo.rawstack()
        stack = stack[:-5] # remove 5 levels of mod_python, publisher
        while stack and stack[0][0].startswith('access'):
            stack.pop(0)
        stack = ' @ %s' % '|'.join(['%s:%s:%s' % x for x in stack])
    else:
        stack = ''

    if _get_trace_local() < ACCESS_TRACE_DEBUG:
        return None

    print 'Access | %.4f | obj: %s cmd: %s vid: %s args: %s kwargs: %s%s' % (
        elapse, obj, cmd, vids,
        kwargs.get('args', ()), kwargs.get('kwargs', {}),
        stack)
dataset/ETHPy150Open slideinc/notifier/notifier/access.py/_trace_data/original