code: def test_simple_graph(self):
      for input_type in [pd.DataFrame, SFrame, list]:
          g = SGraph()
          if input_type is list:
              vertices = [
                  Vertex(
                      x[1]["vid"],
                      {"color": x[1]["color"], "vec": x[1]["vec"]},
                  )
                  for x in self.vertices.iterrows()
              ]
              edges = [
                  Edge(
                      x[1]["src_id"],
                      x[1]["dst_id"],
                      {"weight": x[1]["weight"]},
                  )
                  for x in self.edges.iterrows()
              ]
              g = g.add_vertices(vertices)
              g = g.add_edges(edges)
          else:
              g = g.add_vertices(
                  input_type(self.vertices), vid_field="vid"
              )
              g = g.add_edges(
                  input_type(self.edges),
                  src_field="src_id",
                  dst_field="dst_id",
              )
          self.assertEqual(
              g.summary(), {"num_vertices": 4, "num_edges": 3}
          )
          self.assertItemsEqual(
              g.get_fields(),
              [
                  "__id",
                  "__src_id",
                  "__dst_id",
                  "color",
                  "vec",
                  "weight",
              ],
          )
          self.assertItemsEqual(
              g.get_vertices(format="dataframe").columns.values,
              ["color", "vec"],
          )
          self.assertItemsEqual(
              g.get_edges(format="dataframe").columns.values,
              ["__src_id", "__dst_id", "weight"],
          )
          self.assertTrue(g.get_edges(format="dataframe").shape, (3, 3))
          self.assertTrue(
              g.get_vertices(format="dataframe").shape, (4, 3)
          )
          self.assertTrue(
              g.get_vertices(
                  format="dataframe", fields={"color": "g"}
              ).shape,
              (1, 2),
          )
          self.assertTrue(
              g.get_edges(
                  format="dataframe", fields={"weight": 0.0}
              ).shape,
              (1, 3),
          )
  
          self.assertItemsEqual(
              g.get_vertices(format="sframe").column_names(),
              ["__id", "color", "vec"],
          )
          self.assertItemsEqual(
              g.get_edges(format="sframe").column_names(),
              ["__src_id", "__dst_id", "weight"],
          )
          self.assertTrue(g.get_edges(format="sframe").shape, (3, 3))
          self.assertTrue(g.get_vertices(format="sframe").shape, (4, 3))
          self.assertTrue(
              g.get_vertices(
                  format="sframe", fields={"color": "g"}
              ).shape,
              (1, 2),
          )
          self.assertTrue(
              g.get_edges(
                  format="sframe", fields={"weight": 0.0}
              ).shape,
              (1, 3),
          )
  
          vertices = g.get_vertices(format="list")
          edges = g.get_edges(format="list")
          self.assertEqual(len(vertices), 4)
          self.assertEqual(len(edges), 3)
  
          # get edges is lazy
          edges = g.get_edges()
          self.assertFalse(edges.__is_materialized__())
  
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 4 for calling the GraphTests obj's underlying member method code with example usage: obj.test_simple_graph() without return types