<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_locked(self):
 """ Returns whether model is locked """

        if not self.__locked__:
            return False
        elif self.get_parent():
            return self.get_parent().is_locked()

        return True