class_docstr: Parallel Python SMP execution server class
      
class_docstr_tok: ["Parallel","Python","SMP","execution","server","class"]
docstr: Sets the number of local worker processes (ppworkers)
  
  ncpus - the number of worker processes, if parammeter is omitted
          it will be set to the number of processors in the system
docstr_tok: ["Sets","the","number","of","local","worker","processes","(","ppworkers",")","ncpus","-","the","number","of","worker","processes",",","if","parammeter","is","omitted","it","will","be","set","to","the","number","of","processors","in","the","system"]
code: def set_ncpus(self, ncpus="autodetect"):
      """Sets the number of local worker processes (ppworkers)
  
      ncpus - the number of worker processes, if parammeter is omitted
              it will be set to the number of processors in the system
      """
      if ncpus == "autodetect":
          ncpus = self.__detect_ncpus()
      if not isinstance(ncpus, int):
          raise TypeError("ncpus must have 'int' type")
      if ncpus < 0:
          raise ValueError("ncpus must be an integer > 0")
      if ncpus > len(self.__workers):
          self.__workers.extend(
              [
                  _Worker(self.__restart_on_free, self.__pickle_proto)
                  for x in range(ncpus - len(self.__workers))
              ]
          )
      self.__stats["local"].ncpus = ncpus
      self.__ncpus = ncpus
  
imports: import os
  import threading
  import logging
  import inspect
  import sys
  import types
  import time
  import atexit
  from .None import transport
  from .None import auto
  from .None import common
  import subprocess
label_desc: Use image node_id 5 for calling the Server obj's underlying member method code with example usage: obj.set_ncpus(ncpus) without return types