def METHOD_NAME(sid, cachedir=None):
    """
    For all entities in the session, create simple event tuples, and return
    them as a list
    [     [otype , oid   , pid   , timestamp, event name, odoc]]
    list(tuple(string, string, string, datetime , string    , dict))
    """
    docs = get_session_docs(sid, cachedir=cachedir)
    ret  = list()
    if  'session' in docs:
        doc   = docs['session']
        odoc  = dict()
        otype = 'session'
        oid   = doc['uid']
        ret.append(['state', otype, oid, None, doc['created'],
                    'created',   odoc])
        ret.append(['state', otype, oid, None, doc['connected'],
                    'connected', odoc])
    for doc in docs['pilot']:
        odoc  = dict()
        otype = 'pilot'
        oid   = doc['uid']
        for event in ['input_transfer_started',  'input_transfer_finished',
                      'output_transfer_started', 'output_transfer_finished']:
            if  event in doc:
                ret.append (['state', otype, oid, oid, doc[event], event, odoc])
            else:
                ret.append (['state', otype, oid, oid, None,       event, odoc])
        if  'callbackhistory' in doc:
            for event in doc['callbackhistory']:
                ret.append (['callback',  otype, oid, oid, event['timestamp'],
                             event['state'], odoc])
    for doc in docs['task']:
        odoc  = dict()
        otype = 'task'
        oid   = doc['uid']
        pid   = doc['pilot']
        # TODO: change states to look for
        for event in ['input_transfer_started',  'input_transfer_finished',
                      'output_transfer_started', 'output_transfer_finished']:
            if  event in doc:
                ret.append (['state', otype, oid, pid, doc[event], event, doc])
            else:
                ret.append (['state', otype, oid, pid, None,       event, doc])
        # TODO: this probably needs to be "doc"
        if  'callbackhistory' in event:
            for event in doc['callbackhistory']:
                ret.append (['callback',  otype, oid, pid, event['timestamp'],
                             event['state'], doc])
    # we don't want None times, actually
    for r in list(ret):
        if  r[4] is None:
            ret.remove (r)
    ret.sort (key=lambda tup: tup[4])
    return ret