def extract_data(paths):
    """
        Extracts data from all the files, and returns a generator object
        extract_data to iterably return data for each environment. 
        Number of iterations should equal number of environments in graph_data.

        Parameters:
            paths - Contains the paths to each data file. Check function description of 
                    get_file_locations() to see how paths is structured. 

        Return: 
            A generator object extract_data, or iterable, which will return the data for
			each environment on each iteration of the generator.

		Note:
			If you're unfamiliar with Python generators, check this out:
				https://wiki.python.org/moin/Generators
			If you're unfamiliar with Python "yield", check this out:
				https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do
    """
    for env in paths:
        # Extract out seeds tested
        seeds_txt = paths[env]['seeds']
        seeds = []
        with open(seeds_txt, 'r') as f:
            for l in f:
                seeds.append(int(l))

        # Prepare the data dict to return
        data = {
            'env': '',
            'seeds': [],
            'ppo_for_beginners': {
                'x_mean': [],
                'x_low': [],
                'x_high': [],
                'y_mean': [],
                'y_low': [],
                'y_high': []
            },
            'stable_baselines': {
                'x_mean': [],
                'x_low': [],
                'x_high': [],
                'y_mean': [],
                'y_low': [],
                'y_high': []
            }
        }

        # Extract out ppo_beginner datapoints
        pfb_x_s, pfb_y_s = [], []
        for filename in paths[env]['ppo_for_beginners']:
            curr_data = extract_ppo_for_beginners_data(env, filename)
            pfb_x_s.append(curr_data[0])
            pfb_y_s.append(curr_data[1])

        # Extract out stable_baselines datapoints
        sb_x_s, sb_y_s = [], []
        for filename in paths[env]['stable_baselines']:
            curr_data = extract_stable_baselines_data(env, filename)
            sb_x_s.append(curr_data[0])
            sb_y_s.append(curr_data[1])

        # Preprocess ppo_beginner and stable_baselines data
        pfb_x_s, pfb_y_s = clip_data(pfb_x_s, pfb_y_s)
        sb_x_s, sb_y_s = clip_data(sb_x_s, sb_y_s)

        # Process ppo_beginner datapoints for mean, lower, and upper bounds
        pfb_x_mean, pfb_y_mean = calculate_means(pfb_x_s, pfb_y_s)
        pfb_x_low, pfb_y_low = calculate_lower_bounds(pfb_x_s, pfb_y_s)
        pfb_x_high, pfb_y_high = calculate_upper_bounds(pfb_x_s, pfb_y_s)

        # Process stable_baselines datapoints for mean, lower, and upper bounds
        sb_x_mean, sb_y_mean = calculate_means(sb_x_s, sb_y_s)
        sb_x_low, sb_y_low = calculate_lower_bounds(sb_x_s, sb_y_s)
        sb_x_high, sb_y_high = calculate_upper_bounds(sb_x_s, sb_y_s)

        # Intermediary variables to help us more easily save our data
        pfbs = [pfb_x_mean, pfb_x_low, pfb_x_high, pfb_y_mean, pfb_y_low, pfb_y_high]
        sbs = [sb_x_mean, sb_x_low, sb_x_high, sb_y_mean, sb_y_low, sb_y_high]

        # Fill up data packet
        data['env'] = env
        data['seeds'] = seeds
        for i, data_type in enumerate(['x_mean', 'x_low', 'x_high', 'y_mean', 'y_low', 'y_high']):
            data['ppo_for_beginners'][data_type] = pfbs[i]
            data['stable_baselines'][data_type] = sbs[i]

        # Return current data packet
        yield data
Extracts data from all the files, and returns a generator object
extract_data to iterably return data for each environment.
Number of iterations should equal number of environments in graph_data.

Parameters:
paths - Contains the paths to each data file. Check function description of
get_file_locations() to see how paths is structured.

Return:
A generator object extract_data, or iterable, which will return the data for
each environment on each iteration of the generator.

Note:
If you're unfamiliar with Python generators, check this out:
https://wiki.python.org/moin/Generators
If you're unfamiliar with Python "yield", check this out:
https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do
graph_code/make_graph.py