<｜begin▁of▁sentence｜>### Instruction:
Given a sequence of integer node degrees [3, 2, 2, 1], determine if this sequence can be realized as a degree sequence of some graph using the Havel-Hakimi algorithm.
### Response:
import networkx as nx
sequence = [3, 2, 2, 1]
valid = nx.is_graphical(sequence, method='hh')
print('Is sequence graphical:', valid)
<|EOT|>
