code: def save_state(self, out_path):
          
  
          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)
docs: 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.