code: def max_ratio(stacked_distances):
      max_ratio = 0
      for i in range(stacked_distances.shape[0]):
          for j in range(stacked_distances.shape[1]):
              dist = stacked_distances[i][j][0]
              coredist = stacked_distances[i][j][1]
              if dist == 0 or coredist / dist <= max_ratio:
                  continue
              max_ratio = coredist / dist
  
      return max_ratio
  
file_path: hdbscan/hdbscan/validity.py
imports: import numpy
  from sklearn.metrics import pairwise_distances
  from scipy.spatial.distance import cdist
  from ._hdbscan_linkage import mst_linkage_core
  from .hdbscan_ import isclose
label_desc: Use image node_id 2 for calling a global function with example usage: max_ratio(stacked_distances) and returns: max_ratio