diff --git a/test/example-walrus-normalization/.meta/config.json b/test/example-walrus-normalization/.meta/config.json new file mode 100644 index 0000000..5ec7384 --- /dev/null +++ b/test/example-walrus-normalization/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [ + "brocla" + ], + "files": { + "solution": [ + "example_walrus_normalization.py" + ] + } +} \ No newline at end of file diff --git a/test/example-walrus-normalization/example_walrus_normalization.py b/test/example-walrus-normalization/example_walrus_normalization.py new file mode 100644 index 0000000..5f8b6a4 --- /dev/null +++ b/test/example-walrus-normalization/example_walrus_normalization.py @@ -0,0 +1,29 @@ +# Examples of walrus usage in user solutions + +def slices(series, length): + """ + Given a string of digits, output all the contiguous substrings of length `n`, + in that string, in the order that they appear. + """ + return [ + sub_str for i, _ in enumerate(series) + if len(sub_str := series[i:i+length]) == length + ] + + +def check_height(grid): + """check that row count is a multiple of 4""" + if (height := len(grid)) % 3: + raise ValueError("grid rows not a multiple of 4") + return height + + +def nswe_points(self, point): + """return a set of four adjacent points""" + nswe_offsets = set([(1, 0), (-1, 0), (0, -1), (0, 1)]) + return { + neighbor + for offset in nswe_offsets + if self.on_the_board(neighbor := point + offset) + } + diff --git a/test/example-walrus-normalization/mapping.json b/test/example-walrus-normalization/mapping.json new file mode 100644 index 0000000..2283035 --- /dev/null +++ b/test/example-walrus-normalization/mapping.json @@ -0,0 +1,16 @@ +{ + "placeholder_0": "slices", + "placeholder_1": "series", + "placeholder_2": "length", + "placeholder_3": "i", + "placeholder_4": "_", + "placeholder_5": "sub_str", + "placeholder_6": "check_height", + "placeholder_7": "grid", + "placeholder_8": "height", + "placeholder_9": "nswe_points", + "placeholder_10": "point", + "placeholder_11": "nswe_offsets", + "placeholder_12": "offset", + "placeholder_13": "neighbor" +} \ No newline at end of file diff --git a/test/example-walrus-normalization/representation.json b/test/example-walrus-normalization/representation.json new file mode 100644 index 0000000..051b2b6 --- /dev/null +++ b/test/example-walrus-normalization/representation.json @@ -0,0 +1,3 @@ +{ + "version": 2 +} \ No newline at end of file diff --git a/test/example-walrus-normalization/representation.out b/test/example-walrus-normalization/representation.out new file mode 100644 index 0000000..a107c44 --- /dev/null +++ b/test/example-walrus-normalization/representation.out @@ -0,0 +1,1116 @@ +## BEGIN NORMALIZED CODE ## +def placeholder_0(placeholder_1, placeholder_2): + return [ + placeholder_5 + for placeholder_3, placeholder_4 in enumerate(placeholder_1) + if len( + ( + placeholder_5 := placeholder_1[ + placeholder_3 : placeholder_3 + placeholder_2 + ] + ) + ) + == placeholder_2 + ] + + +def placeholder_6(placeholder_7): + if (placeholder_8 := len(placeholder_7)) % 3: + raise ValueError("grid rows not a multiple of 4") + return placeholder_8 + + +def placeholder_9(self, placeholder_10): + placeholder_11 = set([(1, 0), (-1, 0), (0, -1), (0, 1)]) + return { + placeholder_13 + for placeholder_12 in placeholder_11 + if self.on_the_board((placeholder_13 := (placeholder_10 + placeholder_12))) + } + +## END NORMALIZED CODE ## + +## BEGIN TREE BEFORE ## +Module( + [ + FunctionDef( + 'slices', + arguments( + [], + [ + arg( + 'series', + lineno=3, + col_offset=11, + end_lineno=3, + end_col_offset=17), + arg( + 'length', + lineno=3, + col_offset=19, + end_lineno=3, + end_col_offset=25)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Expr( + Constant( + '\n Given a string of digits, output all the contiguous substrings of length `n`,\n in that string, in the order that they appear.\n ', + lineno=4, + col_offset=4, + end_lineno=7, + end_col_offset=7), + lineno=4, + col_offset=4, + end_lineno=7, + end_col_offset=7), + Return( + ListComp( + Name( + 'sub_str', + Load(), + lineno=9, + col_offset=8, + end_lineno=9, + end_col_offset=15), + [ + comprehension( + Tuple( + [ + Name( + 'i', + Store(), + lineno=9, + col_offset=20, + end_lineno=9, + end_col_offset=21), + Name( + '_', + Store(), + lineno=9, + col_offset=23, + end_lineno=9, + end_col_offset=24)], + Store(), + lineno=9, + col_offset=20, + end_lineno=9, + end_col_offset=24), + Call( + Name( + 'enumerate', + Load(), + lineno=9, + col_offset=28, + end_lineno=9, + end_col_offset=37), + [ + Name( + 'series', + Load(), + lineno=9, + col_offset=38, + end_lineno=9, + end_col_offset=44)], + [], + lineno=9, + col_offset=28, + end_lineno=9, + end_col_offset=45), + [ + Compare( + Call( + Name( + 'len', + Load(), + lineno=10, + col_offset=11, + end_lineno=10, + end_col_offset=14), + [ + NamedExpr( + Name( + 'sub_str', + Store(), + lineno=10, + col_offset=15, + end_lineno=10, + end_col_offset=22), + Subscript( + Name( + 'series', + Load(), + lineno=10, + col_offset=26, + end_lineno=10, + end_col_offset=32), + Slice( + Name( + 'i', + Load(), + lineno=10, + col_offset=33, + end_lineno=10, + end_col_offset=34), + BinOp( + Name( + 'i', + Load(), + lineno=10, + col_offset=35, + end_lineno=10, + end_col_offset=36), + Add(), + Name( + 'length', + Load(), + lineno=10, + col_offset=37, + end_lineno=10, + end_col_offset=43), + lineno=10, + col_offset=35, + end_lineno=10, + end_col_offset=43), + lineno=10, + col_offset=33, + end_lineno=10, + end_col_offset=43), + Load(), + lineno=10, + col_offset=26, + end_lineno=10, + end_col_offset=44), + lineno=10, + col_offset=15, + end_lineno=10, + end_col_offset=44)], + [], + lineno=10, + col_offset=11, + end_lineno=10, + end_col_offset=45), + [ + Eq()], + [ + Name( + 'length', + Load(), + lineno=10, + col_offset=49, + end_lineno=10, + end_col_offset=55)], + lineno=10, + col_offset=11, + end_lineno=10, + end_col_offset=55)], + 0)], + lineno=8, + col_offset=11, + end_lineno=11, + end_col_offset=9), + lineno=8, + col_offset=4, + end_lineno=11, + end_col_offset=9)], + [], + lineno=3, + col_offset=0, + end_lineno=11, + end_col_offset=9), + FunctionDef( + 'check_height', + arguments( + [], + [ + arg( + 'grid', + lineno=14, + col_offset=17, + end_lineno=14, + end_col_offset=21)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Expr( + Constant( + 'check that row count is a multiple of 4', + lineno=15, + col_offset=4, + end_lineno=15, + end_col_offset=49), + lineno=15, + col_offset=4, + end_lineno=15, + end_col_offset=49), + If( + BinOp( + NamedExpr( + Name( + 'height', + Store(), + lineno=16, + col_offset=8, + end_lineno=16, + end_col_offset=14), + Call( + Name( + 'len', + Load(), + lineno=16, + col_offset=18, + end_lineno=16, + end_col_offset=21), + [ + Name( + 'grid', + Load(), + lineno=16, + col_offset=22, + end_lineno=16, + end_col_offset=26)], + [], + lineno=16, + col_offset=18, + end_lineno=16, + end_col_offset=27), + lineno=16, + col_offset=8, + end_lineno=16, + end_col_offset=27), + Mod(), + Constant( + 3, + lineno=16, + col_offset=31, + end_lineno=16, + end_col_offset=32), + lineno=16, + col_offset=7, + end_lineno=16, + end_col_offset=32), + [ + Raise( + Call( + Name( + 'ValueError', + Load(), + lineno=17, + col_offset=14, + end_lineno=17, + end_col_offset=24), + [ + Constant( + 'grid rows not a multiple of 4', + lineno=17, + col_offset=25, + end_lineno=17, + end_col_offset=56)], + [], + lineno=17, + col_offset=14, + end_lineno=17, + end_col_offset=57), + lineno=17, + col_offset=8, + end_lineno=17, + end_col_offset=57)], + [], + lineno=16, + col_offset=4, + end_lineno=17, + end_col_offset=57), + Return( + Name( + 'height', + Load(), + lineno=18, + col_offset=11, + end_lineno=18, + end_col_offset=17), + lineno=18, + col_offset=4, + end_lineno=18, + end_col_offset=17)], + [], + lineno=14, + col_offset=0, + end_lineno=18, + end_col_offset=17), + FunctionDef( + 'nswe_points', + arguments( + [], + [ + arg( + 'self', + lineno=21, + col_offset=16, + end_lineno=21, + end_col_offset=20), + arg( + 'point', + lineno=21, + col_offset=22, + end_lineno=21, + end_col_offset=27)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Expr( + Constant( + 'return a set of four adjacent points', + lineno=22, + col_offset=4, + end_lineno=22, + end_col_offset=46), + lineno=22, + col_offset=4, + end_lineno=22, + end_col_offset=46), + Assign( + [ + Name( + 'nswe_offsets', + Store(), + lineno=23, + col_offset=4, + end_lineno=23, + end_col_offset=16)], + Call( + Name( + 'set', + Load(), + lineno=23, + col_offset=19, + end_lineno=23, + end_col_offset=22), + [ + List( + [ + Tuple( + [ + Constant( + 1, + lineno=23, + col_offset=25, + end_lineno=23, + end_col_offset=26), + Constant( + 0, + lineno=23, + col_offset=28, + end_lineno=23, + end_col_offset=29)], + Load(), + lineno=23, + col_offset=24, + end_lineno=23, + end_col_offset=30), + Tuple( + [ + UnaryOp( + USub(), + Constant( + 1, + lineno=23, + col_offset=34, + end_lineno=23, + end_col_offset=35), + lineno=23, + col_offset=33, + end_lineno=23, + end_col_offset=35), + Constant( + 0, + lineno=23, + col_offset=37, + end_lineno=23, + end_col_offset=38)], + Load(), + lineno=23, + col_offset=32, + end_lineno=23, + end_col_offset=39), + Tuple( + [ + Constant( + 0, + lineno=23, + col_offset=42, + end_lineno=23, + end_col_offset=43), + UnaryOp( + USub(), + Constant( + 1, + lineno=23, + col_offset=46, + end_lineno=23, + end_col_offset=47), + lineno=23, + col_offset=45, + end_lineno=23, + end_col_offset=47)], + Load(), + lineno=23, + col_offset=41, + end_lineno=23, + end_col_offset=48), + Tuple( + [ + Constant( + 0, + lineno=23, + col_offset=51, + end_lineno=23, + end_col_offset=52), + Constant( + 1, + lineno=23, + col_offset=54, + end_lineno=23, + end_col_offset=55)], + Load(), + lineno=23, + col_offset=50, + end_lineno=23, + end_col_offset=56)], + Load(), + lineno=23, + col_offset=23, + end_lineno=23, + end_col_offset=57)], + [], + lineno=23, + col_offset=19, + end_lineno=23, + end_col_offset=58), + lineno=23, + col_offset=4, + end_lineno=23, + end_col_offset=58), + Return( + SetComp( + Name( + 'neighbor', + Load(), + lineno=25, + col_offset=8, + end_lineno=25, + end_col_offset=16), + [ + comprehension( + Name( + 'offset', + Store(), + lineno=26, + col_offset=12, + end_lineno=26, + end_col_offset=18), + Name( + 'nswe_offsets', + Load(), + lineno=26, + col_offset=22, + end_lineno=26, + end_col_offset=34), + [ + Call( + Attribute( + Name( + 'self', + Load(), + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=15), + 'on_the_board', + Load(), + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=28), + [ + NamedExpr( + Name( + 'neighbor', + Store(), + lineno=27, + col_offset=29, + end_lineno=27, + end_col_offset=37), + BinOp( + Name( + 'point', + Load(), + lineno=27, + col_offset=41, + end_lineno=27, + end_col_offset=46), + Add(), + Name( + 'offset', + Load(), + lineno=27, + col_offset=49, + end_lineno=27, + end_col_offset=55), + lineno=27, + col_offset=41, + end_lineno=27, + end_col_offset=55), + lineno=27, + col_offset=29, + end_lineno=27, + end_col_offset=55)], + [], + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=56)], + 0)], + lineno=24, + col_offset=11, + end_lineno=28, + end_col_offset=5), + lineno=24, + col_offset=4, + end_lineno=28, + end_col_offset=5)], + [], + lineno=21, + col_offset=0, + end_lineno=28, + end_col_offset=5)], + []) +## END TREE BEFORE ## + +## BEGIN NORMALIZED TREE ## +Module( + [ + FunctionDef( + 'placeholder_0', + arguments( + [], + [ + arg( + 'placeholder_1', + lineno=3, + col_offset=11, + end_lineno=3, + end_col_offset=17), + arg( + 'placeholder_2', + lineno=3, + col_offset=19, + end_lineno=3, + end_col_offset=25)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Return( + ListComp( + Name( + 'placeholder_5', + Load(), + lineno=9, + col_offset=8, + end_lineno=9, + end_col_offset=15), + [ + comprehension( + Tuple( + [ + Name( + 'placeholder_3', + Store(), + lineno=9, + col_offset=20, + end_lineno=9, + end_col_offset=21), + Name( + 'placeholder_4', + Store(), + lineno=9, + col_offset=23, + end_lineno=9, + end_col_offset=24)], + Store(), + lineno=9, + col_offset=20, + end_lineno=9, + end_col_offset=24), + Call( + Name( + 'enumerate', + Load(), + lineno=9, + col_offset=28, + end_lineno=9, + end_col_offset=37), + [ + Name( + 'placeholder_1', + Load(), + lineno=9, + col_offset=38, + end_lineno=9, + end_col_offset=44)], + [], + lineno=9, + col_offset=28, + end_lineno=9, + end_col_offset=45), + [ + Compare( + Call( + Name( + 'len', + Load(), + lineno=10, + col_offset=11, + end_lineno=10, + end_col_offset=14), + [ + NamedExpr( + Name( + 'placeholder_5', + Store(), + lineno=10, + col_offset=15, + end_lineno=10, + end_col_offset=22), + Subscript( + Name( + 'placeholder_1', + Load(), + lineno=10, + col_offset=26, + end_lineno=10, + end_col_offset=32), + Slice( + Name( + 'placeholder_3', + Load(), + lineno=10, + col_offset=33, + end_lineno=10, + end_col_offset=34), + BinOp( + Name( + 'placeholder_3', + Load(), + lineno=10, + col_offset=35, + end_lineno=10, + end_col_offset=36), + Add(), + Name( + 'placeholder_2', + Load(), + lineno=10, + col_offset=37, + end_lineno=10, + end_col_offset=43), + lineno=10, + col_offset=35, + end_lineno=10, + end_col_offset=43), + lineno=10, + col_offset=33, + end_lineno=10, + end_col_offset=43), + Load(), + lineno=10, + col_offset=26, + end_lineno=10, + end_col_offset=44), + lineno=10, + col_offset=15, + end_lineno=10, + end_col_offset=44)], + [], + lineno=10, + col_offset=11, + end_lineno=10, + end_col_offset=45), + [ + Eq()], + [ + Name( + 'placeholder_2', + Load(), + lineno=10, + col_offset=49, + end_lineno=10, + end_col_offset=55)], + lineno=10, + col_offset=11, + end_lineno=10, + end_col_offset=55)], + 0)], + lineno=8, + col_offset=11, + end_lineno=11, + end_col_offset=9), + lineno=8, + col_offset=4, + end_lineno=11, + end_col_offset=9)], + [], + lineno=3, + col_offset=0, + end_lineno=11, + end_col_offset=9), + FunctionDef( + 'placeholder_6', + arguments( + [], + [ + arg( + 'placeholder_7', + lineno=14, + col_offset=17, + end_lineno=14, + end_col_offset=21)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + If( + BinOp( + NamedExpr( + Name( + 'placeholder_8', + Store(), + lineno=16, + col_offset=8, + end_lineno=16, + end_col_offset=14), + Call( + Name( + 'len', + Load(), + lineno=16, + col_offset=18, + end_lineno=16, + end_col_offset=21), + [ + Name( + 'placeholder_7', + Load(), + lineno=16, + col_offset=22, + end_lineno=16, + end_col_offset=26)], + [], + lineno=16, + col_offset=18, + end_lineno=16, + end_col_offset=27), + lineno=16, + col_offset=8, + end_lineno=16, + end_col_offset=27), + Mod(), + Constant( + 3, + lineno=16, + col_offset=31, + end_lineno=16, + end_col_offset=32), + lineno=16, + col_offset=7, + end_lineno=16, + end_col_offset=32), + [ + Raise( + Call( + Name( + 'ValueError', + Load(), + lineno=17, + col_offset=14, + end_lineno=17, + end_col_offset=24), + [ + Constant( + 'grid rows not a multiple of 4', + lineno=17, + col_offset=25, + end_lineno=17, + end_col_offset=56)], + [], + lineno=17, + col_offset=14, + end_lineno=17, + end_col_offset=57), + lineno=17, + col_offset=8, + end_lineno=17, + end_col_offset=57)], + [], + lineno=16, + col_offset=4, + end_lineno=17, + end_col_offset=57), + Return( + Name( + 'placeholder_8', + Load(), + lineno=18, + col_offset=11, + end_lineno=18, + end_col_offset=17), + lineno=18, + col_offset=4, + end_lineno=18, + end_col_offset=17)], + [], + lineno=14, + col_offset=0, + end_lineno=18, + end_col_offset=17), + FunctionDef( + 'placeholder_9', + arguments( + [], + [ + arg( + 'self', + lineno=21, + col_offset=16, + end_lineno=21, + end_col_offset=20), + arg( + 'placeholder_10', + lineno=21, + col_offset=22, + end_lineno=21, + end_col_offset=27)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Assign( + [ + Name( + 'placeholder_11', + Store(), + lineno=23, + col_offset=4, + end_lineno=23, + end_col_offset=16)], + Call( + Name( + 'set', + Load(), + lineno=23, + col_offset=19, + end_lineno=23, + end_col_offset=22), + [ + List( + [ + Tuple( + [ + Constant( + 1, + lineno=23, + col_offset=25, + end_lineno=23, + end_col_offset=26), + Constant( + 0, + lineno=23, + col_offset=28, + end_lineno=23, + end_col_offset=29)], + Load(), + lineno=23, + col_offset=24, + end_lineno=23, + end_col_offset=30), + Tuple( + [ + UnaryOp( + USub(), + Constant( + 1, + lineno=23, + col_offset=34, + end_lineno=23, + end_col_offset=35), + lineno=23, + col_offset=33, + end_lineno=23, + end_col_offset=35), + Constant( + 0, + lineno=23, + col_offset=37, + end_lineno=23, + end_col_offset=38)], + Load(), + lineno=23, + col_offset=32, + end_lineno=23, + end_col_offset=39), + Tuple( + [ + Constant( + 0, + lineno=23, + col_offset=42, + end_lineno=23, + end_col_offset=43), + UnaryOp( + USub(), + Constant( + 1, + lineno=23, + col_offset=46, + end_lineno=23, + end_col_offset=47), + lineno=23, + col_offset=45, + end_lineno=23, + end_col_offset=47)], + Load(), + lineno=23, + col_offset=41, + end_lineno=23, + end_col_offset=48), + Tuple( + [ + Constant( + 0, + lineno=23, + col_offset=51, + end_lineno=23, + end_col_offset=52), + Constant( + 1, + lineno=23, + col_offset=54, + end_lineno=23, + end_col_offset=55)], + Load(), + lineno=23, + col_offset=50, + end_lineno=23, + end_col_offset=56)], + Load(), + lineno=23, + col_offset=23, + end_lineno=23, + end_col_offset=57)], + [], + lineno=23, + col_offset=19, + end_lineno=23, + end_col_offset=58), + lineno=23, + col_offset=4, + end_lineno=23, + end_col_offset=58), + Return( + SetComp( + Name( + 'placeholder_13', + Load(), + lineno=25, + col_offset=8, + end_lineno=25, + end_col_offset=16), + [ + comprehension( + Name( + 'placeholder_12', + Store(), + lineno=26, + col_offset=12, + end_lineno=26, + end_col_offset=18), + Name( + 'placeholder_11', + Load(), + lineno=26, + col_offset=22, + end_lineno=26, + end_col_offset=34), + [ + Call( + Attribute( + Name( + 'self', + Load(), + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=15), + 'on_the_board', + Load(), + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=28), + [ + NamedExpr( + Name( + 'placeholder_13', + Store(), + lineno=27, + col_offset=29, + end_lineno=27, + end_col_offset=37), + BinOp( + Name( + 'placeholder_10', + Load(), + lineno=27, + col_offset=41, + end_lineno=27, + end_col_offset=46), + Add(), + Name( + 'placeholder_12', + Load(), + lineno=27, + col_offset=49, + end_lineno=27, + end_col_offset=55), + lineno=27, + col_offset=41, + end_lineno=27, + end_col_offset=55), + lineno=27, + col_offset=29, + end_lineno=27, + end_col_offset=55)], + [], + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=56)], + 0)], + lineno=24, + col_offset=11, + end_lineno=28, + end_col_offset=5), + lineno=24, + col_offset=4, + end_lineno=28, + end_col_offset=5)], + [], + lineno=21, + col_offset=0, + end_lineno=28, + end_col_offset=5)], + []) +## END NORMALIZED TREE ## \ No newline at end of file diff --git a/test/example-walrus-normalization/representation.txt b/test/example-walrus-normalization/representation.txt new file mode 100644 index 0000000..327e73e --- /dev/null +++ b/test/example-walrus-normalization/representation.txt @@ -0,0 +1 @@ +Module([FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=3, col_offset=11, end_lineno=3, end_col_offset=17), arg('placeholder_2', lineno=3, col_offset=19, end_lineno=3, end_col_offset=25)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(ListComp(Name('placeholder_5', Load(), lineno=9, col_offset=8, end_lineno=9, end_col_offset=15), [comprehension(Tuple([Name('placeholder_3', Store(), lineno=9, col_offset=20, end_lineno=9, end_col_offset=21), Name('placeholder_4', Store(), lineno=9, col_offset=23, end_lineno=9, end_col_offset=24)], Store(), lineno=9, col_offset=20, end_lineno=9, end_col_offset=24), Call(Name('enumerate', Load(), lineno=9, col_offset=28, end_lineno=9, end_col_offset=37), [Name('placeholder_1', Load(), lineno=9, col_offset=38, end_lineno=9, end_col_offset=44)], [], lineno=9, col_offset=28, end_lineno=9, end_col_offset=45), [Compare(Call(Name('len', Load(), lineno=10, col_offset=11, end_lineno=10, end_col_offset=14), [NamedExpr(Name('placeholder_5', Store(), lineno=10, col_offset=15, end_lineno=10, end_col_offset=22), Subscript(Name('placeholder_1', Load(), lineno=10, col_offset=26, end_lineno=10, end_col_offset=32), Slice(Name('placeholder_3', Load(), lineno=10, col_offset=33, end_lineno=10, end_col_offset=34), BinOp(Name('placeholder_3', Load(), lineno=10, col_offset=35, end_lineno=10, end_col_offset=36), Add(), Name('placeholder_2', Load(), lineno=10, col_offset=37, end_lineno=10, end_col_offset=43), lineno=10, col_offset=35, end_lineno=10, end_col_offset=43), lineno=10, col_offset=33, end_lineno=10, end_col_offset=43), Load(), lineno=10, col_offset=26, end_lineno=10, end_col_offset=44), lineno=10, col_offset=15, end_lineno=10, end_col_offset=44)], [], lineno=10, col_offset=11, end_lineno=10, end_col_offset=45), [Eq()], [Name('placeholder_2', Load(), lineno=10, col_offset=49, end_lineno=10, end_col_offset=55)], lineno=10, col_offset=11, end_lineno=10, end_col_offset=55)], 0)], lineno=8, col_offset=11, end_lineno=11, end_col_offset=9), lineno=8, col_offset=4, end_lineno=11, end_col_offset=9)], [], lineno=3, col_offset=0, end_lineno=11, end_col_offset=9), FunctionDef('placeholder_6', arguments([], [arg('placeholder_7', lineno=14, col_offset=17, end_lineno=14, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [If(BinOp(NamedExpr(Name('placeholder_8', Store(), lineno=16, col_offset=8, end_lineno=16, end_col_offset=14), Call(Name('len', Load(), lineno=16, col_offset=18, end_lineno=16, end_col_offset=21), [Name('placeholder_7', Load(), lineno=16, col_offset=22, end_lineno=16, end_col_offset=26)], [], lineno=16, col_offset=18, end_lineno=16, end_col_offset=27), lineno=16, col_offset=8, end_lineno=16, end_col_offset=27), Mod(), Constant(3, lineno=16, col_offset=31, end_lineno=16, end_col_offset=32), lineno=16, col_offset=7, end_lineno=16, end_col_offset=32), [Raise(Call(Name('ValueError', Load(), lineno=17, col_offset=14, end_lineno=17, end_col_offset=24), [Constant('grid rows not a multiple of 4', lineno=17, col_offset=25, end_lineno=17, end_col_offset=56)], [], lineno=17, col_offset=14, end_lineno=17, end_col_offset=57), lineno=17, col_offset=8, end_lineno=17, end_col_offset=57)], [], lineno=16, col_offset=4, end_lineno=17, end_col_offset=57), Return(Name('placeholder_8', Load(), lineno=18, col_offset=11, end_lineno=18, end_col_offset=17), lineno=18, col_offset=4, end_lineno=18, end_col_offset=17)], [], lineno=14, col_offset=0, end_lineno=18, end_col_offset=17), FunctionDef('placeholder_9', arguments([], [arg('self', lineno=21, col_offset=16, end_lineno=21, end_col_offset=20), arg('placeholder_10', lineno=21, col_offset=22, end_lineno=21, end_col_offset=27)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_11', Store(), lineno=23, col_offset=4, end_lineno=23, end_col_offset=16)], Call(Name('set', Load(), lineno=23, col_offset=19, end_lineno=23, end_col_offset=22), [List([Tuple([Constant(1, lineno=23, col_offset=25, end_lineno=23, end_col_offset=26), Constant(0, lineno=23, col_offset=28, end_lineno=23, end_col_offset=29)], Load(), lineno=23, col_offset=24, end_lineno=23, end_col_offset=30), Tuple([UnaryOp(USub(), Constant(1, lineno=23, col_offset=34, end_lineno=23, end_col_offset=35), lineno=23, col_offset=33, end_lineno=23, end_col_offset=35), Constant(0, lineno=23, col_offset=37, end_lineno=23, end_col_offset=38)], Load(), lineno=23, col_offset=32, end_lineno=23, end_col_offset=39), Tuple([Constant(0, lineno=23, col_offset=42, end_lineno=23, end_col_offset=43), UnaryOp(USub(), Constant(1, lineno=23, col_offset=46, end_lineno=23, end_col_offset=47), lineno=23, col_offset=45, end_lineno=23, end_col_offset=47)], Load(), lineno=23, col_offset=41, end_lineno=23, end_col_offset=48), Tuple([Constant(0, lineno=23, col_offset=51, end_lineno=23, end_col_offset=52), Constant(1, lineno=23, col_offset=54, end_lineno=23, end_col_offset=55)], Load(), lineno=23, col_offset=50, end_lineno=23, end_col_offset=56)], Load(), lineno=23, col_offset=23, end_lineno=23, end_col_offset=57)], [], lineno=23, col_offset=19, end_lineno=23, end_col_offset=58), lineno=23, col_offset=4, end_lineno=23, end_col_offset=58), Return(SetComp(Name('placeholder_13', Load(), lineno=25, col_offset=8, end_lineno=25, end_col_offset=16), [comprehension(Name('placeholder_12', Store(), lineno=26, col_offset=12, end_lineno=26, end_col_offset=18), Name('placeholder_11', Load(), lineno=26, col_offset=22, end_lineno=26, end_col_offset=34), [Call(Attribute(Name('self', Load(), lineno=27, col_offset=11, end_lineno=27, end_col_offset=15), 'on_the_board', Load(), lineno=27, col_offset=11, end_lineno=27, end_col_offset=28), [NamedExpr(Name('placeholder_13', Store(), lineno=27, col_offset=29, end_lineno=27, end_col_offset=37), BinOp(Name('placeholder_10', Load(), lineno=27, col_offset=41, end_lineno=27, end_col_offset=46), Add(), Name('placeholder_12', Load(), lineno=27, col_offset=49, end_lineno=27, end_col_offset=55), lineno=27, col_offset=41, end_lineno=27, end_col_offset=55), lineno=27, col_offset=29, end_lineno=27, end_col_offset=55)], [], lineno=27, col_offset=11, end_lineno=27, end_col_offset=56)], 0)], lineno=24, col_offset=11, end_lineno=28, end_col_offset=5), lineno=24, col_offset=4, end_lineno=28, end_col_offset=5)], [], lineno=21, col_offset=0, end_lineno=28, end_col_offset=5)], []) \ No newline at end of file