code: def test_astar_inadmissible_heuristic_with_cutoff(self):
      heuristic_values = {"s": 36, "y": 14, "x": 10, "u": 10, "v": 0}
  
      def h(u, v):
          return heuristic_values[u]
  
      # optimal path_length in XG is 9. This heuristic gives over-estimate.
      assert nx.astar_path_length(self.XG, "s", "v", heuristic=h) == 10
      assert (
          nx.astar_path_length(
              self.XG, "s", "v", heuristic=h, cutoff=15
          )
          == 10
      )
      with pytest.raises(nx.NetworkXNoPath):
          nx.astar_path_length(self.XG, "s", "v", heuristic=h, cutoff=9)
      with pytest.raises(nx.NetworkXNoPath):
          nx.astar_path_length(
              self.XG, "s", "v", heuristic=h, cutoff=12
          )
  
imports: import pytest
  import networkx
  from networkx.utils import pairwise
label_desc: Use image node_id 16 for calling the TestAStar obj's underlying member method code with example usage: obj.test_astar_inadmissible_heuristic_with_cutoff() and returns: heuristic_values