code: def custom_rmse_model(plot_result: bool, strategy: str) -> None:
      """Train using Python implementation of Squared Error."""
  
      def gradient(
          predt: np.ndarray, dtrain: xgb.DMatrix
      ) -> np.ndarray:
          """Compute the gradient squared error."""
          y = dtrain.get_label().reshape(predt.shape)
          return predt - y
  
      def hessian(predt: np.ndarray, dtrain: xgb.DMatrix) -> np.ndarray:
          """Compute the hessian for squared error."""
          return np.ones(predt.shape)
  
      def squared_log(
          predt: np.ndarray, dtrain: xgb.DMatrix
      ) -> Tuple[np.ndarray, np.ndarray]:
          grad = gradient(predt, dtrain)
          hess = hessian(predt, dtrain)
          # both numpy.ndarray and cupy.ndarray works.
          return grad, hess
  
      def rmse(
          predt: np.ndarray, dtrain: xgb.DMatrix
      ) -> Tuple[str, float]:
          y = dtrain.get_label().reshape(predt.shape)
          v = np.sqrt(np.sum(np.power(y - predt, 2)))
          return "PyRMSE", v
  
      X, y = gen_circle()
      Xy = xgb.DMatrix(X, y)
      results: Dict[str, Dict[str, List[float]]] = {}
      # Make sure the `num_target` is passed to XGBoost when custom objective is used.
      # When builtin objective is used, XGBoost can figure out the number of targets
      # automatically.
      booster = xgb.train(
          {
              "tree_method": "hist",
              "num_target": y.shape[1],
              "multi_strategy": strategy,
          },
          dtrain=Xy,
          num_boost_round=128,
          obj=squared_log,
          evals=[(Xy, "Train")],
          evals_result=results,
          custom_metric=rmse,
      )
  
      y_predt = booster.inplace_predict(X)
      if plot_result:
          plot_predt(y, y_predt, "multi")
  
file_path: xgboost/demo/guide-python/multioutput_regression.py
imports: import argparse
  from typing import Dict, List, Tuple
  import numpy
  from matplotlib import pyplot
  import xgboost
label_desc: Use image node_id 4 for calling a global function with example usage: custom_rmse_model(plot_result, strategy) and returns: unknown, np, grad,  hess, str,  v