@gensim.utils.synchronous('<STR_LIT>')<EOL><INDENT>def check_session(self):<DEDENT>
if self.session is None:<EOL><INDENT>if self.autosession:<EOL><INDENT>self.open_session()<EOL><DEDENT>else:<EOL><INDENT>msg = "<STR_LIT>" % self<EOL>raise RuntimeError(msg)<EOL><DEDENT><DEDENT>
Make sure a session is open.

If it's not and autosession is turned on, create a new session automatically.
If it's not and autosession is off, raise an exception.