code: def test_feature_weights(self):
      kRows = 10
      kCols = 50
      rng = np.random.RandomState(1994)
      fw = rng.uniform(size=kCols)
      X = rng.randn(kRows, kCols)
      m = xgb.DMatrix(X)
      m.set_info(feature_weights=fw)
      np.testing.assert_allclose(
          fw, m.get_float_info("feature_weights")
      )
      # Handle empty
      m.set_info(feature_weights=np.empty((0,)))
  
      assert m.get_float_info("feature_weights").shape[0] == 0
  
      fw -= 1
  
      with pytest.raises(ValueError):
          m.set_info(feature_weights=fw)
  
imports: import csv
  import os
  import tempfile
  import warnings
  import numpy
  import pytest
  import scipy.sparse
  from hypothesis import given, settings, strategies
  from scipy.sparse import csr_matrix, rand
  import xgboost
  from xgboost import testing
  from xgboost.core import DataSplitMode
  from xgboost.testing.data import np_dtypes, run_base_margin_info
label_desc: Use image node_id 10 for calling the TestDMatrix obj's underlying member method code with example usage: obj.test_feature_weights() without return types