code: def check_increasing(x, y):
      """Determine whether y is monotonically correlated with x.
  
      y is found increasing or decreasing with respect to x based on a Spearman
      correlation test.
  
      Parameters
      ----------
      x : array-like, shape=(n_samples,)
              Training data.
  
      y : array-like, shape=(n_samples,)
          Training target.
  
      Returns
      -------
      `increasing_bool` : boolean
          Whether the relationship is increasing or decreasing.
  
      Notes
      -----
      The Spearman correlation coefficient is estimated from the data, and the
      sign of the resulting estimate is used as the result.
  
      In the event that the 95% confidence interval based on Fisher transform
      spans zero, a warning is raised.
  
      References
      ----------
      Fisher transformation. Wikipedia.
      https://en.wikipedia.org/wiki/Fisher_transformation
      """
  
      # Calculate Spearman rho estimate and set return accordingly.
      rho, _ = spearmanr(x, y)
      increasing_bool = rho >= 0
  
      # Run Fisher transform to get the rho CI, but handle rho=+/-1
      if rho not in [-1.0, 1.0]:
          F = 0.5 * math.log((1.0 + rho) / (1.0 - rho))
          F_se = 1 / math.sqrt(len(x) - 3)
  
          # Use a 95% CI, i.e., +/-1.96 S.E.
          # https://en.wikipedia.org/wiki/Fisher_transformation
          rho_0 = math.tanh(F - 1.96 * F_se)
          rho_1 = math.tanh(F + 1.96 * F_se)
  
          # Warn if the CI spans zero.
          if np.sign(rho_0) != np.sign(rho_1):
              warnings.warn(
                  "Confidence interval of the Spearman "
                  "correlation coefficient spans zero. "
                  "Determination of ``increasing`` may be "
                  "suspect."
              )
  
      return increasing_bool
  
imports: import numpy
  from scipy import interpolate
  from scipy.stats import spearmanr
  from .base import BaseEstimator, TransformerMixin, RegressorMixin
  from .utils import as_float_array, check_array, check_consistent_length
  from .utils import deprecated
  from .utils.fixes import astype
  from ._isotonic import _inplace_contiguous_isotonic_regression, _make_unique
  import warnings
  import math
label_desc: Use image node_id 1 for calling a global function with example usage: check_increasing(x, y) and returns: increasing_bool