def load_engine_and_libs(matlab_root, options):
if sys.maxsize > <NUM_LIT:2>**<NUM_LIT:32>:<EOL><INDENT>bits = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>bits = '<STR_LIT>'<EOL><DEDENT>system = platform.system()<EOL>if system == '<STR_LIT>':<EOL><INDENT>if bits == '<STR_LIT>':<EOL><INDENT>lib_dir = join(matlab_root, "<STR_LIT>", "<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>lib_dir = join(matlab_root, "<STR_LIT>", "<STR_LIT>")<EOL><DEDENT>check_python_matlab_architecture(bits, lib_dir)<EOL>libeng = Library(<EOL>join(lib_dir, '<STR_LIT>')<EOL>)<EOL>libmx = Library(<EOL>join(lib_dir, '<STR_LIT>')<EOL>)<EOL>command = "<STR_LIT>".format(<EOL>executable=join(matlab_root, '<STR_LIT>', '<STR_LIT>'),<EOL>options=options<EOL>)<EOL>if not os.path.exists("<STR_LIT>"):<EOL><INDENT>warnings.warn("<STR_LIT>")<EOL><DEDENT><DEDENT>elif system == '<STR_LIT>':<EOL><INDENT>if bits == '<STR_LIT>':<EOL><INDENT>lib_dir = join(matlab_root, "<STR_LIT>", "<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>lib_dir = join(matlab_root, "<STR_LIT>", "<STR_LIT:win32>")<EOL><DEDENT>check_python_matlab_architecture(bits, lib_dir)<EOL>if lib_dir not in os.environ['<STR_LIT>']:<EOL><INDENT>os.environ['<STR_LIT>'] = lib_dir + '<STR_LIT:;>' + os.environ['<STR_LIT>']<EOL><DEDENT>libeng = Library('<STR_LIT>')<EOL>libmx = Library('<STR_LIT>')<EOL>command = None<EOL><DEDENT>elif system == '<STR_LIT>':<EOL><INDENT>if bits == '<STR_LIT>':<EOL><INDENT>lib_dir = join(matlab_root, "<STR_LIT>", "<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>unsupported_platform(system, bits)<EOL><DEDENT>check_python_matlab_architecture(bits, lib_dir)<EOL>libeng = Library(<EOL>join(lib_dir, '<STR_LIT>')<EOL>)<EOL>libmx = Library(<EOL>join(lib_dir, '<STR_LIT>')<EOL>)<EOL>command = "<STR_LIT>".format(<EOL>executable=join(matlab_root, '<STR_LIT>', '<STR_LIT>'),<EOL>options=options<EOL>)<EOL><DEDENT>else:<EOL><INDENT>unsupported_platform(system, bits)<EOL><DEDENT>try:<EOL><INDENT>version_str = c_char_p.in_dll(libeng, "<STR_LIT>").value<EOL>version = tuple([int(v) for v in version_str.split('<STR_LIT:.>')[:<NUM_LIT:2>]])<EOL><DEDENT>except ValueError:<EOL><INDENT>warnings.warn("<STR_LIT>")<EOL>version = None<EOL><DEDENT>if (system == '<STR_LIT>') and (version == (<NUM_LIT:8>, <NUM_LIT:3>)) and (bits == '<STR_LIT>'):<EOL><INDENT>warnings.warn("<STR_LIT>")<EOL><DEDENT>elif (system == '<STR_LIT>') and (version == (<NUM_LIT:8>, <NUM_LIT:3>)) and (bits == '<STR_LIT>'):<EOL><INDENT>warnings.warn("<STR_LIT>")<EOL><DEDENT>engine = libeng.engOpen(command)<EOL>return engine, libeng, libmx, version<EOL>
Load and return `libeng` and `libmx`.  Start and return MATLAB
    engine.

    Returns
    -------
    engine
    libeng
    libmx