code: def rank_on_policy_and_eval(
      seq2slate_net,
      batch: rlt.PreprocessedRankingInput,
      tgt_seq_len: int,
      greedy: bool,
  ):
      model_propensity, model_action = rank_on_policy(
          seq2slate_net, batch, tgt_seq_len, greedy=greedy
      )
      ranked_cities = gather(batch.src_seq.float_features, model_action)
      reward = compute_reward(ranked_cities)
      return model_propensity, model_action, reward
  
imports: import logging
  import math
  import tempfile
  from itertools import permutations
  import pytorch_lightning
  import reagent.core.types
  import torch
  import torch.nn
  from reagent.core.parameters import Seq2SlateParameters
  from reagent.core.parameters_seq2slate import LearningMethod, SimulationParameters
  from reagent.core.torch_utils import gather
  from reagent.model_utils.seq2slate_utils import Seq2SlateOutputArch
  from reagent.models.seq2slate import Seq2SlateMode, Seq2SlateTransformerNet
  from reagent.optimizer.union import Optimizer__Union
  from reagent.training.ranking.seq2slate_sim_trainer import Seq2SlateSimulationTrainer
  from reagent.training.ranking.seq2slate_trainer import Seq2SlateTrainer
  from torch.utils.data import DataLoader
label_desc: Use image node_id 9 for calling a global function with example usage: rank_on_policy_and_eval(seq2slate_net, batch, tgt_seq_len, greedy) and returns: model_propensity,  model_action,  reward