def read_stdin(self, coro=None):
        coro.set_daemon()
        thread_pool = asyncoro.AsyncThreadPool(1)
        while True:
            sys.stdout.write('\nEnter "quit" or "exit" to terminate dispynode,\n'
                             '  "stop" to stop service, "start" to restart service,\n'
                             '  "cpus" to change CPUs used, anything else to get status: ')
            sys.stdout.flush()
            try:
                cmd = yield thread_pool.async_task(raw_input)
            except:
                continue

            cmd = cmd.strip().lower()
            if cmd in ('quit', 'exit'):
                break
            elif cmd in ('stop', 'start', 'cpus'):
                if cmd == 'stop':
                    cpus = 0
                elif cmd == 'start':
                    cpus = self.num_cpus
                elif cmd == 'cpus':
                    cpus = multiprocessing.cpu_count()
                    sys.stdout.write('Enter number of CPUs to use in range -%s to %s: ' %
                                     (cpus - 1, cpus))
                    sys.stdout.flush()
                    try:
                        cpus = yield thread_pool.async_task(raw_input)
                        cpus = int(cpus)
                        if cpus >= 0:
                            assert cpus <= multiprocessing.cpu_count()
                        else:
                            cpus += multiprocessing.cpu_count()
                            assert cpus >= 0
                    except:
                        print('  Invalid cpus ignored')
                        continue
                    self.num_cpus = cpus

                self.avail_cpus = cpus - len(self.job_infos)

                if self.scheduler['ip_addr']:
                    sock = AsyncSocket(socket.socket(socket.AF_INET, socket.SOCK_STREAM),
                                       keyfile=self.keyfile, certfile=self.certfile)
                    sock.settimeout(MsgTimeout)
                    try:
                        yield sock.connect((self.scheduler['ip_addr'], self.scheduler['port']))
                        info = {'ip_addr': self.ext_ip_addr, 'sign': self.sign, 'cpus': cpus}
                        yield sock.send_msg('NODE_CPUS:'.encode() + serialize(info))
                    except:
                        pass
                    finally:
                        sock.close()
                else:
                    if 0 > self.num_cpus:
                        Coro(self.broadcast_ping_msg)
            else:
                print('\n  Serving %d CPUs%s%s%s' %
                      (self.avail_cpus + len(self.job_infos),
                       ' from %s' % self.serivce_start if self.service_start else '',
                       ' to %s' % self.service_end if self.service_end else '',
                       ' for %d clients' % self.serve if self.serve > 0 else ''))
                print('  Completed:\n    %d Computations, %d jobs, %.3f sec CPU time' %
                      (self.num_computations, self.num_jobs, self.cpu_time))
                print('  Running:')
                for i, compute in enumerate(self.computations.itervalues(), start=1):
                    print('    Client %s: %s @ %s running %s jobs' %
                          (i, compute.name, compute.scheduler_ip_addr, compute.pending_jobs))
                print('')
        self.shutdown(quit=True)
dataset/ETHPy150Open pgiri/dispy/py2/dispy/dispynode.py/_DispyNode.read_stdin/swapped operands of `>`