docstr: Eigenvector centrality: P3
docstr_tok: ["Eigenvector","centrality",":","P3"]
code: def test_P3(self):
      """Eigenvector centrality: P3"""
      G = nx.path_graph(3)
      b_answer = {0: 0.5, 1: 0.7071, 2: 0.5}
      b = nx.eigenvector_centrality_numpy(G)
      for n in sorted(G):
          assert b[n] == pytest.approx(b_answer[n], abs=1e-4)
      b = nx.eigenvector_centrality(G)
      for n in sorted(G):
          assert b[n] == pytest.approx(b_answer[n], abs=1e-4)
  
imports: import math
  import pytest
  import networkx
label_desc: Use image node_id 2 for calling the TestEigenvectorCentrality obj's underlying member method code with example usage: obj.test_P3() without return types