class_docstr: Abstract base class for MagickWand object that requires resource
  management. Its all subclasses manage the resource semiautomatically
  and support :keyword:`with` statement as well::
  
      with Resource() as resource:
          # use the resource...
          pass
  
  It doesn't implement constructor by itself, so subclasses should
  implement it. Every constructor should assign the pointer of its
  resource data into :attr:`resource` attribute inside of :keyword:`with`
  :meth:`allocate()` context.  For example::
  
      class Pizza(Resource):
          '''My pizza yummy.'''
  
          def __init__(self):
              with self.allocate():
                  self.resource = library.NewPizza()
  
  .. versionadded:: 0.1.2
code: def resource(self):
      if getattr(self, "c_resource", None):
          deallocate_ref(self.c_resource)
      self.c_resource = None
  
imports: import atexit
  import contextlib
  import ctypes
  import warnings
  from .api import library
  from .compat import abc, string_type
  from .exceptions import TYPE_MAP, WandException
  from .version import MAGICK_VERSION_NUMBER
label_desc: Use image node_id 3 for calling the Resource obj's underlying member method code with example usage: obj.resource() without return types