<s> """<STR_LIT>""" <EOL> import socket <EOL> from imaplib import IMAP4 <EOL> from tlslite . tlsconnection import TLSConnection <EOL> from tlslite . integration . clienthelper import ClientHelper <EOL> IMAP4_TLS_PORT = <NUM_LIT> <EOL> class IMAP4_TLS ( IMAP4 , ClientHelper ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , host = '<STR_LIT>' , port = IMAP4_TLS_PORT , <EOL> username = None , password = None , <EOL> certChain = None , privateKey = None , <EOL> checker = None , <EOL> settings = None ) : <EOL> """<STR_LIT>""" <EOL> ClientHelper . __init__ ( self , <EOL> username , password , <EOL> certChain , privateKey , <EOL> checker , <EOL> settings ) <EOL> IMAP4 . __init__ ( self , host , port ) <EOL> def open ( self , host = '<STR_LIT>' , port = IMAP4_TLS_PORT ) : <EOL> """<STR_LIT>""" <EOL> self . host = host <EOL> self . port = port <EOL> self . sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) <EOL> self . sock . connect ( ( host , port ) ) <EOL> self . sock = TLSConnection ( self . sock ) <EOL> ClientHelper . _handshake ( self , self . sock ) <EOL> self . file = self . sock . makefile ( '<STR_LIT:rb>' ) </s>
