def METHOD_NAME(vec, max_size):
    if max_size < 1:
        return []
    if len(vec) <= max_size or len(vec) == 0:
        return vec
    if max_size == 1:
        return [vec[0]]
    samples = np.linspace(0, len(vec), max_size - 1, endpoint=False).astype(int)
    samples = np.append(samples, len(vec) - 1)
    return vec[samples]