code: def get_cgroup_cpuset():
      cpu_set = []
      # first try if /sys/fs/cgroup/cpuset/cpuset.cpus exists
      if os.path.exists("/sys/fs/cgroup/cpuset/cpuset.cpus"):
          with open("/sys/fs/cgroup/cpuset/cpuset.cpus", "r") as f:
              cpu_cores_str = f.readline().strip()
              cpu_ranges = cpu_cores_str.split(",")
              for cpu_range in cpu_ranges:
                  if "-" in cpu_range:
                      start, end = map(int, cpu_range.split("-"))
                      cpu_set.extend(range(start, end + 1))
                  else:
                      cpu_set.append(int(cpu_range))
      else:
          # if not, we use cpuinfo
          cpu_set = list(range(cpuinfo.get_cpu_info()["count"]))
      return cpu_set
  
file_path: BigDL/python/nano/src/bigdl/nano/utils/common/schedule.py
imports: import subprocess
  import re
  import os
  from typing import Optional
  import platform
  import cpuinfo
  from bigdl.nano.utils.common import invalidInputError
label_desc: Use image node_id 1 for calling a global function with example usage: get_cgroup_cpuset() and returns: cpu_set