def populate(df, n, stream):
    m = df.shape[0]
    while True:
        next(stream)
        j = next(stream)

        d = json.loads(j).get('data')
        if d:
            df.loc[df.shape[0]] = d

        if df.shape[0] >= n + m:
            break
dataset/ETHPy150Open sailthru/relay/bin/debugger.py/populate/original