code: def attributes(self):
          
          length = c_bst_ulong()
          sarr = ctypes.POINTER(ctypes.c_char_p)()
          _check_call(_LIB.XGBoosterGetAttrNames(self.handle,
                                                 ctypes.byref(length),
                                                 ctypes.byref(sarr)))
          attr_names = from_cstr_to_pystr(sarr, length)
          return {n: self.attr(n) for n in attr_names}
docs: Get attributes stored in the Booster as a dictionary.
  
          Returns
          -------
          result : dictionary of  attribute_name: attribute_value pairs of strings.
              Returns an empty dict if there's no attributes.