def is_active( self, flag ):
        'If given flag(s) should generate output.'

        # try to abort early to quicken code
        if not self.active:
            return 0
        if not flag or flag in self.active:
            return 1
        else:
            # check for multi flag type:
            if type( flag ) in ( type(()), type([]) ):
                for s in flag:
                    if s in self.active:
                        return 1
        return 0
If given flag(s) should generate output.
chrome-cordova/gcmServer/xmpp/debug.py