<s> """<STR_LIT>""" <EOL> import io <EOL> import unittest <EOL> from email import policy , message_from_bytes <EOL> from email . generator import BytesGenerator <EOL> from test . test_email import TestEmailBase , parameterize <EOL> def dedent ( bstr ) : <EOL> lines = bstr . splitlines ( ) <EOL> if not lines [ <NUM_LIT:0> ] . strip ( ) : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> stripamt = len ( lines [ <NUM_LIT:0> ] ) - len ( lines [ <NUM_LIT:0> ] . lstrip ( ) ) <EOL> return b'<STR_LIT:\r\n>' . join ( <EOL> [ x [ stripamt : ] if len ( x ) >= stripamt else b'<STR_LIT>' <EOL> for x in lines ] ) <EOL> @ parameterize <EOL> class TestInversion ( TestEmailBase , unittest . TestCase ) : <EOL> def msg_as_input ( self , msg ) : <EOL> m = message_from_bytes ( msg , policy = policy . SMTP ) <EOL> b = io . BytesIO ( ) <EOL> g = BytesGenerator ( b ) <EOL> g . flatten ( m ) <EOL> self . assertEqual ( b . getvalue ( ) , msg ) <EOL> msg_params = { <EOL> '<STR_LIT>' : ( dedent ( b"""<STR_LIT>""" ) , ) , <EOL> } <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
