MCPcopy Create free account
hub / github.com/LabPy/lantz / add

Method add

lantz/stats.py:72–81  ·  view source on GitHub ↗

Add an event to a given accumulator. :param key: category to which the event should be added. :param value: value of the event.

(self, key, value)

Source from the content-addressed store, hash-verified

70 """
71
72 def add(self, key, value):
73 """Add an event to a given accumulator.
74
75 :param key: category to which the event should be added.
76 :param value: value of the event.
77 """
78 if key in self:
79 super().__getitem__(key).add(value)
80 else:
81 super().__setitem__(key, RunningState(value))
82
83 def stats(self, key):
84 """Return the statistics for the current accumulator.

Callers 1

test_groupingMethod · 0.95

Calls 4

RunningStateClass · 0.85
addMethod · 0.45
__getitem__Method · 0.45
__setitem__Method · 0.45

Tested by 1

test_groupingMethod · 0.76