def _choose_nonull_or_dflt(self, dflt, *args):
        if isinstance(dflt, str):
            dflttyp = str            # Allow any string type
        else:
            dflttyp = type(dflt)
        for arg in args:
            if arg is not None:
                 if isinstance(arg, dflttyp):
                     return arg
                 if __debug__: self._log(0, 'bad arg is %s, expecting %s' % (type(arg), dflttyp))
        return dflt
dataset/ETHPy150Open OfflineIMAP/imapfw/imapfw/imap/imaplib3/imaplib2.py/IMAP4._choose_nonull_or_dflt/original