code: def getattr_torchscriptable(
      dictionary: Dict[str, Tensor],
      key: str,
      default: Optional[Tensor] = None,
  ) -> Optional[Tensor]:
      if key in dictionary:
          return dictionary[key]
      else:
          return default
  
label_desc: Use image node_id 1 for calling a global function with example usage: getattr_torchscriptable(dictionary, key, default) and returns: dictionary, default