code: def set_item_pg(pg, k, v):
      if "__" not in k:
          pg[k] = v
      else:
          name, idx = k.split("__")
          pg[name] = tuple(
              v if i == int(idx) else pg[name][i]
              for i in range_of(pg[name])
          )
      return pg
  
imports: from __future__ import annotations
  from .torch_basics import *
label_desc: Use image node_id 26 for calling a global function with example usage: set_item_pg(pg, k, v) and returns: pg