def METHOD_NAME(upx_dir):
    logger.debug('Testing UPX availability ...')
    upx_exe = "upx"
    if upx_dir:
        upx_exe = os.path.normpath(os.path.join(upx_dir, upx_exe))
    # Check if we can call `upx -V`.
    try:
        output = subprocess.check_output(
            [upx_exe, '-V'],
            stdin=subprocess.DEVNULL,
            stderr=subprocess.DEVNULL,
            universal_newlines=True,
        )
    except Exception:
        logger.debug('UPX is not available.')
        return False
    # Read the first line to display version string
    try:
        version_string = output.splitlines()[0]
    except IndexError:
        version_string = 'version string unavailable'
    logger.debug('UPX is available: %s', version_string)
    return True