'Remove a list of nodes from this cluster'

def remove_nodes(self, nodes=None, num_nodes=None, terminate=True, force=False):

    if ((nodes is None) and (num_nodes is None)):
        raise exception.BaseException('please    specify    either    nodes    or    num_nodes    kwargs')
    if (not nodes):
        worker_nodes = self.nodes[1:]
        nodes = worker_nodes[(- num_nodes):]
        nodes.reverse()
        if (len(nodes) != num_nodes):
            raise exception.BaseException(('cant    remove    %d    nodes    -    only    %d    nodes    exist' % (num_nodes, len(worker_nodes))))
    else:
        for node in nodes:
            if node.is_master():
                raise exception.InvalidOperation('cannot    remove    master    node')
    for node in nodes:
        try:
            self.run_plugins(method_name='on_remove_node', node=node, reverse=True)
        except:
            if (not force):
                raise
        if (not terminate):
            continue
        node.terminate()
