<s> """<STR_LIT>""" <EOL> from datetime import datetime <EOL> from wtforms . fields import DateField <EOL> class BirthdayField ( DateField ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , label = None , validators = None , format = '<STR_LIT>' , <EOL> ** kwargs ) : <EOL> DateField . __init__ ( self , label , validators , format , ** kwargs ) <EOL> def process_formdata ( self , valuelist ) : <EOL> if valuelist : <EOL> date_str = '<STR_LIT:U+0020>' . join ( valuelist ) <EOL> try : <EOL> self . data = datetime . strptime ( date_str , self . format ) . date ( ) <EOL> except ValueError : <EOL> self . data = None <EOL> if valuelist != [ "<STR_LIT:None>" , "<STR_LIT:None>" , "<STR_LIT:None>" ] : <EOL> raise ValueError ( "<STR_LIT>" ) </s>
