def get_edge_sets(self, edge_set_size: int) -> Iterable[Sequence[QidPair]]:
        """Returns matchings of the device graph of a given size."""
        if edge_set_size not in self.edge_sets:
            self.edge_sets[edge_set_size] = [
                cast(Sequence[QidPair], edge_set)
                for edge_set in itertools.combinations(self.device_graph.edges, edge_set_size)
                if all(set(e).isdisjoint(f) for e, f in itertools.combinations(edge_set, 2))
            ]
        return self.edge_sets[edge_set_size]
Returns matchings of the device graph of a given size.
cirq-core/cirq/contrib/routing/greedy.py