code: def do_rollouts(self, params, timestep_limit=None):
      # Set the network weights.
      self.policy.set_flat_weights(params)
  
      noise_indices, returns, sign_returns, lengths = [], [], [], []
      eval_returns, eval_lengths = [], []
  
      # Perform some rollouts with noise.
      while len(noise_indices) == 0:
          if np.random.uniform() < self.config.eval_prob:
              # Do an evaluation run with no perturbation.
              self.policy.set_flat_weights(params)
              rewards, length = self.rollout(
                  timestep_limit, add_noise=False
              )
              eval_returns.append(rewards.sum())
              eval_lengths.append(length)
          else:
              # Do a regular run with parameter perturbations.
              noise_index = self.noise.sample_index(
                  self.policy.num_params
              )
  
              perturbation = self.config.noise_stdev * self.noise.get(
                  noise_index, self.policy.num_params
              )
  
              # These two sampling steps could be done in parallel on
              # different actors letting us update twice as frequently.
              self.policy.set_flat_weights(params + perturbation)
              rewards_pos, lengths_pos = self.rollout(timestep_limit)
  
              self.policy.set_flat_weights(params - perturbation)
              rewards_neg, lengths_neg = self.rollout(timestep_limit)
  
              noise_indices.append(noise_index)
              returns.append([rewards_pos.sum(), rewards_neg.sum()])
              sign_returns.append(
                  [
                      np.sign(rewards_pos).sum(),
                      np.sign(rewards_neg).sum(),
                  ]
              )
              lengths.append([lengths_pos, lengths_neg])
  
      return Result(
          noise_indices=noise_indices,
          noisy_returns=returns,
          sign_noisy_returns=sign_returns,
          noisy_lengths=lengths,
          eval_returns=eval_returns,
          eval_lengths=eval_lengths,
      )
  
imports: import logging
  import random
  import time
  from collections import namedtuple
  from typing import Optional
  import numpy
  from rllib_ars.ars.ars_tf_policy import ARSTFPolicy
  import ray
  from ray.rllib.algorithms import Algorithm
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig, NotProvided
  from ray.rllib.algorithms.es import optimizers, utils
  from ray.rllib.algorithms.es.es_tf_policy import rollout
  from ray.rllib.env.env_context import EnvContext
  from ray.rllib.evaluation.worker_set import WorkerSet
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID
  from ray.rllib.utils import FilterManager
  from ray.rllib.utils.actor_manager import FaultAwareApply
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.metrics import NUM_AGENT_STEPS_SAMPLED, NUM_AGENT_STEPS_TRAINED, NUM_ENV_STEPS_SAMPLED, NUM_ENV_STEPS_TRAINED
  from ray.rllib.utils.torch_utils import set_torch_seed
label_desc: Use image node_id 6 for calling the Worker obj's underlying member method code with example usage: obj.do_rollouts(params, timestep_limit) and returns: Result