code: def build_actor(root_dir, env, agent, rb_observer, train_step):
      """Builds the Actor."""
      tf_collect_policy = agent.collect_policy
      collect_policy = py_tf_eager_policy.PyTFEagerPolicy(
          tf_collect_policy, use_tf_function=True
      )
      temp_dir = root_dir + "actor"
      test_actor = actor.Actor(
          env,
          collect_policy,
          train_step,
          steps_per_run=1,
          metrics=actor.collect_metrics(10),
          summary_dir=temp_dir,
          observers=[rb_observer],
      )
  
      return test_actor
  
imports: import functools
  from absl import logging
  import numpy
  import reverb
  import tensorflow
  from tf_agents.agents.dqn import dqn_agent
  from tf_agents.agents.ppo import ppo_clip_agent
  from tf_agents.environments import suite_gym
  from tf_agents.experimental.distributed import reverb_variable_container
  from tf_agents.networks import actor_distribution_network
  from tf_agents.networks import sequential
  from tf_agents.networks import value_network
  from tf_agents.policies import py_tf_eager_policy
  from tf_agents.replay_buffers import reverb_replay_buffer
  from tf_agents.specs import tensor_spec
  from tf_agents.train import actor
  from tf_agents.train.utils import replay_buffer_utils
  from tf_agents.train.utils import spec_utils
  from tf_agents.train.utils import train_utils
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
label_desc: Use image node_id 6 for calling a global function with example usage: build_actor(root_dir, env, agent, rb_observer, train_step) and returns: test_actor