code: def read_action(opt: str, val: str) -> Optional[signal.Signals]:
      if val.lower() == "wait":
          return None
      out = {s.name.lower(): s for s in signal.Signals}.get(val.lower())
      if out is None:
          raise ValueError(
              f"{opt} argument '{val}' is not valid; it should be a signal name ('SIGTERM', "
              "'SIGKILL', etc) or 'WAIT'"
          )
      return out
  
imports: import argparse
  import signal
  import sys
  from typing import Optional
  from determined import ipc
label_desc: Use image node_id 1 for calling a global function with example usage: read_action(opt, val) and returns: out, None