code: def select_action(policy, observation):
      state = torch.from_numpy(observation).float().unsqueeze(0)
      probs = policy(state)
      m = Categorical(probs)
      action = m.sample()
      policy.saved_log_probs.append(m.log_prob(action))
      return action.item()
  
file_path: ignite/examples/reinforcement_learning/reinforce.py
imports: import argparse
  from collections import deque
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  from torch.distributions import Categorical
  from ignite.engine import Engine, Events
label_desc: Use image node_id 1 for calling a global function with example usage: select_action(policy, observation) and returns: action