def _get_accessible_leaves(
        self, i_sample: int, eps: float, norm: float, target_label: int | None
    ) -> list[list[LeafNode]]:
        """
        Determine the leaf nodes accessible within the attack budget.

        :param i_sample: Index of training sample in `x`.
        :param eps: Attack budget epsilon.
        :param norm: The norm to apply epsilon.
        :param target_label: The target label.
        :return: A list of lists of leaf nodes.
        """
        accessible_leaves = []

        for tree in self._trees:
            if (
                self._classifier.nb_classes <= 2
                or target_label is None
                or tree.class_id in [self.y[i_sample], target_label]
            ):

                leaves = []

                for leaf_node in tree.leaf_nodes:
                    distance = self._get_distance(leaf_node.box, i_sample, norm)
                    if leaf_node.box and distance <= eps:
                        leaves.append(leaf_node)

                if not leaves:  # pragma: no cover
                    raise ValueError("No accessible leaves found.")

                accessible_leaves.append(leaves)

        return accessible_leaves

        Determine the leaf nodes accessible within the attack budget.

        :param i_sample: Index of training sample in `x`.
        :param eps: Attack budget epsilon.
        :param norm: The norm to apply epsilon.
        :param target_label: The target label.
        :return: A list of lists of leaf nodes.
        
art/metrics/verification_decisions_trees.py