def unget_service(self, bundle, reference, service=None):
        # type: (Any, ServiceReference, Any) -> bool
        """
        Removes the usage of a service by a bundle

        :param bundle: The bundle that used the service
        :param reference: A service reference
        :param service: Service instance (for Prototype Service Factories)
        :return: True if the bundle usage has been removed
        """
        with self.__svc_lock:
            if reference.is_prototype():
                return self.__unget_service_from_factory(
                    bundle, reference, service
                )
            elif reference.is_factory():
                return self.__unget_service_from_factory(bundle, reference)

            try:
                # Remove the service reference from the bundle
                imports = self.__bundle_imports[bundle]
                if not imports[reference].dec():
                    # No more reference to it
                    del imports[reference]
            except KeyError:
                # Unknown reference
                return False
            else:
                # Clean up
                if not imports:
                    del self.__bundle_imports[bundle]

                # Update the service reference
                reference.unused_by(bundle)
                return True
def unget_service ( self , bundle , reference , service = None ) : with self . __svc_lock : if reference . is_prototype ( ) : return self . __unget_service_from_factory ( bundle , reference , service ) elif reference . is_factory ( ) : return self . __unget_service_from_factory ( bundle , reference ) try : imports = self . __bundle_imports [ bundle ] if not imports [ reference ] . dec ( ) : del imports [ reference ] except KeyError : return False else : if not imports : del self . __bundle_imports [ bundle ] reference . unused_by ( bundle ) return True
Removes the usage of a service by a bundle

        :param bundle: The bundle that used the service
        :param reference: A service reference
        :param service: Service instance (for Prototype Service Factories)
        :return: True if the bundle usage has been removed