sandbox/utils.py
def container_cpu_count() -> int:
    """Return the number of cpu that a container can use."""
    cpu_count = settings.DOCKER_PARAMETERS["cpuset_cpus"]
    
    if "-" in cpu_count:
        lower, upper = cpu_count.split("-")
        cpu_count = int(upper) - int(lower) + 1
    else:
        cpu_count = len(cpu_count.split(","))
    
    return cpu_count
Return the number of cpu that a container can use.
Return the number of cpu that a container can use.
Return the number of cpu that a container can use .
def container_cpu_count() -> int:
    cpu_count = settings.DOCKER_PARAMETERS["cpuset_cpus"]
    if "-" in cpu_count:
        lower, upper = cpu_count.split("-")
        cpu_count = int(upper) - int(lower) + 1
    else:
        cpu_count = len(cpu_count.split(","))
    return cpu_count
def container_cpu_count ( ) -> int : cpu_count = settings . DOCKER_PARAMETERS [ "cpuset_cpus" ] if "-" in cpu_count : lower , upper = cpu_count . split ( "-" ) cpu_count = int ( upper ) - int ( lower ) + 1 else : cpu_count = len ( cpu_count . split ( "," ) ) return cpu_count
Return the number of cpu that a container can use.
Return the number of cpu that a container can use .
"""Return the number of cpu that a container can use."""