code: def _round_corners(pts, round_at_distance):
      if len(pts) > 2:
          calc_with_distance = round_at_distance
          while calc_with_distance > 0.5:
              new_lst = [pts[0]]
              for i, curr in enumerate(pts[1:-1]):
                  i += 1
                  p1 = pts[i - 1]
                  p2 = curr
                  p3 = pts[i + 1]
                  if len(pts) > 3:
                      # i.e.: at least 4 points
                      if sqrt(
                          (p3[0] - p2[0]) ** 2 + (p3[1] - p2[1]) ** 2
                      ) < (2 * calc_with_distance):
                          # prevent from crossing over.
                          new_lst.append(p2)
                          continue
                  generated = _gen_smoother_middle_points_from_3_points(
                      [p1, p2, p3], calc_with_distance
                  )
                  for j in generated:
                      new_lst.append(j)
              new_lst.append(pts[-1])
              pts = new_lst
              calc_with_distance /= 2.0
      return pts
  
file_path: pygraphistry/graphistry/layout/utils/routing.py
imports: from .geometry import rectangle_point_intersection, angle_between_vectors, sqrt
label_desc: Use image node_id 5 for calling a global function with example usage: _round_corners(pts, round_at_distance) and returns: pts