def GetStatus(self):
    "Apply a rough heuristic to give a simple summary of an issue's review\n    or CQ status, assuming adherence to a common workflow.\n\n    Returns None if no issue for this branch, or one of the following keywords:\n      * 'error'    - error from review tool (including deleted issues)\n      * 'unsent'   - no reviewers added\n      * 'waiting'  - waiting for review\n      * 'reply'    - waiting for owner to reply to review\n      * 'not lgtm' - Code-Review -2 from at least one approved reviewer\n      * 'lgtm'     - Code-Review +2 from at least one approved reviewer\n      * 'commit'   - in the commit queue\n      * 'closed'   - abandoned\n    "
    if (not self.GetIssue()):
        return None
    try:
        data = self._GetChangeDetail(['DETAILED_LABELS', 'CURRENT_REVISION'])
    except httplib.HTTPException:
        return 'error'
    if (data['status'] in ('ABANDONED', 'MERGED')):
        return 'closed'
    cq_label = data['labels'].get('Commit-Queue', {})
    if cq_label:
        vote_value = cq_label.get('value', '0')
        vote_text = cq_label.get('values', {}).get(vote_value, '')
        if (vote_text.lower() == 'commit'):
            return 'commit'
    lgtm_label = data['labels'].get('Code-Review', {})
    if lgtm_label:
        if ('rejected' in lgtm_label):
            return 'not lgtm'
        if ('approved' in lgtm_label):
            return 'lgtm'
    if (not data.get('reviewers', {}).get('REVIEWER', [])):
        return 'unsent'
    messages = data.get('messages', [])
    if messages:
        owner = data['owner'].get('_account_id')
        last_message_author = messages[(- 1)].get('author', {}).get('_account_id')
        if (owner != last_message_author):
            return 'reply'
    return 'waiting'
Apply a rough heuristic to give a simple summary of an issue's review
or CQ status, assuming adherence to a common workflow.

Returns None if no issue for this branch, or one of the following keywords:
  * 'error'    - error from review tool (including deleted issues)
  * 'unsent'   - no reviewers added
  * 'waiting'  - waiting for review
  * 'reply'    - waiting for owner to reply to review
  * 'not lgtm' - Code-Review -2 from at least one approved reviewer
  * 'lgtm'     - Code-Review +2 from at least one approved reviewer
  * 'commit'   - in the commit queue
  * 'closed'   - abandoned
def GetStatus(self):
    "Apply a rough heuristic to give a simple summary of an issue's review\n    or CQ status, assuming adherence to a common workflow.\n\n    Returns None if no issue for this branch, or one of the following keywords:\n      * 'error'    - error from review tool (including deleted issues)\n      * 'unsent'   - no reviewers added\n      * 'waiting'  - waiting for review\n      * 'reply'    - waiting for owner to reply to review\n      * 'not lgtm' - Code-Review -2 from at least one approved reviewer\n      * 'lgtm'     - Code-Review +2 from at least one approved reviewer\n      * 'commit'   - in the commit queue\n      * 'closed'   - abandoned\n    "
    if (not self.GetIssue()):
        return None
    try:
        data = self._GetChangeDetail(['DETAILED_LABELS', 'CURRENT_REVISION'])
    except httplib.HTTPException:
        return 'error'
    if (data['status'] in ('ABANDONED', 'MERGED')):
        return 'closed'
    cq_label = data['labels'].get('Commit-Queue', {})
    if cq_label:
        vote_value = cq_label.get('value', '0')
        vote_text = cq_label.get('values', {}).get(vote_value, )
        if (vote_text.lower() == 'commit'):
            return 'commit'
    lgtm_label = data['labels'].get('Code-Review', {})
    if lgtm_label:
        if ('rejected' in lgtm_label):
            return 'not lgtm'
        if ('approved' in lgtm_label):
            return 'lgtm'
    if (not data.get('reviewers', {}).get('REVIEWER', [])):
        return 'unsent'
    messages = data.get('messages', [])
    if messages:
        owner = data['owner'].get('_account_id')
        last_message_author = messages[(- 1)].get('author', {}).get('_account_id')
        if (owner != last_message_author):
            return 'reply'
    return 'waiting'