code: def num_cpu_cores(*, logical: bool = True) -> int:
      """Determine the number of cores available in the cpu.
  
      Parameters
      ----------
      logical
          Whether request is for number of physical or logical cores available in CPU
  
      Returns
      -------
      ret
          Number of cores available in CPU
  
      Examples
      --------
      >>> print(ivy.num_cpu_cores(logical=False))
      2
      """
      if logical:
          return psutil.cpu_count(logical=logical)
      else:
          return psutil.cpu_count(logical=False)
  
imports: import os
  import gc
  import abc
  import math
  import psutil
  import warnings
  import types
  from typing import Type, Optional, Tuple
  from typing import Union, Callable, Iterable, Any
  import ivy
  from ivy.func_wrapper import handle_out_argument, to_native_arrays_and_back, inputs_to_native_arrays, handle_nestable, handle_array_like_without_promotion, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 18 for calling a global function with example usage: num_cpu_cores() and returns: psutil, psutil