code: def _cpu_usage():
      """Compute total cpu usage of the container in nanoseconds
      by reading from cpuacct in cgroups v1 or cpu.stat in cgroups v2.
      """
      try:
          # cgroups v1
          return int(open(CPU_USAGE_PATH).read())
      except FileNotFoundError:
          # cgroups v2
          cpu_stat_text = open(CPU_USAGE_PATH_V2).read()
          # e.g. "usage_usec 16089294616"
          cpu_stat_first_line = cpu_stat_text.split("\n")[0]
          # get the second word of the first line, cast as an integer
          # this is the CPU usage is microseconds
          cpu_usec = int(cpu_stat_first_line.split()[1])
          # Convert to nanoseconds and return.
          return cpu_usec * 1000
  
imports: import logging
  from ray._private.utils import get_num_cpus
label_desc: Use image node_id 2 for calling a global function with example usage: _cpu_usage() and returns: int, unknown