voila/voila/handler.py
def find_kernel_name_for_language(self, kernel_language, kernel_specs=None):
        """Finds a best matching kernel name given a kernel language.

        If multiple kernels matches are found, we try to return the same kernel name each time.
        """
        if kernel_specs is None:
            kernel_specs = yield tornado.gen.maybe_future(self.kernel_spec_manager.get_all_specs())
        matches = [
            name for name, kernel in kernel_specs.items()
            if kernel["spec"]["language"].lower() == kernel_language
        ]
        if matches:
            # Sort by display name to get the same kernel each time.
            matches.sort(key=lambda name: kernel_specs[name]["spec"]["display_name"])
            raise tornado.gen.Return(matches[0])  # TODO py2: replace by return
        else:
            raise tornado.web.HTTPError(500, 'No Jupyter kernel for language %r found' % kernel_language)
Finds a best matching kernel name given a kernel language.

        If multiple kernels matches are found, we try to return the same kernel name each time.
        
Finds a best matching kernel name given a kernel language.
If multiple kernels matches are found, we try to return the same kernel name each time.
Finds a best matching kernel name given a kernel language . If multiple kernels matches are found we try to return the same kernel name each time .
def find_kernel_name_for_language(self, kernel_language, kernel_specs=None):
        if kernel_specs is None:
            kernel_specs = yield tornado.gen.maybe_future(self.kernel_spec_manager.get_all_specs())
        matches = [
            name for name, kernel in kernel_specs.items()
            if kernel["spec"]["language"].lower() == kernel_language
        ]
        if matches:
            matches.sort(key=lambda name: kernel_specs[name]["spec"]["display_name"])
            raise tornado.gen.Return(matches[0])  
        else:
            raise tornado.web.HTTPError(500, 'No Jupyter kernel for language %r found' % kernel_language)
def find_kernel_name_for_language ( self , kernel_language , kernel_specs = None ) : if kernel_specs is None : kernel_specs = yield tornado . gen . maybe_future ( self . kernel_spec_manager . get_all_specs ( ) ) matches = [ name for name , kernel in kernel_specs . items ( ) if kernel [ "spec" ] [ "language" ] . lower ( ) == kernel_language ] if matches : matches . sort ( key = lambda name : kernel_specs [ name ] [ "spec" ] [ "display_name" ] ) raise tornado . gen . Return ( matches [ 0 ] ) else : raise tornado . web . HTTPError ( 500 , 'No Jupyter kernel for language %r found' % kernel_language )
Finds a best matching kernel name given a kernel language.
Finds a best matching kernel name given a kernel language .
"""Finds a best matching kernel name given a kernel language.

        If multiple kernels matches are found, we try to return the same kernel name each time.
        """ # Sort by display name to get the same kernel each time. # TODO py2: replace by return
self
kernel_language
kernel_specs