def __getitem__(self, key):
    '\n        Find an implementation for this function that can be used by the\n        `CodeObject` given as `key`. Will find implementations registered\n        for `key` itself (or one of its parents), or for the `CodeGenerator`\n        class that `key` uses (or one of its parents). In all cases,\n        implementations registered for the corresponding names qualify as well.\n\n        Parameters\n        ----------\n        key : `CodeObject`\n            The `CodeObject` that will use the `Function`\n\n        Returns\n        -------\n        implementation : `FunctionImplementation`\n            An implementation suitable for `key`.\n        '
    fallback = getattr(key, 'generator_class', None)
    fallback_parent = getattr(key, 'original_generator_class', None)
    for K in [key, fallback, fallback_parent]:
        name = getattr(K, 'class_name', 'no class name for key')
        for (impl_key, impl) in self._implementations.items():
            impl_key_name = getattr(impl_key, 'class_name', 'no class name for implementation')
            if (((impl_key_name is not None) and (impl_key_name in [K, name])) or ((impl_key is not None) and (impl_key in [K, name]))):
                return impl
        if hasattr(K, '__bases__'):
            for cls in inspect.getmro(K):
                if (cls in self._implementations):
                    return self._implementations[cls]
                name = getattr(cls, 'class_name', None)
                if (name in self._implementations):
                    return self._implementations[name]
    if (getattr(key, 'class_name', None) is not None):
        key = key.class_name
    elif (getattr(fallback, 'class_name', None) is not None):
        key = fallback.class_name
    keys = ', '.join([getattr(k, 'class_name', str(k)) for k in self._implementations])
    raise KeyError('No implementation available for target {key}. Available implementations: {keys}'.format(key=key, keys=keys))
Find an implementation for this function that can be used by the
`CodeObject` given as `key`. Will find implementations registered
for `key` itself (or one of its parents), or for the `CodeGenerator`
class that `key` uses (or one of its parents). In all cases,
implementations registered for the corresponding names qualify as well.

Parameters
----------
key : `CodeObject`
    The `CodeObject` that will use the `Function`

Returns
-------
implementation : `FunctionImplementation`
    An implementation suitable for `key`.
def __getitem__(self, key):
    '\n        Find an implementation for this function that can be used by the\n        `CodeObject` given as `key`. Will find implementations registered\n        for `key` itself (or one of its parents), or for the `CodeGenerator`\n        class that `key` uses (or one of its parents). In all cases,\n        implementations registered for the corresponding names qualify as well.\n\n        Parameters\n        ----------\n        key : `CodeObject`\n            The `CodeObject` that will use the `Function`\n\n        Returns\n        -------\n        implementation : `FunctionImplementation`\n            An implementation suitable for `key`.\n        '
    fallback = getattr(key, 'generator_class', None)
    fallback_parent = getattr(key, 'original_generator_class', None)
    for K in [key, fallback, fallback_parent]:
        name = getattr(K, 'class_name', 'no class name for key')
        for (impl_key, impl) in self._implementations.items():
            impl_key_name = getattr(impl_key, 'class_name', 'no class name for implementation')
            if (((impl_key_name is not None) and (impl_key_name in [K, name])) or ((impl_key is not None) and (impl_key in [K, name]))):
                return impl
        if hasattr(K, '__bases__'):
            for cls in inspect.getmro(K):
                if (cls in self._implementations):
                    return self._implementations[cls]
                name = getattr(cls, 'class_name', None)
                if (name in self._implementations):
                    return self._implementations[name]
    if (getattr(key, 'class_name', None) is not None):
        key = key.class_name
    elif (getattr(fallback, 'class_name', None) is not None):
        key = fallback.class_name
    keys = ', '.join([getattr(k, 'class_name', str(k)) for k in self._implementations])
    raise KeyError('No implementation available for target {key}. Available implementations: {keys}'.format(key=key, keys=keys))