code: def test_train_on_ray_cluster(
      ray_start_regular, ray_create_mars_cluster
  ):
      rs = mt.random.RandomState(0)
      # keep 1 chunk for X and y
      X = rs.rand(
          n_rows, n_columns, chunk_size=(n_rows, n_columns // 2)
      )
      y = rs.rand(n_rows, chunk_size=n_rows)
      base_margin = rs.rand(n_rows, chunk_size=n_rows)
      dtrain = MarsDMatrix(X, y, base_margin=base_margin)
      eval_x = MarsDMatrix(
          rs.rand(n_rows, n_columns, chunk_size=n_rows // 5),
          rs.rand(n_rows, chunk_size=n_rows // 5),
      )
      evals = [(eval_x, "eval_x")]
      eval_result = dict()
      booster = train(
          {},
          dtrain,
          num_boost_round=2,
          evals=evals,
          evals_result=eval_result,
      )
      assert isinstance(booster, Booster)
      assert len(eval_result) > 0
  
      with pytest.raises(TypeError):
          train(
              {},
              dtrain,
              num_boost_round=2,
              evals=[("eval_x", eval_x)],
              evals_result=eval_result,
          )
  
file_path: mars/mars/learn/contrib/xgboost/tests/test_train.py
imports: import numpy
  import pytest
  from .....None import tensor
  from .....None import dataframe
  from .....tests.core import require_ray
  from ..None import train, MarsDMatrix
label_desc: Use image node_id 5 for calling a global function with example usage: test_train_on_ray_cluster(ray_start_regular, ray_create_mars_cluster) without return types