code: def num_cpus():
      """Return the effective number of CPUs in the system as an integer.
  
      This cross-platform function makes an attempt at finding the total number of
      available CPUs in the system, as returned by various underlying system and
      python calls.
  
      If it can't find a sensible answer, it returns 1 (though an error *may* make
      it return a large positive number that's actually incorrect).
      """
  
      # Many thanks to the Parallel Python project (http://www.parallelpython.com)
      # for the names of the keys we needed to look up for this function.  This
      # code was inspired by their equivalent function.
  
      ncpufuncs = {
          "Linux": _num_cpus_unix,
          "Darwin": _num_cpus_darwin,
          "Windows": _num_cpus_windows,
      }
  
      ncpufunc = ncpufuncs.get(
          platform.system(),
          # default to unix version (Solaris, AIX, etc)
          _num_cpus_unix,
      )
  
      try:
          ncpus = max(1, int(ncpufunc()))
      except:
          ncpus = 1
      return ncpus
  
file_path: catboost/contrib/python/ipython/py2/IPython/utils/sysinfo.py
imports: import os
  import platform
  import pprint
  import sys
  import subprocess
  from IPython.core import release
  from IPython.utils import py3compat, _sysinfo, encoding
label_desc: Use image node_id 8 for calling a global function with example usage: num_cpus() and returns: ncpus