<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def switch_context(self, page):
 """Switch context tabs by tab widget name. :param page: The page should be focussed. :type page: QWidget """

        # noinspection PyUnresolvedReferences
        if page.objectName() == 'profile_edit_page':
            self.stacked_widget.setCurrentIndex(0)
            self.button_box.button(QDialogButtonBox.Close).setHidden(False)
        else:  # resource_edit_page
            self.stacked_widget.setCurrentIndex(1)
            # hide the close button
            self.button_box.button(QDialogButtonBox.Close).setHidden(True)