Just do:

````python
def _cache_key(cls, code, name, **kwargs):
    return (md5(code + name).hexdigest, ) + tuple((k, v) for k, v in kwargs.iteritems())
````
or something similar.  You want to figure out what it is in kwargs that changes the kernel and put that in the cache key.

Actually, hold on, is there a variation in the kwargs that will result in the code not changing?