rekall.interval module

An Interval is a wrapper around a Bounds instance with a payload.

class rekall.interval.Interval(bounds, payload=None)

Bases: object

A single Interval.

An Interval is a wrapper around a Bounds and a payload. The payload can be referenced with the ‘payload’ key - i.e. interval['payload'], as can the fields of the Bounds. The bounds field itself can also be referenced with type ‘bounds’ key.

bounds

Bounds object.

payload

payload object.

P()

This wraps a predicate so it is applied to the payload of Intervals instead of the Intervals themselves.

The output function expects one or more Intervals as input (depending on how many arguments pred expects) and applies the predicate to the payloads of the Intervals instead of the Interavls themselves.

Arg:
pred: The predicate to wrap.
Returns:An output function that applies pred to payloads.
combine(other, bounds_combiner, payload_combiner=<function Interval.<lambda>>)

Combines two Intervals into one by separately combining the bounds and the payload.

Parameters:
  • other – The other Interval to combine with.
  • bounds_combiner – The function to combine the bounds. Takes two Bounds objects as input and returns one Bounds object.
  • payload_combiner – The function to combine the two payloads. Takes two payload objects as input and returns one payload object.
Returns:

A new Interval combined using bounds_combiner and payload_combiner.

copy()

Returns a copy of the Interval.

size(axis=None)

Get the size of the bounds along some axis.

Parameters:axis (optional) – The axis to compute size on. Represented as a pair of co-ordinates, such as ('t1', 't2'). Defaults to None, which uses the primary axis of self’s Bounds.
Returns:The size of the bounds across some axis.
to_json(payload_to_json)

Converts the interval to a JSON object.

Parameters:payload_to_json – Function that converts the payload to a JSON object.
Returns:JSON object for the interval