code: def to_image_idx(
      base_shape: Tuple[int, ...], idxy: Node, valid: Node
  ) -> Tuple[Tuple[Node, Node], Node]:
      idx, idy = (idxy // 4) % base_shape[1], (
          idxy // (4 * base_shape[1])
      )
      # TODO: bring back the valid removal logic (correct!)
      if DEBUG >= 5:
          print(
              "to_image_idx",
              base_shape,
              idx.min,
              idx.max,
              idy.min,
              idy.max,
              idx,
              idy,
              valid,
          )
      return (idx, idy), valid
  
imports: from typing import Tuple
  from tinygrad.helpers import prod, IMAGE, getenv, DEBUG
  from tinygrad.dtype import dtypes
  from tinygrad.shape.symbolic import Node
label_desc: Use image node_id 3 for calling a global function with example usage: to_image_idx(base_shape, idxy, valid) and returns: idx,  idy,  valid