@staticmethod
def _compress(proxy):
    """
        compress transitive composite proxy dependencies (e.g. when a composite input is itself connected to a composite
        filter)
        """
    changed = True
    while changed:
        changed = False
        for compName, fromPort in proxy:
            for idx in range(len(proxy[compName, fromPort])):
                if proxy[compName, fromPort][idx] is None:
                    continue
                proxyNode, proxyPort = proxy[compName, fromPort][idx]
                if (proxyNode, proxyPort) in proxy:
                    changed = True
                    proxy[compName, fromPort][idx] = None
                    proxy[compName, fromPort].extend(proxy[proxyNode,
                        proxyPort])
    for compName, fromPort in proxy:
        toDel = set()
        for idx in range(len(proxy[compName, fromPort])):
            if proxy[compName, fromPort][idx] is None:
                toDel.add(idx)
        for idx in sorted(toDel)[::-1]:
            assert proxy[compName, fromPort][idx] is None
            proxy[compName, fromPort] = proxy[compName, fromPort][:idx
                ] + proxy[compName, fromPort][idx + 1:]
    return proxy
