code: def test_sample_can_be_zipped():
      """Ensures that the sampling is done via indexing.
  
      That is, sampling X and y separately would give the same result as sampling
      concat(X, y), up to a random state. Our `datasets` module relies on
      this behaviour.
      """
      arr1 = pd.Series(np.arange(100))
      arr2 = pd.Series(np.repeat(np.arange(25), 4))
      combined = pd.DataFrame(
          {
              "arr1": arr1,
              "arr2": arr2,
          }
      )
  
      new_arr1 = shap.utils.sample(arr1, 75, random_state=42)
      new_arr2 = shap.utils.sample(arr2, 75, random_state=42)
      new_combined = shap.utils.sample(combined, 75, random_state=42)
  
      assert (new_arr1 == new_combined["arr1"]).all()
      assert (new_arr2 == new_combined["arr2"]).all()
  
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 5 for calling a global function with example usage: test_sample_can_be_zipped() without return types