def _import_module_with_version_check(module_name, minimum_version, install_info=None):
 from distutils.version import LooseVersion
 try:
  module = __import__(module_name)
 except ImportError as exc:
  user_friendly_info = 'Module "{0}" could not be found. {1}'.format(module_name, (install_info or 'Please install it properly to use imbalanced-learn.'))
  exc.args += (user_friendly_info,)
  raise
 module_version = getattr(module, '__version__', '0.0.0')
 version_too_old = (not (LooseVersion(module_version) >= LooseVersion(minimum_version)))
 if version_too_old:
  message = 'A {module_name} version of at least {minimum_version} is required to use imbalanced-learn. {module_version} was found. Please upgrade {module_name}'.format(module_name=module_name, minimum_version=minimum_version, module_version=module_version)
  raise ImportError(message)
 return module

def _import_module_with_version_check ( module_name , minimum_version , install_info = None ) : from distutils . version import LooseVersion try : module = __import__ ( module_name ) except ImportError as exc : user_friendly_info = 'Module "{0}" could not be found. {1}' . format ( module_name , ( install_info or 'Please install it properly to use imbalanced-learn.' ) ) exc . args += ( user_friendly_info , ) raise module_version = getattr ( module , '__version__' , '0.0.0' ) version_too_old = ( not ( LooseVersion ( module_version ) >= LooseVersion ( minimum_version ) ) ) if version_too_old : message = 'A {module_name} version of at least {minimum_version} is required to use imbalanced-learn. {module_version} was found. Please upgrade {module_name}' . format ( module_name = module_name , minimum_version = minimum_version , module_version = module_version ) raise ImportError ( message ) return module
check that module is installed with a recent enough version .