code: def bicor(x, y, c=9):
      """
      Biweight midcorrelation.
  
      Parameters
      ----------
      x, y : array_like
          First and second set of observations. x and y must be independent.
      c : float
          Tuning constant for the biweight estimator (default = 9.0).
  
      Returns
      -------
      r : float
          Correlation coefficient.
      pval : float
          Two-tailed p-value.
  
      Notes
      -----
      This function will return (np.nan, np.nan) if mad(x) == 0 or mad(y) == 0.
  
      References
      ----------
      https://en.wikipedia.org/wiki/Biweight_midcorrelation
  
      https://docs.astropy.org/en/stable/api/astropy.stats.biweight.biweight_midcovariance.html
  
      Langfelder, P., & Horvath, S. (2012). Fast R Functions for Robust
      Correlations and Hierarchical Clustering. Journal of Statistical Software,
      46(11). https://www.ncbi.nlm.nih.gov/pubmed/23050260
      """
      # Calculate median
      nx = x.size
      x_median = np.median(x)
      y_median = np.median(y)
  
      # Raw median absolute deviation
      x_mad = np.median(np.abs(x - x_median))
      y_mad = np.median(np.abs(y - y_median))
      if x_mad == 0 or y_mad == 0:
          # From Langfelder and Horvath 2012:
          # "Strictly speaking, a call to bicor in R should return a missing
          # value if mad(x) = 0 or mad(y) = 0." This avoids division by zero.
          return np.nan, np.nan
  
      # Calculate weights
      u = (x - x_median) / (c * x_mad)
      v = (y - y_median) / (c * y_mad)
      w_x = (1 - u**2) ** 2 * ((1 - np.abs(u)) > 0)
      w_y = (1 - v**2) ** 2 * ((1 - np.abs(v)) > 0)
  
      # Normalize x and y by weights
      x_norm = (x - x_median) * w_x
      y_norm = (y - y_median) * w_y
      denom = np.sqrt((x_norm**2).sum()) * np.sqrt(
          (y_norm**2).sum()
      )
  
      # Correlation coefficient
      r = (x_norm * y_norm).sum() / denom
      pval = _correl_pvalue(r, nx, k=0)
      return r, pval
  
imports: import warnings
  import numpy
  import pandas
  import pandas_flavor
  from scipy.spatial.distance import pdist, squareform
  from scipy.stats import pearsonr, spearmanr, kendalltau
  from pingouin.config import options
  from pingouin.power import power_corr
  from pingouin.multicomp import multicomp
  from pingouin.effsize import compute_esci
  from pingouin.utils import remove_na, _perm_pval, _postprocess_dataframe
  from pingouin.bayesian import bayesfactor_pearson
label_desc: Use image node_id 6 for calling a global function with example usage: bicor(x, y, c) and returns: r,  pval, np,  np