def METHOD_NAME(self, req_id: int, name: Any):
    if req_id in self._req_id_to_name:
        raise KeyError(
            f"Duplicate entry not allowed for {req_id=}, found {self.get(req_id=req_id)}",
        )
    elif name in self._req_id_to_name.values():
        raise KeyError(f"Duplicate entry not allowed for {name=}, found {self.get(name=name)}")