code: def _get_cpu_cores():
      import multiprocessing
  
      if RAY_ON_SPARK_WORKER_CPU_CORES in os.environ:
          # In some cases, spark standalone cluster might configure virtual cpu cores
          # for spark worker that different with number of physical cpu cores,
          # but we cannot easily get the virtual cpu cores configured for spark
          # worker, as a workaround, we provide an environmental variable config
          # `RAY_ON_SPARK_WORKER_CPU_CORES` for user.
          return int(os.environ[RAY_ON_SPARK_WORKER_CPU_CORES])
  
      return multiprocessing.cpu_count()
  
imports: import subprocess
  import os
  import sys
  import random
  import threading
  import collections
  import logging
  import time
label_desc: Use image node_id 15 for calling a global function with example usage: _get_cpu_cores() and returns: multiprocessing, int