<s> '''<STR_LIT>''' <EOL> import cPickle <EOL> import sys <EOL> from pandas import DataMatrix <EOL> import datetime as dt <EOL> import random <EOL> import qstkutil . DataAccess as da <EOL> import qstkutil . qsdateutil as du <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> print "<STR_LIT>" + sys . argv [ <NUM_LIT:1> ] + "<STR_LIT>" + sys . argv [ <NUM_LIT:2> ] <EOL> symbols = list ( [ '<STR_LIT>' ] ) <EOL> t = map ( int , sys . argv [ <NUM_LIT:1> ] . split ( '<STR_LIT:->' ) ) <EOL> startday = dt . datetime ( t [ <NUM_LIT:2> ] , t [ <NUM_LIT:0> ] , t [ <NUM_LIT:1> ] ) <EOL> t = map ( int , sys . argv [ <NUM_LIT:2> ] . split ( '<STR_LIT:->' ) ) <EOL> endday = dt . datetime ( t [ <NUM_LIT:2> ] , t [ <NUM_LIT:0> ] , t [ <NUM_LIT:1> ] ) <EOL> timeofday = dt . timedelta ( hours = <NUM_LIT:16> ) <EOL> timestamps = du . getNYSEdays ( startday , endday , timeofday ) <EOL> dataobj = da . DataAccess ( '<STR_LIT>' ) <EOL> historic = dataobj . get_data ( timestamps , symbols , "<STR_LIT>" ) <EOL> alloc_val = random . random ( ) <EOL> alloc = DataMatrix ( index = [ historic . index [ <NUM_LIT:0> ] ] , data = [ alloc_val ] , columns = symbols ) <EOL> for date in range ( <NUM_LIT:1> , len ( historic . index ) ) : <EOL> alloc_val = <NUM_LIT:1> <EOL> alloc = alloc . append ( DataMatrix ( index = [ historic . index [ date ] ] , data = [ alloc_val ] , columns = [ symbols [ <NUM_LIT:0> ] ] ) ) <EOL> alloc [ '<STR_LIT>' ] = <NUM_LIT:1> - alloc [ symbols [ <NUM_LIT:0> ] ] <EOL> output = open ( sys . argv [ <NUM_LIT:3> ] , "<STR_LIT:wb>" ) <EOL> cPickle . dump ( alloc , output ) </s>
