def sigma_to_eps(
        self,
        sigma: float,
        mechanism: PrivacyMechanism,
        size: int,
        max_token_cnt: int,
        max_self_compositions: int = 1000,
        eps_error: float = 0.01,
        delta_error: float = 1e-10,
    ) -> float:
        """
        Return the epsilon value given a sigma.

        Args:
            sigma (float): The parameter associated with noise mechanism.
            mechanism (PrivacyMechanism): Noise mechanism.
            size (int): Number of samples to be generated.
            max_token_cnt (int): Number of tokens generated per sample.
            max_self_compositions (int, optional): PRV algorithm parameter. Defaults to 1000.
            eps_error (float, optional): PRV algorithm parameter. Defaults to 0.01.
            delta_error (float, optional): PRV algorithm parameter. Defaults to 1e-10.

        Returns:
            float: The epsilon value.

        """
        if max_token_cnt > max_self_compositions:
            raise ValueError(
                "`max_token_cnt` cannot be greater than `max_self_composition`."
            )

        sample_rate = size / self._num_examples
        if mechanism == PrivacyMechanism.GAUSSIAN:
            prv_0 = PoissonSubsampledGaussianMechanism(
                noise_multiplier=sigma, sampling_probability=sample_rate
            )
        elif mechanism == PrivacyMechanism.EXPONENTIAL:
            sigma_bar = math.log(1 + sample_rate * (math.exp(sigma) - 1))
            prv_0 = PureDPMechanism(eps=sigma_bar)
        else:
            raise ValueError(
                "Invalid value for mechanism entered."
                " Please use either 'gaussian' or 'exponential'."
            )
        accountant = PRVAccountant(
            prvs=[
                prv_0,
            ],
            max_self_compositions=[max_self_compositions],
            eps_error=eps_error,
            delta_error=delta_error,
        )
        _eps_low, eps_est, _eps_up = accountant.compute_epsilon(
            delta=1 / self._num_examples, num_self_compositions=[max_token_cnt]
        )
        return eps_est

        Return the epsilon value given a sigma.

        Args:
            sigma (float): The parameter associated with noise mechanism.
            mechanism (PrivacyMechanism): Noise mechanism.
            size (int): Number of samples to be generated.
            max_token_cnt (int): Number of tokens generated per sample.
            max_self_compositions (int, optional): PRV algorithm parameter. Defaults to 1000.
            eps_error (float, optional): PRV algorithm parameter. Defaults to 0.01.
            delta_error (float, optional): PRV algorithm parameter. Defaults to 1e-10.

        Returns:
            float: The epsilon value.

        
llama-index-packs/llama-index-packs-diff-private-simple-dataset/llama_index/packs/diff_private_simple_dataset/base.py