class_docstr: Basically this is the same as multiprocessing's Finalize class except
  this one uses it's own _finalizer_registry.
class_docstr_tok: ["Basically","this","is","the","same","as","multiprocessing","'s","Finalize","class","except","this","one","uses","it","'s","own","_finalizer_registry","."]
code: def __init__(
      self, obj, callback, args=(), kwargs=None, exitpriority=None
  ):
      assert exitpriority is None or type(exitpriority) is int
  
      if obj is not None:
          self._weakref = weakref.ref(obj, self)
      else:
          assert exitpriority is not None
  
      self._callback = callback
      self._args = args
      self._kwargs = kwargs or {}
      self._key = (exitpriority, next(_finalizer_counter))
      self._pid = os.getpid()
  
      _finalizer_registry[self._key] = self
  
imports: import itertools
  import logging
  import multiprocessing.util
  import os
  import re
  import sys
  import socket
  import threading
  import weakref
  import psutil
label_desc: Use image node_id 1 to create a new Finalize object from inherited base classes: mpu with example: obj = Finalize(obj, callback, args, kwargs, exitpriority)