def set_header(self, msg, key, value, encode=True):

        if value is None:
            # TODO: may be remove header here ?
            return

        if not isinstance(value, string_types):
            value = to_unicode(value)

        # Prevent header injection
        if '\n' in value or '\r' in value:
            raise BadHeaderError((value, key) % "Header values can't contain newlines (got %r for header %r)")

        if key.lower() in self.ADDRESS_HEADERS:
            value = ', '.join(sanitize_address(addr, self.charset)
                              for addr in getaddresses((value,)))

        msg[key] = encode and self.encode_header(value) or value
dataset/ETHPy150Open lavr/python-emails/emails/message.py/MessageBuildMixin.set_header/swapped operands of `%`