code: def toy_data_exponential():
      rnd = np.random.RandomState(2)
      n_samples = 100
      x = rnd.randn(n_samples, 2)
      y = np.empty(n_samples, dtype=[("event", bool), ("time", float)])
      y["time"] = rnd.exponential(scale=np.exp(x[:, 0]), size=n_samples)
      y["event"] = rnd.binomial(1, 0.5, size=n_samples) == 1
  
      # ensure at least 2 uncensored events exist
      y["event"][:2] = True
  
      # mark entry with largest time as censored
      # see https://github.com/sebp/scikit-survival/issues/249
      idxmax = np.argmax(y["time"])
      y["event"][idxmax] = False
      return x, y
  
file_path: scikit-survival/tests/test_functions.py
imports: import numpy
  from numpy.testing import assert_array_equal
  import pytest
  from sksurv.functions import StepFunction
  from sksurv.testing import all_survival_estimators
label_desc: Use image node_id 2 for calling a global function with example usage: toy_data_exponential() and returns: x,  y