MCPcopy Create free account
hub / github.com/RingBDStack/GDAP / EventSchema

Class EventSchema

extraction/event_schema.py:8–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class EventSchema:
9 def __init__(self, type_list, role_list, type_role_dict):
10 self.type_list = type_list
11 self.role_list = role_list
12 self.type_role_dict = type_role_dict
13
14 @staticmethod
15 def read_from_file(filename):
16 lines = open(filename).readlines()
17 type_list = json.loads(lines[0])
18 role_list = json.loads(lines[1])
19 type_role_dict = json.loads(lines[2])
20 return EventSchema(type_list, role_list, type_role_dict)
21
22 def write_to_file(self, filename):
23 with open(filename, 'w') as output:
24 output.write(json.dumps(self.type_list) + '\n')
25 output.write(json.dumps(self.role_list) + '\n')
26 output.write(json.dumps(self.type_role_dict) + '\n')
27
28
29def merge_schema(schema_list: List[EventSchema]):

Callers 2

read_from_fileMethod · 0.85
merge_schemaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected