code: def usable_cpu_count():
      
      try:
          result = len(os.sched_getaffinity(0))
      except AttributeError:
          try:
              result = len(psutil.Process().cpu_affinity())
          except AttributeError:
              result = os.cpu_count()
      return result
docs: Get number of CPUs usable by the current process.
  
      Takes into consideration cpusets restrictions.
  
      Returns
      -------
      int