code: def test_sample_basic(arr):
      """Tests the basic functionality of `sample()` on a variety of array-like objects."""
      new_arr = shap.utils.sample(arr, 30, random_state=42)
      assert len(new_arr) == 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 1 for calling a global function with example usage: test_sample_basic(arr) without return types