MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / add_attributes

Method add_attributes

easygraph/readwrite/graphml.py:822–828  ·  view source on GitHub ↗

Appends attribute data.

(self, scope, xml_obj, data, default)

Source from the content-addressed store, hash-verified

820 self.add_edges(G, incremental_writer) # adds attributes too
821
822 def add_attributes(self, scope, xml_obj, data, default):
823 """Appends attribute data."""
824 for k, v in data.items():
825 data_element = self.add_data(
826 str(k), self.attr_type(str(k), scope, v), str(v), scope, default.get(k)
827 )
828 xml_obj.append(data_element)
829
830 def __str__(self):
831 return object.__str__(self)

Callers 1

add_graph_elementMethod · 0.95

Calls 3

add_dataMethod · 0.80
attr_typeMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected