<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def prox_components(X, step, prox=None, axis=0):
 """Split X along axis and apply prox to each chunk. prox can be a list. """

    K = X.shape[axis]

    if not hasattr(prox_list, '__iter__'):
        prox = [prox] * K
    assert len(prox_list) == K

    if axis == 0:
        Pk = [prox_list[k](X[k], step) for k in range(K)]
    if axis == 1:
        Pk = [prox_list[k](X[:,k], step) for k in range(K)]
    return np.stack(Pk, axis=axis)