class_docstr: A data iterator for XGBoost DMatrix.
  
  `reset` and `next` are required for any data iterator, other functions here
  are utilites for demonstration's purpose.
code: def as_array(self):
      return cudf.concat(self._data)
  
imports: import json
  import numpy
  import pytest
  import xgboost
  from xgboost import testing
  from xgboost.testing.data import run_base_margin_info
label_desc: Use image node_id 2 for calling the IterForDMatrixTest obj's underlying member method code with example usage: obj.as_array() and returns: cudf