code: def enforce_not_None(e: Optional[T]) -> T:
      """Enforce non-nullness of input. Used for typechecking and runtime safety."""
      if e is None:
          raise Exception("Input is None.")
      return e
  
file_path: ptgnn/ptgnn/baseneuralmodel/utils/data.py
imports: import random
  from typing import Callable, Iterable, Iterator, List, Optional, TypeVar
label_desc: Use image node_id 1 for calling a global function with example usage: enforce_not_None(e) and returns: e