code: def _get_session(self):
          
          if self._session is None:
              session = self._session = self._database.session()
              session.create()
          return self._session
docs: Create session as needed.
  
          .. note::
  
             Caller is responsible for cleaning up the session after
             all partitions have been processed.