def get_expires( headers ):
    if "Cache-Control" in headers:
        s_maxage = find_s_max_age.match( headers["Cache-Control"] )
        max_age = find_n_max_age.match( headers["Cache-Control"] )
        if s_maxage:
            return datetime.datetime.now() + datetime.timedelta(int(s_maxage.group(1)))
        elif max_age:
            return datetime.datetime.now() + datetime.timedelta(seconds=int(max_age.group(1)))
    
    if "Expires" in headers:
        h_expires = datetime.datetime.strptime( headers["Expires"], "%a, %d %b %Y %H:%M:%S GMT"  )
        h_date    = datetime.datetime.strptime( headers["Date"], "%a, %d %b %Y %H:%M:%S GMT"  )
        delta     = datetime.timedelta = h_expires - h_date
        return datetime.datetime.now() + delta
    
    return datetime.datetime.now() + datetime.timedelta( days=7 )
dataset/ETHPy150Open symkat/SymPullCDN/hutils.py/get_expires/original