def lsub(self, reference, wildcard):
        """
        List a subset of the subscribed available mailboxes

        This command is allowed in the Authenticated and Selected states.

        The parameters and returned object are the same as for the L{list}
        method, with one slight difference: Only mailboxes which have been
        subscribed can be included in the resulting list.
        """
        cmd = b'LSUB'

        encodedReference = reference.encode('ascii')
        encodedWildcard = wildcard.encode('imap4-utf-7')
        args = b"".join([
            b'"', encodedReference, b'"'
            b' "', encodedWildcard, b'"',
        ])
        resp = (b'LSUB',)
        d = self.sendCommand(Command(cmd, args, wantResponse=resp))
        d.addCallback(self.__cbList, b'LSUB')
        return d

        List a subset of the subscribed available mailboxes

        This command is allowed in the Authenticated and Selected states.

        The parameters and returned object are the same as for the L{list}
        method, with one slight difference: Only mailboxes which have been
        subscribed can be included in the resulting list.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/imap4.py