code: def path_new_using_function(
      w: int,
      h: int,
      func: Callable[[int, int, int, int, Any], float],
      userData: Any = 0,
      dcost: float = 1.41,
  ) -> tcod.path.AStar:
      
      return tcod.path.AStar(
          tcod.path._EdgeCostFunc((func, userData), (w, h)), dcost
      )
docs: Return a new AStar using the given callable function.
  
      Args:
          w (int): Clipping width.
          h (int): Clipping height.
          func (Callable[[int, int, int, int, Any], float]):
          userData (Any):
          dcost (float): A multiplier for the cost of diagonal movement.
                         Can be set to 0 to disable diagonal movement.
      Returns:
          AStar: A new AStar instance.