code: def find_natural_neighbors(tri, grid_points):
      r
      tree = cKDTree(grid_points)
  
      in_triangulation = tri.find_simplex(tree.data) >= 0
  
      triangle_info = {}
  
      members = {key: [] for key in range(len(tree.data))}
  
      for i, simplices in enumerate(tri.simplices):
  
          ps = tri.points[simplices]
  
          cc = circumcenter(*ps)
          r = circumcircle_radius(*ps)
  
          triangle_info[i] = {'cc': cc, 'r': r}
  
          qualifiers = tree.query_ball_point(cc, r)
  
          for qualifier in qualifiers:
              if in_triangulation[qualifier]:
                  members[qualifier].append(i)
  
      return members, triangle_info
docs: r"""Return the natural neighbor triangles for each given grid cell.
  
      These are determined by the properties of the given delaunay triangulation.
      A triangle is a natural neighbor of a grid cell if that triangles circumcenter
      is within the circumradius of the grid cell center.
  
      Parameters
      ----------
      tri: Object
          A Delaunay Triangulation.
      grid_points: (X, Y) ndarray
          Locations of grids.
  
      Returns
      -------
      members: dictionary
          List of simplex codes for natural neighbor
          triangles in 'tri' for each grid cell.
      triangle_info: dictionary
          Circumcenter and radius information for each
          triangle in 'tri'.