parameters: (self)
return_statement: return results
docstring: Returns a list of cycles in the graph, where each cycle is its own list.
docstring_summary: Returns a list of cycles in the graph, where each cycle is its own list.
docstring_tokens: Returns a list of cycles in the graph where each cycle is its own list .
function: def FindCycles(self):
      """
      Returns a list of cycles in the graph, where each cycle is its own list.
      """
      results = []
      visited = set()
  
      def Visit(node, path):
        for child in node.dependents:
          if child in path:
            results.append([child] + path[:path.index(child) + 1])
          elif not child in visited:
            visited.add(child)
            Visit(child, [child] + path)
  
      visited.add(self)
      Visit(self, [self])
  
      return results
function_tokens: def FindCycles ( self ) : results = [ ] visited = set ( ) def Visit ( node , path ) : for child in node . dependents : if child in path : results . append ( [ child ] + path [ : path . index ( child ) + 1 ] ) elif not child in visited : visited . add ( child ) Visit ( child , [ child ] + path ) visited . add ( self ) Visit ( self , [ self ] ) return results