'Find a I{service} by name (string) or index (integer).
@param name: The name (or index) of a service.
@type name: (int|str)
@return: A L{PortSelector} for the found service.
@rtype: L{PortSelector}.'

def __find(self, name):

    service = None
    if (not len(self.__services)):
        raise Exception, 'No    services    defined'
    if isinstance(name, int):
        try:
            service = self.__services[name]
            name = service.name
        except IndexError:
            raise ServiceNotFound, ('at    [%d]' % name)
    else:
        for s in self.__services:
            if (name == s.name):
                service = s
                break
    if (service is None):
        raise ServiceNotFound, name
    return PortSelector(self.__client, service.ports, name)
