class_docstr: A global context to hold additional attributes of xgb.DMatrix
class_docstr_tok: ["A","global","context","to","hold","additional","attributes","of","xgb.DMatrix"]
docstr: Set an attribute for a xgb.DMatrix
  Parameters
  ----------
  key: str
      The name of the attribute
  matrix: xgb.DMatrix
      The matrix
  value: Optional[Any]
      The new value
docstr_tok: ["Set","an","attribute","for","a","xgb.DMatrix","Parameters","--","--","--","--","--","key",":","str","The","name","of","the","attribute","matrix",":","xgb.DMatrix","The","matrix","value",":","Optional","[","Any","]","The","new","value"]
code: def set(self, key, matrix, value):
      """
      Set an attribute for a xgb.DMatrix
      Parameters
      ----------
      key: str
          The name of the attribute
      matrix: xgb.DMatrix
          The matrix
      value: Optional[Any]
          The new value
      """
      self.context_dict[key][matrix.handle.value] = value
  
imports: import multiprocessing
  import logging
  from typing import Dict
  from collections import defaultdict
  import numpy
  from tvm.autotvm.tuner.metric import max_curve
  from .cost_model import PythonBasedModel
  from ..feature import get_per_store_features_from_measure_pairs, get_per_store_features_from_states
  from ..measure_record import RecordReader
label_desc: Use image node_id 3 for calling the XGBDMatrixContext obj's underlying member method code with example usage: obj.set(key, matrix, value) without return types