Prepare the session after the connection has been established.
19420
def session_preparation(self):
        """"""
        self._test_channel_read()
        self.set_base_prompt()
        self.tmsh_mode()
        self.set_base_prompt()
        self.disable_paging(
            command="modify cli preference pager disabled display-threshold 0"
        )
        self.clear_buffer()
        cmd = 'run /util bash -c "stty cols 255"'
        self.set_terminal_width(command=cmd)
478704
def attach_session(self):
        """"""
        proc = self.cmd('attach-session', '-t%s' % self.id)

        if proc.stderr:
            raise exc.LibTmuxException(proc.stderr)
1121062
private function startSession()
    {
        if ('' === session_id()) {
            // no session active
            session_set_cookie_params(
                $this->sessionOptions['lifetime'],
                $this->sessionOptions['path'],
                $this->sessionOptions['domain'],
                $this->sessionOptions['secure'],
                $this->sessionOptions['httponly']
            );
            session_start();
        }
    }
370521
def on_welcome(self, connection, event):
        
        # Start the pool
        self.__pool.start()

        logging.info("! Connected to server '%s': %s",
                     event.source, event.arguments[0])
        connection.join("#cohorte")
1336948
private function prepare()
    {
        $session = new Session();
        $session->start();

        $request = Request::createFromGlobals();
        $request->setSession($session);

        $this->requestStack->push($request);
        $this->tokenStorage->setToken(
            new AnonymousToken('anonymous', 'anonymous', ['ROLE_ADMINISTRATOR'])
        );
    }
1094959
private void connect() {
    session = CqlSession.builder().build();

    System.out.printf("Connected to session: %s%n", session.getName());
  }
391013
def process_reset_session(session, connection_initialize = false)
      # set active command sequence info
      session[:cmd_sequence] = connection_initialize ? :CMD_HELO : :CMD_RSET
      # drop any auth challenge
      session[:auth_challenge] = {}
      # test existing of :ctx hash
      session[:ctx] || session[:ctx] = {}
      # reset server values (only on connection start)
      if connection_initialize
        # create or rebuild :ctx hash
        session[:ctx].merge!(
          server: {
            local_host: '',
            local_ip: '',
            local_port: '',
            local_response: '',
            remote_host: '',
            remote_ip: '',
            remote_port: '',
            helo: '',
            helo_response: '',
            connected: '',
            exceptions: 0,
            authorization_id: '',
            authentication_id: '',
            authenticated: '',
            encrypted: ''
          }
        )
      end
      # reset envelope values
      session[:ctx].merge!(
        envelope: {
          from: '',
          to: [],
          encoding_body: '',
          encoding_utf8: ''
        }
      )
      # reset message data
      session[:ctx].merge!(
        message: {
          received: -1,
          delivered: -1,
          bytesize: -1,
          headers: '',
          crlf: "\r\n",
          data: ''
        }
      )
    end
633009
def init_session(db_url=None, echo=False, engine=None, settings=None):
    
    if engine is None:
        engine = init_engine(db_url=db_url, echo=echo, settings=settings)
    return sessionmaker(bind=engine)
743763
def prepare(self):
        
        # Maybe the Brok is a old daemon one or was already prepared
        # if so, the data is already ok
        if hasattr(self, 'prepared') and not self.prepared:
            self.data = unserialize(self.data)
            if self.instance_id:
                self.data['instance_id'] = self.instance_id
        self.prepared = True
1214985
def session_preparation(self):
        
        delay_factor = self.select_delay_factor(delay_factor=0)
        i = 1
        while i <= 4:
            # Comware can have a banner that prompts you to continue
            # 'Press Y or ENTER to continue, N to exit.'
            time.sleep(0.5 * delay_factor)
            self.write_channel("\n")
            i += 1

        time.sleep(0.3 * delay_factor)
        self.clear_buffer()
        self._test_channel_read(pattern=r"[>\]]")
        self.set_base_prompt()
        command = self.RETURN + "screen-length disable"
        self.disable_paging(command=command)
        # Clear the read buffer
        time.sleep(0.3 * self.global_delay_factor)
        self.clear_buffer()
493213
public function prepare()
    {
        if (!$this->sessionBag->has(self::CSRF_TKN_NAME)) {
            $this->sessionBag->set(self::CSRF_TKN_NAME, $this->generateToken());
            $this->sessionBag->set(self::CSRF_TKN_TIME, time());
        }

        $this->prepared = true;
    }
735202
public function init()
    {

        // initialize the prepared statements
        $this->customerIntsStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_INTS));
    }
1267651
public function init()
    {

        // initialize the prepared statements
        $this->customerDatetimesStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_DATETIMES));
    }
676910
def prepare(self):
        
        super(SessionRequestHandler, self).prepare()
        result = yield gen.Task(self.start_session)
        LOGGER.debug('Exiting SessionRequestHandler.prepare: %r', result)
846638
def _start_connection_setup(self):
        """"""
        logger.info('We are connected[%s], request connection setup',
                    self.link_uri)
        self.platform.fetch_platform_informations(self._platform_info_fetched)
550998
def init_db_conn(connection_name, connection_string, scopefunc=None):
    
    engine = create_engine(connection_string)
    session = scoped_session(sessionmaker(), scopefunc=scopefunc)
    session.configure(bind=engine)
    pool.connections[connection_name] = Connection(engine, session)
1174814
public function init()
    {

        // initialize the prepared statements
        $this->customerAddressDatetimesStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::CUSTOMER_ADDRESS_DATETIMES));
    }