code: def test_gframe(self):
      g = SGraph()
      v = g.vertices
      self.assertSequenceEqual(v.column_names(), ["__id"])
      e = g.edges
      self.assertSequenceEqual(
          e.column_names(), ["__src_id", "__dst_id"]
      )
  
      # Test vertices and edge attributes cannot be modified
      def set_vertices_empty(g):
          g.vertices = SFrame()
  
      def set_edges_empty(g):
          g.edges = SFrame()
  
      def remove_vertices(g):
          del g.vertices
  
      def remove_edges(g):
          del g.edges
  
      def remove_edge_column(gf, name):
          del gf[name]
  
      self.assertRaises(AttributeError, lambda: remove_vertices(g))
      self.assertRaises(AttributeError, lambda: remove_edges(g))
      self.assertRaises(AttributeError, lambda: set_vertices_empty(g))
      self.assertRaises(AttributeError, lambda: set_edges_empty(g))
  
      # Test gframe operations has the same effect as its sframe+graph equivalent
      g = (
          SGraph()
          .add_vertices(self.vertices, "vid")
          .add_edges(self.edges, "src_id", "dst_id")
      )
      v = g.vertices
      v["id_col"] = v["__id"]
      e = g.edges
      e["src_id_col"] = e["__src_id"]
      e["dst_id_col"] = e["__dst_id"]
      g2 = (
          SGraph()
          .add_vertices(self.vertices, "vid")
          .add_edges(self.edges, "src_id", "dst_id")
      )
      new_vdata = g2.get_vertices()
      new_vdata["id_col"] = new_vdata["__id"]
      new_edata = g2.get_edges()
      new_edata["src_id_col"] = new_edata["__src_id"]
      new_edata["dst_id_col"] = new_edata["__dst_id"]
      g2 = (
          SGraph()
          .add_vertices(new_vdata, "__id")
          .add_edges(new_edata, "__src_id", "__dst_id")
      )
      assert_frame_equal(
          g.get_vertices()
          .to_dataframe()
          .sort_values("__id")
          .reset_index(drop=True),
          g2.get_vertices()
          .to_dataframe()
          .sort_values("__id")
          .reset_index(drop=True),
      )
      assert_frame_equal(
          g.get_edges()
          .to_dataframe()
          .sort_values(["__src_id", "__dst_id"])
          .reset_index(drop=True),
          g2.get_edges()
          .to_dataframe()
          .sort_values(["__src_id", "__dst_id"])
          .reset_index(drop=True),
      )
  
      # check delete a column with exception, and edges is still in a valid state
      self.assertRaises(
          KeyError, lambda: remove_edge_column(g.edges, "badcolumn")
      )
      g.edges.head()
  
      # test slicing
      assert_frame_equal(
          g.edges[:3].to_dataframe(), g.get_edges()[:3].to_dataframe()
      )
      assert_frame_equal(
          g.vertices[:3].to_dataframe(),
          g.get_vertices()[:3].to_dataframe(),
      )
  
      # test add row number
      e_expected = g.get_edges().to_dataframe()
      v_expected = g.get_vertices().to_dataframe()
      e_expected["id"] = range(len(e_expected))
      v_expected["id"] = range(len(v_expected))
  
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 12 for calling the GraphTests obj's underlying member method code with example usage: obj.test_gframe() without return types