code: def get_num_processes():
      
      cpu_count = multiprocessing.cpu_count()
  
      if config.NUMBER_OF_CORES == 0:
          raise ValueError(
              'Invalid NUMBER_OF_CORES; value may not be 0.')
  
      if config.NUMBER_OF_CORES > cpu_count:
          log.info('Requesting %s cores; only %s available',
                   config.NUMBER_OF_CORES, cpu_count)
          return cpu_count
  
      if config.NUMBER_OF_CORES < 0:
          num = cpu_count + config.NUMBER_OF_CORES + 1
          if num <= 0:
              raise ValueError(
                  'Invalid NUMBER_OF_CORES; negative value is too negative: '
                  'requesting {} cores, {} available.'.format(num, cpu_count))
  
          return num
  
      return config.NUMBER_OF_CORES
docs: Return the number of processes to use in parallel.