code: def evaluate_gym(
      env_name: str,
      model: ModelManager__Union,
      publisher: ModelPublisher__Union,
      num_eval_episodes: int,
      passing_score_bar: float,
      module_name: str = "default_model",
      max_steps: Optional[int] = None,
  ):
      env = Gym(env_name=env_name)
      initialize_seed(1, env)
      agent = make_agent_from_model(env, model, publisher, module_name)
  
      rewards = evaluate_for_n_episodes(
          n=num_eval_episodes, env=env, agent=agent, max_steps=max_steps
      )
      avg_reward = np.mean(rewards)
      logger.info(
          f"Average reward over {num_eval_episodes} is {avg_reward}.\n"
          f"List of rewards: {rewards}\n"
          f"Passing score bar: {passing_score_bar}"
      )
      assert (
          avg_reward >= passing_score_bar
      ), f"{avg_reward} fails to pass the bar of {passing_score_bar}!"
      return
  
imports: import json
  import logging
  from typing import Optional
  import gym
  import numpy
  import pandas
  import pytorch_lightning
  import torch
  from reagent.data.spark_utils import call_spark_class, get_spark_session
  from reagent.gym.agents.agent import Agent
  from reagent.gym.envs import Gym
  from reagent.gym.policies.predictor_policies import create_predictor_policy_from_model
  from reagent.gym.policies.random_policies import make_random_policy_for_env
  from reagent.gym.runners.gymrunner import evaluate_for_n_episodes
  from reagent.gym.utils import fill_replay_buffer
  from reagent.model_managers.union import ModelManager__Union
  from reagent.publishers.union import FileSystemPublisher, ModelPublisher__Union
  from reagent.replay_memory.circular_replay_buffer import ReplayBuffer
  from reagent.replay_memory.utils import replay_buffer_to_pre_timeline_df
  from .types import TableSpec
label_desc: Use image node_id 7 for calling a global function with example usage: evaluate_gym(env_name, model, publisher, num_eval_episodes, passing_score_bar, module_name, max_steps) without return types