code: def cleanup_lib(self):
          
          if not self.using_openmp:
              #this if statement is necessary because shared libraries that use
              #OpenMP will core dump when unloaded, this is a well-known issue with OpenMP
              logging.debug('unloading shared library')
              _ctypes.dlclose(self.lib._handle)
docs: unload the previously loaded shared library