#NEWLINE# @ apply_settings #NEWLINE# def parse( self , date_string , settings = None ) : #NEWLINE# #INDENT# date_string = six . text_type ( date_string ) #NEWLINE# if ( not date_string . strip ( ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Empty string' ) #NEWLINE# #UNINDENT# date_string = strip_braces ( date_string ) #NEWLINE# ( date_string , tz ) = pop_tz_offset_from_string ( date_string ) #NEWLINE# ( date_obj , period ) = dateutil_parse ( date_string , settings = settings ) #NEWLINE# if ( tz is not None ) : #NEWLINE# #INDENT# date_obj = tz . localize ( date_string ) #NEWLINE# #UNINDENT# if settings . TIMEZONE : #NEWLINE# #INDENT# date_obj = apply_timezone ( date_obj , settings . TIMEZONE ) #NEWLINE# #UNINDENT# if ( not settings . RETURN_AS_TIMEZONE_AWARE ) : #NEWLINE# #INDENT# date_obj = date_obj . replace ( tzinfo = None ) #NEWLINE# #UNINDENT# return ( date_obj , period )