def registerSession(self, session):
        negotiatorKey = session.getParentNegotiatorKey()
        peerUser = session.sharingWithUser
        if negotiatorKey in self.sessionsByUserByNegotiator:
            if peerUser in self.sessionsByUserByNegotiator[negotiatorKey]:
                existingSessions = self.sessionsByUserByNegotiator[negotiatorKey][peerUser]
                if session in existingSessions:
                    if hasattr(session, 'view') and session.view:
                        self.logger.warn('already collaborating on %s with %s' % (session.view.file_name(), peerUser))
                    else:
                        self.logger.debug('attempt to register already existing session with %s but without a set view' % peerUser)
                else:
                    existingSessions.add(session)
            else:
                self.sessionsByUserByNegotiator[negotiatorKey] = {peerUser: set([session])}
        else:
            self.sessionsByUserByNegotiator[negotiatorKey] = {peerUser: set([session])}
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/sub_collab/registry.py/Registry.registerSession/original