<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _merge_states(self, old_state, new_state):
 """ Merge two given states, and return a new one. :param old_state: :param new_state: :returns: The merged state, and whether a merging has occurred """


        # print old_state.dbg_print_stack()
        # print new_state.dbg_print_stack()

        merged_state, _, merging_occurred = old_state.merge(new_state, plugin_whitelist=self._mergeable_plugins)

        # print "Merged: "
        # print merged_state.dbg_print_stack()

        return merged_state, merging_occurred