code: def with_getitem(idx: int, layer: Model) -> Model[InT, OutT]:
      """Transform data on the way into and out of a layer, by plucking an item
      from a tuple.
      """
      return Model(
          f"with_getitem({layer.name})",
          forward,
          init=init,
          layers=[layer],
          attrs={"idx": idx},
      )
  
imports: from typing import Any, Callable, Optional, Tuple
  from ..config import registry
  from ..model import Model
label_desc: Use image node_id 1 for calling a global function with example usage: with_getitem(idx, layer) and returns: Model