@contract
def tricube_weights(n):
    """ Generates a list of weights according to the tricube function.

    :param n: The number of weights to generate.
     :type n: int

    :return: A list of generated weights.
     :rtype: list(float)
    """
    spread = top = float(n - 1)
    weights = []
    for i in range(2, n):
        weights.append((1 - ((top - i) / spread) ** 3) ** 3)
    return [weights[0], weights[0]] + weights
dataset/ETHPy150Open beloglazov/openstack-neat/neat/locals/overload/statistics.py/tricube_weights/original