def restore_instances(self, instances):
instances = instances.encode()<EOL>if os.path.exists(instances):<EOL><INDENT>ret = lib.EnvRestoreInstances(self._env, instances)<EOL>if ret == -<NUM_LIT:1>:<EOL><INDENT>raise CLIPSError(self._env)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>ret = lib.EnvRestoreInstancesFromString(self._env, instances, -<NUM_LIT:1>)<EOL>if ret == -<NUM_LIT:1>:<EOL><INDENT>raise CLIPSError(self._env)<EOL><DEDENT><DEDENT>return ret<EOL>
Restore a set of instances into the CLIPS data base.

        The Python equivalent of the CLIPS restore-instances command.

        Instances can be passed as a set of strings or as a file.