docstr: Betweenness centrality: P3 endpoints
docstr_tok: ["Betweenness","centrality",":","P3","endpoints"]
code: def test_P3_endpoints(self):
      """Betweenness centrality: P3 endpoints"""
      G = nx.path_graph(3)
      b_answer = {0: 2.0, 1: 3.0, 2: 2.0}
      b = nx.betweenness_centrality(
          G, weight=None, normalized=False, endpoints=True
      )
      for n in sorted(G):
          assert b[n] == pytest.approx(b_answer[n], abs=1e-7)
      # normalized = True case
      b_answer = {0: 2 / 3, 1: 1.0, 2: 2 / 3}
      b = nx.betweenness_centrality(
          G, weight=None, normalized=True, endpoints=True
      )
      for n in sorted(G):
          assert b[n] == pytest.approx(b_answer[n], abs=1e-7)
  
imports: import pytest
  import networkx
label_desc: Use image node_id 6 for calling the TestBetweennessCentrality obj's underlying member method code with example usage: obj.test_P3_endpoints() without return types