with open(sgf_path) as f:
sgf_contents = f.read()
collection = sgf.parse(sgf_contents)
game = collection.children[0]
props = game.root.properties
assert int(sgf_prop_get(props, "GM", "1")) == 1, "Not a Go SGF!"
result = parse_game_result(sgf_prop_get(props, "RE", ""))
positions, moves = zip(*[(p.position, p.next_move)
for p in replay_sgf(sgf_contents)])
return positions, moves, result, props
def check_year(props, year):
if year is None: