code: def test_specified_methods(self):
      G = nx.Graph()
      nx.add_cycle(G, range(7), weight=2)
      ans = nx.average_shortest_path_length(
          G, weight="weight", method="dijkstra"
      )
      assert ans == pytest.approx(4, abs=1e-7)
      ans = nx.average_shortest_path_length(
          G, weight="weight", method="bellman-ford"
      )
      assert ans == pytest.approx(4, abs=1e-7)
      ans = nx.average_shortest_path_length(
          G, weight="weight", method="floyd-warshall"
      )
      assert ans == pytest.approx(4, abs=1e-7)
  
      G = nx.Graph()
      nx.add_path(G, range(5), weight=2)
      ans = nx.average_shortest_path_length(
          G, weight="weight", method="dijkstra"
      )
      assert ans == pytest.approx(4, abs=1e-7)
      ans = nx.average_shortest_path_length(
          G, weight="weight", method="bellman-ford"
      )
      assert ans == pytest.approx(4, abs=1e-7)
      ans = nx.average_shortest_path_length(
          G, weight="weight", method="floyd-warshall"
      )
      assert ans == pytest.approx(4, abs=1e-7)
  
imports: import pytest
  import networkx
label_desc: Use image node_id 4 for calling the TestAverageShortestPathLength obj's underlying member method code with example usage: obj.test_specified_methods() without return types