MCPcopy Create free account
hub / github.com/apache/devlake / DummyStream

Class DummyStream

backend/python/pydevlake/tests/stream_test.py:35–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34
35class DummyStream(Stream):
36 tool_model = DummyToolModel
37 domain_types = [DomainType.CROSS]
38
39 def collect(self, state, context):
40 for i, each in enumerate(context.connection.raw_data):
41 count = state.get("count", 0)
42 yield each, {"count": count + i}
43
44 def extract(self, raw) -> ToolModel:
45 return DummyToolModel(
46 id=raw["i"],
47 name=raw["n"]
48 )
49
50 def convert(self, tm, ctx):
51 return DummyDomainModel(
52 ID=tm.id,
53 Name=tm.name,
54 )
55
56
57class DummyConnection(Connection):

Callers 1

streamFunction · 0.85

Calls

no outgoing calls

Tested by 1

streamFunction · 0.68