def start(self):
<EOL>logger = _get_logger(self.debug)<EOL>started = self._session.start()<EOL>if started:<EOL><INDENT>ev = self._session.nextEvent()<EOL>ev_name = _EVENT_DICT[ev.eventType()]<EOL>logger.info('<STR_LIT>'.format(ev_name))<EOL>for msg in ev:<EOL><INDENT>logger.info('<STR_LIT>'.format(msg))<EOL><DEDENT>if ev.eventType() != blpapi.Event.SESSION_STATUS:<EOL><INDENT>raise RuntimeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(ev_name))<EOL><DEDENT>ev = self._session.nextEvent()<EOL>ev_name = _EVENT_DICT[ev.eventType()]<EOL>logger.info('<STR_LIT>'.format(ev_name))<EOL>for msg in ev:<EOL><INDENT>logger.info('<STR_LIT>'.format(msg))<EOL><DEDENT>if ev.eventType() != blpapi.Event.SESSION_STATUS:<EOL><INDENT>raise RuntimeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(ev_name))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>ev = self._session.nextEvent(self.timeout)<EOL>if ev.eventType() == blpapi.Event.SESSION_STATUS:<EOL><INDENT>for msg in ev:<EOL><INDENT>logger.warning('<STR_LIT>'.format(msg))<EOL><DEDENT>raise ConnectionError('<STR_LIT>')<EOL><DEDENT><DEDENT>self._init_services()<EOL>return self<EOL>
Start connection and initialize session services