code: def test_detect_docker_cpus():
      # No limits set
      with tempfile.NamedTemporaryFile(
          "w"
      ) as quota_file, tempfile.NamedTemporaryFile(
          "w"
      ) as period_file, tempfile.NamedTemporaryFile(
          "w"
      ) as cpuset_file:
          quota_file.write("-1")
          period_file.write("100000")
          cpuset_file.write("0-63")
          quota_file.flush()
          period_file.flush()
          cpuset_file.flush()
          assert (
              ray._private.utils._get_docker_cpus(
                  cpu_quota_file_name=quota_file.name,
                  cpu_period_file_name=period_file.name,
                  cpuset_file_name=cpuset_file.name,
              )
              == 64
          )
  
      # No cpuset used
      with tempfile.NamedTemporaryFile(
          "w"
      ) as quota_file, tempfile.NamedTemporaryFile(
          "w"
      ) as period_file, tempfile.NamedTemporaryFile(
          "w"
      ) as cpuset_file:
          quota_file.write("-1")
          period_file.write("100000")
          cpuset_file.write("0-10,20,50-63")
          quota_file.flush()
          period_file.flush()
          cpuset_file.flush()
          assert (
              ray._private.utils._get_docker_cpus(
                  cpu_quota_file_name=quota_file.name,
                  cpu_period_file_name=period_file.name,
                  cpuset_file_name=cpuset_file.name,
              )
              == 26
          )
  
      # Quota set
      with tempfile.NamedTemporaryFile(
          "w"
      ) as quota_file, tempfile.NamedTemporaryFile(
          "w"
      ) as period_file, tempfile.NamedTemporaryFile(
          "w"
      ) as cpuset_file:
          quota_file.write("42")
          period_file.write("100")
          cpuset_file.write("0-63")
          quota_file.flush()
          period_file.flush()
          cpuset_file.flush()
          assert (
              ray._private.utils._get_docker_cpus(
                  cpu_quota_file_name=quota_file.name,
                  cpu_period_file_name=period_file.name,
                  cpuset_file_name=cpuset_file.name,
              )
              == 0.42
          )
  
      # cgroups v2, cpu_quota set
      with tempfile.NamedTemporaryFile("w") as cpu_max_file:
          cpu_max_file.write("200000 100000")
          cpu_max_file.flush()
          assert (
              ray._private.utils._get_docker_cpus(
                  cpu_quota_file_name="nope",
                  cpu_period_file_name="give_up",
                  cpuset_file_name="lose_hope",
                  cpu_max_file_name=cpu_max_file.name,
              )
              == 2.0
          )
  
      # cgroups v2, cpu_quota unset
      with tempfile.NamedTemporaryFile("w") as cpu_max_file:
          cpu_max_file.write("max 100000")
          cpu_max_file.flush()
          assert (
              ray._private.utils._get_docker_cpus(
                  cpu_quota_file_name="nope",
                  cpu_period_file_name="give_up",
                  cpuset_file_name="lose_hope",
                  cpu_max_file_name=cpu_max_file.name,
              )
              is None
          )
  
imports: import glob
  import logging
  import multiprocessing
  import os
  import sys
  import tempfile
  import time
  from unittest import mock
  import numpy
  import psutil
  import pytest
  import ray
  import ray._private.gcs_utils
  import ray._private.ray_constants
  import ray._private.utils
  import ray.cluster_utils
  import ray.util.accelerators
  from ray._private.test_utils import wait_for_condition
  from ray.dashboard import k8s_utils
  from ray.runtime_env import RuntimeEnv
label_desc: Use image node_id 10 for calling a global function with example usage: test_detect_docker_cpus() without return types