code: def calculate_rr_weights(config: AlgorithmConfig) -> List[float]:
      """Calculate the round robin weights for the rollout and train steps"""
      if not config["training_intensity"]:
          return [1, 1]
  
      # Calculate the "native ratio" as:
      # [train-batch-size] / [size of env-rolled-out sampled data]
      # This is to set freshly rollout-collected data in relation to
      # the data we pull from the replay buffer (which also contains old
      # samples).
      native_ratio = config["train_batch_size"] / (
          config.get_rollout_fragment_length()
          * config["num_envs_per_worker"]
          # Add one to workers because the local
          # worker usually collects experiences as well, and we avoid division by zero.
          * max(config["num_workers"] + 1, 1)
      )
  
      # Training intensity is specified in terms of
      # (steps_replayed / steps_sampled), so adjust for the native ratio.
      sample_and_train_weight = (
          config["training_intensity"] / native_ratio
      )
      if sample_and_train_weight < 1:
          return [int(np.round(1 / sample_and_train_weight)), 1]
      else:
          return [1, int(np.round(sample_and_train_weight))]
  
imports: import logging
  from typing import List, Optional, Type, Callable
  import numpy
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig, NotProvided
  from ray.rllib.algorithms.dqn.dqn_tf_policy import DQNTFPolicy
  from ray.rllib.algorithms.dqn.dqn_torch_policy import DQNTorchPolicy
  from ray.rllib.algorithms.simple_q.simple_q import SimpleQ, SimpleQConfig
  from ray.rllib.execution.rollout_ops import synchronous_parallel_sample
  from ray.rllib.policy.sample_batch import MultiAgentBatch
  from ray.rllib.execution.train_ops import train_one_step, multi_gpu_train_one_step
  from ray.rllib.policy.policy import Policy
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.replay_buffers.utils import update_priorities_in_replay_buffer
  from ray.rllib.utils.typing import ResultDict
  from ray.rllib.utils.metrics import LAST_TARGET_UPDATE_TS, NUM_AGENT_STEPS_SAMPLED, NUM_ENV_STEPS_SAMPLED, NUM_TARGET_UPDATES, SAMPLE_TIMER, SYNCH_WORKER_WEIGHTS_TIMER
  from ray.rllib.utils.deprecation import DEPRECATED_VALUE
  from ray.rllib.utils.replay_buffers.utils import sample_min_n_steps_from_buffer
label_desc: Use image node_id 1 for calling a global function with example usage: calculate_rr_weights(config) and returns: list, list, list