<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_state(self, out_path):
 """Save the current state of this emulated object to a file. Args: out_path (str):
 The path to save the dumped state of this emulated object. """


        state = self.dump_state()

        # Remove all IntEnums from state since they cannot be json-serialized on python 2.7
        # See https://bitbucket.org/stoneleaf/enum34/issues/17/difference-between-enum34-and-enum-json
        state = _clean_intenum(state)

        with open(out_path, "w") as outfile:
            json.dump(state, outfile, indent=4)