code: def unload_module(modname):
      
      import sys
      import gc
      if modname in sys.modules:
          referrer_list = gc.get_referrers(sys.modules[modname])
          #module = sys.modules[modname]
          for referer in referrer_list:
              if referer is not sys.modules:
                  referer[modname] = None
              #del referer[modname]
          #sys.modules[modname] = module
          #del module
          refcount = sys.getrefcount(sys.modules[modname])
          print('%s refcount=%r' % (modname, refcount))
          del sys.modules[modname]
docs: WARNING POTENTIALLY DANGEROUS AND MAY NOT WORK
  
      References:
          http://stackoverflow.com/questions/437589/how-do-i-unload-reload-a-python-module
  
      CommandLine:
          python -m utool.util_cplat --test-unload_module
  
      Example:
          >>> # DISABLE_DOCTEST
          >>> import sys, gc  # NOQA
          >>> import pyhesaff
          >>> import utool as ut
          >>> modname = 'pyhesaff'
          >>> print('%s refcount=%r' % (modname, sys.getrefcount(pyhesaff),))
          >>> #referrer_list = gc.get_referrers(sys.modules[modname])
          >>> #print('referrer_list = %s' % (ut.repr4(referrer_list),))
          >>> ut.unload_module(modname)
          >>> assert pyhesaff is None