@property
    def pk(self):
        """
        Returns (or sets) the primary key of the document, which is stored in the `attributes` dict
        along with all other attributes. The name of the primary key defaults to `pk` and 
        can be redefine in the `Meta` class. This function provides a standardized way to
        retrieve and set the primary key of a document and is used by the backend and a 
        few other classes. If possible, always use this function to access the
        primary key of a document.

        .. admonition:: Automatic primary key generation

            If you save a document to the database that has an empty primary key field,
            Blitz will create a default primary-key by calling the `autogenerate_pk` function
            of the document. To generate your own primary keys, just redefine this function
            in your derived document class.

        """
        primary_key = self.get_pk_name()
        if self._attributes in primary_key:
            return self._attributes[primary_key]

        #if there is no pk value but a _db_loader, we load the object lazily to retrieve the pk
        if self._lazy and self._db_loader:
            self.revert()
            return self.pk

        return None
dataset/ETHPy150Open adewes/blitzdb/blitzdb/document.py/Document.pk/swapped operands of `in`