def get_max_age(response):
 if (not response.has_header('Cache-Control')):
  return
 cc = dict([_to_tuple(el) for el in cc_delim_re.split(response['Cache-Control'])])
 if ('max-age' in cc):
  try:
   return int(cc['max-age'])
  except (ValueError, TypeError):
   pass

def get_max_age ( response ) : if ( not response . has_header ( 'Cache-Control' ) ) : return cc = dict ( [ _to_tuple ( el ) for el in cc_delim_re . split ( response [ 'Cache-Control' ] ) ] ) if ( 'max-age' in cc ) : try : return int ( cc [ 'max-age' ] ) except ( ValueError , TypeError ) : pass
returns the max-age from the response cache-control header as an integer (or none if it wasnt found or wasnt an integer .