<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save_facts(self, path, mode=SaveMode.LOCAL_SAVE):
 """Save the facts in the system to the specified file. The Python equivalent of the CLIPS save-facts command. """

        ret = lib.EnvSaveFacts(self._env, path.encode(), mode)
        if ret == -1:
            raise CLIPSError(self._env)

        return ret