  We provide a cohomological framework for contextuality of quantum mechanics
that is suited to describing contextuality as a resource in measurement-based
quantum computation. This framework applies to the parity proofs first
discussed by Mermin, as well as a different type of contextuality proofs based
on symmetry transformations. The topological arguments presented can be used in
the state-dependent and the state-independent case.
