code: def deprecate_endpoint(
      path: str,
      new_path: str,
      router_method: Callable,
      old_router_method: Optional[Callable] = None,
      *args,
      **kwargs,
  ):
      """
      Helper decorator to deprecate a `path` endpoint adding the `new_path` endpoint.
  
      Both `path` and `new_path` shares the same router method (get, post, patch,...) `router_method`
      """
  
      def decorator(func: Callable):
          kwargs.pop("path", None)
          kwargs.pop("deprecated", None)
          operation_id = kwargs.pop("operation_id", None)
          operation_id_old = None
          if operation_id:
              operation_id_old = f"{operation_id}_old"
  
          old_router_method_ = old_router_method or router_method
  
          old_router_method_(
              path=path,
              *args,
              deprecated=True,
              operation_id=operation_id_old,
              **kwargs,
          )(func)
          router_method(
              path=new_path,
              *args,
              deprecated=False,
              operation_id=operation_id,
              **kwargs,
          )(func)
  
      return decorator
  
label_desc: Use image node_id 1 for calling a global function with example usage: deprecate_endpoint(path, new_path, router_method, old_router_method) and returns: decorator