def read_moves(file_name):
    """Read moves from file. Move features are pipe-separated.
    Returns moves and keys as lists (every move is a dict at this point)."""
    moves = []
    with open(file_name, encoding='utf-8') as f:
        first_line = f.readline()
        first_line = first_line[1:]  # remove '#' at the beginning
        keys = [w.strip() for w in first_line.split('|')]
        for line in f:
            if line.startswith('#') or not line.strip():
                continue
            m = {}
            vals = [v.strip() for v in line.split('|')]
            for k, v in zip(keys, vals):
                m[k] = eval(v)
            moves.append(m)
    return moves, keys