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: Add edges to the SGraph. Edges should be input as a list of
  :class:`~turicreate.Edge` objects, an :class:`~turicreate.SFrame`, or a
  Pandas DataFrame. If the new edges are in an SFrame or DataFrame, then
  ``src_field`` and ``dst_field`` are required to specify the columns that
  contain the source and destination vertex IDs; additional columns are
  treated as edge attributes. If these attributes are not already present
  in the graph's edge data, they are added, with existing edges acquiring
  the value ``None``.
  
  Parameters
  ----------
  edges : Edge | list [Edge] | pandas.DataFrame | SFrame
      Edge data. If the edges are in an SFrame or DataFrame, then
      ``src_field`` and ``dst_field`` are required to specify the columns
      that contain the source and destination vertex IDs. Additional
      columns are treated as edge attributes.
  
  src_field : string, optional
      Column in the SFrame or DataFrame to use as source vertex IDs. Not
      required if ``edges`` is a list.
  
  dst_field : string, optional
      Column in the SFrame or Pandas DataFrame to use as destination
      vertex IDs. Not required if ``edges`` is a list.
  
  Returns
  -------
  out : SGraph
      A new SGraph with `edges` added.
  
  See Also
  --------
  Edge, SFrame, add_vertices
  
  Notes
  -----
  - If an edge is added whose source and destination IDs match edges that
    already exist in the graph, a new edge is added to the graph. This
    contrasts with :py:func:`add_vertices`, which overwrites existing
    vertices.
  
  Examples
  --------
  >>> from turicreate import SGraph, Vertex, Edge, SFrame
  >>> g = SGraph()
  >>> verts = [Vertex(0, attr={'breed': 'labrador'}),
               Vertex(1, attr={'breed': 'labrador'}),
               Vertex(2, attr={'breed': 'vizsla'})]
  >>> g = g.add_vertices(verts)
  
  Add a single edge.
  
  >>> g = g.add_edges(Edge(1, 2))
  
  Add a list of edges.
  
  >>> g = g.add_edges([Edge(0, 2), Edge(1, 2)])
  
  Add edges from an SFrame.
  
  >>> sf_edge = SFrame({'source': [0, 1], 'dest': [2, 2]})
  >>> g = g.add_edges(sf_edge, src_field='source', dst_field='dest')
docstr_tok: ["Add","edges","to","the","SGraph",".","Edges","should","be","input","as","a","list","of",":","class",":","`","~turicreate.Edge","`","objects",",","an",":","class",":","`","~turicreate.SFrame","`",",","or","a","Pandas","DataFrame",".","If","the","new","edges","are","in","an","SFrame","or","DataFrame",",","then","``","src_field","``","and","``","dst_field","``","are","required","to","specify","the","columns","that","contain","the","source","and","destination","vertex","IDs",";","additional","columns","are","treated","as","edge","attributes",".","If","these","attributes","are","not","already","present","in","the","graph","'s","edge","data",",","they","are","added",",","with","existing","edges","acquiring","the","value","``","None","``",".","Parameters","--","--","--","--","--","edges",":","Edge","|","list","[","Edge","]","|","pandas.DataFrame","|","SFrame","Edge","data",".","If","the","edges","are","in","an","SFrame","or","DataFrame",",","then","``","src_field","``","and","``","dst_field","``","are","required","to","specify","the","columns","that","contain","the","source","and","destination","vertex","IDs",".","Additional","columns","are","treated","as","edge","attributes",".","src_field",":","string",",","optional","Column","in","the","SFrame","or","DataFrame","to","use","as","source","vertex","IDs",".","Not","required","if","``","edges","``","is","a","list",".","dst_field",":","string",",","optional","Column","in","the","SFrame","or","Pandas","DataFrame","to","use","as","destination","vertex","IDs",".","Not","required","if","``","edges","``","is","a","list",".","Returns","--","--","--","-","out",":","SGraph","A","new","SGraph","with","`","edges","`","added",".","See","Also","--","--","--","--","Edge",",","SFrame",",","add_vertices","Notes","--","--","-","-","If","an","edge","is","added","whose","source","and","destination","IDs","match","edges","that","already","exist","in","the","graph",",","a","new","edge","is","added","to","the","graph",".","This","contrasts","with",":","py",":","func",":","`","add_vertices","`",",","which","overwrites","existing","vertices",".","Examples","--","--","--","--",">",">",">","from","turicreate","import","SGraph",",","Vertex",",","Edge",",","SFrame",">",">",">","g","=","SGraph","(",")",">",">",">","verts","=","[","Vertex","(","0",",","attr=","{","'breed","'",":","'labrador","'","}",")",",","Vertex","(","1",",","attr=","{","'breed","'",":","'labrador","'","}",")",",","Vertex","(","2",",","attr=","{","'breed","'",":","'vizsla","'","}",")","]",">",">",">","g","=","g.add_vertices","(","verts",")","Add","a","single","edge",".",">",">",">","g","=","g.add_edges","(","Edge","(","1",",","2",")",")","Add","a","list","of","edges",".",">",">",">","g","=","g.add_edges","(","[","Edge","(","0",",","2",")",",","Edge","(","1",",","2",")","]",")","Add","edges","from","an","SFrame",".",">",">",">","sf_edge","=","SFrame","(","{","'source","'",":","[","0",",","1","]",",","'dest","'",":","[","2",",","2","]","}",")",">",">",">","g","=","g.add_edges","(","sf_edge",",","src_field='source","'",",","dst_field='dest","'",")"]
code: def add_edges(self, edges, src_field=None, dst_field=None):
      """
      Add edges to the SGraph. Edges should be input as a list of
      :class:`~turicreate.Edge` objects, an :class:`~turicreate.SFrame`, or a
      Pandas DataFrame. If the new edges are in an SFrame or DataFrame, then
      ``src_field`` and ``dst_field`` are required to specify the columns that
      contain the source and destination vertex IDs; additional columns are
      treated as edge attributes. If these attributes are not already present
      in the graph's edge data, they are added, with existing edges acquiring
      the value ``None``.
  
      Parameters
      ----------
      edges : Edge | list [Edge] | pandas.DataFrame | SFrame
          Edge data. If the edges are in an SFrame or DataFrame, then
          ``src_field`` and ``dst_field`` are required to specify the columns
          that contain the source and destination vertex IDs. Additional
          columns are treated as edge attributes.
  
      src_field : string, optional
          Column in the SFrame or DataFrame to use as source vertex IDs. Not
          required if ``edges`` is a list.
  
      dst_field : string, optional
          Column in the SFrame or Pandas DataFrame to use as destination
          vertex IDs. Not required if ``edges`` is a list.
  
      Returns
      -------
      out : SGraph
          A new SGraph with `edges` added.
  
      See Also
      --------
      Edge, SFrame, add_vertices
  
      Notes
      -----
      - If an edge is added whose source and destination IDs match edges that
        already exist in the graph, a new edge is added to the graph. This
        contrasts with :py:func:`add_vertices`, which overwrites existing
        vertices.
  
      Examples
      --------
      >>> from turicreate import SGraph, Vertex, Edge, SFrame
      >>> g = SGraph()
      >>> verts = [Vertex(0, attr={'breed': 'labrador'}),
                   Vertex(1, attr={'breed': 'labrador'}),
                   Vertex(2, attr={'breed': 'vizsla'})]
      >>> g = g.add_vertices(verts)
  
      Add a single edge.
  
      >>> g = g.add_edges(Edge(1, 2))
  
      Add a list of edges.
  
      >>> g = g.add_edges([Edge(0, 2), Edge(1, 2)])
  
      Add edges from an SFrame.
  
      >>> sf_edge = SFrame({'source': [0, 1], 'dest': [2, 2]})
      >>> g = g.add_edges(sf_edge, src_field='source', dst_field='dest')
      """
  
      sf = _edge_data_to_sframe(edges, src_field, dst_field)
  
      with cython_context():
          proxy = self.__proxy__.add_edges(
              sf.__proxy__, _SRC_VID_COLUMN, _DST_VID_COLUMN
          )
          return SGraph(_proxy=proxy)
  
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 13 for calling the SGraph obj's underlying member method code with example usage: obj.add_edges(edges, src_field, dst_field) and returns: SGraph