def __init__(self, avatar):
        """
        Initialize the session and create a reference to it on the avatar for
        later inspection.
        """
        self.avatar = avatar
        self.avatar._testSession = self
        self.cmd = None
        self.proto = None
        self.ptyReq = False
        self.eof = 0
        self.onClose = defer.Deferred()

        Initialize the session and create a reference to it on the avatar for
        later inspection.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_ssh.py