code: def pearson(p, q, *_):
      # calculate pearson coefficient
      pearson_coeff = np.nan
      if len(p) >= 2:
          same0 = all(p == p[0])
          same1 = all(q == q[0])
          if not same0 and not same1:
              # this avoids std==0, and thereby avoid runtime warnings
              pearson_coeff, _ = stats.pearsonr(p, q)
      return pearson_coeff
  
file_path: popmon/popmon/analysis/comparison/comparisons.py
imports: import numpy
  from scipy import stats
  from popmon.base.registry import Registry
label_desc: Use image node_id 9 for calling a global function with example usage: pearson(p, q) and returns: pearson_coeff