code: def _to_dmatrix(data):
      import xgboost as xgb
  
      dm = xgb.DMatrix(data.data, label=data.target)
      return dm
  
file_path: pandas-ml/pandas_ml/xgboost/base.py
imports: from pandas_ml.core.accessor import _AccessorMethods
label_desc: Use image node_id 1 for calling a global function with example usage: _to_dmatrix(data) and returns: dm