docstr: Tests that the google_matrix doesn't change except for the dangling
  nodes.
docstr_tok: ["Tests","that","the","google_matrix","does","n't","change","except","for","the","dangling","nodes","."]
code: def test_dangling_matrix(self):
      """
      Tests that the google_matrix doesn't change except for the dangling
      nodes.
      """
      G = self.G
      dangling = self.dangling_edges
      dangling_sum = sum(dangling.values())
      M1 = nx.google_matrix(G, personalization=dangling)
      M2 = nx.google_matrix(
          G, personalization=dangling, dangling=dangling
      )
      for i in range(len(G)):
          for j in range(len(G)):
              if i == self.dangling_node_index and (j + 1) in dangling:
                  assert M2[i, j] == pytest.approx(
                      dangling[j + 1] / dangling_sum, abs=1e-4
                  )
              else:
                  assert M2[i, j] == pytest.approx(M1[i, j], abs=1e-4)
  
imports: import random
  import pytest
  import networkx
  from networkx.classes.tests import dispatch_interface
  from networkx.algorithms.link_analysis.pagerank_alg import _pagerank_numpy, _pagerank_python, _pagerank_scipy
label_desc: Use image node_id 10 for calling the TestPageRank obj's underlying member method code with example usage: obj.test_dangling_matrix() without return types