def window_function(u):
    """
    params:
    - u: an iterable

    return:
    - 1 if u_i < 1/2 for all i ∈ {1,2, ... , d}, and 0 otherwise
    """
    for u_i in u:
        if abs(u_i) >= 0.5:
            return 0

    return 1