MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / LineCountWorker

Class LineCountWorker

example_code/item_052.py:81–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79
80print("Example 4")
81class LineCountWorker(Worker):
82 def map(self):
83 data = self.input_data.read()
84 self.result = data.count("\n")
85
86 def reduce(self, other):
87 self.result += other.result
88
89
90print("Example 5")

Callers 1

create_workersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected