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_edges(self, src_ids=list(), dst_ids=list(), fields={}, format='sframe')
  Return a collection of edges and their attributes. This function is used
  to find edges by vertex IDs, filter on edge attributes, or list in-out
  neighbors of vertex sets.
  
  Parameters
  ----------
  src_ids, dst_ids : list or SArray, optional
      Parallel arrays of vertex IDs, with each pair corresponding to an
      edge to fetch. Only edges in this list are returned. ``None`` can be
      used to designate a wild card. For instance, ``src_ids=[1, 2,
      None]``, ``dst_ids=[3, None, 5]`` will fetch the edge 1->3, all
      outgoing edges of 2 and all incoming edges of 5. src_id and dst_id
      may be left empty, which implies an array of all wild cards.
  
  fields : dict, optional
      Dictionary specifying equality constraints on field values. For
      example, ``{'relationship': 'following'}``, returns only edges whose
      'relationship' field equals 'following'. ``None`` can be used as a
      value to designate a wild card. e.g. ``{'relationship': None}`` will
      find all edges with the field 'relationship' regardless of the
      value.
  
  format : {'sframe', 'list'}, optional
      Output format. The 'sframe' output (default) contains columns
      __src_id and __dst_id with edge vertex IDs and a column for each
      edge attribute. List output returns a list of Edge objects.
  
  Returns
  -------
  out : SFrame | list [Edge]
      An SFrame or list of edges.
  
  See Also
  --------
  Edge, get_vertices
  
  Examples
  --------
  Return all edges in the graph.
  
  >>> from turicreate import SGraph, Edge
  >>> g = SGraph().add_edges([Edge(0, 1, attr={'rating': 5}),
                              Edge(0, 2, attr={'rating': 2}),
                              Edge(1, 2)])
  >>> g.get_edges(src_ids=[None], dst_ids=[None])
  +----------+----------+--------+
  | __src_id | __dst_id | rating |
  +----------+----------+--------+
  |    0     |    2     |   2    |
  |    0     |    1     |   5    |
  |    1     |    2     |  None  |
  +----------+----------+--------+
  
  Return edges with the attribute "rating" of 5.
  
  >>> g.get_edges(fields={'rating': 5})
  +----------+----------+--------+
  | __src_id | __dst_id | rating |
  +----------+----------+--------+
  |    0     |    1     |   5    |
  +----------+----------+--------+
  
  Return edges 0 --> 1 and 1 --> 2 (if present in the graph).
  
  >>> g.get_edges(src_ids=[0, 1], dst_ids=[1, 2])
  +----------+----------+--------+
  | __src_id | __dst_id | rating |
  +----------+----------+--------+
  |    0     |    1     |   5    |
  |    1     |    2     |  None  |
  +----------+----------+--------+
docstr_tok: ["get_edges","(","self",",","src_ids=list","(",")",",","dst_ids=list","(",")",",","fields=","{","}",",","format='sframe","'",")","Return","a","collection","of","edges","and","their","attributes",".","This","function","is","used","to","find","edges","by","vertex","IDs",",","filter","on","edge","attributes",",","or","list","in-out","neighbors","of","vertex","sets",".","Parameters","--","--","--","--","--","src_ids",",","dst_ids",":","list","or","SArray",",","optional","Parallel","arrays","of","vertex","IDs",",","with","each","pair","corresponding","to","an","edge","to","fetch",".","Only","edges","in","this","list","are","returned",".","``","None","``","can","be","used","to","designate","a","wild","card",".","For","instance",",","``","src_ids=","[","1",",","2",",","None","]","``",",","``","dst_ids=","[","3",",","None",",","5","]","``","will","fetch","the","edge","1-",">","3",",","all","outgoing","edges","of","2","and","all","incoming","edges","of","5.","src_id","and","dst_id","may","be","left","empty",",","which","implies","an","array","of","all","wild","cards",".","fields",":","dict",",","optional","Dictionary","specifying","equality","constraints","on","field","values",".","For","example",",","``","{","'relationship","'",":","'following","'","}","``",",","returns","only","edges","whose","'relationship","'","field","equals","'following","'",".","``","None","``","can","be","used","as","a","value","to","designate","a","wild","card",".","e.g",".","``","{","'relationship","'",":","None","}","``","will","find","all","edges","with","the","field","'relationship","'","regardless","of","the","value",".","format",":","{","'sframe","'",",","'list","'","}",",","optional","Output","format",".","The","'sframe","'","output","(","default",")","contains","columns","__src_id","and","__dst_id","with","edge","vertex","IDs","and","a","column","for","each","edge","attribute",".","List","output","returns","a","list","of","Edge","objects",".","Returns","--","--","--","-","out",":","SFrame","|","list","[","Edge","]","An","SFrame","or","list","of","edges",".","See","Also","--","--","--","--","Edge",",","get_vertices","Examples","--","--","--","--","Return","all","edges","in","the","graph",".",">",">",">","from","turicreate","import","SGraph",",","Edge",">",">",">","g","=","SGraph","(",")",".add_edges","(","[","Edge","(","0",",","1",",","attr=","{","'rating","'",":","5","}",")",",","Edge","(","0",",","2",",","attr=","{","'rating","'",":","2","}",")",",","Edge","(","1",",","2",")","]",")",">",">",">","g.get_edges","(","src_ids=","[","None","]",",","dst_ids=","[","None","]",")","+","--","--","--","--","--","+","--","--","--","--","--","+","--","--","--","--","+","|","__src_id","|","__dst_id","|","rating","|","+","--","--","--","--","--","+","--","--","--","--","--","+","--","--","--","--","+","|","0","|","2","|","2","|","|","0","|","1","|","5","|","|","1","|","2","|","None","|","+","--","--","--","--","--","+","--","--","--","--","--","+","--","--","--","--","+","Return","edges","with","the","attribute","``","rating","''","of","5",".",">",">",">","g.get_edges","(","fields=","{","'rating","'",":","5","}",")","+","--","--","--","--","--","+","--","--","--","--","--","+","--","--","--","--","+","|","__src_id","|","__dst_id","|","rating","|","+","--","--","--","--","--","+","--","--","--","--","--","+","--","--","--","--","+","|","0","|","1","|","5","|","+","--","--","--","--","--","+","--","--","--","--","--","+","--","--","--","--","+","Return","edges","0","--",">","1","and","1","--",">","2","(","if","present","in","the","graph",")",".",">",">",">","g.get_edges","(","src_ids=","[","0",",","1","]",",","dst_ids=","[","1",",","2","]",")","+","--","--","--","--","--","+","--","--","--","--","--","+","--","--","--","--","+","|","__src_id","|","__dst_id","|","rating","|","+","--","--","--","--","--","+","--","--","--","--","--","+","--","--","--","--","+","|","0","|","1","|","5","|","|","1","|","2","|","None","|","+","--","--","--","--","--","+","--","--","--","--","--","+","--","--","--","--","+"]
code: def get_edges(
      self, src_ids=[], dst_ids=[], fields={}, format="sframe"
  ):
      """
      get_edges(self, src_ids=list(), dst_ids=list(), fields={}, format='sframe')
      Return a collection of edges and their attributes. This function is used
      to find edges by vertex IDs, filter on edge attributes, or list in-out
      neighbors of vertex sets.
  
      Parameters
      ----------
      src_ids, dst_ids : list or SArray, optional
          Parallel arrays of vertex IDs, with each pair corresponding to an
          edge to fetch. Only edges in this list are returned. ``None`` can be
          used to designate a wild card. For instance, ``src_ids=[1, 2,
          None]``, ``dst_ids=[3, None, 5]`` will fetch the edge 1->3, all
          outgoing edges of 2 and all incoming edges of 5. src_id and dst_id
          may be left empty, which implies an array of all wild cards.
  
      fields : dict, optional
          Dictionary specifying equality constraints on field values. For
          example, ``{'relationship': 'following'}``, returns only edges whose
          'relationship' field equals 'following'. ``None`` can be used as a
          value to designate a wild card. e.g. ``{'relationship': None}`` will
          find all edges with the field 'relationship' regardless of the
          value.
  
      format : {'sframe', 'list'}, optional
          Output format. The 'sframe' output (default) contains columns
          __src_id and __dst_id with edge vertex IDs and a column for each
          edge attribute. List output returns a list of Edge objects.
  
      Returns
      -------
      out : SFrame | list [Edge]
          An SFrame or list of edges.
  
      See Also
      --------
      Edge, get_vertices
  
      Examples
      --------
      Return all edges in the graph.
  
      >>> from turicreate import SGraph, Edge
      >>> g = SGraph().add_edges([Edge(0, 1, attr={'rating': 5}),
                                  Edge(0, 2, attr={'rating': 2}),
                                  Edge(1, 2)])
      >>> g.get_edges(src_ids=[None], dst_ids=[None])
      +----------+----------+--------+
      | __src_id | __dst_id | rating |
      +----------+----------+--------+
      |    0     |    2     |   2    |
      |    0     |    1     |   5    |
      |    1     |    2     |  None  |
      +----------+----------+--------+
  
      Return edges with the attribute "rating" of 5.
  
      >>> g.get_edges(fields={'rating': 5})
      +----------+----------+--------+
      | __src_id | __dst_id | rating |
      +----------+----------+--------+
      |    0     |    1     |   5    |
      +----------+----------+--------+
  
      Return edges 0 --> 1 and 1 --> 2 (if present in the graph).
  
      >>> g.get_edges(src_ids=[0, 1], dst_ids=[1, 2])
      +----------+----------+--------+
      | __src_id | __dst_id | rating |
      +----------+----------+--------+
      |    0     |    1     |   5    |
      |    1     |    2     |  None  |
      +----------+----------+--------+
      """
  
      if not _is_non_string_iterable(src_ids):
          src_ids = [src_ids]
      if not _is_non_string_iterable(dst_ids):
          dst_ids = [dst_ids]
  
      if type(src_ids) not in (list, SArray):
          raise TypeError("src_ids must be list or SArray type")
      if type(dst_ids) not in (list, SArray):
          raise TypeError("dst_ids must be list or SArray type")
  
      # implicit Nones
      if len(src_ids) == 0 and len(dst_ids) > 0:
          src_ids = [None] * len(dst_ids)
      # implicit Nones
      if len(dst_ids) == 0 and len(src_ids) > 0:
          dst_ids = [None] * len(src_ids)
  
      with cython_context():
          sf = SFrame(
              _proxy=self.__proxy__.get_edges(src_ids, dst_ids, fields)
          )
  
      if format == "sframe":
          return sf
      if 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:
              return sf.head(sf.num_rows()).to_dataframe()
      elif format == "list":
          return _dataframe_to_edge_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 11 for calling the SGraph obj's underlying member method code with example usage: obj.get_edges(src_ids, dst_ids, fields, format) and returns: sf, pd, sf, _dataframe_to_edge_list