def SetCQState(self, new_state):
    props = self.GetIssueProperties()
    if props.get('private'):
        DieWithError('Cannot set-commit on private issue')
    if (new_state == _CQState.COMMIT):
        self.SetFlag('commit', '1')
    elif (new_state == _CQState.NONE):
        self.SetFlag('commit', '0')
    else:
        raise NotImplementedError()
def SetCQState(self, new_state):
    props = self.GetIssueProperties()
    if props.get('private'):
        DieWithError('Cannot set-commit on private issue')
    if (new_state == _CQState.COMMIT):
        self.SetFlag('commit', '1')
    elif (new_state == _CQState.NONE):
        self.SetFlag('commit', '0')
    else:
        raise NotImplementedError()