code: def get_negative_cycle(self):
          '''
          API:
              get_negative_cycle(self)
          Description:
              Finds and returns negative cost cycle using 'cost' attribute of
              arcs. Return value is a list of nodes representing cycle it is in
              the following form; n_1-n_2-...-n_k, when the cycle has k nodes.
          Pre:
              Arcs should have 'cost' attribute.
          Return:
              Returns a list of nodes in the cycle if a negative cycle exists,
              returns None otherwise.
          '''
          nl = self.get_node_list()
          i = nl[0]
          (valid, distance, nextn) = self.floyd_warshall()
          if not valid:
              cycle = self.floyd_warshall_get_cycle(distance, nextn)
              return cycle
          else:
              return Nonf get_negative_cycle(self):
          '''
          API:
              get_negative_cycle(self)
          Description:
              Finds and returns negative cost cycle using 'cost' attribute of
              arcs. Return value is a list of nodes representing cycle it is in
              the following form; n_1-n_2-...-n_k, when the cycle has k nodes.
          Pre:
              Arcs should have 'cost' attribute.
          Return:
              Returns a list of nodes in the cycle if a negative cycle exists,
              returns None otherwise.
          '''
          nl = self.get_node_list()
          i = nl[0]
          (valid, distance, nextn) = self.floyd_warshall()
          if not valid:
              cycle = self.floyd_warshall_get_cycle(distance, nextn)
              return cycle
          else:
              return None
docs: API:
              get_negative_cycle(self)
          Description:
              Finds and returns negative cost cycle using 'cost' attribute of
              arcs. Return value is a list of nodes representing cycle it is in
              the following form; n_1-n_2-...-n_k, when the cycle has k nodes.
          Pre:
              Arcs should have 'cost' attribute.
          Return:
              Returns a list of nodes in the cycle if a negative cycle exists,
              returns None otherwise.