code: def sobol_first(Y, X, m):
      # pre-process to catch constant array
      # see: https://github.com/numpy/numpy/issues/9631
      if Y.ptp() == 0.0:
          # Catch constant results
          # If Y does not change then it is not sensitive to anything...
          return 0.0
  
      xr = rankdata(X, method="ordinal")
      Vi = 0
      N = len(Y)
      Y_mean = Y.mean()
      for j in range(len(m) - 1):
          ix = np.where((xr > m[j]) & (xr <= m[j + 1]))[0]
          nm = len(ix)
          Vi += (nm / N) * ((Y[ix].mean() - Y_mean) ** 2)
  
      return Vi / np.var(Y)
  
file_path: SALib/src/SALib/analyze/delta.py
imports: from typing import Dict
  from scipy.stats import norm, gaussian_kde, rankdata
  import numpy
  from .None import common_args
  from ..util import read_param_file, ResultDict
label_desc: Use image node_id 4 for calling a global function with example usage: sobol_first(Y, X, m) and returns: unknown, int