def _format_issue(issue):
 ret = {'id': issue.get('id'), 'issue_number': issue.get('number'), 'state': issue.get('state'), 'title': issue.get('title'), 'user': issue.get('user').get('login'), 'html_url': issue.get('html_url')}
 assignee = issue.get('assignee')
 if assignee:
  assignee = assignee.get('login')
 labels = issue.get('labels')
 label_names = []
 for label in labels:
  label_names.append(label.get('name'))
 milestone = issue.get('milestone')
 if milestone:
  milestone = milestone.get('title')
 ret['assignee'] = assignee
 ret['labels'] = label_names
 ret['milestone'] = milestone
 return ret

def _format_issue ( issue ) : ret = { 'id' : issue . get ( 'id' ) , 'issue_number' : issue . get ( 'number' ) , 'state' : issue . get ( 'state' ) , 'title' : issue . get ( 'title' ) , 'user' : issue . get ( 'user' ) . get ( 'login' ) , 'html_url' : issue . get ( 'html_url' ) } assignee = issue . get ( 'assignee' ) if assignee : assignee = assignee . get ( 'login' ) labels = issue . get ( 'labels' ) label_names = [ ] for label in labels : label_names . append ( label . get ( 'name' ) ) milestone = issue . get ( 'milestone' ) if milestone : milestone = milestone . get ( 'title' ) ret [ 'assignee' ] = assignee ret [ 'labels' ] = label_names ret [ 'milestone' ] = milestone return ret
helper function to format api return information into a more manageable and useful dictionary for issue information .