<commit_before># -*- coding: utf-8 -*-
"""Retrieve candle data."""
import argparse
import json
from oandapyV20 import API
from oandapyV20.exceptions import V20Error
import oandapyV20.endpoints.instruments as instruments
from exampleauth import exampleAuth


# constants
granularities = instruments.definitions["CandlestickGranularity"].keys()
granularities = sorted(granularities)

# create the top-level parser
parser = argparse.ArgumentParser(prog='candle-data')
parser.add_argument('--nice', action='store_true', help='json indented')
parser.add_argument('--count', default=0, type=int, help='num recs, if not specified 500')
parser.add_argument('--granularity', choices=granularities, required=True)
parser.add_argument('--start', type=str, help="date-time YYYY-MM-DDTHH:MM:SS")
parser.add_argument('--end', type=str, help="date-time YYYY-MM-DDTHH:MM:SS")
parser.add_argument('--instruments', type=str, nargs='?',
                    action='append', help='instruments')


class Main(object):
    def __init__(self, api, accountID, clargs):
        self._accountID = accountID
        self.clargs = clargs<commit_msg>FIX for new definitions<commit_after># -*- coding: utf-8 -*-
"""Retrieve candle data."""
import argparse
import json
from oandapyV20 import API
from oandapyV20.exceptions import V20Error
import oandapyV20.endpoints.instruments as instruments
from exampleauth import exampleAuth


granularities = ["M1", "M5", "M15", "H1", "H4", "D"]
# create the top-level parser
parser = argparse.ArgumentParser(prog='candle-data')
parser.add_argument('--nice', action='store_true', help='json indented')
parser.add_argument('--count', default=0, type=int, help='num recs, if not specified 500')
parser.add_argument('--granularity', choices=granularities, required=True)
parser.add_argument('--start', type=str, help="date-time YYYY-MM-DDTHH:MM:SS")
parser.add_argument('--end', type=str, help="date-time YYYY-MM-DDTHH:MM:SS")
parser.add_argument('--instruments', type=str, nargs='?',
                    action='append', help='instruments')


class Main(object):
    def __init__(self, api, accountID, clargs):
        self._accountID = accountID
        self.clargs = clargs
{'fraction_non_alphanumeric': 0.14809720311783586, 'fraction_numerical': 0.014672168729940394, 'mean_word_length': 5.39882697947214, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4590063', 'n_tokens_mistral': 724, 'n_tokens_neox': 696, 'n_words': 158}