def check_date(option, opt, value):
 try:
  return DateTime.strptime(value, '%Y/%m/%d')
 except DateTime.Error:
  raise OptionValueError(('expected format of %s is yyyy/mm/dd' % opt))

def check_date ( option , opt , value ) : try : return DateTime . strptime ( value , '%Y/%m/%d' ) except DateTime . Error : raise OptionValueError ( ( 'expected format of %s is yyyy/mm/dd' % opt ) )
check a file value return the filepath .