code: def calc_reach_dist_new_points(
      set_index: set,
      neighborhoods: dict,
      rev_neighborhoods: dict,
      reach_dist: dict,
      dist_dict: dict,
      k_dist: dict,
  ):
      """
      Calculate reachability distance from new points to neighbors and from neighbors to new points.
      """
      for c in set_index:
          for j in set(neighborhoods[c]):
              reach_dist[c][j] = max(dist_dict[c][j], k_dist[j])
          for j in set(rev_neighborhoods[c]):
              reach_dist[j][c] = max(dist_dict[j][c], k_dist[c])
      return reach_dist
  
imports: from __future__ import annotations
  import copy
  import functools
  import pandas
  from river import anomaly, utils
  from river.neighbors.base import DistanceFunc
label_desc: Use image node_id 4 for calling a global function with example usage: calc_reach_dist_new_points(set_index, neighborhoods, rev_neighborhoods, reach_dist, dist_dict, k_dist) and returns: reach_dist