code: def get_ref(self, reftype, index):
          
          try:
              got_reftype, data = self.refs[int(index)]
          except (IndexError, ValueError):
              raise CoconutInternalException("no reference at invalid index", index)
          internal_assert(got_reftype == reftype, "wanted " + reftype + " reference; got " + got_reftype + " reference")
          return data
docs: Retrieve a reference.