def get_app(self, reference_app=None):
if reference_app is not None:<EOL><INDENT>return reference_app<EOL><DEDENT>if current_app:<EOL><INDENT>return current_app._get_current_object()<EOL><DEDENT>if self.app is not None:<EOL><INDENT>return self.app<EOL><DEDENT>raise RuntimeError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>)<EOL>
Helper method that implements the logic to look up an
        application.