code: def test_metaworld_sample_and_step():
      # Import, construct environments here to avoid using up too much
      # resources if this test isn't run.
      # pylint: disable=import-outside-toplevel
      import metaworld
  
      ml1 = metaworld.ML1("push-v1")
      tasks = task_sampler.MetaWorldTaskSampler(ml1, "train")
      updates = tasks.sample(100)
      assert len(updates) == 100
      env = updates[0]()
      action = env.action_space.sample()
      env.reset()
      env.step(action)
      env.step(action)
      env.close()
      updates = tasks.sample(100, with_replacement=True)
      assert len(updates) == 100
  
file_path: garage/tests/garage/experiment/test_task_sampler.py
imports: import functools
  import unittest.mock
  import numpy
  import pytest
  from garage.experiment import task_sampler
  from garage.envs.mujoco.half_cheetah_vel_env import HalfCheetahVelEnv
label_desc: Use image node_id 5 for calling a global function with example usage: test_metaworld_sample_and_step() without return types