code: def test_save_load(self):
      g = (
          SGraph()
          .add_vertices(self.vertices, "vid")
          .add_edges(self.edges, "src_id", "dst_id")
      )
      with util.TempDirectory() as f:
          g.save(f)
          g2 = load_sgraph(f, "binary")
          self.assertEqual(
              g2.summary(), {"num_vertices": 4, "num_edges": 3}
          )
          self.assertItemsEqual(
              g2.get_fields(),
              {
                  "__id",
                  "__src_id",
                  "__dst_id",
                  "color",
                  "vec",
                  "weight",
              },
          )
  
      with util.TempDirectory() as f:
          g.save(f, format="csv")
          vertices = SFrame.read_csv(f + "/vertices.csv")
          edges = SFrame.read_csv(f + "/edges.csv")
          g2 = (
              SGraph()
              .add_edges(edges, "__src_id", "__dst_id")
              .add_vertices(vertices, "__id")
          )
          self.assertEqual(
              g2.summary(), {"num_vertices": 4, "num_edges": 3}
          )
          self.assertItemsEqual(
              g2.get_fields(),
              {
                  "__id",
                  "__src_id",
                  "__dst_id",
                  "color",
                  "vec",
                  "weight",
              },
          )
  
      temp_fn = None
      # The delete=False is for Windows sake
      with tempfile.NamedTemporaryFile(
          suffix=".json", delete=False
      ) as f:
          temp_fn = f.name
          g.save(f.name)
          with open(f.name, "r") as f2:
              data = f2.read()
              g2 = json.loads(data)
          self.assertTrue("vertices" in g2)
          self.assertTrue("edges" in g2)
      if os.path.exists(temp_fn):
          os.remove(temp_fn)
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from ..data_structures.sgraph import SGraph, Vertex, Edge, load_sgraph
  from ..data_structures.sframe import SFrame
  from .None import util
  import pandas
  from pandas.util.testing import assert_frame_equal
  import numpy
  import unittest
  import tempfile
  import json
  import os
  import sys
  import pytest
label_desc: Use image node_id 8 for calling the GraphTests obj's underlying member method code with example usage: obj.test_save_load() without return types