code: def test_init_without_worker_factory(ray_local_session_fixture):
      del ray_local_session_fixture
      assert ray.is_initialized()
      max_episode_length = 16
      env = PointEnv()
      policy = FixedPolicy(
          env.spec,
          scripted_actions=[
              env.action_space.sample()
              for _ in range(max_episode_length)
          ],
      )
      sampler = RaySampler(
          agents=policy,
          envs=env,
          seed=100,
          max_episode_length=max_episode_length,
      )
      worker_factory = WorkerFactory(
          seed=100, max_episode_length=max_episode_length
      )
      assert sampler._worker_factory._seed == worker_factory._seed
      assert (
          sampler._worker_factory._max_episode_length
          == worker_factory._max_episode_length
      )
      with pytest.raises(
          TypeError, match="Must construct a sampler from"
      ):
          RaySampler(agents=policy, envs=env)
  
file_path: garage/tests/garage/sampler/test_ray_batched_sampler.py
imports: from unittest.mock import Mock
  import numpy
  import pytest
  import ray
  from garage.envs import PointEnv
  from garage.envs.grid_world_env import GridWorldEnv
  from garage.experiment.task_sampler import SetTaskSampler
  from garage.np.policies import FixedPolicy, ScriptedPolicy
  from garage.sampler import LocalSampler, RaySampler, WorkerFactory
  from tests.fixtures.sampler import ray_local_session_fixture
label_desc: Use image node_id 5 for calling a global function with example usage: test_init_without_worker_factory(ray_local_session_fixture) without return types