<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rolling_returns_cumulative(returns, window, min_periods=1, geometric=True):
 """ return the rolling cumulative returns Parameters returns : DataFrame or Series window : number of observations min_periods : minimum number of observations in a window geometric : link the returns geometrically """

    if geometric:
        rc = lambda x: (1. + x[np.isfinite(x)]).prod() - 1.
    else:
        rc = lambda x: (x[np.isfinite(x)]).sum()

    return pd.rolling_apply(returns, window, rc, min_periods=min_periods)