code: def register(cls, encryptor: Encryptor):
          
          # save the current encryptor statically
          cls.__encryptor__ = encryptor
  
          # NB: we cannot use the before_insert listener in conjunction with a foreign key relationship
          # for encrypted data; SQLAlchemy will warn about using 'related attribute set' operation so
          # late in its insert/flush process.
          listeners = dict(
              init=on_init,
              load=on_load,
          )
  
          for name, func in listeners.items():
              # If we initialize the graph multiple times (as in many unit testing scenarios),
              # we will accumulate listener functions -- with unpredictable results. As protection,
              # we need to remove existing listeners before adding new ones; this solution only
              # works if the id (e.g. memory address) of the listener does not change, which means
              # they cannot be closures around the `encryptor` reference.
              #
              # Hence the `__encryptor__` hack above...
              if contains(cls, name, func):
                  remove(cls, name, func)
              listen(cls, name, func)
docs: Register this encryptable with an encryptor.
  
          Instances of this encryptor will be encrypted on initialization and decrypted on load.