<s> from stdnet import odm <EOL> from stdnet . utils import encoders , todatetime , todate , missing_intervals <EOL> from stdnet . apps . columnts import ColumnTSField <EOL> class TimeSeries ( odm . StdModel ) : <EOL> ticker = odm . SymbolField ( unique = True ) <EOL> data = odm . TimeSeriesField ( ) <EOL> def todate ( self , v ) : <EOL> return todatetime ( v ) <EOL> def dates ( self ) : <EOL> return self . data <EOL> def items ( self ) : <EOL> return self . data . items ( ) <EOL> def __get_start ( self ) : <EOL> r = self . data . front ( ) <EOL> if r : <EOL> return r [ <NUM_LIT:0> ] <EOL> data_start = property ( __get_start ) <EOL> def __get_end ( self ) : <EOL> r = self . data . back ( ) <EOL> if r : <EOL> return r [ <NUM_LIT:0> ] <EOL> data_end = property ( __get_end ) <EOL> def size ( self ) : <EOL> '''<STR_LIT>''' <EOL> return self . data . size ( ) <EOL> def intervals ( self , startdate , enddate , parseinterval = None ) : <EOL> '''<STR_LIT>''' <EOL> return missing_intervals ( startdate , enddate , self . data_start , <EOL> self . data_end , dateconverter = self . todate , <EOL> parseinterval = parseinterval ) <EOL> class DateTimeSeries ( TimeSeries ) : <EOL> data = odm . TimeSeriesField ( pickler = encoders . DateConverter ( ) ) <EOL> def todate ( self , v ) : <EOL> return todate ( v ) <EOL> class BigTimeSeries ( DateTimeSeries ) : <EOL> data = odm . TimeSeriesField ( pickler = encoders . DateConverter ( ) , <EOL> value_pickler = encoders . PythonPickle ( ) ) <EOL> class ColumnTimeSeries ( odm . StdModel ) : <EOL> ticker = odm . SymbolField ( unique = True ) <EOL> data = ColumnTSField ( ) </s>
