def check_rollout(edits_service, package_name, days):
edit = edits_service.insert(body={}, packageName=package_name).execute()<EOL>response = edits_service.tracks().get(editId=edit['<STR_LIT:id>'], track='<STR_LIT>', packageName=package_name).execute()<EOL>releases = response['<STR_LIT>']<EOL>for release in releases:<EOL><INDENT>if release['<STR_LIT:status>'] == '<STR_LIT>':<EOL><INDENT>url = '<STR_LIT>'.format(release['<STR_LIT:name>'])<EOL>resp = requests.head(url)<EOL>if resp.status_code != <NUM_LIT:200>:<EOL><INDENT>if resp.status_code != <NUM_LIT>:  <EOL><INDENT>logger.warning("<STR_LIT>", url, resp.status_code)<EOL><DEDENT>continue<EOL><DEDENT>age = time.time() - calendar.timegm(eu.parsedate(resp.headers['<STR_LIT>']))<EOL>if age >= days * DAY:<EOL><INDENT>yield release, age<EOL><DEDENT><DEDENT><DEDENT>
Check if package_name has a release on staged rollout for too long