def dereference(self, dbref, **kwargs):
        if not isinstance(dbref, DBRef):
            raise TypeError("cannot dereference a %s" % type(dbref))
        if dbref.database is not None and dbref.database != self.__name:
            raise ValueError("trying to dereference a DBRef that points to "
                             "another database (%r not %r)" % (dbref.database,
                                                               self.__name))
        return self[dbref.collection].find_one({"_id": dbref.id}, **kwargs)
Dereference a :class:`~bson.dbref.DBRef`, getting the
dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/database.py/Database.dereference