docs: def reference_index(self, ref_id):
          """Return the first reference with this ID."""
          try:
              indexes = range(self.reference_count())
              return next(i for i in indexes if self.reference_id(i) == ref_id)
          except StopIteration as e:
              raise ReferenceNotFoundError("ID: " + ref_id) from e