def _get_completed_cleaning_command(self, task, commands):
        if not commands:
            return

        last_command = commands[-1]

        if last_command['command_name'] != 'execute_clean_step':
            # catches race condition where execute_clean_step is still
            # processing so the command hasn't started yet
            LOG.debug('Expected agent last command to be "execute_clean_step" '
                      'for node %(node)s, instead got "%(command)s". Waiting '
                      'for next heartbeat.',
                      {'node': task.node.uuid,
                       'command': last_command['command_name']})
            return

        last_result = last_command.get('command_result') or {}
        last_step = last_result.get('clean_step')
        if last_command['command_status'] == 'RUNNING':
            LOG.debug('Clean step still running for node %(node)s: %(step)s',
                      {'step': last_step, 'node': task.node.uuid})
            return
        elif (last_command['command_status'] == 'SUCCEEDED' and
              last_step != task.node.clean_step):
            # A previous clean_step was running, the new command has not yet
            # started.
            LOG.debug('Clean step not yet started for node %(node)s: %(step)s',
                      {'step': last_step, 'node': task.node.uuid})
            return
        else:
            return last_command
Given a start and stop index, return a list of all tokens in
dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/agent_base_vendor.py/BaseAgentVendor._get_completed_cleaning_command--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/antlr3/antlr3/streams.py/CommonTokenStream.getTokens