

def _CheckLibyal(libyal_python_modules, latest_version_check=False):
    'Checks the availability of libyal libraries.\n\n  Args:\n    libyal_python_modules: a dictionary of libyal python module name as\n                           the key and version as the value.\n    latest_version_check: optional boolean value to indicate if the project\n                          site should be checked for the latest version.\n\n  Returns:\n    True if the libyal libraries are available, False otherwise.\n  '
    connection_error = False
    result = True
    for (module_name, module_version) in sorted(libyal_python_modules.items()):
        module_object = _ImportPythonModule(module_name)
        if (not module_object):
            print('[FAILURE]\tmissing: {0:s}.'.format(module_name))
            result = False
            continue
        libyal_name = 'lib{0:s}'.format(module_name[2:])
        installed_version = int(module_object.get_version())
        latest_version = None
        if latest_version_check:
            try:
                latest_version = _GetLibyalGithubReleasesLatestVersion(libyal_name)
            except urllib_error.URLError:
                latest_version = None
            if (not latest_version):
                try:
                    latest_version = _GetLibyalGoogleDriveLatestVersion(libyal_name)
                except urllib_error.URLError:
                    latest_version = None
            if (not latest_version):
                print('Unable to determine latest version of {0:s} ({1:s}).\n'.format(libyal_name, module_name))
                latest_version = None
                connection_error = True
        if ((module_version is not None) and (installed_version < module_version)):
            print('[FAILURE]\t{0:s} ({1:s}) version: {2:d} is too old, {3:d} or later required.'.format(libyal_name, libyal_python_modules, installed_version, module_version))
            result = False
        elif (latest_version and (installed_version != latest_version)):
            print('[INFO]\t\t{0:s} ({1:s}) version: {2:d} installed, version: {3:d} available.'.format(libyal_name, module_name, installed_version, latest_version))
        else:
            print('[OK]\t\t{0:s} ({1:s}) version: {2:d}'.format(libyal_name, module_name, installed_version))
    if connection_error:
        print('[INFO] to check for the latest versions this script needs Internet access.')
    return result

dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/dependencies.py _CheckLibyal/VarMisuse@220/584 `module_name`->`libyal_python_modules`