def METHOD_NAME(x, w):
    new_data = 0
    if isinstance(x, SparseVector):
        for idx, v in x.get_all_data():
            # if idx < len(w):
            new_data += v * w[idx]
    else:
        new_data = np.dot(x, w)
    return new_data