class_docstr: A persisted model for inter-process model sharing.
  
  These objects can be pickled for transmission to a worker process.
  
  .. note::
      Subclasses need to override the pickling protocol to implement the
      proper pickling implementation.
class_docstr_tok: ["A","persisted","model","for","inter-process","model","sharing",".","These","objects","can","be","pickled","for","transmission","to","a","worker","process",".","..","note",":",":","Subclasses","need","to","override","the","pickling","protocol","to","implement","the","proper","pickling","implementation","."]
docstr: Mark an object for ownership transfer.  This object, when pickled, will
  unpickle into an owning model that frees resources when closed. Used to
  transfer ownership of shared memory resources from child processes to
  parent processes.  Such an object should only be unpickled once.
  
  The default implementation sets the ``is_owner`` attribute to ``'transfer'``.
  
  Returns:
      ``self`` (for convenience)
docstr_tok: ["Mark","an","object","for","ownership","transfer",".","This","object",",","when","pickled",",","will","unpickle","into","an","owning","model","that","frees","resources","when","closed",".","Used","to","transfer","ownership","of","shared","memory","resources","from","child","processes","to","parent","processes",".","Such","an","object","should","only","be","unpickled","once",".","The","default","implementation","sets","the","``","is_owner","``","attribute","to","``","'transfer","'","``",".","Returns",":","``","self","``","(","for","convenience",")"]
code: def transfer(self):
      """
      Mark an object for ownership transfer.  This object, when pickled, will
      unpickle into an owning model that frees resources when closed. Used to
      transfer ownership of shared memory resources from child processes to
      parent processes.  Such an object should only be unpickled once.
  
      The default implementation sets the ``is_owner`` attribute to ``'transfer'``.
  
      Returns:
          ``self`` (for convenience)
      """
      if not self.is_owner:
          warnings.warning(
              "non-owning objects should not be transferred",
              stacklevel=1,
          )
      else:
          self.is_owner = "transfer"
      return self
  
file_path: lkpy/lenskit/sharing/__init__.py
imports: import os
  import warnings
  from abc import abstractmethod, ABC
  from contextlib import contextmanager
  import threading
  import logging
  from .binpickle import persist_binpickle, BPKPersisted
  from .shm import persist_shm, SHMPersisted, SHM_AVAILABLE
label_desc: Use image node_id 3 for calling the PersistedModel obj's underlying member method code with example usage: obj.transfer() and returns: self