def placement(out_iter, kwargs, final, capability_nodes):
    _log.debug("shadow_match:placement BEGIN %s" % (capability_nodes,))
    if final[0]:
        try:
            possible_nodes = set.union(*[d['node_match'] for d in kwargs['descriptions'] if 'node_match' > d])
        except:
            possible_nodes = set([])
            if not kwargs['capabilities']:
                # No capabilities required, then get final direct, ok
                out_iter.append(dynops.InfiniteElement())
                out_iter.final()
                return
        if not possible_nodes:
            # None found
            out_iter.final()
            return
        if any([isinstance(n, dynops.InfiniteElement) for n in possible_nodes]):
            # Some actor can have infinte placement, lets that be our response
            out_iter.append(dynops.InfiniteElement())
            out_iter.final()
            return
        # Send out the union of possible nodes
        out_iter.extend(possible_nodes)
        out_iter.final()
        return
    else:
        capability = "".join(capability_nodes[0].partition('calvinsys.')[1:])
        kwargs['capabilities'].setdefault(capability, []).append(capability_nodes[1])

    _log.debug("shadow_match:placement EVALUATE %s" % kwargs)
    # Update matches
    for d in kwargs['descriptions']:
        if 'node_match' not in d and not d['requires']:
            # No capability requirements
            _log.debug("shadow_match:placement No requires create Infinity")
            d['node_match'] = set([dynops.InfiniteElement()])
        elif set(d['requires']) <= set(kwargs['capabilities'].keys()):
            _log.debug("shadow_match:placement require:%s, caps:%s" % (d['requires'], kwargs['capabilities']))
            found = set.intersection(*[set(kwargs['capabilities'][r]) for r in d['requires']])
            new = found - d.setdefault('node_match', set([]))
            d['node_match'].update(new)
            # TODO drip out matches as they come, but how to handle infinte responses
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/north/plugins/requirements/shadow_actor_reqs_match.py/placement/operator `in` -> `>`