code: def test_with_sklearn_obj_metric() -> None:
      from sklearn.metrics import mean_squared_error
  
      X, y = tm.datasets.make_regression()
      reg = xgb.XGBRegressor(
          objective=tm.ls_obj, eval_metric=mean_squared_error
      )
      reg.fit(X, y)
  
      pkl = pickle.dumps(reg)
      reg_1 = pickle.loads(pkl)
      assert callable(reg_1.objective)
      assert callable(reg_1.eval_metric)
  
      with tempfile.TemporaryDirectory() as tmpdir:
          path = os.path.join(tmpdir, "model.json")
          reg.save_model(path)
  
          reg_2 = xgb.XGBRegressor()
          reg_2.load_model(path)
  
      assert not callable(reg_2.objective)
      assert not callable(reg_2.eval_metric)
      assert reg_2.eval_metric is None
  
imports: import json
  import locale
  import os
  import pickle
  import tempfile
  from pathlib import Path
  from typing import List
  import numpy
  import pytest
  import xgboost
  from xgboost import testing
label_desc: Use image node_id 4 for calling a global function with example usage: test_with_sklearn_obj_metric() without return types