def valid_date(date):
 if (not hasattr(date, 'tzinfo')):
  return False
 if ((date.tzinfo is None) or (_total_seconds(date.utcoffset()) < 1.1)):
  return True
 return False

def valid_date ( date ) : if ( not hasattr ( date , 'tzinfo' ) ) : return False if ( ( date . tzinfo is None ) or ( _total_seconds ( date . utcoffset ( ) ) < 1.1 ) ) : return True return False
validate an expires datetime object .