@contract
def tricube_bisquare_weights(data):
    """ Generates a weights according to the tricube bisquare function.

    :param data: The input data.
     :type data: list(float)

    :return: A list of generated weights.
     :rtype: list(float)
    """
    n = len(data)
    s6 = 6 * median(map(abs, data))
    weights = tricube_weights(n)
    weights2 = []
    for i in range(2, n):
            weights2.append(weights[i] * (1 - (data[i] / s6) ** 2) ** 2)
    return [weights2[0], weights2[0]] + weights2
dataset/ETHPy150Open beloglazov/openstack-neat/neat/locals/overload/statistics.py/tricube_bisquare_weights/original