<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def show_dlg(self, dlg):
 """ Abstraction function that is to be used instead of dlg.ShowModal Parameters dlg : dialog to ShowModal if possible """

        if not self.test_mode:
            dlg.Center()
            return dlg.ShowModal()
        else:
            return dlg.GetAffirmativeId()