#NEWLINE# def decode( self , bulk ) : #NEWLINE# #INDENT# match = self . DATE_PATTERN . search ( bulk ) #NEWLINE# if match : #NEWLINE# #INDENT# year = int ( match . group ( 'year' ) ) #NEWLINE# month = int ( match . group ( 'month' ) ) #NEWLINE# day = int ( match . group ( 'day' ) ) #NEWLINE# return datetime . date ( year , month , day ) #NEWLINE# #UNINDENT# fmt = bulk . DATE_FORMAT #NEWLINE# msg = 'expected a {0!r} format, not {1!r}' . format ( fmt , bulk ) #NEWLINE# raise ValueError ( msg )