code: def test_sample_basic_sparse():
      """Tests the basic functionality of `sample()` on sparse objects."""
      arr = ssp.csr_matrix((100, 3), dtype=np.int8)
      new_arr = shap.utils.sample(arr, 30, random_state=42)
      assert new_arr.shape[0] == 30
  
file_path: shap/tests/utils/test_general.py
imports: import numpy
  import pandas
  import pytest
  import scipy.sparse
  import shap
label_desc: Use image node_id 2 for calling a global function with example usage: test_sample_basic_sparse() without return types