def METHOD_NAME(radius, smooth=True):  # pragma: no cover
    """
    Generates a ball-shaped structuring element.
    Parameters
    ----------
    radius : int
        The radius of the ball-shaped structuring element.
    smooth : bool, optional
        Indicates whether the balls should include the nibs (``False``) on
        the surface or not (``True``).  The default is ``True``.
    Returns
    -------
    cupy ndarray
        The structuring element where elements of the neighborhood
        are 1 and 0 otherwise.
    """
    import cupy as cp
    n = 2 * radius + 1
    Z, Y, X = cp.mgrid[-radius:radius:n * 1j,
                       -radius:radius:n * 1j,
                       -radius:radius:n * 1j]
    s = X ** 2 + Y ** 2 + Z ** 2
    if smooth:
        radius = radius - 0.001
    return s <= radius * radius