#NEWLINE# def is_day_hour( date ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# date_format = '%Y-%m-%d/%H' #NEWLINE# is_valid = ( datetime . datetime . strptime ( date , date_format ) . strftime ( date_format ) == date ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# is_valid = False #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# is_valid = False #NEWLINE# #UNINDENT# return date