Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias alias alias Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Lambda arguments args NameParam NameParam defaults CompareLt NameLoad NameLoad Lambda arguments args NameParam NameParam defaults CompareGt NameLoad NameLoad Lambda arguments args NameParam NameParam defaults CompareEq NameLoad NameLoad Lambda arguments args NameParam NameParam defaults CompareNotEq NameLoad NameLoad Lambda arguments args NameParam NameParam defaults CompareLtE NameLoad NameLoad Lambda arguments args NameParam NameParam defaults CompareGtE NameLoad NameLoad Lambda arguments args NameParam NameParam defaults CompareIn NameLoad NameLoad Lambda arguments args NameParam NameParam defaults CompareNotIn NameLoad NameLoad Lambda arguments args NameParam NameParam defaults Call NameLoad ListComp CompareIn NameLoad NameLoad comprehension NameStore NameLoad Lambda arguments args NameParam NameParam defaults CompareEq BinOpMod NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Lambda arguments args NameParam NameParam defaults BoolOpOr BoolOpAnd NameLoad CompareIsNot NameLoad NameLoad BoolOpAnd CompareIs NameLoad NameLoad UnaryOpNot NameLoad ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If UnaryOpNot Call NameLoad NameLoad NameLoad body Return NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Call NameLoad Str decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Call NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If UnaryOpNot Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If Call NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad Lambda arguments args NameParam defaults CompareEq NameLoad NameLoad For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If Call AttributeLoad NameLoad attr NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Dict Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str For NameStore NameLoad body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str NameLoad Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Delete SubscriptDel AttributeLoad NameLoad attr Index SubscriptLoad NameLoad Index Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Return ListComp Call AttributeLoad NameLoad attr NameLoad NameLoad comprehension NameStore NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Return Call NameLoad NameLoad keyword Lambda arguments args NameParam defaults SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Str decorator_list decorator_list
N/A N/A A Task logger that presents our DB interface, 
but exists entirely in memory and implemented with dicts.

Authors:

* Min RK


TaskRecords are dicts of the form:
{
    'msg_id' : str(uuid),
    'client_uuid' : str(uuid),
    'engine_uuid' : str(uuid) or None,
    'header' : dict(header),
    'content': dict(content),
    'buffers': list(buffers),
    'submitted': datetime,
    'started': datetime or None,
    'completed': datetime or None,
    'resubmitted': datetime or None,
    'result_header' : dict(header) or None,
    'result_content' : dict(content) or None,
    'result_buffers' : list(buffers) or None,
}
With this info, many of the special categories of tasks can be defined by query:

pending:  completed is None
client's outstanding: client_uuid = uuid && completed is None
MIA: arrived is None (and completed is None)
etc.

EngineRecords are dicts of the form:
{
    'eid' : int(id),
    'uuid': str(uuid)
}
This may be extended, but is currently.

We support a subset of mongodb operators:
    $lt,$gt,$lte,$gte,$ne,$in,$nin,$all,$mod,$exists
 datetime datetime IPython.config.configurable LoggingConfigurable IPython.utils.traitlets Dict Unicode Instance N/A filters N/A $lt $gt $eq $ne $lte $gte $in $nin $all $mod $exists N/A N/A N/A a b N/A N/A a b N/A N/A N/A a b N/A N/A b a N/A N/A N/A a b N/A N/A a b N/A N/A N/A a b N/A N/A a b N/A N/A N/A a b N/A N/A a b N/A N/A N/A a b N/A N/A a b N/A N/A N/A a b N/A N/A a b N/A N/A N/A a b N/A N/A a b N/A N/A N/A a b N/A N/A all N/A N/A a bb N/A bb b N/A N/A N/A a b N/A N/A N/A a N/A b N/A 0 N/A b N/A 1 N/A N/A N/A a b N/A N/A N/A b N/A a None N/A N/A a None N/A b CompositeFilter N/A object N/A N/A Composite filter for matching multiple properties. __init__ N/A N/A self dikt N/A N/A N/A N/A self tests N/A N/A N/A self values N/A N/A N/A key value N/A N/A dikt items N/A N/A N/A N/A N/A self tests append N/A filters N/A key N/A N/A N/A N/A self values append value N/A __call__ N/A N/A self value N/A N/A N/A N/A test check N/A zip N/A self tests N/A self values N/A N/A N/A N/A test value check N/A N/A False N/A True N/A N/A BaseDB N/A LoggingConfigurable N/A N/A Empty Parent class so traitlets work on DB. N/A session N/A Unicode N/A DictDB N/A BaseDB N/A N/A Basic in-memory dict-based object for saving Task Records.
    
    This is the first object to present the DB interface
    for logging tasks out of memory.
    
    The interface is based on MongoDB, so adding a MongoDB
    backend should be straightforward.
     N/A _records N/A Dict _match_one N/A N/A self rec tests N/A N/A N/A Check if a specific record matches tests. N/A N/A key test N/A N/A tests items N/A N/A N/A N/A test N/A N/A rec get key None N/A N/A False N/A True N/A _match N/A N/A self check N/A N/A N/A Find all the matches for a check dict. N/A matches N/A N/A tests N/A N/A N/A k v N/A N/A check items N/A N/A N/A isinstance v dict N/A N/A N/A tests N/A k N/A CompositeFilter v N/A N/A N/A tests N/A k N/A N/A N/A o N/A N/A o v N/A rec N/A N/A N/A self _records values N/A N/A N/A N/A self _match_one rec tests N/A N/A N/A N/A matches append rec N/A matches N/A _extract_subdict N/A N/A self rec keys N/A N/A N/A extract subdict of keys N/A d N/A N/A N/A d N/A msg_id N/A rec N/A msg_id N/A key keys N/A N/A N/A d N/A key N/A rec N/A key N/A d N/A add_record N/A N/A self msg_id rec N/A N/A N/A Add a new Task Record, by msg_id. N/A N/A msg_id N/A self _records N/A N/A N/A KeyError N/A Already have msg_id %r msg_id N/A N/A N/A self _records N/A msg_id rec N/A get_record N/A N/A self msg_id N/A N/A N/A Get a specific Task Record, by msg_id. N/A N/A msg_id N/A self _records N/A N/A N/A KeyError N/A No such msg_id %r msg_id N/A N/A N/A self _records N/A msg_id N/A update_record N/A N/A self msg_id rec N/A N/A N/A Update the data in an existing record. N/A N/A N/A N/A N/A self _records N/A msg_id update rec N/A drop_matching_records N/A N/A self check N/A N/A N/A Remove a record from the DB. N/A matches N/A N/A self _match check N/A m matches N/A N/A N/A N/A self _records N/A N/A m N/A msg_id N/A drop_record N/A N/A self msg_id N/A N/A N/A Remove a record from the DB. N/A N/A N/A self _records N/A msg_id N/A find_records N/A N/A self check keys N/A None N/A N/A Find records matching a query dict, optionally extracting subset of keys.
        
        Returns dict keyed by msg_id of matching records.
        
        Parameters
        ----------
        
        check: dict
            mongodb-style query argument
        keys: list of strs [optional]
            if specified, the subset of keys to extract.  msg_id will *always* be
            included.
         N/A matches N/A N/A self _match check N/A keys N/A N/A N/A N/A N/A self _extract_subdict rec keys N/A rec matches N/A N/A matches N/A get_history N/A N/A self N/A N/A N/A get all msg_ids, ordered by time submitted. N/A msg_ids N/A list N/A N/A N/A self _records keys N/A N/A sorted msg_ids key N/A N/A N/A m N/A N/A N/A N/A self _records N/A m N/A submitted N/A N/A