<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def must_be_same(self, klass):
 """Called to make sure a Node is a Dir. Since we're an Entry, we can morph into one."""

        if self.__class__ is not klass:
            self.__class__ = klass
            self._morph()
            self.clear()