def can_import(module):
 try:
  __import__(module)
 except ImportError:
  return False
 return True

def can_import ( module ) : try : __import__ ( module ) except ImportError : return False return True
return true if a given module can be imported or not .