<commit_before>import sys
import requests
import time
import pytz
import datetime
from tzlocal import get_localzone

from .source import Source

# Yahoo urls
YQL_URL = 'https://query.yahooapis.com/v1/public/yql'
YQL_QUERY = 'select * from yahoo.finance.quotes where symbol in ("%s")'

# API stability parameters
RETRIES = 10
RETRY_WAIT = 20 / 1000

# query keys
DATA_KEYS = ['Currency', 'LastTradeDate', 'LastTradeWithTime', 'Name',
             'PreviousClose', 'Symbol', 'StockExchange', 'Ask',
             'AverageDailyVolume', 'Bid', 'BookValue', 'Change',
             'DividendShare', 'EPSEstimateCurrentYear', 'EPSEstimateNextYear',
             'EPSEstimateNextQuarter', 'DaysLow', 'DaysHigh', 'YearLow',
             'YearHigh', 'MarketCapitalization', 'EBITDA',
             'LastTradePriceOnly', 'Name', 'Open', 'DividendYield',
             'YearRange', 'PriceSales', 'PriceBook', 'PercentChange',
             'PercentChangeFromYearLow', 'PercentChangeFromYearHigh']


class YahooRealTime(Source):

    def __init__(self, mongo):
        super().__init__('YahooRealTime', mongo)

    def _download_data(self, symbols, params):
        symbols = [s for s in symbols if self._is_trading(s)]

        # query parameters
        params = {
            'q': YQL_QUERY % ','.join(symbols),<commit_msg>fix: Empty fetch due to filtering<commit_after>import sys
import requests
import time
import pytz
import datetime
from tzlocal import get_localzone

from .source import Source

# Yahoo urls
YQL_URL = 'https://query.yahooapis.com/v1/public/yql'
YQL_QUERY = 'select * from yahoo.finance.quotes where symbol in ("%s")'

# API stability parameters
RETRIES = 10
RETRY_WAIT = 20 / 1000

# query keys
DATA_KEYS = ['Currency', 'LastTradeDate', 'LastTradeWithTime', 'Name',
             'PreviousClose', 'Symbol', 'StockExchange', 'Ask',
             'AverageDailyVolume', 'Bid', 'BookValue', 'Change',
             'DividendShare', 'EPSEstimateCurrentYear', 'EPSEstimateNextYear',
             'EPSEstimateNextQuarter', 'DaysLow', 'DaysHigh', 'YearLow',
             'YearHigh', 'MarketCapitalization', 'EBITDA',
             'LastTradePriceOnly', 'Name', 'Open', 'DividendYield',
             'YearRange', 'PriceSales', 'PriceBook', 'PercentChange',
             'PercentChangeFromYearLow', 'PercentChangeFromYearHigh']


class YahooRealTime(Source):

    def __init__(self, mongo):
        super().__init__('YahooRealTime', mongo)

    def _download_data(self, symbols, params):
        symbols = [s for s in symbols if self._is_trading(s)]
        if len(symbols) == 0:
            return []

        # query parameters
        params = {
            'q': YQL_QUERY % ','.join(symbols),
{'fraction_non_alphanumeric': 0.12936802973977696, 'fraction_numerical': 0.007063197026022305, 'mean_word_length': 3.3827361563517915, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2047488', 'n_tokens_mistral': 877, 'n_tokens_neox': 827, 'n_words': 204}