<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_library(platform, is_64bit, lib_dir=LIB_DIR):
 """Loads the NLPIR library appropriate for the user's system. This function is called automatically when this module is loaded. :param str platform: The platform identifier for the user's system. :param bool is_64bit: Whether or not the user's system is 64-bit. :param str lib_dir: The directory that contains the library files (defaults to :data:`LIB_DIR`). :raises RuntimeError: The user's platform is not supported by NLPIR. """

    logger.debug("Loading NLPIR library file from '{}'".format(lib_dir))
    if platform.startswith('win') and is_64bit:
        lib = os.path.join(lib_dir, 'NLPIR64')
        logger.debug("Using library file for 64-bit Windows.")
    elif platform.startswith('win'):
        lib = os.path.join(lib_dir, 'NLPIR32')
        logger.debug("Using library file for 32-bit Windows.")
    elif platform.startswith('linux') and is_64bit:
        lib = os.path.join(lib_dir, 'libNLPIR64.so')
        logger.debug("Using library file for 64-bit GNU/Linux.")
    elif platform.startswith('linux'):
        lib = os.path.join(lib_dir, 'libNLPIR32.so')
        logger.debug("Using library file for 32-bit GNU/Linux.")
    elif platform == 'darwin':
        lib = os.path.join(lib_dir, 'libNLPIRios.so')
        logger.debug("Using library file for OSX/iOS.")
    else:
        raise RuntimeError("Platform '{}' is not supported by NLPIR.".format(
                           platform))
    lib_nlpir = cdll.LoadLibrary(lib if is_python3 else lib.encode('utf-8'))
    logger.debug("NLPIR library file '{}' loaded.".format(lib))
    return lib_nlpir