code: def test_rollout(env, policy):
      worker = VecWorker(
          seed=SEED,
          max_episode_length=MAX_EPISODE_LENGTH,
          worker_number=0,
          n_envs=N_EPS,
      )
      worker.update_agent(policy)
      worker.update_env(env)
      eps = worker.rollout()
      assert len(eps.lengths) == N_EPS
      eps2 = worker.rollout()
      assert len(eps2.lengths) == N_EPS
      assert str(eps) == str(eps2)
      assert eps.actions.var() > 0
      worker.shutdown()
  
file_path: garage/tests/garage/sampler/test_vec_worker.py
imports: import pprint
  import pytest
  from garage.envs import GridWorldEnv
  from garage.experiment.task_sampler import EnvPoolSampler
  from garage.np.policies import ScriptedPolicy
  from garage.sampler import LocalSampler, VecWorker, WorkerFactory
label_desc: Use image node_id 6 for calling a global function with example usage: test_rollout(env, policy) without return types