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: get_vertices(self, ids=list(), fields={}, format='sframe')
  Return a collection of vertices and their attributes.
  
  Parameters
  ----------
  
  ids : list [int | float | str] or SArray
      List of vertex IDs to retrieve. Only vertices in this list will be
      returned. Also accepts a single vertex id.
  
  fields : dict | pandas.DataFrame
      Dictionary specifying equality constraint on field values. For
      example ``{'gender': 'M'}``, returns only vertices whose 'gender'
      field is 'M'. ``None`` can be used to designate a wild card. For
      example, {'relationship': None} will find all vertices with the
      field 'relationship' regardless of the value.
  
  format : {'sframe', 'list'}
      Output format. The SFrame output (default) contains a column
      ``__src_id`` with vertex IDs and a column for each vertex attribute.
      List output returns a list of Vertex objects.
  
  Returns
  -------
  out : SFrame or list [Vertex]
      An SFrame or list of Vertex objects.
  
  See Also
  --------
  Vertex, get_edges
  
  Examples
  --------
  Return all vertices in the graph.
  
  >>> from turicreate import SGraph, Vertex
  >>> g = SGraph().add_vertices([Vertex(0, attr={'gender': 'M'}),
                                 Vertex(1, attr={'gender': 'F'}),
                                 Vertex(2, attr={'gender': 'F'})])
  >>> g.get_vertices()
  +------+--------+
  | __id | gender |
  +------+--------+
  |  0   |   M    |
  |  2   |   F    |
  |  1   |   F    |
  +------+--------+
  
  Return vertices 0 and 2.
  
  >>> g.get_vertices(ids=[0, 2])
  +------+--------+
  | __id | gender |
  +------+--------+
  |  0   |   M    |
  |  2   |   F    |
  +------+--------+
  
  Return vertices with the vertex attribute "gender" equal to "M".
  
  >>> g.get_vertices(fields={'gender': 'M'})
  +------+--------+
  | __id | gender |
  +------+--------+
  |  0   |   M    |
  +------+--------+
docstr_tok: ["get_vertices","(","self",",","ids=list","(",")",",","fields=","{","}",",","format='sframe","'",")","Return","a","collection","of","vertices","and","their","attributes",".","Parameters","--","--","--","--","--","ids",":","list","[","int","|","float","|","str","]","or","SArray","List","of","vertex","IDs","to","retrieve",".","Only","vertices","in","this","list","will","be","returned",".","Also","accepts","a","single","vertex","id",".","fields",":","dict","|","pandas.DataFrame","Dictionary","specifying","equality","constraint","on","field","values",".","For","example","``","{","'gender","'",":","'M","'","}","``",",","returns","only","vertices","whose","'gender'","field","is","'M","'",".","``","None","``","can","be","used","to","designate","a","wild","card",".","For","example",",","{","'relationship","'",":","None","}","will","find","all","vertices","with","the","field","'relationship","'","regardless","of","the","value",".","format",":","{","'sframe","'",",","'list","'","}","Output","format",".","The","SFrame","output","(","default",")","contains","a","column","``","__src_id","``","with","vertex","IDs","and","a","column","for","each","vertex","attribute",".","List","output","returns","a","list","of","Vertex","objects",".","Returns","--","--","--","-","out",":","SFrame","or","list","[","Vertex","]","An","SFrame","or","list","of","Vertex","objects",".","See","Also","--","--","--","--","Vertex",",","get_edges","Examples","--","--","--","--","Return","all","vertices","in","the","graph",".",">",">",">","from","turicreate","import","SGraph",",","Vertex",">",">",">","g","=","SGraph","(",")",".add_vertices","(","[","Vertex","(","0",",","attr=","{","'gender","'",":","'M","'","}",")",",","Vertex","(","1",",","attr=","{","'gender","'",":","'","F","'","}",")",",","Vertex","(","2",",","attr=","{","'gender","'",":","'","F","'","}",")","]",")",">",">",">","g.get_vertices","(",")","+","--","--","--","+","--","--","--","--","+","|","__id","|","gender","|","+","--","--","--","+","--","--","--","--","+","|","0","|","M","|","|","2","|","F","|","|","1","|","F","|","+","--","--","--","+","--","--","--","--","+","Return","vertices","0","and","2",".",">",">",">","g.get_vertices","(","ids=","[","0",",","2","]",")","+","--","--","--","+","--","--","--","--","+","|","__id","|","gender","|","+","--","--","--","+","--","--","--","--","+","|","0","|","M","|","|","2","|","F","|","+","--","--","--","+","--","--","--","--","+","Return","vertices","with","the","vertex","attribute","``","gender","''","equal","to","``","M","''",".",">",">",">","g.get_vertices","(","fields=","{","'gender","'",":","'M","'","}",")","+","--","--","--","+","--","--","--","--","+","|","__id","|","gender","|","+","--","--","--","+","--","--","--","--","+","|","0","|","M","|","+","--","--","--","+","--","--","--","--","+"]
code: def get_vertices(self, ids=[], fields={}, format="sframe"):
      """
      get_vertices(self, ids=list(), fields={}, format='sframe')
      Return a collection of vertices and their attributes.
  
      Parameters
      ----------
  
      ids : list [int | float | str] or SArray
          List of vertex IDs to retrieve. Only vertices in this list will be
          returned. Also accepts a single vertex id.
  
      fields : dict | pandas.DataFrame
          Dictionary specifying equality constraint on field values. For
          example ``{'gender': 'M'}``, returns only vertices whose 'gender'
          field is 'M'. ``None`` can be used to designate a wild card. For
          example, {'relationship': None} will find all vertices with the
          field 'relationship' regardless of the value.
  
      format : {'sframe', 'list'}
          Output format. The SFrame output (default) contains a column
          ``__src_id`` with vertex IDs and a column for each vertex attribute.
          List output returns a list of Vertex objects.
  
      Returns
      -------
      out : SFrame or list [Vertex]
          An SFrame or list of Vertex objects.
  
      See Also
      --------
      Vertex, get_edges
  
      Examples
      --------
      Return all vertices in the graph.
  
      >>> from turicreate import SGraph, Vertex
      >>> g = SGraph().add_vertices([Vertex(0, attr={'gender': 'M'}),
                                     Vertex(1, attr={'gender': 'F'}),
                                     Vertex(2, attr={'gender': 'F'})])
      >>> g.get_vertices()
      +------+--------+
      | __id | gender |
      +------+--------+
      |  0   |   M    |
      |  2   |   F    |
      |  1   |   F    |
      +------+--------+
  
      Return vertices 0 and 2.
  
      >>> g.get_vertices(ids=[0, 2])
      +------+--------+
      | __id | gender |
      +------+--------+
      |  0   |   M    |
      |  2   |   F    |
      +------+--------+
  
      Return vertices with the vertex attribute "gender" equal to "M".
  
      >>> g.get_vertices(fields={'gender': 'M'})
      +------+--------+
      | __id | gender |
      +------+--------+
      |  0   |   M    |
      +------+--------+
      """
  
      if not _is_non_string_iterable(ids):
          ids = [ids]
  
      if type(ids) not in (list, SArray):
          raise TypeError("ids must be list or SArray type")
  
      with cython_context():
          sf = SFrame(_proxy=self.__proxy__.get_vertices(ids, fields))
  
      if format == "sframe":
          return sf
      elif format == "dataframe":
          assert (
              HAS_PANDAS
          ), "Cannot use dataframe because Pandas is not available or version is too low."
          if sf.num_rows() == 0:
              return pd.DataFrame()
          else:
              df = sf.head(sf.num_rows()).to_dataframe()
              return df.set_index("__id")
      elif format == "list":
          return _dataframe_to_vertex_list(sf.to_dataframe())
      else:
          raise ValueError("Invalid format specifier")
  
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 10 for calling the SGraph obj's underlying member method code with example usage: obj.get_vertices(ids, fields, format) and returns: sf, pd, df, _dataframe_to_vertex_list