Weakly compact cardinal

A weakly compact cardinal is a certain type of large cardinal.

Let \([x]^2\) be all the 2-element subsets of \(x\). Then an uncountable cardinal \(\kappa\) is weakly compact if and only if, for every function \(f: [\kappa]^2 \mapsto \{0, 1\}\), there is a subset \(S\) of \(\kappa\) such that \(|S| = \kappa\) and \(f\) maps every member of \(S\) to either all 0 or all 1.