code: def get_server_session(self):
          
          with self._lock:
              session_timeout = self._description.logical_session_timeout_minutes
              if session_timeout is None:
                  # Maybe we need an initial scan? Can raise ServerSelectionError.
                  if self._description.topology_type == TOPOLOGY_TYPE.Single:
                      if not self._description.has_known_servers:
                          self._select_servers_loop(
                              any_server_selector,
                              self._settings.server_selection_timeout,
                              None)
                  elif not self._description.readable_servers:
                      self._select_servers_loop(
                          readable_server_selector,
                          self._settings.server_selection_timeout,
                          None)
  
              session_timeout = self._description.logical_session_timeout_minutes
              if session_timeout is None:
                  raise ConfigurationError(
                      "Sessions are not supported by this MongoDB deployment")
  
              return self._session_pool.get_server_session(session_timeout)
docs: Start or resume a server session, or raise ConfigurationError.