class_docstr: A matching of vertices in a graph.
  
  A matching of an undirected graph is a set of edges such that each
  vertex is incident on at most one matched edge. When each vertex is
  incident on I{exactly} one matched edge, the matching called
  I{perfect}. This class is used in C{igraph} to represent non-perfect
  and perfect matchings in undirected graphs.
  
  This class is usually not instantiated directly, everything
  is taken care of by the functions that return matchings.
  
  Examples:
  
    >>> from igraph import Graph
    >>> g = Graph.Famous("noperfectmatching")
    >>> matching = g.maximum_matching()
class_docstr_tok: ["A","matching","of","vertices","in","a","graph",".","A","matching","of","an","undirected","graph","is","a","set","of","edges","such","that","each","vertex","is","incident","on","at","most","one","matched","edge",".","When","each","vertex","is","incident","on","I","{","exactly","}","one","matched","edge",",","the","matching","called","I","{","perfect","}",".","This","class","is","used","in","C","{","igraph","}","to","represent","non-perfect","and","perfect","matchings","in","undirected","graphs",".","This","class","is","usually","not","instantiated","directly",",","everything","is","taken","care","of","by","the","functions","that","return","matchings",".","Examples",":",">",">",">","from","igraph","import","Graph",">",">",">","g","=","Graph.Famous","(","``","noperfectmatching","''",")",">",">",">","matching","=","g.maximum_matching","(",")"]
docstr: Returns the vertex a given vertex is matched to.
  
  @param vertex: the vertex we are interested in; either an integer index
    or an instance of L{Vertex}.
  @return: the index of the vertex matched to the given vertex, either as
    an integer index (if I{vertex} was integer) or as an instance of
    L{Vertex}. When the vertex is unmatched, returns C{None}.
docstr_tok: ["Returns","the","vertex","a","given","vertex","is","matched","to",".","@","param","vertex",":","the","vertex","we","are","interested","in",";","either","an","integer","index","or","an","instance","of","L","{","Vertex","}",".","@","return",":","the","index","of","the","vertex","matched","to","the","given","vertex",",","either","as","an","integer","index","(","if","I","{","vertex","}","was","integer",")","or","as","an","instance","of","L","{","Vertex","}",".","When","the","vertex","is","unmatched",",","returns","C","{","None","}","."]
code: def match_of(self, vertex):
      """Returns the vertex a given vertex is matched to.
  
      @param vertex: the vertex we are interested in; either an integer index
        or an instance of L{Vertex}.
      @return: the index of the vertex matched to the given vertex, either as
        an integer index (if I{vertex} was integer) or as an instance of
        L{Vertex}. When the vertex is unmatched, returns C{None}.
      """
      if isinstance(vertex, Vertex):
          matched = self._matching[vertex.index]
          if matched < 0:
              return None
          return self._graph.vs[matched]
  
      matched = self._matching[vertex]
      if matched < 0:
          return None
      return matched
  
file_path: python-igraph/src/igraph/matching.py
imports: from igraph._igraph import Vertex
label_desc: Use image node_id 9 for calling the Matching obj's underlying member method code with example usage: obj.match_of(vertex) and returns: matched, self, None, None