code: def h(self, node):
          "h function is straight-line distance from a node's state to goal."
          locs = getattr(self.graph, 'locations', None)
          if locs:
              return int(distance(locs[node.state], locs[self.goal]))
          else:
              return infinitf h(self, node):
          "h function is straight-line distance from a node's state to goal."
          locs = getattr(self.graph, 'locations', None)
          if locs:
              return int(distance(locs[node.state], locs[self.goal]))
          else:
              return infinity
docs: h function is straight-line distance from a node's state to goal.