(self, rep)
Support Jupyter's improved completion machinery.
Support Jupyter's improved completion machinery.
Support Jupyter s improved completion machinery .
def _handle_complete_reply(self, rep):
        """Support Jupyter's improved completion machinery.
        """
        info = self._request_info.get('complete')
        if (info and info.id == rep['parent_header']['msg_id']):
            content = rep['content']

            if 'metadata' not in content or \
                    '_jupyter_types_experimental' not in content['metadata']:
                log.error('Jupyter API has changed, completions are unavailable.')
                return
            matches = content['metadata']['_jupyter_types_experimental']
            start = content['cursor_start']

            start = max(start, 0)

            for m in matches:
                if m['type'] == '<unknown>':
                    m['type'] = None

            self._show_completions(matches, start)
        self._opened_automatically = True
def _handle_complete_reply ( self , rep ) : info = self . _request_info . get ( 'complete' ) if ( info and info . id == rep [ 'parent_header' ] [ 'msg_id' ] ) : content = rep [ 'content' ] if 'metadata' not in content or '_jupyter_types_experimental' not in content [ 'metadata' ] : log . error ( 'Jupyter API has changed, completions are unavailable.' ) return matches = content [ 'metadata' ] [ '_jupyter_types_experimental' ] start = content [ 'cursor_start' ] start = max ( start , 0 ) for m in matches : if m [ 'type' ] == '<unknown>' : m [ 'type' ] = None self . _show_completions ( matches , start ) self . _opened_automatically = True