MCPcopy Index your code
hub / github.com/ipython/ipython / get_session_info

Method get_session_info

IPython/core/history.py:405–429  ·  view source on GitHub ↗

Get info about a session. Parameters ---------- session : int Session number to retrieve. Returns ------- session_id : int Session ID number start : datetime Timestamp for the start of the session.

(
        self, session: int
    )

Source from the content-addressed store, hash-verified

403 @only_when_enabled
404 @catch_corrupt_db
405 def get_session_info(
406 self, session: int
407 ) -> tuple[int, datetime.datetime, Optional[datetime.datetime], Optional[int], str]:
408 """Get info about a session.
409
410 Parameters
411 ----------
412 session : int
413 Session number to retrieve.
414
415 Returns
416 -------
417 session_id : int
418 Session ID number
419 start : datetime
420 Timestamp for the start of the session.
421 end : datetime
422 Timestamp for the end of the session, or None if IPython crashed.
423 num_cmds : int
424 Number of commands run, or None if IPython crashed.
425 remark : str
426 A manually set description.
427 """
428 query = "SELECT * from sessions where session == ?"
429 return self.db.execute(query, (session,)).fetchone()
430
431 @catch_corrupt_db
432 def get_last_session_id(self) -> Optional[int]:

Callers

nothing calls this directly

Calls 1

executeMethod · 0.80

Tested by

no test coverage detected