code: def test_digits_stochastic():
      model = FacilityLocationSelection(
          25, "cosine", optimizer="stochastic", random_state=0
      )
      model.fit(X_digits_cupy, sample_cost=X_digits_costs)
      assert_array_equal(model.ranking, digits_stochastic_ranking)
      assert_array_almost_equal(model.gains, digits_stochastic_gains, 4)
      assert_less_equal(sum(X_digits_costs[model.ranking]), 25)
  
imports: import scipy
  import numpy
  from apricot import FacilityLocationSelection
  from apricot.optimizers import *
  from sklearn.datasets import load_digits
  from sklearn.metrics import pairwise_distances
  from nose.tools import assert_less_equal
  from numpy.testing import assert_almost_equal
  from numpy.testing import assert_array_equal
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 9 for calling a global function with example usage: test_digits_stochastic() without return types