<commit_before>package com.surmize.stockpricecrawler;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;

public class StockPriceService {

    static final Logger logger = Logger.getLogger(StockPriceService.class.getName());
    private final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("M/d/yyyy h:mma z", Locale.ENGLISH);
    
    public List<StockPrice> getStockPriceData(List<String> symbols){
        List<StockPrice> prices = new ArrayList<>();
        for(int i=0; i<symbols.size(); i=i+100){
            int endIndex = Math.min(symbols.size(), i+100);
            callStockPriceAPI(prices, symbols.subList(i, endIndex));
        }
        return prices;
    }
    
    private void callStockPriceAPI(List<StockPrice> prices, List<String> symbols){
        BufferedReader in = null;
        try {
            URL priceUrl = new URL(buildUrlString(symbols));
            in = new BufferedReader( new InputStreamReader(priceUrl.openStream()));
            String inputLine;
            while ((inputLine = in.readLine()) != null) {
                String[] stockArray = inputLine.split(",");
                System.out.println("WORKING ON SYMBOL "+stockArray[0]);
                StockPrice sp = new StockPrice();
                sp.stockSymbol =  removeQuotes(stockArray[0]);
                sp.tradeTime = getDateFromDatePlusTime(stockArray[1], stockArray[2]);
                sp.price = getFloat(stockArray[3]);
                sp.peRatio = getFloat(stockArray[4]);
                sp.pegRatio = getFloat(stockArray[5]);
                sp.dayLow = getFloat(stockArray[6]);
                sp.dayHigh = getFloat(stockArray[7]);
                prices.add(sp);
            }
            in.close();
        } catch (IOException ex) {
            logger.log(Level.SEVERE, null, ex);
        } finally {
            try {
                in.close();<commit_msg>Simple clean up<commit_after>package com.surmize.stockpricecrawler;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;

public class StockPriceService {

    static final Logger logger = Logger.getLogger(StockPriceService.class.getName());
    private final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("M/d/yyyy h:mma z", Locale.ENGLISH);
    
    public List<StockPrice> getStockPriceData(List<String> symbols){
        List<StockPrice> prices = new ArrayList<>();
        for(int i=0; i<symbols.size(); i=i+100){
            int endIndex = Math.min(symbols.size(), i+100);
            callStockPriceAPI(prices, symbols.subList(i, endIndex));
        }
        return prices;
    }
    
    private void callStockPriceAPI(List<StockPrice> prices, List<String> symbols){
        BufferedReader in = null;
        try {
            URL priceUrl = new URL(buildUrlString(symbols));
            in = new BufferedReader( new InputStreamReader(priceUrl.openStream()));
            String inputLine;
            while ((inputLine = in.readLine()) != null) {
                String[] stockArray = inputLine.split(",");
                StockPrice sp = new StockPrice();
                sp.stockSymbol =  removeQuotes(stockArray[0]);
                sp.tradeTime = getDateFromDatePlusTime(stockArray[1], stockArray[2]);
                sp.price = getFloat(stockArray[3]);
                sp.peRatio = getFloat(stockArray[4]);
                sp.pegRatio = getFloat(stockArray[5]);
                sp.dayLow = getFloat(stockArray[6]);
                sp.dayHigh = getFloat(stockArray[7]);
                prices.add(sp);
            }
            in.close();
        } catch (IOException ex) {
            logger.log(Level.SEVERE, null, ex);
        } finally {
            try {
                in.close();
{'fraction_non_alphanumeric': 0.11630079402148528, 'fraction_numerical': 0.007239607659971976, 'mean_word_length': 2.5135356849876946, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1792695', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1193, 'n_words': 249}