code: def dmatrix_from_cudf(input_type, DMatrixT, missing=np.NAN):
      """Test constructing DMatrix from cudf"""
      import pandas as pd
  
      kRows = 80
      kCols = 3
  
      na = np.random.randn(kRows, kCols)
      na[:, 0:2] = na[:, 0:2].astype(input_type)
  
      na[5, 0] = missing
      na[3, 1] = missing
  
      pa = pd.DataFrame(
          {"0": na[:, 0], "1": na[:, 1], "2": na[:, 2].astype(np.int32)}
      )
  
      np_label = np.random.randn(kRows).astype(input_type)
      pa_label = pd.DataFrame(np_label)
  
      cd = cudf.from_pandas(pa)
      cd_label = cudf.from_pandas(pa_label).iloc[:, 0]
  
      dtrain = DMatrixT(cd, missing=missing, label=cd_label)
      assert dtrain.num_col() == kCols
      assert dtrain.num_row() == kRows
  
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 1 for calling a global function with example usage: dmatrix_from_cudf(input_type, DMatrixT, missing) without return types