code: def add_ref(self, reftype, data):
          
          ref = (reftype, data)
          try:
              index = self.refs.index(ref)
          except ValueError:
              self.refs.append(ref)
              index = len(self.refs) - 1
          return str(index)
docs: Add a reference and returns the identifier.