class_docstr: A scalable graph data structure. The SGraph data structure allows arbitrary
  dictionary attributes on vertices and edges, provides flexible vertex and
  edge query functions, and seamless transformation to and from
  :class:`~turicreate.SFrame`.
  
  There are several ways to create an SGraph. The simplest way is to make an
  empty SGraph then add vertices and edges with the :py:func:`add_vertices`
  and :py:func:`add_edges` methods. SGraphs can also be created from vertex
  and edge lists stored in :class:`~turicreate.SFrames`. Columns of these
  SFrames not used as vertex IDs are assumed to be vertex or edge attributes.
  
  Please see the `User Guide
  <https://apple.github.io/turicreate/docs/userguide/sgraph/sgraph.html>`_
  for a more detailed introduction to creating and working with SGraphs.
  
  Parameters
  ----------
  vertices : SFrame, optional
      Vertex data. Must include an ID column with the name specified by
      the `vid_field` parameter. Additional columns are treated as vertex
      attributes.
  
  edges : SFrame, optional
      Edge data. Must include source and destination ID columns as specified
      by `src_field` and `dst_field` parameters. Additional columns are treated
      as edge attributes.
  
  vid_field : str, optional
      The name of vertex ID column in the `vertices` SFrame.
  
  src_field : str, optional
      The name of source ID column in the `edges` SFrame.
  
  dst_field : str, optional
      The name of destination ID column in the `edges` SFrame.
  
  See Also
  --------
  SFrame
  
  Notes
  -----
  - SGraphs are *structurally immutable*. In the example below, the
    :func:`~add_vertices` and :func:`~add_edges` commands both return a new
    graph; the old graph gets garbage collected.
  
  Examples
  --------
  >>> from turicreate import SGraph, Vertex, Edge
  >>> g = SGraph()
  >>> verts = [Vertex(0, attr={'breed': 'labrador'}),
               Vertex(1, attr={'breed': 'labrador'}),
               Vertex(2, attr={'breed': 'vizsla'})]
  >>> g = g.add_vertices(verts)
  >>> g = g.add_edges(Edge(1, 2))
class_docstr_tok: ["A","scalable","graph","data","structure",".","The","SGraph","data","structure","allows","arbitrary","dictionary","attributes","on","vertices","and","edges",",","provides","flexible","vertex","and","edge","query","functions",",","and","seamless","transformation","to","and","from",":","class",":","`","~turicreate.SFrame","`",".","There","are","several","ways","to","create","an","SGraph",".","The","simplest","way","is","to","make","an","empty","SGraph","then","add","vertices","and","edges","with","the",":","py",":","func",":","`","add_vertices","`","and",":","py",":","func",":","`","add_edges","`","methods",".","SGraphs","can","also","be","created","from","vertex","and","edge","lists","stored","in",":","class",":","`","~turicreate.SFrames","`",".","Columns","of","these","SFrames","not","used","as","vertex","IDs","are","assumed","to","be","vertex","or","edge","attributes",".","Please","see","the","`","User","Guide","<","https",":","\/\/apple.github.io\/turicreate\/docs\/userguide\/sgraph\/sgraph.html",">","`","_","for","a","more","detailed","introduction","to","creating","and","working","with","SGraphs",".","Parameters","--","--","--","--","--","vertices",":","SFrame",",","optional","Vertex","data",".","Must","include","an","ID","column","with","the","name","specified","by","the","`","vid_field","`","parameter",".","Additional","columns","are","treated","as","vertex","attributes",".","edges",":","SFrame",",","optional","Edge","data",".","Must","include","source","and","destination","ID","columns","as","specified","by","`","src_field","`","and","`","dst_field","`","parameters",".","Additional","columns","are","treated","as","edge","attributes",".","vid_field",":","str",",","optional","The","name","of","vertex","ID","column","in","the","`","vertices","`","SFrame",".","src_field",":","str",",","optional","The","name","of","source","ID","column","in","the","`","edges","`","SFrame",".","dst_field",":","str",",","optional","The","name","of","destination","ID","column","in","the","`","edges","`","SFrame",".","See","Also","--","--","--","--","SFrame","Notes","--","--","-","-","SGraphs","are","*","structurally","immutable","*",".","In","the","example","below",",","the",":","func",":","`","~add_vertices","`","and",":","func",":","`","~add_edges","`","commands","both","return","a","new","graph",";","the","old","graph","gets","garbage","collected",".","Examples","--","--","--","--",">",">",">","from","turicreate","import","SGraph",",","Vertex",",","Edge",">",">",">","g","=","SGraph","(",")",">",">",">","verts","=","[","Vertex","(","0",",","attr=","{","'breed","'",":","'labrador","'","}",")",",","Vertex","(","1",",","attr=","{","'breed","'",":","'labrador","'","}",")",",","Vertex","(","2",",","attr=","{","'breed","'",":","'vizsla","'","}",")","]",">",">",">","g","=","g.add_vertices","(","verts",")",">",">",">","g","=","g.add_edges","(","Edge","(","1",",","2",")",")"]
docstr: __init__(vertices=None, edges=None, vid_field='__id', src_field='__src_id', dst_field='__dst_id')
  
  By default, construct an empty graph when vertices and edges are None.
  Otherwise construct an SGraph with given vertices and edges.
  
  Parameters
  ----------
  vertices : SFrame, optional
      An SFrame containing vertex id columns and optional vertex data
      columns.
  
  edges : SFrame, optional
      An SFrame containing source and target id columns and optional edge
      data columns.
  
  vid_field : str, optional
      The name of vertex id column in the `vertices` SFrame.
  
  src_field : str, optional
      The name of source id column in the `edges` SFrame.
  
  dst_field : str, optional
      The name of target id column in the `edges` SFrame.
docstr_tok: ["__init__","(","vertices=None",",","edges=None",",","vid_field='__id","'",",","src_field='__src_id","'",",","dst_field='__dst_id","'",")","By","default",",","construct","an","empty","graph","when","vertices","and","edges","are","None",".","Otherwise","construct","an","SGraph","with","given","vertices","and","edges",".","Parameters","--","--","--","--","--","vertices",":","SFrame",",","optional","An","SFrame","containing","vertex","id","columns","and","optional","vertex","data","columns",".","edges",":","SFrame",",","optional","An","SFrame","containing","source","and","target","id","columns","and","optional","edge","data","columns",".","vid_field",":","str",",","optional","The","name","of","vertex","id","column","in","the","`","vertices","`","SFrame",".","src_field",":","str",",","optional","The","name","of","source","id","column","in","the","`","edges","`","SFrame",".","dst_field",":","str",",","optional","The","name","of","target","id","column","in","the","`","edges","`","SFrame","."]
code: def __init__(
      self,
      vertices=None,
      edges=None,
      vid_field="__id",
      src_field="__src_id",
      dst_field="__dst_id",
      _proxy=None,
  ):
      """
      __init__(vertices=None, edges=None, vid_field='__id', src_field='__src_id', dst_field='__dst_id')
  
      By default, construct an empty graph when vertices and edges are None.
      Otherwise construct an SGraph with given vertices and edges.
  
      Parameters
      ----------
      vertices : SFrame, optional
          An SFrame containing vertex id columns and optional vertex data
          columns.
  
      edges : SFrame, optional
          An SFrame containing source and target id columns and optional edge
          data columns.
  
      vid_field : str, optional
          The name of vertex id column in the `vertices` SFrame.
  
      src_field : str, optional
          The name of source id column in the `edges` SFrame.
  
      dst_field : str, optional
          The name of target id column in the `edges` SFrame.
      """
      if _proxy is None:
          self.__proxy__ = UnityGraphProxy()
          if vertices is not None:
              self.__proxy__ = self.add_vertices(
                  vertices, vid_field
              ).__proxy__
          if edges is not None:
              self.__proxy__ = self.add_edges(
                  edges, src_field, dst_field
              ).__proxy__
      else:
          self.__proxy__ = _proxy
      self._vertices = GFrame(self, VERTEX_GFRAME)
      self._edges = GFrame(self, EDGE_GFRAME)
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from .._connect import main
  from .sframe import SFrame
  from .sarray import SArray
  from .gframe import GFrame, VERTEX_GFRAME, EDGE_GFRAME
  from .._cython.cy_graph import UnityGraphProxy
  from .._cython.context import debug_trace
  from ..util import _is_non_string_iterable, _make_internal_url
  from .._deps import pandas
  from .._deps import HAS_PANDAS
  import inspect
  import copy
  import sys
label_desc: Use image node_id 1 to create a new SGraph object from inherited base classes: object with example: obj = SGraph(vertices, edges, vid_field, src_field, dst_field, _proxy)