def _get_coarse_reduced_mask(
        self,
        x: np.ndarray,
        x_noise: np.ndarray,
        x_tar_noise: np.ndarray,
        y: int,
        mask: np.ndarray,
        patches: list[np.ndarray],
        indices: list[tuple[int, int]],
        xforms: list,
        clip_min: float,
        clip_max: float,
        pts: np.ndarray | None = None,
    ) -> tuple[np.ndarray, list[np.ndarray], list[tuple[int, int]]]:
        """
        Function to coarsely reduce mask.

        :param x: An array with one original input to be attacked.
        :param x_noise: x in the resolution of the noise size.
        :param x_tar_noise: x_tar in the resolution of the noise size.
        :param y: The target label.
        :param mask: An array with a mask to be applied to the adversarial perturbations. Shape needs to be
                     broadcastable to the shape of x. Any features for which the mask is zero will not be adversarially
                     perturbed.
        :param patches: List of patches from heatmap.
        :param indices: List of indices for the heatmap patches.
        :param xforms: List of transform params.
        :param clip_min: Minimum value of an example.
        :param clip_max: Maximum value of an example.
        :param pts: Optional. A set of points that will set the crop size in the perspective transform.
        :return: mask, adjusted list of patches, adjusted list of indices
        """
        # binary search leftmost pivot value for which `tr` exceeds specified threshold if one exists
        num_patches = len(patches)
        if num_patches == 1:
            pivot = 0

        else:
            low = 0
            high = num_patches - 1
            while low <= high:
                mid = low + (high - low) // 2
                score, _ = self._evaluate_transform_robustness_at_pivot(
                    x, x_noise, x_tar_noise, y, mask, patches, xforms, clip_min, clip_max, mid, pts
                )
                if score >= self.tr_hi:
                    if mid > 0:
                        high = mid - 1
                        continue
                    break

                # score < threshold:
                low = mid + 1

            pivot = mid

        _, best_mask = self._evaluate_transform_robustness_at_pivot(
            x, x_noise, x_tar_noise, y, mask, patches, xforms, clip_min, clip_max, pivot, pts
        )

        patches = patches[:]  # reduce will examine all patches
        indices = indices[:]

        return best_mask, patches, indices

        Function to coarsely reduce mask.

        :param x: An array with one original input to be attacked.
        :param x_noise: x in the resolution of the noise size.
        :param x_tar_noise: x_tar in the resolution of the noise size.
        :param y: The target label.
        :param mask: An array with a mask to be applied to the adversarial perturbations. Shape needs to be
                     broadcastable to the shape of x. Any features for which the mask is zero will not be adversarially
                     perturbed.
        :param patches: List of patches from heatmap.
        :param indices: List of indices for the heatmap patches.
        :param xforms: List of transform params.
        :param clip_min: Minimum value of an example.
        :param clip_max: Maximum value of an example.
        :param pts: Optional. A set of points that will set the crop size in the perspective transform.
        :return: mask, adjusted list of patches, adjusted list of indices
        
art/attacks/evasion/graphite/graphite_blackbox.py