code: def _find_neighbor_and_lambda(
      neighbor_indices, neighbor_distances, core_distances, min_samples
  ):
      """
      Find the nearest mutual reachability neighbor of a point, and  compute
      the associated lambda value for the point, given the mutual reachability
      distance to a nearest neighbor.
  
      Parameters
      ----------
      neighbor_indices : array (2 * min_samples, )
          An array of raw distance based nearest neighbor indices.
  
      neighbor_distances : array (2 * min_samples, )
          An array of raw distances to the nearest neighbors.
  
      core_distances : array (n_samples, )
          An array of core distances for all points
  
      min_samples : int
          The min_samples value used to generate core distances.
  
      Returns
      -------
      neighbor : int
          The index into the full raw data set of the nearest mutual reachability
          distance neighbor of the point.
  
      lambda_ : float
          The lambda value at which this point joins/merges with `neighbor`.
      """
      neighbor_core_distances = core_distances[neighbor_indices]
      point_core_distances = neighbor_distances[min_samples] * np.ones(
          neighbor_indices.shape[0]
      )
      mr_distances = np.vstack(
          (
              neighbor_core_distances,
              point_core_distances,
              neighbor_distances,
          )
      ).max(axis=0)
  
      nn_index = mr_distances.argmin()
  
      nearest_neighbor = neighbor_indices[nn_index]
      if mr_distances[nn_index] > 0.0:
          lambda_ = 1.0 / mr_distances[nn_index]
      else:
          lambda_ = np.finfo(np.double).max
  
      return nearest_neighbor, lambda_
  
file_path: hdbscan/hdbscan/prediction.py
imports: import numpy
  from sklearn.neighbors import KDTree, BallTree
  from .dist_metrics import DistanceMetric
  from ._hdbscan_tree import recurse_leaf_dfs
  from ._prediction_utils import get_tree_row_with_child, dist_membership_vector, outlier_membership_vector, prob_in_some_cluster, all_points_dist_membership_vector, all_points_outlier_membership_vector, all_points_prob_in_some_cluster
  from warnings import warn
label_desc: Use image node_id 1 for calling a global function with example usage: _find_neighbor_and_lambda(neighbor_indices, neighbor_distances, core_distances, min_samples) and returns: nearest_neighbor,  lambda_