'Directed Modularity matrix'

def test_directed_modularity(self):

    B = numpy.matrix([[(-0.2), 0.6, 0.8, (-0.4), (-0.4), (-0.4)], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.7, 0.4, (-0.3), (-0.6), 0.4, (-0.6)], [(-0.2), (-0.4), (-0.2), (-0.4), 0.6, 0.6], [(-0.2), (-0.4), (-0.2), 0.6, (-0.4), 0.6], [(-0.1), (-0.2), (-0.1), 0.8, (-0.2), (-0.2)]])
    node_permutation = [5, 1, 2, 3, 4, 6]
    idx_permutation = [4, 0, 1, 2, 3, 5]
    mm = nx.directed_modularity_matrix(self.DG, nodelist=sorted(self.DG))
    assert_equal(mm, B)
    assert_equal(nx.directed_modularity_matrix(self.DG, nodelist=node_permutation), B[numpy.ix_(idx_permutation, idx_permutation)])
