def METHOD_NAME(corners, weights):
    assert len(corners) == len(weights)
    first = corners[0]
    if not isinstance(first, dict):
        ret = sum(corners[i] * weights[i] for i in range(len(corners)))
        return ret
    results = dict()
    for k in first.keys():
        new_corners = [corner[k] for corner in corners]
        results[k] = METHOD_NAME(new_corners, weights)
    return results