<commit_before># -*- coding: utf-8 -*-

'''Data downloader for Yahoo Finance API 2017'''

import requests
import re
from datetime import datetime
import pandas as pd
import io


class Downloader:
    def __init__(self):
        self.DATA_TYPES = ['history', 'div', 'split']
        self._cookie = None
        self._crumb = None
        self.attempt_counter = 0
        self.years = 20
        self.ticker = None

    def set_ticker(self, ticker):
        '''Set the ticker for the downloader instance.'''

        self.ticker = ticker or self.ticker
        if self.ticker is None:
            raise Exception('You should specify a ticker in set_ticker()')
        return self

    def set_years(self, years):
        '''Set the year range for the downloader instance.'''

        if years is None:
            raise Exception('You should specify the number of years in set_years()')
        else:
            self.years = years
        return self<commit_msg>Add settings method to check current parameters<commit_after># -*- coding: utf-8 -*-

'''Data downloader for Yahoo Finance API 2017'''

import requests
import re
from datetime import datetime
import pandas as pd
import io


class Downloader:
    def __init__(self):
        self.DATA_TYPES = ['history', 'div', 'split']
        self._cookie = None
        self._crumb = None
        self.attempt_counter = 0
        self.years = 20
        self.ticker = None

    def set_ticker(self, ticker):
        '''Set the ticker for the downloader instance.'''

        self.ticker = ticker or self.ticker
        if self.ticker is None:
            raise Exception('You should specify a ticker in set_ticker()')
        return self

    def set_years(self, years):
        '''Set the year range for the downloader instance.'''

        if years is None:
            raise Exception('You should specify the number of years in set_years()')
        else:
            self.years = years
        return self

    def settings(self):
        '''Return the currently set ticker and year range in a tuple'''

        return (self.ticker, self.years)
{'fraction_non_alphanumeric': 0.08973747016706445, 'fraction_numerical': 0.0076372315035799524, 'mean_word_length': 2.3007874015748033, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3176385', 'n_tokens_mistral': 598, 'n_tokens_neox': 558, 'n_words': 221}