def __init__(self, *, parent=None, con=None, persist=True, **kwargs):
if parent and con:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>self.con = parent.con if parent else con<EOL>main_resource = kwargs.pop('<STR_LIT>', None) or (<EOL>getattr(parent, '<STR_LIT>', None) if parent else None)<EOL>super().__init__(<EOL>protocol=parent.protocol if parent else kwargs.get('<STR_LIT>'),<EOL>main_resource=main_resource)<EOL>self.persist = persist<EOL>self.inactivity_limit = dt.timedelta(seconds=PERSISTENT_SESSION_INACTIVITY_MAX_AGE)if persist else dt.timedelta(seconds=NON_PERSISTENT_SESSION_INACTIVITY_MAX_AGE)<EOL>self.session_id = None<EOL>self.last_activity = dt.datetime.now()<EOL>
Create a workbook session object.

        :param parent: parent for this operation
        :param Connection con: connection to use if no parent specified
        :param Bool persist: Whether or not to persist the session changes