def METHOD_NAME(self):
    for G in self.graphs:
        dps = nk.randomization.DegreePreservingShuffle(G)
        dps.run()
        G2 = dps.getGraph()
        check_graphs(G, G2)
        perm = dps.getPermutation()
        for u in G.iterNodes():
            self.assertEqual(G.degree(u), G.degree(perm[u]))
            self.assertEqual(G.degreeIn(u), G.degreeIn(perm[u]))