parameters: (self, n)
docstring: method to add neighbors to vertex.
          if graph is undirected neighbor relations
          have to be added to both ends of egde
docstring_summary: method to add neighbors to vertex.
          if graph is undirected neighbor relations
          have to be added to both ends of egde
docstring_tokens: method to add neighbors to vertex . if graph is undirected neighbor relations have to be added to both ends of egde
function: def add_neighbors(self, n):
          """method to add neighbors to vertex.
          if graph is undirected neighbor relations
          have to be added to both ends of egde"""
  
          # if passed value is no Vertex an Error is created
          assert isinstance(n, Vertex)
  
          # if Vertex is already added as a neighbor
          # if is ignored
          if n not in self.neighbors:
  
              # neighbor list is appended with new neighbor value
              self.neighbors.append(n)
function_tokens: def add_neighbors ( self , n ) : # if passed value is no Vertex an Error is created assert isinstance ( n , Vertex ) # if Vertex is already added as a neighbor # if is ignored if n not in self . neighbors : # neighbor list is appended with new neighbor value self . neighbors . append ( n )