<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calc_bca_interval(bootstrap_replicates, jackknife_replicates, mle_params, conf_percentage):
 """ Calculate 'bias-corrected and accelerated' bootstrap confidence intervals. Parameters bootstrap_replicates : 2D ndarray. Each row should correspond to a different bootstrap parameter sample. Each column should correspond to an element of the parameter vector being estimated. jackknife_replicates : 2D ndarray. Each row should correspond to a different jackknife parameter sample, formed by deleting a particular observation and then re-estimating the desired model. Each column should correspond to an element of the parameter vector being estimated. mle_params : 1D ndarray. The original dataset's maximum likelihood point estimate. Should have the same number of elements as `samples.shape[1]`. conf_percentage : scalar in the interval (0.0, 100.0). Denotes the confidence-level of the returned confidence interval. For instance, to calculate a 95% confidence interval, pass `95`. Returns ------- conf_intervals : 2D ndarray. The shape of the returned array will be `(2, samples.shape[1])`. The first row will correspond to the lower value in the confidence interval. The second row will correspond to the upper value in the confidence interval. There will be one column for each element of the parameter vector being estimated. References Efron, Bradley, and Robert J. Tibshirani. An Introduction to the Bootstrap. CRC press, 1994. Section 14.3. DiCiccio, Thomas J., and Bradley Efron. "Bootstrap confidence intervals." Statistical science (1996):
 189-212. """

    # Check validity of arguments
    check_conf_percentage_validity(conf_percentage)
    ensure_samples_is_ndim_ndarray(bootstrap_replicates, ndim=2)
    ensure_samples_is_ndim_ndarray(jackknife_replicates,
                                   name='jackknife', ndim=2)
    # Calculate the alpha * 100% value
    alpha_percent = get_alpha_from_conf_percentage(conf_percentage)
    # Estimate the bias correction for the bootstrap samples
    bias_correction =\
        calc_bias_correction_bca(bootstrap_replicates, mle_params)
    # Estimate the acceleration
    acceleration = calc_acceleration_bca(jackknife_replicates)
    # Get the lower and upper percent value for the raw bootstrap samples.
    lower_percents =\
        calc_lower_bca_percentile(alpha_percent, bias_correction, acceleration)
    upper_percents =\
        calc_upper_bca_percentile(alpha_percent, bias_correction, acceleration)
    # Get the lower and upper endpoints for the desired confidence intervals.
    lower_endpoints = np.diag(np.percentile(bootstrap_replicates,
                                            lower_percents,
                                            interpolation='lower',
                                            axis=0))
    upper_endpoints = np.diag(np.percentile(bootstrap_replicates,
                                            upper_percents,
                                            interpolation='higher',
                                            axis=0))
    # Combine the enpoints into a single ndarray.
    conf_intervals = combine_conf_endpoints(lower_endpoints, upper_endpoints)
    return conf_intervals