def close_issue(issue, github_auth):
 closed_issue = issue.copy()
 closed_issue['state'] = 'closed'
 r = requests.post(('https://api.github.com/repos/Khan/khan-exercises/issues/%s' % issue['number']), data=json.dumps(closed_issue), auth=github_auth)
 try:
  r.raise_for_status()
  time.sleep(1)
  return True
 except requests.HTTPError:
  return False

def close_issue ( issue , github_auth ) : closed_issue = issue . copy ( ) closed_issue [ 'state' ] = 'closed' r = requests . post ( ( 'https://api.github.com/repos/Khan/khan-exercises/issues/%s' % issue [ 'number' ] ) , data = json . dumps ( closed_issue ) , auth = github_auth ) try : r . raise_for_status ( ) time . sleep ( 1 ) return True except requests . HTTPError : return False
attempt to close an issue and return whether it succeeded .