def query_ball_point(self, x, r, p=<NUM_LIT>, eps=<NUM_LIT:0>):
x = np.asarray(x)<EOL>if x.shape[-<NUM_LIT:1>] != self.m:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % (x.shape[-<NUM_LIT:1>], self.m))<EOL><DEDENT>if len(x.shape) == <NUM_LIT:1>:<EOL><INDENT>return self.__query_ball_point(x, r, p, eps)<EOL><DEDENT>else:<EOL><INDENT>retshape = x.shape[:-<NUM_LIT:1>]<EOL>result = np.empty(retshape, dtype=np.object)<EOL>for c in np.ndindex(retshape):<EOL><INDENT>result[c] = self.__query_ball_point(x[c], r, p=p, eps=eps)<EOL><DEDENT>return result<EOL><DEDENT>
Find all points within distance r of point(s) x.

        Parameters
        ----------
        x : array_like, shape tuple + (self.m,)
            The point or points to search for neighbors of.
        r : positive float
            The radius of points to return.
        p : float, optional
            Which Minkowski p-norm to use.  Should be in the range [1, inf].
        eps : nonnegative float, optional
            Approximate search. Branches of the tree are not explored if their
            nearest points are further than ``r / (1 + eps)``, and branches are
            added in bulk if their furthest points are nearer than
            ``r * (1 + eps)``.

        Returns
        -------
        results : list or array of lists
            If `x` is a single point, returns a list of the indices of the
            neighbors of `x`. If `x` is an array of points, returns an object
            array of shape tuple containing lists of neighbors.

        Notes
        -----
        If you have many points whose neighbors you want to find, you may save
        substantial amounts of time by putting them in a KDTree and using
        query_ball_tree.

        Examples
        --------
        >>> from scipy import spatial
        >>> x, y = np.mgrid[0:4, 0:4]
        >>> points = zip(x.ravel(), y.ravel())
        >>> tree = spatial.KDTree(points)
        >>> tree.query_ball_point([2, 0], 1)
        [4, 8, 9, 12]