code: def train_result(param, dmat, num_rounds):
      result = {}
      booster = xgb.train(
          param,
          dmat,
          num_rounds,
          [(dmat, "train")],
          verbose_eval=False,
          evals_result=result,
      )
      assert booster.num_boosted_rounds() == num_rounds
      return result
  
file_path: xgboost/tests/python-gpu/test_gpu_linear.py
imports: import pytest
  from hypothesis import assume, given, note, settings, strategies
  import xgboost
  from xgboost import testing
label_desc: Use image node_id 1 for calling a global function with example usage: train_result(param, dmat, num_rounds) and returns: result