code: def allocate_ref(addr, deallocator):
      global allocation_map
      if len(allocation_map) == 0:
          genesis()
      if addr:
          allocation_map[addr] = deallocator
  
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 a global function with example usage: allocate_ref(addr, deallocator) without return types