def rolling_sum(data=None, window=None, freq=None, to_df=False):
    if not freq or not window:
        raise ValueError('Please include all required parameters.')

    send = {'freq': json.dumps(freq), 'data': json.dumps(data), 'window': window}
    r = requests.post('http://127.0.0.1:5000/rolling_sum', data=send)
    response = r.json

    if to_df:
        import pandas as pd
        key = response.keys()[0]
        index = pd.to_datetime(response[key]['time'])
        df = pd.DataFrame({key: response[key]['data']}, index=index)
        return df

    return response
find method that uses the cursor to only return a block of
dataset/ETHPy150Open wrobstory/mcflyin/examples/marty.py/rolling_sum--crossover with--dataset/ETHPy150Open twisted/txmongo/txmongo/collection.py/Collection.find_with_cursor