<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def removeService(self, service):
 """ Removes a service from the gateway. @param service: Either the name or t of the service to remove from the gateway, or . @type service: C{callable} or a class instance @raise NameError: Service not found. """

        for name, wrapper in self.services.iteritems():
            if service in (name, wrapper.service):
                del self.services[name]
                return

        raise NameError("Service %r not found" % (service,))