code: def test_should_scale_up_ready_to_total_ratio(self):
      # Test that scale-up is blocked if under the ready workers to total workers
      # ratio.
      config = AutoscalingConfig(
          min_workers=1, max_workers=4, ready_to_total_workers_ratio=0.5
      )
      policy = AutoscalingPolicy(config)
  
      num_total_workers = 2
      num_running_workers = 1
      # Shouldn't scale up due to being under ready workers to total workers ratio.
      assert not policy.should_scale_up(
          num_total_workers, num_running_workers
      )
  
      num_total_workers = 3
      num_running_workers = 2
      # Shouldn scale up due to being over ready workers to total workers ratio.
      assert policy.should_scale_up(
          num_total_workers, num_running_workers
      )
  
imports: import collections
  import time
  import pytest
  import ray
  from ray.data._internal.compute import ActorPoolStrategy
  from ray.data._internal.execution.operators.actor_pool_map_operator import AutoscalingConfig, AutoscalingPolicy, _ActorPool
  from ray.data._internal.execution.util import make_ref_bundles
  from ray.tests.conftest import *
label_desc: Use image node_id 5 for calling the TestAutoscalingPolicy obj's underlying member method code with example usage: obj.test_should_scale_up_ready_to_total_ratio() without return types