def _get_distance(self, box: Box, i_sample: int, norm: float) -> float:
        """
        Determine the distance between sample and interval box.

        :param box: Interval box.
        :param i_sample: Index of training sample in `x`.
        :param norm: The norm to apply epsilon.
        :return: The distance.
        """
        resulting_distance = 0.0

        for feature, interval in box.intervals.items():
            feature_value = self.x[i_sample, feature]

            if interval.lower_bound < feature_value < interval.upper_bound:
                distance = 0.0
            else:
                difference = max(
                    feature_value - interval.upper_bound,
                    interval.lower_bound - feature_value,
                )
                if norm == 0:
                    distance = 1.0
                elif norm == np.inf:
                    distance = difference
                else:
                    distance = pow(difference, norm)

            if norm == np.inf:
                resulting_distance = max(resulting_distance, distance)
            else:
                resulting_distance += distance

        if norm not in [0, np.inf]:
            resulting_distance = pow(resulting_distance, 1.0 / norm)

        return resulting_distance

        Determine the distance between sample and interval box.

        :param box: Interval box.
        :param i_sample: Index of training sample in `x`.
        :param norm: The norm to apply epsilon.
        :return: The distance.
        
art/metrics/verification_decisions_trees.py