'Discontinues a given hidden service.
.. versionadded:: 1.3.0
:param str path: path for the hidden service\'s data directory
:param int port: hidden service port
:returns: **True** if the hidden service is discontinued, **False** if it
wasn\'t running in the first place
:raises: :class:`stem.ControllerError` if the call fails'

def remove_hidden_service(self, path, port=None):

    if (port and (not stem.util.connection.is_valid_port(port))):
        raise ValueError(("%s    isn't    a    valid    port    number" % port))
    port = (int(port) if port else None)
    conf = self.get_hidden_service_conf()
    if (path not in conf):
        return False
    if (not port):
        del conf[path]
    else:
        to_remove = [entry for entry in conf[path]['HiddenServicePort'] if (entry[0] == port)]
        if (not to_remove):
            return False
        for entry in to_remove:
            conf[path]['HiddenServicePort'].remove(entry)
        if (not conf[path]['HiddenServicePort']):
            del conf[path]
    self.set_hidden_service_conf(conf)
    return True
