code: def to_list(X: OptionalList[T]) -> list[T]:
      """Wraps tensor `X` into a list, if it isn't a list of Tensors yet."""
      if isinstance(X, list):
          return X
      return [X]
  
imports: from __future__ import annotations
  from typing import TypeVar
  import numpy
  import tensorflow
  import tensorflow.keras.backend
  from innvestigate.backend.types import Layer, OptionalList, ShapeTuple, Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: to_list(X) and returns: list, X