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_labels(self):
      return np.concatenate(self._labels)
  
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 3 for calling the IterForDMatrixTest obj's underlying member method code with example usage: obj.as_array_labels() and returns: np