code: def expert_source(env, goal, max_episode_length, n_eps):
      expert = OptimalPolicy(env.spec, goal=goal)
      workers = WorkerFactory(
          seed=100, max_episode_length=max_episode_length
      )
      expert_sampler = LocalSampler.from_worker_factory(
          workers, expert, env
      )
      for _ in range(n_eps):
          eps_batch = expert_sampler.obtain_samples(
              0, max_episode_length, None
          )
          yield eps_batch
  
file_path: garage/tests/garage/torch/algos/test_bc.py
imports: import numpy
  import ray
  from garage.envs import PointEnv
  from garage.experiment import deterministic
  from garage.sampler import LocalSampler, WorkerFactory
  from garage.torch.algos import BC
  from garage.torch.policies import DeterministicMLPPolicy, GaussianMLPPolicy, Policy
  from garage.trainer import Trainer
  from tests.fixtures import snapshot_config
  from tests.fixtures.sampler import ray_local_session_fixture
label_desc: Use image node_id 4 for calling a global function with example usage: expert_source(env, goal, max_episode_length, n_eps) without return types