code: def igetattr(obj, attr, *args):
      """
      Indexed getattr function
  
      Examples:
          >>> model = Model()
          >>> igetattr(model, "weight[2]")
      """
      if "[" in attr and "]" in attr:
          attr = "".join("\t".join(attr.split("[")).split("]")).split(
              "\t"
          )
          indexes = "[".join(attr[1:-1]).replace("[", "][")
          indexes = (
              "[" + indexes + "]" if len(indexes) >= 1 else indexes
          )
          return igetattr(obj, attr[0] + indexes)[int(attr[-1])]
      else:
          return getattr(obj, attr, *args)
  
label_desc: Use image node_id 1 for calling a global function with example usage: igetattr(obj, attr) and returns: igetattr, getattr