MCPcopy Create free account
hub / github.com/ipython/ipython / get_session_info

Method get_session_info

IPython/core/history.py:604–631  ·  view source on GitHub ↗

Get info about a session. Parameters ---------- session : int Session number to retrieve. The current session is 0, and negative numbers count back from current session, so -1 is the previous session. Returns -------

(self, session=0)

Source from the content-addressed store, hash-verified

602 # Methods for retrieving history
603 # ------------------------------
604 def get_session_info(self, session=0):
605 """Get info about a session.
606
607 Parameters
608 ----------
609
610 session : int
611 Session number to retrieve. The current session is 0, and negative
612 numbers count back from current session, so -1 is the previous session.
613
614 Returns
615 -------
616
617 session_id : int
618 Session ID number
619 start : datetime
620 Timestamp for the start of the session.
621 end : datetime
622 Timestamp for the end of the session, or None if IPython crashed.
623 num_cmds : int
624 Number of commands run, or None if IPython crashed.
625 remark : unicode
626 A manually set description.
627 """
628 if session <= 0:
629 session += self.session_number
630
631 return super(HistoryManager, self).get_session_info(session=session)
632
633 def _get_range_session(self, start=1, stop=None, raw=True, output=False):
634 """Get input and output history from the current session. Called by

Callers 1

test_timestamp_typeFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_timestamp_typeFunction · 0.36