def _keywordFilteringTest(self, keyword):
        """
        Helper to implement tests for value filtering of KEYWORD and UNKEYWORD
        queries.

        @param keyword: A native string giving the name of the L{imap4.Query}
            keyword argument to test.
        """
        # Check all the printable exclusions
        self.assertEqual(
            '(%s twistedrocks)' % (keyword.upper(),),
            imap4.Query(**{keyword: r'twisted (){%*"\] rocks'}))

        # Check all the non-printable exclusions
        self.assertEqual(
            '(%s twistedrocks)' % (keyword.upper(),),
            imap4.Query(**{
                    keyword: 'twisted %s rocks' % (
                    ''.join(chr(ch) for ch in range(33)),)}))

        Helper to implement tests for value filtering of KEYWORD and UNKEYWORD
        queries.

        @param keyword: A native string giving the name of the L{imap4.Query}
            keyword argument to test.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_imap.py