def valid_max_age(number):
 if isinstance(number, basestring):
  try:
   number = long(number)
  except (ValueError, TypeError):
   return False
 if ((number >= 0) and ((number % 1) == 0)):
  return True
 return False

def valid_max_age ( number ) : if isinstance ( number , basestring ) : try : number = long ( number ) except ( ValueError , TypeError ) : return False if ( ( number >= 0 ) and ( ( number % 1 ) == 0 ) ) : return True return False
validate a cookie max-age .