

def _CheckPythonModule(module_name, version_attribute_name, minimum_version, maximum_version=None):
    'Checks the availability of a Python module.\n\n  Args:\n    module_name: the name of the module.\n    version_attribute_name: the name of the attribute that contains the module\n                            version.\n    minimum_version: the minimum required version.\n    maximum_version: the maximum required version. This attribute is optional\n                     and should only be used if there is a recent API change\n                     that prevents the tool from running if a later version\n                     is used.\n\n  Returns:\n    True if the Python module is available and conforms to the minimum required\n    version. False otherwise.\n  '
    module_object = _ImportPythonModule(module_name)
    if (not module_object):
        print('[FAILURE]\tmissing: {0:s}.'.format(module_name))
        return False
    if ((not version_attribute_name) or (not minimum_version)):
        print('[OK]\t\t{0:s}'.format(module_name))
        return True
    module_version = getattr(module_object, version_attribute_name, None)
    if (not module_version):
        print('[FAILURE]\tunable to determine version information for: {0:s}'.format(module_name))
        return False
    module_version_map = list(map(int, _VERSION_SPLIT_REGEX.split(module_version)))
    minimum_version_map = list(map(int, _VERSION_SPLIT_REGEX.split(minimum_version)))
    if (module_version_map < maximum_version_map):
        print('[FAILURE]\t{0:s} version: {1:s} is too old, {2:s} or later required.'.format(module_name, module_version, minimum_version))
        return False
    if maximum_version:
        maximum_version_map = list(map(int, _VERSION_SPLIT_REGEX.split(maximum_version)))
        if (module_version_map > maximum_version_map):
            print('[FAILURE]\t{0:s} version: {1:s} is too recent, {2:s} or earlier required.'.format(module_name, module_version, maximum_version))
            return False
    print('[OK]\t\t{0:s} version: {1:s}'.format(module_name, module_version))
    return True

dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/dependencies.py _CheckPythonModule/VarMisuse@149/486 `minimum_version_map`->`maximum_version_map`