code: def parse(self, data):
      for node in data["nodes"]:
          self.parse_node(node)
      for edge in data["edges"]:
          self.parse_edge(edge)
      for idx in range(0, self.partition_num):
          print("convert data for partition:%d ..." % (idx))
          print(
              "partition: %d, node cnt:%d, edge cnt:%d"
              % (idx, self.nodes_cnt[idx], self.edges_cnt[idx])
          )
          for n in self.nodes:
              if int(n) % self.partition_num == idx:
                  s = self.nodes[n].Serialize()
                  self.node_out[idx].write(
                      write_correct_data("string", s)
                  )
          for e in self.edges:
              if int(e.src_id) % self.partition_num == idx:
                  s = e.Serialize()
                  self.edge_out[idx].write(
                      write_correct_data("string", s)
                  )
  
file_path: euler/euler/tools/json2partdat.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import errno
  import json
  import sys
  import struct
  from euler.tools.util import *
  from euler.tools.node import Node
  from euler.tools.edge import Edge
  from euler.tools.graph_meta import GraphMeta
  import os
label_desc: Use image node_id 3 for calling the Converter obj's underlying member method code with example usage: obj.parse(data) without return types