<commit_before>from __future__ import absolute_import
from __future__ import print_function

import sys
import glob

import numpy as np
#import matplotlib.pyplot as plt

import pandas as pd
pd.set_option('display.width',    1000)
pd.set_option('display.max_rows', 1000)

from signals import *

def __main__():
    """ 
    Trading Simulator from curriculumvite trading competition
    see also the arvix Paper from <NAME> http://arxiv.org/pdf/1508.00317v1
    Modified by <EMAIL>
    
    produces data to train a neural net
    """
    # Trades smaller than this will be omitted


    path = "./training_data_large/"
    file_list = sorted(glob.glob('./training_data_large/prod_data_*v.txt'))

    if len(file_list) == 0:
        print ("No ./training_data_large/product_data_*txt  files exist in the directory. Please copy them in the ./training_data_largetest/ . Aborting.")
        sys.exit()
        
    try:
        write_spans = True if sys.argv[1] == "--spans" else False
    except IndexError:
        write_spans = False
        
    try:
        chained_deals = True if sys.argv[0] == "--chained-deals" else False
    except IndexError:
        chained_deals = False    
    
    min_trade_amount = None
    comission = 0.0

    for j in range(len(file_list)):
        filename = file_list[j]
        print('Training: ',filename)

        day_file = filename
        
        generate_signals_for_file(day_file, comission, write_spans, chained_deals)


__main__();
<commit_msg>With 0 index will be out of range. Changed to 1  i.e sys.argv[1]  , we only use 1 option on the command line<commit_after>from __future__ import absolute_import
from __future__ import print_function

import sys
import glob

import numpy as np
#import matplotlib.pyplot as plt

import pandas as pd
pd.set_option('display.width',    1000)
pd.set_option('display.max_rows', 1000)

from signals import *

def __main__():
    """ 
    Trading Simulator from curriculumvite trading competition
    see also the arvix Paper from <NAME> http://arxiv.org/pdf/1508.00317v1
    Modified by <EMAIL>
    
    produces data to train a neural net
    """
    # Trades smaller than this will be omitted


    path = "./training_data_large/"
    file_list = sorted(glob.glob('./training_data_large/prod_data_*v.txt'))

    if len(file_list) == 0:
        print ("No ./training_data_large/product_data_*txt  files exist in the directory. Please copy them in the ./training_data_largetest/ . Aborting.")
        sys.exit()
        
    try:
        write_spans = True if sys.argv[1] == "--spans" else False
    except IndexError:
        write_spans = False
        
    try:
        #chained_deals = True if sys.argv[0] == "--chained-deals" else False
        chained_deals = True if sys.argv[1] == "--chained-deals" else False
    except IndexError:
        chained_deals = False    
    
    min_trade_amount = None
    comission = 0.0

    for j in range(len(file_list)):
        filename = file_list[j]
        print('Training: ',filename)

        day_file = filename
        
        generate_signals_for_file(day_file, comission, write_spans, chained_deals)


__main__();

{'fraction_non_alphanumeric': 0.09142857142857143, 'fraction_numerical': 0.01619047619047619, 'mean_word_length': 2.7918170878459687, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3512395', 'n_tokens_mistral': 1034, 'n_tokens_neox': 976, 'n_words': 288}