def ensureNotImported(moduleNames, errorMessage, preventImports=[]):
 for name in moduleNames:
  if (sys.modules.get(name) is not None):
   raise ImportError(errorMessage)
 for name in preventImports:
  sys.modules[name] = None

def ensureNotImported ( moduleNames , errorMessage , preventImports = [ ] ) : for name in moduleNames : if ( sys . modules . get ( name ) is not None ) : raise ImportError ( errorMessage ) for name in preventImports : sys . modules [ name ] = None
check whether the given modules were imported .