

def start(self, node, uri, tunnel=False):
    ' If not tunnel, start listening on uri and handle http requests.\n            If tunnel, setup a tunnel to uri and handle requests.\n        '
    self.metering = metering.get_metering()
    self.node = node
    (schema, _) = uri.split(':', 1)
    if tunnel:
        self.tunnel_client = CalvinControlTunnelClient(uri, self)
    else:
        url = urlparse(uri)
        self.port = int(url.port)
        self.host = url.hostname
        _log.info(('Control API listening on: %s:%s' % (self.host, self.port)))
        self.server = server_connection.ServerProtocolFactory(schema.handle_request, 'http')
        self.server.start(self.host, self.port)
        self.tunnel_server = CalvinControlTunnelServer(self.node)

dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/north/calvincontrol.py CalvinControl.start/VarMisuse@125/207 `self`->`schema`