code: def linear_decay(X, y, min_value=0.0, max_value=1.0):
      """Generates a linear decay by mapping input data `X`, `y` to a linearly decreasing range from `max_value`
      to `min_value`. The length and step of the decay is determined by the number of samples in `y`.
  
      !!! warning
          It is up to the user to sort the dataset appropriately.
  
      Parameters
      ----------
      X : array-like, shape=(n_samples, n_features,)
          Training data. Unused, present for API consistency by convention.
      y : array-like, shape=(n_samples,)
          Target values. Used to determine the number of samples in the decay.
      min_value : float, default=0.
          The minimum value of the decay.
      max_value : float, default=1.
          The maximum value of the decay.
  
      Returns
      -------
      np.ndarray, shape=(n_samples,)
          The decay values.
  
      Raises
      ------
      ValueError
          If `min_value` is greater than `max_value`.
      """
  
      if min_value > max_value:
          raise ValueError(
              "`min_value` must be less than or equal to `max_value`"
          )
  
      n_samples = y.shape[0]
      return np.linspace(min_value, max_value, n_samples + 1)[1:]
  
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: linear_decay(X, y, min_value, max_value) and returns: np