<commit_before>'''Module containing a handful of methods for
aggregating data from markets throughout the world'''

import requests
import json

def fetchData(apikey, url):
    '''Returns JSON data of the Dow Jones Average.'''
    parameters = {'rows' : 1, 'auth_token' : apikey}
    req = requests.get(url, params=parameters)
    data = json.loads(req.content)
    parsedData = []
    stockData = {}
    for datum in data:
        stockData['name'] = data['name']
        stockData['description'] = data['description']
        stockData['data'] = data['data']
        stockData['code'] = data['code']
    parsedData.append(stockData)
    return parsedData   

def dowjonesIndustrialAvg(apikey):
    '''Returns JSON data of the Dow Jones Average.'''
    parameters = {'rows' : 1, 'auth_token' : apikey}
    apiurl = 'https://www.quandl.com/api/v1/datasets/BCB/UDJIAD1.json?'
    req = requests.get(apiurl, params=parameters)
    data = json.loads(req.content)
    parsedData = []
    stockData = {}
    for datum in data:
        stockData['name'] = data['name']
        stockData['description'] = data['description']
        stockData['data'] = data['data']
        stockData['code'] = data['code']
    parsedData.append(stockData)
    return parsedData

def snp500IndexPull(apikey):
    '''Returns JSON data of the S&P 500 Index.'''
    parameters = {'rows' : 1, 'auth_token' : apikey}
    apiurl = 'https://www.quandl.com/api/v1/datasets/YAHOO/INDEX_GSPC.json?'
    req = requests.get(apiurl, params=parameters)
    data = json.loads(req.content)
    parsedData = []
    stockData = {}
    for datum in data: 
        stockData['name'] = data['name']
        stockData['description'] = data['description']
        stockData['data'] = data['data']
        stockData['code'] = data['code']
    parsedData.append(stockData)
    return parsedData

def nasdaqPull(apikey):
    '''Returns JSON data of the Nasdaq Index.'''
    parameters = {'rows' : 1, 'auth_token' : apikey}
    apiurl = 'https://www.quandl.com/api/v1/datasets/NASDAQOMX/COMP.json?'
    req = requests.get(apiurl, params=parameters)
    data = json.loads(req.content)
    parsedData = []
    stockData = {}
    for datum in data: 
        stockData['name'] = data['name']
        stockData['description'] = data['description']
        stockData['data'] = data['data']
        stockData['code'] = data['code']
    parsedData.append(stockData)
    return parsedData<commit_msg>Removing redundant methods<commit_after>'''Module containing a handful of methods for
aggregating data from markets throughout the world'''

import requests
import json

def fetchData(apikey, url):
    '''Returns JSON data of the Dow Jones Average.'''
    parameters = {'rows' : 1, 'auth_token' : apikey}
    req = requests.get(url, params=parameters)
    data = json.loads(req.content)
    parsedData = []
    stockData = {}
    for datum in data:
        stockData['name'] = data['name']
        stockData['description'] = data['description']
        stockData['data'] = data['data']
        stockData['code'] = data['code']
    parsedData.append(stockData)
    return parsedData
{'fraction_non_alphanumeric': 0.14450496635693688, 'fraction_numerical': 0.004806151874399231, 'mean_word_length': 3.3603351955307263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1681692', 'n_tokens_mistral': 967, 'n_tokens_neox': 960, 'n_words': 229}