def extract_ppo_for_beginners_data(env, filename):
    """
        Extract the total timesteps and average episodic return from the logging
        data specified to PPO for Beginners.

        Parameters:
            env - The environment we're currently graphing.
            filename - The file containing data. Should be "seed_xxx.txt" such that the
                        xxx are integers

        Return:
            x - the total timesteps at each iteration
            y - average episodic return at each iteration
    """
    # x is timesteps so far, y is average episodic reward
    x, y = [], []

    # extract out x's and y's
    with open(filename, 'r') as f:
        for l in f:
            l = [e.strip() for e in l.split(':')]
            if 'Average Episodic Return' in l:
                y.append(float(l[1]))
            if 'Timesteps So Far' in l:
                x.append(int(l[1]))

    return x, y
Extract the total timesteps and average episodic return from the logging
data specified to PPO for Beginners.

Parameters:
env - The environment we're currently graphing.
filename - The file containing data. Should be "seed_xxx.txt" such that the
xxx are integers

Return:
x - the total timesteps at each iteration
y - average episodic return at each iteration
graph_code/make_graph.py