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 vertices to the SGraph. Vertices should be input as a list of
  :class:`~turicreate.Vertex` objects, an :class:`~turicreate.SFrame`, or a
  pandas DataFrame. If vertices are specified by SFrame or DataFrame,
  ``vid_field`` specifies which column contains the vertex ID. Remaining
  columns are assumed to hold additional vertex attributes. If these
  attributes are not already present in the graph's vertex data, they are
  added, with existing vertices acquiring the value ``None``.
  
  Parameters
  ----------
  vertices : Vertex | list [Vertex] | pandas.DataFrame | SFrame
      Vertex data. If the vertices are in an SFrame or DataFrame, then
      ``vid_field`` specifies the column containing the vertex IDs.
      Additional columns are treated as vertex attributes.
  
  vid_field : string, optional
      Column in the DataFrame or SFrame to use as vertex ID. Required if
      vertices is an SFrame. If ``vertices`` is a DataFrame and
      ``vid_field`` is not specified, the row index is used as vertex ID.
  
  Returns
  -------
  out : SGraph
      A new SGraph with vertices added.
  
  See Also
  --------
  Vertex, SFrame, add_edges
  
  Notes
  -----
  - If vertices are added with indices that already exist in the graph,
    they are overwritten completely. All attributes for these vertices
    will conform to the specification in this method.
  
  Examples
  --------
  >>> from turicreate import SGraph, Vertex, SFrame
  >>> g = SGraph()
  
  Add a single vertex.
  
  >>> g = g.add_vertices(Vertex(0, attr={'breed': 'labrador'}))
  
  Add a list of vertices.
  
  >>> verts = [Vertex(0, attr={'breed': 'labrador'}),
               Vertex(1, attr={'breed': 'labrador'}),
               Vertex(2, attr={'breed': 'vizsla'})]
  >>> g = g.add_vertices(verts)
  
  Add vertices from an SFrame.
  
  >>> sf_vert = SFrame({'id': [0, 1, 2], 'breed':['lab', 'lab', 'vizsla']})
  >>> g = g.add_vertices(sf_vert, vid_field='id')
docstr_tok: ["Add","vertices","to","the","SGraph",".","Vertices","should","be","input","as","a","list","of",":","class",":","`","~turicreate.Vertex","`","objects",",","an",":","class",":","`","~turicreate.SFrame","`",",","or","a","pandas","DataFrame",".","If","vertices","are","specified","by","SFrame","or","DataFrame",",","``","vid_field","``","specifies","which","column","contains","the","vertex","ID",".","Remaining","columns","are","assumed","to","hold","additional","vertex","attributes",".","If","these","attributes","are","not","already","present","in","the","graph","'s","vertex","data",",","they","are","added",",","with","existing","vertices","acquiring","the","value","``","None","``",".","Parameters","--","--","--","--","--","vertices",":","Vertex","|","list","[","Vertex","]","|","pandas.DataFrame","|","SFrame","Vertex","data",".","If","the","vertices","are","in","an","SFrame","or","DataFrame",",","then","``","vid_field","``","specifies","the","column","containing","the","vertex","IDs",".","Additional","columns","are","treated","as","vertex","attributes",".","vid_field",":","string",",","optional","Column","in","the","DataFrame","or","SFrame","to","use","as","vertex","ID",".","Required","if","vertices","is","an","SFrame",".","If","``","vertices","``","is","a","DataFrame","and","``","vid_field","``","is","not","specified",",","the","row","index","is","used","as","vertex","ID",".","Returns","--","--","--","-","out",":","SGraph","A","new","SGraph","with","vertices","added",".","See","Also","--","--","--","--","Vertex",",","SFrame",",","add_edges","Notes","--","--","-","-","If","vertices","are","added","with","indices","that","already","exist","in","the","graph",",","they","are","overwritten","completely",".","All","attributes","for","these","vertices","will","conform","to","the","specification","in","this","method",".","Examples","--","--","--","--",">",">",">","from","turicreate","import","SGraph",",","Vertex",",","SFrame",">",">",">","g","=","SGraph","(",")","Add","a","single","vertex",".",">",">",">","g","=","g.add_vertices","(","Vertex","(","0",",","attr=","{","'breed","'",":","'labrador","'","}",")",")","Add","a","list","of","vertices",".",">",">",">","verts","=","[","Vertex","(","0",",","attr=","{","'breed","'",":","'labrador","'","}",")",",","Vertex","(","1",",","attr=","{","'breed","'",":","'labrador","'","}",")",",","Vertex","(","2",",","attr=","{","'breed","'",":","'vizsla","'","}",")","]",">",">",">","g","=","g.add_vertices","(","verts",")","Add","vertices","from","an","SFrame",".",">",">",">","sf_vert","=","SFrame","(","{","'id","'",":","[","0",",","1",",","2","]",",","'breed","'",":","[","'lab","'",",","'lab","'",",","'vizsla","'","]","}",")",">",">",">","g","=","g.add_vertices","(","sf_vert",",","vid_field='id","'",")"]
code: def add_vertices(self, vertices, vid_field=None):
      """
      Add vertices to the SGraph. Vertices should be input as a list of
      :class:`~turicreate.Vertex` objects, an :class:`~turicreate.SFrame`, or a
      pandas DataFrame. If vertices are specified by SFrame or DataFrame,
      ``vid_field`` specifies which column contains the vertex ID. Remaining
      columns are assumed to hold additional vertex attributes. If these
      attributes are not already present in the graph's vertex data, they are
      added, with existing vertices acquiring the value ``None``.
  
      Parameters
      ----------
      vertices : Vertex | list [Vertex] | pandas.DataFrame | SFrame
          Vertex data. If the vertices are in an SFrame or DataFrame, then
          ``vid_field`` specifies the column containing the vertex IDs.
          Additional columns are treated as vertex attributes.
  
      vid_field : string, optional
          Column in the DataFrame or SFrame to use as vertex ID. Required if
          vertices is an SFrame. If ``vertices`` is a DataFrame and
          ``vid_field`` is not specified, the row index is used as vertex ID.
  
      Returns
      -------
      out : SGraph
          A new SGraph with vertices added.
  
      See Also
      --------
      Vertex, SFrame, add_edges
  
      Notes
      -----
      - If vertices are added with indices that already exist in the graph,
        they are overwritten completely. All attributes for these vertices
        will conform to the specification in this method.
  
      Examples
      --------
      >>> from turicreate import SGraph, Vertex, SFrame
      >>> g = SGraph()
  
      Add a single vertex.
  
      >>> g = g.add_vertices(Vertex(0, attr={'breed': 'labrador'}))
  
      Add a list of vertices.
  
      >>> verts = [Vertex(0, attr={'breed': 'labrador'}),
                   Vertex(1, attr={'breed': 'labrador'}),
                   Vertex(2, attr={'breed': 'vizsla'})]
      >>> g = g.add_vertices(verts)
  
      Add vertices from an SFrame.
  
      >>> sf_vert = SFrame({'id': [0, 1, 2], 'breed':['lab', 'lab', 'vizsla']})
      >>> g = g.add_vertices(sf_vert, vid_field='id')
      """
  
      sf = _vertex_data_to_sframe(vertices, vid_field)
  
      with cython_context():
          proxy = self.__proxy__.add_vertices(sf.__proxy__, _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 12 for calling the SGraph obj's underlying member method code with example usage: obj.add_vertices(vertices, vid_field) and returns: SGraph