code: def _index_from_letter(letter: str) -> int:
      if letter == "X":
          return 0
      if letter == "Y":
          return 1
      if letter == "Z":
          return 2
      raise ValueError("letter must be either X, Y or Z.")
  
imports: from typing import Optional
  import torch
  import torch.nn.functional
  from ..common.datatypes import Device
label_desc: Use image node_id 8 for calling a global function with example usage: _index_from_letter(letter) and returns: int, int, int