def calc_rate(rate, rate_long, maturity):
    """Approximate a current interest rate.

    Permforms linear interpolation based on the current
    1-year and 10-year rates and the maturity of the
    bond.

    Parameters
    ----------
    rate : float
        1-year interest rate.
    rate_long : float
        10-year interest rate.
    maturity : int
        Maturity of the bond in years.

    Returns
    -------
    float
        Approximated interest rate.
    """
    return rate + (rate_long - rate)*(maturity - 1) / 9