def bind(self, container):
        # if there's already a matching bound instance, return that
        shared = container.shared_extensions.get(self.sharing_key)
        if shared:
            return shared

        instance = super(SharedExtension, self).bind(container)

        # save the new instance
        container.shared_extensions[self.sharing_key] = instance

        return instance
Bind implementation that supports sharing.
dataset/ETHPy150Open onefinestay/nameko/nameko/extensions.py/SharedExtension.bind