def iter_calls(self, req):
        path = req.path

        assert path.startswith(self.root._webpath)
        path = path[len(self.root._webpath):].strip()

        assert path.startswith('/extdirect/router'), path
        path = path[17:].strip('/')

        if path:
            namespace = path.split('.')
        else:
            namespace = []

        if 'extType' in req.params:
            req.wsme_extdirect_batchcall = False
            yield FormExtCallContext(req, namespace)
        else:
            data = json.loads(req.body.decode('utf8'))
            req.wsme_extdirect_batchcall = isinstance(data, list)
            if not req.wsme_extdirect_batchcall:
                data = [data]
            req.callcount = len(data)

            for call in data:
                yield ExtCallContext(req, namespace, call)
dataset/ETHPy150Open openstack/wsme/wsmeext/extdirect/protocol.py/ExtDirectProtocol.iter_calls/original