def save_instances(self, path, binary=False, mode=SaveMode.LOCAL_SAVE):
if binary:<EOL><INDENT>ret = lib.EnvBinarySaveInstances(self._env, path.encode(), mode)<EOL><DEDENT>else:<EOL><INDENT>ret = lib.EnvSaveInstances(self._env, path.encode(), mode)<EOL><DEDENT>if ret == <NUM_LIT:0>:<EOL><INDENT>raise CLIPSError(self._env)<EOL><DEDENT>return ret<EOL>
Save the instances in the system to the specified file.

        If binary is True, the instances will be saved in binary format.

        The Python equivalent of the CLIPS save-instances command.