code: def build_experiment_config() -> experiments.ExperimentConfig:
      """Returns a configuration for PWIL experiments."""
  
      # Create an environment, grab the spec, and use it to create networks.
      env_name = FLAGS.env_name
  
      def environment_factory(seed: int) -> dm_env.Environment:
          del seed
          return helpers.make_environment(task=env_name)
  
      dummy_seed = 1
      environment = environment_factory(dummy_seed)
      environment_spec = specs.make_environment_spec(environment)
  
      # Create d4pg agent
      d4pg_config = d4pg.D4PGConfig(
          learning_rate=5e-5, sigma=0.2, samples_per_insert=256
      )
      d4pg_builder = d4pg.D4PGBuilder(config=d4pg_config)
  
      # Create demonstrations function.
      dataset_name = helpers.get_dataset_name(FLAGS.env_name)
      num_demonstrations = FLAGS.num_demonstrations
  
      def make_demonstrations():
          transitions_iterator = tfds.get_tfds_dataset(
              dataset_name,
              num_demonstrations,
              env_spec=environment_spec,
          )
          return pwil.PWILDemonstrations(
              demonstrations=transitions_iterator, episode_length=1000
          )
  
      # Construct PWIL agent
      pwil_config = pwil.PWILConfig(num_transitions_rb=0)
      pwil_builder = pwil.PWILBuilder(
          rl_agent=d4pg_builder,
          config=pwil_config,
          demonstrations_fn=make_demonstrations,
      )
  
      return experiments.ExperimentConfig(
          builder=pwil_builder,
          environment_factory=environment_factory,
          network_factory=make_networks,
          seed=FLAGS.seed,
          max_num_actor_steps=FLAGS.num_steps,
      )
  
file_path: acme/examples/baselines/imitation/run_pwil.py
imports: from typing import Sequence
  from absl import flags
  from acme import specs
  from acme.agents.jax import d4pg
  from acme.agents.jax import pwil
  from acme.datasets import tfds
  import helpers
  from absl import app
  from acme.jax import experiments
  from acme.jax import networks
  from acme.jax import utils
  from acme.utils import lp_utils
  import dm_env
  import haiku
  import jax.numpy
  import launchpad
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: build_experiment_config() and returns: experiments, helpers, pwil