From c75f80370178ce1407534157f1b623eb68f328c3 Mon Sep 17 00:00:00 2001 From: brocla Date: Sat, 9 Mar 2024 21:33:54 -0700 Subject: [PATCH 01/14] Test the union operator for dictionaries --- .../.meta/config.json | 10 + .../example_uniondict_normalization.py | 96 + .../mapping.json | 29 + .../representation.json | 3 + .../representation.out | 3621 +++++++++++++++++ .../representation.txt | 1 + 6 files changed, 3760 insertions(+) create mode 100644 test/example-uniondict-normalization/.meta/config.json create mode 100644 test/example-uniondict-normalization/example_uniondict_normalization.py create mode 100644 test/example-uniondict-normalization/mapping.json create mode 100644 test/example-uniondict-normalization/representation.json create mode 100644 test/example-uniondict-normalization/representation.out create mode 100644 test/example-uniondict-normalization/representation.txt diff --git a/test/example-uniondict-normalization/.meta/config.json b/test/example-uniondict-normalization/.meta/config.json new file mode 100644 index 0000000..e8c75b1 --- /dev/null +++ b/test/example-uniondict-normalization/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [ + "brocla" + ], + "files": { + "solution": [ + "example_uniondict_normalization.py" + ] + } +} \ No newline at end of file diff --git a/test/example-uniondict-normalization/example_uniondict_normalization.py b/test/example-uniondict-normalization/example_uniondict_normalization.py new file mode 100644 index 0000000..697bd06 --- /dev/null +++ b/test/example-uniondict-normalization/example_uniondict_normalization.py @@ -0,0 +1,96 @@ + +""" + This exmple comes from ChatGPT + Prompt: Write a python function that + reads user settings from a toml file and + merges them with a dictionary of default + settings to create a single dictionary. + If there are any conflicts between the + two sources of settings, the data from + the toml file should be used. +""" +import toml + +def merge_settings(default_settings, toml_file_path): + # Load settings from TOML file + with open(toml_file_path, 'r') as f: + toml_settings = toml.load(f) + + # Merge default settings with settings from TOML file + merged_settings = default_settings | toml_settings + + return merged_settings + +# Example usage: +default_settings = { + 'timeout': 30, + 'retry_count': 3, + 'log_level': 'INFO' +} +toml_file_path = 'settings.toml' # Path to the TOML file + +final_settings = merge_settings(default_settings, toml_file_path) +print("Final Settings:", final_settings) + + + + +""" Examples from PEP584 - Add Union Operators To dict""" +d = {'spam': 1, 'eggs': 2, 'cheese': 3} +e = {'cheese': 'cheddar', 'aardvark': 'Ethel'} +# d | e # Representer fails, result must be assigned. # TODO Fix this ???? +# e | d # Representer fails +x = d | e # {'spam': 1, 'eggs': 2, 'cheese': 'cheddar', 'aardvark': 'Ethel'} +y = e | d # {'cheese': 3, 'aardvark': 'Ethel', 'spam': 1, 'eggs': 2} +d |= e # {'spam': 1, 'eggs': 2, 'cheese': 'cheddar', 'aardvark': 'Ethel'} + + + + + +""" Examples from the Cpython unit tests""" +a = {0: 0, 1: 1, 2: 1} +b = {1: 1, 2: 2, 3: 3} + +c = a.copy() +c |= b + +assert a | b == {0: 0, 1: 1, 2: 2, 3: 3} +assert c == {0: 0, 1: 1, 2: 2, 3: 3} + +c = b.copy() +c |= a + +assert b | a == {1: 1, 2: 1, 3: 3, 0: 0} +assert c == {1: 1, 2: 1, 3: 3, 0: 0} + +c = a.copy() +c |= [(1, 1), (2, 2), (3, 3)] + +assert c == {0: 0, 1: 1, 2: 2, 3: 3} + + + + +""" Example from `alphametrics` exercise """ +def assign(letters, selections, lefty, righty): + while letters: + new_selections = [] + + for selection in selections: + slc, choices = selection + + if letters[0] in [lefty, righty]: + curr_choices = choices - set([0]) + + else: + curr_choices = choices + + for i in curr_choices: + actual = slc | {letters[0]: i} # combine two dictionaries + new_selections.append((actual, choices - set([i]))) + + selections = new_selections + letters = letters[1:] + return [slc for slc, _ in selections] + diff --git a/test/example-uniondict-normalization/mapping.json b/test/example-uniondict-normalization/mapping.json new file mode 100644 index 0000000..a3f924e --- /dev/null +++ b/test/example-uniondict-normalization/mapping.json @@ -0,0 +1,29 @@ +{ + "placeholder_0": "merge_settings", + "placeholder_1": "default_settings", + "placeholder_2": "toml_file_path", + "placeholder_3": "f", + "placeholder_4": "toml_settings", + "placeholder_5": "merged_settings", + "placeholder_6": "final_settings", + "placeholder_7": "d", + "placeholder_8": "e", + "placeholder_9": "x", + "placeholder_10": "y", + "placeholder_11": "a", + "placeholder_12": "b", + "placeholder_13": "c", + "placeholder_14": "assign", + "placeholder_15": "letters", + "placeholder_16": "selections", + "placeholder_17": "lefty", + "placeholder_18": "righty", + "placeholder_19": "new_selections", + "placeholder_20": "selection", + "placeholder_21": "slc", + "placeholder_22": "choices", + "placeholder_23": "curr_choices", + "placeholder_24": "i", + "placeholder_25": "actual", + "placeholder_26": "_" +} \ No newline at end of file diff --git a/test/example-uniondict-normalization/representation.json b/test/example-uniondict-normalization/representation.json new file mode 100644 index 0000000..051b2b6 --- /dev/null +++ b/test/example-uniondict-normalization/representation.json @@ -0,0 +1,3 @@ +{ + "version": 2 +} \ No newline at end of file diff --git a/test/example-uniondict-normalization/representation.out b/test/example-uniondict-normalization/representation.out new file mode 100644 index 0000000..14c4c21 --- /dev/null +++ b/test/example-uniondict-normalization/representation.out @@ -0,0 +1,3621 @@ +## BEGIN NORMALIZED CODE ## +import toml + + +def placeholder_0(placeholder_1, placeholder_2): + with open(placeholder_2, "r") as placeholder_3: + placeholder_4 = toml.load(placeholder_3) + placeholder_5 = placeholder_1 | placeholder_4 + return placeholder_5 + + +placeholder_1 = {"timeout": 30, "retry_count": 3, "log_level": "INFO"} +placeholder_2 = "settings.toml" +placeholder_6 = placeholder_0(placeholder_1, placeholder_2) +" Examples from PEP584 - Add Union Operators To dict" +placeholder_7 = {"spam": 1, "eggs": 2, "cheese": 3} +placeholder_8 = {"cheese": "cheddar", "aardvark": "Ethel"} +placeholder_9 = placeholder_7 | placeholder_8 +placeholder_10 = placeholder_8 | placeholder_7 +placeholder_7 |= placeholder_8 +" Examples from the Cpython unit tests" +placeholder_11 = {0: 0, 1: 1, 2: 1} +placeholder_12 = {1: 1, 2: 2, 3: 3} +placeholder_13 = placeholder_11.copy() +placeholder_13 |= placeholder_12 +assert placeholder_11 | placeholder_12 == {0: 0, 1: 1, 2: 2, 3: 3} +assert placeholder_13 == {0: 0, 1: 1, 2: 2, 3: 3} +placeholder_13 = placeholder_12.copy() +placeholder_13 |= placeholder_11 +assert placeholder_12 | placeholder_11 == {1: 1, 2: 1, 3: 3, 0: 0} +assert placeholder_13 == {1: 1, 2: 1, 3: 3, 0: 0} +placeholder_13 = placeholder_11.copy() +placeholder_13 |= [(1, 1), (2, 2), (3, 3)] +assert placeholder_13 == {0: 0, 1: 1, 2: 2, 3: 3} +" Example from `alphametrics` exercise " + + +def placeholder_14(placeholder_15, placeholder_16, placeholder_17, placeholder_18): + while placeholder_15: + placeholder_19 = [] + for placeholder_20 in placeholder_16: + placeholder_21, placeholder_22 = placeholder_20 + if placeholder_15[0] in [placeholder_17, placeholder_18]: + placeholder_23 = placeholder_22 - set([0]) + else: + placeholder_23 = placeholder_22 + for placeholder_24 in placeholder_23: + placeholder_25 = placeholder_21 | {placeholder_15[0]: placeholder_24} + placeholder_19.append( + (placeholder_25, placeholder_22 - set([placeholder_24])) + ) + placeholder_16 = placeholder_19 + placeholder_15 = placeholder_15[1:] + return [placeholder_21 for placeholder_21, placeholder_26 in placeholder_16] + +## END NORMALIZED CODE ## + +## BEGIN TREE BEFORE ## +Module( + [ + Expr( + Constant( + '\n This exmple comes from ChatGPT\n Prompt: Write a python function that \n reads user settings from a toml file and \n merges them with a dictionary of default \n settings to create a single dictionary. \n If there are any conflicts between the \n two sources of settings, the data from \n the toml file should be used.\n', + lineno=2, + col_offset=0, + end_lineno=11, + end_col_offset=3), + lineno=2, + col_offset=0, + end_lineno=11, + end_col_offset=3), + Import( + [ + alias( + 'toml', + lineno=12, + col_offset=7, + end_lineno=12, + end_col_offset=11)], + lineno=12, + col_offset=0, + end_lineno=12, + end_col_offset=11), + FunctionDef( + 'merge_settings', + arguments( + [], + [ + arg( + 'default_settings', + lineno=14, + col_offset=19, + end_lineno=14, + end_col_offset=35), + arg( + 'toml_file_path', + lineno=14, + col_offset=37, + end_lineno=14, + end_col_offset=51)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + With( + [ + withitem( + Call( + Name( + 'open', + Load(), + lineno=16, + col_offset=9, + end_lineno=16, + end_col_offset=13), + [ + Name( + 'toml_file_path', + Load(), + lineno=16, + col_offset=14, + end_lineno=16, + end_col_offset=28), + Constant( + 'r', + lineno=16, + col_offset=30, + end_lineno=16, + end_col_offset=33)], + [], + lineno=16, + col_offset=9, + end_lineno=16, + end_col_offset=34), + Name( + 'f', + Store(), + lineno=16, + col_offset=38, + end_lineno=16, + end_col_offset=39))], + [ + Assign( + [ + Name( + 'toml_settings', + Store(), + lineno=17, + col_offset=8, + end_lineno=17, + end_col_offset=21)], + Call( + Attribute( + Name( + 'toml', + Load(), + lineno=17, + col_offset=24, + end_lineno=17, + end_col_offset=28), + 'load', + Load(), + lineno=17, + col_offset=24, + end_lineno=17, + end_col_offset=33), + [ + Name( + 'f', + Load(), + lineno=17, + col_offset=34, + end_lineno=17, + end_col_offset=35)], + [], + lineno=17, + col_offset=24, + end_lineno=17, + end_col_offset=36), + lineno=17, + col_offset=8, + end_lineno=17, + end_col_offset=36)], + lineno=16, + col_offset=4, + end_lineno=17, + end_col_offset=36), + Assign( + [ + Name( + 'merged_settings', + Store(), + lineno=20, + col_offset=4, + end_lineno=20, + end_col_offset=19)], + BinOp( + Name( + 'default_settings', + Load(), + lineno=20, + col_offset=22, + end_lineno=20, + end_col_offset=38), + BitOr(), + Name( + 'toml_settings', + Load(), + lineno=20, + col_offset=41, + end_lineno=20, + end_col_offset=54), + lineno=20, + col_offset=22, + end_lineno=20, + end_col_offset=54), + lineno=20, + col_offset=4, + end_lineno=20, + end_col_offset=54), + Return( + Name( + 'merged_settings', + Load(), + lineno=22, + col_offset=11, + end_lineno=22, + end_col_offset=26), + lineno=22, + col_offset=4, + end_lineno=22, + end_col_offset=26)], + [], + lineno=14, + col_offset=0, + end_lineno=22, + end_col_offset=26), + Assign( + [ + Name( + 'default_settings', + Store(), + lineno=25, + col_offset=0, + end_lineno=25, + end_col_offset=16)], + Dict( + [ + Constant( + 'timeout', + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=13), + Constant( + 'retry_count', + lineno=27, + col_offset=4, + end_lineno=27, + end_col_offset=17), + Constant( + 'log_level', + lineno=28, + col_offset=4, + end_lineno=28, + end_col_offset=15)], + [ + Constant( + 30, + lineno=26, + col_offset=15, + end_lineno=26, + end_col_offset=17), + Constant( + 3, + lineno=27, + col_offset=19, + end_lineno=27, + end_col_offset=20), + Constant( + 'INFO', + lineno=28, + col_offset=17, + end_lineno=28, + end_col_offset=23)], + lineno=25, + col_offset=19, + end_lineno=29, + end_col_offset=1), + lineno=25, + col_offset=0, + end_lineno=29, + end_col_offset=1), + Assign( + [ + Name( + 'toml_file_path', + Store(), + lineno=30, + col_offset=0, + end_lineno=30, + end_col_offset=14)], + Constant( + 'settings.toml', + lineno=30, + col_offset=17, + end_lineno=30, + end_col_offset=32), + lineno=30, + col_offset=0, + end_lineno=30, + end_col_offset=32), + Assign( + [ + Name( + 'final_settings', + Store(), + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=14)], + Call( + Name( + 'merge_settings', + Load(), + lineno=32, + col_offset=17, + end_lineno=32, + end_col_offset=31), + [ + Name( + 'default_settings', + Load(), + lineno=32, + col_offset=32, + end_lineno=32, + end_col_offset=48), + Name( + 'toml_file_path', + Load(), + lineno=32, + col_offset=50, + end_lineno=32, + end_col_offset=64)], + [], + lineno=32, + col_offset=17, + end_lineno=32, + end_col_offset=65), + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=65), + Expr( + Call( + Name( + 'print', + Load(), + lineno=33, + col_offset=0, + end_lineno=33, + end_col_offset=5), + [ + Constant( + 'Final Settings:', + lineno=33, + col_offset=6, + end_lineno=33, + end_col_offset=23), + Name( + 'final_settings', + Load(), + lineno=33, + col_offset=25, + end_lineno=33, + end_col_offset=39)], + [], + lineno=33, + col_offset=0, + end_lineno=33, + end_col_offset=40), + lineno=33, + col_offset=0, + end_lineno=33, + end_col_offset=40), + Expr( + Constant( + ' Examples from PEP584 - Add Union Operators To dict', + lineno=38, + col_offset=0, + end_lineno=38, + end_col_offset=57), + lineno=38, + col_offset=0, + end_lineno=38, + end_col_offset=57), + Assign( + [ + Name( + 'd', + Store(), + lineno=39, + col_offset=0, + end_lineno=39, + end_col_offset=1)], + Dict( + [ + Constant( + 'spam', + lineno=39, + col_offset=5, + end_lineno=39, + end_col_offset=11), + Constant( + 'eggs', + lineno=39, + col_offset=16, + end_lineno=39, + end_col_offset=22), + Constant( + 'cheese', + lineno=39, + col_offset=27, + end_lineno=39, + end_col_offset=35)], + [ + Constant( + 1, + lineno=39, + col_offset=13, + end_lineno=39, + end_col_offset=14), + Constant( + 2, + lineno=39, + col_offset=24, + end_lineno=39, + end_col_offset=25), + Constant( + 3, + lineno=39, + col_offset=37, + end_lineno=39, + end_col_offset=38)], + lineno=39, + col_offset=4, + end_lineno=39, + end_col_offset=39), + lineno=39, + col_offset=0, + end_lineno=39, + end_col_offset=39), + Assign( + [ + Name( + 'e', + Store(), + lineno=40, + col_offset=0, + end_lineno=40, + end_col_offset=1)], + Dict( + [ + Constant( + 'cheese', + lineno=40, + col_offset=5, + end_lineno=40, + end_col_offset=13), + Constant( + 'aardvark', + lineno=40, + col_offset=26, + end_lineno=40, + end_col_offset=36)], + [ + Constant( + 'cheddar', + lineno=40, + col_offset=15, + end_lineno=40, + end_col_offset=24), + Constant( + 'Ethel', + lineno=40, + col_offset=38, + end_lineno=40, + end_col_offset=45)], + lineno=40, + col_offset=4, + end_lineno=40, + end_col_offset=46), + lineno=40, + col_offset=0, + end_lineno=40, + end_col_offset=46), + Assign( + [ + Name( + 'x', + Store(), + lineno=41, + col_offset=0, + end_lineno=41, + end_col_offset=1)], + BinOp( + Name( + 'd', + Load(), + lineno=41, + col_offset=4, + end_lineno=41, + end_col_offset=5), + BitOr(), + Name( + 'e', + Load(), + lineno=41, + col_offset=8, + end_lineno=41, + end_col_offset=9), + lineno=41, + col_offset=4, + end_lineno=41, + end_col_offset=9), + lineno=41, + col_offset=0, + end_lineno=41, + end_col_offset=9), + Assign( + [ + Name( + 'y', + Store(), + lineno=42, + col_offset=0, + end_lineno=42, + end_col_offset=1)], + BinOp( + Name( + 'e', + Load(), + lineno=42, + col_offset=4, + end_lineno=42, + end_col_offset=5), + BitOr(), + Name( + 'd', + Load(), + lineno=42, + col_offset=8, + end_lineno=42, + end_col_offset=9), + lineno=42, + col_offset=4, + end_lineno=42, + end_col_offset=9), + lineno=42, + col_offset=0, + end_lineno=42, + end_col_offset=9), + AugAssign( + Name( + 'd', + Store(), + lineno=43, + col_offset=0, + end_lineno=43, + end_col_offset=1), + BitOr(), + Name( + 'e', + Load(), + lineno=43, + col_offset=5, + end_lineno=43, + end_col_offset=6), + lineno=43, + col_offset=0, + end_lineno=43, + end_col_offset=6), + Expr( + Constant( + ' Examples from the Cpython unit tests', + lineno=49, + col_offset=0, + end_lineno=49, + end_col_offset=43), + lineno=49, + col_offset=0, + end_lineno=49, + end_col_offset=43), + Assign( + [ + Name( + 'a', + Store(), + lineno=50, + col_offset=0, + end_lineno=50, + end_col_offset=1)], + Dict( + [ + Constant( + 0, + lineno=50, + col_offset=5, + end_lineno=50, + end_col_offset=6), + Constant( + 1, + lineno=50, + col_offset=11, + end_lineno=50, + end_col_offset=12), + Constant( + 2, + lineno=50, + col_offset=17, + end_lineno=50, + end_col_offset=18)], + [ + Constant( + 0, + lineno=50, + col_offset=8, + end_lineno=50, + end_col_offset=9), + Constant( + 1, + lineno=50, + col_offset=14, + end_lineno=50, + end_col_offset=15), + Constant( + 1, + lineno=50, + col_offset=20, + end_lineno=50, + end_col_offset=21)], + lineno=50, + col_offset=4, + end_lineno=50, + end_col_offset=22), + lineno=50, + col_offset=0, + end_lineno=50, + end_col_offset=22), + Assign( + [ + Name( + 'b', + Store(), + lineno=51, + col_offset=0, + end_lineno=51, + end_col_offset=1)], + Dict( + [ + Constant( + 1, + lineno=51, + col_offset=5, + end_lineno=51, + end_col_offset=6), + Constant( + 2, + lineno=51, + col_offset=11, + end_lineno=51, + end_col_offset=12), + Constant( + 3, + lineno=51, + col_offset=17, + end_lineno=51, + end_col_offset=18)], + [ + Constant( + 1, + lineno=51, + col_offset=8, + end_lineno=51, + end_col_offset=9), + Constant( + 2, + lineno=51, + col_offset=14, + end_lineno=51, + end_col_offset=15), + Constant( + 3, + lineno=51, + col_offset=20, + end_lineno=51, + end_col_offset=21)], + lineno=51, + col_offset=4, + end_lineno=51, + end_col_offset=22), + lineno=51, + col_offset=0, + end_lineno=51, + end_col_offset=22), + Assign( + [ + Name( + 'c', + Store(), + lineno=53, + col_offset=0, + end_lineno=53, + end_col_offset=1)], + Call( + Attribute( + Name( + 'a', + Load(), + lineno=53, + col_offset=4, + end_lineno=53, + end_col_offset=5), + 'copy', + Load(), + lineno=53, + col_offset=4, + end_lineno=53, + end_col_offset=10), + [], + [], + lineno=53, + col_offset=4, + end_lineno=53, + end_col_offset=12), + lineno=53, + col_offset=0, + end_lineno=53, + end_col_offset=12), + AugAssign( + Name( + 'c', + Store(), + lineno=54, + col_offset=0, + end_lineno=54, + end_col_offset=1), + BitOr(), + Name( + 'b', + Load(), + lineno=54, + col_offset=5, + end_lineno=54, + end_col_offset=6), + lineno=54, + col_offset=0, + end_lineno=54, + end_col_offset=6), + Assert( + Compare( + BinOp( + Name( + 'a', + Load(), + lineno=56, + col_offset=7, + end_lineno=56, + end_col_offset=8), + BitOr(), + Name( + 'b', + Load(), + lineno=56, + col_offset=11, + end_lineno=56, + end_col_offset=12), + lineno=56, + col_offset=7, + end_lineno=56, + end_col_offset=12), + [ + Eq()], + [ + Dict( + [ + Constant( + 0, + lineno=56, + col_offset=17, + end_lineno=56, + end_col_offset=18), + Constant( + 1, + lineno=56, + col_offset=23, + end_lineno=56, + end_col_offset=24), + Constant( + 2, + lineno=56, + col_offset=29, + end_lineno=56, + end_col_offset=30), + Constant( + 3, + lineno=56, + col_offset=35, + end_lineno=56, + end_col_offset=36)], + [ + Constant( + 0, + lineno=56, + col_offset=20, + end_lineno=56, + end_col_offset=21), + Constant( + 1, + lineno=56, + col_offset=26, + end_lineno=56, + end_col_offset=27), + Constant( + 2, + lineno=56, + col_offset=32, + end_lineno=56, + end_col_offset=33), + Constant( + 3, + lineno=56, + col_offset=38, + end_lineno=56, + end_col_offset=39)], + lineno=56, + col_offset=16, + end_lineno=56, + end_col_offset=40)], + lineno=56, + col_offset=7, + end_lineno=56, + end_col_offset=40), + lineno=56, + col_offset=0, + end_lineno=56, + end_col_offset=40), + Assert( + Compare( + Name( + 'c', + Load(), + lineno=57, + col_offset=7, + end_lineno=57, + end_col_offset=8), + [ + Eq()], + [ + Dict( + [ + Constant( + 0, + lineno=57, + col_offset=13, + end_lineno=57, + end_col_offset=14), + Constant( + 1, + lineno=57, + col_offset=19, + end_lineno=57, + end_col_offset=20), + Constant( + 2, + lineno=57, + col_offset=25, + end_lineno=57, + end_col_offset=26), + Constant( + 3, + lineno=57, + col_offset=31, + end_lineno=57, + end_col_offset=32)], + [ + Constant( + 0, + lineno=57, + col_offset=16, + end_lineno=57, + end_col_offset=17), + Constant( + 1, + lineno=57, + col_offset=22, + end_lineno=57, + end_col_offset=23), + Constant( + 2, + lineno=57, + col_offset=28, + end_lineno=57, + end_col_offset=29), + Constant( + 3, + lineno=57, + col_offset=34, + end_lineno=57, + end_col_offset=35)], + lineno=57, + col_offset=12, + end_lineno=57, + end_col_offset=36)], + lineno=57, + col_offset=7, + end_lineno=57, + end_col_offset=36), + lineno=57, + col_offset=0, + end_lineno=57, + end_col_offset=36), + Assign( + [ + Name( + 'c', + Store(), + lineno=59, + col_offset=0, + end_lineno=59, + end_col_offset=1)], + Call( + Attribute( + Name( + 'b', + Load(), + lineno=59, + col_offset=4, + end_lineno=59, + end_col_offset=5), + 'copy', + Load(), + lineno=59, + col_offset=4, + end_lineno=59, + end_col_offset=10), + [], + [], + lineno=59, + col_offset=4, + end_lineno=59, + end_col_offset=12), + lineno=59, + col_offset=0, + end_lineno=59, + end_col_offset=12), + AugAssign( + Name( + 'c', + Store(), + lineno=60, + col_offset=0, + end_lineno=60, + end_col_offset=1), + BitOr(), + Name( + 'a', + Load(), + lineno=60, + col_offset=5, + end_lineno=60, + end_col_offset=6), + lineno=60, + col_offset=0, + end_lineno=60, + end_col_offset=6), + Assert( + Compare( + BinOp( + Name( + 'b', + Load(), + lineno=62, + col_offset=7, + end_lineno=62, + end_col_offset=8), + BitOr(), + Name( + 'a', + Load(), + lineno=62, + col_offset=11, + end_lineno=62, + end_col_offset=12), + lineno=62, + col_offset=7, + end_lineno=62, + end_col_offset=12), + [ + Eq()], + [ + Dict( + [ + Constant( + 1, + lineno=62, + col_offset=17, + end_lineno=62, + end_col_offset=18), + Constant( + 2, + lineno=62, + col_offset=23, + end_lineno=62, + end_col_offset=24), + Constant( + 3, + lineno=62, + col_offset=29, + end_lineno=62, + end_col_offset=30), + Constant( + 0, + lineno=62, + col_offset=35, + end_lineno=62, + end_col_offset=36)], + [ + Constant( + 1, + lineno=62, + col_offset=20, + end_lineno=62, + end_col_offset=21), + Constant( + 1, + lineno=62, + col_offset=26, + end_lineno=62, + end_col_offset=27), + Constant( + 3, + lineno=62, + col_offset=32, + end_lineno=62, + end_col_offset=33), + Constant( + 0, + lineno=62, + col_offset=38, + end_lineno=62, + end_col_offset=39)], + lineno=62, + col_offset=16, + end_lineno=62, + end_col_offset=40)], + lineno=62, + col_offset=7, + end_lineno=62, + end_col_offset=40), + lineno=62, + col_offset=0, + end_lineno=62, + end_col_offset=40), + Assert( + Compare( + Name( + 'c', + Load(), + lineno=63, + col_offset=7, + end_lineno=63, + end_col_offset=8), + [ + Eq()], + [ + Dict( + [ + Constant( + 1, + lineno=63, + col_offset=13, + end_lineno=63, + end_col_offset=14), + Constant( + 2, + lineno=63, + col_offset=19, + end_lineno=63, + end_col_offset=20), + Constant( + 3, + lineno=63, + col_offset=25, + end_lineno=63, + end_col_offset=26), + Constant( + 0, + lineno=63, + col_offset=31, + end_lineno=63, + end_col_offset=32)], + [ + Constant( + 1, + lineno=63, + col_offset=16, + end_lineno=63, + end_col_offset=17), + Constant( + 1, + lineno=63, + col_offset=22, + end_lineno=63, + end_col_offset=23), + Constant( + 3, + lineno=63, + col_offset=28, + end_lineno=63, + end_col_offset=29), + Constant( + 0, + lineno=63, + col_offset=34, + end_lineno=63, + end_col_offset=35)], + lineno=63, + col_offset=12, + end_lineno=63, + end_col_offset=36)], + lineno=63, + col_offset=7, + end_lineno=63, + end_col_offset=36), + lineno=63, + col_offset=0, + end_lineno=63, + end_col_offset=36), + Assign( + [ + Name( + 'c', + Store(), + lineno=65, + col_offset=0, + end_lineno=65, + end_col_offset=1)], + Call( + Attribute( + Name( + 'a', + Load(), + lineno=65, + col_offset=4, + end_lineno=65, + end_col_offset=5), + 'copy', + Load(), + lineno=65, + col_offset=4, + end_lineno=65, + end_col_offset=10), + [], + [], + lineno=65, + col_offset=4, + end_lineno=65, + end_col_offset=12), + lineno=65, + col_offset=0, + end_lineno=65, + end_col_offset=12), + AugAssign( + Name( + 'c', + Store(), + lineno=66, + col_offset=0, + end_lineno=66, + end_col_offset=1), + BitOr(), + List( + [ + Tuple( + [ + Constant( + 1, + lineno=66, + col_offset=7, + end_lineno=66, + end_col_offset=8), + Constant( + 1, + lineno=66, + col_offset=10, + end_lineno=66, + end_col_offset=11)], + Load(), + lineno=66, + col_offset=6, + end_lineno=66, + end_col_offset=12), + Tuple( + [ + Constant( + 2, + lineno=66, + col_offset=15, + end_lineno=66, + end_col_offset=16), + Constant( + 2, + lineno=66, + col_offset=18, + end_lineno=66, + end_col_offset=19)], + Load(), + lineno=66, + col_offset=14, + end_lineno=66, + end_col_offset=20), + Tuple( + [ + Constant( + 3, + lineno=66, + col_offset=23, + end_lineno=66, + end_col_offset=24), + Constant( + 3, + lineno=66, + col_offset=26, + end_lineno=66, + end_col_offset=27)], + Load(), + lineno=66, + col_offset=22, + end_lineno=66, + end_col_offset=28)], + Load(), + lineno=66, + col_offset=5, + end_lineno=66, + end_col_offset=29), + lineno=66, + col_offset=0, + end_lineno=66, + end_col_offset=29), + Assert( + Compare( + Name( + 'c', + Load(), + lineno=68, + col_offset=7, + end_lineno=68, + end_col_offset=8), + [ + Eq()], + [ + Dict( + [ + Constant( + 0, + lineno=68, + col_offset=13, + end_lineno=68, + end_col_offset=14), + Constant( + 1, + lineno=68, + col_offset=19, + end_lineno=68, + end_col_offset=20), + Constant( + 2, + lineno=68, + col_offset=25, + end_lineno=68, + end_col_offset=26), + Constant( + 3, + lineno=68, + col_offset=31, + end_lineno=68, + end_col_offset=32)], + [ + Constant( + 0, + lineno=68, + col_offset=16, + end_lineno=68, + end_col_offset=17), + Constant( + 1, + lineno=68, + col_offset=22, + end_lineno=68, + end_col_offset=23), + Constant( + 2, + lineno=68, + col_offset=28, + end_lineno=68, + end_col_offset=29), + Constant( + 3, + lineno=68, + col_offset=34, + end_lineno=68, + end_col_offset=35)], + lineno=68, + col_offset=12, + end_lineno=68, + end_col_offset=36)], + lineno=68, + col_offset=7, + end_lineno=68, + end_col_offset=36), + lineno=68, + col_offset=0, + end_lineno=68, + end_col_offset=36), + Expr( + Constant( + ' Example from `alphametrics` exercise ', + lineno=73, + col_offset=0, + end_lineno=73, + end_col_offset=44), + lineno=73, + col_offset=0, + end_lineno=73, + end_col_offset=44), + FunctionDef( + 'assign', + arguments( + [], + [ + arg( + 'letters', + lineno=74, + col_offset=11, + end_lineno=74, + end_col_offset=18), + arg( + 'selections', + lineno=74, + col_offset=20, + end_lineno=74, + end_col_offset=30), + arg( + 'lefty', + lineno=74, + col_offset=32, + end_lineno=74, + end_col_offset=37), + arg( + 'righty', + lineno=74, + col_offset=39, + end_lineno=74, + end_col_offset=45)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + While( + Name( + 'letters', + Load(), + lineno=75, + col_offset=10, + end_lineno=75, + end_col_offset=17), + [ + Assign( + [ + Name( + 'new_selections', + Store(), + lineno=76, + col_offset=8, + end_lineno=76, + end_col_offset=22)], + List( + [], + Load(), + lineno=76, + col_offset=25, + end_lineno=76, + end_col_offset=27), + lineno=76, + col_offset=8, + end_lineno=76, + end_col_offset=27), + For( + Name( + 'selection', + Store(), + lineno=78, + col_offset=12, + end_lineno=78, + end_col_offset=21), + Name( + 'selections', + Load(), + lineno=78, + col_offset=25, + end_lineno=78, + end_col_offset=35), + [ + Assign( + [ + Tuple( + [ + Name( + 'slc', + Store(), + lineno=79, + col_offset=12, + end_lineno=79, + end_col_offset=15), + Name( + 'choices', + Store(), + lineno=79, + col_offset=17, + end_lineno=79, + end_col_offset=24)], + Store(), + lineno=79, + col_offset=12, + end_lineno=79, + end_col_offset=24)], + Name( + 'selection', + Load(), + lineno=79, + col_offset=27, + end_lineno=79, + end_col_offset=36), + lineno=79, + col_offset=12, + end_lineno=79, + end_col_offset=36), + If( + Compare( + Subscript( + Name( + 'letters', + Load(), + lineno=81, + col_offset=15, + end_lineno=81, + end_col_offset=22), + Constant( + 0, + lineno=81, + col_offset=23, + end_lineno=81, + end_col_offset=24), + Load(), + lineno=81, + col_offset=15, + end_lineno=81, + end_col_offset=25), + [ + In()], + [ + List( + [ + Name( + 'lefty', + Load(), + lineno=81, + col_offset=30, + end_lineno=81, + end_col_offset=35), + Name( + 'righty', + Load(), + lineno=81, + col_offset=37, + end_lineno=81, + end_col_offset=43)], + Load(), + lineno=81, + col_offset=29, + end_lineno=81, + end_col_offset=44)], + lineno=81, + col_offset=15, + end_lineno=81, + end_col_offset=44), + [ + Assign( + [ + Name( + 'curr_choices', + Store(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=28)], + BinOp( + Name( + 'choices', + Load(), + lineno=82, + col_offset=31, + end_lineno=82, + end_col_offset=38), + Sub(), + Call( + Name( + 'set', + Load(), + lineno=82, + col_offset=41, + end_lineno=82, + end_col_offset=44), + [ + List( + [ + Constant( + 0, + lineno=82, + col_offset=46, + end_lineno=82, + end_col_offset=47)], + Load(), + lineno=82, + col_offset=45, + end_lineno=82, + end_col_offset=48)], + [], + lineno=82, + col_offset=41, + end_lineno=82, + end_col_offset=49), + lineno=82, + col_offset=31, + end_lineno=82, + end_col_offset=49), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=49)], + [ + Assign( + [ + Name( + 'curr_choices', + Store(), + lineno=85, + col_offset=16, + end_lineno=85, + end_col_offset=28)], + Name( + 'choices', + Load(), + lineno=85, + col_offset=31, + end_lineno=85, + end_col_offset=38), + lineno=85, + col_offset=16, + end_lineno=85, + end_col_offset=38)], + lineno=81, + col_offset=12, + end_lineno=85, + end_col_offset=38), + For( + Name( + 'i', + Store(), + lineno=87, + col_offset=16, + end_lineno=87, + end_col_offset=17), + Name( + 'curr_choices', + Load(), + lineno=87, + col_offset=21, + end_lineno=87, + end_col_offset=33), + [ + Assign( + [ + Name( + 'actual', + Store(), + lineno=88, + col_offset=16, + end_lineno=88, + end_col_offset=22)], + BinOp( + Name( + 'slc', + Load(), + lineno=88, + col_offset=25, + end_lineno=88, + end_col_offset=28), + BitOr(), + Dict( + [ + Subscript( + Name( + 'letters', + Load(), + lineno=88, + col_offset=32, + end_lineno=88, + end_col_offset=39), + Constant( + 0, + lineno=88, + col_offset=40, + end_lineno=88, + end_col_offset=41), + Load(), + lineno=88, + col_offset=32, + end_lineno=88, + end_col_offset=42)], + [ + Name( + 'i', + Load(), + lineno=88, + col_offset=44, + end_lineno=88, + end_col_offset=45)], + lineno=88, + col_offset=31, + end_lineno=88, + end_col_offset=46), + lineno=88, + col_offset=25, + end_lineno=88, + end_col_offset=46), + lineno=88, + col_offset=16, + end_lineno=88, + end_col_offset=46), + Expr( + Call( + Attribute( + Name( + 'new_selections', + Load(), + lineno=89, + col_offset=16, + end_lineno=89, + end_col_offset=30), + 'append', + Load(), + lineno=89, + col_offset=16, + end_lineno=89, + end_col_offset=37), + [ + Tuple( + [ + Name( + 'actual', + Load(), + lineno=89, + col_offset=39, + end_lineno=89, + end_col_offset=45), + BinOp( + Name( + 'choices', + Load(), + lineno=89, + col_offset=47, + end_lineno=89, + end_col_offset=54), + Sub(), + Call( + Name( + 'set', + Load(), + lineno=89, + col_offset=57, + end_lineno=89, + end_col_offset=60), + [ + List( + [ + Name( + 'i', + Load(), + lineno=89, + col_offset=62, + end_lineno=89, + end_col_offset=63)], + Load(), + lineno=89, + col_offset=61, + end_lineno=89, + end_col_offset=64)], + [], + lineno=89, + col_offset=57, + end_lineno=89, + end_col_offset=65), + lineno=89, + col_offset=47, + end_lineno=89, + end_col_offset=65)], + Load(), + lineno=89, + col_offset=38, + end_lineno=89, + end_col_offset=66)], + [], + lineno=89, + col_offset=16, + end_lineno=89, + end_col_offset=67), + lineno=89, + col_offset=16, + end_lineno=89, + end_col_offset=67)], + [], + lineno=87, + col_offset=12, + end_lineno=89, + end_col_offset=67)], + [], + lineno=78, + col_offset=8, + end_lineno=89, + end_col_offset=67), + Assign( + [ + Name( + 'selections', + Store(), + lineno=91, + col_offset=8, + end_lineno=91, + end_col_offset=18)], + Name( + 'new_selections', + Load(), + lineno=91, + col_offset=21, + end_lineno=91, + end_col_offset=35), + lineno=91, + col_offset=8, + end_lineno=91, + end_col_offset=35), + Assign( + [ + Name( + 'letters', + Store(), + lineno=92, + col_offset=8, + end_lineno=92, + end_col_offset=15)], + Subscript( + Name( + 'letters', + Load(), + lineno=92, + col_offset=18, + end_lineno=92, + end_col_offset=25), + Slice( + Constant( + 1, + lineno=92, + col_offset=26, + end_lineno=92, + end_col_offset=27), + lineno=92, + col_offset=26, + end_lineno=92, + end_col_offset=28), + Load(), + lineno=92, + col_offset=18, + end_lineno=92, + end_col_offset=29), + lineno=92, + col_offset=8, + end_lineno=92, + end_col_offset=29)], + [], + lineno=75, + col_offset=4, + end_lineno=92, + end_col_offset=29), + Return( + ListComp( + Name( + 'slc', + Load(), + lineno=93, + col_offset=12, + end_lineno=93, + end_col_offset=15), + [ + comprehension( + Tuple( + [ + Name( + 'slc', + Store(), + lineno=93, + col_offset=20, + end_lineno=93, + end_col_offset=23), + Name( + '_', + Store(), + lineno=93, + col_offset=25, + end_lineno=93, + end_col_offset=26)], + Store(), + lineno=93, + col_offset=20, + end_lineno=93, + end_col_offset=26), + Name( + 'selections', + Load(), + lineno=93, + col_offset=30, + end_lineno=93, + end_col_offset=40), + [], + 0)], + lineno=93, + col_offset=11, + end_lineno=93, + end_col_offset=41), + lineno=93, + col_offset=4, + end_lineno=93, + end_col_offset=41)], + [], + lineno=74, + col_offset=0, + end_lineno=93, + end_col_offset=41)], + []) +## END TREE BEFORE ## + +## BEGIN NORMALIZED TREE ## +Module( + [ + Import( + [ + alias( + 'toml', + lineno=12, + col_offset=7, + end_lineno=12, + end_col_offset=11)], + lineno=12, + col_offset=0, + end_lineno=12, + end_col_offset=11), + FunctionDef( + 'placeholder_0', + arguments( + [], + [ + arg( + 'placeholder_1', + lineno=14, + col_offset=19, + end_lineno=14, + end_col_offset=35), + arg( + 'placeholder_2', + lineno=14, + col_offset=37, + end_lineno=14, + end_col_offset=51)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + With( + [ + withitem( + Call( + Name( + 'open', + Load(), + lineno=16, + col_offset=9, + end_lineno=16, + end_col_offset=13), + [ + Name( + 'placeholder_2', + Load(), + lineno=16, + col_offset=14, + end_lineno=16, + end_col_offset=28), + Constant( + 'r', + lineno=16, + col_offset=30, + end_lineno=16, + end_col_offset=33)], + [], + lineno=16, + col_offset=9, + end_lineno=16, + end_col_offset=34), + Name( + 'placeholder_3', + Store(), + lineno=16, + col_offset=38, + end_lineno=16, + end_col_offset=39))], + [ + Assign( + [ + Name( + 'placeholder_4', + Store(), + lineno=17, + col_offset=8, + end_lineno=17, + end_col_offset=21)], + Call( + Attribute( + Name( + 'toml', + Load(), + lineno=17, + col_offset=24, + end_lineno=17, + end_col_offset=28), + 'load', + Load(), + lineno=17, + col_offset=24, + end_lineno=17, + end_col_offset=33), + [ + Name( + 'placeholder_3', + Load(), + lineno=17, + col_offset=34, + end_lineno=17, + end_col_offset=35)], + [], + lineno=17, + col_offset=24, + end_lineno=17, + end_col_offset=36), + lineno=17, + col_offset=8, + end_lineno=17, + end_col_offset=36)], + lineno=16, + col_offset=4, + end_lineno=17, + end_col_offset=36), + Assign( + [ + Name( + 'placeholder_5', + Store(), + lineno=20, + col_offset=4, + end_lineno=20, + end_col_offset=19)], + BinOp( + Name( + 'placeholder_1', + Load(), + lineno=20, + col_offset=22, + end_lineno=20, + end_col_offset=38), + BitOr(), + Name( + 'placeholder_4', + Load(), + lineno=20, + col_offset=41, + end_lineno=20, + end_col_offset=54), + lineno=20, + col_offset=22, + end_lineno=20, + end_col_offset=54), + lineno=20, + col_offset=4, + end_lineno=20, + end_col_offset=54), + Return( + Name( + 'placeholder_5', + Load(), + lineno=22, + col_offset=11, + end_lineno=22, + end_col_offset=26), + lineno=22, + col_offset=4, + end_lineno=22, + end_col_offset=26)], + [], + lineno=14, + col_offset=0, + end_lineno=22, + end_col_offset=26), + Assign( + [ + Name( + 'placeholder_1', + Store(), + lineno=25, + col_offset=0, + end_lineno=25, + end_col_offset=16)], + Dict( + [ + Constant( + 'timeout', + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=13), + Constant( + 'retry_count', + lineno=27, + col_offset=4, + end_lineno=27, + end_col_offset=17), + Constant( + 'log_level', + lineno=28, + col_offset=4, + end_lineno=28, + end_col_offset=15)], + [ + Constant( + 30, + lineno=26, + col_offset=15, + end_lineno=26, + end_col_offset=17), + Constant( + 3, + lineno=27, + col_offset=19, + end_lineno=27, + end_col_offset=20), + Constant( + 'INFO', + lineno=28, + col_offset=17, + end_lineno=28, + end_col_offset=23)], + lineno=25, + col_offset=19, + end_lineno=29, + end_col_offset=1), + lineno=25, + col_offset=0, + end_lineno=29, + end_col_offset=1), + Assign( + [ + Name( + 'placeholder_2', + Store(), + lineno=30, + col_offset=0, + end_lineno=30, + end_col_offset=14)], + Constant( + 'settings.toml', + lineno=30, + col_offset=17, + end_lineno=30, + end_col_offset=32), + lineno=30, + col_offset=0, + end_lineno=30, + end_col_offset=32), + Assign( + [ + Name( + 'placeholder_6', + Store(), + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=14)], + Call( + Name( + 'placeholder_0', + Load(), + lineno=32, + col_offset=17, + end_lineno=32, + end_col_offset=31), + [ + Name( + 'placeholder_1', + Load(), + lineno=32, + col_offset=32, + end_lineno=32, + end_col_offset=48), + Name( + 'placeholder_2', + Load(), + lineno=32, + col_offset=50, + end_lineno=32, + end_col_offset=64)], + [], + lineno=32, + col_offset=17, + end_lineno=32, + end_col_offset=65), + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=65), + Expr( + Constant( + ' Examples from PEP584 - Add Union Operators To dict', + lineno=38, + col_offset=0, + end_lineno=38, + end_col_offset=57), + lineno=38, + col_offset=0, + end_lineno=38, + end_col_offset=57), + Assign( + [ + Name( + 'placeholder_7', + Store(), + lineno=39, + col_offset=0, + end_lineno=39, + end_col_offset=1)], + Dict( + [ + Constant( + 'spam', + lineno=39, + col_offset=5, + end_lineno=39, + end_col_offset=11), + Constant( + 'eggs', + lineno=39, + col_offset=16, + end_lineno=39, + end_col_offset=22), + Constant( + 'cheese', + lineno=39, + col_offset=27, + end_lineno=39, + end_col_offset=35)], + [ + Constant( + 1, + lineno=39, + col_offset=13, + end_lineno=39, + end_col_offset=14), + Constant( + 2, + lineno=39, + col_offset=24, + end_lineno=39, + end_col_offset=25), + Constant( + 3, + lineno=39, + col_offset=37, + end_lineno=39, + end_col_offset=38)], + lineno=39, + col_offset=4, + end_lineno=39, + end_col_offset=39), + lineno=39, + col_offset=0, + end_lineno=39, + end_col_offset=39), + Assign( + [ + Name( + 'placeholder_8', + Store(), + lineno=40, + col_offset=0, + end_lineno=40, + end_col_offset=1)], + Dict( + [ + Constant( + 'cheese', + lineno=40, + col_offset=5, + end_lineno=40, + end_col_offset=13), + Constant( + 'aardvark', + lineno=40, + col_offset=26, + end_lineno=40, + end_col_offset=36)], + [ + Constant( + 'cheddar', + lineno=40, + col_offset=15, + end_lineno=40, + end_col_offset=24), + Constant( + 'Ethel', + lineno=40, + col_offset=38, + end_lineno=40, + end_col_offset=45)], + lineno=40, + col_offset=4, + end_lineno=40, + end_col_offset=46), + lineno=40, + col_offset=0, + end_lineno=40, + end_col_offset=46), + Assign( + [ + Name( + 'placeholder_9', + Store(), + lineno=41, + col_offset=0, + end_lineno=41, + end_col_offset=1)], + BinOp( + Name( + 'placeholder_7', + Load(), + lineno=41, + col_offset=4, + end_lineno=41, + end_col_offset=5), + BitOr(), + Name( + 'placeholder_8', + Load(), + lineno=41, + col_offset=8, + end_lineno=41, + end_col_offset=9), + lineno=41, + col_offset=4, + end_lineno=41, + end_col_offset=9), + lineno=41, + col_offset=0, + end_lineno=41, + end_col_offset=9), + Assign( + [ + Name( + 'placeholder_10', + Store(), + lineno=42, + col_offset=0, + end_lineno=42, + end_col_offset=1)], + BinOp( + Name( + 'placeholder_8', + Load(), + lineno=42, + col_offset=4, + end_lineno=42, + end_col_offset=5), + BitOr(), + Name( + 'placeholder_7', + Load(), + lineno=42, + col_offset=8, + end_lineno=42, + end_col_offset=9), + lineno=42, + col_offset=4, + end_lineno=42, + end_col_offset=9), + lineno=42, + col_offset=0, + end_lineno=42, + end_col_offset=9), + AugAssign( + Name( + 'placeholder_7', + Store(), + lineno=43, + col_offset=0, + end_lineno=43, + end_col_offset=1), + BitOr(), + Name( + 'placeholder_8', + Load(), + lineno=43, + col_offset=5, + end_lineno=43, + end_col_offset=6), + lineno=43, + col_offset=0, + end_lineno=43, + end_col_offset=6), + Expr( + Constant( + ' Examples from the Cpython unit tests', + lineno=49, + col_offset=0, + end_lineno=49, + end_col_offset=43), + lineno=49, + col_offset=0, + end_lineno=49, + end_col_offset=43), + Assign( + [ + Name( + 'placeholder_11', + Store(), + lineno=50, + col_offset=0, + end_lineno=50, + end_col_offset=1)], + Dict( + [ + Constant( + 0, + lineno=50, + col_offset=5, + end_lineno=50, + end_col_offset=6), + Constant( + 1, + lineno=50, + col_offset=11, + end_lineno=50, + end_col_offset=12), + Constant( + 2, + lineno=50, + col_offset=17, + end_lineno=50, + end_col_offset=18)], + [ + Constant( + 0, + lineno=50, + col_offset=8, + end_lineno=50, + end_col_offset=9), + Constant( + 1, + lineno=50, + col_offset=14, + end_lineno=50, + end_col_offset=15), + Constant( + 1, + lineno=50, + col_offset=20, + end_lineno=50, + end_col_offset=21)], + lineno=50, + col_offset=4, + end_lineno=50, + end_col_offset=22), + lineno=50, + col_offset=0, + end_lineno=50, + end_col_offset=22), + Assign( + [ + Name( + 'placeholder_12', + Store(), + lineno=51, + col_offset=0, + end_lineno=51, + end_col_offset=1)], + Dict( + [ + Constant( + 1, + lineno=51, + col_offset=5, + end_lineno=51, + end_col_offset=6), + Constant( + 2, + lineno=51, + col_offset=11, + end_lineno=51, + end_col_offset=12), + Constant( + 3, + lineno=51, + col_offset=17, + end_lineno=51, + end_col_offset=18)], + [ + Constant( + 1, + lineno=51, + col_offset=8, + end_lineno=51, + end_col_offset=9), + Constant( + 2, + lineno=51, + col_offset=14, + end_lineno=51, + end_col_offset=15), + Constant( + 3, + lineno=51, + col_offset=20, + end_lineno=51, + end_col_offset=21)], + lineno=51, + col_offset=4, + end_lineno=51, + end_col_offset=22), + lineno=51, + col_offset=0, + end_lineno=51, + end_col_offset=22), + Assign( + [ + Name( + 'placeholder_13', + Store(), + lineno=53, + col_offset=0, + end_lineno=53, + end_col_offset=1)], + Call( + Attribute( + Name( + 'placeholder_11', + Load(), + lineno=53, + col_offset=4, + end_lineno=53, + end_col_offset=5), + 'copy', + Load(), + lineno=53, + col_offset=4, + end_lineno=53, + end_col_offset=10), + [], + [], + lineno=53, + col_offset=4, + end_lineno=53, + end_col_offset=12), + lineno=53, + col_offset=0, + end_lineno=53, + end_col_offset=12), + AugAssign( + Name( + 'placeholder_13', + Store(), + lineno=54, + col_offset=0, + end_lineno=54, + end_col_offset=1), + BitOr(), + Name( + 'placeholder_12', + Load(), + lineno=54, + col_offset=5, + end_lineno=54, + end_col_offset=6), + lineno=54, + col_offset=0, + end_lineno=54, + end_col_offset=6), + Assert( + Compare( + BinOp( + Name( + 'placeholder_11', + Load(), + lineno=56, + col_offset=7, + end_lineno=56, + end_col_offset=8), + BitOr(), + Name( + 'placeholder_12', + Load(), + lineno=56, + col_offset=11, + end_lineno=56, + end_col_offset=12), + lineno=56, + col_offset=7, + end_lineno=56, + end_col_offset=12), + [ + Eq()], + [ + Dict( + [ + Constant( + 0, + lineno=56, + col_offset=17, + end_lineno=56, + end_col_offset=18), + Constant( + 1, + lineno=56, + col_offset=23, + end_lineno=56, + end_col_offset=24), + Constant( + 2, + lineno=56, + col_offset=29, + end_lineno=56, + end_col_offset=30), + Constant( + 3, + lineno=56, + col_offset=35, + end_lineno=56, + end_col_offset=36)], + [ + Constant( + 0, + lineno=56, + col_offset=20, + end_lineno=56, + end_col_offset=21), + Constant( + 1, + lineno=56, + col_offset=26, + end_lineno=56, + end_col_offset=27), + Constant( + 2, + lineno=56, + col_offset=32, + end_lineno=56, + end_col_offset=33), + Constant( + 3, + lineno=56, + col_offset=38, + end_lineno=56, + end_col_offset=39)], + lineno=56, + col_offset=16, + end_lineno=56, + end_col_offset=40)], + lineno=56, + col_offset=7, + end_lineno=56, + end_col_offset=40), + lineno=56, + col_offset=0, + end_lineno=56, + end_col_offset=40), + Assert( + Compare( + Name( + 'placeholder_13', + Load(), + lineno=57, + col_offset=7, + end_lineno=57, + end_col_offset=8), + [ + Eq()], + [ + Dict( + [ + Constant( + 0, + lineno=57, + col_offset=13, + end_lineno=57, + end_col_offset=14), + Constant( + 1, + lineno=57, + col_offset=19, + end_lineno=57, + end_col_offset=20), + Constant( + 2, + lineno=57, + col_offset=25, + end_lineno=57, + end_col_offset=26), + Constant( + 3, + lineno=57, + col_offset=31, + end_lineno=57, + end_col_offset=32)], + [ + Constant( + 0, + lineno=57, + col_offset=16, + end_lineno=57, + end_col_offset=17), + Constant( + 1, + lineno=57, + col_offset=22, + end_lineno=57, + end_col_offset=23), + Constant( + 2, + lineno=57, + col_offset=28, + end_lineno=57, + end_col_offset=29), + Constant( + 3, + lineno=57, + col_offset=34, + end_lineno=57, + end_col_offset=35)], + lineno=57, + col_offset=12, + end_lineno=57, + end_col_offset=36)], + lineno=57, + col_offset=7, + end_lineno=57, + end_col_offset=36), + lineno=57, + col_offset=0, + end_lineno=57, + end_col_offset=36), + Assign( + [ + Name( + 'placeholder_13', + Store(), + lineno=59, + col_offset=0, + end_lineno=59, + end_col_offset=1)], + Call( + Attribute( + Name( + 'placeholder_12', + Load(), + lineno=59, + col_offset=4, + end_lineno=59, + end_col_offset=5), + 'copy', + Load(), + lineno=59, + col_offset=4, + end_lineno=59, + end_col_offset=10), + [], + [], + lineno=59, + col_offset=4, + end_lineno=59, + end_col_offset=12), + lineno=59, + col_offset=0, + end_lineno=59, + end_col_offset=12), + AugAssign( + Name( + 'placeholder_13', + Store(), + lineno=60, + col_offset=0, + end_lineno=60, + end_col_offset=1), + BitOr(), + Name( + 'placeholder_11', + Load(), + lineno=60, + col_offset=5, + end_lineno=60, + end_col_offset=6), + lineno=60, + col_offset=0, + end_lineno=60, + end_col_offset=6), + Assert( + Compare( + BinOp( + Name( + 'placeholder_12', + Load(), + lineno=62, + col_offset=7, + end_lineno=62, + end_col_offset=8), + BitOr(), + Name( + 'placeholder_11', + Load(), + lineno=62, + col_offset=11, + end_lineno=62, + end_col_offset=12), + lineno=62, + col_offset=7, + end_lineno=62, + end_col_offset=12), + [ + Eq()], + [ + Dict( + [ + Constant( + 1, + lineno=62, + col_offset=17, + end_lineno=62, + end_col_offset=18), + Constant( + 2, + lineno=62, + col_offset=23, + end_lineno=62, + end_col_offset=24), + Constant( + 3, + lineno=62, + col_offset=29, + end_lineno=62, + end_col_offset=30), + Constant( + 0, + lineno=62, + col_offset=35, + end_lineno=62, + end_col_offset=36)], + [ + Constant( + 1, + lineno=62, + col_offset=20, + end_lineno=62, + end_col_offset=21), + Constant( + 1, + lineno=62, + col_offset=26, + end_lineno=62, + end_col_offset=27), + Constant( + 3, + lineno=62, + col_offset=32, + end_lineno=62, + end_col_offset=33), + Constant( + 0, + lineno=62, + col_offset=38, + end_lineno=62, + end_col_offset=39)], + lineno=62, + col_offset=16, + end_lineno=62, + end_col_offset=40)], + lineno=62, + col_offset=7, + end_lineno=62, + end_col_offset=40), + lineno=62, + col_offset=0, + end_lineno=62, + end_col_offset=40), + Assert( + Compare( + Name( + 'placeholder_13', + Load(), + lineno=63, + col_offset=7, + end_lineno=63, + end_col_offset=8), + [ + Eq()], + [ + Dict( + [ + Constant( + 1, + lineno=63, + col_offset=13, + end_lineno=63, + end_col_offset=14), + Constant( + 2, + lineno=63, + col_offset=19, + end_lineno=63, + end_col_offset=20), + Constant( + 3, + lineno=63, + col_offset=25, + end_lineno=63, + end_col_offset=26), + Constant( + 0, + lineno=63, + col_offset=31, + end_lineno=63, + end_col_offset=32)], + [ + Constant( + 1, + lineno=63, + col_offset=16, + end_lineno=63, + end_col_offset=17), + Constant( + 1, + lineno=63, + col_offset=22, + end_lineno=63, + end_col_offset=23), + Constant( + 3, + lineno=63, + col_offset=28, + end_lineno=63, + end_col_offset=29), + Constant( + 0, + lineno=63, + col_offset=34, + end_lineno=63, + end_col_offset=35)], + lineno=63, + col_offset=12, + end_lineno=63, + end_col_offset=36)], + lineno=63, + col_offset=7, + end_lineno=63, + end_col_offset=36), + lineno=63, + col_offset=0, + end_lineno=63, + end_col_offset=36), + Assign( + [ + Name( + 'placeholder_13', + Store(), + lineno=65, + col_offset=0, + end_lineno=65, + end_col_offset=1)], + Call( + Attribute( + Name( + 'placeholder_11', + Load(), + lineno=65, + col_offset=4, + end_lineno=65, + end_col_offset=5), + 'copy', + Load(), + lineno=65, + col_offset=4, + end_lineno=65, + end_col_offset=10), + [], + [], + lineno=65, + col_offset=4, + end_lineno=65, + end_col_offset=12), + lineno=65, + col_offset=0, + end_lineno=65, + end_col_offset=12), + AugAssign( + Name( + 'placeholder_13', + Store(), + lineno=66, + col_offset=0, + end_lineno=66, + end_col_offset=1), + BitOr(), + List( + [ + Tuple( + [ + Constant( + 1, + lineno=66, + col_offset=7, + end_lineno=66, + end_col_offset=8), + Constant( + 1, + lineno=66, + col_offset=10, + end_lineno=66, + end_col_offset=11)], + Load(), + lineno=66, + col_offset=6, + end_lineno=66, + end_col_offset=12), + Tuple( + [ + Constant( + 2, + lineno=66, + col_offset=15, + end_lineno=66, + end_col_offset=16), + Constant( + 2, + lineno=66, + col_offset=18, + end_lineno=66, + end_col_offset=19)], + Load(), + lineno=66, + col_offset=14, + end_lineno=66, + end_col_offset=20), + Tuple( + [ + Constant( + 3, + lineno=66, + col_offset=23, + end_lineno=66, + end_col_offset=24), + Constant( + 3, + lineno=66, + col_offset=26, + end_lineno=66, + end_col_offset=27)], + Load(), + lineno=66, + col_offset=22, + end_lineno=66, + end_col_offset=28)], + Load(), + lineno=66, + col_offset=5, + end_lineno=66, + end_col_offset=29), + lineno=66, + col_offset=0, + end_lineno=66, + end_col_offset=29), + Assert( + Compare( + Name( + 'placeholder_13', + Load(), + lineno=68, + col_offset=7, + end_lineno=68, + end_col_offset=8), + [ + Eq()], + [ + Dict( + [ + Constant( + 0, + lineno=68, + col_offset=13, + end_lineno=68, + end_col_offset=14), + Constant( + 1, + lineno=68, + col_offset=19, + end_lineno=68, + end_col_offset=20), + Constant( + 2, + lineno=68, + col_offset=25, + end_lineno=68, + end_col_offset=26), + Constant( + 3, + lineno=68, + col_offset=31, + end_lineno=68, + end_col_offset=32)], + [ + Constant( + 0, + lineno=68, + col_offset=16, + end_lineno=68, + end_col_offset=17), + Constant( + 1, + lineno=68, + col_offset=22, + end_lineno=68, + end_col_offset=23), + Constant( + 2, + lineno=68, + col_offset=28, + end_lineno=68, + end_col_offset=29), + Constant( + 3, + lineno=68, + col_offset=34, + end_lineno=68, + end_col_offset=35)], + lineno=68, + col_offset=12, + end_lineno=68, + end_col_offset=36)], + lineno=68, + col_offset=7, + end_lineno=68, + end_col_offset=36), + lineno=68, + col_offset=0, + end_lineno=68, + end_col_offset=36), + Expr( + Constant( + ' Example from `alphametrics` exercise ', + lineno=73, + col_offset=0, + end_lineno=73, + end_col_offset=44), + lineno=73, + col_offset=0, + end_lineno=73, + end_col_offset=44), + FunctionDef( + 'placeholder_14', + arguments( + [], + [ + arg( + 'placeholder_15', + lineno=74, + col_offset=11, + end_lineno=74, + end_col_offset=18), + arg( + 'placeholder_16', + lineno=74, + col_offset=20, + end_lineno=74, + end_col_offset=30), + arg( + 'placeholder_17', + lineno=74, + col_offset=32, + end_lineno=74, + end_col_offset=37), + arg( + 'placeholder_18', + lineno=74, + col_offset=39, + end_lineno=74, + end_col_offset=45)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + While( + Name( + 'placeholder_15', + Load(), + lineno=75, + col_offset=10, + end_lineno=75, + end_col_offset=17), + [ + Assign( + [ + Name( + 'placeholder_19', + Store(), + lineno=76, + col_offset=8, + end_lineno=76, + end_col_offset=22)], + List( + [], + Load(), + lineno=76, + col_offset=25, + end_lineno=76, + end_col_offset=27), + lineno=76, + col_offset=8, + end_lineno=76, + end_col_offset=27), + For( + Name( + 'placeholder_20', + Store(), + lineno=78, + col_offset=12, + end_lineno=78, + end_col_offset=21), + Name( + 'placeholder_16', + Load(), + lineno=78, + col_offset=25, + end_lineno=78, + end_col_offset=35), + [ + Assign( + [ + Tuple( + [ + Name( + 'placeholder_21', + Store(), + lineno=79, + col_offset=12, + end_lineno=79, + end_col_offset=15), + Name( + 'placeholder_22', + Store(), + lineno=79, + col_offset=17, + end_lineno=79, + end_col_offset=24)], + Store(), + lineno=79, + col_offset=12, + end_lineno=79, + end_col_offset=24)], + Name( + 'placeholder_20', + Load(), + lineno=79, + col_offset=27, + end_lineno=79, + end_col_offset=36), + lineno=79, + col_offset=12, + end_lineno=79, + end_col_offset=36), + If( + Compare( + Subscript( + Name( + 'placeholder_15', + Load(), + lineno=81, + col_offset=15, + end_lineno=81, + end_col_offset=22), + Constant( + 0, + lineno=81, + col_offset=23, + end_lineno=81, + end_col_offset=24), + Load(), + lineno=81, + col_offset=15, + end_lineno=81, + end_col_offset=25), + [ + In()], + [ + List( + [ + Name( + 'placeholder_17', + Load(), + lineno=81, + col_offset=30, + end_lineno=81, + end_col_offset=35), + Name( + 'placeholder_18', + Load(), + lineno=81, + col_offset=37, + end_lineno=81, + end_col_offset=43)], + Load(), + lineno=81, + col_offset=29, + end_lineno=81, + end_col_offset=44)], + lineno=81, + col_offset=15, + end_lineno=81, + end_col_offset=44), + [ + Assign( + [ + Name( + 'placeholder_23', + Store(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=28)], + BinOp( + Name( + 'placeholder_22', + Load(), + lineno=82, + col_offset=31, + end_lineno=82, + end_col_offset=38), + Sub(), + Call( + Name( + 'set', + Load(), + lineno=82, + col_offset=41, + end_lineno=82, + end_col_offset=44), + [ + List( + [ + Constant( + 0, + lineno=82, + col_offset=46, + end_lineno=82, + end_col_offset=47)], + Load(), + lineno=82, + col_offset=45, + end_lineno=82, + end_col_offset=48)], + [], + lineno=82, + col_offset=41, + end_lineno=82, + end_col_offset=49), + lineno=82, + col_offset=31, + end_lineno=82, + end_col_offset=49), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=49)], + [ + Assign( + [ + Name( + 'placeholder_23', + Store(), + lineno=85, + col_offset=16, + end_lineno=85, + end_col_offset=28)], + Name( + 'placeholder_22', + Load(), + lineno=85, + col_offset=31, + end_lineno=85, + end_col_offset=38), + lineno=85, + col_offset=16, + end_lineno=85, + end_col_offset=38)], + lineno=81, + col_offset=12, + end_lineno=85, + end_col_offset=38), + For( + Name( + 'placeholder_24', + Store(), + lineno=87, + col_offset=16, + end_lineno=87, + end_col_offset=17), + Name( + 'placeholder_23', + Load(), + lineno=87, + col_offset=21, + end_lineno=87, + end_col_offset=33), + [ + Assign( + [ + Name( + 'placeholder_25', + Store(), + lineno=88, + col_offset=16, + end_lineno=88, + end_col_offset=22)], + BinOp( + Name( + 'placeholder_21', + Load(), + lineno=88, + col_offset=25, + end_lineno=88, + end_col_offset=28), + BitOr(), + Dict( + [ + Subscript( + Name( + 'placeholder_15', + Load(), + lineno=88, + col_offset=32, + end_lineno=88, + end_col_offset=39), + Constant( + 0, + lineno=88, + col_offset=40, + end_lineno=88, + end_col_offset=41), + Load(), + lineno=88, + col_offset=32, + end_lineno=88, + end_col_offset=42)], + [ + Name( + 'placeholder_24', + Load(), + lineno=88, + col_offset=44, + end_lineno=88, + end_col_offset=45)], + lineno=88, + col_offset=31, + end_lineno=88, + end_col_offset=46), + lineno=88, + col_offset=25, + end_lineno=88, + end_col_offset=46), + lineno=88, + col_offset=16, + end_lineno=88, + end_col_offset=46), + Expr( + Call( + Attribute( + Name( + 'placeholder_19', + Load(), + lineno=89, + col_offset=16, + end_lineno=89, + end_col_offset=30), + 'append', + Load(), + lineno=89, + col_offset=16, + end_lineno=89, + end_col_offset=37), + [ + Tuple( + [ + Name( + 'placeholder_25', + Load(), + lineno=89, + col_offset=39, + end_lineno=89, + end_col_offset=45), + BinOp( + Name( + 'placeholder_22', + Load(), + lineno=89, + col_offset=47, + end_lineno=89, + end_col_offset=54), + Sub(), + Call( + Name( + 'set', + Load(), + lineno=89, + col_offset=57, + end_lineno=89, + end_col_offset=60), + [ + List( + [ + Name( + 'placeholder_24', + Load(), + lineno=89, + col_offset=62, + end_lineno=89, + end_col_offset=63)], + Load(), + lineno=89, + col_offset=61, + end_lineno=89, + end_col_offset=64)], + [], + lineno=89, + col_offset=57, + end_lineno=89, + end_col_offset=65), + lineno=89, + col_offset=47, + end_lineno=89, + end_col_offset=65)], + Load(), + lineno=89, + col_offset=38, + end_lineno=89, + end_col_offset=66)], + [], + lineno=89, + col_offset=16, + end_lineno=89, + end_col_offset=67), + lineno=89, + col_offset=16, + end_lineno=89, + end_col_offset=67)], + [], + lineno=87, + col_offset=12, + end_lineno=89, + end_col_offset=67)], + [], + lineno=78, + col_offset=8, + end_lineno=89, + end_col_offset=67), + Assign( + [ + Name( + 'placeholder_16', + Store(), + lineno=91, + col_offset=8, + end_lineno=91, + end_col_offset=18)], + Name( + 'placeholder_19', + Load(), + lineno=91, + col_offset=21, + end_lineno=91, + end_col_offset=35), + lineno=91, + col_offset=8, + end_lineno=91, + end_col_offset=35), + Assign( + [ + Name( + 'placeholder_15', + Store(), + lineno=92, + col_offset=8, + end_lineno=92, + end_col_offset=15)], + Subscript( + Name( + 'placeholder_15', + Load(), + lineno=92, + col_offset=18, + end_lineno=92, + end_col_offset=25), + Slice( + Constant( + 1, + lineno=92, + col_offset=26, + end_lineno=92, + end_col_offset=27), + lineno=92, + col_offset=26, + end_lineno=92, + end_col_offset=28), + Load(), + lineno=92, + col_offset=18, + end_lineno=92, + end_col_offset=29), + lineno=92, + col_offset=8, + end_lineno=92, + end_col_offset=29)], + [], + lineno=75, + col_offset=4, + end_lineno=92, + end_col_offset=29), + Return( + ListComp( + Name( + 'placeholder_21', + Load(), + lineno=93, + col_offset=12, + end_lineno=93, + end_col_offset=15), + [ + comprehension( + Tuple( + [ + Name( + 'placeholder_21', + Store(), + lineno=93, + col_offset=20, + end_lineno=93, + end_col_offset=23), + Name( + 'placeholder_26', + Store(), + lineno=93, + col_offset=25, + end_lineno=93, + end_col_offset=26)], + Store(), + lineno=93, + col_offset=20, + end_lineno=93, + end_col_offset=26), + Name( + 'placeholder_16', + Load(), + lineno=93, + col_offset=30, + end_lineno=93, + end_col_offset=40), + [], + 0)], + lineno=93, + col_offset=11, + end_lineno=93, + end_col_offset=41), + lineno=93, + col_offset=4, + end_lineno=93, + end_col_offset=41)], + [], + lineno=74, + col_offset=0, + end_lineno=93, + end_col_offset=41)], + []) +## END NORMALIZED TREE ## \ No newline at end of file diff --git a/test/example-uniondict-normalization/representation.txt b/test/example-uniondict-normalization/representation.txt new file mode 100644 index 0000000..525c8e8 --- /dev/null +++ b/test/example-uniondict-normalization/representation.txt @@ -0,0 +1 @@ +Module([Import([alias('toml', lineno=12, col_offset=7, end_lineno=12, end_col_offset=11)], lineno=12, col_offset=0, end_lineno=12, end_col_offset=11), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=14, col_offset=19, end_lineno=14, end_col_offset=35), arg('placeholder_2', lineno=14, col_offset=37, end_lineno=14, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], defaults=[]), [With([withitem(Call(Name('open', Load(), lineno=16, col_offset=9, end_lineno=16, end_col_offset=13), [Name('placeholder_2', Load(), lineno=16, col_offset=14, end_lineno=16, end_col_offset=28), Constant('r', lineno=16, col_offset=30, end_lineno=16, end_col_offset=33)], [], lineno=16, col_offset=9, end_lineno=16, end_col_offset=34), Name('placeholder_3', Store(), lineno=16, col_offset=38, end_lineno=16, end_col_offset=39))], [Assign([Name('placeholder_4', Store(), lineno=17, col_offset=8, end_lineno=17, end_col_offset=21)], Call(Attribute(Name('toml', Load(), lineno=17, col_offset=24, end_lineno=17, end_col_offset=28), 'load', Load(), lineno=17, col_offset=24, end_lineno=17, end_col_offset=33), [Name('placeholder_3', Load(), lineno=17, col_offset=34, end_lineno=17, end_col_offset=35)], [], lineno=17, col_offset=24, end_lineno=17, end_col_offset=36), lineno=17, col_offset=8, end_lineno=17, end_col_offset=36)], lineno=16, col_offset=4, end_lineno=17, end_col_offset=36), Assign([Name('placeholder_5', Store(), lineno=20, col_offset=4, end_lineno=20, end_col_offset=19)], BinOp(Name('placeholder_1', Load(), lineno=20, col_offset=22, end_lineno=20, end_col_offset=38), BitOr(), Name('placeholder_4', Load(), lineno=20, col_offset=41, end_lineno=20, end_col_offset=54), lineno=20, col_offset=22, end_lineno=20, end_col_offset=54), lineno=20, col_offset=4, end_lineno=20, end_col_offset=54), Return(Name('placeholder_5', Load(), lineno=22, col_offset=11, end_lineno=22, end_col_offset=26), lineno=22, col_offset=4, end_lineno=22, end_col_offset=26)], [], lineno=14, col_offset=0, end_lineno=22, end_col_offset=26), Assign([Name('placeholder_1', Store(), lineno=25, col_offset=0, end_lineno=25, end_col_offset=16)], Dict([Constant('timeout', lineno=26, col_offset=4, end_lineno=26, end_col_offset=13), Constant('retry_count', lineno=27, col_offset=4, end_lineno=27, end_col_offset=17), Constant('log_level', lineno=28, col_offset=4, end_lineno=28, end_col_offset=15)], [Constant(30, lineno=26, col_offset=15, end_lineno=26, end_col_offset=17), Constant(3, lineno=27, col_offset=19, end_lineno=27, end_col_offset=20), Constant('INFO', lineno=28, col_offset=17, end_lineno=28, end_col_offset=23)], lineno=25, col_offset=19, end_lineno=29, end_col_offset=1), lineno=25, col_offset=0, end_lineno=29, end_col_offset=1), Assign([Name('placeholder_2', Store(), lineno=30, col_offset=0, end_lineno=30, end_col_offset=14)], Constant('settings.toml', lineno=30, col_offset=17, end_lineno=30, end_col_offset=32), lineno=30, col_offset=0, end_lineno=30, end_col_offset=32), Assign([Name('placeholder_6', Store(), lineno=32, col_offset=0, end_lineno=32, end_col_offset=14)], Call(Name('placeholder_0', Load(), lineno=32, col_offset=17, end_lineno=32, end_col_offset=31), [Name('placeholder_1', Load(), lineno=32, col_offset=32, end_lineno=32, end_col_offset=48), Name('placeholder_2', Load(), lineno=32, col_offset=50, end_lineno=32, end_col_offset=64)], [], lineno=32, col_offset=17, end_lineno=32, end_col_offset=65), lineno=32, col_offset=0, end_lineno=32, end_col_offset=65), Expr(Constant(' Examples from PEP584 - Add Union Operators To dict', lineno=38, col_offset=0, end_lineno=38, end_col_offset=57), lineno=38, col_offset=0, end_lineno=38, end_col_offset=57), Assign([Name('placeholder_7', Store(), lineno=39, col_offset=0, end_lineno=39, end_col_offset=1)], Dict([Constant('spam', lineno=39, col_offset=5, end_lineno=39, end_col_offset=11), Constant('eggs', lineno=39, col_offset=16, end_lineno=39, end_col_offset=22), Constant('cheese', lineno=39, col_offset=27, end_lineno=39, end_col_offset=35)], [Constant(1, lineno=39, col_offset=13, end_lineno=39, end_col_offset=14), Constant(2, lineno=39, col_offset=24, end_lineno=39, end_col_offset=25), Constant(3, lineno=39, col_offset=37, end_lineno=39, end_col_offset=38)], lineno=39, col_offset=4, end_lineno=39, end_col_offset=39), lineno=39, col_offset=0, end_lineno=39, end_col_offset=39), Assign([Name('placeholder_8', Store(), lineno=40, col_offset=0, end_lineno=40, end_col_offset=1)], Dict([Constant('cheese', lineno=40, col_offset=5, end_lineno=40, end_col_offset=13), Constant('aardvark', lineno=40, col_offset=26, end_lineno=40, end_col_offset=36)], [Constant('cheddar', lineno=40, col_offset=15, end_lineno=40, end_col_offset=24), Constant('Ethel', lineno=40, col_offset=38, end_lineno=40, end_col_offset=45)], lineno=40, col_offset=4, end_lineno=40, end_col_offset=46), lineno=40, col_offset=0, end_lineno=40, end_col_offset=46), Assign([Name('placeholder_9', Store(), lineno=41, col_offset=0, end_lineno=41, end_col_offset=1)], BinOp(Name('placeholder_7', Load(), lineno=41, col_offset=4, end_lineno=41, end_col_offset=5), BitOr(), Name('placeholder_8', Load(), lineno=41, col_offset=8, end_lineno=41, end_col_offset=9), lineno=41, col_offset=4, end_lineno=41, end_col_offset=9), lineno=41, col_offset=0, end_lineno=41, end_col_offset=9), Assign([Name('placeholder_10', Store(), lineno=42, col_offset=0, end_lineno=42, end_col_offset=1)], BinOp(Name('placeholder_8', Load(), lineno=42, col_offset=4, end_lineno=42, end_col_offset=5), BitOr(), Name('placeholder_7', Load(), lineno=42, col_offset=8, end_lineno=42, end_col_offset=9), lineno=42, col_offset=4, end_lineno=42, end_col_offset=9), lineno=42, col_offset=0, end_lineno=42, end_col_offset=9), AugAssign(Name('placeholder_7', Store(), lineno=43, col_offset=0, end_lineno=43, end_col_offset=1), BitOr(), Name('placeholder_8', Load(), lineno=43, col_offset=5, end_lineno=43, end_col_offset=6), lineno=43, col_offset=0, end_lineno=43, end_col_offset=6), Expr(Constant(' Examples from the Cpython unit tests', lineno=49, col_offset=0, end_lineno=49, end_col_offset=43), lineno=49, col_offset=0, end_lineno=49, end_col_offset=43), Assign([Name('placeholder_11', Store(), lineno=50, col_offset=0, end_lineno=50, end_col_offset=1)], Dict([Constant(0, lineno=50, col_offset=5, end_lineno=50, end_col_offset=6), Constant(1, lineno=50, col_offset=11, end_lineno=50, end_col_offset=12), Constant(2, lineno=50, col_offset=17, end_lineno=50, end_col_offset=18)], [Constant(0, lineno=50, col_offset=8, end_lineno=50, end_col_offset=9), Constant(1, lineno=50, col_offset=14, end_lineno=50, end_col_offset=15), Constant(1, lineno=50, col_offset=20, end_lineno=50, end_col_offset=21)], lineno=50, col_offset=4, end_lineno=50, end_col_offset=22), lineno=50, col_offset=0, end_lineno=50, end_col_offset=22), Assign([Name('placeholder_12', Store(), lineno=51, col_offset=0, end_lineno=51, end_col_offset=1)], Dict([Constant(1, lineno=51, col_offset=5, end_lineno=51, end_col_offset=6), Constant(2, lineno=51, col_offset=11, end_lineno=51, end_col_offset=12), Constant(3, lineno=51, col_offset=17, end_lineno=51, end_col_offset=18)], [Constant(1, lineno=51, col_offset=8, end_lineno=51, end_col_offset=9), Constant(2, lineno=51, col_offset=14, end_lineno=51, end_col_offset=15), Constant(3, lineno=51, col_offset=20, end_lineno=51, end_col_offset=21)], lineno=51, col_offset=4, end_lineno=51, end_col_offset=22), lineno=51, col_offset=0, end_lineno=51, end_col_offset=22), Assign([Name('placeholder_13', Store(), lineno=53, col_offset=0, end_lineno=53, end_col_offset=1)], Call(Attribute(Name('placeholder_11', Load(), lineno=53, col_offset=4, end_lineno=53, end_col_offset=5), 'copy', Load(), lineno=53, col_offset=4, end_lineno=53, end_col_offset=10), [], [], lineno=53, col_offset=4, end_lineno=53, end_col_offset=12), lineno=53, col_offset=0, end_lineno=53, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=54, col_offset=0, end_lineno=54, end_col_offset=1), BitOr(), Name('placeholder_12', Load(), lineno=54, col_offset=5, end_lineno=54, end_col_offset=6), lineno=54, col_offset=0, end_lineno=54, end_col_offset=6), Assert(Compare(BinOp(Name('placeholder_11', Load(), lineno=56, col_offset=7, end_lineno=56, end_col_offset=8), BitOr(), Name('placeholder_12', Load(), lineno=56, col_offset=11, end_lineno=56, end_col_offset=12), lineno=56, col_offset=7, end_lineno=56, end_col_offset=12), [Eq()], [Dict([Constant(0, lineno=56, col_offset=17, end_lineno=56, end_col_offset=18), Constant(1, lineno=56, col_offset=23, end_lineno=56, end_col_offset=24), Constant(2, lineno=56, col_offset=29, end_lineno=56, end_col_offset=30), Constant(3, lineno=56, col_offset=35, end_lineno=56, end_col_offset=36)], [Constant(0, lineno=56, col_offset=20, end_lineno=56, end_col_offset=21), Constant(1, lineno=56, col_offset=26, end_lineno=56, end_col_offset=27), Constant(2, lineno=56, col_offset=32, end_lineno=56, end_col_offset=33), Constant(3, lineno=56, col_offset=38, end_lineno=56, end_col_offset=39)], lineno=56, col_offset=16, end_lineno=56, end_col_offset=40)], lineno=56, col_offset=7, end_lineno=56, end_col_offset=40), lineno=56, col_offset=0, end_lineno=56, end_col_offset=40), Assert(Compare(Name('placeholder_13', Load(), lineno=57, col_offset=7, end_lineno=57, end_col_offset=8), [Eq()], [Dict([Constant(0, lineno=57, col_offset=13, end_lineno=57, end_col_offset=14), Constant(1, lineno=57, col_offset=19, end_lineno=57, end_col_offset=20), Constant(2, lineno=57, col_offset=25, end_lineno=57, end_col_offset=26), Constant(3, lineno=57, col_offset=31, end_lineno=57, end_col_offset=32)], [Constant(0, lineno=57, col_offset=16, end_lineno=57, end_col_offset=17), Constant(1, lineno=57, col_offset=22, end_lineno=57, end_col_offset=23), Constant(2, lineno=57, col_offset=28, end_lineno=57, end_col_offset=29), Constant(3, lineno=57, col_offset=34, end_lineno=57, end_col_offset=35)], lineno=57, col_offset=12, end_lineno=57, end_col_offset=36)], lineno=57, col_offset=7, end_lineno=57, end_col_offset=36), lineno=57, col_offset=0, end_lineno=57, end_col_offset=36), Assign([Name('placeholder_13', Store(), lineno=59, col_offset=0, end_lineno=59, end_col_offset=1)], Call(Attribute(Name('placeholder_12', Load(), lineno=59, col_offset=4, end_lineno=59, end_col_offset=5), 'copy', Load(), lineno=59, col_offset=4, end_lineno=59, end_col_offset=10), [], [], lineno=59, col_offset=4, end_lineno=59, end_col_offset=12), lineno=59, col_offset=0, end_lineno=59, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=60, col_offset=0, end_lineno=60, end_col_offset=1), BitOr(), Name('placeholder_11', Load(), lineno=60, col_offset=5, end_lineno=60, end_col_offset=6), lineno=60, col_offset=0, end_lineno=60, end_col_offset=6), Assert(Compare(BinOp(Name('placeholder_12', Load(), lineno=62, col_offset=7, end_lineno=62, end_col_offset=8), BitOr(), Name('placeholder_11', Load(), lineno=62, col_offset=11, end_lineno=62, end_col_offset=12), lineno=62, col_offset=7, end_lineno=62, end_col_offset=12), [Eq()], [Dict([Constant(1, lineno=62, col_offset=17, end_lineno=62, end_col_offset=18), Constant(2, lineno=62, col_offset=23, end_lineno=62, end_col_offset=24), Constant(3, lineno=62, col_offset=29, end_lineno=62, end_col_offset=30), Constant(0, lineno=62, col_offset=35, end_lineno=62, end_col_offset=36)], [Constant(1, lineno=62, col_offset=20, end_lineno=62, end_col_offset=21), Constant(1, lineno=62, col_offset=26, end_lineno=62, end_col_offset=27), Constant(3, lineno=62, col_offset=32, end_lineno=62, end_col_offset=33), Constant(0, lineno=62, col_offset=38, end_lineno=62, end_col_offset=39)], lineno=62, col_offset=16, end_lineno=62, end_col_offset=40)], lineno=62, col_offset=7, end_lineno=62, end_col_offset=40), lineno=62, col_offset=0, end_lineno=62, end_col_offset=40), Assert(Compare(Name('placeholder_13', Load(), lineno=63, col_offset=7, end_lineno=63, end_col_offset=8), [Eq()], [Dict([Constant(1, lineno=63, col_offset=13, end_lineno=63, end_col_offset=14), Constant(2, lineno=63, col_offset=19, end_lineno=63, end_col_offset=20), Constant(3, lineno=63, col_offset=25, end_lineno=63, end_col_offset=26), Constant(0, lineno=63, col_offset=31, end_lineno=63, end_col_offset=32)], [Constant(1, lineno=63, col_offset=16, end_lineno=63, end_col_offset=17), Constant(1, lineno=63, col_offset=22, end_lineno=63, end_col_offset=23), Constant(3, lineno=63, col_offset=28, end_lineno=63, end_col_offset=29), Constant(0, lineno=63, col_offset=34, end_lineno=63, end_col_offset=35)], lineno=63, col_offset=12, end_lineno=63, end_col_offset=36)], lineno=63, col_offset=7, end_lineno=63, end_col_offset=36), lineno=63, col_offset=0, end_lineno=63, end_col_offset=36), Assign([Name('placeholder_13', Store(), lineno=65, col_offset=0, end_lineno=65, end_col_offset=1)], Call(Attribute(Name('placeholder_11', Load(), lineno=65, col_offset=4, end_lineno=65, end_col_offset=5), 'copy', Load(), lineno=65, col_offset=4, end_lineno=65, end_col_offset=10), [], [], lineno=65, col_offset=4, end_lineno=65, end_col_offset=12), lineno=65, col_offset=0, end_lineno=65, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=66, col_offset=0, end_lineno=66, end_col_offset=1), BitOr(), List([Tuple([Constant(1, lineno=66, col_offset=7, end_lineno=66, end_col_offset=8), Constant(1, lineno=66, col_offset=10, end_lineno=66, end_col_offset=11)], Load(), lineno=66, col_offset=6, end_lineno=66, end_col_offset=12), Tuple([Constant(2, lineno=66, col_offset=15, end_lineno=66, end_col_offset=16), Constant(2, lineno=66, col_offset=18, end_lineno=66, end_col_offset=19)], Load(), lineno=66, col_offset=14, end_lineno=66, end_col_offset=20), Tuple([Constant(3, lineno=66, col_offset=23, end_lineno=66, end_col_offset=24), Constant(3, lineno=66, col_offset=26, end_lineno=66, end_col_offset=27)], Load(), lineno=66, col_offset=22, end_lineno=66, end_col_offset=28)], Load(), lineno=66, col_offset=5, end_lineno=66, end_col_offset=29), lineno=66, col_offset=0, end_lineno=66, end_col_offset=29), Assert(Compare(Name('placeholder_13', Load(), lineno=68, col_offset=7, end_lineno=68, end_col_offset=8), [Eq()], [Dict([Constant(0, lineno=68, col_offset=13, end_lineno=68, end_col_offset=14), Constant(1, lineno=68, col_offset=19, end_lineno=68, end_col_offset=20), Constant(2, lineno=68, col_offset=25, end_lineno=68, end_col_offset=26), Constant(3, lineno=68, col_offset=31, end_lineno=68, end_col_offset=32)], [Constant(0, lineno=68, col_offset=16, end_lineno=68, end_col_offset=17), Constant(1, lineno=68, col_offset=22, end_lineno=68, end_col_offset=23), Constant(2, lineno=68, col_offset=28, end_lineno=68, end_col_offset=29), Constant(3, lineno=68, col_offset=34, end_lineno=68, end_col_offset=35)], lineno=68, col_offset=12, end_lineno=68, end_col_offset=36)], lineno=68, col_offset=7, end_lineno=68, end_col_offset=36), lineno=68, col_offset=0, end_lineno=68, end_col_offset=36), Expr(Constant(' Example from `alphametrics` exercise ', lineno=73, col_offset=0, end_lineno=73, end_col_offset=44), lineno=73, col_offset=0, end_lineno=73, end_col_offset=44), FunctionDef('placeholder_14', arguments([], [arg('placeholder_15', lineno=74, col_offset=11, end_lineno=74, end_col_offset=18), arg('placeholder_16', lineno=74, col_offset=20, end_lineno=74, end_col_offset=30), arg('placeholder_17', lineno=74, col_offset=32, end_lineno=74, end_col_offset=37), arg('placeholder_18', lineno=74, col_offset=39, end_lineno=74, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [While(Name('placeholder_15', Load(), lineno=75, col_offset=10, end_lineno=75, end_col_offset=17), [Assign([Name('placeholder_19', Store(), lineno=76, col_offset=8, end_lineno=76, end_col_offset=22)], List([], Load(), lineno=76, col_offset=25, end_lineno=76, end_col_offset=27), lineno=76, col_offset=8, end_lineno=76, end_col_offset=27), For(Name('placeholder_20', Store(), lineno=78, col_offset=12, end_lineno=78, end_col_offset=21), Name('placeholder_16', Load(), lineno=78, col_offset=25, end_lineno=78, end_col_offset=35), [Assign([Tuple([Name('placeholder_21', Store(), lineno=79, col_offset=12, end_lineno=79, end_col_offset=15), Name('placeholder_22', Store(), lineno=79, col_offset=17, end_lineno=79, end_col_offset=24)], Store(), lineno=79, col_offset=12, end_lineno=79, end_col_offset=24)], Name('placeholder_20', Load(), lineno=79, col_offset=27, end_lineno=79, end_col_offset=36), lineno=79, col_offset=12, end_lineno=79, end_col_offset=36), If(Compare(Subscript(Name('placeholder_15', Load(), lineno=81, col_offset=15, end_lineno=81, end_col_offset=22), Constant(0, lineno=81, col_offset=23, end_lineno=81, end_col_offset=24), Load(), lineno=81, col_offset=15, end_lineno=81, end_col_offset=25), [In()], [List([Name('placeholder_17', Load(), lineno=81, col_offset=30, end_lineno=81, end_col_offset=35), Name('placeholder_18', Load(), lineno=81, col_offset=37, end_lineno=81, end_col_offset=43)], Load(), lineno=81, col_offset=29, end_lineno=81, end_col_offset=44)], lineno=81, col_offset=15, end_lineno=81, end_col_offset=44), [Assign([Name('placeholder_23', Store(), lineno=82, col_offset=16, end_lineno=82, end_col_offset=28)], BinOp(Name('placeholder_22', Load(), lineno=82, col_offset=31, end_lineno=82, end_col_offset=38), Sub(), Call(Name('set', Load(), lineno=82, col_offset=41, end_lineno=82, end_col_offset=44), [List([Constant(0, lineno=82, col_offset=46, end_lineno=82, end_col_offset=47)], Load(), lineno=82, col_offset=45, end_lineno=82, end_col_offset=48)], [], lineno=82, col_offset=41, end_lineno=82, end_col_offset=49), lineno=82, col_offset=31, end_lineno=82, end_col_offset=49), lineno=82, col_offset=16, end_lineno=82, end_col_offset=49)], [Assign([Name('placeholder_23', Store(), lineno=85, col_offset=16, end_lineno=85, end_col_offset=28)], Name('placeholder_22', Load(), lineno=85, col_offset=31, end_lineno=85, end_col_offset=38), lineno=85, col_offset=16, end_lineno=85, end_col_offset=38)], lineno=81, col_offset=12, end_lineno=85, end_col_offset=38), For(Name('placeholder_24', Store(), lineno=87, col_offset=16, end_lineno=87, end_col_offset=17), Name('placeholder_23', Load(), lineno=87, col_offset=21, end_lineno=87, end_col_offset=33), [Assign([Name('placeholder_25', Store(), lineno=88, col_offset=16, end_lineno=88, end_col_offset=22)], BinOp(Name('placeholder_21', Load(), lineno=88, col_offset=25, end_lineno=88, end_col_offset=28), BitOr(), Dict([Subscript(Name('placeholder_15', Load(), lineno=88, col_offset=32, end_lineno=88, end_col_offset=39), Constant(0, lineno=88, col_offset=40, end_lineno=88, end_col_offset=41), Load(), lineno=88, col_offset=32, end_lineno=88, end_col_offset=42)], [Name('placeholder_24', Load(), lineno=88, col_offset=44, end_lineno=88, end_col_offset=45)], lineno=88, col_offset=31, end_lineno=88, end_col_offset=46), lineno=88, col_offset=25, end_lineno=88, end_col_offset=46), lineno=88, col_offset=16, end_lineno=88, end_col_offset=46), Expr(Call(Attribute(Name('placeholder_19', Load(), lineno=89, col_offset=16, end_lineno=89, end_col_offset=30), 'append', Load(), lineno=89, col_offset=16, end_lineno=89, end_col_offset=37), [Tuple([Name('placeholder_25', Load(), lineno=89, col_offset=39, end_lineno=89, end_col_offset=45), BinOp(Name('placeholder_22', Load(), lineno=89, col_offset=47, end_lineno=89, end_col_offset=54), Sub(), Call(Name('set', Load(), lineno=89, col_offset=57, end_lineno=89, end_col_offset=60), [List([Name('placeholder_24', Load(), lineno=89, col_offset=62, end_lineno=89, end_col_offset=63)], Load(), lineno=89, col_offset=61, end_lineno=89, end_col_offset=64)], [], lineno=89, col_offset=57, end_lineno=89, end_col_offset=65), lineno=89, col_offset=47, end_lineno=89, end_col_offset=65)], Load(), lineno=89, col_offset=38, end_lineno=89, end_col_offset=66)], [], lineno=89, col_offset=16, end_lineno=89, end_col_offset=67), lineno=89, col_offset=16, end_lineno=89, end_col_offset=67)], [], lineno=87, col_offset=12, end_lineno=89, end_col_offset=67)], [], lineno=78, col_offset=8, end_lineno=89, end_col_offset=67), Assign([Name('placeholder_16', Store(), lineno=91, col_offset=8, end_lineno=91, end_col_offset=18)], Name('placeholder_19', Load(), lineno=91, col_offset=21, end_lineno=91, end_col_offset=35), lineno=91, col_offset=8, end_lineno=91, end_col_offset=35), Assign([Name('placeholder_15', Store(), lineno=92, col_offset=8, end_lineno=92, end_col_offset=15)], Subscript(Name('placeholder_15', Load(), lineno=92, col_offset=18, end_lineno=92, end_col_offset=25), Slice(Constant(1, lineno=92, col_offset=26, end_lineno=92, end_col_offset=27), lineno=92, col_offset=26, end_lineno=92, end_col_offset=28), Load(), lineno=92, col_offset=18, end_lineno=92, end_col_offset=29), lineno=92, col_offset=8, end_lineno=92, end_col_offset=29)], [], lineno=75, col_offset=4, end_lineno=92, end_col_offset=29), Return(ListComp(Name('placeholder_21', Load(), lineno=93, col_offset=12, end_lineno=93, end_col_offset=15), [comprehension(Tuple([Name('placeholder_21', Store(), lineno=93, col_offset=20, end_lineno=93, end_col_offset=23), Name('placeholder_26', Store(), lineno=93, col_offset=25, end_lineno=93, end_col_offset=26)], Store(), lineno=93, col_offset=20, end_lineno=93, end_col_offset=26), Name('placeholder_16', Load(), lineno=93, col_offset=30, end_lineno=93, end_col_offset=40), [], 0)], lineno=93, col_offset=11, end_lineno=93, end_col_offset=41), lineno=93, col_offset=4, end_lineno=93, end_col_offset=41)], [], lineno=74, col_offset=0, end_lineno=93, end_col_offset=41)], []) \ No newline at end of file From 4942d4b9934a3ec016b40103cbbff65a49d744ab Mon Sep 17 00:00:00 2001 From: brocla Date: Wed, 13 Mar 2024 08:19:12 -0600 Subject: [PATCH 02/14] Convert to tomlib - delete leading and trailing blank lines --- .../example_uniondict_normalization.py | 6 +- .../representation.out | 2228 ++++++++--------- .../representation.txt | 2 +- 3 files changed, 1117 insertions(+), 1119 deletions(-) diff --git a/test/example-uniondict-normalization/example_uniondict_normalization.py b/test/example-uniondict-normalization/example_uniondict_normalization.py index 697bd06..d530306 100644 --- a/test/example-uniondict-normalization/example_uniondict_normalization.py +++ b/test/example-uniondict-normalization/example_uniondict_normalization.py @@ -1,4 +1,3 @@ - """ This exmple comes from ChatGPT Prompt: Write a python function that @@ -9,12 +8,12 @@ two sources of settings, the data from the toml file should be used. """ -import toml +import tomlib def merge_settings(default_settings, toml_file_path): # Load settings from TOML file with open(toml_file_path, 'r') as f: - toml_settings = toml.load(f) + toml_settings = tomlib.load(f) # Merge default settings with settings from TOML file merged_settings = default_settings | toml_settings @@ -93,4 +92,3 @@ def assign(letters, selections, lefty, righty): selections = new_selections letters = letters[1:] return [slc for slc, _ in selections] - diff --git a/test/example-uniondict-normalization/representation.out b/test/example-uniondict-normalization/representation.out index 14c4c21..bbea6a4 100644 --- a/test/example-uniondict-normalization/representation.out +++ b/test/example-uniondict-normalization/representation.out @@ -1,10 +1,10 @@ ## BEGIN NORMALIZED CODE ## -import toml +import tomlib def placeholder_0(placeholder_1, placeholder_2): with open(placeholder_2, "r") as placeholder_3: - placeholder_4 = toml.load(placeholder_3) + placeholder_4 = tomlib.load(placeholder_3) placeholder_5 = placeholder_1 | placeholder_4 return placeholder_5 @@ -61,26 +61,26 @@ Module( Expr( Constant( '\n This exmple comes from ChatGPT\n Prompt: Write a python function that \n reads user settings from a toml file and \n merges them with a dictionary of default \n settings to create a single dictionary. \n If there are any conflicts between the \n two sources of settings, the data from \n the toml file should be used.\n', - lineno=2, + lineno=1, col_offset=0, - end_lineno=11, + end_lineno=10, end_col_offset=3), - lineno=2, + lineno=1, col_offset=0, - end_lineno=11, + end_lineno=10, end_col_offset=3), Import( [ alias( - 'toml', - lineno=12, + 'tomlib', + lineno=11, col_offset=7, - end_lineno=12, - end_col_offset=11)], - lineno=12, + end_lineno=11, + end_col_offset=13)], + lineno=11, col_offset=0, - end_lineno=12, - end_col_offset=11), + end_lineno=11, + end_col_offset=13), FunctionDef( 'merge_settings', arguments( @@ -88,15 +88,15 @@ Module( [ arg( 'default_settings', - lineno=14, + lineno=13, col_offset=19, - end_lineno=14, + end_lineno=13, end_col_offset=35), arg( 'toml_file_path', - lineno=14, + lineno=13, col_offset=37, - end_lineno=14, + end_lineno=13, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], @@ -109,35 +109,35 @@ Module( Name( 'open', Load(), - lineno=16, + lineno=15, col_offset=9, - end_lineno=16, + end_lineno=15, end_col_offset=13), [ Name( 'toml_file_path', Load(), - lineno=16, + lineno=15, col_offset=14, - end_lineno=16, + end_lineno=15, end_col_offset=28), Constant( 'r', - lineno=16, + lineno=15, col_offset=30, - end_lineno=16, + end_lineno=15, end_col_offset=33)], [], - lineno=16, + lineno=15, col_offset=9, - end_lineno=16, + end_lineno=15, end_col_offset=34), Name( 'f', Store(), - lineno=16, + lineno=15, col_offset=38, - end_lineno=16, + end_lineno=15, end_col_offset=39))], [ Assign( @@ -145,617 +145,617 @@ Module( Name( 'toml_settings', Store(), - lineno=17, + lineno=16, col_offset=8, - end_lineno=17, + end_lineno=16, end_col_offset=21)], Call( Attribute( Name( - 'toml', + 'tomlib', Load(), - lineno=17, + lineno=16, col_offset=24, - end_lineno=17, - end_col_offset=28), + end_lineno=16, + end_col_offset=30), 'load', Load(), - lineno=17, + lineno=16, col_offset=24, - end_lineno=17, - end_col_offset=33), + end_lineno=16, + end_col_offset=35), [ Name( 'f', Load(), - lineno=17, - col_offset=34, - end_lineno=17, - end_col_offset=35)], + lineno=16, + col_offset=36, + end_lineno=16, + end_col_offset=37)], [], - lineno=17, + lineno=16, col_offset=24, - end_lineno=17, - end_col_offset=36), - lineno=17, + end_lineno=16, + end_col_offset=38), + lineno=16, col_offset=8, - end_lineno=17, - end_col_offset=36)], - lineno=16, + end_lineno=16, + end_col_offset=38)], + lineno=15, col_offset=4, - end_lineno=17, - end_col_offset=36), + end_lineno=16, + end_col_offset=38), Assign( [ Name( 'merged_settings', Store(), - lineno=20, + lineno=19, col_offset=4, - end_lineno=20, + end_lineno=19, end_col_offset=19)], BinOp( Name( 'default_settings', Load(), - lineno=20, + lineno=19, col_offset=22, - end_lineno=20, + end_lineno=19, end_col_offset=38), BitOr(), Name( 'toml_settings', Load(), - lineno=20, + lineno=19, col_offset=41, - end_lineno=20, + end_lineno=19, end_col_offset=54), - lineno=20, + lineno=19, col_offset=22, - end_lineno=20, + end_lineno=19, end_col_offset=54), - lineno=20, + lineno=19, col_offset=4, - end_lineno=20, + end_lineno=19, end_col_offset=54), Return( Name( 'merged_settings', Load(), - lineno=22, + lineno=21, col_offset=11, - end_lineno=22, + end_lineno=21, end_col_offset=26), - lineno=22, + lineno=21, col_offset=4, - end_lineno=22, + end_lineno=21, end_col_offset=26)], [], - lineno=14, + lineno=13, col_offset=0, - end_lineno=22, + end_lineno=21, end_col_offset=26), Assign( [ Name( 'default_settings', Store(), - lineno=25, + lineno=24, col_offset=0, - end_lineno=25, + end_lineno=24, end_col_offset=16)], Dict( [ Constant( 'timeout', - lineno=26, + lineno=25, col_offset=4, - end_lineno=26, + end_lineno=25, end_col_offset=13), Constant( 'retry_count', - lineno=27, + lineno=26, col_offset=4, - end_lineno=27, + end_lineno=26, end_col_offset=17), Constant( 'log_level', - lineno=28, + lineno=27, col_offset=4, - end_lineno=28, + end_lineno=27, end_col_offset=15)], [ Constant( 30, - lineno=26, + lineno=25, col_offset=15, - end_lineno=26, + end_lineno=25, end_col_offset=17), Constant( 3, - lineno=27, + lineno=26, col_offset=19, - end_lineno=27, + end_lineno=26, end_col_offset=20), Constant( 'INFO', - lineno=28, + lineno=27, col_offset=17, - end_lineno=28, + end_lineno=27, end_col_offset=23)], - lineno=25, + lineno=24, col_offset=19, - end_lineno=29, + end_lineno=28, end_col_offset=1), - lineno=25, + lineno=24, col_offset=0, - end_lineno=29, + end_lineno=28, end_col_offset=1), Assign( [ Name( 'toml_file_path', Store(), - lineno=30, + lineno=29, col_offset=0, - end_lineno=30, + end_lineno=29, end_col_offset=14)], Constant( 'settings.toml', - lineno=30, + lineno=29, col_offset=17, - end_lineno=30, + end_lineno=29, end_col_offset=32), - lineno=30, + lineno=29, col_offset=0, - end_lineno=30, + end_lineno=29, end_col_offset=32), Assign( [ Name( 'final_settings', Store(), - lineno=32, + lineno=31, col_offset=0, - end_lineno=32, + end_lineno=31, end_col_offset=14)], Call( Name( 'merge_settings', Load(), - lineno=32, + lineno=31, col_offset=17, - end_lineno=32, + end_lineno=31, end_col_offset=31), [ Name( 'default_settings', Load(), - lineno=32, + lineno=31, col_offset=32, - end_lineno=32, + end_lineno=31, end_col_offset=48), Name( 'toml_file_path', Load(), - lineno=32, + lineno=31, col_offset=50, - end_lineno=32, + end_lineno=31, end_col_offset=64)], [], - lineno=32, + lineno=31, col_offset=17, - end_lineno=32, + end_lineno=31, end_col_offset=65), - lineno=32, + lineno=31, col_offset=0, - end_lineno=32, + end_lineno=31, end_col_offset=65), Expr( Call( Name( 'print', Load(), - lineno=33, + lineno=32, col_offset=0, - end_lineno=33, + end_lineno=32, end_col_offset=5), [ Constant( 'Final Settings:', - lineno=33, + lineno=32, col_offset=6, - end_lineno=33, + end_lineno=32, end_col_offset=23), Name( 'final_settings', Load(), - lineno=33, + lineno=32, col_offset=25, - end_lineno=33, + end_lineno=32, end_col_offset=39)], [], - lineno=33, + lineno=32, col_offset=0, - end_lineno=33, + end_lineno=32, end_col_offset=40), - lineno=33, + lineno=32, col_offset=0, - end_lineno=33, + end_lineno=32, end_col_offset=40), Expr( Constant( ' Examples from PEP584 - Add Union Operators To dict', - lineno=38, + lineno=37, col_offset=0, - end_lineno=38, + end_lineno=37, end_col_offset=57), - lineno=38, + lineno=37, col_offset=0, - end_lineno=38, + end_lineno=37, end_col_offset=57), Assign( [ Name( 'd', Store(), - lineno=39, + lineno=38, col_offset=0, - end_lineno=39, + end_lineno=38, end_col_offset=1)], Dict( [ Constant( 'spam', - lineno=39, + lineno=38, col_offset=5, - end_lineno=39, + end_lineno=38, end_col_offset=11), Constant( 'eggs', - lineno=39, + lineno=38, col_offset=16, - end_lineno=39, + end_lineno=38, end_col_offset=22), Constant( 'cheese', - lineno=39, + lineno=38, col_offset=27, - end_lineno=39, + end_lineno=38, end_col_offset=35)], [ Constant( 1, - lineno=39, + lineno=38, col_offset=13, - end_lineno=39, + end_lineno=38, end_col_offset=14), Constant( 2, - lineno=39, + lineno=38, col_offset=24, - end_lineno=39, + end_lineno=38, end_col_offset=25), Constant( 3, - lineno=39, + lineno=38, col_offset=37, - end_lineno=39, + end_lineno=38, end_col_offset=38)], - lineno=39, + lineno=38, col_offset=4, - end_lineno=39, + end_lineno=38, end_col_offset=39), - lineno=39, + lineno=38, col_offset=0, - end_lineno=39, + end_lineno=38, end_col_offset=39), Assign( [ Name( 'e', Store(), - lineno=40, + lineno=39, col_offset=0, - end_lineno=40, + end_lineno=39, end_col_offset=1)], Dict( [ Constant( 'cheese', - lineno=40, + lineno=39, col_offset=5, - end_lineno=40, + end_lineno=39, end_col_offset=13), Constant( 'aardvark', - lineno=40, + lineno=39, col_offset=26, - end_lineno=40, + end_lineno=39, end_col_offset=36)], [ Constant( 'cheddar', - lineno=40, + lineno=39, col_offset=15, - end_lineno=40, + end_lineno=39, end_col_offset=24), Constant( 'Ethel', - lineno=40, + lineno=39, col_offset=38, - end_lineno=40, + end_lineno=39, end_col_offset=45)], - lineno=40, + lineno=39, col_offset=4, - end_lineno=40, + end_lineno=39, end_col_offset=46), - lineno=40, + lineno=39, col_offset=0, - end_lineno=40, + end_lineno=39, end_col_offset=46), Assign( [ Name( 'x', Store(), - lineno=41, + lineno=42, col_offset=0, - end_lineno=41, + end_lineno=42, end_col_offset=1)], BinOp( Name( 'd', Load(), - lineno=41, + lineno=42, col_offset=4, - end_lineno=41, + end_lineno=42, end_col_offset=5), BitOr(), Name( 'e', Load(), - lineno=41, + lineno=42, col_offset=8, - end_lineno=41, + end_lineno=42, end_col_offset=9), - lineno=41, + lineno=42, col_offset=4, - end_lineno=41, + end_lineno=42, end_col_offset=9), - lineno=41, + lineno=42, col_offset=0, - end_lineno=41, + end_lineno=42, end_col_offset=9), Assign( [ Name( 'y', Store(), - lineno=42, + lineno=43, col_offset=0, - end_lineno=42, + end_lineno=43, end_col_offset=1)], BinOp( Name( 'e', Load(), - lineno=42, + lineno=43, col_offset=4, - end_lineno=42, + end_lineno=43, end_col_offset=5), BitOr(), Name( 'd', Load(), - lineno=42, + lineno=43, col_offset=8, - end_lineno=42, + end_lineno=43, end_col_offset=9), - lineno=42, + lineno=43, col_offset=4, - end_lineno=42, + end_lineno=43, end_col_offset=9), - lineno=42, + lineno=43, col_offset=0, - end_lineno=42, + end_lineno=43, end_col_offset=9), AugAssign( Name( 'd', Store(), - lineno=43, + lineno=44, col_offset=0, - end_lineno=43, + end_lineno=44, end_col_offset=1), BitOr(), Name( 'e', Load(), - lineno=43, + lineno=44, col_offset=5, - end_lineno=43, + end_lineno=44, end_col_offset=6), - lineno=43, + lineno=44, col_offset=0, - end_lineno=43, + end_lineno=44, end_col_offset=6), Expr( Constant( ' Examples from the Cpython unit tests', - lineno=49, + lineno=50, col_offset=0, - end_lineno=49, + end_lineno=50, end_col_offset=43), - lineno=49, + lineno=50, col_offset=0, - end_lineno=49, + end_lineno=50, end_col_offset=43), Assign( [ Name( 'a', Store(), - lineno=50, + lineno=51, col_offset=0, - end_lineno=50, + end_lineno=51, end_col_offset=1)], Dict( [ Constant( 0, - lineno=50, + lineno=51, col_offset=5, - end_lineno=50, + end_lineno=51, end_col_offset=6), Constant( 1, - lineno=50, + lineno=51, col_offset=11, - end_lineno=50, + end_lineno=51, end_col_offset=12), Constant( 2, - lineno=50, + lineno=51, col_offset=17, - end_lineno=50, + end_lineno=51, end_col_offset=18)], [ Constant( 0, - lineno=50, + lineno=51, col_offset=8, - end_lineno=50, + end_lineno=51, end_col_offset=9), Constant( 1, - lineno=50, + lineno=51, col_offset=14, - end_lineno=50, + end_lineno=51, end_col_offset=15), Constant( 1, - lineno=50, + lineno=51, col_offset=20, - end_lineno=50, + end_lineno=51, end_col_offset=21)], - lineno=50, + lineno=51, col_offset=4, - end_lineno=50, + end_lineno=51, end_col_offset=22), - lineno=50, + lineno=51, col_offset=0, - end_lineno=50, + end_lineno=51, end_col_offset=22), Assign( [ Name( 'b', Store(), - lineno=51, + lineno=52, col_offset=0, - end_lineno=51, + end_lineno=52, end_col_offset=1)], Dict( [ Constant( 1, - lineno=51, + lineno=52, col_offset=5, - end_lineno=51, + end_lineno=52, end_col_offset=6), Constant( 2, - lineno=51, + lineno=52, col_offset=11, - end_lineno=51, + end_lineno=52, end_col_offset=12), Constant( 3, - lineno=51, + lineno=52, col_offset=17, - end_lineno=51, + end_lineno=52, end_col_offset=18)], [ Constant( 1, - lineno=51, + lineno=52, col_offset=8, - end_lineno=51, + end_lineno=52, end_col_offset=9), Constant( 2, - lineno=51, + lineno=52, col_offset=14, - end_lineno=51, + end_lineno=52, end_col_offset=15), Constant( 3, - lineno=51, + lineno=52, col_offset=20, - end_lineno=51, + end_lineno=52, end_col_offset=21)], - lineno=51, + lineno=52, col_offset=4, - end_lineno=51, + end_lineno=52, end_col_offset=22), - lineno=51, + lineno=52, col_offset=0, - end_lineno=51, + end_lineno=52, end_col_offset=22), Assign( [ Name( 'c', Store(), - lineno=53, + lineno=54, col_offset=0, - end_lineno=53, + end_lineno=54, end_col_offset=1)], Call( Attribute( Name( 'a', Load(), - lineno=53, + lineno=54, col_offset=4, - end_lineno=53, + end_lineno=54, end_col_offset=5), 'copy', Load(), - lineno=53, + lineno=54, col_offset=4, - end_lineno=53, + end_lineno=54, end_col_offset=10), [], [], - lineno=53, + lineno=54, col_offset=4, - end_lineno=53, + end_lineno=54, end_col_offset=12), - lineno=53, + lineno=54, col_offset=0, - end_lineno=53, + end_lineno=54, end_col_offset=12), AugAssign( Name( 'c', Store(), - lineno=54, + lineno=55, col_offset=0, - end_lineno=54, + end_lineno=55, end_col_offset=1), BitOr(), Name( 'b', Load(), - lineno=54, + lineno=55, col_offset=5, - end_lineno=54, + end_lineno=55, end_col_offset=6), - lineno=54, + lineno=55, col_offset=0, - end_lineno=54, + end_lineno=55, end_col_offset=6), Assert( Compare( @@ -763,21 +763,21 @@ Module( Name( 'a', Load(), - lineno=56, + lineno=57, col_offset=7, - end_lineno=56, + end_lineno=57, end_col_offset=8), BitOr(), Name( 'b', Load(), - lineno=56, + lineno=57, col_offset=11, - end_lineno=56, + end_lineno=57, end_col_offset=12), - lineno=56, + lineno=57, col_offset=7, - end_lineno=56, + end_lineno=57, end_col_offset=12), [ Eq()], @@ -786,73 +786,73 @@ Module( [ Constant( 0, - lineno=56, + lineno=57, col_offset=17, - end_lineno=56, + end_lineno=57, end_col_offset=18), Constant( 1, - lineno=56, + lineno=57, col_offset=23, - end_lineno=56, + end_lineno=57, end_col_offset=24), Constant( 2, - lineno=56, + lineno=57, col_offset=29, - end_lineno=56, + end_lineno=57, end_col_offset=30), Constant( 3, - lineno=56, + lineno=57, col_offset=35, - end_lineno=56, + end_lineno=57, end_col_offset=36)], [ Constant( 0, - lineno=56, + lineno=57, col_offset=20, - end_lineno=56, + end_lineno=57, end_col_offset=21), Constant( 1, - lineno=56, + lineno=57, col_offset=26, - end_lineno=56, + end_lineno=57, end_col_offset=27), Constant( 2, - lineno=56, + lineno=57, col_offset=32, - end_lineno=56, + end_lineno=57, end_col_offset=33), Constant( 3, - lineno=56, + lineno=57, col_offset=38, - end_lineno=56, + end_lineno=57, end_col_offset=39)], - lineno=56, + lineno=57, col_offset=16, - end_lineno=56, + end_lineno=57, end_col_offset=40)], - lineno=56, + lineno=57, col_offset=7, - end_lineno=56, + end_lineno=57, end_col_offset=40), - lineno=56, + lineno=57, col_offset=0, - end_lineno=56, + end_lineno=57, end_col_offset=40), Assert( Compare( Name( 'c', Load(), - lineno=57, + lineno=58, col_offset=7, - end_lineno=57, + end_lineno=58, end_col_offset=8), [ Eq()], @@ -861,118 +861,118 @@ Module( [ Constant( 0, - lineno=57, + lineno=58, col_offset=13, - end_lineno=57, + end_lineno=58, end_col_offset=14), Constant( 1, - lineno=57, + lineno=58, col_offset=19, - end_lineno=57, + end_lineno=58, end_col_offset=20), Constant( 2, - lineno=57, + lineno=58, col_offset=25, - end_lineno=57, + end_lineno=58, end_col_offset=26), Constant( 3, - lineno=57, + lineno=58, col_offset=31, - end_lineno=57, + end_lineno=58, end_col_offset=32)], [ Constant( 0, - lineno=57, + lineno=58, col_offset=16, - end_lineno=57, + end_lineno=58, end_col_offset=17), Constant( 1, - lineno=57, + lineno=58, col_offset=22, - end_lineno=57, + end_lineno=58, end_col_offset=23), Constant( 2, - lineno=57, + lineno=58, col_offset=28, - end_lineno=57, + end_lineno=58, end_col_offset=29), Constant( 3, - lineno=57, + lineno=58, col_offset=34, - end_lineno=57, + end_lineno=58, end_col_offset=35)], - lineno=57, + lineno=58, col_offset=12, - end_lineno=57, + end_lineno=58, end_col_offset=36)], - lineno=57, + lineno=58, col_offset=7, - end_lineno=57, + end_lineno=58, end_col_offset=36), - lineno=57, + lineno=58, col_offset=0, - end_lineno=57, + end_lineno=58, end_col_offset=36), Assign( [ Name( 'c', Store(), - lineno=59, + lineno=60, col_offset=0, - end_lineno=59, + end_lineno=60, end_col_offset=1)], Call( Attribute( Name( 'b', Load(), - lineno=59, + lineno=60, col_offset=4, - end_lineno=59, + end_lineno=60, end_col_offset=5), 'copy', Load(), - lineno=59, + lineno=60, col_offset=4, - end_lineno=59, + end_lineno=60, end_col_offset=10), [], [], - lineno=59, + lineno=60, col_offset=4, - end_lineno=59, + end_lineno=60, end_col_offset=12), - lineno=59, + lineno=60, col_offset=0, - end_lineno=59, + end_lineno=60, end_col_offset=12), AugAssign( Name( 'c', Store(), - lineno=60, + lineno=61, col_offset=0, - end_lineno=60, + end_lineno=61, end_col_offset=1), BitOr(), Name( 'a', Load(), - lineno=60, + lineno=61, col_offset=5, - end_lineno=60, + end_lineno=61, end_col_offset=6), - lineno=60, + lineno=61, col_offset=0, - end_lineno=60, + end_lineno=61, end_col_offset=6), Assert( Compare( @@ -980,21 +980,21 @@ Module( Name( 'b', Load(), - lineno=62, + lineno=63, col_offset=7, - end_lineno=62, + end_lineno=63, end_col_offset=8), BitOr(), Name( 'a', Load(), - lineno=62, + lineno=63, col_offset=11, - end_lineno=62, + end_lineno=63, end_col_offset=12), - lineno=62, + lineno=63, col_offset=7, - end_lineno=62, + end_lineno=63, end_col_offset=12), [ Eq()], @@ -1003,73 +1003,73 @@ Module( [ Constant( 1, - lineno=62, + lineno=63, col_offset=17, - end_lineno=62, + end_lineno=63, end_col_offset=18), Constant( 2, - lineno=62, + lineno=63, col_offset=23, - end_lineno=62, + end_lineno=63, end_col_offset=24), Constant( 3, - lineno=62, + lineno=63, col_offset=29, - end_lineno=62, + end_lineno=63, end_col_offset=30), Constant( 0, - lineno=62, + lineno=63, col_offset=35, - end_lineno=62, + end_lineno=63, end_col_offset=36)], [ Constant( 1, - lineno=62, + lineno=63, col_offset=20, - end_lineno=62, + end_lineno=63, end_col_offset=21), Constant( 1, - lineno=62, + lineno=63, col_offset=26, - end_lineno=62, + end_lineno=63, end_col_offset=27), Constant( 3, - lineno=62, + lineno=63, col_offset=32, - end_lineno=62, + end_lineno=63, end_col_offset=33), Constant( 0, - lineno=62, + lineno=63, col_offset=38, - end_lineno=62, + end_lineno=63, end_col_offset=39)], - lineno=62, + lineno=63, col_offset=16, - end_lineno=62, + end_lineno=63, end_col_offset=40)], - lineno=62, + lineno=63, col_offset=7, - end_lineno=62, + end_lineno=63, end_col_offset=40), - lineno=62, + lineno=63, col_offset=0, - end_lineno=62, + end_lineno=63, end_col_offset=40), Assert( Compare( Name( 'c', Load(), - lineno=63, + lineno=64, col_offset=7, - end_lineno=63, + end_lineno=64, end_col_offset=8), [ Eq()], @@ -1078,106 +1078,106 @@ Module( [ Constant( 1, - lineno=63, + lineno=64, col_offset=13, - end_lineno=63, + end_lineno=64, end_col_offset=14), Constant( 2, - lineno=63, + lineno=64, col_offset=19, - end_lineno=63, + end_lineno=64, end_col_offset=20), Constant( 3, - lineno=63, + lineno=64, col_offset=25, - end_lineno=63, + end_lineno=64, end_col_offset=26), Constant( 0, - lineno=63, + lineno=64, col_offset=31, - end_lineno=63, + end_lineno=64, end_col_offset=32)], [ Constant( 1, - lineno=63, + lineno=64, col_offset=16, - end_lineno=63, + end_lineno=64, end_col_offset=17), Constant( 1, - lineno=63, + lineno=64, col_offset=22, - end_lineno=63, + end_lineno=64, end_col_offset=23), Constant( 3, - lineno=63, + lineno=64, col_offset=28, - end_lineno=63, + end_lineno=64, end_col_offset=29), Constant( 0, - lineno=63, + lineno=64, col_offset=34, - end_lineno=63, + end_lineno=64, end_col_offset=35)], - lineno=63, + lineno=64, col_offset=12, - end_lineno=63, + end_lineno=64, end_col_offset=36)], - lineno=63, + lineno=64, col_offset=7, - end_lineno=63, + end_lineno=64, end_col_offset=36), - lineno=63, + lineno=64, col_offset=0, - end_lineno=63, + end_lineno=64, end_col_offset=36), Assign( [ Name( 'c', Store(), - lineno=65, + lineno=66, col_offset=0, - end_lineno=65, + end_lineno=66, end_col_offset=1)], Call( Attribute( Name( 'a', Load(), - lineno=65, + lineno=66, col_offset=4, - end_lineno=65, + end_lineno=66, end_col_offset=5), 'copy', Load(), - lineno=65, + lineno=66, col_offset=4, - end_lineno=65, + end_lineno=66, end_col_offset=10), [], [], - lineno=65, + lineno=66, col_offset=4, - end_lineno=65, + end_lineno=66, end_col_offset=12), - lineno=65, + lineno=66, col_offset=0, - end_lineno=65, + end_lineno=66, end_col_offset=12), AugAssign( Name( 'c', Store(), - lineno=66, + lineno=67, col_offset=0, - end_lineno=66, + end_lineno=67, end_col_offset=1), BitOr(), List( @@ -1186,76 +1186,76 @@ Module( [ Constant( 1, - lineno=66, + lineno=67, col_offset=7, - end_lineno=66, + end_lineno=67, end_col_offset=8), Constant( 1, - lineno=66, + lineno=67, col_offset=10, - end_lineno=66, + end_lineno=67, end_col_offset=11)], Load(), - lineno=66, + lineno=67, col_offset=6, - end_lineno=66, + end_lineno=67, end_col_offset=12), Tuple( [ Constant( 2, - lineno=66, + lineno=67, col_offset=15, - end_lineno=66, + end_lineno=67, end_col_offset=16), Constant( 2, - lineno=66, + lineno=67, col_offset=18, - end_lineno=66, + end_lineno=67, end_col_offset=19)], Load(), - lineno=66, + lineno=67, col_offset=14, - end_lineno=66, + end_lineno=67, end_col_offset=20), Tuple( [ Constant( 3, - lineno=66, + lineno=67, col_offset=23, - end_lineno=66, + end_lineno=67, end_col_offset=24), Constant( 3, - lineno=66, + lineno=67, col_offset=26, - end_lineno=66, + end_lineno=67, end_col_offset=27)], Load(), - lineno=66, + lineno=67, col_offset=22, - end_lineno=66, + end_lineno=67, end_col_offset=28)], Load(), - lineno=66, + lineno=67, col_offset=5, - end_lineno=66, + end_lineno=67, end_col_offset=29), - lineno=66, + lineno=67, col_offset=0, - end_lineno=66, + end_lineno=67, end_col_offset=29), Assert( Compare( Name( 'c', Load(), - lineno=68, + lineno=69, col_offset=7, - end_lineno=68, + end_lineno=69, end_col_offset=8), [ Eq()], @@ -1264,75 +1264,75 @@ Module( [ Constant( 0, - lineno=68, + lineno=69, col_offset=13, - end_lineno=68, + end_lineno=69, end_col_offset=14), Constant( 1, - lineno=68, + lineno=69, col_offset=19, - end_lineno=68, + end_lineno=69, end_col_offset=20), Constant( 2, - lineno=68, + lineno=69, col_offset=25, - end_lineno=68, + end_lineno=69, end_col_offset=26), Constant( 3, - lineno=68, + lineno=69, col_offset=31, - end_lineno=68, + end_lineno=69, end_col_offset=32)], [ Constant( 0, - lineno=68, + lineno=69, col_offset=16, - end_lineno=68, + end_lineno=69, end_col_offset=17), Constant( 1, - lineno=68, + lineno=69, col_offset=22, - end_lineno=68, + end_lineno=69, end_col_offset=23), Constant( 2, - lineno=68, + lineno=69, col_offset=28, - end_lineno=68, + end_lineno=69, end_col_offset=29), Constant( 3, - lineno=68, + lineno=69, col_offset=34, - end_lineno=68, + end_lineno=69, end_col_offset=35)], - lineno=68, + lineno=69, col_offset=12, - end_lineno=68, + end_lineno=69, end_col_offset=36)], - lineno=68, + lineno=69, col_offset=7, - end_lineno=68, + end_lineno=69, end_col_offset=36), - lineno=68, + lineno=69, col_offset=0, - end_lineno=68, + end_lineno=69, end_col_offset=36), Expr( Constant( ' Example from `alphametrics` exercise ', - lineno=73, + lineno=74, col_offset=0, - end_lineno=73, + end_lineno=74, end_col_offset=44), - lineno=73, + lineno=74, col_offset=0, - end_lineno=73, + end_lineno=74, end_col_offset=44), FunctionDef( 'assign', @@ -1341,27 +1341,27 @@ Module( [ arg( 'letters', - lineno=74, + lineno=75, col_offset=11, - end_lineno=74, + end_lineno=75, end_col_offset=18), arg( 'selections', - lineno=74, + lineno=75, col_offset=20, - end_lineno=74, + end_lineno=75, end_col_offset=30), arg( 'lefty', - lineno=74, + lineno=75, col_offset=32, - end_lineno=74, + end_lineno=75, end_col_offset=37), arg( 'righty', - lineno=74, + lineno=75, col_offset=39, - end_lineno=74, + end_lineno=75, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], @@ -1371,9 +1371,9 @@ Module( Name( 'letters', Load(), - lineno=75, + lineno=76, col_offset=10, - end_lineno=75, + end_lineno=76, end_col_offset=17), [ Assign( @@ -1381,35 +1381,35 @@ Module( Name( 'new_selections', Store(), - lineno=76, + lineno=77, col_offset=8, - end_lineno=76, + end_lineno=77, end_col_offset=22)], List( [], Load(), - lineno=76, + lineno=77, col_offset=25, - end_lineno=76, + end_lineno=77, end_col_offset=27), - lineno=76, + lineno=77, col_offset=8, - end_lineno=76, + end_lineno=77, end_col_offset=27), For( Name( 'selection', Store(), - lineno=78, + lineno=79, col_offset=12, - end_lineno=78, + end_lineno=79, end_col_offset=21), Name( 'selections', Load(), - lineno=78, + lineno=79, col_offset=25, - end_lineno=78, + end_lineno=79, end_col_offset=35), [ Assign( @@ -1419,32 +1419,32 @@ Module( Name( 'slc', Store(), - lineno=79, + lineno=80, col_offset=12, - end_lineno=79, + end_lineno=80, end_col_offset=15), Name( 'choices', Store(), - lineno=79, + lineno=80, col_offset=17, - end_lineno=79, + end_lineno=80, end_col_offset=24)], Store(), - lineno=79, + lineno=80, col_offset=12, - end_lineno=79, + end_lineno=80, end_col_offset=24)], Name( 'selection', Load(), - lineno=79, + lineno=80, col_offset=27, - end_lineno=79, + end_lineno=80, end_col_offset=36), - lineno=79, + lineno=80, col_offset=12, - end_lineno=79, + end_lineno=80, end_col_offset=36), If( Compare( @@ -1452,20 +1452,20 @@ Module( Name( 'letters', Load(), - lineno=81, + lineno=82, col_offset=15, - end_lineno=81, + end_lineno=82, end_col_offset=22), Constant( 0, - lineno=81, + lineno=82, col_offset=23, - end_lineno=81, + end_lineno=82, end_col_offset=24), Load(), - lineno=81, + lineno=82, col_offset=15, - end_lineno=81, + end_lineno=82, end_col_offset=25), [ In()], @@ -1475,25 +1475,25 @@ Module( Name( 'lefty', Load(), - lineno=81, + lineno=82, col_offset=30, - end_lineno=81, + end_lineno=82, end_col_offset=35), Name( 'righty', Load(), - lineno=81, + lineno=82, col_offset=37, - end_lineno=81, + end_lineno=82, end_col_offset=43)], Load(), - lineno=81, + lineno=82, col_offset=29, - end_lineno=81, + end_lineno=82, end_col_offset=44)], - lineno=81, + lineno=82, col_offset=15, - end_lineno=81, + end_lineno=82, end_col_offset=44), [ Assign( @@ -1501,53 +1501,53 @@ Module( Name( 'curr_choices', Store(), - lineno=82, + lineno=83, col_offset=16, - end_lineno=82, + end_lineno=83, end_col_offset=28)], BinOp( Name( 'choices', Load(), - lineno=82, + lineno=83, col_offset=31, - end_lineno=82, + end_lineno=83, end_col_offset=38), Sub(), Call( Name( 'set', Load(), - lineno=82, + lineno=83, col_offset=41, - end_lineno=82, + end_lineno=83, end_col_offset=44), [ List( [ Constant( 0, - lineno=82, + lineno=83, col_offset=46, - end_lineno=82, + end_lineno=83, end_col_offset=47)], Load(), - lineno=82, + lineno=83, col_offset=45, - end_lineno=82, + end_lineno=83, end_col_offset=48)], [], - lineno=82, + lineno=83, col_offset=41, - end_lineno=82, + end_lineno=83, end_col_offset=49), - lineno=82, + lineno=83, col_offset=31, - end_lineno=82, + end_lineno=83, end_col_offset=49), - lineno=82, + lineno=83, col_offset=16, - end_lineno=82, + end_lineno=83, end_col_offset=49)], [ Assign( @@ -1555,39 +1555,39 @@ Module( Name( 'curr_choices', Store(), - lineno=85, + lineno=86, col_offset=16, - end_lineno=85, + end_lineno=86, end_col_offset=28)], Name( 'choices', Load(), - lineno=85, + lineno=86, col_offset=31, - end_lineno=85, + end_lineno=86, end_col_offset=38), - lineno=85, + lineno=86, col_offset=16, - end_lineno=85, + end_lineno=86, end_col_offset=38)], - lineno=81, + lineno=82, col_offset=12, - end_lineno=85, + end_lineno=86, end_col_offset=38), For( Name( 'i', Store(), - lineno=87, + lineno=88, col_offset=16, - end_lineno=87, + end_lineno=88, end_col_offset=17), Name( 'curr_choices', Load(), - lineno=87, + lineno=88, col_offset=21, - end_lineno=87, + end_lineno=88, end_col_offset=33), [ Assign( @@ -1595,17 +1595,17 @@ Module( Name( 'actual', Store(), - lineno=88, + lineno=89, col_offset=16, - end_lineno=88, + end_lineno=89, end_col_offset=22)], BinOp( Name( 'slc', Load(), - lineno=88, + lineno=89, col_offset=25, - end_lineno=88, + end_lineno=89, end_col_offset=28), BitOr(), Dict( @@ -1614,40 +1614,40 @@ Module( Name( 'letters', Load(), - lineno=88, + lineno=89, col_offset=32, - end_lineno=88, + end_lineno=89, end_col_offset=39), Constant( 0, - lineno=88, + lineno=89, col_offset=40, - end_lineno=88, + end_lineno=89, end_col_offset=41), Load(), - lineno=88, + lineno=89, col_offset=32, - end_lineno=88, + end_lineno=89, end_col_offset=42)], [ Name( 'i', Load(), - lineno=88, + lineno=89, col_offset=44, - end_lineno=88, + end_lineno=89, end_col_offset=45)], - lineno=88, + lineno=89, col_offset=31, - end_lineno=88, + end_lineno=89, end_col_offset=46), - lineno=88, + lineno=89, col_offset=25, - end_lineno=88, + end_lineno=89, end_col_offset=46), - lineno=88, + lineno=89, col_offset=16, - end_lineno=88, + end_lineno=89, end_col_offset=46), Expr( Call( @@ -1655,15 +1655,15 @@ Module( Name( 'new_selections', Load(), - lineno=89, + lineno=90, col_offset=16, - end_lineno=89, + end_lineno=90, end_col_offset=30), 'append', Load(), - lineno=89, + lineno=90, col_offset=16, - end_lineno=89, + end_lineno=90, end_col_offset=37), [ Tuple( @@ -1671,26 +1671,26 @@ Module( Name( 'actual', Load(), - lineno=89, + lineno=90, col_offset=39, - end_lineno=89, + end_lineno=90, end_col_offset=45), BinOp( Name( 'choices', Load(), - lineno=89, + lineno=90, col_offset=47, - end_lineno=89, + end_lineno=90, end_col_offset=54), Sub(), Call( Name( 'set', Load(), - lineno=89, + lineno=90, col_offset=57, - end_lineno=89, + end_lineno=90, end_col_offset=60), [ List( @@ -1698,118 +1698,118 @@ Module( Name( 'i', Load(), - lineno=89, + lineno=90, col_offset=62, - end_lineno=89, + end_lineno=90, end_col_offset=63)], Load(), - lineno=89, + lineno=90, col_offset=61, - end_lineno=89, + end_lineno=90, end_col_offset=64)], [], - lineno=89, + lineno=90, col_offset=57, - end_lineno=89, + end_lineno=90, end_col_offset=65), - lineno=89, + lineno=90, col_offset=47, - end_lineno=89, + end_lineno=90, end_col_offset=65)], Load(), - lineno=89, + lineno=90, col_offset=38, - end_lineno=89, + end_lineno=90, end_col_offset=66)], [], - lineno=89, + lineno=90, col_offset=16, - end_lineno=89, + end_lineno=90, end_col_offset=67), - lineno=89, + lineno=90, col_offset=16, - end_lineno=89, + end_lineno=90, end_col_offset=67)], [], - lineno=87, + lineno=88, col_offset=12, - end_lineno=89, + end_lineno=90, end_col_offset=67)], [], - lineno=78, + lineno=79, col_offset=8, - end_lineno=89, + end_lineno=90, end_col_offset=67), Assign( [ Name( 'selections', Store(), - lineno=91, + lineno=92, col_offset=8, - end_lineno=91, + end_lineno=92, end_col_offset=18)], Name( 'new_selections', Load(), - lineno=91, + lineno=92, col_offset=21, - end_lineno=91, + end_lineno=92, end_col_offset=35), - lineno=91, + lineno=92, col_offset=8, - end_lineno=91, + end_lineno=92, end_col_offset=35), Assign( [ Name( 'letters', Store(), - lineno=92, + lineno=93, col_offset=8, - end_lineno=92, + end_lineno=93, end_col_offset=15)], Subscript( Name( 'letters', Load(), - lineno=92, + lineno=93, col_offset=18, - end_lineno=92, + end_lineno=93, end_col_offset=25), Slice( Constant( 1, - lineno=92, + lineno=93, col_offset=26, - end_lineno=92, + end_lineno=93, end_col_offset=27), - lineno=92, + lineno=93, col_offset=26, - end_lineno=92, + end_lineno=93, end_col_offset=28), Load(), - lineno=92, + lineno=93, col_offset=18, - end_lineno=92, + end_lineno=93, end_col_offset=29), - lineno=92, + lineno=93, col_offset=8, - end_lineno=92, + end_lineno=93, end_col_offset=29)], [], - lineno=75, + lineno=76, col_offset=4, - end_lineno=92, + end_lineno=93, end_col_offset=29), Return( ListComp( Name( 'slc', Load(), - lineno=93, + lineno=94, col_offset=12, - end_lineno=93, + end_lineno=94, end_col_offset=15), [ comprehension( @@ -1818,43 +1818,43 @@ Module( Name( 'slc', Store(), - lineno=93, + lineno=94, col_offset=20, - end_lineno=93, + end_lineno=94, end_col_offset=23), Name( '_', Store(), - lineno=93, + lineno=94, col_offset=25, - end_lineno=93, + end_lineno=94, end_col_offset=26)], Store(), - lineno=93, + lineno=94, col_offset=20, - end_lineno=93, + end_lineno=94, end_col_offset=26), Name( 'selections', Load(), - lineno=93, + lineno=94, col_offset=30, - end_lineno=93, + end_lineno=94, end_col_offset=40), [], 0)], - lineno=93, + lineno=94, col_offset=11, - end_lineno=93, + end_lineno=94, end_col_offset=41), - lineno=93, + lineno=94, col_offset=4, - end_lineno=93, + end_lineno=94, end_col_offset=41)], [], - lineno=74, + lineno=75, col_offset=0, - end_lineno=93, + end_lineno=94, end_col_offset=41)], []) ## END TREE BEFORE ## @@ -1865,15 +1865,15 @@ Module( Import( [ alias( - 'toml', - lineno=12, + 'tomlib', + lineno=11, col_offset=7, - end_lineno=12, - end_col_offset=11)], - lineno=12, + end_lineno=11, + end_col_offset=13)], + lineno=11, col_offset=0, - end_lineno=12, - end_col_offset=11), + end_lineno=11, + end_col_offset=13), FunctionDef( 'placeholder_0', arguments( @@ -1881,15 +1881,15 @@ Module( [ arg( 'placeholder_1', - lineno=14, + lineno=13, col_offset=19, - end_lineno=14, + end_lineno=13, end_col_offset=35), arg( 'placeholder_2', - lineno=14, + lineno=13, col_offset=37, - end_lineno=14, + end_lineno=13, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], @@ -1902,35 +1902,35 @@ Module( Name( 'open', Load(), - lineno=16, + lineno=15, col_offset=9, - end_lineno=16, + end_lineno=15, end_col_offset=13), [ Name( 'placeholder_2', Load(), - lineno=16, + lineno=15, col_offset=14, - end_lineno=16, + end_lineno=15, end_col_offset=28), Constant( 'r', - lineno=16, + lineno=15, col_offset=30, - end_lineno=16, + end_lineno=15, end_col_offset=33)], [], - lineno=16, + lineno=15, col_offset=9, - end_lineno=16, + end_lineno=15, end_col_offset=34), Name( 'placeholder_3', Store(), - lineno=16, + lineno=15, col_offset=38, - end_lineno=16, + end_lineno=15, end_col_offset=39))], [ Assign( @@ -1938,585 +1938,585 @@ Module( Name( 'placeholder_4', Store(), - lineno=17, + lineno=16, col_offset=8, - end_lineno=17, + end_lineno=16, end_col_offset=21)], Call( Attribute( Name( - 'toml', + 'tomlib', Load(), - lineno=17, + lineno=16, col_offset=24, - end_lineno=17, - end_col_offset=28), + end_lineno=16, + end_col_offset=30), 'load', Load(), - lineno=17, + lineno=16, col_offset=24, - end_lineno=17, - end_col_offset=33), + end_lineno=16, + end_col_offset=35), [ Name( 'placeholder_3', Load(), - lineno=17, - col_offset=34, - end_lineno=17, - end_col_offset=35)], + lineno=16, + col_offset=36, + end_lineno=16, + end_col_offset=37)], [], - lineno=17, + lineno=16, col_offset=24, - end_lineno=17, - end_col_offset=36), - lineno=17, + end_lineno=16, + end_col_offset=38), + lineno=16, col_offset=8, - end_lineno=17, - end_col_offset=36)], - lineno=16, + end_lineno=16, + end_col_offset=38)], + lineno=15, col_offset=4, - end_lineno=17, - end_col_offset=36), + end_lineno=16, + end_col_offset=38), Assign( [ Name( 'placeholder_5', Store(), - lineno=20, + lineno=19, col_offset=4, - end_lineno=20, + end_lineno=19, end_col_offset=19)], BinOp( Name( 'placeholder_1', Load(), - lineno=20, + lineno=19, col_offset=22, - end_lineno=20, + end_lineno=19, end_col_offset=38), BitOr(), Name( 'placeholder_4', Load(), - lineno=20, + lineno=19, col_offset=41, - end_lineno=20, + end_lineno=19, end_col_offset=54), - lineno=20, + lineno=19, col_offset=22, - end_lineno=20, + end_lineno=19, end_col_offset=54), - lineno=20, + lineno=19, col_offset=4, - end_lineno=20, + end_lineno=19, end_col_offset=54), Return( Name( 'placeholder_5', Load(), - lineno=22, + lineno=21, col_offset=11, - end_lineno=22, + end_lineno=21, end_col_offset=26), - lineno=22, + lineno=21, col_offset=4, - end_lineno=22, + end_lineno=21, end_col_offset=26)], [], - lineno=14, + lineno=13, col_offset=0, - end_lineno=22, + end_lineno=21, end_col_offset=26), Assign( [ Name( 'placeholder_1', Store(), - lineno=25, + lineno=24, col_offset=0, - end_lineno=25, + end_lineno=24, end_col_offset=16)], Dict( [ Constant( 'timeout', - lineno=26, + lineno=25, col_offset=4, - end_lineno=26, + end_lineno=25, end_col_offset=13), Constant( 'retry_count', - lineno=27, + lineno=26, col_offset=4, - end_lineno=27, + end_lineno=26, end_col_offset=17), Constant( 'log_level', - lineno=28, + lineno=27, col_offset=4, - end_lineno=28, + end_lineno=27, end_col_offset=15)], [ Constant( 30, - lineno=26, + lineno=25, col_offset=15, - end_lineno=26, + end_lineno=25, end_col_offset=17), Constant( 3, - lineno=27, + lineno=26, col_offset=19, - end_lineno=27, + end_lineno=26, end_col_offset=20), Constant( 'INFO', - lineno=28, + lineno=27, col_offset=17, - end_lineno=28, + end_lineno=27, end_col_offset=23)], - lineno=25, + lineno=24, col_offset=19, - end_lineno=29, + end_lineno=28, end_col_offset=1), - lineno=25, + lineno=24, col_offset=0, - end_lineno=29, + end_lineno=28, end_col_offset=1), Assign( [ Name( 'placeholder_2', Store(), - lineno=30, + lineno=29, col_offset=0, - end_lineno=30, + end_lineno=29, end_col_offset=14)], Constant( 'settings.toml', - lineno=30, + lineno=29, col_offset=17, - end_lineno=30, + end_lineno=29, end_col_offset=32), - lineno=30, + lineno=29, col_offset=0, - end_lineno=30, + end_lineno=29, end_col_offset=32), Assign( [ Name( 'placeholder_6', Store(), - lineno=32, + lineno=31, col_offset=0, - end_lineno=32, + end_lineno=31, end_col_offset=14)], Call( Name( 'placeholder_0', Load(), - lineno=32, + lineno=31, col_offset=17, - end_lineno=32, + end_lineno=31, end_col_offset=31), [ Name( 'placeholder_1', Load(), - lineno=32, + lineno=31, col_offset=32, - end_lineno=32, + end_lineno=31, end_col_offset=48), Name( 'placeholder_2', Load(), - lineno=32, + lineno=31, col_offset=50, - end_lineno=32, + end_lineno=31, end_col_offset=64)], [], - lineno=32, + lineno=31, col_offset=17, - end_lineno=32, + end_lineno=31, end_col_offset=65), - lineno=32, + lineno=31, col_offset=0, - end_lineno=32, + end_lineno=31, end_col_offset=65), Expr( Constant( ' Examples from PEP584 - Add Union Operators To dict', - lineno=38, + lineno=37, col_offset=0, - end_lineno=38, + end_lineno=37, end_col_offset=57), - lineno=38, + lineno=37, col_offset=0, - end_lineno=38, + end_lineno=37, end_col_offset=57), Assign( [ Name( 'placeholder_7', Store(), - lineno=39, + lineno=38, col_offset=0, - end_lineno=39, + end_lineno=38, end_col_offset=1)], Dict( [ Constant( 'spam', - lineno=39, + lineno=38, col_offset=5, - end_lineno=39, + end_lineno=38, end_col_offset=11), Constant( 'eggs', - lineno=39, + lineno=38, col_offset=16, - end_lineno=39, + end_lineno=38, end_col_offset=22), Constant( 'cheese', - lineno=39, + lineno=38, col_offset=27, - end_lineno=39, + end_lineno=38, end_col_offset=35)], [ Constant( 1, - lineno=39, + lineno=38, col_offset=13, - end_lineno=39, + end_lineno=38, end_col_offset=14), Constant( 2, - lineno=39, + lineno=38, col_offset=24, - end_lineno=39, + end_lineno=38, end_col_offset=25), Constant( 3, - lineno=39, + lineno=38, col_offset=37, - end_lineno=39, + end_lineno=38, end_col_offset=38)], - lineno=39, + lineno=38, col_offset=4, - end_lineno=39, + end_lineno=38, end_col_offset=39), - lineno=39, + lineno=38, col_offset=0, - end_lineno=39, + end_lineno=38, end_col_offset=39), Assign( [ Name( 'placeholder_8', Store(), - lineno=40, + lineno=39, col_offset=0, - end_lineno=40, + end_lineno=39, end_col_offset=1)], Dict( [ Constant( 'cheese', - lineno=40, + lineno=39, col_offset=5, - end_lineno=40, + end_lineno=39, end_col_offset=13), Constant( 'aardvark', - lineno=40, + lineno=39, col_offset=26, - end_lineno=40, + end_lineno=39, end_col_offset=36)], [ Constant( 'cheddar', - lineno=40, + lineno=39, col_offset=15, - end_lineno=40, + end_lineno=39, end_col_offset=24), Constant( 'Ethel', - lineno=40, + lineno=39, col_offset=38, - end_lineno=40, + end_lineno=39, end_col_offset=45)], - lineno=40, + lineno=39, col_offset=4, - end_lineno=40, + end_lineno=39, end_col_offset=46), - lineno=40, + lineno=39, col_offset=0, - end_lineno=40, + end_lineno=39, end_col_offset=46), Assign( [ Name( 'placeholder_9', Store(), - lineno=41, + lineno=42, col_offset=0, - end_lineno=41, + end_lineno=42, end_col_offset=1)], BinOp( Name( 'placeholder_7', Load(), - lineno=41, + lineno=42, col_offset=4, - end_lineno=41, + end_lineno=42, end_col_offset=5), BitOr(), Name( 'placeholder_8', Load(), - lineno=41, + lineno=42, col_offset=8, - end_lineno=41, + end_lineno=42, end_col_offset=9), - lineno=41, + lineno=42, col_offset=4, - end_lineno=41, + end_lineno=42, end_col_offset=9), - lineno=41, + lineno=42, col_offset=0, - end_lineno=41, + end_lineno=42, end_col_offset=9), Assign( [ Name( 'placeholder_10', Store(), - lineno=42, + lineno=43, col_offset=0, - end_lineno=42, + end_lineno=43, end_col_offset=1)], BinOp( Name( 'placeholder_8', Load(), - lineno=42, + lineno=43, col_offset=4, - end_lineno=42, + end_lineno=43, end_col_offset=5), BitOr(), Name( 'placeholder_7', Load(), - lineno=42, + lineno=43, col_offset=8, - end_lineno=42, + end_lineno=43, end_col_offset=9), - lineno=42, + lineno=43, col_offset=4, - end_lineno=42, + end_lineno=43, end_col_offset=9), - lineno=42, + lineno=43, col_offset=0, - end_lineno=42, + end_lineno=43, end_col_offset=9), AugAssign( Name( 'placeholder_7', Store(), - lineno=43, + lineno=44, col_offset=0, - end_lineno=43, + end_lineno=44, end_col_offset=1), BitOr(), Name( 'placeholder_8', Load(), - lineno=43, + lineno=44, col_offset=5, - end_lineno=43, + end_lineno=44, end_col_offset=6), - lineno=43, + lineno=44, col_offset=0, - end_lineno=43, + end_lineno=44, end_col_offset=6), Expr( Constant( ' Examples from the Cpython unit tests', - lineno=49, + lineno=50, col_offset=0, - end_lineno=49, + end_lineno=50, end_col_offset=43), - lineno=49, + lineno=50, col_offset=0, - end_lineno=49, + end_lineno=50, end_col_offset=43), Assign( [ Name( 'placeholder_11', Store(), - lineno=50, + lineno=51, col_offset=0, - end_lineno=50, + end_lineno=51, end_col_offset=1)], Dict( [ Constant( 0, - lineno=50, + lineno=51, col_offset=5, - end_lineno=50, + end_lineno=51, end_col_offset=6), Constant( 1, - lineno=50, + lineno=51, col_offset=11, - end_lineno=50, + end_lineno=51, end_col_offset=12), Constant( 2, - lineno=50, + lineno=51, col_offset=17, - end_lineno=50, + end_lineno=51, end_col_offset=18)], [ Constant( 0, - lineno=50, + lineno=51, col_offset=8, - end_lineno=50, + end_lineno=51, end_col_offset=9), Constant( 1, - lineno=50, + lineno=51, col_offset=14, - end_lineno=50, + end_lineno=51, end_col_offset=15), Constant( 1, - lineno=50, + lineno=51, col_offset=20, - end_lineno=50, + end_lineno=51, end_col_offset=21)], - lineno=50, + lineno=51, col_offset=4, - end_lineno=50, + end_lineno=51, end_col_offset=22), - lineno=50, + lineno=51, col_offset=0, - end_lineno=50, + end_lineno=51, end_col_offset=22), Assign( [ Name( 'placeholder_12', Store(), - lineno=51, + lineno=52, col_offset=0, - end_lineno=51, + end_lineno=52, end_col_offset=1)], Dict( [ Constant( 1, - lineno=51, + lineno=52, col_offset=5, - end_lineno=51, + end_lineno=52, end_col_offset=6), Constant( 2, - lineno=51, + lineno=52, col_offset=11, - end_lineno=51, + end_lineno=52, end_col_offset=12), Constant( 3, - lineno=51, + lineno=52, col_offset=17, - end_lineno=51, + end_lineno=52, end_col_offset=18)], [ Constant( 1, - lineno=51, + lineno=52, col_offset=8, - end_lineno=51, + end_lineno=52, end_col_offset=9), Constant( 2, - lineno=51, + lineno=52, col_offset=14, - end_lineno=51, + end_lineno=52, end_col_offset=15), Constant( 3, - lineno=51, + lineno=52, col_offset=20, - end_lineno=51, + end_lineno=52, end_col_offset=21)], - lineno=51, + lineno=52, col_offset=4, - end_lineno=51, + end_lineno=52, end_col_offset=22), - lineno=51, + lineno=52, col_offset=0, - end_lineno=51, + end_lineno=52, end_col_offset=22), Assign( [ Name( 'placeholder_13', Store(), - lineno=53, + lineno=54, col_offset=0, - end_lineno=53, + end_lineno=54, end_col_offset=1)], Call( Attribute( Name( 'placeholder_11', Load(), - lineno=53, + lineno=54, col_offset=4, - end_lineno=53, + end_lineno=54, end_col_offset=5), 'copy', Load(), - lineno=53, + lineno=54, col_offset=4, - end_lineno=53, + end_lineno=54, end_col_offset=10), [], [], - lineno=53, + lineno=54, col_offset=4, - end_lineno=53, + end_lineno=54, end_col_offset=12), - lineno=53, + lineno=54, col_offset=0, - end_lineno=53, + end_lineno=54, end_col_offset=12), AugAssign( Name( 'placeholder_13', Store(), - lineno=54, + lineno=55, col_offset=0, - end_lineno=54, + end_lineno=55, end_col_offset=1), BitOr(), Name( 'placeholder_12', Load(), - lineno=54, + lineno=55, col_offset=5, - end_lineno=54, + end_lineno=55, end_col_offset=6), - lineno=54, + lineno=55, col_offset=0, - end_lineno=54, + end_lineno=55, end_col_offset=6), Assert( Compare( @@ -2524,21 +2524,21 @@ Module( Name( 'placeholder_11', Load(), - lineno=56, + lineno=57, col_offset=7, - end_lineno=56, + end_lineno=57, end_col_offset=8), BitOr(), Name( 'placeholder_12', Load(), - lineno=56, + lineno=57, col_offset=11, - end_lineno=56, + end_lineno=57, end_col_offset=12), - lineno=56, + lineno=57, col_offset=7, - end_lineno=56, + end_lineno=57, end_col_offset=12), [ Eq()], @@ -2547,73 +2547,73 @@ Module( [ Constant( 0, - lineno=56, + lineno=57, col_offset=17, - end_lineno=56, + end_lineno=57, end_col_offset=18), Constant( 1, - lineno=56, + lineno=57, col_offset=23, - end_lineno=56, + end_lineno=57, end_col_offset=24), Constant( 2, - lineno=56, + lineno=57, col_offset=29, - end_lineno=56, + end_lineno=57, end_col_offset=30), Constant( 3, - lineno=56, + lineno=57, col_offset=35, - end_lineno=56, + end_lineno=57, end_col_offset=36)], [ Constant( 0, - lineno=56, + lineno=57, col_offset=20, - end_lineno=56, + end_lineno=57, end_col_offset=21), Constant( 1, - lineno=56, + lineno=57, col_offset=26, - end_lineno=56, + end_lineno=57, end_col_offset=27), Constant( 2, - lineno=56, + lineno=57, col_offset=32, - end_lineno=56, + end_lineno=57, end_col_offset=33), Constant( 3, - lineno=56, + lineno=57, col_offset=38, - end_lineno=56, + end_lineno=57, end_col_offset=39)], - lineno=56, + lineno=57, col_offset=16, - end_lineno=56, + end_lineno=57, end_col_offset=40)], - lineno=56, + lineno=57, col_offset=7, - end_lineno=56, + end_lineno=57, end_col_offset=40), - lineno=56, + lineno=57, col_offset=0, - end_lineno=56, + end_lineno=57, end_col_offset=40), Assert( Compare( Name( 'placeholder_13', Load(), - lineno=57, + lineno=58, col_offset=7, - end_lineno=57, + end_lineno=58, end_col_offset=8), [ Eq()], @@ -2622,118 +2622,118 @@ Module( [ Constant( 0, - lineno=57, + lineno=58, col_offset=13, - end_lineno=57, + end_lineno=58, end_col_offset=14), Constant( 1, - lineno=57, + lineno=58, col_offset=19, - end_lineno=57, + end_lineno=58, end_col_offset=20), Constant( 2, - lineno=57, + lineno=58, col_offset=25, - end_lineno=57, + end_lineno=58, end_col_offset=26), Constant( 3, - lineno=57, + lineno=58, col_offset=31, - end_lineno=57, + end_lineno=58, end_col_offset=32)], [ Constant( 0, - lineno=57, + lineno=58, col_offset=16, - end_lineno=57, + end_lineno=58, end_col_offset=17), Constant( 1, - lineno=57, + lineno=58, col_offset=22, - end_lineno=57, + end_lineno=58, end_col_offset=23), Constant( 2, - lineno=57, + lineno=58, col_offset=28, - end_lineno=57, + end_lineno=58, end_col_offset=29), Constant( 3, - lineno=57, + lineno=58, col_offset=34, - end_lineno=57, + end_lineno=58, end_col_offset=35)], - lineno=57, + lineno=58, col_offset=12, - end_lineno=57, + end_lineno=58, end_col_offset=36)], - lineno=57, + lineno=58, col_offset=7, - end_lineno=57, + end_lineno=58, end_col_offset=36), - lineno=57, + lineno=58, col_offset=0, - end_lineno=57, + end_lineno=58, end_col_offset=36), Assign( [ Name( 'placeholder_13', Store(), - lineno=59, + lineno=60, col_offset=0, - end_lineno=59, + end_lineno=60, end_col_offset=1)], Call( Attribute( Name( 'placeholder_12', Load(), - lineno=59, + lineno=60, col_offset=4, - end_lineno=59, + end_lineno=60, end_col_offset=5), 'copy', Load(), - lineno=59, + lineno=60, col_offset=4, - end_lineno=59, + end_lineno=60, end_col_offset=10), [], [], - lineno=59, + lineno=60, col_offset=4, - end_lineno=59, + end_lineno=60, end_col_offset=12), - lineno=59, + lineno=60, col_offset=0, - end_lineno=59, + end_lineno=60, end_col_offset=12), AugAssign( Name( 'placeholder_13', Store(), - lineno=60, + lineno=61, col_offset=0, - end_lineno=60, + end_lineno=61, end_col_offset=1), BitOr(), Name( 'placeholder_11', Load(), - lineno=60, + lineno=61, col_offset=5, - end_lineno=60, + end_lineno=61, end_col_offset=6), - lineno=60, + lineno=61, col_offset=0, - end_lineno=60, + end_lineno=61, end_col_offset=6), Assert( Compare( @@ -2741,21 +2741,21 @@ Module( Name( 'placeholder_12', Load(), - lineno=62, + lineno=63, col_offset=7, - end_lineno=62, + end_lineno=63, end_col_offset=8), BitOr(), Name( 'placeholder_11', Load(), - lineno=62, + lineno=63, col_offset=11, - end_lineno=62, + end_lineno=63, end_col_offset=12), - lineno=62, + lineno=63, col_offset=7, - end_lineno=62, + end_lineno=63, end_col_offset=12), [ Eq()], @@ -2764,73 +2764,73 @@ Module( [ Constant( 1, - lineno=62, + lineno=63, col_offset=17, - end_lineno=62, + end_lineno=63, end_col_offset=18), Constant( 2, - lineno=62, + lineno=63, col_offset=23, - end_lineno=62, + end_lineno=63, end_col_offset=24), Constant( 3, - lineno=62, + lineno=63, col_offset=29, - end_lineno=62, + end_lineno=63, end_col_offset=30), Constant( 0, - lineno=62, + lineno=63, col_offset=35, - end_lineno=62, + end_lineno=63, end_col_offset=36)], [ Constant( 1, - lineno=62, + lineno=63, col_offset=20, - end_lineno=62, + end_lineno=63, end_col_offset=21), Constant( 1, - lineno=62, + lineno=63, col_offset=26, - end_lineno=62, + end_lineno=63, end_col_offset=27), Constant( 3, - lineno=62, + lineno=63, col_offset=32, - end_lineno=62, + end_lineno=63, end_col_offset=33), Constant( 0, - lineno=62, + lineno=63, col_offset=38, - end_lineno=62, + end_lineno=63, end_col_offset=39)], - lineno=62, + lineno=63, col_offset=16, - end_lineno=62, + end_lineno=63, end_col_offset=40)], - lineno=62, + lineno=63, col_offset=7, - end_lineno=62, + end_lineno=63, end_col_offset=40), - lineno=62, + lineno=63, col_offset=0, - end_lineno=62, + end_lineno=63, end_col_offset=40), Assert( Compare( Name( 'placeholder_13', Load(), - lineno=63, + lineno=64, col_offset=7, - end_lineno=63, + end_lineno=64, end_col_offset=8), [ Eq()], @@ -2839,106 +2839,106 @@ Module( [ Constant( 1, - lineno=63, + lineno=64, col_offset=13, - end_lineno=63, + end_lineno=64, end_col_offset=14), Constant( 2, - lineno=63, + lineno=64, col_offset=19, - end_lineno=63, + end_lineno=64, end_col_offset=20), Constant( 3, - lineno=63, + lineno=64, col_offset=25, - end_lineno=63, + end_lineno=64, end_col_offset=26), Constant( 0, - lineno=63, + lineno=64, col_offset=31, - end_lineno=63, + end_lineno=64, end_col_offset=32)], [ Constant( 1, - lineno=63, + lineno=64, col_offset=16, - end_lineno=63, + end_lineno=64, end_col_offset=17), Constant( 1, - lineno=63, + lineno=64, col_offset=22, - end_lineno=63, + end_lineno=64, end_col_offset=23), Constant( 3, - lineno=63, + lineno=64, col_offset=28, - end_lineno=63, + end_lineno=64, end_col_offset=29), Constant( 0, - lineno=63, + lineno=64, col_offset=34, - end_lineno=63, + end_lineno=64, end_col_offset=35)], - lineno=63, + lineno=64, col_offset=12, - end_lineno=63, + end_lineno=64, end_col_offset=36)], - lineno=63, + lineno=64, col_offset=7, - end_lineno=63, + end_lineno=64, end_col_offset=36), - lineno=63, + lineno=64, col_offset=0, - end_lineno=63, + end_lineno=64, end_col_offset=36), Assign( [ Name( 'placeholder_13', Store(), - lineno=65, + lineno=66, col_offset=0, - end_lineno=65, + end_lineno=66, end_col_offset=1)], Call( Attribute( Name( 'placeholder_11', Load(), - lineno=65, + lineno=66, col_offset=4, - end_lineno=65, + end_lineno=66, end_col_offset=5), 'copy', Load(), - lineno=65, + lineno=66, col_offset=4, - end_lineno=65, + end_lineno=66, end_col_offset=10), [], [], - lineno=65, + lineno=66, col_offset=4, - end_lineno=65, + end_lineno=66, end_col_offset=12), - lineno=65, + lineno=66, col_offset=0, - end_lineno=65, + end_lineno=66, end_col_offset=12), AugAssign( Name( 'placeholder_13', Store(), - lineno=66, + lineno=67, col_offset=0, - end_lineno=66, + end_lineno=67, end_col_offset=1), BitOr(), List( @@ -2947,76 +2947,76 @@ Module( [ Constant( 1, - lineno=66, + lineno=67, col_offset=7, - end_lineno=66, + end_lineno=67, end_col_offset=8), Constant( 1, - lineno=66, + lineno=67, col_offset=10, - end_lineno=66, + end_lineno=67, end_col_offset=11)], Load(), - lineno=66, + lineno=67, col_offset=6, - end_lineno=66, + end_lineno=67, end_col_offset=12), Tuple( [ Constant( 2, - lineno=66, + lineno=67, col_offset=15, - end_lineno=66, + end_lineno=67, end_col_offset=16), Constant( 2, - lineno=66, + lineno=67, col_offset=18, - end_lineno=66, + end_lineno=67, end_col_offset=19)], Load(), - lineno=66, + lineno=67, col_offset=14, - end_lineno=66, + end_lineno=67, end_col_offset=20), Tuple( [ Constant( 3, - lineno=66, + lineno=67, col_offset=23, - end_lineno=66, + end_lineno=67, end_col_offset=24), Constant( 3, - lineno=66, + lineno=67, col_offset=26, - end_lineno=66, + end_lineno=67, end_col_offset=27)], Load(), - lineno=66, + lineno=67, col_offset=22, - end_lineno=66, + end_lineno=67, end_col_offset=28)], Load(), - lineno=66, + lineno=67, col_offset=5, - end_lineno=66, + end_lineno=67, end_col_offset=29), - lineno=66, + lineno=67, col_offset=0, - end_lineno=66, + end_lineno=67, end_col_offset=29), Assert( Compare( Name( 'placeholder_13', Load(), - lineno=68, + lineno=69, col_offset=7, - end_lineno=68, + end_lineno=69, end_col_offset=8), [ Eq()], @@ -3025,75 +3025,75 @@ Module( [ Constant( 0, - lineno=68, + lineno=69, col_offset=13, - end_lineno=68, + end_lineno=69, end_col_offset=14), Constant( 1, - lineno=68, + lineno=69, col_offset=19, - end_lineno=68, + end_lineno=69, end_col_offset=20), Constant( 2, - lineno=68, + lineno=69, col_offset=25, - end_lineno=68, + end_lineno=69, end_col_offset=26), Constant( 3, - lineno=68, + lineno=69, col_offset=31, - end_lineno=68, + end_lineno=69, end_col_offset=32)], [ Constant( 0, - lineno=68, + lineno=69, col_offset=16, - end_lineno=68, + end_lineno=69, end_col_offset=17), Constant( 1, - lineno=68, + lineno=69, col_offset=22, - end_lineno=68, + end_lineno=69, end_col_offset=23), Constant( 2, - lineno=68, + lineno=69, col_offset=28, - end_lineno=68, + end_lineno=69, end_col_offset=29), Constant( 3, - lineno=68, + lineno=69, col_offset=34, - end_lineno=68, + end_lineno=69, end_col_offset=35)], - lineno=68, + lineno=69, col_offset=12, - end_lineno=68, + end_lineno=69, end_col_offset=36)], - lineno=68, + lineno=69, col_offset=7, - end_lineno=68, + end_lineno=69, end_col_offset=36), - lineno=68, + lineno=69, col_offset=0, - end_lineno=68, + end_lineno=69, end_col_offset=36), Expr( Constant( ' Example from `alphametrics` exercise ', - lineno=73, + lineno=74, col_offset=0, - end_lineno=73, + end_lineno=74, end_col_offset=44), - lineno=73, + lineno=74, col_offset=0, - end_lineno=73, + end_lineno=74, end_col_offset=44), FunctionDef( 'placeholder_14', @@ -3102,27 +3102,27 @@ Module( [ arg( 'placeholder_15', - lineno=74, + lineno=75, col_offset=11, - end_lineno=74, + end_lineno=75, end_col_offset=18), arg( 'placeholder_16', - lineno=74, + lineno=75, col_offset=20, - end_lineno=74, + end_lineno=75, end_col_offset=30), arg( 'placeholder_17', - lineno=74, + lineno=75, col_offset=32, - end_lineno=74, + end_lineno=75, end_col_offset=37), arg( 'placeholder_18', - lineno=74, + lineno=75, col_offset=39, - end_lineno=74, + end_lineno=75, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], @@ -3132,9 +3132,9 @@ Module( Name( 'placeholder_15', Load(), - lineno=75, + lineno=76, col_offset=10, - end_lineno=75, + end_lineno=76, end_col_offset=17), [ Assign( @@ -3142,35 +3142,35 @@ Module( Name( 'placeholder_19', Store(), - lineno=76, + lineno=77, col_offset=8, - end_lineno=76, + end_lineno=77, end_col_offset=22)], List( [], Load(), - lineno=76, + lineno=77, col_offset=25, - end_lineno=76, + end_lineno=77, end_col_offset=27), - lineno=76, + lineno=77, col_offset=8, - end_lineno=76, + end_lineno=77, end_col_offset=27), For( Name( 'placeholder_20', Store(), - lineno=78, + lineno=79, col_offset=12, - end_lineno=78, + end_lineno=79, end_col_offset=21), Name( 'placeholder_16', Load(), - lineno=78, + lineno=79, col_offset=25, - end_lineno=78, + end_lineno=79, end_col_offset=35), [ Assign( @@ -3180,32 +3180,32 @@ Module( Name( 'placeholder_21', Store(), - lineno=79, + lineno=80, col_offset=12, - end_lineno=79, + end_lineno=80, end_col_offset=15), Name( 'placeholder_22', Store(), - lineno=79, + lineno=80, col_offset=17, - end_lineno=79, + end_lineno=80, end_col_offset=24)], Store(), - lineno=79, + lineno=80, col_offset=12, - end_lineno=79, + end_lineno=80, end_col_offset=24)], Name( 'placeholder_20', Load(), - lineno=79, + lineno=80, col_offset=27, - end_lineno=79, + end_lineno=80, end_col_offset=36), - lineno=79, + lineno=80, col_offset=12, - end_lineno=79, + end_lineno=80, end_col_offset=36), If( Compare( @@ -3213,20 +3213,20 @@ Module( Name( 'placeholder_15', Load(), - lineno=81, + lineno=82, col_offset=15, - end_lineno=81, + end_lineno=82, end_col_offset=22), Constant( 0, - lineno=81, + lineno=82, col_offset=23, - end_lineno=81, + end_lineno=82, end_col_offset=24), Load(), - lineno=81, + lineno=82, col_offset=15, - end_lineno=81, + end_lineno=82, end_col_offset=25), [ In()], @@ -3236,25 +3236,25 @@ Module( Name( 'placeholder_17', Load(), - lineno=81, + lineno=82, col_offset=30, - end_lineno=81, + end_lineno=82, end_col_offset=35), Name( 'placeholder_18', Load(), - lineno=81, + lineno=82, col_offset=37, - end_lineno=81, + end_lineno=82, end_col_offset=43)], Load(), - lineno=81, + lineno=82, col_offset=29, - end_lineno=81, + end_lineno=82, end_col_offset=44)], - lineno=81, + lineno=82, col_offset=15, - end_lineno=81, + end_lineno=82, end_col_offset=44), [ Assign( @@ -3262,53 +3262,53 @@ Module( Name( 'placeholder_23', Store(), - lineno=82, + lineno=83, col_offset=16, - end_lineno=82, + end_lineno=83, end_col_offset=28)], BinOp( Name( 'placeholder_22', Load(), - lineno=82, + lineno=83, col_offset=31, - end_lineno=82, + end_lineno=83, end_col_offset=38), Sub(), Call( Name( 'set', Load(), - lineno=82, + lineno=83, col_offset=41, - end_lineno=82, + end_lineno=83, end_col_offset=44), [ List( [ Constant( 0, - lineno=82, + lineno=83, col_offset=46, - end_lineno=82, + end_lineno=83, end_col_offset=47)], Load(), - lineno=82, + lineno=83, col_offset=45, - end_lineno=82, + end_lineno=83, end_col_offset=48)], [], - lineno=82, + lineno=83, col_offset=41, - end_lineno=82, + end_lineno=83, end_col_offset=49), - lineno=82, + lineno=83, col_offset=31, - end_lineno=82, + end_lineno=83, end_col_offset=49), - lineno=82, + lineno=83, col_offset=16, - end_lineno=82, + end_lineno=83, end_col_offset=49)], [ Assign( @@ -3316,39 +3316,39 @@ Module( Name( 'placeholder_23', Store(), - lineno=85, + lineno=86, col_offset=16, - end_lineno=85, + end_lineno=86, end_col_offset=28)], Name( 'placeholder_22', Load(), - lineno=85, + lineno=86, col_offset=31, - end_lineno=85, + end_lineno=86, end_col_offset=38), - lineno=85, + lineno=86, col_offset=16, - end_lineno=85, + end_lineno=86, end_col_offset=38)], - lineno=81, + lineno=82, col_offset=12, - end_lineno=85, + end_lineno=86, end_col_offset=38), For( Name( 'placeholder_24', Store(), - lineno=87, + lineno=88, col_offset=16, - end_lineno=87, + end_lineno=88, end_col_offset=17), Name( 'placeholder_23', Load(), - lineno=87, + lineno=88, col_offset=21, - end_lineno=87, + end_lineno=88, end_col_offset=33), [ Assign( @@ -3356,17 +3356,17 @@ Module( Name( 'placeholder_25', Store(), - lineno=88, + lineno=89, col_offset=16, - end_lineno=88, + end_lineno=89, end_col_offset=22)], BinOp( Name( 'placeholder_21', Load(), - lineno=88, + lineno=89, col_offset=25, - end_lineno=88, + end_lineno=89, end_col_offset=28), BitOr(), Dict( @@ -3375,40 +3375,40 @@ Module( Name( 'placeholder_15', Load(), - lineno=88, + lineno=89, col_offset=32, - end_lineno=88, + end_lineno=89, end_col_offset=39), Constant( 0, - lineno=88, + lineno=89, col_offset=40, - end_lineno=88, + end_lineno=89, end_col_offset=41), Load(), - lineno=88, + lineno=89, col_offset=32, - end_lineno=88, + end_lineno=89, end_col_offset=42)], [ Name( 'placeholder_24', Load(), - lineno=88, + lineno=89, col_offset=44, - end_lineno=88, + end_lineno=89, end_col_offset=45)], - lineno=88, + lineno=89, col_offset=31, - end_lineno=88, + end_lineno=89, end_col_offset=46), - lineno=88, + lineno=89, col_offset=25, - end_lineno=88, + end_lineno=89, end_col_offset=46), - lineno=88, + lineno=89, col_offset=16, - end_lineno=88, + end_lineno=89, end_col_offset=46), Expr( Call( @@ -3416,15 +3416,15 @@ Module( Name( 'placeholder_19', Load(), - lineno=89, + lineno=90, col_offset=16, - end_lineno=89, + end_lineno=90, end_col_offset=30), 'append', Load(), - lineno=89, + lineno=90, col_offset=16, - end_lineno=89, + end_lineno=90, end_col_offset=37), [ Tuple( @@ -3432,26 +3432,26 @@ Module( Name( 'placeholder_25', Load(), - lineno=89, + lineno=90, col_offset=39, - end_lineno=89, + end_lineno=90, end_col_offset=45), BinOp( Name( 'placeholder_22', Load(), - lineno=89, + lineno=90, col_offset=47, - end_lineno=89, + end_lineno=90, end_col_offset=54), Sub(), Call( Name( 'set', Load(), - lineno=89, + lineno=90, col_offset=57, - end_lineno=89, + end_lineno=90, end_col_offset=60), [ List( @@ -3459,118 +3459,118 @@ Module( Name( 'placeholder_24', Load(), - lineno=89, + lineno=90, col_offset=62, - end_lineno=89, + end_lineno=90, end_col_offset=63)], Load(), - lineno=89, + lineno=90, col_offset=61, - end_lineno=89, + end_lineno=90, end_col_offset=64)], [], - lineno=89, + lineno=90, col_offset=57, - end_lineno=89, + end_lineno=90, end_col_offset=65), - lineno=89, + lineno=90, col_offset=47, - end_lineno=89, + end_lineno=90, end_col_offset=65)], Load(), - lineno=89, + lineno=90, col_offset=38, - end_lineno=89, + end_lineno=90, end_col_offset=66)], [], - lineno=89, + lineno=90, col_offset=16, - end_lineno=89, + end_lineno=90, end_col_offset=67), - lineno=89, + lineno=90, col_offset=16, - end_lineno=89, + end_lineno=90, end_col_offset=67)], [], - lineno=87, + lineno=88, col_offset=12, - end_lineno=89, + end_lineno=90, end_col_offset=67)], [], - lineno=78, + lineno=79, col_offset=8, - end_lineno=89, + end_lineno=90, end_col_offset=67), Assign( [ Name( 'placeholder_16', Store(), - lineno=91, + lineno=92, col_offset=8, - end_lineno=91, + end_lineno=92, end_col_offset=18)], Name( 'placeholder_19', Load(), - lineno=91, + lineno=92, col_offset=21, - end_lineno=91, + end_lineno=92, end_col_offset=35), - lineno=91, + lineno=92, col_offset=8, - end_lineno=91, + end_lineno=92, end_col_offset=35), Assign( [ Name( 'placeholder_15', Store(), - lineno=92, + lineno=93, col_offset=8, - end_lineno=92, + end_lineno=93, end_col_offset=15)], Subscript( Name( 'placeholder_15', Load(), - lineno=92, + lineno=93, col_offset=18, - end_lineno=92, + end_lineno=93, end_col_offset=25), Slice( Constant( 1, - lineno=92, + lineno=93, col_offset=26, - end_lineno=92, + end_lineno=93, end_col_offset=27), - lineno=92, + lineno=93, col_offset=26, - end_lineno=92, + end_lineno=93, end_col_offset=28), Load(), - lineno=92, + lineno=93, col_offset=18, - end_lineno=92, + end_lineno=93, end_col_offset=29), - lineno=92, + lineno=93, col_offset=8, - end_lineno=92, + end_lineno=93, end_col_offset=29)], [], - lineno=75, + lineno=76, col_offset=4, - end_lineno=92, + end_lineno=93, end_col_offset=29), Return( ListComp( Name( 'placeholder_21', Load(), - lineno=93, + lineno=94, col_offset=12, - end_lineno=93, + end_lineno=94, end_col_offset=15), [ comprehension( @@ -3579,43 +3579,43 @@ Module( Name( 'placeholder_21', Store(), - lineno=93, + lineno=94, col_offset=20, - end_lineno=93, + end_lineno=94, end_col_offset=23), Name( 'placeholder_26', Store(), - lineno=93, + lineno=94, col_offset=25, - end_lineno=93, + end_lineno=94, end_col_offset=26)], Store(), - lineno=93, + lineno=94, col_offset=20, - end_lineno=93, + end_lineno=94, end_col_offset=26), Name( 'placeholder_16', Load(), - lineno=93, + lineno=94, col_offset=30, - end_lineno=93, + end_lineno=94, end_col_offset=40), [], 0)], - lineno=93, + lineno=94, col_offset=11, - end_lineno=93, + end_lineno=94, end_col_offset=41), - lineno=93, + lineno=94, col_offset=4, - end_lineno=93, + end_lineno=94, end_col_offset=41)], [], - lineno=74, + lineno=75, col_offset=0, - end_lineno=93, + end_lineno=94, end_col_offset=41)], []) ## END NORMALIZED TREE ## \ No newline at end of file diff --git a/test/example-uniondict-normalization/representation.txt b/test/example-uniondict-normalization/representation.txt index 525c8e8..df9d5bf 100644 --- a/test/example-uniondict-normalization/representation.txt +++ b/test/example-uniondict-normalization/representation.txt @@ -1 +1 @@ -Module([Import([alias('toml', lineno=12, col_offset=7, end_lineno=12, end_col_offset=11)], lineno=12, col_offset=0, end_lineno=12, end_col_offset=11), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=14, col_offset=19, end_lineno=14, end_col_offset=35), arg('placeholder_2', lineno=14, col_offset=37, end_lineno=14, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], defaults=[]), [With([withitem(Call(Name('open', Load(), lineno=16, col_offset=9, end_lineno=16, end_col_offset=13), [Name('placeholder_2', Load(), lineno=16, col_offset=14, end_lineno=16, end_col_offset=28), Constant('r', lineno=16, col_offset=30, end_lineno=16, end_col_offset=33)], [], lineno=16, col_offset=9, end_lineno=16, end_col_offset=34), Name('placeholder_3', Store(), lineno=16, col_offset=38, end_lineno=16, end_col_offset=39))], [Assign([Name('placeholder_4', Store(), lineno=17, col_offset=8, end_lineno=17, end_col_offset=21)], Call(Attribute(Name('toml', Load(), lineno=17, col_offset=24, end_lineno=17, end_col_offset=28), 'load', Load(), lineno=17, col_offset=24, end_lineno=17, end_col_offset=33), [Name('placeholder_3', Load(), lineno=17, col_offset=34, end_lineno=17, end_col_offset=35)], [], lineno=17, col_offset=24, end_lineno=17, end_col_offset=36), lineno=17, col_offset=8, end_lineno=17, end_col_offset=36)], lineno=16, col_offset=4, end_lineno=17, end_col_offset=36), Assign([Name('placeholder_5', Store(), lineno=20, col_offset=4, end_lineno=20, end_col_offset=19)], BinOp(Name('placeholder_1', Load(), lineno=20, col_offset=22, end_lineno=20, end_col_offset=38), BitOr(), Name('placeholder_4', Load(), lineno=20, col_offset=41, end_lineno=20, end_col_offset=54), lineno=20, col_offset=22, end_lineno=20, end_col_offset=54), lineno=20, col_offset=4, end_lineno=20, end_col_offset=54), Return(Name('placeholder_5', Load(), lineno=22, col_offset=11, end_lineno=22, end_col_offset=26), lineno=22, col_offset=4, end_lineno=22, end_col_offset=26)], [], lineno=14, col_offset=0, end_lineno=22, end_col_offset=26), Assign([Name('placeholder_1', Store(), lineno=25, col_offset=0, end_lineno=25, end_col_offset=16)], Dict([Constant('timeout', lineno=26, col_offset=4, end_lineno=26, end_col_offset=13), Constant('retry_count', lineno=27, col_offset=4, end_lineno=27, end_col_offset=17), Constant('log_level', lineno=28, col_offset=4, end_lineno=28, end_col_offset=15)], [Constant(30, lineno=26, col_offset=15, end_lineno=26, end_col_offset=17), Constant(3, lineno=27, col_offset=19, end_lineno=27, end_col_offset=20), Constant('INFO', lineno=28, col_offset=17, end_lineno=28, end_col_offset=23)], lineno=25, col_offset=19, end_lineno=29, end_col_offset=1), lineno=25, col_offset=0, end_lineno=29, end_col_offset=1), Assign([Name('placeholder_2', Store(), lineno=30, col_offset=0, end_lineno=30, end_col_offset=14)], Constant('settings.toml', lineno=30, col_offset=17, end_lineno=30, end_col_offset=32), lineno=30, col_offset=0, end_lineno=30, end_col_offset=32), Assign([Name('placeholder_6', Store(), lineno=32, col_offset=0, end_lineno=32, end_col_offset=14)], Call(Name('placeholder_0', Load(), lineno=32, col_offset=17, end_lineno=32, end_col_offset=31), [Name('placeholder_1', Load(), lineno=32, col_offset=32, end_lineno=32, end_col_offset=48), Name('placeholder_2', Load(), lineno=32, col_offset=50, end_lineno=32, end_col_offset=64)], [], lineno=32, col_offset=17, end_lineno=32, end_col_offset=65), lineno=32, col_offset=0, end_lineno=32, end_col_offset=65), Expr(Constant(' Examples from PEP584 - Add Union Operators To dict', lineno=38, col_offset=0, end_lineno=38, end_col_offset=57), lineno=38, col_offset=0, end_lineno=38, end_col_offset=57), Assign([Name('placeholder_7', Store(), lineno=39, col_offset=0, end_lineno=39, end_col_offset=1)], Dict([Constant('spam', lineno=39, col_offset=5, end_lineno=39, end_col_offset=11), Constant('eggs', lineno=39, col_offset=16, end_lineno=39, end_col_offset=22), Constant('cheese', lineno=39, col_offset=27, end_lineno=39, end_col_offset=35)], [Constant(1, lineno=39, col_offset=13, end_lineno=39, end_col_offset=14), Constant(2, lineno=39, col_offset=24, end_lineno=39, end_col_offset=25), Constant(3, lineno=39, col_offset=37, end_lineno=39, end_col_offset=38)], lineno=39, col_offset=4, end_lineno=39, end_col_offset=39), lineno=39, col_offset=0, end_lineno=39, end_col_offset=39), Assign([Name('placeholder_8', Store(), lineno=40, col_offset=0, end_lineno=40, end_col_offset=1)], Dict([Constant('cheese', lineno=40, col_offset=5, end_lineno=40, end_col_offset=13), Constant('aardvark', lineno=40, col_offset=26, end_lineno=40, end_col_offset=36)], [Constant('cheddar', lineno=40, col_offset=15, end_lineno=40, end_col_offset=24), Constant('Ethel', lineno=40, col_offset=38, end_lineno=40, end_col_offset=45)], lineno=40, col_offset=4, end_lineno=40, end_col_offset=46), lineno=40, col_offset=0, end_lineno=40, end_col_offset=46), Assign([Name('placeholder_9', Store(), lineno=41, col_offset=0, end_lineno=41, end_col_offset=1)], BinOp(Name('placeholder_7', Load(), lineno=41, col_offset=4, end_lineno=41, end_col_offset=5), BitOr(), Name('placeholder_8', Load(), lineno=41, col_offset=8, end_lineno=41, end_col_offset=9), lineno=41, col_offset=4, end_lineno=41, end_col_offset=9), lineno=41, col_offset=0, end_lineno=41, end_col_offset=9), Assign([Name('placeholder_10', Store(), lineno=42, col_offset=0, end_lineno=42, end_col_offset=1)], BinOp(Name('placeholder_8', Load(), lineno=42, col_offset=4, end_lineno=42, end_col_offset=5), BitOr(), Name('placeholder_7', Load(), lineno=42, col_offset=8, end_lineno=42, end_col_offset=9), lineno=42, col_offset=4, end_lineno=42, end_col_offset=9), lineno=42, col_offset=0, end_lineno=42, end_col_offset=9), AugAssign(Name('placeholder_7', Store(), lineno=43, col_offset=0, end_lineno=43, end_col_offset=1), BitOr(), Name('placeholder_8', Load(), lineno=43, col_offset=5, end_lineno=43, end_col_offset=6), lineno=43, col_offset=0, end_lineno=43, end_col_offset=6), Expr(Constant(' Examples from the Cpython unit tests', lineno=49, col_offset=0, end_lineno=49, end_col_offset=43), lineno=49, col_offset=0, end_lineno=49, end_col_offset=43), Assign([Name('placeholder_11', Store(), lineno=50, col_offset=0, end_lineno=50, end_col_offset=1)], Dict([Constant(0, lineno=50, col_offset=5, end_lineno=50, end_col_offset=6), Constant(1, lineno=50, col_offset=11, end_lineno=50, end_col_offset=12), Constant(2, lineno=50, col_offset=17, end_lineno=50, end_col_offset=18)], [Constant(0, lineno=50, col_offset=8, end_lineno=50, end_col_offset=9), Constant(1, lineno=50, col_offset=14, end_lineno=50, end_col_offset=15), Constant(1, lineno=50, col_offset=20, end_lineno=50, end_col_offset=21)], lineno=50, col_offset=4, end_lineno=50, end_col_offset=22), lineno=50, col_offset=0, end_lineno=50, end_col_offset=22), Assign([Name('placeholder_12', Store(), lineno=51, col_offset=0, end_lineno=51, end_col_offset=1)], Dict([Constant(1, lineno=51, col_offset=5, end_lineno=51, end_col_offset=6), Constant(2, lineno=51, col_offset=11, end_lineno=51, end_col_offset=12), Constant(3, lineno=51, col_offset=17, end_lineno=51, end_col_offset=18)], [Constant(1, lineno=51, col_offset=8, end_lineno=51, end_col_offset=9), Constant(2, lineno=51, col_offset=14, end_lineno=51, end_col_offset=15), Constant(3, lineno=51, col_offset=20, end_lineno=51, end_col_offset=21)], lineno=51, col_offset=4, end_lineno=51, end_col_offset=22), lineno=51, col_offset=0, end_lineno=51, end_col_offset=22), Assign([Name('placeholder_13', Store(), lineno=53, col_offset=0, end_lineno=53, end_col_offset=1)], Call(Attribute(Name('placeholder_11', Load(), lineno=53, col_offset=4, end_lineno=53, end_col_offset=5), 'copy', Load(), lineno=53, col_offset=4, end_lineno=53, end_col_offset=10), [], [], lineno=53, col_offset=4, end_lineno=53, end_col_offset=12), lineno=53, col_offset=0, end_lineno=53, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=54, col_offset=0, end_lineno=54, end_col_offset=1), BitOr(), Name('placeholder_12', Load(), lineno=54, col_offset=5, end_lineno=54, end_col_offset=6), lineno=54, col_offset=0, end_lineno=54, end_col_offset=6), Assert(Compare(BinOp(Name('placeholder_11', Load(), lineno=56, col_offset=7, end_lineno=56, end_col_offset=8), BitOr(), Name('placeholder_12', Load(), lineno=56, col_offset=11, end_lineno=56, end_col_offset=12), lineno=56, col_offset=7, end_lineno=56, end_col_offset=12), [Eq()], [Dict([Constant(0, lineno=56, col_offset=17, end_lineno=56, end_col_offset=18), Constant(1, lineno=56, col_offset=23, end_lineno=56, end_col_offset=24), Constant(2, lineno=56, col_offset=29, end_lineno=56, end_col_offset=30), Constant(3, lineno=56, col_offset=35, end_lineno=56, end_col_offset=36)], [Constant(0, lineno=56, col_offset=20, end_lineno=56, end_col_offset=21), Constant(1, lineno=56, col_offset=26, end_lineno=56, end_col_offset=27), Constant(2, lineno=56, col_offset=32, end_lineno=56, end_col_offset=33), Constant(3, lineno=56, col_offset=38, end_lineno=56, end_col_offset=39)], lineno=56, col_offset=16, end_lineno=56, end_col_offset=40)], lineno=56, col_offset=7, end_lineno=56, end_col_offset=40), lineno=56, col_offset=0, end_lineno=56, end_col_offset=40), Assert(Compare(Name('placeholder_13', Load(), lineno=57, col_offset=7, end_lineno=57, end_col_offset=8), [Eq()], [Dict([Constant(0, lineno=57, col_offset=13, end_lineno=57, end_col_offset=14), Constant(1, lineno=57, col_offset=19, end_lineno=57, end_col_offset=20), Constant(2, lineno=57, col_offset=25, end_lineno=57, end_col_offset=26), Constant(3, lineno=57, col_offset=31, end_lineno=57, end_col_offset=32)], [Constant(0, lineno=57, col_offset=16, end_lineno=57, end_col_offset=17), Constant(1, lineno=57, col_offset=22, end_lineno=57, end_col_offset=23), Constant(2, lineno=57, col_offset=28, end_lineno=57, end_col_offset=29), Constant(3, lineno=57, col_offset=34, end_lineno=57, end_col_offset=35)], lineno=57, col_offset=12, end_lineno=57, end_col_offset=36)], lineno=57, col_offset=7, end_lineno=57, end_col_offset=36), lineno=57, col_offset=0, end_lineno=57, end_col_offset=36), Assign([Name('placeholder_13', Store(), lineno=59, col_offset=0, end_lineno=59, end_col_offset=1)], Call(Attribute(Name('placeholder_12', Load(), lineno=59, col_offset=4, end_lineno=59, end_col_offset=5), 'copy', Load(), lineno=59, col_offset=4, end_lineno=59, end_col_offset=10), [], [], lineno=59, col_offset=4, end_lineno=59, end_col_offset=12), lineno=59, col_offset=0, end_lineno=59, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=60, col_offset=0, end_lineno=60, end_col_offset=1), BitOr(), Name('placeholder_11', Load(), lineno=60, col_offset=5, end_lineno=60, end_col_offset=6), lineno=60, col_offset=0, end_lineno=60, end_col_offset=6), Assert(Compare(BinOp(Name('placeholder_12', Load(), lineno=62, col_offset=7, end_lineno=62, end_col_offset=8), BitOr(), Name('placeholder_11', Load(), lineno=62, col_offset=11, end_lineno=62, end_col_offset=12), lineno=62, col_offset=7, end_lineno=62, end_col_offset=12), [Eq()], [Dict([Constant(1, lineno=62, col_offset=17, end_lineno=62, end_col_offset=18), Constant(2, lineno=62, col_offset=23, end_lineno=62, end_col_offset=24), Constant(3, lineno=62, col_offset=29, end_lineno=62, end_col_offset=30), Constant(0, lineno=62, col_offset=35, end_lineno=62, end_col_offset=36)], [Constant(1, lineno=62, col_offset=20, end_lineno=62, end_col_offset=21), Constant(1, lineno=62, col_offset=26, end_lineno=62, end_col_offset=27), Constant(3, lineno=62, col_offset=32, end_lineno=62, end_col_offset=33), Constant(0, lineno=62, col_offset=38, end_lineno=62, end_col_offset=39)], lineno=62, col_offset=16, end_lineno=62, end_col_offset=40)], lineno=62, col_offset=7, end_lineno=62, end_col_offset=40), lineno=62, col_offset=0, end_lineno=62, end_col_offset=40), Assert(Compare(Name('placeholder_13', Load(), lineno=63, col_offset=7, end_lineno=63, end_col_offset=8), [Eq()], [Dict([Constant(1, lineno=63, col_offset=13, end_lineno=63, end_col_offset=14), Constant(2, lineno=63, col_offset=19, end_lineno=63, end_col_offset=20), Constant(3, lineno=63, col_offset=25, end_lineno=63, end_col_offset=26), Constant(0, lineno=63, col_offset=31, end_lineno=63, end_col_offset=32)], [Constant(1, lineno=63, col_offset=16, end_lineno=63, end_col_offset=17), Constant(1, lineno=63, col_offset=22, end_lineno=63, end_col_offset=23), Constant(3, lineno=63, col_offset=28, end_lineno=63, end_col_offset=29), Constant(0, lineno=63, col_offset=34, end_lineno=63, end_col_offset=35)], lineno=63, col_offset=12, end_lineno=63, end_col_offset=36)], lineno=63, col_offset=7, end_lineno=63, end_col_offset=36), lineno=63, col_offset=0, end_lineno=63, end_col_offset=36), Assign([Name('placeholder_13', Store(), lineno=65, col_offset=0, end_lineno=65, end_col_offset=1)], Call(Attribute(Name('placeholder_11', Load(), lineno=65, col_offset=4, end_lineno=65, end_col_offset=5), 'copy', Load(), lineno=65, col_offset=4, end_lineno=65, end_col_offset=10), [], [], lineno=65, col_offset=4, end_lineno=65, end_col_offset=12), lineno=65, col_offset=0, end_lineno=65, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=66, col_offset=0, end_lineno=66, end_col_offset=1), BitOr(), List([Tuple([Constant(1, lineno=66, col_offset=7, end_lineno=66, end_col_offset=8), Constant(1, lineno=66, col_offset=10, end_lineno=66, end_col_offset=11)], Load(), lineno=66, col_offset=6, end_lineno=66, end_col_offset=12), Tuple([Constant(2, lineno=66, col_offset=15, end_lineno=66, end_col_offset=16), Constant(2, lineno=66, col_offset=18, end_lineno=66, end_col_offset=19)], Load(), lineno=66, col_offset=14, end_lineno=66, end_col_offset=20), Tuple([Constant(3, lineno=66, col_offset=23, end_lineno=66, end_col_offset=24), Constant(3, lineno=66, col_offset=26, end_lineno=66, end_col_offset=27)], Load(), lineno=66, col_offset=22, end_lineno=66, end_col_offset=28)], Load(), lineno=66, col_offset=5, end_lineno=66, end_col_offset=29), lineno=66, col_offset=0, end_lineno=66, end_col_offset=29), Assert(Compare(Name('placeholder_13', Load(), lineno=68, col_offset=7, end_lineno=68, end_col_offset=8), [Eq()], [Dict([Constant(0, lineno=68, col_offset=13, end_lineno=68, end_col_offset=14), Constant(1, lineno=68, col_offset=19, end_lineno=68, end_col_offset=20), Constant(2, lineno=68, col_offset=25, end_lineno=68, end_col_offset=26), Constant(3, lineno=68, col_offset=31, end_lineno=68, end_col_offset=32)], [Constant(0, lineno=68, col_offset=16, end_lineno=68, end_col_offset=17), Constant(1, lineno=68, col_offset=22, end_lineno=68, end_col_offset=23), Constant(2, lineno=68, col_offset=28, end_lineno=68, end_col_offset=29), Constant(3, lineno=68, col_offset=34, end_lineno=68, end_col_offset=35)], lineno=68, col_offset=12, end_lineno=68, end_col_offset=36)], lineno=68, col_offset=7, end_lineno=68, end_col_offset=36), lineno=68, col_offset=0, end_lineno=68, end_col_offset=36), Expr(Constant(' Example from `alphametrics` exercise ', lineno=73, col_offset=0, end_lineno=73, end_col_offset=44), lineno=73, col_offset=0, end_lineno=73, end_col_offset=44), FunctionDef('placeholder_14', arguments([], [arg('placeholder_15', lineno=74, col_offset=11, end_lineno=74, end_col_offset=18), arg('placeholder_16', lineno=74, col_offset=20, end_lineno=74, end_col_offset=30), arg('placeholder_17', lineno=74, col_offset=32, end_lineno=74, end_col_offset=37), arg('placeholder_18', lineno=74, col_offset=39, end_lineno=74, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [While(Name('placeholder_15', Load(), lineno=75, col_offset=10, end_lineno=75, end_col_offset=17), [Assign([Name('placeholder_19', Store(), lineno=76, col_offset=8, end_lineno=76, end_col_offset=22)], List([], Load(), lineno=76, col_offset=25, end_lineno=76, end_col_offset=27), lineno=76, col_offset=8, end_lineno=76, end_col_offset=27), For(Name('placeholder_20', Store(), lineno=78, col_offset=12, end_lineno=78, end_col_offset=21), Name('placeholder_16', Load(), lineno=78, col_offset=25, end_lineno=78, end_col_offset=35), [Assign([Tuple([Name('placeholder_21', Store(), lineno=79, col_offset=12, end_lineno=79, end_col_offset=15), Name('placeholder_22', Store(), lineno=79, col_offset=17, end_lineno=79, end_col_offset=24)], Store(), lineno=79, col_offset=12, end_lineno=79, end_col_offset=24)], Name('placeholder_20', Load(), lineno=79, col_offset=27, end_lineno=79, end_col_offset=36), lineno=79, col_offset=12, end_lineno=79, end_col_offset=36), If(Compare(Subscript(Name('placeholder_15', Load(), lineno=81, col_offset=15, end_lineno=81, end_col_offset=22), Constant(0, lineno=81, col_offset=23, end_lineno=81, end_col_offset=24), Load(), lineno=81, col_offset=15, end_lineno=81, end_col_offset=25), [In()], [List([Name('placeholder_17', Load(), lineno=81, col_offset=30, end_lineno=81, end_col_offset=35), Name('placeholder_18', Load(), lineno=81, col_offset=37, end_lineno=81, end_col_offset=43)], Load(), lineno=81, col_offset=29, end_lineno=81, end_col_offset=44)], lineno=81, col_offset=15, end_lineno=81, end_col_offset=44), [Assign([Name('placeholder_23', Store(), lineno=82, col_offset=16, end_lineno=82, end_col_offset=28)], BinOp(Name('placeholder_22', Load(), lineno=82, col_offset=31, end_lineno=82, end_col_offset=38), Sub(), Call(Name('set', Load(), lineno=82, col_offset=41, end_lineno=82, end_col_offset=44), [List([Constant(0, lineno=82, col_offset=46, end_lineno=82, end_col_offset=47)], Load(), lineno=82, col_offset=45, end_lineno=82, end_col_offset=48)], [], lineno=82, col_offset=41, end_lineno=82, end_col_offset=49), lineno=82, col_offset=31, end_lineno=82, end_col_offset=49), lineno=82, col_offset=16, end_lineno=82, end_col_offset=49)], [Assign([Name('placeholder_23', Store(), lineno=85, col_offset=16, end_lineno=85, end_col_offset=28)], Name('placeholder_22', Load(), lineno=85, col_offset=31, end_lineno=85, end_col_offset=38), lineno=85, col_offset=16, end_lineno=85, end_col_offset=38)], lineno=81, col_offset=12, end_lineno=85, end_col_offset=38), For(Name('placeholder_24', Store(), lineno=87, col_offset=16, end_lineno=87, end_col_offset=17), Name('placeholder_23', Load(), lineno=87, col_offset=21, end_lineno=87, end_col_offset=33), [Assign([Name('placeholder_25', Store(), lineno=88, col_offset=16, end_lineno=88, end_col_offset=22)], BinOp(Name('placeholder_21', Load(), lineno=88, col_offset=25, end_lineno=88, end_col_offset=28), BitOr(), Dict([Subscript(Name('placeholder_15', Load(), lineno=88, col_offset=32, end_lineno=88, end_col_offset=39), Constant(0, lineno=88, col_offset=40, end_lineno=88, end_col_offset=41), Load(), lineno=88, col_offset=32, end_lineno=88, end_col_offset=42)], [Name('placeholder_24', Load(), lineno=88, col_offset=44, end_lineno=88, end_col_offset=45)], lineno=88, col_offset=31, end_lineno=88, end_col_offset=46), lineno=88, col_offset=25, end_lineno=88, end_col_offset=46), lineno=88, col_offset=16, end_lineno=88, end_col_offset=46), Expr(Call(Attribute(Name('placeholder_19', Load(), lineno=89, col_offset=16, end_lineno=89, end_col_offset=30), 'append', Load(), lineno=89, col_offset=16, end_lineno=89, end_col_offset=37), [Tuple([Name('placeholder_25', Load(), lineno=89, col_offset=39, end_lineno=89, end_col_offset=45), BinOp(Name('placeholder_22', Load(), lineno=89, col_offset=47, end_lineno=89, end_col_offset=54), Sub(), Call(Name('set', Load(), lineno=89, col_offset=57, end_lineno=89, end_col_offset=60), [List([Name('placeholder_24', Load(), lineno=89, col_offset=62, end_lineno=89, end_col_offset=63)], Load(), lineno=89, col_offset=61, end_lineno=89, end_col_offset=64)], [], lineno=89, col_offset=57, end_lineno=89, end_col_offset=65), lineno=89, col_offset=47, end_lineno=89, end_col_offset=65)], Load(), lineno=89, col_offset=38, end_lineno=89, end_col_offset=66)], [], lineno=89, col_offset=16, end_lineno=89, end_col_offset=67), lineno=89, col_offset=16, end_lineno=89, end_col_offset=67)], [], lineno=87, col_offset=12, end_lineno=89, end_col_offset=67)], [], lineno=78, col_offset=8, end_lineno=89, end_col_offset=67), Assign([Name('placeholder_16', Store(), lineno=91, col_offset=8, end_lineno=91, end_col_offset=18)], Name('placeholder_19', Load(), lineno=91, col_offset=21, end_lineno=91, end_col_offset=35), lineno=91, col_offset=8, end_lineno=91, end_col_offset=35), Assign([Name('placeholder_15', Store(), lineno=92, col_offset=8, end_lineno=92, end_col_offset=15)], Subscript(Name('placeholder_15', Load(), lineno=92, col_offset=18, end_lineno=92, end_col_offset=25), Slice(Constant(1, lineno=92, col_offset=26, end_lineno=92, end_col_offset=27), lineno=92, col_offset=26, end_lineno=92, end_col_offset=28), Load(), lineno=92, col_offset=18, end_lineno=92, end_col_offset=29), lineno=92, col_offset=8, end_lineno=92, end_col_offset=29)], [], lineno=75, col_offset=4, end_lineno=92, end_col_offset=29), Return(ListComp(Name('placeholder_21', Load(), lineno=93, col_offset=12, end_lineno=93, end_col_offset=15), [comprehension(Tuple([Name('placeholder_21', Store(), lineno=93, col_offset=20, end_lineno=93, end_col_offset=23), Name('placeholder_26', Store(), lineno=93, col_offset=25, end_lineno=93, end_col_offset=26)], Store(), lineno=93, col_offset=20, end_lineno=93, end_col_offset=26), Name('placeholder_16', Load(), lineno=93, col_offset=30, end_lineno=93, end_col_offset=40), [], 0)], lineno=93, col_offset=11, end_lineno=93, end_col_offset=41), lineno=93, col_offset=4, end_lineno=93, end_col_offset=41)], [], lineno=74, col_offset=0, end_lineno=93, end_col_offset=41)], []) \ No newline at end of file +Module([Import([alias('tomlib', lineno=11, col_offset=7, end_lineno=11, end_col_offset=13)], lineno=11, col_offset=0, end_lineno=11, end_col_offset=13), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=13, col_offset=19, end_lineno=13, end_col_offset=35), arg('placeholder_2', lineno=13, col_offset=37, end_lineno=13, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], defaults=[]), [With([withitem(Call(Name('open', Load(), lineno=15, col_offset=9, end_lineno=15, end_col_offset=13), [Name('placeholder_2', Load(), lineno=15, col_offset=14, end_lineno=15, end_col_offset=28), Constant('r', lineno=15, col_offset=30, end_lineno=15, end_col_offset=33)], [], lineno=15, col_offset=9, end_lineno=15, end_col_offset=34), Name('placeholder_3', Store(), lineno=15, col_offset=38, end_lineno=15, end_col_offset=39))], [Assign([Name('placeholder_4', Store(), lineno=16, col_offset=8, end_lineno=16, end_col_offset=21)], Call(Attribute(Name('tomlib', Load(), lineno=16, col_offset=24, end_lineno=16, end_col_offset=30), 'load', Load(), lineno=16, col_offset=24, end_lineno=16, end_col_offset=35), [Name('placeholder_3', Load(), lineno=16, col_offset=36, end_lineno=16, end_col_offset=37)], [], lineno=16, col_offset=24, end_lineno=16, end_col_offset=38), lineno=16, col_offset=8, end_lineno=16, end_col_offset=38)], lineno=15, col_offset=4, end_lineno=16, end_col_offset=38), Assign([Name('placeholder_5', Store(), lineno=19, col_offset=4, end_lineno=19, end_col_offset=19)], BinOp(Name('placeholder_1', Load(), lineno=19, col_offset=22, end_lineno=19, end_col_offset=38), BitOr(), Name('placeholder_4', Load(), lineno=19, col_offset=41, end_lineno=19, end_col_offset=54), lineno=19, col_offset=22, end_lineno=19, end_col_offset=54), lineno=19, col_offset=4, end_lineno=19, end_col_offset=54), Return(Name('placeholder_5', Load(), lineno=21, col_offset=11, end_lineno=21, end_col_offset=26), lineno=21, col_offset=4, end_lineno=21, end_col_offset=26)], [], lineno=13, col_offset=0, end_lineno=21, end_col_offset=26), Assign([Name('placeholder_1', Store(), lineno=24, col_offset=0, end_lineno=24, end_col_offset=16)], Dict([Constant('timeout', lineno=25, col_offset=4, end_lineno=25, end_col_offset=13), Constant('retry_count', lineno=26, col_offset=4, end_lineno=26, end_col_offset=17), Constant('log_level', lineno=27, col_offset=4, end_lineno=27, end_col_offset=15)], [Constant(30, lineno=25, col_offset=15, end_lineno=25, end_col_offset=17), Constant(3, lineno=26, col_offset=19, end_lineno=26, end_col_offset=20), Constant('INFO', lineno=27, col_offset=17, end_lineno=27, end_col_offset=23)], lineno=24, col_offset=19, end_lineno=28, end_col_offset=1), lineno=24, col_offset=0, end_lineno=28, end_col_offset=1), Assign([Name('placeholder_2', Store(), lineno=29, col_offset=0, end_lineno=29, end_col_offset=14)], Constant('settings.toml', lineno=29, col_offset=17, end_lineno=29, end_col_offset=32), lineno=29, col_offset=0, end_lineno=29, end_col_offset=32), Assign([Name('placeholder_6', Store(), lineno=31, col_offset=0, end_lineno=31, end_col_offset=14)], Call(Name('placeholder_0', Load(), lineno=31, col_offset=17, end_lineno=31, end_col_offset=31), [Name('placeholder_1', Load(), lineno=31, col_offset=32, end_lineno=31, end_col_offset=48), Name('placeholder_2', Load(), lineno=31, col_offset=50, end_lineno=31, end_col_offset=64)], [], lineno=31, col_offset=17, end_lineno=31, end_col_offset=65), lineno=31, col_offset=0, end_lineno=31, end_col_offset=65), Expr(Constant(' Examples from PEP584 - Add Union Operators To dict', lineno=37, col_offset=0, end_lineno=37, end_col_offset=57), lineno=37, col_offset=0, end_lineno=37, end_col_offset=57), Assign([Name('placeholder_7', Store(), lineno=38, col_offset=0, end_lineno=38, end_col_offset=1)], Dict([Constant('spam', lineno=38, col_offset=5, end_lineno=38, end_col_offset=11), Constant('eggs', lineno=38, col_offset=16, end_lineno=38, end_col_offset=22), Constant('cheese', lineno=38, col_offset=27, end_lineno=38, end_col_offset=35)], [Constant(1, lineno=38, col_offset=13, end_lineno=38, end_col_offset=14), Constant(2, lineno=38, col_offset=24, end_lineno=38, end_col_offset=25), Constant(3, lineno=38, col_offset=37, end_lineno=38, end_col_offset=38)], lineno=38, col_offset=4, end_lineno=38, end_col_offset=39), lineno=38, col_offset=0, end_lineno=38, end_col_offset=39), Assign([Name('placeholder_8', Store(), lineno=39, col_offset=0, end_lineno=39, end_col_offset=1)], Dict([Constant('cheese', lineno=39, col_offset=5, end_lineno=39, end_col_offset=13), Constant('aardvark', lineno=39, col_offset=26, end_lineno=39, end_col_offset=36)], [Constant('cheddar', lineno=39, col_offset=15, end_lineno=39, end_col_offset=24), Constant('Ethel', lineno=39, col_offset=38, end_lineno=39, end_col_offset=45)], lineno=39, col_offset=4, end_lineno=39, end_col_offset=46), lineno=39, col_offset=0, end_lineno=39, end_col_offset=46), Assign([Name('placeholder_9', Store(), lineno=42, col_offset=0, end_lineno=42, end_col_offset=1)], BinOp(Name('placeholder_7', Load(), lineno=42, col_offset=4, end_lineno=42, end_col_offset=5), BitOr(), Name('placeholder_8', Load(), lineno=42, col_offset=8, end_lineno=42, end_col_offset=9), lineno=42, col_offset=4, end_lineno=42, end_col_offset=9), lineno=42, col_offset=0, end_lineno=42, end_col_offset=9), Assign([Name('placeholder_10', Store(), lineno=43, col_offset=0, end_lineno=43, end_col_offset=1)], BinOp(Name('placeholder_8', Load(), lineno=43, col_offset=4, end_lineno=43, end_col_offset=5), BitOr(), Name('placeholder_7', Load(), lineno=43, col_offset=8, end_lineno=43, end_col_offset=9), lineno=43, col_offset=4, end_lineno=43, end_col_offset=9), lineno=43, col_offset=0, end_lineno=43, end_col_offset=9), AugAssign(Name('placeholder_7', Store(), lineno=44, col_offset=0, end_lineno=44, end_col_offset=1), BitOr(), Name('placeholder_8', Load(), lineno=44, col_offset=5, end_lineno=44, end_col_offset=6), lineno=44, col_offset=0, end_lineno=44, end_col_offset=6), Expr(Constant(' Examples from the Cpython unit tests', lineno=50, col_offset=0, end_lineno=50, end_col_offset=43), lineno=50, col_offset=0, end_lineno=50, end_col_offset=43), Assign([Name('placeholder_11', Store(), lineno=51, col_offset=0, end_lineno=51, end_col_offset=1)], Dict([Constant(0, lineno=51, col_offset=5, end_lineno=51, end_col_offset=6), Constant(1, lineno=51, col_offset=11, end_lineno=51, end_col_offset=12), Constant(2, lineno=51, col_offset=17, end_lineno=51, end_col_offset=18)], [Constant(0, lineno=51, col_offset=8, end_lineno=51, end_col_offset=9), Constant(1, lineno=51, col_offset=14, end_lineno=51, end_col_offset=15), Constant(1, lineno=51, col_offset=20, end_lineno=51, end_col_offset=21)], lineno=51, col_offset=4, end_lineno=51, end_col_offset=22), lineno=51, col_offset=0, end_lineno=51, end_col_offset=22), Assign([Name('placeholder_12', Store(), lineno=52, col_offset=0, end_lineno=52, end_col_offset=1)], Dict([Constant(1, lineno=52, col_offset=5, end_lineno=52, end_col_offset=6), Constant(2, lineno=52, col_offset=11, end_lineno=52, end_col_offset=12), Constant(3, lineno=52, col_offset=17, end_lineno=52, end_col_offset=18)], [Constant(1, lineno=52, col_offset=8, end_lineno=52, end_col_offset=9), Constant(2, lineno=52, col_offset=14, end_lineno=52, end_col_offset=15), Constant(3, lineno=52, col_offset=20, end_lineno=52, end_col_offset=21)], lineno=52, col_offset=4, end_lineno=52, end_col_offset=22), lineno=52, col_offset=0, end_lineno=52, end_col_offset=22), Assign([Name('placeholder_13', Store(), lineno=54, col_offset=0, end_lineno=54, end_col_offset=1)], Call(Attribute(Name('placeholder_11', Load(), lineno=54, col_offset=4, end_lineno=54, end_col_offset=5), 'copy', Load(), lineno=54, col_offset=4, end_lineno=54, end_col_offset=10), [], [], lineno=54, col_offset=4, end_lineno=54, end_col_offset=12), lineno=54, col_offset=0, end_lineno=54, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=55, col_offset=0, end_lineno=55, end_col_offset=1), BitOr(), Name('placeholder_12', Load(), lineno=55, col_offset=5, end_lineno=55, end_col_offset=6), lineno=55, col_offset=0, end_lineno=55, end_col_offset=6), Assert(Compare(BinOp(Name('placeholder_11', Load(), lineno=57, col_offset=7, end_lineno=57, end_col_offset=8), BitOr(), Name('placeholder_12', Load(), lineno=57, col_offset=11, end_lineno=57, end_col_offset=12), lineno=57, col_offset=7, end_lineno=57, end_col_offset=12), [Eq()], [Dict([Constant(0, lineno=57, col_offset=17, end_lineno=57, end_col_offset=18), Constant(1, lineno=57, col_offset=23, end_lineno=57, end_col_offset=24), Constant(2, lineno=57, col_offset=29, end_lineno=57, end_col_offset=30), Constant(3, lineno=57, col_offset=35, end_lineno=57, end_col_offset=36)], [Constant(0, lineno=57, col_offset=20, end_lineno=57, end_col_offset=21), Constant(1, lineno=57, col_offset=26, end_lineno=57, end_col_offset=27), Constant(2, lineno=57, col_offset=32, end_lineno=57, end_col_offset=33), Constant(3, lineno=57, col_offset=38, end_lineno=57, end_col_offset=39)], lineno=57, col_offset=16, end_lineno=57, end_col_offset=40)], lineno=57, col_offset=7, end_lineno=57, end_col_offset=40), lineno=57, col_offset=0, end_lineno=57, end_col_offset=40), Assert(Compare(Name('placeholder_13', Load(), lineno=58, col_offset=7, end_lineno=58, end_col_offset=8), [Eq()], [Dict([Constant(0, lineno=58, col_offset=13, end_lineno=58, end_col_offset=14), Constant(1, lineno=58, col_offset=19, end_lineno=58, end_col_offset=20), Constant(2, lineno=58, col_offset=25, end_lineno=58, end_col_offset=26), Constant(3, lineno=58, col_offset=31, end_lineno=58, end_col_offset=32)], [Constant(0, lineno=58, col_offset=16, end_lineno=58, end_col_offset=17), Constant(1, lineno=58, col_offset=22, end_lineno=58, end_col_offset=23), Constant(2, lineno=58, col_offset=28, end_lineno=58, end_col_offset=29), Constant(3, lineno=58, col_offset=34, end_lineno=58, end_col_offset=35)], lineno=58, col_offset=12, end_lineno=58, end_col_offset=36)], lineno=58, col_offset=7, end_lineno=58, end_col_offset=36), lineno=58, col_offset=0, end_lineno=58, end_col_offset=36), Assign([Name('placeholder_13', Store(), lineno=60, col_offset=0, end_lineno=60, end_col_offset=1)], Call(Attribute(Name('placeholder_12', Load(), lineno=60, col_offset=4, end_lineno=60, end_col_offset=5), 'copy', Load(), lineno=60, col_offset=4, end_lineno=60, end_col_offset=10), [], [], lineno=60, col_offset=4, end_lineno=60, end_col_offset=12), lineno=60, col_offset=0, end_lineno=60, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=61, col_offset=0, end_lineno=61, end_col_offset=1), BitOr(), Name('placeholder_11', Load(), lineno=61, col_offset=5, end_lineno=61, end_col_offset=6), lineno=61, col_offset=0, end_lineno=61, end_col_offset=6), Assert(Compare(BinOp(Name('placeholder_12', Load(), lineno=63, col_offset=7, end_lineno=63, end_col_offset=8), BitOr(), Name('placeholder_11', Load(), lineno=63, col_offset=11, end_lineno=63, end_col_offset=12), lineno=63, col_offset=7, end_lineno=63, end_col_offset=12), [Eq()], [Dict([Constant(1, lineno=63, col_offset=17, end_lineno=63, end_col_offset=18), Constant(2, lineno=63, col_offset=23, end_lineno=63, end_col_offset=24), Constant(3, lineno=63, col_offset=29, end_lineno=63, end_col_offset=30), Constant(0, lineno=63, col_offset=35, end_lineno=63, end_col_offset=36)], [Constant(1, lineno=63, col_offset=20, end_lineno=63, end_col_offset=21), Constant(1, lineno=63, col_offset=26, end_lineno=63, end_col_offset=27), Constant(3, lineno=63, col_offset=32, end_lineno=63, end_col_offset=33), Constant(0, lineno=63, col_offset=38, end_lineno=63, end_col_offset=39)], lineno=63, col_offset=16, end_lineno=63, end_col_offset=40)], lineno=63, col_offset=7, end_lineno=63, end_col_offset=40), lineno=63, col_offset=0, end_lineno=63, end_col_offset=40), Assert(Compare(Name('placeholder_13', Load(), lineno=64, col_offset=7, end_lineno=64, end_col_offset=8), [Eq()], [Dict([Constant(1, lineno=64, col_offset=13, end_lineno=64, end_col_offset=14), Constant(2, lineno=64, col_offset=19, end_lineno=64, end_col_offset=20), Constant(3, lineno=64, col_offset=25, end_lineno=64, end_col_offset=26), Constant(0, lineno=64, col_offset=31, end_lineno=64, end_col_offset=32)], [Constant(1, lineno=64, col_offset=16, end_lineno=64, end_col_offset=17), Constant(1, lineno=64, col_offset=22, end_lineno=64, end_col_offset=23), Constant(3, lineno=64, col_offset=28, end_lineno=64, end_col_offset=29), Constant(0, lineno=64, col_offset=34, end_lineno=64, end_col_offset=35)], lineno=64, col_offset=12, end_lineno=64, end_col_offset=36)], lineno=64, col_offset=7, end_lineno=64, end_col_offset=36), lineno=64, col_offset=0, end_lineno=64, end_col_offset=36), Assign([Name('placeholder_13', Store(), lineno=66, col_offset=0, end_lineno=66, end_col_offset=1)], Call(Attribute(Name('placeholder_11', Load(), lineno=66, col_offset=4, end_lineno=66, end_col_offset=5), 'copy', Load(), lineno=66, col_offset=4, end_lineno=66, end_col_offset=10), [], [], lineno=66, col_offset=4, end_lineno=66, end_col_offset=12), lineno=66, col_offset=0, end_lineno=66, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=67, col_offset=0, end_lineno=67, end_col_offset=1), BitOr(), List([Tuple([Constant(1, lineno=67, col_offset=7, end_lineno=67, end_col_offset=8), Constant(1, lineno=67, col_offset=10, end_lineno=67, end_col_offset=11)], Load(), lineno=67, col_offset=6, end_lineno=67, end_col_offset=12), Tuple([Constant(2, lineno=67, col_offset=15, end_lineno=67, end_col_offset=16), Constant(2, lineno=67, col_offset=18, end_lineno=67, end_col_offset=19)], Load(), lineno=67, col_offset=14, end_lineno=67, end_col_offset=20), Tuple([Constant(3, lineno=67, col_offset=23, end_lineno=67, end_col_offset=24), Constant(3, lineno=67, col_offset=26, end_lineno=67, end_col_offset=27)], Load(), lineno=67, col_offset=22, end_lineno=67, end_col_offset=28)], Load(), lineno=67, col_offset=5, end_lineno=67, end_col_offset=29), lineno=67, col_offset=0, end_lineno=67, end_col_offset=29), Assert(Compare(Name('placeholder_13', Load(), lineno=69, col_offset=7, end_lineno=69, end_col_offset=8), [Eq()], [Dict([Constant(0, lineno=69, col_offset=13, end_lineno=69, end_col_offset=14), Constant(1, lineno=69, col_offset=19, end_lineno=69, end_col_offset=20), Constant(2, lineno=69, col_offset=25, end_lineno=69, end_col_offset=26), Constant(3, lineno=69, col_offset=31, end_lineno=69, end_col_offset=32)], [Constant(0, lineno=69, col_offset=16, end_lineno=69, end_col_offset=17), Constant(1, lineno=69, col_offset=22, end_lineno=69, end_col_offset=23), Constant(2, lineno=69, col_offset=28, end_lineno=69, end_col_offset=29), Constant(3, lineno=69, col_offset=34, end_lineno=69, end_col_offset=35)], lineno=69, col_offset=12, end_lineno=69, end_col_offset=36)], lineno=69, col_offset=7, end_lineno=69, end_col_offset=36), lineno=69, col_offset=0, end_lineno=69, end_col_offset=36), Expr(Constant(' Example from `alphametrics` exercise ', lineno=74, col_offset=0, end_lineno=74, end_col_offset=44), lineno=74, col_offset=0, end_lineno=74, end_col_offset=44), FunctionDef('placeholder_14', arguments([], [arg('placeholder_15', lineno=75, col_offset=11, end_lineno=75, end_col_offset=18), arg('placeholder_16', lineno=75, col_offset=20, end_lineno=75, end_col_offset=30), arg('placeholder_17', lineno=75, col_offset=32, end_lineno=75, end_col_offset=37), arg('placeholder_18', lineno=75, col_offset=39, end_lineno=75, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [While(Name('placeholder_15', Load(), lineno=76, col_offset=10, end_lineno=76, end_col_offset=17), [Assign([Name('placeholder_19', Store(), lineno=77, col_offset=8, end_lineno=77, end_col_offset=22)], List([], Load(), lineno=77, col_offset=25, end_lineno=77, end_col_offset=27), lineno=77, col_offset=8, end_lineno=77, end_col_offset=27), For(Name('placeholder_20', Store(), lineno=79, col_offset=12, end_lineno=79, end_col_offset=21), Name('placeholder_16', Load(), lineno=79, col_offset=25, end_lineno=79, end_col_offset=35), [Assign([Tuple([Name('placeholder_21', Store(), lineno=80, col_offset=12, end_lineno=80, end_col_offset=15), Name('placeholder_22', Store(), lineno=80, col_offset=17, end_lineno=80, end_col_offset=24)], Store(), lineno=80, col_offset=12, end_lineno=80, end_col_offset=24)], Name('placeholder_20', Load(), lineno=80, col_offset=27, end_lineno=80, end_col_offset=36), lineno=80, col_offset=12, end_lineno=80, end_col_offset=36), If(Compare(Subscript(Name('placeholder_15', Load(), lineno=82, col_offset=15, end_lineno=82, end_col_offset=22), Constant(0, lineno=82, col_offset=23, end_lineno=82, end_col_offset=24), Load(), lineno=82, col_offset=15, end_lineno=82, end_col_offset=25), [In()], [List([Name('placeholder_17', Load(), lineno=82, col_offset=30, end_lineno=82, end_col_offset=35), Name('placeholder_18', Load(), lineno=82, col_offset=37, end_lineno=82, end_col_offset=43)], Load(), lineno=82, col_offset=29, end_lineno=82, end_col_offset=44)], lineno=82, col_offset=15, end_lineno=82, end_col_offset=44), [Assign([Name('placeholder_23', Store(), lineno=83, col_offset=16, end_lineno=83, end_col_offset=28)], BinOp(Name('placeholder_22', Load(), lineno=83, col_offset=31, end_lineno=83, end_col_offset=38), Sub(), Call(Name('set', Load(), lineno=83, col_offset=41, end_lineno=83, end_col_offset=44), [List([Constant(0, lineno=83, col_offset=46, end_lineno=83, end_col_offset=47)], Load(), lineno=83, col_offset=45, end_lineno=83, end_col_offset=48)], [], lineno=83, col_offset=41, end_lineno=83, end_col_offset=49), lineno=83, col_offset=31, end_lineno=83, end_col_offset=49), lineno=83, col_offset=16, end_lineno=83, end_col_offset=49)], [Assign([Name('placeholder_23', Store(), lineno=86, col_offset=16, end_lineno=86, end_col_offset=28)], Name('placeholder_22', Load(), lineno=86, col_offset=31, end_lineno=86, end_col_offset=38), lineno=86, col_offset=16, end_lineno=86, end_col_offset=38)], lineno=82, col_offset=12, end_lineno=86, end_col_offset=38), For(Name('placeholder_24', Store(), lineno=88, col_offset=16, end_lineno=88, end_col_offset=17), Name('placeholder_23', Load(), lineno=88, col_offset=21, end_lineno=88, end_col_offset=33), [Assign([Name('placeholder_25', Store(), lineno=89, col_offset=16, end_lineno=89, end_col_offset=22)], BinOp(Name('placeholder_21', Load(), lineno=89, col_offset=25, end_lineno=89, end_col_offset=28), BitOr(), Dict([Subscript(Name('placeholder_15', Load(), lineno=89, col_offset=32, end_lineno=89, end_col_offset=39), Constant(0, lineno=89, col_offset=40, end_lineno=89, end_col_offset=41), Load(), lineno=89, col_offset=32, end_lineno=89, end_col_offset=42)], [Name('placeholder_24', Load(), lineno=89, col_offset=44, end_lineno=89, end_col_offset=45)], lineno=89, col_offset=31, end_lineno=89, end_col_offset=46), lineno=89, col_offset=25, end_lineno=89, end_col_offset=46), lineno=89, col_offset=16, end_lineno=89, end_col_offset=46), Expr(Call(Attribute(Name('placeholder_19', Load(), lineno=90, col_offset=16, end_lineno=90, end_col_offset=30), 'append', Load(), lineno=90, col_offset=16, end_lineno=90, end_col_offset=37), [Tuple([Name('placeholder_25', Load(), lineno=90, col_offset=39, end_lineno=90, end_col_offset=45), BinOp(Name('placeholder_22', Load(), lineno=90, col_offset=47, end_lineno=90, end_col_offset=54), Sub(), Call(Name('set', Load(), lineno=90, col_offset=57, end_lineno=90, end_col_offset=60), [List([Name('placeholder_24', Load(), lineno=90, col_offset=62, end_lineno=90, end_col_offset=63)], Load(), lineno=90, col_offset=61, end_lineno=90, end_col_offset=64)], [], lineno=90, col_offset=57, end_lineno=90, end_col_offset=65), lineno=90, col_offset=47, end_lineno=90, end_col_offset=65)], Load(), lineno=90, col_offset=38, end_lineno=90, end_col_offset=66)], [], lineno=90, col_offset=16, end_lineno=90, end_col_offset=67), lineno=90, col_offset=16, end_lineno=90, end_col_offset=67)], [], lineno=88, col_offset=12, end_lineno=90, end_col_offset=67)], [], lineno=79, col_offset=8, end_lineno=90, end_col_offset=67), Assign([Name('placeholder_16', Store(), lineno=92, col_offset=8, end_lineno=92, end_col_offset=18)], Name('placeholder_19', Load(), lineno=92, col_offset=21, end_lineno=92, end_col_offset=35), lineno=92, col_offset=8, end_lineno=92, end_col_offset=35), Assign([Name('placeholder_15', Store(), lineno=93, col_offset=8, end_lineno=93, end_col_offset=15)], Subscript(Name('placeholder_15', Load(), lineno=93, col_offset=18, end_lineno=93, end_col_offset=25), Slice(Constant(1, lineno=93, col_offset=26, end_lineno=93, end_col_offset=27), lineno=93, col_offset=26, end_lineno=93, end_col_offset=28), Load(), lineno=93, col_offset=18, end_lineno=93, end_col_offset=29), lineno=93, col_offset=8, end_lineno=93, end_col_offset=29)], [], lineno=76, col_offset=4, end_lineno=93, end_col_offset=29), Return(ListComp(Name('placeholder_21', Load(), lineno=94, col_offset=12, end_lineno=94, end_col_offset=15), [comprehension(Tuple([Name('placeholder_21', Store(), lineno=94, col_offset=20, end_lineno=94, end_col_offset=23), Name('placeholder_26', Store(), lineno=94, col_offset=25, end_lineno=94, end_col_offset=26)], Store(), lineno=94, col_offset=20, end_lineno=94, end_col_offset=26), Name('placeholder_16', Load(), lineno=94, col_offset=30, end_lineno=94, end_col_offset=40), [], 0)], lineno=94, col_offset=11, end_lineno=94, end_col_offset=41), lineno=94, col_offset=4, end_lineno=94, end_col_offset=41)], [], lineno=75, col_offset=0, end_lineno=94, end_col_offset=41)], []) \ No newline at end of file From 980bb9c7973f07db63c6a3da5d47e4ce23dd28b5 Mon Sep 17 00:00:00 2001 From: brocla Date: Thu, 14 Mar 2024 14:38:15 -0600 Subject: [PATCH 03/14] Drop unit tests. Be explict about dictionaries. --- .../example_uniondict_normalization.py | 131 +- .../mapping.json | 53 +- .../representation.out | 4579 +++++++---------- .../representation.txt | 2 +- 4 files changed, 2071 insertions(+), 2694 deletions(-) diff --git a/test/example-uniondict-normalization/example_uniondict_normalization.py b/test/example-uniondict-normalization/example_uniondict_normalization.py index d530306..ae4434a 100644 --- a/test/example-uniondict-normalization/example_uniondict_normalization.py +++ b/test/example-uniondict-normalization/example_uniondict_normalization.py @@ -1,3 +1,68 @@ +""" Examples adapted from Mecha Munch Management""" +def update_recipes_tuple(ideas, recipe_updates): + """Update the recipe ideas dictionary. + :param ideas: dict - The "recipe ideas" dict. + :param recipe_updates: tuple - tuple with updates for the ideas section. + :return: dict - updated "recipe ideas" dict. + """ + + # Since this action updates the dict in place, + # the dict then needs to be returned separately, otherwise it is a syntax error. + ideas |= dict(recipe_updates) + return ideas + + +def update_recipes_dict(ideas, recipe_updates): + """Update the recipe ideas dictionary. + :param ideas: dict - The "recipe ideas" dict. + :param recipe_updates: dict - dictionary with updates for the ideas section. + :return: dict - updated "recipe ideas" dict. + """ + + # Since this action returns a *new* dict, it can go directly on the return line. + return dict(ideas) | dict(recipe_updates) + +##Example Usage## +ideas = {'Banana Bread' : {'Banana': 1, 'Apple': 1, 'Walnuts': 1, 'Flour': 1, 'Eggs': 2, 'Butter': 1}} + +recipe_updates_tuple= (('Banana Bread', {'Banana': 4, 'Walnuts': 2, 'Flour': 1, 'Eggs': 2, 'Butter': 1, 'Milk': 2, 'Eggs': 3}),) + +recipe_update_dict= {'Banana Bread': {'Banana': 4, 'Walnuts': 2, 'Flour': 1, 'Eggs': 2, 'Butter': 1, 'Milk': 2, 'Eggs': 3}} + +update_recipes_tuple(ideas, recipe_updates_tuple) + # {'Banana Bread': {'Banana': 4, 'Walnuts': 2, 'Flour': 1, 'Eggs': 3, 'Butter': 1, 'Milk': 2}} + +update_recipes_dict(ideas, recipe_update_dict) + # {'Banana Bread': {'Banana': 4, 'Walnuts': 2, 'Flour': 1, 'Eggs': 3, 'Butter': 1, 'Milk': 2}} + + + +""" Example from `alphametrics` exercise """ +def assign(letters, selections, lefty, righty): + while letters: + new_selections = [] + + for selection in selections: + slc, choices = selection + + if letters[0] in [lefty, righty]: + curr_choices = choices - set([0]) + + else: + curr_choices = choices + + for item in curr_choices: + actual = slc | {letters[0]: item} # combine two dictionaries + new_selections.append((actual, choices - set([item]))) + + selections = new_selections + letters = letters[1:] + return [slc for slc, _ in selections] + + + + + """ This exmple comes from ChatGPT Prompt: Write a python function that @@ -16,7 +81,7 @@ def merge_settings(default_settings, toml_file_path): toml_settings = tomlib.load(f) # Merge default settings with settings from TOML file - merged_settings = default_settings | toml_settings + merged_settings = dict(default_settings) | dict(toml_settings) return merged_settings @@ -29,66 +94,4 @@ def merge_settings(default_settings, toml_file_path): toml_file_path = 'settings.toml' # Path to the TOML file final_settings = merge_settings(default_settings, toml_file_path) -print("Final Settings:", final_settings) - - - - -""" Examples from PEP584 - Add Union Operators To dict""" -d = {'spam': 1, 'eggs': 2, 'cheese': 3} -e = {'cheese': 'cheddar', 'aardvark': 'Ethel'} -# d | e # Representer fails, result must be assigned. # TODO Fix this ???? -# e | d # Representer fails -x = d | e # {'spam': 1, 'eggs': 2, 'cheese': 'cheddar', 'aardvark': 'Ethel'} -y = e | d # {'cheese': 3, 'aardvark': 'Ethel', 'spam': 1, 'eggs': 2} -d |= e # {'spam': 1, 'eggs': 2, 'cheese': 'cheddar', 'aardvark': 'Ethel'} - - - - - -""" Examples from the Cpython unit tests""" -a = {0: 0, 1: 1, 2: 1} -b = {1: 1, 2: 2, 3: 3} - -c = a.copy() -c |= b - -assert a | b == {0: 0, 1: 1, 2: 2, 3: 3} -assert c == {0: 0, 1: 1, 2: 2, 3: 3} - -c = b.copy() -c |= a - -assert b | a == {1: 1, 2: 1, 3: 3, 0: 0} -assert c == {1: 1, 2: 1, 3: 3, 0: 0} - -c = a.copy() -c |= [(1, 1), (2, 2), (3, 3)] - -assert c == {0: 0, 1: 1, 2: 2, 3: 3} - - - - -""" Example from `alphametrics` exercise """ -def assign(letters, selections, lefty, righty): - while letters: - new_selections = [] - - for selection in selections: - slc, choices = selection - - if letters[0] in [lefty, righty]: - curr_choices = choices - set([0]) - - else: - curr_choices = choices - - for i in curr_choices: - actual = slc | {letters[0]: i} # combine two dictionaries - new_selections.append((actual, choices - set([i]))) - - selections = new_selections - letters = letters[1:] - return [slc for slc, _ in selections] +print("Final Settings:", final_settings) \ No newline at end of file diff --git a/test/example-uniondict-normalization/mapping.json b/test/example-uniondict-normalization/mapping.json index a3f924e..7966164 100644 --- a/test/example-uniondict-normalization/mapping.json +++ b/test/example-uniondict-normalization/mapping.json @@ -1,29 +1,28 @@ { - "placeholder_0": "merge_settings", - "placeholder_1": "default_settings", - "placeholder_2": "toml_file_path", - "placeholder_3": "f", - "placeholder_4": "toml_settings", - "placeholder_5": "merged_settings", - "placeholder_6": "final_settings", - "placeholder_7": "d", - "placeholder_8": "e", - "placeholder_9": "x", - "placeholder_10": "y", - "placeholder_11": "a", - "placeholder_12": "b", - "placeholder_13": "c", - "placeholder_14": "assign", - "placeholder_15": "letters", - "placeholder_16": "selections", - "placeholder_17": "lefty", - "placeholder_18": "righty", - "placeholder_19": "new_selections", - "placeholder_20": "selection", - "placeholder_21": "slc", - "placeholder_22": "choices", - "placeholder_23": "curr_choices", - "placeholder_24": "i", - "placeholder_25": "actual", - "placeholder_26": "_" + "placeholder_0": "update_recipes_tuple", + "placeholder_1": "ideas", + "placeholder_2": "recipe_updates", + "placeholder_3": "update_recipes_dict", + "placeholder_4": "recipe_updates_tuple", + "placeholder_5": "recipe_update_dict", + "placeholder_6": "assign", + "placeholder_7": "letters", + "placeholder_8": "selections", + "placeholder_9": "lefty", + "placeholder_10": "righty", + "placeholder_11": "new_selections", + "placeholder_12": "selection", + "placeholder_13": "slc", + "placeholder_14": "choices", + "placeholder_15": "curr_choices", + "placeholder_16": "item", + "placeholder_17": "actual", + "placeholder_18": "_", + "placeholder_19": "merge_settings", + "placeholder_20": "default_settings", + "placeholder_21": "toml_file_path", + "placeholder_22": "f", + "placeholder_23": "toml_settings", + "placeholder_24": "merged_settings", + "placeholder_25": "final_settings" } \ No newline at end of file diff --git a/test/example-uniondict-normalization/representation.out b/test/example-uniondict-normalization/representation.out index bbea6a4..2b6f9c1 100644 --- a/test/example-uniondict-normalization/representation.out +++ b/test/example-uniondict-normalization/representation.out @@ -1,57 +1,86 @@ ## BEGIN NORMALIZED CODE ## -import tomlib +def placeholder_0(placeholder_1, placeholder_2): + placeholder_1 |= dict(placeholder_2) + return placeholder_1 -def placeholder_0(placeholder_1, placeholder_2): - with open(placeholder_2, "r") as placeholder_3: - placeholder_4 = tomlib.load(placeholder_3) - placeholder_5 = placeholder_1 | placeholder_4 - return placeholder_5 +def placeholder_3(placeholder_1, placeholder_2): + return dict(placeholder_1) | dict(placeholder_2) -placeholder_1 = {"timeout": 30, "retry_count": 3, "log_level": "INFO"} -placeholder_2 = "settings.toml" -placeholder_6 = placeholder_0(placeholder_1, placeholder_2) -" Examples from PEP584 - Add Union Operators To dict" -placeholder_7 = {"spam": 1, "eggs": 2, "cheese": 3} -placeholder_8 = {"cheese": "cheddar", "aardvark": "Ethel"} -placeholder_9 = placeholder_7 | placeholder_8 -placeholder_10 = placeholder_8 | placeholder_7 -placeholder_7 |= placeholder_8 -" Examples from the Cpython unit tests" -placeholder_11 = {0: 0, 1: 1, 2: 1} -placeholder_12 = {1: 1, 2: 2, 3: 3} -placeholder_13 = placeholder_11.copy() -placeholder_13 |= placeholder_12 -assert placeholder_11 | placeholder_12 == {0: 0, 1: 1, 2: 2, 3: 3} -assert placeholder_13 == {0: 0, 1: 1, 2: 2, 3: 3} -placeholder_13 = placeholder_12.copy() -placeholder_13 |= placeholder_11 -assert placeholder_12 | placeholder_11 == {1: 1, 2: 1, 3: 3, 0: 0} -assert placeholder_13 == {1: 1, 2: 1, 3: 3, 0: 0} -placeholder_13 = placeholder_11.copy() -placeholder_13 |= [(1, 1), (2, 2), (3, 3)] -assert placeholder_13 == {0: 0, 1: 1, 2: 2, 3: 3} +placeholder_1 = { + "Banana Bread": { + "Banana": 1, + "Apple": 1, + "Walnuts": 1, + "Flour": 1, + "Eggs": 2, + "Butter": 1, + } +} +placeholder_4 = ( + ( + "Banana Bread", + { + "Banana": 4, + "Walnuts": 2, + "Flour": 1, + "Eggs": 2, + "Butter": 1, + "Milk": 2, + "Eggs": 3, + }, + ), +) +placeholder_5 = { + "Banana Bread": { + "Banana": 4, + "Walnuts": 2, + "Flour": 1, + "Eggs": 2, + "Butter": 1, + "Milk": 2, + "Eggs": 3, + } +} +placeholder_0(placeholder_1, placeholder_4) +placeholder_3(placeholder_1, placeholder_5) " Example from `alphametrics` exercise " -def placeholder_14(placeholder_15, placeholder_16, placeholder_17, placeholder_18): - while placeholder_15: - placeholder_19 = [] - for placeholder_20 in placeholder_16: - placeholder_21, placeholder_22 = placeholder_20 - if placeholder_15[0] in [placeholder_17, placeholder_18]: - placeholder_23 = placeholder_22 - set([0]) +def placeholder_6(placeholder_7, placeholder_8, placeholder_9, placeholder_10): + while placeholder_7: + placeholder_11 = [] + for placeholder_12 in placeholder_8: + placeholder_13, placeholder_14 = placeholder_12 + if placeholder_7[0] in [placeholder_9, placeholder_10]: + placeholder_15 = placeholder_14 - set([0]) else: - placeholder_23 = placeholder_22 - for placeholder_24 in placeholder_23: - placeholder_25 = placeholder_21 | {placeholder_15[0]: placeholder_24} - placeholder_19.append( - (placeholder_25, placeholder_22 - set([placeholder_24])) + placeholder_15 = placeholder_14 + for placeholder_16 in placeholder_15: + placeholder_17 = placeholder_13 | {placeholder_7[0]: placeholder_16} + placeholder_11.append( + (placeholder_17, placeholder_14 - set([placeholder_16])) ) - placeholder_16 = placeholder_19 - placeholder_15 = placeholder_15[1:] - return [placeholder_21 for placeholder_21, placeholder_26 in placeholder_16] + placeholder_8 = placeholder_11 + placeholder_7 = placeholder_7[1:] + return [placeholder_13 for placeholder_13, placeholder_18 in placeholder_8] + + +"\n This exmple comes from ChatGPT\n Prompt: Write a python function that \n reads user settings from a toml file and \n merges them with a dictionary of default \n settings to create a single dictionary. \n If there are any conflicts between the \n two sources of settings, the data from \n the toml file should be used.\n" +import tomlib + + +def placeholder_19(placeholder_20, placeholder_21): + with open(placeholder_21, "r") as placeholder_22: + placeholder_23 = tomlib.load(placeholder_22) + placeholder_24 = dict(placeholder_20) | dict(placeholder_23) + return placeholder_24 + + +placeholder_20 = {"timeout": 30, "retry_count": 3, "log_level": "INFO"} +placeholder_21 = "settings.toml" +placeholder_25 = placeholder_19(placeholder_20, placeholder_21) ## END NORMALIZED CODE ## @@ -60,1279 +89,610 @@ Module( [ Expr( Constant( - '\n This exmple comes from ChatGPT\n Prompt: Write a python function that \n reads user settings from a toml file and \n merges them with a dictionary of default \n settings to create a single dictionary. \n If there are any conflicts between the \n two sources of settings, the data from \n the toml file should be used.\n', + ' Examples adapted from Mecha Munch Management', lineno=1, col_offset=0, - end_lineno=10, - end_col_offset=3), + end_lineno=1, + end_col_offset=51), lineno=1, col_offset=0, - end_lineno=10, - end_col_offset=3), - Import( + end_lineno=1, + end_col_offset=51), + FunctionDef( + 'update_recipes_tuple', + arguments( + [], + [ + arg( + 'ideas', + lineno=2, + col_offset=25, + end_lineno=2, + end_col_offset=30), + arg( + 'recipe_updates', + lineno=2, + col_offset=32, + end_lineno=2, + end_col_offset=46)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), [ - alias( - 'tomlib', + Expr( + Constant( + 'Update the recipe ideas dictionary.\n :param ideas: dict - The "recipe ideas" dict.\n :param recipe_updates: tuple - tuple with updates for the ideas section.\n :return: dict - updated "recipe ideas" dict.\n ', + lineno=3, + col_offset=4, + end_lineno=7, + end_col_offset=7), + lineno=3, + col_offset=4, + end_lineno=7, + end_col_offset=7), + AugAssign( + Name( + 'ideas', + Store(), + lineno=11, + col_offset=4, + end_lineno=11, + end_col_offset=9), + BitOr(), + Call( + Name( + 'dict', + Load(), + lineno=11, + col_offset=13, + end_lineno=11, + end_col_offset=17), + [ + Name( + 'recipe_updates', + Load(), + lineno=11, + col_offset=18, + end_lineno=11, + end_col_offset=32)], + [], + lineno=11, + col_offset=13, + end_lineno=11, + end_col_offset=33), lineno=11, - col_offset=7, + col_offset=4, end_lineno=11, - end_col_offset=13)], - lineno=11, + end_col_offset=33), + Return( + Name( + 'ideas', + Load(), + lineno=12, + col_offset=11, + end_lineno=12, + end_col_offset=16), + lineno=12, + col_offset=4, + end_lineno=12, + end_col_offset=16)], + [], + lineno=2, col_offset=0, - end_lineno=11, - end_col_offset=13), + end_lineno=12, + end_col_offset=16), FunctionDef( - 'merge_settings', + 'update_recipes_dict', arguments( [], [ arg( - 'default_settings', - lineno=13, - col_offset=19, - end_lineno=13, - end_col_offset=35), + 'ideas', + lineno=15, + col_offset=24, + end_lineno=15, + end_col_offset=29), arg( - 'toml_file_path', - lineno=13, - col_offset=37, - end_lineno=13, - end_col_offset=51)], + 'recipe_updates', + lineno=15, + col_offset=31, + end_lineno=15, + end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [ - With( - [ - withitem( - Call( + Expr( + Constant( + 'Update the recipe ideas dictionary.\n :param ideas: dict - The "recipe ideas" dict.\n :param recipe_updates: dict - dictionary with updates for the ideas section.\n :return: dict - updated "recipe ideas" dict.\n ', + lineno=16, + col_offset=4, + end_lineno=20, + end_col_offset=7), + lineno=16, + col_offset=4, + end_lineno=20, + end_col_offset=7), + Return( + BinOp( + Call( + Name( + 'dict', + Load(), + lineno=23, + col_offset=11, + end_lineno=23, + end_col_offset=15), + [ Name( - 'open', + 'ideas', Load(), - lineno=15, - col_offset=9, - end_lineno=15, - end_col_offset=13), - [ - Name( - 'toml_file_path', - Load(), - lineno=15, - col_offset=14, - end_lineno=15, - end_col_offset=28), - Constant( - 'r', - lineno=15, - col_offset=30, - end_lineno=15, - end_col_offset=33)], - [], - lineno=15, - col_offset=9, - end_lineno=15, - end_col_offset=34), + lineno=23, + col_offset=16, + end_lineno=23, + end_col_offset=21)], + [], + lineno=23, + col_offset=11, + end_lineno=23, + end_col_offset=22), + BitOr(), + Call( Name( - 'f', - Store(), - lineno=15, - col_offset=38, - end_lineno=15, - end_col_offset=39))], - [ - Assign( + 'dict', + Load(), + lineno=23, + col_offset=25, + end_lineno=23, + end_col_offset=29), [ Name( - 'toml_settings', - Store(), - lineno=16, - col_offset=8, - end_lineno=16, - end_col_offset=21)], - Call( - Attribute( - Name( - 'tomlib', - Load(), - lineno=16, - col_offset=24, - end_lineno=16, - end_col_offset=30), - 'load', + 'recipe_updates', Load(), - lineno=16, - col_offset=24, - end_lineno=16, - end_col_offset=35), - [ - Name( - 'f', - Load(), - lineno=16, - col_offset=36, - end_lineno=16, - end_col_offset=37)], - [], - lineno=16, - col_offset=24, - end_lineno=16, - end_col_offset=38), - lineno=16, - col_offset=8, - end_lineno=16, - end_col_offset=38)], - lineno=15, - col_offset=4, - end_lineno=16, - end_col_offset=38), - Assign( - [ - Name( - 'merged_settings', - Store(), - lineno=19, - col_offset=4, - end_lineno=19, - end_col_offset=19)], - BinOp( - Name( - 'default_settings', - Load(), - lineno=19, - col_offset=22, - end_lineno=19, - end_col_offset=38), - BitOr(), - Name( - 'toml_settings', - Load(), - lineno=19, - col_offset=41, - end_lineno=19, - end_col_offset=54), - lineno=19, - col_offset=22, - end_lineno=19, - end_col_offset=54), - lineno=19, - col_offset=4, - end_lineno=19, - end_col_offset=54), - Return( - Name( - 'merged_settings', - Load(), - lineno=21, + lineno=23, + col_offset=30, + end_lineno=23, + end_col_offset=44)], + [], + lineno=23, + col_offset=25, + end_lineno=23, + end_col_offset=45), + lineno=23, col_offset=11, - end_lineno=21, - end_col_offset=26), - lineno=21, + end_lineno=23, + end_col_offset=45), + lineno=23, col_offset=4, - end_lineno=21, - end_col_offset=26)], + end_lineno=23, + end_col_offset=45)], [], - lineno=13, + lineno=15, col_offset=0, - end_lineno=21, - end_col_offset=26), + end_lineno=23, + end_col_offset=45), Assign( [ Name( - 'default_settings', + 'ideas', Store(), - lineno=24, + lineno=26, col_offset=0, - end_lineno=24, - end_col_offset=16)], + end_lineno=26, + end_col_offset=5)], Dict( [ Constant( - 'timeout', - lineno=25, - col_offset=4, - end_lineno=25, - end_col_offset=13), - Constant( - 'retry_count', + 'Banana Bread', lineno=26, - col_offset=4, + col_offset=10, end_lineno=26, - end_col_offset=17), - Constant( - 'log_level', - lineno=27, - col_offset=4, - end_lineno=27, - end_col_offset=15)], + end_col_offset=24)], [ - Constant( - 30, - lineno=25, - col_offset=15, - end_lineno=25, - end_col_offset=17), - Constant( - 3, + Dict( + [ + Constant( + 'Banana', + lineno=26, + col_offset=28, + end_lineno=26, + end_col_offset=36), + Constant( + 'Apple', + lineno=26, + col_offset=41, + end_lineno=26, + end_col_offset=48), + Constant( + 'Walnuts', + lineno=26, + col_offset=53, + end_lineno=26, + end_col_offset=62), + Constant( + 'Flour', + lineno=26, + col_offset=67, + end_lineno=26, + end_col_offset=74), + Constant( + 'Eggs', + lineno=26, + col_offset=79, + end_lineno=26, + end_col_offset=85), + Constant( + 'Butter', + lineno=26, + col_offset=90, + end_lineno=26, + end_col_offset=98)], + [ + Constant( + 1, + lineno=26, + col_offset=38, + end_lineno=26, + end_col_offset=39), + Constant( + 1, + lineno=26, + col_offset=50, + end_lineno=26, + end_col_offset=51), + Constant( + 1, + lineno=26, + col_offset=64, + end_lineno=26, + end_col_offset=65), + Constant( + 1, + lineno=26, + col_offset=76, + end_lineno=26, + end_col_offset=77), + Constant( + 2, + lineno=26, + col_offset=87, + end_lineno=26, + end_col_offset=88), + Constant( + 1, + lineno=26, + col_offset=100, + end_lineno=26, + end_col_offset=101)], lineno=26, - col_offset=19, + col_offset=27, end_lineno=26, - end_col_offset=20), - Constant( - 'INFO', - lineno=27, - col_offset=17, - end_lineno=27, - end_col_offset=23)], - lineno=24, - col_offset=19, - end_lineno=28, - end_col_offset=1), - lineno=24, + end_col_offset=102)], + lineno=26, + col_offset=9, + end_lineno=26, + end_col_offset=103), + lineno=26, col_offset=0, - end_lineno=28, - end_col_offset=1), + end_lineno=26, + end_col_offset=103), Assign( [ Name( - 'toml_file_path', + 'recipe_updates_tuple', Store(), - lineno=29, + lineno=28, col_offset=0, - end_lineno=29, - end_col_offset=14)], - Constant( - 'settings.toml', - lineno=29, - col_offset=17, - end_lineno=29, - end_col_offset=32), - lineno=29, + end_lineno=28, + end_col_offset=20)], + Tuple( + [ + Tuple( + [ + Constant( + 'Banana Bread', + lineno=28, + col_offset=24, + end_lineno=28, + end_col_offset=38), + Dict( + [ + Constant( + 'Banana', + lineno=28, + col_offset=41, + end_lineno=28, + end_col_offset=49), + Constant( + 'Walnuts', + lineno=28, + col_offset=55, + end_lineno=28, + end_col_offset=64), + Constant( + 'Flour', + lineno=28, + col_offset=69, + end_lineno=28, + end_col_offset=76), + Constant( + 'Eggs', + lineno=28, + col_offset=81, + end_lineno=28, + end_col_offset=87), + Constant( + 'Butter', + lineno=28, + col_offset=92, + end_lineno=28, + end_col_offset=100), + Constant( + 'Milk', + lineno=28, + col_offset=105, + end_lineno=28, + end_col_offset=111), + Constant( + 'Eggs', + lineno=28, + col_offset=116, + end_lineno=28, + end_col_offset=122)], + [ + Constant( + 4, + lineno=28, + col_offset=51, + end_lineno=28, + end_col_offset=52), + Constant( + 2, + lineno=28, + col_offset=66, + end_lineno=28, + end_col_offset=67), + Constant( + 1, + lineno=28, + col_offset=78, + end_lineno=28, + end_col_offset=79), + Constant( + 2, + lineno=28, + col_offset=89, + end_lineno=28, + end_col_offset=90), + Constant( + 1, + lineno=28, + col_offset=102, + end_lineno=28, + end_col_offset=103), + Constant( + 2, + lineno=28, + col_offset=113, + end_lineno=28, + end_col_offset=114), + Constant( + 3, + lineno=28, + col_offset=124, + end_lineno=28, + end_col_offset=125)], + lineno=28, + col_offset=40, + end_lineno=28, + end_col_offset=126)], + Load(), + lineno=28, + col_offset=23, + end_lineno=28, + end_col_offset=127)], + Load(), + lineno=28, + col_offset=22, + end_lineno=28, + end_col_offset=129), + lineno=28, col_offset=0, - end_lineno=29, - end_col_offset=32), + end_lineno=28, + end_col_offset=129), Assign( [ Name( - 'final_settings', + 'recipe_update_dict', Store(), - lineno=31, + lineno=30, col_offset=0, - end_lineno=31, - end_col_offset=14)], - Call( - Name( - 'merge_settings', - Load(), - lineno=31, - col_offset=17, - end_lineno=31, - end_col_offset=31), + end_lineno=30, + end_col_offset=18)], + Dict( [ - Name( - 'default_settings', - Load(), - lineno=31, - col_offset=32, - end_lineno=31, - end_col_offset=48), - Name( - 'toml_file_path', - Load(), - lineno=31, - col_offset=50, - end_lineno=31, - end_col_offset=64)], - [], - lineno=31, - col_offset=17, - end_lineno=31, - end_col_offset=65), - lineno=31, - col_offset=0, - end_lineno=31, - end_col_offset=65), - Expr( - Call( - Name( - 'print', - Load(), - lineno=32, - col_offset=0, - end_lineno=32, - end_col_offset=5), - [ - Constant( - 'Final Settings:', - lineno=32, - col_offset=6, - end_lineno=32, - end_col_offset=23), - Name( - 'final_settings', - Load(), - lineno=32, - col_offset=25, - end_lineno=32, - end_col_offset=39)], - [], - lineno=32, - col_offset=0, - end_lineno=32, - end_col_offset=40), - lineno=32, - col_offset=0, - end_lineno=32, - end_col_offset=40), - Expr( - Constant( - ' Examples from PEP584 - Add Union Operators To dict', - lineno=37, - col_offset=0, - end_lineno=37, - end_col_offset=57), - lineno=37, - col_offset=0, - end_lineno=37, - end_col_offset=57), - Assign( - [ - Name( - 'd', - Store(), - lineno=38, - col_offset=0, - end_lineno=38, - end_col_offset=1)], - Dict( - [ - Constant( - 'spam', - lineno=38, - col_offset=5, - end_lineno=38, - end_col_offset=11), Constant( - 'eggs', - lineno=38, - col_offset=16, - end_lineno=38, - end_col_offset=22), - Constant( - 'cheese', - lineno=38, - col_offset=27, - end_lineno=38, + 'Banana Bread', + lineno=30, + col_offset=21, + end_lineno=30, end_col_offset=35)], - [ - Constant( - 1, - lineno=38, - col_offset=13, - end_lineno=38, - end_col_offset=14), - Constant( - 2, - lineno=38, - col_offset=24, - end_lineno=38, - end_col_offset=25), - Constant( - 3, - lineno=38, - col_offset=37, - end_lineno=38, - end_col_offset=38)], - lineno=38, - col_offset=4, - end_lineno=38, - end_col_offset=39), - lineno=38, - col_offset=0, - end_lineno=38, - end_col_offset=39), - Assign( - [ - Name( - 'e', - Store(), - lineno=39, - col_offset=0, - end_lineno=39, - end_col_offset=1)], - Dict( - [ - Constant( - 'cheese', - lineno=39, - col_offset=5, - end_lineno=39, - end_col_offset=13), - Constant( - 'aardvark', - lineno=39, - col_offset=26, - end_lineno=39, - end_col_offset=36)], - [ - Constant( - 'cheddar', - lineno=39, - col_offset=15, - end_lineno=39, - end_col_offset=24), - Constant( - 'Ethel', - lineno=39, - col_offset=38, - end_lineno=39, - end_col_offset=45)], - lineno=39, - col_offset=4, - end_lineno=39, - end_col_offset=46), - lineno=39, - col_offset=0, - end_lineno=39, - end_col_offset=46), - Assign( - [ - Name( - 'x', - Store(), - lineno=42, - col_offset=0, - end_lineno=42, - end_col_offset=1)], - BinOp( - Name( - 'd', - Load(), - lineno=42, - col_offset=4, - end_lineno=42, - end_col_offset=5), - BitOr(), - Name( - 'e', - Load(), - lineno=42, - col_offset=8, - end_lineno=42, - end_col_offset=9), - lineno=42, - col_offset=4, - end_lineno=42, - end_col_offset=9), - lineno=42, - col_offset=0, - end_lineno=42, - end_col_offset=9), - Assign( - [ - Name( - 'y', - Store(), - lineno=43, - col_offset=0, - end_lineno=43, - end_col_offset=1)], - BinOp( - Name( - 'e', - Load(), - lineno=43, - col_offset=4, - end_lineno=43, - end_col_offset=5), - BitOr(), - Name( - 'd', - Load(), - lineno=43, - col_offset=8, - end_lineno=43, - end_col_offset=9), - lineno=43, - col_offset=4, - end_lineno=43, - end_col_offset=9), - lineno=43, - col_offset=0, - end_lineno=43, - end_col_offset=9), - AugAssign( - Name( - 'd', - Store(), - lineno=44, - col_offset=0, - end_lineno=44, - end_col_offset=1), - BitOr(), - Name( - 'e', - Load(), - lineno=44, - col_offset=5, - end_lineno=44, - end_col_offset=6), - lineno=44, - col_offset=0, - end_lineno=44, - end_col_offset=6), - Expr( - Constant( - ' Examples from the Cpython unit tests', - lineno=50, - col_offset=0, - end_lineno=50, - end_col_offset=43), - lineno=50, - col_offset=0, - end_lineno=50, - end_col_offset=43), - Assign( - [ - Name( - 'a', - Store(), - lineno=51, - col_offset=0, - end_lineno=51, - end_col_offset=1)], - Dict( - [ - Constant( - 0, - lineno=51, - col_offset=5, - end_lineno=51, - end_col_offset=6), - Constant( - 1, - lineno=51, - col_offset=11, - end_lineno=51, - end_col_offset=12), - Constant( - 2, - lineno=51, - col_offset=17, - end_lineno=51, - end_col_offset=18)], - [ - Constant( - 0, - lineno=51, - col_offset=8, - end_lineno=51, - end_col_offset=9), - Constant( - 1, - lineno=51, - col_offset=14, - end_lineno=51, - end_col_offset=15), - Constant( - 1, - lineno=51, - col_offset=20, - end_lineno=51, - end_col_offset=21)], - lineno=51, - col_offset=4, - end_lineno=51, - end_col_offset=22), - lineno=51, - col_offset=0, - end_lineno=51, - end_col_offset=22), - Assign( - [ - Name( - 'b', - Store(), - lineno=52, - col_offset=0, - end_lineno=52, - end_col_offset=1)], - Dict( - [ - Constant( - 1, - lineno=52, - col_offset=5, - end_lineno=52, - end_col_offset=6), - Constant( - 2, - lineno=52, - col_offset=11, - end_lineno=52, - end_col_offset=12), - Constant( - 3, - lineno=52, - col_offset=17, - end_lineno=52, - end_col_offset=18)], - [ - Constant( - 1, - lineno=52, - col_offset=8, - end_lineno=52, - end_col_offset=9), - Constant( - 2, - lineno=52, - col_offset=14, - end_lineno=52, - end_col_offset=15), - Constant( - 3, - lineno=52, - col_offset=20, - end_lineno=52, - end_col_offset=21)], - lineno=52, - col_offset=4, - end_lineno=52, - end_col_offset=22), - lineno=52, - col_offset=0, - end_lineno=52, - end_col_offset=22), - Assign( - [ - Name( - 'c', - Store(), - lineno=54, - col_offset=0, - end_lineno=54, - end_col_offset=1)], - Call( - Attribute( - Name( - 'a', - Load(), - lineno=54, - col_offset=4, - end_lineno=54, - end_col_offset=5), - 'copy', - Load(), - lineno=54, - col_offset=4, - end_lineno=54, - end_col_offset=10), - [], - [], - lineno=54, - col_offset=4, - end_lineno=54, - end_col_offset=12), - lineno=54, - col_offset=0, - end_lineno=54, - end_col_offset=12), - AugAssign( - Name( - 'c', - Store(), - lineno=55, - col_offset=0, - end_lineno=55, - end_col_offset=1), - BitOr(), - Name( - 'b', - Load(), - lineno=55, - col_offset=5, - end_lineno=55, - end_col_offset=6), - lineno=55, - col_offset=0, - end_lineno=55, - end_col_offset=6), - Assert( - Compare( - BinOp( - Name( - 'a', - Load(), - lineno=57, - col_offset=7, - end_lineno=57, - end_col_offset=8), - BitOr(), - Name( - 'b', - Load(), - lineno=57, - col_offset=11, - end_lineno=57, - end_col_offset=12), - lineno=57, - col_offset=7, - end_lineno=57, - end_col_offset=12), - [ - Eq()], [ Dict( [ Constant( - 0, - lineno=57, - col_offset=17, - end_lineno=57, - end_col_offset=18), - Constant( - 1, - lineno=57, - col_offset=23, - end_lineno=57, - end_col_offset=24), - Constant( - 2, - lineno=57, - col_offset=29, - end_lineno=57, - end_col_offset=30), - Constant( - 3, - lineno=57, - col_offset=35, - end_lineno=57, - end_col_offset=36)], + 'Banana', + lineno=30, + col_offset=38, + end_lineno=30, + end_col_offset=46), + Constant( + 'Walnuts', + lineno=30, + col_offset=52, + end_lineno=30, + end_col_offset=61), + Constant( + 'Flour', + lineno=30, + col_offset=66, + end_lineno=30, + end_col_offset=73), + Constant( + 'Eggs', + lineno=30, + col_offset=78, + end_lineno=30, + end_col_offset=84), + Constant( + 'Butter', + lineno=30, + col_offset=89, + end_lineno=30, + end_col_offset=97), + Constant( + 'Milk', + lineno=30, + col_offset=102, + end_lineno=30, + end_col_offset=108), + Constant( + 'Eggs', + lineno=30, + col_offset=113, + end_lineno=30, + end_col_offset=119)], [ Constant( - 0, - lineno=57, - col_offset=20, - end_lineno=57, - end_col_offset=21), - Constant( - 1, - lineno=57, - col_offset=26, - end_lineno=57, - end_col_offset=27), + 4, + lineno=30, + col_offset=48, + end_lineno=30, + end_col_offset=49), Constant( 2, - lineno=57, - col_offset=32, - end_lineno=57, - end_col_offset=33), - Constant( - 3, - lineno=57, - col_offset=38, - end_lineno=57, - end_col_offset=39)], - lineno=57, - col_offset=16, - end_lineno=57, - end_col_offset=40)], - lineno=57, - col_offset=7, - end_lineno=57, - end_col_offset=40), - lineno=57, - col_offset=0, - end_lineno=57, - end_col_offset=40), - Assert( - Compare( - Name( - 'c', - Load(), - lineno=58, - col_offset=7, - end_lineno=58, - end_col_offset=8), - [ - Eq()], - [ - Dict( - [ - Constant( - 0, - lineno=58, - col_offset=13, - end_lineno=58, - end_col_offset=14), + lineno=30, + col_offset=63, + end_lineno=30, + end_col_offset=64), Constant( 1, - lineno=58, - col_offset=19, - end_lineno=58, - end_col_offset=20), + lineno=30, + col_offset=75, + end_lineno=30, + end_col_offset=76), Constant( 2, - lineno=58, - col_offset=25, - end_lineno=58, - end_col_offset=26), - Constant( - 3, - lineno=58, - col_offset=31, - end_lineno=58, - end_col_offset=32)], - [ - Constant( - 0, - lineno=58, - col_offset=16, - end_lineno=58, - end_col_offset=17), + lineno=30, + col_offset=86, + end_lineno=30, + end_col_offset=87), Constant( 1, - lineno=58, - col_offset=22, - end_lineno=58, - end_col_offset=23), + lineno=30, + col_offset=99, + end_lineno=30, + end_col_offset=100), Constant( 2, - lineno=58, - col_offset=28, - end_lineno=58, - end_col_offset=29), + lineno=30, + col_offset=110, + end_lineno=30, + end_col_offset=111), Constant( 3, - lineno=58, - col_offset=34, - end_lineno=58, - end_col_offset=35)], - lineno=58, - col_offset=12, - end_lineno=58, - end_col_offset=36)], - lineno=58, - col_offset=7, - end_lineno=58, - end_col_offset=36), - lineno=58, + lineno=30, + col_offset=121, + end_lineno=30, + end_col_offset=122)], + lineno=30, + col_offset=37, + end_lineno=30, + end_col_offset=123)], + lineno=30, + col_offset=20, + end_lineno=30, + end_col_offset=124), + lineno=30, col_offset=0, - end_lineno=58, - end_col_offset=36), - Assign( - [ - Name( - 'c', - Store(), - lineno=60, - col_offset=0, - end_lineno=60, - end_col_offset=1)], + end_lineno=30, + end_col_offset=124), + Expr( Call( - Attribute( - Name( - 'b', - Load(), - lineno=60, - col_offset=4, - end_lineno=60, - end_col_offset=5), - 'copy', + Name( + 'update_recipes_tuple', Load(), - lineno=60, - col_offset=4, - end_lineno=60, - end_col_offset=10), - [], - [], - lineno=60, - col_offset=4, - end_lineno=60, - end_col_offset=12), - lineno=60, - col_offset=0, - end_lineno=60, - end_col_offset=12), - AugAssign( - Name( - 'c', - Store(), - lineno=61, - col_offset=0, - end_lineno=61, - end_col_offset=1), - BitOr(), - Name( - 'a', - Load(), - lineno=61, - col_offset=5, - end_lineno=61, - end_col_offset=6), - lineno=61, - col_offset=0, - end_lineno=61, - end_col_offset=6), - Assert( - Compare( - BinOp( + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=20), + [ Name( - 'b', + 'ideas', Load(), - lineno=63, - col_offset=7, - end_lineno=63, - end_col_offset=8), - BitOr(), + lineno=32, + col_offset=21, + end_lineno=32, + end_col_offset=26), Name( - 'a', + 'recipe_updates_tuple', Load(), - lineno=63, - col_offset=11, - end_lineno=63, - end_col_offset=12), - lineno=63, - col_offset=7, - end_lineno=63, - end_col_offset=12), - [ - Eq()], - [ - Dict( - [ - Constant( - 1, - lineno=63, - col_offset=17, - end_lineno=63, - end_col_offset=18), - Constant( - 2, - lineno=63, - col_offset=23, - end_lineno=63, - end_col_offset=24), - Constant( - 3, - lineno=63, - col_offset=29, - end_lineno=63, - end_col_offset=30), - Constant( - 0, - lineno=63, - col_offset=35, - end_lineno=63, - end_col_offset=36)], - [ - Constant( - 1, - lineno=63, - col_offset=20, - end_lineno=63, - end_col_offset=21), - Constant( - 1, - lineno=63, - col_offset=26, - end_lineno=63, - end_col_offset=27), - Constant( - 3, - lineno=63, - col_offset=32, - end_lineno=63, - end_col_offset=33), - Constant( - 0, - lineno=63, - col_offset=38, - end_lineno=63, - end_col_offset=39)], - lineno=63, - col_offset=16, - end_lineno=63, - end_col_offset=40)], - lineno=63, - col_offset=7, - end_lineno=63, - end_col_offset=40), - lineno=63, + lineno=32, + col_offset=28, + end_lineno=32, + end_col_offset=48)], + [], + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=49), + lineno=32, col_offset=0, - end_lineno=63, - end_col_offset=40), - Assert( - Compare( + end_lineno=32, + end_col_offset=49), + Expr( + Call( Name( - 'c', + 'update_recipes_dict', Load(), - lineno=64, - col_offset=7, - end_lineno=64, - end_col_offset=8), - [ - Eq()], - [ - Dict( - [ - Constant( - 1, - lineno=64, - col_offset=13, - end_lineno=64, - end_col_offset=14), - Constant( - 2, - lineno=64, - col_offset=19, - end_lineno=64, - end_col_offset=20), - Constant( - 3, - lineno=64, - col_offset=25, - end_lineno=64, - end_col_offset=26), - Constant( - 0, - lineno=64, - col_offset=31, - end_lineno=64, - end_col_offset=32)], - [ - Constant( - 1, - lineno=64, - col_offset=16, - end_lineno=64, - end_col_offset=17), - Constant( - 1, - lineno=64, - col_offset=22, - end_lineno=64, - end_col_offset=23), - Constant( - 3, - lineno=64, - col_offset=28, - end_lineno=64, - end_col_offset=29), - Constant( - 0, - lineno=64, - col_offset=34, - end_lineno=64, - end_col_offset=35)], - lineno=64, - col_offset=12, - end_lineno=64, - end_col_offset=36)], - lineno=64, - col_offset=7, - end_lineno=64, - end_col_offset=36), - lineno=64, - col_offset=0, - end_lineno=64, - end_col_offset=36), - Assign( - [ - Name( - 'c', - Store(), - lineno=66, + lineno=35, col_offset=0, - end_lineno=66, - end_col_offset=1)], - Call( - Attribute( + end_lineno=35, + end_col_offset=19), + [ Name( - 'a', + 'ideas', Load(), - lineno=66, - col_offset=4, - end_lineno=66, - end_col_offset=5), - 'copy', - Load(), - lineno=66, - col_offset=4, - end_lineno=66, - end_col_offset=10), - [], + lineno=35, + col_offset=20, + end_lineno=35, + end_col_offset=25), + Name( + 'recipe_update_dict', + Load(), + lineno=35, + col_offset=27, + end_lineno=35, + end_col_offset=45)], [], - lineno=66, - col_offset=4, - end_lineno=66, - end_col_offset=12), - lineno=66, - col_offset=0, - end_lineno=66, - end_col_offset=12), - AugAssign( - Name( - 'c', - Store(), - lineno=67, + lineno=35, col_offset=0, - end_lineno=67, - end_col_offset=1), - BitOr(), - List( - [ - Tuple( - [ - Constant( - 1, - lineno=67, - col_offset=7, - end_lineno=67, - end_col_offset=8), - Constant( - 1, - lineno=67, - col_offset=10, - end_lineno=67, - end_col_offset=11)], - Load(), - lineno=67, - col_offset=6, - end_lineno=67, - end_col_offset=12), - Tuple( - [ - Constant( - 2, - lineno=67, - col_offset=15, - end_lineno=67, - end_col_offset=16), - Constant( - 2, - lineno=67, - col_offset=18, - end_lineno=67, - end_col_offset=19)], - Load(), - lineno=67, - col_offset=14, - end_lineno=67, - end_col_offset=20), - Tuple( - [ - Constant( - 3, - lineno=67, - col_offset=23, - end_lineno=67, - end_col_offset=24), - Constant( - 3, - lineno=67, - col_offset=26, - end_lineno=67, - end_col_offset=27)], - Load(), - lineno=67, - col_offset=22, - end_lineno=67, - end_col_offset=28)], - Load(), - lineno=67, - col_offset=5, - end_lineno=67, - end_col_offset=29), - lineno=67, - col_offset=0, - end_lineno=67, - end_col_offset=29), - Assert( - Compare( - Name( - 'c', - Load(), - lineno=69, - col_offset=7, - end_lineno=69, - end_col_offset=8), - [ - Eq()], - [ - Dict( - [ - Constant( - 0, - lineno=69, - col_offset=13, - end_lineno=69, - end_col_offset=14), - Constant( - 1, - lineno=69, - col_offset=19, - end_lineno=69, - end_col_offset=20), - Constant( - 2, - lineno=69, - col_offset=25, - end_lineno=69, - end_col_offset=26), - Constant( - 3, - lineno=69, - col_offset=31, - end_lineno=69, - end_col_offset=32)], - [ - Constant( - 0, - lineno=69, - col_offset=16, - end_lineno=69, - end_col_offset=17), - Constant( - 1, - lineno=69, - col_offset=22, - end_lineno=69, - end_col_offset=23), - Constant( - 2, - lineno=69, - col_offset=28, - end_lineno=69, - end_col_offset=29), - Constant( - 3, - lineno=69, - col_offset=34, - end_lineno=69, - end_col_offset=35)], - lineno=69, - col_offset=12, - end_lineno=69, - end_col_offset=36)], - lineno=69, - col_offset=7, - end_lineno=69, - end_col_offset=36), - lineno=69, + end_lineno=35, + end_col_offset=46), + lineno=35, col_offset=0, - end_lineno=69, - end_col_offset=36), + end_lineno=35, + end_col_offset=46), Expr( Constant( ' Example from `alphametrics` exercise ', - lineno=74, + lineno=40, col_offset=0, - end_lineno=74, + end_lineno=40, end_col_offset=44), - lineno=74, + lineno=40, col_offset=0, - end_lineno=74, + end_lineno=40, end_col_offset=44), FunctionDef( 'assign', @@ -1341,27 +701,27 @@ Module( [ arg( 'letters', - lineno=75, + lineno=41, col_offset=11, - end_lineno=75, + end_lineno=41, end_col_offset=18), arg( 'selections', - lineno=75, + lineno=41, col_offset=20, - end_lineno=75, + end_lineno=41, end_col_offset=30), arg( 'lefty', - lineno=75, + lineno=41, col_offset=32, - end_lineno=75, + end_lineno=41, end_col_offset=37), arg( 'righty', - lineno=75, + lineno=41, col_offset=39, - end_lineno=75, + end_lineno=41, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], @@ -1371,9 +731,9 @@ Module( Name( 'letters', Load(), - lineno=76, + lineno=42, col_offset=10, - end_lineno=76, + end_lineno=42, end_col_offset=17), [ Assign( @@ -1381,35 +741,35 @@ Module( Name( 'new_selections', Store(), - lineno=77, + lineno=43, col_offset=8, - end_lineno=77, + end_lineno=43, end_col_offset=22)], List( [], Load(), - lineno=77, + lineno=43, col_offset=25, - end_lineno=77, + end_lineno=43, end_col_offset=27), - lineno=77, + lineno=43, col_offset=8, - end_lineno=77, + end_lineno=43, end_col_offset=27), For( Name( 'selection', Store(), - lineno=79, + lineno=45, col_offset=12, - end_lineno=79, + end_lineno=45, end_col_offset=21), Name( 'selections', Load(), - lineno=79, + lineno=45, col_offset=25, - end_lineno=79, + end_lineno=45, end_col_offset=35), [ Assign( @@ -1419,32 +779,32 @@ Module( Name( 'slc', Store(), - lineno=80, + lineno=46, col_offset=12, - end_lineno=80, + end_lineno=46, end_col_offset=15), Name( 'choices', Store(), - lineno=80, + lineno=46, col_offset=17, - end_lineno=80, + end_lineno=46, end_col_offset=24)], Store(), - lineno=80, + lineno=46, col_offset=12, - end_lineno=80, + end_lineno=46, end_col_offset=24)], Name( 'selection', Load(), - lineno=80, + lineno=46, col_offset=27, - end_lineno=80, + end_lineno=46, end_col_offset=36), - lineno=80, + lineno=46, col_offset=12, - end_lineno=80, + end_lineno=46, end_col_offset=36), If( Compare( @@ -1452,20 +812,20 @@ Module( Name( 'letters', Load(), - lineno=82, + lineno=48, col_offset=15, - end_lineno=82, + end_lineno=48, end_col_offset=22), Constant( 0, - lineno=82, + lineno=48, col_offset=23, - end_lineno=82, + end_lineno=48, end_col_offset=24), Load(), - lineno=82, + lineno=48, col_offset=15, - end_lineno=82, + end_lineno=48, end_col_offset=25), [ In()], @@ -1475,25 +835,25 @@ Module( Name( 'lefty', Load(), - lineno=82, + lineno=48, col_offset=30, - end_lineno=82, + end_lineno=48, end_col_offset=35), Name( 'righty', Load(), - lineno=82, + lineno=48, col_offset=37, - end_lineno=82, + end_lineno=48, end_col_offset=43)], Load(), - lineno=82, + lineno=48, col_offset=29, - end_lineno=82, + end_lineno=48, end_col_offset=44)], - lineno=82, + lineno=48, col_offset=15, - end_lineno=82, + end_lineno=48, end_col_offset=44), [ Assign( @@ -1501,53 +861,53 @@ Module( Name( 'curr_choices', Store(), - lineno=83, + lineno=49, col_offset=16, - end_lineno=83, + end_lineno=49, end_col_offset=28)], BinOp( Name( 'choices', Load(), - lineno=83, + lineno=49, col_offset=31, - end_lineno=83, + end_lineno=49, end_col_offset=38), Sub(), Call( Name( 'set', Load(), - lineno=83, + lineno=49, col_offset=41, - end_lineno=83, + end_lineno=49, end_col_offset=44), [ List( [ Constant( 0, - lineno=83, + lineno=49, col_offset=46, - end_lineno=83, + end_lineno=49, end_col_offset=47)], Load(), - lineno=83, + lineno=49, col_offset=45, - end_lineno=83, + end_lineno=49, end_col_offset=48)], [], - lineno=83, + lineno=49, col_offset=41, - end_lineno=83, + end_lineno=49, end_col_offset=49), - lineno=83, + lineno=49, col_offset=31, - end_lineno=83, + end_lineno=49, end_col_offset=49), - lineno=83, + lineno=49, col_offset=16, - end_lineno=83, + end_lineno=49, end_col_offset=49)], [ Assign( @@ -1555,57 +915,57 @@ Module( Name( 'curr_choices', Store(), - lineno=86, + lineno=52, col_offset=16, - end_lineno=86, + end_lineno=52, end_col_offset=28)], Name( 'choices', Load(), - lineno=86, + lineno=52, col_offset=31, - end_lineno=86, + end_lineno=52, end_col_offset=38), - lineno=86, + lineno=52, col_offset=16, - end_lineno=86, + end_lineno=52, end_col_offset=38)], - lineno=82, + lineno=48, col_offset=12, - end_lineno=86, + end_lineno=52, end_col_offset=38), For( Name( - 'i', + 'item', Store(), - lineno=88, + lineno=54, col_offset=16, - end_lineno=88, - end_col_offset=17), + end_lineno=54, + end_col_offset=20), Name( 'curr_choices', Load(), - lineno=88, - col_offset=21, - end_lineno=88, - end_col_offset=33), + lineno=54, + col_offset=24, + end_lineno=54, + end_col_offset=36), [ Assign( [ Name( 'actual', Store(), - lineno=89, + lineno=55, col_offset=16, - end_lineno=89, + end_lineno=55, end_col_offset=22)], BinOp( Name( 'slc', Load(), - lineno=89, + lineno=55, col_offset=25, - end_lineno=89, + end_lineno=55, end_col_offset=28), BitOr(), Dict( @@ -1614,56 +974,56 @@ Module( Name( 'letters', Load(), - lineno=89, + lineno=55, col_offset=32, - end_lineno=89, + end_lineno=55, end_col_offset=39), Constant( 0, - lineno=89, + lineno=55, col_offset=40, - end_lineno=89, + end_lineno=55, end_col_offset=41), Load(), - lineno=89, + lineno=55, col_offset=32, - end_lineno=89, + end_lineno=55, end_col_offset=42)], [ Name( - 'i', + 'item', Load(), - lineno=89, + lineno=55, col_offset=44, - end_lineno=89, - end_col_offset=45)], - lineno=89, + end_lineno=55, + end_col_offset=48)], + lineno=55, col_offset=31, - end_lineno=89, - end_col_offset=46), - lineno=89, + end_lineno=55, + end_col_offset=49), + lineno=55, col_offset=25, - end_lineno=89, - end_col_offset=46), - lineno=89, + end_lineno=55, + end_col_offset=49), + lineno=55, col_offset=16, - end_lineno=89, - end_col_offset=46), + end_lineno=55, + end_col_offset=49), Expr( Call( Attribute( Name( 'new_selections', Load(), - lineno=90, + lineno=56, col_offset=16, - end_lineno=90, + end_lineno=56, end_col_offset=30), 'append', Load(), - lineno=90, + lineno=56, col_offset=16, - end_lineno=90, + end_lineno=56, end_col_offset=37), [ Tuple( @@ -1671,145 +1031,145 @@ Module( Name( 'actual', Load(), - lineno=90, + lineno=56, col_offset=39, - end_lineno=90, + end_lineno=56, end_col_offset=45), BinOp( Name( 'choices', Load(), - lineno=90, + lineno=56, col_offset=47, - end_lineno=90, + end_lineno=56, end_col_offset=54), Sub(), Call( Name( 'set', Load(), - lineno=90, + lineno=56, col_offset=57, - end_lineno=90, + end_lineno=56, end_col_offset=60), [ List( [ Name( - 'i', + 'item', Load(), - lineno=90, + lineno=56, col_offset=62, - end_lineno=90, - end_col_offset=63)], + end_lineno=56, + end_col_offset=66)], Load(), - lineno=90, + lineno=56, col_offset=61, - end_lineno=90, - end_col_offset=64)], + end_lineno=56, + end_col_offset=67)], [], - lineno=90, + lineno=56, col_offset=57, - end_lineno=90, - end_col_offset=65), - lineno=90, + end_lineno=56, + end_col_offset=68), + lineno=56, col_offset=47, - end_lineno=90, - end_col_offset=65)], + end_lineno=56, + end_col_offset=68)], Load(), - lineno=90, + lineno=56, col_offset=38, - end_lineno=90, - end_col_offset=66)], + end_lineno=56, + end_col_offset=69)], [], - lineno=90, + lineno=56, col_offset=16, - end_lineno=90, - end_col_offset=67), - lineno=90, + end_lineno=56, + end_col_offset=70), + lineno=56, col_offset=16, - end_lineno=90, - end_col_offset=67)], + end_lineno=56, + end_col_offset=70)], [], - lineno=88, + lineno=54, col_offset=12, - end_lineno=90, - end_col_offset=67)], + end_lineno=56, + end_col_offset=70)], [], - lineno=79, + lineno=45, col_offset=8, - end_lineno=90, - end_col_offset=67), + end_lineno=56, + end_col_offset=70), Assign( [ Name( 'selections', Store(), - lineno=92, + lineno=58, col_offset=8, - end_lineno=92, + end_lineno=58, end_col_offset=18)], Name( 'new_selections', Load(), - lineno=92, + lineno=58, col_offset=21, - end_lineno=92, + end_lineno=58, end_col_offset=35), - lineno=92, + lineno=58, col_offset=8, - end_lineno=92, + end_lineno=58, end_col_offset=35), Assign( [ Name( 'letters', Store(), - lineno=93, + lineno=59, col_offset=8, - end_lineno=93, + end_lineno=59, end_col_offset=15)], Subscript( Name( 'letters', Load(), - lineno=93, + lineno=59, col_offset=18, - end_lineno=93, + end_lineno=59, end_col_offset=25), Slice( Constant( 1, - lineno=93, + lineno=59, col_offset=26, - end_lineno=93, + end_lineno=59, end_col_offset=27), - lineno=93, + lineno=59, col_offset=26, - end_lineno=93, + end_lineno=59, end_col_offset=28), Load(), - lineno=93, + lineno=59, col_offset=18, - end_lineno=93, + end_lineno=59, end_col_offset=29), - lineno=93, + lineno=59, col_offset=8, - end_lineno=93, + end_lineno=59, end_col_offset=29)], [], - lineno=76, + lineno=42, col_offset=4, - end_lineno=93, + end_lineno=59, end_col_offset=29), Return( ListComp( Name( 'slc', Load(), - lineno=94, + lineno=60, col_offset=12, - end_lineno=94, + end_lineno=60, end_col_offset=15), [ comprehension( @@ -1818,78 +1178,83 @@ Module( Name( 'slc', Store(), - lineno=94, + lineno=60, col_offset=20, - end_lineno=94, + end_lineno=60, end_col_offset=23), Name( '_', Store(), - lineno=94, + lineno=60, col_offset=25, - end_lineno=94, + end_lineno=60, end_col_offset=26)], Store(), - lineno=94, + lineno=60, col_offset=20, - end_lineno=94, + end_lineno=60, end_col_offset=26), Name( 'selections', Load(), - lineno=94, + lineno=60, col_offset=30, - end_lineno=94, + end_lineno=60, end_col_offset=40), [], 0)], - lineno=94, + lineno=60, col_offset=11, - end_lineno=94, + end_lineno=60, end_col_offset=41), - lineno=94, + lineno=60, col_offset=4, - end_lineno=94, + end_lineno=60, end_col_offset=41)], [], - lineno=75, + lineno=41, col_offset=0, - end_lineno=94, - end_col_offset=41)], - []) -## END TREE BEFORE ## - -## BEGIN NORMALIZED TREE ## -Module( - [ + end_lineno=60, + end_col_offset=41), + Expr( + Constant( + '\n This exmple comes from ChatGPT\n Prompt: Write a python function that \n reads user settings from a toml file and \n merges them with a dictionary of default \n settings to create a single dictionary. \n If there are any conflicts between the \n two sources of settings, the data from \n the toml file should be used.\n', + lineno=66, + col_offset=0, + end_lineno=75, + end_col_offset=3), + lineno=66, + col_offset=0, + end_lineno=75, + end_col_offset=3), Import( [ alias( 'tomlib', - lineno=11, + lineno=76, col_offset=7, - end_lineno=11, + end_lineno=76, end_col_offset=13)], - lineno=11, + lineno=76, col_offset=0, - end_lineno=11, + end_lineno=76, end_col_offset=13), FunctionDef( - 'placeholder_0', + 'merge_settings', arguments( [], [ arg( - 'placeholder_1', - lineno=13, + 'default_settings', + lineno=78, col_offset=19, - end_lineno=13, + end_lineno=78, end_col_offset=35), arg( - 'placeholder_2', - lineno=13, + 'toml_file_path', + lineno=78, col_offset=37, - end_lineno=13, + end_lineno=78, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], @@ -1902,1227 +1267,916 @@ Module( Name( 'open', Load(), - lineno=15, + lineno=80, col_offset=9, - end_lineno=15, + end_lineno=80, end_col_offset=13), [ Name( - 'placeholder_2', + 'toml_file_path', Load(), - lineno=15, + lineno=80, col_offset=14, - end_lineno=15, + end_lineno=80, end_col_offset=28), Constant( 'r', - lineno=15, + lineno=80, col_offset=30, - end_lineno=15, + end_lineno=80, end_col_offset=33)], [], - lineno=15, + lineno=80, col_offset=9, - end_lineno=15, + end_lineno=80, end_col_offset=34), Name( - 'placeholder_3', + 'f', Store(), - lineno=15, + lineno=80, col_offset=38, - end_lineno=15, + end_lineno=80, end_col_offset=39))], [ Assign( [ Name( - 'placeholder_4', + 'toml_settings', Store(), - lineno=16, + lineno=81, col_offset=8, - end_lineno=16, + end_lineno=81, end_col_offset=21)], Call( Attribute( Name( 'tomlib', Load(), - lineno=16, + lineno=81, col_offset=24, - end_lineno=16, + end_lineno=81, end_col_offset=30), 'load', Load(), - lineno=16, + lineno=81, col_offset=24, - end_lineno=16, + end_lineno=81, end_col_offset=35), [ Name( - 'placeholder_3', + 'f', Load(), - lineno=16, + lineno=81, col_offset=36, - end_lineno=16, + end_lineno=81, end_col_offset=37)], [], - lineno=16, + lineno=81, col_offset=24, - end_lineno=16, + end_lineno=81, end_col_offset=38), - lineno=16, + lineno=81, col_offset=8, - end_lineno=16, + end_lineno=81, end_col_offset=38)], - lineno=15, + lineno=80, col_offset=4, - end_lineno=16, + end_lineno=81, end_col_offset=38), Assign( [ Name( - 'placeholder_5', + 'merged_settings', Store(), - lineno=19, + lineno=84, col_offset=4, - end_lineno=19, + end_lineno=84, end_col_offset=19)], BinOp( - Name( - 'placeholder_1', - Load(), - lineno=19, + Call( + Name( + 'dict', + Load(), + lineno=84, + col_offset=22, + end_lineno=84, + end_col_offset=26), + [ + Name( + 'default_settings', + Load(), + lineno=84, + col_offset=27, + end_lineno=84, + end_col_offset=43)], + [], + lineno=84, col_offset=22, - end_lineno=19, - end_col_offset=38), + end_lineno=84, + end_col_offset=44), BitOr(), - Name( - 'placeholder_4', - Load(), - lineno=19, - col_offset=41, - end_lineno=19, - end_col_offset=54), - lineno=19, + Call( + Name( + 'dict', + Load(), + lineno=84, + col_offset=47, + end_lineno=84, + end_col_offset=51), + [ + Name( + 'toml_settings', + Load(), + lineno=84, + col_offset=52, + end_lineno=84, + end_col_offset=65)], + [], + lineno=84, + col_offset=47, + end_lineno=84, + end_col_offset=66), + lineno=84, col_offset=22, - end_lineno=19, - end_col_offset=54), - lineno=19, + end_lineno=84, + end_col_offset=66), + lineno=84, col_offset=4, - end_lineno=19, - end_col_offset=54), + end_lineno=84, + end_col_offset=66), Return( Name( - 'placeholder_5', + 'merged_settings', Load(), - lineno=21, + lineno=86, col_offset=11, - end_lineno=21, + end_lineno=86, end_col_offset=26), - lineno=21, + lineno=86, col_offset=4, - end_lineno=21, + end_lineno=86, end_col_offset=26)], [], - lineno=13, + lineno=78, col_offset=0, - end_lineno=21, + end_lineno=86, end_col_offset=26), Assign( [ Name( - 'placeholder_1', + 'default_settings', Store(), - lineno=24, + lineno=89, col_offset=0, - end_lineno=24, + end_lineno=89, end_col_offset=16)], Dict( [ Constant( 'timeout', - lineno=25, + lineno=90, col_offset=4, - end_lineno=25, + end_lineno=90, end_col_offset=13), Constant( 'retry_count', - lineno=26, + lineno=91, col_offset=4, - end_lineno=26, + end_lineno=91, end_col_offset=17), Constant( 'log_level', - lineno=27, + lineno=92, col_offset=4, - end_lineno=27, + end_lineno=92, end_col_offset=15)], [ Constant( 30, - lineno=25, + lineno=90, col_offset=15, - end_lineno=25, + end_lineno=90, end_col_offset=17), Constant( 3, - lineno=26, + lineno=91, col_offset=19, - end_lineno=26, + end_lineno=91, end_col_offset=20), Constant( 'INFO', - lineno=27, + lineno=92, col_offset=17, - end_lineno=27, + end_lineno=92, end_col_offset=23)], - lineno=24, + lineno=89, col_offset=19, - end_lineno=28, + end_lineno=93, end_col_offset=1), - lineno=24, + lineno=89, col_offset=0, - end_lineno=28, + end_lineno=93, end_col_offset=1), Assign( [ Name( - 'placeholder_2', + 'toml_file_path', Store(), - lineno=29, + lineno=94, col_offset=0, - end_lineno=29, + end_lineno=94, end_col_offset=14)], Constant( 'settings.toml', - lineno=29, + lineno=94, col_offset=17, - end_lineno=29, + end_lineno=94, end_col_offset=32), - lineno=29, + lineno=94, col_offset=0, - end_lineno=29, + end_lineno=94, end_col_offset=32), Assign( [ Name( - 'placeholder_6', + 'final_settings', Store(), - lineno=31, + lineno=96, col_offset=0, - end_lineno=31, + end_lineno=96, end_col_offset=14)], Call( Name( - 'placeholder_0', + 'merge_settings', Load(), - lineno=31, + lineno=96, col_offset=17, - end_lineno=31, + end_lineno=96, end_col_offset=31), [ Name( - 'placeholder_1', + 'default_settings', Load(), - lineno=31, + lineno=96, col_offset=32, - end_lineno=31, + end_lineno=96, end_col_offset=48), Name( - 'placeholder_2', + 'toml_file_path', Load(), - lineno=31, + lineno=96, col_offset=50, - end_lineno=31, + end_lineno=96, end_col_offset=64)], [], - lineno=31, + lineno=96, col_offset=17, - end_lineno=31, + end_lineno=96, end_col_offset=65), - lineno=31, + lineno=96, col_offset=0, - end_lineno=31, + end_lineno=96, end_col_offset=65), - Expr( - Constant( - ' Examples from PEP584 - Add Union Operators To dict', - lineno=37, - col_offset=0, - end_lineno=37, - end_col_offset=57), - lineno=37, - col_offset=0, - end_lineno=37, - end_col_offset=57), - Assign( - [ - Name( - 'placeholder_7', - Store(), - lineno=38, - col_offset=0, - end_lineno=38, - end_col_offset=1)], - Dict( - [ - Constant( - 'spam', - lineno=38, - col_offset=5, - end_lineno=38, - end_col_offset=11), - Constant( - 'eggs', - lineno=38, - col_offset=16, - end_lineno=38, - end_col_offset=22), - Constant( - 'cheese', - lineno=38, - col_offset=27, - end_lineno=38, - end_col_offset=35)], - [ - Constant( - 1, - lineno=38, - col_offset=13, - end_lineno=38, - end_col_offset=14), - Constant( - 2, - lineno=38, - col_offset=24, - end_lineno=38, - end_col_offset=25), - Constant( - 3, - lineno=38, - col_offset=37, - end_lineno=38, - end_col_offset=38)], - lineno=38, - col_offset=4, - end_lineno=38, - end_col_offset=39), - lineno=38, - col_offset=0, - end_lineno=38, - end_col_offset=39), - Assign( - [ - Name( - 'placeholder_8', - Store(), - lineno=39, - col_offset=0, - end_lineno=39, - end_col_offset=1)], - Dict( - [ - Constant( - 'cheese', - lineno=39, - col_offset=5, - end_lineno=39, - end_col_offset=13), - Constant( - 'aardvark', - lineno=39, - col_offset=26, - end_lineno=39, - end_col_offset=36)], - [ - Constant( - 'cheddar', - lineno=39, - col_offset=15, - end_lineno=39, - end_col_offset=24), - Constant( - 'Ethel', - lineno=39, - col_offset=38, - end_lineno=39, - end_col_offset=45)], - lineno=39, - col_offset=4, - end_lineno=39, - end_col_offset=46), - lineno=39, - col_offset=0, - end_lineno=39, - end_col_offset=46), - Assign( - [ - Name( - 'placeholder_9', - Store(), - lineno=42, - col_offset=0, - end_lineno=42, - end_col_offset=1)], - BinOp( - Name( - 'placeholder_7', - Load(), - lineno=42, - col_offset=4, - end_lineno=42, - end_col_offset=5), - BitOr(), - Name( - 'placeholder_8', - Load(), - lineno=42, - col_offset=8, - end_lineno=42, - end_col_offset=9), - lineno=42, - col_offset=4, - end_lineno=42, - end_col_offset=9), - lineno=42, - col_offset=0, - end_lineno=42, - end_col_offset=9), - Assign( - [ - Name( - 'placeholder_10', - Store(), - lineno=43, - col_offset=0, - end_lineno=43, - end_col_offset=1)], - BinOp( - Name( - 'placeholder_8', - Load(), - lineno=43, - col_offset=4, - end_lineno=43, - end_col_offset=5), - BitOr(), - Name( - 'placeholder_7', - Load(), - lineno=43, - col_offset=8, - end_lineno=43, - end_col_offset=9), - lineno=43, - col_offset=4, - end_lineno=43, - end_col_offset=9), - lineno=43, - col_offset=0, - end_lineno=43, - end_col_offset=9), - AugAssign( - Name( - 'placeholder_7', - Store(), - lineno=44, - col_offset=0, - end_lineno=44, - end_col_offset=1), - BitOr(), - Name( - 'placeholder_8', - Load(), - lineno=44, - col_offset=5, - end_lineno=44, - end_col_offset=6), - lineno=44, - col_offset=0, - end_lineno=44, - end_col_offset=6), - Expr( - Constant( - ' Examples from the Cpython unit tests', - lineno=50, - col_offset=0, - end_lineno=50, - end_col_offset=43), - lineno=50, - col_offset=0, - end_lineno=50, - end_col_offset=43), - Assign( - [ - Name( - 'placeholder_11', - Store(), - lineno=51, - col_offset=0, - end_lineno=51, - end_col_offset=1)], - Dict( - [ - Constant( - 0, - lineno=51, - col_offset=5, - end_lineno=51, - end_col_offset=6), - Constant( - 1, - lineno=51, - col_offset=11, - end_lineno=51, - end_col_offset=12), - Constant( - 2, - lineno=51, - col_offset=17, - end_lineno=51, - end_col_offset=18)], - [ - Constant( - 0, - lineno=51, - col_offset=8, - end_lineno=51, - end_col_offset=9), - Constant( - 1, - lineno=51, - col_offset=14, - end_lineno=51, - end_col_offset=15), - Constant( - 1, - lineno=51, - col_offset=20, - end_lineno=51, - end_col_offset=21)], - lineno=51, - col_offset=4, - end_lineno=51, - end_col_offset=22), - lineno=51, - col_offset=0, - end_lineno=51, - end_col_offset=22), - Assign( - [ - Name( - 'placeholder_12', - Store(), - lineno=52, - col_offset=0, - end_lineno=52, - end_col_offset=1)], - Dict( - [ - Constant( - 1, - lineno=52, - col_offset=5, - end_lineno=52, - end_col_offset=6), - Constant( - 2, - lineno=52, - col_offset=11, - end_lineno=52, - end_col_offset=12), - Constant( - 3, - lineno=52, - col_offset=17, - end_lineno=52, - end_col_offset=18)], - [ - Constant( - 1, - lineno=52, - col_offset=8, - end_lineno=52, - end_col_offset=9), - Constant( - 2, - lineno=52, - col_offset=14, - end_lineno=52, - end_col_offset=15), - Constant( - 3, - lineno=52, - col_offset=20, - end_lineno=52, - end_col_offset=21)], - lineno=52, - col_offset=4, - end_lineno=52, - end_col_offset=22), - lineno=52, - col_offset=0, - end_lineno=52, - end_col_offset=22), - Assign( - [ - Name( - 'placeholder_13', - Store(), - lineno=54, - col_offset=0, - end_lineno=54, - end_col_offset=1)], - Call( - Attribute( - Name( - 'placeholder_11', - Load(), - lineno=54, - col_offset=4, - end_lineno=54, - end_col_offset=5), - 'copy', - Load(), - lineno=54, - col_offset=4, - end_lineno=54, - end_col_offset=10), - [], - [], - lineno=54, - col_offset=4, - end_lineno=54, - end_col_offset=12), - lineno=54, - col_offset=0, - end_lineno=54, - end_col_offset=12), - AugAssign( - Name( - 'placeholder_13', - Store(), - lineno=55, - col_offset=0, - end_lineno=55, - end_col_offset=1), - BitOr(), - Name( - 'placeholder_12', - Load(), - lineno=55, - col_offset=5, - end_lineno=55, - end_col_offset=6), - lineno=55, - col_offset=0, - end_lineno=55, - end_col_offset=6), - Assert( - Compare( - BinOp( - Name( - 'placeholder_11', - Load(), - lineno=57, - col_offset=7, - end_lineno=57, - end_col_offset=8), - BitOr(), - Name( - 'placeholder_12', - Load(), - lineno=57, - col_offset=11, - end_lineno=57, - end_col_offset=12), - lineno=57, - col_offset=7, - end_lineno=57, - end_col_offset=12), - [ - Eq()], - [ - Dict( - [ - Constant( - 0, - lineno=57, - col_offset=17, - end_lineno=57, - end_col_offset=18), - Constant( - 1, - lineno=57, - col_offset=23, - end_lineno=57, - end_col_offset=24), - Constant( - 2, - lineno=57, - col_offset=29, - end_lineno=57, - end_col_offset=30), - Constant( - 3, - lineno=57, - col_offset=35, - end_lineno=57, - end_col_offset=36)], - [ - Constant( - 0, - lineno=57, - col_offset=20, - end_lineno=57, - end_col_offset=21), - Constant( - 1, - lineno=57, - col_offset=26, - end_lineno=57, - end_col_offset=27), - Constant( - 2, - lineno=57, - col_offset=32, - end_lineno=57, - end_col_offset=33), - Constant( - 3, - lineno=57, - col_offset=38, - end_lineno=57, - end_col_offset=39)], - lineno=57, - col_offset=16, - end_lineno=57, - end_col_offset=40)], - lineno=57, - col_offset=7, - end_lineno=57, - end_col_offset=40), - lineno=57, - col_offset=0, - end_lineno=57, - end_col_offset=40), - Assert( - Compare( - Name( - 'placeholder_13', - Load(), - lineno=58, - col_offset=7, - end_lineno=58, - end_col_offset=8), - [ - Eq()], - [ - Dict( - [ - Constant( - 0, - lineno=58, - col_offset=13, - end_lineno=58, - end_col_offset=14), - Constant( - 1, - lineno=58, - col_offset=19, - end_lineno=58, - end_col_offset=20), - Constant( - 2, - lineno=58, - col_offset=25, - end_lineno=58, - end_col_offset=26), - Constant( - 3, - lineno=58, - col_offset=31, - end_lineno=58, - end_col_offset=32)], - [ - Constant( - 0, - lineno=58, - col_offset=16, - end_lineno=58, - end_col_offset=17), - Constant( - 1, - lineno=58, - col_offset=22, - end_lineno=58, - end_col_offset=23), - Constant( - 2, - lineno=58, - col_offset=28, - end_lineno=58, - end_col_offset=29), - Constant( - 3, - lineno=58, - col_offset=34, - end_lineno=58, - end_col_offset=35)], - lineno=58, - col_offset=12, - end_lineno=58, - end_col_offset=36)], - lineno=58, - col_offset=7, - end_lineno=58, - end_col_offset=36), - lineno=58, - col_offset=0, - end_lineno=58, - end_col_offset=36), - Assign( - [ + Expr( + Call( Name( - 'placeholder_13', - Store(), - lineno=60, + 'print', + Load(), + lineno=97, col_offset=0, - end_lineno=60, - end_col_offset=1)], - Call( - Attribute( + end_lineno=97, + end_col_offset=5), + [ + Constant( + 'Final Settings:', + lineno=97, + col_offset=6, + end_lineno=97, + end_col_offset=23), Name( - 'placeholder_12', + 'final_settings', Load(), - lineno=60, - col_offset=4, - end_lineno=60, - end_col_offset=5), - 'copy', - Load(), - lineno=60, - col_offset=4, - end_lineno=60, - end_col_offset=10), - [], + lineno=97, + col_offset=25, + end_lineno=97, + end_col_offset=39)], [], - lineno=60, - col_offset=4, - end_lineno=60, - end_col_offset=12), - lineno=60, - col_offset=0, - end_lineno=60, - end_col_offset=12), - AugAssign( - Name( - 'placeholder_13', - Store(), - lineno=61, + lineno=97, col_offset=0, - end_lineno=61, - end_col_offset=1), - BitOr(), - Name( - 'placeholder_11', - Load(), - lineno=61, - col_offset=5, - end_lineno=61, - end_col_offset=6), - lineno=61, + end_lineno=97, + end_col_offset=40), + lineno=97, col_offset=0, - end_lineno=61, - end_col_offset=6), - Assert( - Compare( - BinOp( + end_lineno=97, + end_col_offset=40)], + []) +## END TREE BEFORE ## + +## BEGIN NORMALIZED TREE ## +Module( + [ + FunctionDef( + 'placeholder_0', + arguments( + [], + [ + arg( + 'placeholder_1', + lineno=2, + col_offset=25, + end_lineno=2, + end_col_offset=30), + arg( + 'placeholder_2', + lineno=2, + col_offset=32, + end_lineno=2, + end_col_offset=46)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + AugAssign( Name( - 'placeholder_12', - Load(), - lineno=63, - col_offset=7, - end_lineno=63, - end_col_offset=8), + 'placeholder_1', + Store(), + lineno=11, + col_offset=4, + end_lineno=11, + end_col_offset=9), BitOr(), + Call( + Name( + 'dict', + Load(), + lineno=11, + col_offset=13, + end_lineno=11, + end_col_offset=17), + [ + Name( + 'placeholder_2', + Load(), + lineno=11, + col_offset=18, + end_lineno=11, + end_col_offset=32)], + [], + lineno=11, + col_offset=13, + end_lineno=11, + end_col_offset=33), + lineno=11, + col_offset=4, + end_lineno=11, + end_col_offset=33), + Return( Name( - 'placeholder_11', + 'placeholder_1', Load(), - lineno=63, + lineno=12, col_offset=11, - end_lineno=63, - end_col_offset=12), - lineno=63, - col_offset=7, - end_lineno=63, - end_col_offset=12), + end_lineno=12, + end_col_offset=16), + lineno=12, + col_offset=4, + end_lineno=12, + end_col_offset=16)], + [], + lineno=2, + col_offset=0, + end_lineno=12, + end_col_offset=16), + FunctionDef( + 'placeholder_3', + arguments( + [], + [ + arg( + 'placeholder_1', + lineno=15, + col_offset=24, + end_lineno=15, + end_col_offset=29), + arg( + 'placeholder_2', + lineno=15, + col_offset=31, + end_lineno=15, + end_col_offset=45)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Return( + BinOp( + Call( + Name( + 'dict', + Load(), + lineno=23, + col_offset=11, + end_lineno=23, + end_col_offset=15), + [ + Name( + 'placeholder_1', + Load(), + lineno=23, + col_offset=16, + end_lineno=23, + end_col_offset=21)], + [], + lineno=23, + col_offset=11, + end_lineno=23, + end_col_offset=22), + BitOr(), + Call( + Name( + 'dict', + Load(), + lineno=23, + col_offset=25, + end_lineno=23, + end_col_offset=29), + [ + Name( + 'placeholder_2', + Load(), + lineno=23, + col_offset=30, + end_lineno=23, + end_col_offset=44)], + [], + lineno=23, + col_offset=25, + end_lineno=23, + end_col_offset=45), + lineno=23, + col_offset=11, + end_lineno=23, + end_col_offset=45), + lineno=23, + col_offset=4, + end_lineno=23, + end_col_offset=45)], + [], + lineno=15, + col_offset=0, + end_lineno=23, + end_col_offset=45), + Assign( + [ + Name( + 'placeholder_1', + Store(), + lineno=26, + col_offset=0, + end_lineno=26, + end_col_offset=5)], + Dict( [ - Eq()], + Constant( + 'Banana Bread', + lineno=26, + col_offset=10, + end_lineno=26, + end_col_offset=24)], [ Dict( [ Constant( - 1, - lineno=63, - col_offset=17, - end_lineno=63, - end_col_offset=18), - Constant( - 2, - lineno=63, - col_offset=23, - end_lineno=63, - end_col_offset=24), - Constant( - 3, - lineno=63, - col_offset=29, - end_lineno=63, - end_col_offset=30), - Constant( - 0, - lineno=63, - col_offset=35, - end_lineno=63, - end_col_offset=36)], + 'Banana', + lineno=26, + col_offset=28, + end_lineno=26, + end_col_offset=36), + Constant( + 'Apple', + lineno=26, + col_offset=41, + end_lineno=26, + end_col_offset=48), + Constant( + 'Walnuts', + lineno=26, + col_offset=53, + end_lineno=26, + end_col_offset=62), + Constant( + 'Flour', + lineno=26, + col_offset=67, + end_lineno=26, + end_col_offset=74), + Constant( + 'Eggs', + lineno=26, + col_offset=79, + end_lineno=26, + end_col_offset=85), + Constant( + 'Butter', + lineno=26, + col_offset=90, + end_lineno=26, + end_col_offset=98)], [ Constant( 1, - lineno=63, - col_offset=20, - end_lineno=63, - end_col_offset=21), - Constant( - 1, - lineno=63, - col_offset=26, - end_lineno=63, - end_col_offset=27), - Constant( - 3, - lineno=63, - col_offset=32, - end_lineno=63, - end_col_offset=33), - Constant( - 0, - lineno=63, + lineno=26, col_offset=38, - end_lineno=63, - end_col_offset=39)], - lineno=63, - col_offset=16, - end_lineno=63, - end_col_offset=40)], - lineno=63, - col_offset=7, - end_lineno=63, - end_col_offset=40), - lineno=63, - col_offset=0, - end_lineno=63, - end_col_offset=40), - Assert( - Compare( - Name( - 'placeholder_13', - Load(), - lineno=64, - col_offset=7, - end_lineno=64, - end_col_offset=8), - [ - Eq()], - [ - Dict( - [ + end_lineno=26, + end_col_offset=39), Constant( 1, - lineno=64, - col_offset=13, - end_lineno=64, - end_col_offset=14), - Constant( - 2, - lineno=64, - col_offset=19, - end_lineno=64, - end_col_offset=20), - Constant( - 3, - lineno=64, - col_offset=25, - end_lineno=64, - end_col_offset=26), - Constant( - 0, - lineno=64, - col_offset=31, - end_lineno=64, - end_col_offset=32)], - [ + lineno=26, + col_offset=50, + end_lineno=26, + end_col_offset=51), Constant( 1, - lineno=64, - col_offset=16, - end_lineno=64, - end_col_offset=17), + lineno=26, + col_offset=64, + end_lineno=26, + end_col_offset=65), Constant( 1, - lineno=64, - col_offset=22, - end_lineno=64, - end_col_offset=23), + lineno=26, + col_offset=76, + end_lineno=26, + end_col_offset=77), Constant( - 3, - lineno=64, - col_offset=28, - end_lineno=64, - end_col_offset=29), + 2, + lineno=26, + col_offset=87, + end_lineno=26, + end_col_offset=88), Constant( - 0, - lineno=64, - col_offset=34, - end_lineno=64, - end_col_offset=35)], - lineno=64, - col_offset=12, - end_lineno=64, - end_col_offset=36)], - lineno=64, - col_offset=7, - end_lineno=64, - end_col_offset=36), - lineno=64, + 1, + lineno=26, + col_offset=100, + end_lineno=26, + end_col_offset=101)], + lineno=26, + col_offset=27, + end_lineno=26, + end_col_offset=102)], + lineno=26, + col_offset=9, + end_lineno=26, + end_col_offset=103), + lineno=26, col_offset=0, - end_lineno=64, - end_col_offset=36), + end_lineno=26, + end_col_offset=103), Assign( [ Name( - 'placeholder_13', + 'placeholder_4', Store(), - lineno=66, + lineno=28, col_offset=0, - end_lineno=66, - end_col_offset=1)], - Call( - Attribute( - Name( - 'placeholder_11', - Load(), - lineno=66, - col_offset=4, - end_lineno=66, - end_col_offset=5), - 'copy', - Load(), - lineno=66, - col_offset=4, - end_lineno=66, - end_col_offset=10), - [], - [], - lineno=66, - col_offset=4, - end_lineno=66, - end_col_offset=12), - lineno=66, - col_offset=0, - end_lineno=66, - end_col_offset=12), - AugAssign( - Name( - 'placeholder_13', - Store(), - lineno=67, - col_offset=0, - end_lineno=67, - end_col_offset=1), - BitOr(), - List( + end_lineno=28, + end_col_offset=20)], + Tuple( [ Tuple( [ Constant( - 1, - lineno=67, - col_offset=7, - end_lineno=67, - end_col_offset=8), - Constant( - 1, - lineno=67, - col_offset=10, - end_lineno=67, - end_col_offset=11)], - Load(), - lineno=67, - col_offset=6, - end_lineno=67, - end_col_offset=12), - Tuple( - [ - Constant( - 2, - lineno=67, - col_offset=15, - end_lineno=67, - end_col_offset=16), - Constant( - 2, - lineno=67, - col_offset=18, - end_lineno=67, - end_col_offset=19)], - Load(), - lineno=67, - col_offset=14, - end_lineno=67, - end_col_offset=20), - Tuple( - [ - Constant( - 3, - lineno=67, - col_offset=23, - end_lineno=67, - end_col_offset=24), - Constant( - 3, - lineno=67, - col_offset=26, - end_lineno=67, - end_col_offset=27)], + 'Banana Bread', + lineno=28, + col_offset=24, + end_lineno=28, + end_col_offset=38), + Dict( + [ + Constant( + 'Banana', + lineno=28, + col_offset=41, + end_lineno=28, + end_col_offset=49), + Constant( + 'Walnuts', + lineno=28, + col_offset=55, + end_lineno=28, + end_col_offset=64), + Constant( + 'Flour', + lineno=28, + col_offset=69, + end_lineno=28, + end_col_offset=76), + Constant( + 'Eggs', + lineno=28, + col_offset=81, + end_lineno=28, + end_col_offset=87), + Constant( + 'Butter', + lineno=28, + col_offset=92, + end_lineno=28, + end_col_offset=100), + Constant( + 'Milk', + lineno=28, + col_offset=105, + end_lineno=28, + end_col_offset=111), + Constant( + 'Eggs', + lineno=28, + col_offset=116, + end_lineno=28, + end_col_offset=122)], + [ + Constant( + 4, + lineno=28, + col_offset=51, + end_lineno=28, + end_col_offset=52), + Constant( + 2, + lineno=28, + col_offset=66, + end_lineno=28, + end_col_offset=67), + Constant( + 1, + lineno=28, + col_offset=78, + end_lineno=28, + end_col_offset=79), + Constant( + 2, + lineno=28, + col_offset=89, + end_lineno=28, + end_col_offset=90), + Constant( + 1, + lineno=28, + col_offset=102, + end_lineno=28, + end_col_offset=103), + Constant( + 2, + lineno=28, + col_offset=113, + end_lineno=28, + end_col_offset=114), + Constant( + 3, + lineno=28, + col_offset=124, + end_lineno=28, + end_col_offset=125)], + lineno=28, + col_offset=40, + end_lineno=28, + end_col_offset=126)], Load(), - lineno=67, - col_offset=22, - end_lineno=67, - end_col_offset=28)], + lineno=28, + col_offset=23, + end_lineno=28, + end_col_offset=127)], Load(), - lineno=67, - col_offset=5, - end_lineno=67, - end_col_offset=29), - lineno=67, + lineno=28, + col_offset=22, + end_lineno=28, + end_col_offset=129), + lineno=28, col_offset=0, - end_lineno=67, - end_col_offset=29), - Assert( - Compare( + end_lineno=28, + end_col_offset=129), + Assign( + [ Name( - 'placeholder_13', - Load(), - lineno=69, - col_offset=7, - end_lineno=69, - end_col_offset=8), + 'placeholder_5', + Store(), + lineno=30, + col_offset=0, + end_lineno=30, + end_col_offset=18)], + Dict( [ - Eq()], + Constant( + 'Banana Bread', + lineno=30, + col_offset=21, + end_lineno=30, + end_col_offset=35)], [ Dict( [ Constant( - 0, - lineno=69, - col_offset=13, - end_lineno=69, - end_col_offset=14), + 'Banana', + lineno=30, + col_offset=38, + end_lineno=30, + end_col_offset=46), + Constant( + 'Walnuts', + lineno=30, + col_offset=52, + end_lineno=30, + end_col_offset=61), + Constant( + 'Flour', + lineno=30, + col_offset=66, + end_lineno=30, + end_col_offset=73), + Constant( + 'Eggs', + lineno=30, + col_offset=78, + end_lineno=30, + end_col_offset=84), + Constant( + 'Butter', + lineno=30, + col_offset=89, + end_lineno=30, + end_col_offset=97), + Constant( + 'Milk', + lineno=30, + col_offset=102, + end_lineno=30, + end_col_offset=108), + Constant( + 'Eggs', + lineno=30, + col_offset=113, + end_lineno=30, + end_col_offset=119)], + [ Constant( - 1, - lineno=69, - col_offset=19, - end_lineno=69, - end_col_offset=20), + 4, + lineno=30, + col_offset=48, + end_lineno=30, + end_col_offset=49), Constant( 2, - lineno=69, - col_offset=25, - end_lineno=69, - end_col_offset=26), + lineno=30, + col_offset=63, + end_lineno=30, + end_col_offset=64), Constant( - 3, - lineno=69, - col_offset=31, - end_lineno=69, - end_col_offset=32)], - [ + 1, + lineno=30, + col_offset=75, + end_lineno=30, + end_col_offset=76), Constant( - 0, - lineno=69, - col_offset=16, - end_lineno=69, - end_col_offset=17), + 2, + lineno=30, + col_offset=86, + end_lineno=30, + end_col_offset=87), Constant( 1, - lineno=69, - col_offset=22, - end_lineno=69, - end_col_offset=23), + lineno=30, + col_offset=99, + end_lineno=30, + end_col_offset=100), Constant( 2, - lineno=69, - col_offset=28, - end_lineno=69, - end_col_offset=29), + lineno=30, + col_offset=110, + end_lineno=30, + end_col_offset=111), Constant( 3, - lineno=69, - col_offset=34, - end_lineno=69, - end_col_offset=35)], - lineno=69, - col_offset=12, - end_lineno=69, - end_col_offset=36)], - lineno=69, - col_offset=7, - end_lineno=69, - end_col_offset=36), - lineno=69, + lineno=30, + col_offset=121, + end_lineno=30, + end_col_offset=122)], + lineno=30, + col_offset=37, + end_lineno=30, + end_col_offset=123)], + lineno=30, + col_offset=20, + end_lineno=30, + end_col_offset=124), + lineno=30, + col_offset=0, + end_lineno=30, + end_col_offset=124), + Expr( + Call( + Name( + 'placeholder_0', + Load(), + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=20), + [ + Name( + 'placeholder_1', + Load(), + lineno=32, + col_offset=21, + end_lineno=32, + end_col_offset=26), + Name( + 'placeholder_4', + Load(), + lineno=32, + col_offset=28, + end_lineno=32, + end_col_offset=48)], + [], + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=49), + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=49), + Expr( + Call( + Name( + 'placeholder_3', + Load(), + lineno=35, + col_offset=0, + end_lineno=35, + end_col_offset=19), + [ + Name( + 'placeholder_1', + Load(), + lineno=35, + col_offset=20, + end_lineno=35, + end_col_offset=25), + Name( + 'placeholder_5', + Load(), + lineno=35, + col_offset=27, + end_lineno=35, + end_col_offset=45)], + [], + lineno=35, + col_offset=0, + end_lineno=35, + end_col_offset=46), + lineno=35, col_offset=0, - end_lineno=69, - end_col_offset=36), + end_lineno=35, + end_col_offset=46), Expr( Constant( ' Example from `alphametrics` exercise ', - lineno=74, + lineno=40, col_offset=0, - end_lineno=74, + end_lineno=40, end_col_offset=44), - lineno=74, + lineno=40, col_offset=0, - end_lineno=74, + end_lineno=40, end_col_offset=44), FunctionDef( - 'placeholder_14', + 'placeholder_6', arguments( [], [ arg( - 'placeholder_15', - lineno=75, + 'placeholder_7', + lineno=41, col_offset=11, - end_lineno=75, + end_lineno=41, end_col_offset=18), arg( - 'placeholder_16', - lineno=75, + 'placeholder_8', + lineno=41, col_offset=20, - end_lineno=75, + end_lineno=41, end_col_offset=30), arg( - 'placeholder_17', - lineno=75, + 'placeholder_9', + lineno=41, col_offset=32, - end_lineno=75, + end_lineno=41, end_col_offset=37), arg( - 'placeholder_18', - lineno=75, + 'placeholder_10', + lineno=41, col_offset=39, - end_lineno=75, + end_lineno=41, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], @@ -3130,47 +2184,47 @@ Module( [ While( Name( - 'placeholder_15', + 'placeholder_7', Load(), - lineno=76, + lineno=42, col_offset=10, - end_lineno=76, + end_lineno=42, end_col_offset=17), [ Assign( [ Name( - 'placeholder_19', + 'placeholder_11', Store(), - lineno=77, + lineno=43, col_offset=8, - end_lineno=77, + end_lineno=43, end_col_offset=22)], List( [], Load(), - lineno=77, + lineno=43, col_offset=25, - end_lineno=77, + end_lineno=43, end_col_offset=27), - lineno=77, + lineno=43, col_offset=8, - end_lineno=77, + end_lineno=43, end_col_offset=27), For( Name( - 'placeholder_20', + 'placeholder_12', Store(), - lineno=79, + lineno=45, col_offset=12, - end_lineno=79, + end_lineno=45, end_col_offset=21), Name( - 'placeholder_16', + 'placeholder_8', Load(), - lineno=79, + lineno=45, col_offset=25, - end_lineno=79, + end_lineno=45, end_col_offset=35), [ Assign( @@ -3178,55 +2232,55 @@ Module( Tuple( [ Name( - 'placeholder_21', + 'placeholder_13', Store(), - lineno=80, + lineno=46, col_offset=12, - end_lineno=80, + end_lineno=46, end_col_offset=15), Name( - 'placeholder_22', + 'placeholder_14', Store(), - lineno=80, + lineno=46, col_offset=17, - end_lineno=80, + end_lineno=46, end_col_offset=24)], Store(), - lineno=80, + lineno=46, col_offset=12, - end_lineno=80, + end_lineno=46, end_col_offset=24)], Name( - 'placeholder_20', + 'placeholder_12', Load(), - lineno=80, + lineno=46, col_offset=27, - end_lineno=80, + end_lineno=46, end_col_offset=36), - lineno=80, + lineno=46, col_offset=12, - end_lineno=80, + end_lineno=46, end_col_offset=36), If( Compare( Subscript( Name( - 'placeholder_15', + 'placeholder_7', Load(), - lineno=82, + lineno=48, col_offset=15, - end_lineno=82, + end_lineno=48, end_col_offset=22), Constant( 0, - lineno=82, + lineno=48, col_offset=23, - end_lineno=82, + end_lineno=48, end_col_offset=24), Load(), - lineno=82, + lineno=48, col_offset=15, - end_lineno=82, + end_lineno=48, end_col_offset=25), [ In()], @@ -3234,388 +2288,709 @@ Module( List( [ Name( - 'placeholder_17', + 'placeholder_9', Load(), - lineno=82, + lineno=48, col_offset=30, - end_lineno=82, + end_lineno=48, end_col_offset=35), Name( - 'placeholder_18', + 'placeholder_10', Load(), - lineno=82, + lineno=48, col_offset=37, - end_lineno=82, + end_lineno=48, end_col_offset=43)], Load(), - lineno=82, + lineno=48, col_offset=29, - end_lineno=82, + end_lineno=48, end_col_offset=44)], - lineno=82, + lineno=48, col_offset=15, - end_lineno=82, + end_lineno=48, end_col_offset=44), [ Assign( [ Name( - 'placeholder_23', + 'placeholder_15', Store(), - lineno=83, + lineno=49, col_offset=16, - end_lineno=83, + end_lineno=49, end_col_offset=28)], BinOp( Name( - 'placeholder_22', + 'placeholder_14', Load(), - lineno=83, + lineno=49, col_offset=31, - end_lineno=83, + end_lineno=49, end_col_offset=38), Sub(), Call( Name( 'set', Load(), - lineno=83, + lineno=49, col_offset=41, - end_lineno=83, + end_lineno=49, end_col_offset=44), [ List( [ Constant( 0, - lineno=83, + lineno=49, col_offset=46, - end_lineno=83, + end_lineno=49, end_col_offset=47)], Load(), - lineno=83, + lineno=49, col_offset=45, - end_lineno=83, + end_lineno=49, end_col_offset=48)], [], - lineno=83, + lineno=49, col_offset=41, - end_lineno=83, + end_lineno=49, end_col_offset=49), - lineno=83, + lineno=49, col_offset=31, - end_lineno=83, + end_lineno=49, end_col_offset=49), - lineno=83, + lineno=49, col_offset=16, - end_lineno=83, + end_lineno=49, end_col_offset=49)], [ Assign( [ Name( - 'placeholder_23', + 'placeholder_15', Store(), - lineno=86, + lineno=52, col_offset=16, - end_lineno=86, + end_lineno=52, end_col_offset=28)], Name( - 'placeholder_22', + 'placeholder_14', Load(), - lineno=86, + lineno=52, col_offset=31, - end_lineno=86, + end_lineno=52, end_col_offset=38), - lineno=86, + lineno=52, col_offset=16, - end_lineno=86, + end_lineno=52, end_col_offset=38)], - lineno=82, + lineno=48, col_offset=12, - end_lineno=86, + end_lineno=52, end_col_offset=38), For( Name( - 'placeholder_24', + 'placeholder_16', Store(), - lineno=88, + lineno=54, col_offset=16, - end_lineno=88, - end_col_offset=17), + end_lineno=54, + end_col_offset=20), Name( - 'placeholder_23', + 'placeholder_15', Load(), - lineno=88, - col_offset=21, - end_lineno=88, - end_col_offset=33), + lineno=54, + col_offset=24, + end_lineno=54, + end_col_offset=36), [ Assign( [ Name( - 'placeholder_25', + 'placeholder_17', Store(), - lineno=89, + lineno=55, col_offset=16, - end_lineno=89, + end_lineno=55, end_col_offset=22)], BinOp( Name( - 'placeholder_21', + 'placeholder_13', Load(), - lineno=89, + lineno=55, col_offset=25, - end_lineno=89, + end_lineno=55, end_col_offset=28), BitOr(), Dict( [ Subscript( Name( - 'placeholder_15', + 'placeholder_7', Load(), - lineno=89, + lineno=55, col_offset=32, - end_lineno=89, + end_lineno=55, end_col_offset=39), Constant( 0, - lineno=89, + lineno=55, col_offset=40, - end_lineno=89, + end_lineno=55, end_col_offset=41), Load(), - lineno=89, + lineno=55, col_offset=32, - end_lineno=89, + end_lineno=55, end_col_offset=42)], [ Name( - 'placeholder_24', + 'placeholder_16', Load(), - lineno=89, + lineno=55, col_offset=44, - end_lineno=89, - end_col_offset=45)], - lineno=89, + end_lineno=55, + end_col_offset=48)], + lineno=55, col_offset=31, - end_lineno=89, - end_col_offset=46), - lineno=89, + end_lineno=55, + end_col_offset=49), + lineno=55, col_offset=25, - end_lineno=89, - end_col_offset=46), - lineno=89, + end_lineno=55, + end_col_offset=49), + lineno=55, col_offset=16, - end_lineno=89, - end_col_offset=46), + end_lineno=55, + end_col_offset=49), Expr( Call( Attribute( Name( - 'placeholder_19', + 'placeholder_11', Load(), - lineno=90, + lineno=56, col_offset=16, - end_lineno=90, + end_lineno=56, end_col_offset=30), 'append', Load(), - lineno=90, + lineno=56, col_offset=16, - end_lineno=90, + end_lineno=56, end_col_offset=37), [ Tuple( [ Name( - 'placeholder_25', + 'placeholder_17', Load(), - lineno=90, + lineno=56, col_offset=39, - end_lineno=90, + end_lineno=56, end_col_offset=45), BinOp( Name( - 'placeholder_22', + 'placeholder_14', Load(), - lineno=90, + lineno=56, col_offset=47, - end_lineno=90, + end_lineno=56, end_col_offset=54), Sub(), Call( Name( 'set', Load(), - lineno=90, + lineno=56, col_offset=57, - end_lineno=90, + end_lineno=56, end_col_offset=60), [ List( [ Name( - 'placeholder_24', + 'placeholder_16', Load(), - lineno=90, + lineno=56, col_offset=62, - end_lineno=90, - end_col_offset=63)], + end_lineno=56, + end_col_offset=66)], Load(), - lineno=90, + lineno=56, col_offset=61, - end_lineno=90, - end_col_offset=64)], + end_lineno=56, + end_col_offset=67)], [], - lineno=90, + lineno=56, col_offset=57, - end_lineno=90, - end_col_offset=65), - lineno=90, + end_lineno=56, + end_col_offset=68), + lineno=56, col_offset=47, - end_lineno=90, - end_col_offset=65)], + end_lineno=56, + end_col_offset=68)], Load(), - lineno=90, + lineno=56, col_offset=38, - end_lineno=90, - end_col_offset=66)], + end_lineno=56, + end_col_offset=69)], [], - lineno=90, + lineno=56, col_offset=16, - end_lineno=90, - end_col_offset=67), - lineno=90, + end_lineno=56, + end_col_offset=70), + lineno=56, col_offset=16, - end_lineno=90, - end_col_offset=67)], + end_lineno=56, + end_col_offset=70)], [], - lineno=88, + lineno=54, col_offset=12, - end_lineno=90, - end_col_offset=67)], + end_lineno=56, + end_col_offset=70)], [], - lineno=79, + lineno=45, col_offset=8, - end_lineno=90, - end_col_offset=67), + end_lineno=56, + end_col_offset=70), Assign( [ Name( - 'placeholder_16', + 'placeholder_8', Store(), - lineno=92, + lineno=58, col_offset=8, - end_lineno=92, + end_lineno=58, end_col_offset=18)], Name( - 'placeholder_19', + 'placeholder_11', Load(), - lineno=92, + lineno=58, col_offset=21, - end_lineno=92, + end_lineno=58, end_col_offset=35), - lineno=92, + lineno=58, col_offset=8, - end_lineno=92, + end_lineno=58, end_col_offset=35), Assign( [ Name( - 'placeholder_15', + 'placeholder_7', Store(), - lineno=93, + lineno=59, col_offset=8, - end_lineno=93, + end_lineno=59, end_col_offset=15)], Subscript( Name( - 'placeholder_15', + 'placeholder_7', Load(), - lineno=93, + lineno=59, col_offset=18, - end_lineno=93, + end_lineno=59, end_col_offset=25), Slice( Constant( 1, - lineno=93, + lineno=59, col_offset=26, - end_lineno=93, + end_lineno=59, end_col_offset=27), - lineno=93, + lineno=59, col_offset=26, - end_lineno=93, + end_lineno=59, end_col_offset=28), Load(), - lineno=93, + lineno=59, col_offset=18, - end_lineno=93, + end_lineno=59, end_col_offset=29), - lineno=93, + lineno=59, col_offset=8, - end_lineno=93, + end_lineno=59, end_col_offset=29)], [], - lineno=76, + lineno=42, col_offset=4, - end_lineno=93, + end_lineno=59, end_col_offset=29), Return( ListComp( Name( - 'placeholder_21', + 'placeholder_13', Load(), - lineno=94, + lineno=60, col_offset=12, - end_lineno=94, + end_lineno=60, end_col_offset=15), [ comprehension( Tuple( [ Name( - 'placeholder_21', + 'placeholder_13', Store(), - lineno=94, + lineno=60, col_offset=20, - end_lineno=94, + end_lineno=60, end_col_offset=23), Name( - 'placeholder_26', + 'placeholder_18', Store(), - lineno=94, + lineno=60, col_offset=25, - end_lineno=94, + end_lineno=60, end_col_offset=26)], Store(), - lineno=94, + lineno=60, col_offset=20, - end_lineno=94, + end_lineno=60, end_col_offset=26), Name( - 'placeholder_16', + 'placeholder_8', Load(), - lineno=94, + lineno=60, col_offset=30, - end_lineno=94, + end_lineno=60, end_col_offset=40), [], 0)], - lineno=94, + lineno=60, col_offset=11, - end_lineno=94, + end_lineno=60, end_col_offset=41), - lineno=94, + lineno=60, col_offset=4, - end_lineno=94, + end_lineno=60, end_col_offset=41)], [], - lineno=75, + lineno=41, + col_offset=0, + end_lineno=60, + end_col_offset=41), + Expr( + Constant( + '\n This exmple comes from ChatGPT\n Prompt: Write a python function that \n reads user settings from a toml file and \n merges them with a dictionary of default \n settings to create a single dictionary. \n If there are any conflicts between the \n two sources of settings, the data from \n the toml file should be used.\n', + lineno=66, + col_offset=0, + end_lineno=75, + end_col_offset=3), + lineno=66, + col_offset=0, + end_lineno=75, + end_col_offset=3), + Import( + [ + alias( + 'tomlib', + lineno=76, + col_offset=7, + end_lineno=76, + end_col_offset=13)], + lineno=76, + col_offset=0, + end_lineno=76, + end_col_offset=13), + FunctionDef( + 'placeholder_19', + arguments( + [], + [ + arg( + 'placeholder_20', + lineno=78, + col_offset=19, + end_lineno=78, + end_col_offset=35), + arg( + 'placeholder_21', + lineno=78, + col_offset=37, + end_lineno=78, + end_col_offset=51)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + With( + [ + withitem( + Call( + Name( + 'open', + Load(), + lineno=80, + col_offset=9, + end_lineno=80, + end_col_offset=13), + [ + Name( + 'placeholder_21', + Load(), + lineno=80, + col_offset=14, + end_lineno=80, + end_col_offset=28), + Constant( + 'r', + lineno=80, + col_offset=30, + end_lineno=80, + end_col_offset=33)], + [], + lineno=80, + col_offset=9, + end_lineno=80, + end_col_offset=34), + Name( + 'placeholder_22', + Store(), + lineno=80, + col_offset=38, + end_lineno=80, + end_col_offset=39))], + [ + Assign( + [ + Name( + 'placeholder_23', + Store(), + lineno=81, + col_offset=8, + end_lineno=81, + end_col_offset=21)], + Call( + Attribute( + Name( + 'tomlib', + Load(), + lineno=81, + col_offset=24, + end_lineno=81, + end_col_offset=30), + 'load', + Load(), + lineno=81, + col_offset=24, + end_lineno=81, + end_col_offset=35), + [ + Name( + 'placeholder_22', + Load(), + lineno=81, + col_offset=36, + end_lineno=81, + end_col_offset=37)], + [], + lineno=81, + col_offset=24, + end_lineno=81, + end_col_offset=38), + lineno=81, + col_offset=8, + end_lineno=81, + end_col_offset=38)], + lineno=80, + col_offset=4, + end_lineno=81, + end_col_offset=38), + Assign( + [ + Name( + 'placeholder_24', + Store(), + lineno=84, + col_offset=4, + end_lineno=84, + end_col_offset=19)], + BinOp( + Call( + Name( + 'dict', + Load(), + lineno=84, + col_offset=22, + end_lineno=84, + end_col_offset=26), + [ + Name( + 'placeholder_20', + Load(), + lineno=84, + col_offset=27, + end_lineno=84, + end_col_offset=43)], + [], + lineno=84, + col_offset=22, + end_lineno=84, + end_col_offset=44), + BitOr(), + Call( + Name( + 'dict', + Load(), + lineno=84, + col_offset=47, + end_lineno=84, + end_col_offset=51), + [ + Name( + 'placeholder_23', + Load(), + lineno=84, + col_offset=52, + end_lineno=84, + end_col_offset=65)], + [], + lineno=84, + col_offset=47, + end_lineno=84, + end_col_offset=66), + lineno=84, + col_offset=22, + end_lineno=84, + end_col_offset=66), + lineno=84, + col_offset=4, + end_lineno=84, + end_col_offset=66), + Return( + Name( + 'placeholder_24', + Load(), + lineno=86, + col_offset=11, + end_lineno=86, + end_col_offset=26), + lineno=86, + col_offset=4, + end_lineno=86, + end_col_offset=26)], + [], + lineno=78, + col_offset=0, + end_lineno=86, + end_col_offset=26), + Assign( + [ + Name( + 'placeholder_20', + Store(), + lineno=89, + col_offset=0, + end_lineno=89, + end_col_offset=16)], + Dict( + [ + Constant( + 'timeout', + lineno=90, + col_offset=4, + end_lineno=90, + end_col_offset=13), + Constant( + 'retry_count', + lineno=91, + col_offset=4, + end_lineno=91, + end_col_offset=17), + Constant( + 'log_level', + lineno=92, + col_offset=4, + end_lineno=92, + end_col_offset=15)], + [ + Constant( + 30, + lineno=90, + col_offset=15, + end_lineno=90, + end_col_offset=17), + Constant( + 3, + lineno=91, + col_offset=19, + end_lineno=91, + end_col_offset=20), + Constant( + 'INFO', + lineno=92, + col_offset=17, + end_lineno=92, + end_col_offset=23)], + lineno=89, + col_offset=19, + end_lineno=93, + end_col_offset=1), + lineno=89, + col_offset=0, + end_lineno=93, + end_col_offset=1), + Assign( + [ + Name( + 'placeholder_21', + Store(), + lineno=94, + col_offset=0, + end_lineno=94, + end_col_offset=14)], + Constant( + 'settings.toml', + lineno=94, + col_offset=17, + end_lineno=94, + end_col_offset=32), + lineno=94, col_offset=0, end_lineno=94, - end_col_offset=41)], + end_col_offset=32), + Assign( + [ + Name( + 'placeholder_25', + Store(), + lineno=96, + col_offset=0, + end_lineno=96, + end_col_offset=14)], + Call( + Name( + 'placeholder_19', + Load(), + lineno=96, + col_offset=17, + end_lineno=96, + end_col_offset=31), + [ + Name( + 'placeholder_20', + Load(), + lineno=96, + col_offset=32, + end_lineno=96, + end_col_offset=48), + Name( + 'placeholder_21', + Load(), + lineno=96, + col_offset=50, + end_lineno=96, + end_col_offset=64)], + [], + lineno=96, + col_offset=17, + end_lineno=96, + end_col_offset=65), + lineno=96, + col_offset=0, + end_lineno=96, + end_col_offset=65)], []) ## END NORMALIZED TREE ## \ No newline at end of file diff --git a/test/example-uniondict-normalization/representation.txt b/test/example-uniondict-normalization/representation.txt index df9d5bf..eb8e34b 100644 --- a/test/example-uniondict-normalization/representation.txt +++ b/test/example-uniondict-normalization/representation.txt @@ -1 +1 @@ -Module([Import([alias('tomlib', lineno=11, col_offset=7, end_lineno=11, end_col_offset=13)], lineno=11, col_offset=0, end_lineno=11, end_col_offset=13), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=13, col_offset=19, end_lineno=13, end_col_offset=35), arg('placeholder_2', lineno=13, col_offset=37, end_lineno=13, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], defaults=[]), [With([withitem(Call(Name('open', Load(), lineno=15, col_offset=9, end_lineno=15, end_col_offset=13), [Name('placeholder_2', Load(), lineno=15, col_offset=14, end_lineno=15, end_col_offset=28), Constant('r', lineno=15, col_offset=30, end_lineno=15, end_col_offset=33)], [], lineno=15, col_offset=9, end_lineno=15, end_col_offset=34), Name('placeholder_3', Store(), lineno=15, col_offset=38, end_lineno=15, end_col_offset=39))], [Assign([Name('placeholder_4', Store(), lineno=16, col_offset=8, end_lineno=16, end_col_offset=21)], Call(Attribute(Name('tomlib', Load(), lineno=16, col_offset=24, end_lineno=16, end_col_offset=30), 'load', Load(), lineno=16, col_offset=24, end_lineno=16, end_col_offset=35), [Name('placeholder_3', Load(), lineno=16, col_offset=36, end_lineno=16, end_col_offset=37)], [], lineno=16, col_offset=24, end_lineno=16, end_col_offset=38), lineno=16, col_offset=8, end_lineno=16, end_col_offset=38)], lineno=15, col_offset=4, end_lineno=16, end_col_offset=38), Assign([Name('placeholder_5', Store(), lineno=19, col_offset=4, end_lineno=19, end_col_offset=19)], BinOp(Name('placeholder_1', Load(), lineno=19, col_offset=22, end_lineno=19, end_col_offset=38), BitOr(), Name('placeholder_4', Load(), lineno=19, col_offset=41, end_lineno=19, end_col_offset=54), lineno=19, col_offset=22, end_lineno=19, end_col_offset=54), lineno=19, col_offset=4, end_lineno=19, end_col_offset=54), Return(Name('placeholder_5', Load(), lineno=21, col_offset=11, end_lineno=21, end_col_offset=26), lineno=21, col_offset=4, end_lineno=21, end_col_offset=26)], [], lineno=13, col_offset=0, end_lineno=21, end_col_offset=26), Assign([Name('placeholder_1', Store(), lineno=24, col_offset=0, end_lineno=24, end_col_offset=16)], Dict([Constant('timeout', lineno=25, col_offset=4, end_lineno=25, end_col_offset=13), Constant('retry_count', lineno=26, col_offset=4, end_lineno=26, end_col_offset=17), Constant('log_level', lineno=27, col_offset=4, end_lineno=27, end_col_offset=15)], [Constant(30, lineno=25, col_offset=15, end_lineno=25, end_col_offset=17), Constant(3, lineno=26, col_offset=19, end_lineno=26, end_col_offset=20), Constant('INFO', lineno=27, col_offset=17, end_lineno=27, end_col_offset=23)], lineno=24, col_offset=19, end_lineno=28, end_col_offset=1), lineno=24, col_offset=0, end_lineno=28, end_col_offset=1), Assign([Name('placeholder_2', Store(), lineno=29, col_offset=0, end_lineno=29, end_col_offset=14)], Constant('settings.toml', lineno=29, col_offset=17, end_lineno=29, end_col_offset=32), lineno=29, col_offset=0, end_lineno=29, end_col_offset=32), Assign([Name('placeholder_6', Store(), lineno=31, col_offset=0, end_lineno=31, end_col_offset=14)], Call(Name('placeholder_0', Load(), lineno=31, col_offset=17, end_lineno=31, end_col_offset=31), [Name('placeholder_1', Load(), lineno=31, col_offset=32, end_lineno=31, end_col_offset=48), Name('placeholder_2', Load(), lineno=31, col_offset=50, end_lineno=31, end_col_offset=64)], [], lineno=31, col_offset=17, end_lineno=31, end_col_offset=65), lineno=31, col_offset=0, end_lineno=31, end_col_offset=65), Expr(Constant(' Examples from PEP584 - Add Union Operators To dict', lineno=37, col_offset=0, end_lineno=37, end_col_offset=57), lineno=37, col_offset=0, end_lineno=37, end_col_offset=57), Assign([Name('placeholder_7', Store(), lineno=38, col_offset=0, end_lineno=38, end_col_offset=1)], Dict([Constant('spam', lineno=38, col_offset=5, end_lineno=38, end_col_offset=11), Constant('eggs', lineno=38, col_offset=16, end_lineno=38, end_col_offset=22), Constant('cheese', lineno=38, col_offset=27, end_lineno=38, end_col_offset=35)], [Constant(1, lineno=38, col_offset=13, end_lineno=38, end_col_offset=14), Constant(2, lineno=38, col_offset=24, end_lineno=38, end_col_offset=25), Constant(3, lineno=38, col_offset=37, end_lineno=38, end_col_offset=38)], lineno=38, col_offset=4, end_lineno=38, end_col_offset=39), lineno=38, col_offset=0, end_lineno=38, end_col_offset=39), Assign([Name('placeholder_8', Store(), lineno=39, col_offset=0, end_lineno=39, end_col_offset=1)], Dict([Constant('cheese', lineno=39, col_offset=5, end_lineno=39, end_col_offset=13), Constant('aardvark', lineno=39, col_offset=26, end_lineno=39, end_col_offset=36)], [Constant('cheddar', lineno=39, col_offset=15, end_lineno=39, end_col_offset=24), Constant('Ethel', lineno=39, col_offset=38, end_lineno=39, end_col_offset=45)], lineno=39, col_offset=4, end_lineno=39, end_col_offset=46), lineno=39, col_offset=0, end_lineno=39, end_col_offset=46), Assign([Name('placeholder_9', Store(), lineno=42, col_offset=0, end_lineno=42, end_col_offset=1)], BinOp(Name('placeholder_7', Load(), lineno=42, col_offset=4, end_lineno=42, end_col_offset=5), BitOr(), Name('placeholder_8', Load(), lineno=42, col_offset=8, end_lineno=42, end_col_offset=9), lineno=42, col_offset=4, end_lineno=42, end_col_offset=9), lineno=42, col_offset=0, end_lineno=42, end_col_offset=9), Assign([Name('placeholder_10', Store(), lineno=43, col_offset=0, end_lineno=43, end_col_offset=1)], BinOp(Name('placeholder_8', Load(), lineno=43, col_offset=4, end_lineno=43, end_col_offset=5), BitOr(), Name('placeholder_7', Load(), lineno=43, col_offset=8, end_lineno=43, end_col_offset=9), lineno=43, col_offset=4, end_lineno=43, end_col_offset=9), lineno=43, col_offset=0, end_lineno=43, end_col_offset=9), AugAssign(Name('placeholder_7', Store(), lineno=44, col_offset=0, end_lineno=44, end_col_offset=1), BitOr(), Name('placeholder_8', Load(), lineno=44, col_offset=5, end_lineno=44, end_col_offset=6), lineno=44, col_offset=0, end_lineno=44, end_col_offset=6), Expr(Constant(' Examples from the Cpython unit tests', lineno=50, col_offset=0, end_lineno=50, end_col_offset=43), lineno=50, col_offset=0, end_lineno=50, end_col_offset=43), Assign([Name('placeholder_11', Store(), lineno=51, col_offset=0, end_lineno=51, end_col_offset=1)], Dict([Constant(0, lineno=51, col_offset=5, end_lineno=51, end_col_offset=6), Constant(1, lineno=51, col_offset=11, end_lineno=51, end_col_offset=12), Constant(2, lineno=51, col_offset=17, end_lineno=51, end_col_offset=18)], [Constant(0, lineno=51, col_offset=8, end_lineno=51, end_col_offset=9), Constant(1, lineno=51, col_offset=14, end_lineno=51, end_col_offset=15), Constant(1, lineno=51, col_offset=20, end_lineno=51, end_col_offset=21)], lineno=51, col_offset=4, end_lineno=51, end_col_offset=22), lineno=51, col_offset=0, end_lineno=51, end_col_offset=22), Assign([Name('placeholder_12', Store(), lineno=52, col_offset=0, end_lineno=52, end_col_offset=1)], Dict([Constant(1, lineno=52, col_offset=5, end_lineno=52, end_col_offset=6), Constant(2, lineno=52, col_offset=11, end_lineno=52, end_col_offset=12), Constant(3, lineno=52, col_offset=17, end_lineno=52, end_col_offset=18)], [Constant(1, lineno=52, col_offset=8, end_lineno=52, end_col_offset=9), Constant(2, lineno=52, col_offset=14, end_lineno=52, end_col_offset=15), Constant(3, lineno=52, col_offset=20, end_lineno=52, end_col_offset=21)], lineno=52, col_offset=4, end_lineno=52, end_col_offset=22), lineno=52, col_offset=0, end_lineno=52, end_col_offset=22), Assign([Name('placeholder_13', Store(), lineno=54, col_offset=0, end_lineno=54, end_col_offset=1)], Call(Attribute(Name('placeholder_11', Load(), lineno=54, col_offset=4, end_lineno=54, end_col_offset=5), 'copy', Load(), lineno=54, col_offset=4, end_lineno=54, end_col_offset=10), [], [], lineno=54, col_offset=4, end_lineno=54, end_col_offset=12), lineno=54, col_offset=0, end_lineno=54, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=55, col_offset=0, end_lineno=55, end_col_offset=1), BitOr(), Name('placeholder_12', Load(), lineno=55, col_offset=5, end_lineno=55, end_col_offset=6), lineno=55, col_offset=0, end_lineno=55, end_col_offset=6), Assert(Compare(BinOp(Name('placeholder_11', Load(), lineno=57, col_offset=7, end_lineno=57, end_col_offset=8), BitOr(), Name('placeholder_12', Load(), lineno=57, col_offset=11, end_lineno=57, end_col_offset=12), lineno=57, col_offset=7, end_lineno=57, end_col_offset=12), [Eq()], [Dict([Constant(0, lineno=57, col_offset=17, end_lineno=57, end_col_offset=18), Constant(1, lineno=57, col_offset=23, end_lineno=57, end_col_offset=24), Constant(2, lineno=57, col_offset=29, end_lineno=57, end_col_offset=30), Constant(3, lineno=57, col_offset=35, end_lineno=57, end_col_offset=36)], [Constant(0, lineno=57, col_offset=20, end_lineno=57, end_col_offset=21), Constant(1, lineno=57, col_offset=26, end_lineno=57, end_col_offset=27), Constant(2, lineno=57, col_offset=32, end_lineno=57, end_col_offset=33), Constant(3, lineno=57, col_offset=38, end_lineno=57, end_col_offset=39)], lineno=57, col_offset=16, end_lineno=57, end_col_offset=40)], lineno=57, col_offset=7, end_lineno=57, end_col_offset=40), lineno=57, col_offset=0, end_lineno=57, end_col_offset=40), Assert(Compare(Name('placeholder_13', Load(), lineno=58, col_offset=7, end_lineno=58, end_col_offset=8), [Eq()], [Dict([Constant(0, lineno=58, col_offset=13, end_lineno=58, end_col_offset=14), Constant(1, lineno=58, col_offset=19, end_lineno=58, end_col_offset=20), Constant(2, lineno=58, col_offset=25, end_lineno=58, end_col_offset=26), Constant(3, lineno=58, col_offset=31, end_lineno=58, end_col_offset=32)], [Constant(0, lineno=58, col_offset=16, end_lineno=58, end_col_offset=17), Constant(1, lineno=58, col_offset=22, end_lineno=58, end_col_offset=23), Constant(2, lineno=58, col_offset=28, end_lineno=58, end_col_offset=29), Constant(3, lineno=58, col_offset=34, end_lineno=58, end_col_offset=35)], lineno=58, col_offset=12, end_lineno=58, end_col_offset=36)], lineno=58, col_offset=7, end_lineno=58, end_col_offset=36), lineno=58, col_offset=0, end_lineno=58, end_col_offset=36), Assign([Name('placeholder_13', Store(), lineno=60, col_offset=0, end_lineno=60, end_col_offset=1)], Call(Attribute(Name('placeholder_12', Load(), lineno=60, col_offset=4, end_lineno=60, end_col_offset=5), 'copy', Load(), lineno=60, col_offset=4, end_lineno=60, end_col_offset=10), [], [], lineno=60, col_offset=4, end_lineno=60, end_col_offset=12), lineno=60, col_offset=0, end_lineno=60, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=61, col_offset=0, end_lineno=61, end_col_offset=1), BitOr(), Name('placeholder_11', Load(), lineno=61, col_offset=5, end_lineno=61, end_col_offset=6), lineno=61, col_offset=0, end_lineno=61, end_col_offset=6), Assert(Compare(BinOp(Name('placeholder_12', Load(), lineno=63, col_offset=7, end_lineno=63, end_col_offset=8), BitOr(), Name('placeholder_11', Load(), lineno=63, col_offset=11, end_lineno=63, end_col_offset=12), lineno=63, col_offset=7, end_lineno=63, end_col_offset=12), [Eq()], [Dict([Constant(1, lineno=63, col_offset=17, end_lineno=63, end_col_offset=18), Constant(2, lineno=63, col_offset=23, end_lineno=63, end_col_offset=24), Constant(3, lineno=63, col_offset=29, end_lineno=63, end_col_offset=30), Constant(0, lineno=63, col_offset=35, end_lineno=63, end_col_offset=36)], [Constant(1, lineno=63, col_offset=20, end_lineno=63, end_col_offset=21), Constant(1, lineno=63, col_offset=26, end_lineno=63, end_col_offset=27), Constant(3, lineno=63, col_offset=32, end_lineno=63, end_col_offset=33), Constant(0, lineno=63, col_offset=38, end_lineno=63, end_col_offset=39)], lineno=63, col_offset=16, end_lineno=63, end_col_offset=40)], lineno=63, col_offset=7, end_lineno=63, end_col_offset=40), lineno=63, col_offset=0, end_lineno=63, end_col_offset=40), Assert(Compare(Name('placeholder_13', Load(), lineno=64, col_offset=7, end_lineno=64, end_col_offset=8), [Eq()], [Dict([Constant(1, lineno=64, col_offset=13, end_lineno=64, end_col_offset=14), Constant(2, lineno=64, col_offset=19, end_lineno=64, end_col_offset=20), Constant(3, lineno=64, col_offset=25, end_lineno=64, end_col_offset=26), Constant(0, lineno=64, col_offset=31, end_lineno=64, end_col_offset=32)], [Constant(1, lineno=64, col_offset=16, end_lineno=64, end_col_offset=17), Constant(1, lineno=64, col_offset=22, end_lineno=64, end_col_offset=23), Constant(3, lineno=64, col_offset=28, end_lineno=64, end_col_offset=29), Constant(0, lineno=64, col_offset=34, end_lineno=64, end_col_offset=35)], lineno=64, col_offset=12, end_lineno=64, end_col_offset=36)], lineno=64, col_offset=7, end_lineno=64, end_col_offset=36), lineno=64, col_offset=0, end_lineno=64, end_col_offset=36), Assign([Name('placeholder_13', Store(), lineno=66, col_offset=0, end_lineno=66, end_col_offset=1)], Call(Attribute(Name('placeholder_11', Load(), lineno=66, col_offset=4, end_lineno=66, end_col_offset=5), 'copy', Load(), lineno=66, col_offset=4, end_lineno=66, end_col_offset=10), [], [], lineno=66, col_offset=4, end_lineno=66, end_col_offset=12), lineno=66, col_offset=0, end_lineno=66, end_col_offset=12), AugAssign(Name('placeholder_13', Store(), lineno=67, col_offset=0, end_lineno=67, end_col_offset=1), BitOr(), List([Tuple([Constant(1, lineno=67, col_offset=7, end_lineno=67, end_col_offset=8), Constant(1, lineno=67, col_offset=10, end_lineno=67, end_col_offset=11)], Load(), lineno=67, col_offset=6, end_lineno=67, end_col_offset=12), Tuple([Constant(2, lineno=67, col_offset=15, end_lineno=67, end_col_offset=16), Constant(2, lineno=67, col_offset=18, end_lineno=67, end_col_offset=19)], Load(), lineno=67, col_offset=14, end_lineno=67, end_col_offset=20), Tuple([Constant(3, lineno=67, col_offset=23, end_lineno=67, end_col_offset=24), Constant(3, lineno=67, col_offset=26, end_lineno=67, end_col_offset=27)], Load(), lineno=67, col_offset=22, end_lineno=67, end_col_offset=28)], Load(), lineno=67, col_offset=5, end_lineno=67, end_col_offset=29), lineno=67, col_offset=0, end_lineno=67, end_col_offset=29), Assert(Compare(Name('placeholder_13', Load(), lineno=69, col_offset=7, end_lineno=69, end_col_offset=8), [Eq()], [Dict([Constant(0, lineno=69, col_offset=13, end_lineno=69, end_col_offset=14), Constant(1, lineno=69, col_offset=19, end_lineno=69, end_col_offset=20), Constant(2, lineno=69, col_offset=25, end_lineno=69, end_col_offset=26), Constant(3, lineno=69, col_offset=31, end_lineno=69, end_col_offset=32)], [Constant(0, lineno=69, col_offset=16, end_lineno=69, end_col_offset=17), Constant(1, lineno=69, col_offset=22, end_lineno=69, end_col_offset=23), Constant(2, lineno=69, col_offset=28, end_lineno=69, end_col_offset=29), Constant(3, lineno=69, col_offset=34, end_lineno=69, end_col_offset=35)], lineno=69, col_offset=12, end_lineno=69, end_col_offset=36)], lineno=69, col_offset=7, end_lineno=69, end_col_offset=36), lineno=69, col_offset=0, end_lineno=69, end_col_offset=36), Expr(Constant(' Example from `alphametrics` exercise ', lineno=74, col_offset=0, end_lineno=74, end_col_offset=44), lineno=74, col_offset=0, end_lineno=74, end_col_offset=44), FunctionDef('placeholder_14', arguments([], [arg('placeholder_15', lineno=75, col_offset=11, end_lineno=75, end_col_offset=18), arg('placeholder_16', lineno=75, col_offset=20, end_lineno=75, end_col_offset=30), arg('placeholder_17', lineno=75, col_offset=32, end_lineno=75, end_col_offset=37), arg('placeholder_18', lineno=75, col_offset=39, end_lineno=75, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [While(Name('placeholder_15', Load(), lineno=76, col_offset=10, end_lineno=76, end_col_offset=17), [Assign([Name('placeholder_19', Store(), lineno=77, col_offset=8, end_lineno=77, end_col_offset=22)], List([], Load(), lineno=77, col_offset=25, end_lineno=77, end_col_offset=27), lineno=77, col_offset=8, end_lineno=77, end_col_offset=27), For(Name('placeholder_20', Store(), lineno=79, col_offset=12, end_lineno=79, end_col_offset=21), Name('placeholder_16', Load(), lineno=79, col_offset=25, end_lineno=79, end_col_offset=35), [Assign([Tuple([Name('placeholder_21', Store(), lineno=80, col_offset=12, end_lineno=80, end_col_offset=15), Name('placeholder_22', Store(), lineno=80, col_offset=17, end_lineno=80, end_col_offset=24)], Store(), lineno=80, col_offset=12, end_lineno=80, end_col_offset=24)], Name('placeholder_20', Load(), lineno=80, col_offset=27, end_lineno=80, end_col_offset=36), lineno=80, col_offset=12, end_lineno=80, end_col_offset=36), If(Compare(Subscript(Name('placeholder_15', Load(), lineno=82, col_offset=15, end_lineno=82, end_col_offset=22), Constant(0, lineno=82, col_offset=23, end_lineno=82, end_col_offset=24), Load(), lineno=82, col_offset=15, end_lineno=82, end_col_offset=25), [In()], [List([Name('placeholder_17', Load(), lineno=82, col_offset=30, end_lineno=82, end_col_offset=35), Name('placeholder_18', Load(), lineno=82, col_offset=37, end_lineno=82, end_col_offset=43)], Load(), lineno=82, col_offset=29, end_lineno=82, end_col_offset=44)], lineno=82, col_offset=15, end_lineno=82, end_col_offset=44), [Assign([Name('placeholder_23', Store(), lineno=83, col_offset=16, end_lineno=83, end_col_offset=28)], BinOp(Name('placeholder_22', Load(), lineno=83, col_offset=31, end_lineno=83, end_col_offset=38), Sub(), Call(Name('set', Load(), lineno=83, col_offset=41, end_lineno=83, end_col_offset=44), [List([Constant(0, lineno=83, col_offset=46, end_lineno=83, end_col_offset=47)], Load(), lineno=83, col_offset=45, end_lineno=83, end_col_offset=48)], [], lineno=83, col_offset=41, end_lineno=83, end_col_offset=49), lineno=83, col_offset=31, end_lineno=83, end_col_offset=49), lineno=83, col_offset=16, end_lineno=83, end_col_offset=49)], [Assign([Name('placeholder_23', Store(), lineno=86, col_offset=16, end_lineno=86, end_col_offset=28)], Name('placeholder_22', Load(), lineno=86, col_offset=31, end_lineno=86, end_col_offset=38), lineno=86, col_offset=16, end_lineno=86, end_col_offset=38)], lineno=82, col_offset=12, end_lineno=86, end_col_offset=38), For(Name('placeholder_24', Store(), lineno=88, col_offset=16, end_lineno=88, end_col_offset=17), Name('placeholder_23', Load(), lineno=88, col_offset=21, end_lineno=88, end_col_offset=33), [Assign([Name('placeholder_25', Store(), lineno=89, col_offset=16, end_lineno=89, end_col_offset=22)], BinOp(Name('placeholder_21', Load(), lineno=89, col_offset=25, end_lineno=89, end_col_offset=28), BitOr(), Dict([Subscript(Name('placeholder_15', Load(), lineno=89, col_offset=32, end_lineno=89, end_col_offset=39), Constant(0, lineno=89, col_offset=40, end_lineno=89, end_col_offset=41), Load(), lineno=89, col_offset=32, end_lineno=89, end_col_offset=42)], [Name('placeholder_24', Load(), lineno=89, col_offset=44, end_lineno=89, end_col_offset=45)], lineno=89, col_offset=31, end_lineno=89, end_col_offset=46), lineno=89, col_offset=25, end_lineno=89, end_col_offset=46), lineno=89, col_offset=16, end_lineno=89, end_col_offset=46), Expr(Call(Attribute(Name('placeholder_19', Load(), lineno=90, col_offset=16, end_lineno=90, end_col_offset=30), 'append', Load(), lineno=90, col_offset=16, end_lineno=90, end_col_offset=37), [Tuple([Name('placeholder_25', Load(), lineno=90, col_offset=39, end_lineno=90, end_col_offset=45), BinOp(Name('placeholder_22', Load(), lineno=90, col_offset=47, end_lineno=90, end_col_offset=54), Sub(), Call(Name('set', Load(), lineno=90, col_offset=57, end_lineno=90, end_col_offset=60), [List([Name('placeholder_24', Load(), lineno=90, col_offset=62, end_lineno=90, end_col_offset=63)], Load(), lineno=90, col_offset=61, end_lineno=90, end_col_offset=64)], [], lineno=90, col_offset=57, end_lineno=90, end_col_offset=65), lineno=90, col_offset=47, end_lineno=90, end_col_offset=65)], Load(), lineno=90, col_offset=38, end_lineno=90, end_col_offset=66)], [], lineno=90, col_offset=16, end_lineno=90, end_col_offset=67), lineno=90, col_offset=16, end_lineno=90, end_col_offset=67)], [], lineno=88, col_offset=12, end_lineno=90, end_col_offset=67)], [], lineno=79, col_offset=8, end_lineno=90, end_col_offset=67), Assign([Name('placeholder_16', Store(), lineno=92, col_offset=8, end_lineno=92, end_col_offset=18)], Name('placeholder_19', Load(), lineno=92, col_offset=21, end_lineno=92, end_col_offset=35), lineno=92, col_offset=8, end_lineno=92, end_col_offset=35), Assign([Name('placeholder_15', Store(), lineno=93, col_offset=8, end_lineno=93, end_col_offset=15)], Subscript(Name('placeholder_15', Load(), lineno=93, col_offset=18, end_lineno=93, end_col_offset=25), Slice(Constant(1, lineno=93, col_offset=26, end_lineno=93, end_col_offset=27), lineno=93, col_offset=26, end_lineno=93, end_col_offset=28), Load(), lineno=93, col_offset=18, end_lineno=93, end_col_offset=29), lineno=93, col_offset=8, end_lineno=93, end_col_offset=29)], [], lineno=76, col_offset=4, end_lineno=93, end_col_offset=29), Return(ListComp(Name('placeholder_21', Load(), lineno=94, col_offset=12, end_lineno=94, end_col_offset=15), [comprehension(Tuple([Name('placeholder_21', Store(), lineno=94, col_offset=20, end_lineno=94, end_col_offset=23), Name('placeholder_26', Store(), lineno=94, col_offset=25, end_lineno=94, end_col_offset=26)], Store(), lineno=94, col_offset=20, end_lineno=94, end_col_offset=26), Name('placeholder_16', Load(), lineno=94, col_offset=30, end_lineno=94, end_col_offset=40), [], 0)], lineno=94, col_offset=11, end_lineno=94, end_col_offset=41), lineno=94, col_offset=4, end_lineno=94, end_col_offset=41)], [], lineno=75, col_offset=0, end_lineno=94, end_col_offset=41)], []) \ No newline at end of file +Module([FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=2, col_offset=25, end_lineno=2, end_col_offset=30), arg('placeholder_2', lineno=2, col_offset=32, end_lineno=2, end_col_offset=46)], kwonlyargs=[], kw_defaults=[], defaults=[]), [AugAssign(Name('placeholder_1', Store(), lineno=11, col_offset=4, end_lineno=11, end_col_offset=9), BitOr(), Call(Name('dict', Load(), lineno=11, col_offset=13, end_lineno=11, end_col_offset=17), [Name('placeholder_2', Load(), lineno=11, col_offset=18, end_lineno=11, end_col_offset=32)], [], lineno=11, col_offset=13, end_lineno=11, end_col_offset=33), lineno=11, col_offset=4, end_lineno=11, end_col_offset=33), Return(Name('placeholder_1', Load(), lineno=12, col_offset=11, end_lineno=12, end_col_offset=16), lineno=12, col_offset=4, end_lineno=12, end_col_offset=16)], [], lineno=2, col_offset=0, end_lineno=12, end_col_offset=16), FunctionDef('placeholder_3', arguments([], [arg('placeholder_1', lineno=15, col_offset=24, end_lineno=15, end_col_offset=29), arg('placeholder_2', lineno=15, col_offset=31, end_lineno=15, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(BinOp(Call(Name('dict', Load(), lineno=23, col_offset=11, end_lineno=23, end_col_offset=15), [Name('placeholder_1', Load(), lineno=23, col_offset=16, end_lineno=23, end_col_offset=21)], [], lineno=23, col_offset=11, end_lineno=23, end_col_offset=22), BitOr(), Call(Name('dict', Load(), lineno=23, col_offset=25, end_lineno=23, end_col_offset=29), [Name('placeholder_2', Load(), lineno=23, col_offset=30, end_lineno=23, end_col_offset=44)], [], lineno=23, col_offset=25, end_lineno=23, end_col_offset=45), lineno=23, col_offset=11, end_lineno=23, end_col_offset=45), lineno=23, col_offset=4, end_lineno=23, end_col_offset=45)], [], lineno=15, col_offset=0, end_lineno=23, end_col_offset=45), Assign([Name('placeholder_1', Store(), lineno=26, col_offset=0, end_lineno=26, end_col_offset=5)], Dict([Constant('Banana Bread', lineno=26, col_offset=10, end_lineno=26, end_col_offset=24)], [Dict([Constant('Banana', lineno=26, col_offset=28, end_lineno=26, end_col_offset=36), Constant('Apple', lineno=26, col_offset=41, end_lineno=26, end_col_offset=48), Constant('Walnuts', lineno=26, col_offset=53, end_lineno=26, end_col_offset=62), Constant('Flour', lineno=26, col_offset=67, end_lineno=26, end_col_offset=74), Constant('Eggs', lineno=26, col_offset=79, end_lineno=26, end_col_offset=85), Constant('Butter', lineno=26, col_offset=90, end_lineno=26, end_col_offset=98)], [Constant(1, lineno=26, col_offset=38, end_lineno=26, end_col_offset=39), Constant(1, lineno=26, col_offset=50, end_lineno=26, end_col_offset=51), Constant(1, lineno=26, col_offset=64, end_lineno=26, end_col_offset=65), Constant(1, lineno=26, col_offset=76, end_lineno=26, end_col_offset=77), Constant(2, lineno=26, col_offset=87, end_lineno=26, end_col_offset=88), Constant(1, lineno=26, col_offset=100, end_lineno=26, end_col_offset=101)], lineno=26, col_offset=27, end_lineno=26, end_col_offset=102)], lineno=26, col_offset=9, end_lineno=26, end_col_offset=103), lineno=26, col_offset=0, end_lineno=26, end_col_offset=103), Assign([Name('placeholder_4', Store(), lineno=28, col_offset=0, end_lineno=28, end_col_offset=20)], Tuple([Tuple([Constant('Banana Bread', lineno=28, col_offset=24, end_lineno=28, end_col_offset=38), Dict([Constant('Banana', lineno=28, col_offset=41, end_lineno=28, end_col_offset=49), Constant('Walnuts', lineno=28, col_offset=55, end_lineno=28, end_col_offset=64), Constant('Flour', lineno=28, col_offset=69, end_lineno=28, end_col_offset=76), Constant('Eggs', lineno=28, col_offset=81, end_lineno=28, end_col_offset=87), Constant('Butter', lineno=28, col_offset=92, end_lineno=28, end_col_offset=100), Constant('Milk', lineno=28, col_offset=105, end_lineno=28, end_col_offset=111), Constant('Eggs', lineno=28, col_offset=116, end_lineno=28, end_col_offset=122)], [Constant(4, lineno=28, col_offset=51, end_lineno=28, end_col_offset=52), Constant(2, lineno=28, col_offset=66, end_lineno=28, end_col_offset=67), Constant(1, lineno=28, col_offset=78, end_lineno=28, end_col_offset=79), Constant(2, lineno=28, col_offset=89, end_lineno=28, end_col_offset=90), Constant(1, lineno=28, col_offset=102, end_lineno=28, end_col_offset=103), Constant(2, lineno=28, col_offset=113, end_lineno=28, end_col_offset=114), Constant(3, lineno=28, col_offset=124, end_lineno=28, end_col_offset=125)], lineno=28, col_offset=40, end_lineno=28, end_col_offset=126)], Load(), lineno=28, col_offset=23, end_lineno=28, end_col_offset=127)], Load(), lineno=28, col_offset=22, end_lineno=28, end_col_offset=129), lineno=28, col_offset=0, end_lineno=28, end_col_offset=129), Assign([Name('placeholder_5', Store(), lineno=30, col_offset=0, end_lineno=30, end_col_offset=18)], Dict([Constant('Banana Bread', lineno=30, col_offset=21, end_lineno=30, end_col_offset=35)], [Dict([Constant('Banana', lineno=30, col_offset=38, end_lineno=30, end_col_offset=46), Constant('Walnuts', lineno=30, col_offset=52, end_lineno=30, end_col_offset=61), Constant('Flour', lineno=30, col_offset=66, end_lineno=30, end_col_offset=73), Constant('Eggs', lineno=30, col_offset=78, end_lineno=30, end_col_offset=84), Constant('Butter', lineno=30, col_offset=89, end_lineno=30, end_col_offset=97), Constant('Milk', lineno=30, col_offset=102, end_lineno=30, end_col_offset=108), Constant('Eggs', lineno=30, col_offset=113, end_lineno=30, end_col_offset=119)], [Constant(4, lineno=30, col_offset=48, end_lineno=30, end_col_offset=49), Constant(2, lineno=30, col_offset=63, end_lineno=30, end_col_offset=64), Constant(1, lineno=30, col_offset=75, end_lineno=30, end_col_offset=76), Constant(2, lineno=30, col_offset=86, end_lineno=30, end_col_offset=87), Constant(1, lineno=30, col_offset=99, end_lineno=30, end_col_offset=100), Constant(2, lineno=30, col_offset=110, end_lineno=30, end_col_offset=111), Constant(3, lineno=30, col_offset=121, end_lineno=30, end_col_offset=122)], lineno=30, col_offset=37, end_lineno=30, end_col_offset=123)], lineno=30, col_offset=20, end_lineno=30, end_col_offset=124), lineno=30, col_offset=0, end_lineno=30, end_col_offset=124), Expr(Call(Name('placeholder_0', Load(), lineno=32, col_offset=0, end_lineno=32, end_col_offset=20), [Name('placeholder_1', Load(), lineno=32, col_offset=21, end_lineno=32, end_col_offset=26), Name('placeholder_4', Load(), lineno=32, col_offset=28, end_lineno=32, end_col_offset=48)], [], lineno=32, col_offset=0, end_lineno=32, end_col_offset=49), lineno=32, col_offset=0, end_lineno=32, end_col_offset=49), Expr(Call(Name('placeholder_3', Load(), lineno=35, col_offset=0, end_lineno=35, end_col_offset=19), [Name('placeholder_1', Load(), lineno=35, col_offset=20, end_lineno=35, end_col_offset=25), Name('placeholder_5', Load(), lineno=35, col_offset=27, end_lineno=35, end_col_offset=45)], [], lineno=35, col_offset=0, end_lineno=35, end_col_offset=46), lineno=35, col_offset=0, end_lineno=35, end_col_offset=46), Expr(Constant(' Example from `alphametrics` exercise ', lineno=40, col_offset=0, end_lineno=40, end_col_offset=44), lineno=40, col_offset=0, end_lineno=40, end_col_offset=44), FunctionDef('placeholder_6', arguments([], [arg('placeholder_7', lineno=41, col_offset=11, end_lineno=41, end_col_offset=18), arg('placeholder_8', lineno=41, col_offset=20, end_lineno=41, end_col_offset=30), arg('placeholder_9', lineno=41, col_offset=32, end_lineno=41, end_col_offset=37), arg('placeholder_10', lineno=41, col_offset=39, end_lineno=41, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [While(Name('placeholder_7', Load(), lineno=42, col_offset=10, end_lineno=42, end_col_offset=17), [Assign([Name('placeholder_11', Store(), lineno=43, col_offset=8, end_lineno=43, end_col_offset=22)], List([], Load(), lineno=43, col_offset=25, end_lineno=43, end_col_offset=27), lineno=43, col_offset=8, end_lineno=43, end_col_offset=27), For(Name('placeholder_12', Store(), lineno=45, col_offset=12, end_lineno=45, end_col_offset=21), Name('placeholder_8', Load(), lineno=45, col_offset=25, end_lineno=45, end_col_offset=35), [Assign([Tuple([Name('placeholder_13', Store(), lineno=46, col_offset=12, end_lineno=46, end_col_offset=15), Name('placeholder_14', Store(), lineno=46, col_offset=17, end_lineno=46, end_col_offset=24)], Store(), lineno=46, col_offset=12, end_lineno=46, end_col_offset=24)], Name('placeholder_12', Load(), lineno=46, col_offset=27, end_lineno=46, end_col_offset=36), lineno=46, col_offset=12, end_lineno=46, end_col_offset=36), If(Compare(Subscript(Name('placeholder_7', Load(), lineno=48, col_offset=15, end_lineno=48, end_col_offset=22), Constant(0, lineno=48, col_offset=23, end_lineno=48, end_col_offset=24), Load(), lineno=48, col_offset=15, end_lineno=48, end_col_offset=25), [In()], [List([Name('placeholder_9', Load(), lineno=48, col_offset=30, end_lineno=48, end_col_offset=35), Name('placeholder_10', Load(), lineno=48, col_offset=37, end_lineno=48, end_col_offset=43)], Load(), lineno=48, col_offset=29, end_lineno=48, end_col_offset=44)], lineno=48, col_offset=15, end_lineno=48, end_col_offset=44), [Assign([Name('placeholder_15', Store(), lineno=49, col_offset=16, end_lineno=49, end_col_offset=28)], BinOp(Name('placeholder_14', Load(), lineno=49, col_offset=31, end_lineno=49, end_col_offset=38), Sub(), Call(Name('set', Load(), lineno=49, col_offset=41, end_lineno=49, end_col_offset=44), [List([Constant(0, lineno=49, col_offset=46, end_lineno=49, end_col_offset=47)], Load(), lineno=49, col_offset=45, end_lineno=49, end_col_offset=48)], [], lineno=49, col_offset=41, end_lineno=49, end_col_offset=49), lineno=49, col_offset=31, end_lineno=49, end_col_offset=49), lineno=49, col_offset=16, end_lineno=49, end_col_offset=49)], [Assign([Name('placeholder_15', Store(), lineno=52, col_offset=16, end_lineno=52, end_col_offset=28)], Name('placeholder_14', Load(), lineno=52, col_offset=31, end_lineno=52, end_col_offset=38), lineno=52, col_offset=16, end_lineno=52, end_col_offset=38)], lineno=48, col_offset=12, end_lineno=52, end_col_offset=38), For(Name('placeholder_16', Store(), lineno=54, col_offset=16, end_lineno=54, end_col_offset=20), Name('placeholder_15', Load(), lineno=54, col_offset=24, end_lineno=54, end_col_offset=36), [Assign([Name('placeholder_17', Store(), lineno=55, col_offset=16, end_lineno=55, end_col_offset=22)], BinOp(Name('placeholder_13', Load(), lineno=55, col_offset=25, end_lineno=55, end_col_offset=28), BitOr(), Dict([Subscript(Name('placeholder_7', Load(), lineno=55, col_offset=32, end_lineno=55, end_col_offset=39), Constant(0, lineno=55, col_offset=40, end_lineno=55, end_col_offset=41), Load(), lineno=55, col_offset=32, end_lineno=55, end_col_offset=42)], [Name('placeholder_16', Load(), lineno=55, col_offset=44, end_lineno=55, end_col_offset=48)], lineno=55, col_offset=31, end_lineno=55, end_col_offset=49), lineno=55, col_offset=25, end_lineno=55, end_col_offset=49), lineno=55, col_offset=16, end_lineno=55, end_col_offset=49), Expr(Call(Attribute(Name('placeholder_11', Load(), lineno=56, col_offset=16, end_lineno=56, end_col_offset=30), 'append', Load(), lineno=56, col_offset=16, end_lineno=56, end_col_offset=37), [Tuple([Name('placeholder_17', Load(), lineno=56, col_offset=39, end_lineno=56, end_col_offset=45), BinOp(Name('placeholder_14', Load(), lineno=56, col_offset=47, end_lineno=56, end_col_offset=54), Sub(), Call(Name('set', Load(), lineno=56, col_offset=57, end_lineno=56, end_col_offset=60), [List([Name('placeholder_16', Load(), lineno=56, col_offset=62, end_lineno=56, end_col_offset=66)], Load(), lineno=56, col_offset=61, end_lineno=56, end_col_offset=67)], [], lineno=56, col_offset=57, end_lineno=56, end_col_offset=68), lineno=56, col_offset=47, end_lineno=56, end_col_offset=68)], Load(), lineno=56, col_offset=38, end_lineno=56, end_col_offset=69)], [], lineno=56, col_offset=16, end_lineno=56, end_col_offset=70), lineno=56, col_offset=16, end_lineno=56, end_col_offset=70)], [], lineno=54, col_offset=12, end_lineno=56, end_col_offset=70)], [], lineno=45, col_offset=8, end_lineno=56, end_col_offset=70), Assign([Name('placeholder_8', Store(), lineno=58, col_offset=8, end_lineno=58, end_col_offset=18)], Name('placeholder_11', Load(), lineno=58, col_offset=21, end_lineno=58, end_col_offset=35), lineno=58, col_offset=8, end_lineno=58, end_col_offset=35), Assign([Name('placeholder_7', Store(), lineno=59, col_offset=8, end_lineno=59, end_col_offset=15)], Subscript(Name('placeholder_7', Load(), lineno=59, col_offset=18, end_lineno=59, end_col_offset=25), Slice(Constant(1, lineno=59, col_offset=26, end_lineno=59, end_col_offset=27), lineno=59, col_offset=26, end_lineno=59, end_col_offset=28), Load(), lineno=59, col_offset=18, end_lineno=59, end_col_offset=29), lineno=59, col_offset=8, end_lineno=59, end_col_offset=29)], [], lineno=42, col_offset=4, end_lineno=59, end_col_offset=29), Return(ListComp(Name('placeholder_13', Load(), lineno=60, col_offset=12, end_lineno=60, end_col_offset=15), [comprehension(Tuple([Name('placeholder_13', Store(), lineno=60, col_offset=20, end_lineno=60, end_col_offset=23), Name('placeholder_18', Store(), lineno=60, col_offset=25, end_lineno=60, end_col_offset=26)], Store(), lineno=60, col_offset=20, end_lineno=60, end_col_offset=26), Name('placeholder_8', Load(), lineno=60, col_offset=30, end_lineno=60, end_col_offset=40), [], 0)], lineno=60, col_offset=11, end_lineno=60, end_col_offset=41), lineno=60, col_offset=4, end_lineno=60, end_col_offset=41)], [], lineno=41, col_offset=0, end_lineno=60, end_col_offset=41), Expr(Constant('\n This exmple comes from ChatGPT\n Prompt: Write a python function that \n reads user settings from a toml file and \n merges them with a dictionary of default \n settings to create a single dictionary. \n If there are any conflicts between the \n two sources of settings, the data from \n the toml file should be used.\n', lineno=66, col_offset=0, end_lineno=75, end_col_offset=3), lineno=66, col_offset=0, end_lineno=75, end_col_offset=3), Import([alias('tomlib', lineno=76, col_offset=7, end_lineno=76, end_col_offset=13)], lineno=76, col_offset=0, end_lineno=76, end_col_offset=13), FunctionDef('placeholder_19', arguments([], [arg('placeholder_20', lineno=78, col_offset=19, end_lineno=78, end_col_offset=35), arg('placeholder_21', lineno=78, col_offset=37, end_lineno=78, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], defaults=[]), [With([withitem(Call(Name('open', Load(), lineno=80, col_offset=9, end_lineno=80, end_col_offset=13), [Name('placeholder_21', Load(), lineno=80, col_offset=14, end_lineno=80, end_col_offset=28), Constant('r', lineno=80, col_offset=30, end_lineno=80, end_col_offset=33)], [], lineno=80, col_offset=9, end_lineno=80, end_col_offset=34), Name('placeholder_22', Store(), lineno=80, col_offset=38, end_lineno=80, end_col_offset=39))], [Assign([Name('placeholder_23', Store(), lineno=81, col_offset=8, end_lineno=81, end_col_offset=21)], Call(Attribute(Name('tomlib', Load(), lineno=81, col_offset=24, end_lineno=81, end_col_offset=30), 'load', Load(), lineno=81, col_offset=24, end_lineno=81, end_col_offset=35), [Name('placeholder_22', Load(), lineno=81, col_offset=36, end_lineno=81, end_col_offset=37)], [], lineno=81, col_offset=24, end_lineno=81, end_col_offset=38), lineno=81, col_offset=8, end_lineno=81, end_col_offset=38)], lineno=80, col_offset=4, end_lineno=81, end_col_offset=38), Assign([Name('placeholder_24', Store(), lineno=84, col_offset=4, end_lineno=84, end_col_offset=19)], BinOp(Call(Name('dict', Load(), lineno=84, col_offset=22, end_lineno=84, end_col_offset=26), [Name('placeholder_20', Load(), lineno=84, col_offset=27, end_lineno=84, end_col_offset=43)], [], lineno=84, col_offset=22, end_lineno=84, end_col_offset=44), BitOr(), Call(Name('dict', Load(), lineno=84, col_offset=47, end_lineno=84, end_col_offset=51), [Name('placeholder_23', Load(), lineno=84, col_offset=52, end_lineno=84, end_col_offset=65)], [], lineno=84, col_offset=47, end_lineno=84, end_col_offset=66), lineno=84, col_offset=22, end_lineno=84, end_col_offset=66), lineno=84, col_offset=4, end_lineno=84, end_col_offset=66), Return(Name('placeholder_24', Load(), lineno=86, col_offset=11, end_lineno=86, end_col_offset=26), lineno=86, col_offset=4, end_lineno=86, end_col_offset=26)], [], lineno=78, col_offset=0, end_lineno=86, end_col_offset=26), Assign([Name('placeholder_20', Store(), lineno=89, col_offset=0, end_lineno=89, end_col_offset=16)], Dict([Constant('timeout', lineno=90, col_offset=4, end_lineno=90, end_col_offset=13), Constant('retry_count', lineno=91, col_offset=4, end_lineno=91, end_col_offset=17), Constant('log_level', lineno=92, col_offset=4, end_lineno=92, end_col_offset=15)], [Constant(30, lineno=90, col_offset=15, end_lineno=90, end_col_offset=17), Constant(3, lineno=91, col_offset=19, end_lineno=91, end_col_offset=20), Constant('INFO', lineno=92, col_offset=17, end_lineno=92, end_col_offset=23)], lineno=89, col_offset=19, end_lineno=93, end_col_offset=1), lineno=89, col_offset=0, end_lineno=93, end_col_offset=1), Assign([Name('placeholder_21', Store(), lineno=94, col_offset=0, end_lineno=94, end_col_offset=14)], Constant('settings.toml', lineno=94, col_offset=17, end_lineno=94, end_col_offset=32), lineno=94, col_offset=0, end_lineno=94, end_col_offset=32), Assign([Name('placeholder_25', Store(), lineno=96, col_offset=0, end_lineno=96, end_col_offset=14)], Call(Name('placeholder_19', Load(), lineno=96, col_offset=17, end_lineno=96, end_col_offset=31), [Name('placeholder_20', Load(), lineno=96, col_offset=32, end_lineno=96, end_col_offset=48), Name('placeholder_21', Load(), lineno=96, col_offset=50, end_lineno=96, end_col_offset=64)], [], lineno=96, col_offset=17, end_lineno=96, end_col_offset=65), lineno=96, col_offset=0, end_lineno=96, end_col_offset=65)], []) \ No newline at end of file From 0aeb1263cef9847a6fe3a596188e1a09e01c23e1 Mon Sep 17 00:00:00 2001 From: BethanyG Date: Fri, 15 Mar 2024 14:53:58 -0700 Subject: [PATCH 04/14] Update test/example-uniondict-normalization/example_uniondict_normalization.py The second argument here needs to be an iterable, and dicts only iterate over keys, but we need keys and values. --- .../example_uniondict_normalization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/example-uniondict-normalization/example_uniondict_normalization.py b/test/example-uniondict-normalization/example_uniondict_normalization.py index ae4434a..2a7533e 100644 --- a/test/example-uniondict-normalization/example_uniondict_normalization.py +++ b/test/example-uniondict-normalization/example_uniondict_normalization.py @@ -8,7 +8,7 @@ def update_recipes_tuple(ideas, recipe_updates): # Since this action updates the dict in place, # the dict then needs to be returned separately, otherwise it is a syntax error. - ideas |= dict(recipe_updates) + ideas |= recipe_updates return ideas From 330a262b11cc15316ccc9a2f4455cd861b759f6b Mon Sep 17 00:00:00 2001 From: BethanyG Date: Fri, 15 Mar 2024 14:54:58 -0700 Subject: [PATCH 05/14] Update test/example-uniondict-normalization/example_uniondict_normalization.py --- .../example_uniondict_normalization.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/example-uniondict-normalization/example_uniondict_normalization.py b/test/example-uniondict-normalization/example_uniondict_normalization.py index 2a7533e..d22cb3a 100644 --- a/test/example-uniondict-normalization/example_uniondict_normalization.py +++ b/test/example-uniondict-normalization/example_uniondict_normalization.py @@ -6,6 +6,7 @@ def update_recipes_tuple(ideas, recipe_updates): :return: dict - updated "recipe ideas" dict. """ + # recipe_updates here is a tuple. # Since this action updates the dict in place, # the dict then needs to be returned separately, otherwise it is a syntax error. ideas |= recipe_updates From 0e67a90ccb5a1eb29fad05f59e186e3f912d94af Mon Sep 17 00:00:00 2001 From: BethanyG Date: Fri, 15 Mar 2024 15:07:08 -0700 Subject: [PATCH 06/14] Re Ran Test Representation Due to some small code review changes, had to re-record the representation. --- .../example_uniondict_normalization.py | 40 +- .../representation.out | 1821 ++++++++--------- .../representation.txt | 2 +- 3 files changed, 901 insertions(+), 962 deletions(-) diff --git a/test/example-uniondict-normalization/example_uniondict_normalization.py b/test/example-uniondict-normalization/example_uniondict_normalization.py index d22cb3a..245f0a8 100644 --- a/test/example-uniondict-normalization/example_uniondict_normalization.py +++ b/test/example-uniondict-normalization/example_uniondict_normalization.py @@ -1,6 +1,19 @@ -""" Examples adapted from Mecha Munch Management""" +""" Examples adapted from Mecha Munch Management, Alphametrics, and ChatGPT + + ChatGPT Prompt: Write a python function that + reads user settings from a toml file and + merges them with a dictionary of default + settings to create a single dictionary. + If there are any conflicts between the + two sources of settings, the data from + the toml file should be used. +""" + + def update_recipes_tuple(ideas, recipe_updates): - """Update the recipe ideas dictionary. + """Mecha Munch Management Example. + + Update the recipe ideas dictionary. :param ideas: dict - The "recipe ideas" dict. :param recipe_updates: tuple - tuple with updates for the ideas section. :return: dict - updated "recipe ideas" dict. @@ -14,7 +27,9 @@ def update_recipes_tuple(ideas, recipe_updates): def update_recipes_dict(ideas, recipe_updates): - """Update the recipe ideas dictionary. + """Second Mecha Munch Management Example. + + Update the recipe ideas dictionary. :param ideas: dict - The "recipe ideas" dict. :param recipe_updates: dict - dictionary with updates for the ideas section. :return: dict - updated "recipe ideas" dict. @@ -37,9 +52,9 @@ def update_recipes_dict(ideas, recipe_updates): # {'Banana Bread': {'Banana': 4, 'Walnuts': 2, 'Flour': 1, 'Eggs': 3, 'Butter': 1, 'Milk': 2}} - -""" Example from `alphametrics` exercise """ def assign(letters, selections, lefty, righty): + """ Example from `alphametrics` exercise """ + while letters: new_selections = [] @@ -61,19 +76,6 @@ def assign(letters, selections, lefty, righty): return [slc for slc, _ in selections] - - - -""" - This exmple comes from ChatGPT - Prompt: Write a python function that - reads user settings from a toml file and - merges them with a dictionary of default - settings to create a single dictionary. - If there are any conflicts between the - two sources of settings, the data from - the toml file should be used. -""" import tomlib def merge_settings(default_settings, toml_file_path): @@ -95,4 +97,4 @@ def merge_settings(default_settings, toml_file_path): toml_file_path = 'settings.toml' # Path to the TOML file final_settings = merge_settings(default_settings, toml_file_path) -print("Final Settings:", final_settings) \ No newline at end of file +print("Final Settings:", final_settings) diff --git a/test/example-uniondict-normalization/representation.out b/test/example-uniondict-normalization/representation.out index 2b6f9c1..b17ddb5 100644 --- a/test/example-uniondict-normalization/representation.out +++ b/test/example-uniondict-normalization/representation.out @@ -1,6 +1,6 @@ ## BEGIN NORMALIZED CODE ## def placeholder_0(placeholder_1, placeholder_2): - placeholder_1 |= dict(placeholder_2) + placeholder_1 |= placeholder_2 return placeholder_1 @@ -45,7 +45,6 @@ placeholder_5 = { } placeholder_0(placeholder_1, placeholder_4) placeholder_3(placeholder_1, placeholder_5) -" Example from `alphametrics` exercise " def placeholder_6(placeholder_7, placeholder_8, placeholder_9, placeholder_10): @@ -67,7 +66,6 @@ def placeholder_6(placeholder_7, placeholder_8, placeholder_9, placeholder_10): return [placeholder_13 for placeholder_13, placeholder_18 in placeholder_8] -"\n This exmple comes from ChatGPT\n Prompt: Write a python function that \n reads user settings from a toml file and \n merges them with a dictionary of default \n settings to create a single dictionary. \n If there are any conflicts between the \n two sources of settings, the data from \n the toml file should be used.\n" import tomlib @@ -89,15 +87,15 @@ Module( [ Expr( Constant( - ' Examples adapted from Mecha Munch Management', + ' Examples adapted from Mecha Munch Management, Alphametrics, and ChatGPT\n\n ChatGPT Prompt: Write a python function that\n reads user settings from a toml file and\n merges them with a dictionary of default\n settings to create a single dictionary.\n If there are any conflicts between the\n two sources of settings, the data from\n the toml file should be used.\n', lineno=1, col_offset=0, - end_lineno=1, - end_col_offset=51), + end_lineno=10, + end_col_offset=3), lineno=1, col_offset=0, - end_lineno=1, - end_col_offset=51), + end_lineno=10, + end_col_offset=3), FunctionDef( 'update_recipes_tuple', arguments( @@ -105,15 +103,15 @@ Module( [ arg( 'ideas', - lineno=2, + lineno=13, col_offset=25, - end_lineno=2, + end_lineno=13, end_col_offset=30), arg( 'recipe_updates', - lineno=2, + lineno=13, col_offset=32, - end_lineno=2, + end_lineno=13, end_col_offset=46)], kwonlyargs=[], kw_defaults=[], @@ -121,65 +119,51 @@ Module( [ Expr( Constant( - 'Update the recipe ideas dictionary.\n :param ideas: dict - The "recipe ideas" dict.\n :param recipe_updates: tuple - tuple with updates for the ideas section.\n :return: dict - updated "recipe ideas" dict.\n ', - lineno=3, + 'Mecha Munch Management Example.\n\n Update the recipe ideas dictionary.\n :param ideas: dict - The "recipe ideas" dict.\n :param recipe_updates: tuple - tuple with updates for the ideas section.\n :return: dict - updated "recipe ideas" dict.\n ', + lineno=14, col_offset=4, - end_lineno=7, + end_lineno=20, end_col_offset=7), - lineno=3, + lineno=14, col_offset=4, - end_lineno=7, + end_lineno=20, end_col_offset=7), AugAssign( Name( 'ideas', Store(), - lineno=11, + lineno=25, col_offset=4, - end_lineno=11, + end_lineno=25, end_col_offset=9), BitOr(), - Call( - Name( - 'dict', - Load(), - lineno=11, - col_offset=13, - end_lineno=11, - end_col_offset=17), - [ - Name( - 'recipe_updates', - Load(), - lineno=11, - col_offset=18, - end_lineno=11, - end_col_offset=32)], - [], - lineno=11, + Name( + 'recipe_updates', + Load(), + lineno=25, col_offset=13, - end_lineno=11, - end_col_offset=33), - lineno=11, + end_lineno=25, + end_col_offset=27), + lineno=25, col_offset=4, - end_lineno=11, - end_col_offset=33), + end_lineno=25, + end_col_offset=27), Return( Name( 'ideas', Load(), - lineno=12, + lineno=26, col_offset=11, - end_lineno=12, + end_lineno=26, end_col_offset=16), - lineno=12, + lineno=26, col_offset=4, - end_lineno=12, + end_lineno=26, end_col_offset=16)], [], - lineno=2, + lineno=13, col_offset=0, - end_lineno=12, + end_lineno=26, end_col_offset=16), FunctionDef( 'update_recipes_dict', @@ -188,15 +172,15 @@ Module( [ arg( 'ideas', - lineno=15, + lineno=29, col_offset=24, - end_lineno=15, + end_lineno=29, end_col_offset=29), arg( 'recipe_updates', - lineno=15, + lineno=29, col_offset=31, - end_lineno=15, + end_lineno=29, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], @@ -204,14 +188,14 @@ Module( [ Expr( Constant( - 'Update the recipe ideas dictionary.\n :param ideas: dict - The "recipe ideas" dict.\n :param recipe_updates: dict - dictionary with updates for the ideas section.\n :return: dict - updated "recipe ideas" dict.\n ', - lineno=16, + 'Second Mecha Munch Management Example.\n\n Update the recipe ideas dictionary.\n :param ideas: dict - The "recipe ideas" dict.\n :param recipe_updates: dict - dictionary with updates for the ideas section.\n :return: dict - updated "recipe ideas" dict.\n ', + lineno=30, col_offset=4, - end_lineno=20, + end_lineno=36, end_col_offset=7), - lineno=16, + lineno=30, col_offset=4, - end_lineno=20, + end_lineno=36, end_col_offset=7), Return( BinOp( @@ -219,171 +203,171 @@ Module( Name( 'dict', Load(), - lineno=23, + lineno=39, col_offset=11, - end_lineno=23, + end_lineno=39, end_col_offset=15), [ Name( 'ideas', Load(), - lineno=23, + lineno=39, col_offset=16, - end_lineno=23, + end_lineno=39, end_col_offset=21)], [], - lineno=23, + lineno=39, col_offset=11, - end_lineno=23, + end_lineno=39, end_col_offset=22), BitOr(), Call( Name( 'dict', Load(), - lineno=23, + lineno=39, col_offset=25, - end_lineno=23, + end_lineno=39, end_col_offset=29), [ Name( 'recipe_updates', Load(), - lineno=23, + lineno=39, col_offset=30, - end_lineno=23, + end_lineno=39, end_col_offset=44)], [], - lineno=23, + lineno=39, col_offset=25, - end_lineno=23, + end_lineno=39, end_col_offset=45), - lineno=23, + lineno=39, col_offset=11, - end_lineno=23, + end_lineno=39, end_col_offset=45), - lineno=23, + lineno=39, col_offset=4, - end_lineno=23, + end_lineno=39, end_col_offset=45)], [], - lineno=15, + lineno=29, col_offset=0, - end_lineno=23, + end_lineno=39, end_col_offset=45), Assign( [ Name( 'ideas', Store(), - lineno=26, + lineno=42, col_offset=0, - end_lineno=26, + end_lineno=42, end_col_offset=5)], Dict( [ Constant( 'Banana Bread', - lineno=26, + lineno=42, col_offset=10, - end_lineno=26, + end_lineno=42, end_col_offset=24)], [ Dict( [ Constant( 'Banana', - lineno=26, + lineno=42, col_offset=28, - end_lineno=26, + end_lineno=42, end_col_offset=36), Constant( 'Apple', - lineno=26, + lineno=42, col_offset=41, - end_lineno=26, + end_lineno=42, end_col_offset=48), Constant( 'Walnuts', - lineno=26, + lineno=42, col_offset=53, - end_lineno=26, + end_lineno=42, end_col_offset=62), Constant( 'Flour', - lineno=26, + lineno=42, col_offset=67, - end_lineno=26, + end_lineno=42, end_col_offset=74), Constant( 'Eggs', - lineno=26, + lineno=42, col_offset=79, - end_lineno=26, + end_lineno=42, end_col_offset=85), Constant( 'Butter', - lineno=26, + lineno=42, col_offset=90, - end_lineno=26, + end_lineno=42, end_col_offset=98)], [ Constant( 1, - lineno=26, + lineno=42, col_offset=38, - end_lineno=26, + end_lineno=42, end_col_offset=39), Constant( 1, - lineno=26, + lineno=42, col_offset=50, - end_lineno=26, + end_lineno=42, end_col_offset=51), Constant( 1, - lineno=26, + lineno=42, col_offset=64, - end_lineno=26, + end_lineno=42, end_col_offset=65), Constant( 1, - lineno=26, + lineno=42, col_offset=76, - end_lineno=26, + end_lineno=42, end_col_offset=77), Constant( 2, - lineno=26, + lineno=42, col_offset=87, - end_lineno=26, + end_lineno=42, end_col_offset=88), Constant( 1, - lineno=26, + lineno=42, col_offset=100, - end_lineno=26, + end_lineno=42, end_col_offset=101)], - lineno=26, + lineno=42, col_offset=27, - end_lineno=26, + end_lineno=42, end_col_offset=102)], - lineno=26, + lineno=42, col_offset=9, - end_lineno=26, + end_lineno=42, end_col_offset=103), - lineno=26, + lineno=42, col_offset=0, - end_lineno=26, + end_lineno=42, end_col_offset=103), Assign( [ Name( 'recipe_updates_tuple', Store(), - lineno=28, + lineno=44, col_offset=0, - end_lineno=28, + end_lineno=44, end_col_offset=20)], Tuple( [ @@ -391,309 +375,298 @@ Module( [ Constant( 'Banana Bread', - lineno=28, + lineno=44, col_offset=24, - end_lineno=28, + end_lineno=44, end_col_offset=38), Dict( [ Constant( 'Banana', - lineno=28, + lineno=44, col_offset=41, - end_lineno=28, + end_lineno=44, end_col_offset=49), Constant( 'Walnuts', - lineno=28, + lineno=44, col_offset=55, - end_lineno=28, + end_lineno=44, end_col_offset=64), Constant( 'Flour', - lineno=28, + lineno=44, col_offset=69, - end_lineno=28, + end_lineno=44, end_col_offset=76), Constant( 'Eggs', - lineno=28, + lineno=44, col_offset=81, - end_lineno=28, + end_lineno=44, end_col_offset=87), Constant( 'Butter', - lineno=28, + lineno=44, col_offset=92, - end_lineno=28, + end_lineno=44, end_col_offset=100), Constant( 'Milk', - lineno=28, + lineno=44, col_offset=105, - end_lineno=28, + end_lineno=44, end_col_offset=111), Constant( 'Eggs', - lineno=28, + lineno=44, col_offset=116, - end_lineno=28, + end_lineno=44, end_col_offset=122)], [ Constant( 4, - lineno=28, + lineno=44, col_offset=51, - end_lineno=28, + end_lineno=44, end_col_offset=52), Constant( 2, - lineno=28, + lineno=44, col_offset=66, - end_lineno=28, + end_lineno=44, end_col_offset=67), Constant( 1, - lineno=28, + lineno=44, col_offset=78, - end_lineno=28, + end_lineno=44, end_col_offset=79), Constant( 2, - lineno=28, + lineno=44, col_offset=89, - end_lineno=28, + end_lineno=44, end_col_offset=90), Constant( 1, - lineno=28, + lineno=44, col_offset=102, - end_lineno=28, + end_lineno=44, end_col_offset=103), Constant( 2, - lineno=28, + lineno=44, col_offset=113, - end_lineno=28, + end_lineno=44, end_col_offset=114), Constant( 3, - lineno=28, + lineno=44, col_offset=124, - end_lineno=28, + end_lineno=44, end_col_offset=125)], - lineno=28, + lineno=44, col_offset=40, - end_lineno=28, + end_lineno=44, end_col_offset=126)], Load(), - lineno=28, + lineno=44, col_offset=23, - end_lineno=28, + end_lineno=44, end_col_offset=127)], Load(), - lineno=28, + lineno=44, col_offset=22, - end_lineno=28, + end_lineno=44, end_col_offset=129), - lineno=28, + lineno=44, col_offset=0, - end_lineno=28, + end_lineno=44, end_col_offset=129), Assign( [ Name( 'recipe_update_dict', Store(), - lineno=30, + lineno=46, col_offset=0, - end_lineno=30, + end_lineno=46, end_col_offset=18)], Dict( [ Constant( 'Banana Bread', - lineno=30, + lineno=46, col_offset=21, - end_lineno=30, + end_lineno=46, end_col_offset=35)], [ Dict( [ Constant( 'Banana', - lineno=30, + lineno=46, col_offset=38, - end_lineno=30, + end_lineno=46, end_col_offset=46), Constant( 'Walnuts', - lineno=30, + lineno=46, col_offset=52, - end_lineno=30, + end_lineno=46, end_col_offset=61), Constant( 'Flour', - lineno=30, + lineno=46, col_offset=66, - end_lineno=30, + end_lineno=46, end_col_offset=73), Constant( 'Eggs', - lineno=30, + lineno=46, col_offset=78, - end_lineno=30, + end_lineno=46, end_col_offset=84), Constant( 'Butter', - lineno=30, + lineno=46, col_offset=89, - end_lineno=30, + end_lineno=46, end_col_offset=97), Constant( 'Milk', - lineno=30, + lineno=46, col_offset=102, - end_lineno=30, + end_lineno=46, end_col_offset=108), Constant( 'Eggs', - lineno=30, + lineno=46, col_offset=113, - end_lineno=30, + end_lineno=46, end_col_offset=119)], [ Constant( 4, - lineno=30, + lineno=46, col_offset=48, - end_lineno=30, + end_lineno=46, end_col_offset=49), Constant( 2, - lineno=30, + lineno=46, col_offset=63, - end_lineno=30, + end_lineno=46, end_col_offset=64), Constant( 1, - lineno=30, + lineno=46, col_offset=75, - end_lineno=30, + end_lineno=46, end_col_offset=76), Constant( 2, - lineno=30, + lineno=46, col_offset=86, - end_lineno=30, + end_lineno=46, end_col_offset=87), Constant( 1, - lineno=30, + lineno=46, col_offset=99, - end_lineno=30, + end_lineno=46, end_col_offset=100), Constant( 2, - lineno=30, + lineno=46, col_offset=110, - end_lineno=30, + end_lineno=46, end_col_offset=111), Constant( 3, - lineno=30, + lineno=46, col_offset=121, - end_lineno=30, + end_lineno=46, end_col_offset=122)], - lineno=30, + lineno=46, col_offset=37, - end_lineno=30, + end_lineno=46, end_col_offset=123)], - lineno=30, + lineno=46, col_offset=20, - end_lineno=30, + end_lineno=46, end_col_offset=124), - lineno=30, + lineno=46, col_offset=0, - end_lineno=30, + end_lineno=46, end_col_offset=124), Expr( Call( Name( 'update_recipes_tuple', Load(), - lineno=32, + lineno=48, col_offset=0, - end_lineno=32, + end_lineno=48, end_col_offset=20), [ Name( 'ideas', Load(), - lineno=32, + lineno=48, col_offset=21, - end_lineno=32, + end_lineno=48, end_col_offset=26), Name( 'recipe_updates_tuple', Load(), - lineno=32, + lineno=48, col_offset=28, - end_lineno=32, + end_lineno=48, end_col_offset=48)], [], - lineno=32, + lineno=48, col_offset=0, - end_lineno=32, + end_lineno=48, end_col_offset=49), - lineno=32, + lineno=48, col_offset=0, - end_lineno=32, + end_lineno=48, end_col_offset=49), Expr( Call( Name( 'update_recipes_dict', Load(), - lineno=35, + lineno=51, col_offset=0, - end_lineno=35, + end_lineno=51, end_col_offset=19), [ Name( 'ideas', Load(), - lineno=35, + lineno=51, col_offset=20, - end_lineno=35, + end_lineno=51, end_col_offset=25), Name( 'recipe_update_dict', Load(), - lineno=35, + lineno=51, col_offset=27, - end_lineno=35, + end_lineno=51, end_col_offset=45)], [], - lineno=35, + lineno=51, col_offset=0, - end_lineno=35, + end_lineno=51, end_col_offset=46), - lineno=35, + lineno=51, col_offset=0, - end_lineno=35, + end_lineno=51, end_col_offset=46), - Expr( - Constant( - ' Example from `alphametrics` exercise ', - lineno=40, - col_offset=0, - end_lineno=40, - end_col_offset=44), - lineno=40, - col_offset=0, - end_lineno=40, - end_col_offset=44), FunctionDef( 'assign', arguments( @@ -701,39 +674,50 @@ Module( [ arg( 'letters', - lineno=41, + lineno=55, col_offset=11, - end_lineno=41, + end_lineno=55, end_col_offset=18), arg( 'selections', - lineno=41, + lineno=55, col_offset=20, - end_lineno=41, + end_lineno=55, end_col_offset=30), arg( 'lefty', - lineno=41, + lineno=55, col_offset=32, - end_lineno=41, + end_lineno=55, end_col_offset=37), arg( 'righty', - lineno=41, + lineno=55, col_offset=39, - end_lineno=41, + end_lineno=55, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [ + Expr( + Constant( + ' Example from `alphametrics` exercise ', + lineno=56, + col_offset=4, + end_lineno=56, + end_col_offset=48), + lineno=56, + col_offset=4, + end_lineno=56, + end_col_offset=48), While( Name( 'letters', Load(), - lineno=42, + lineno=58, col_offset=10, - end_lineno=42, + end_lineno=58, end_col_offset=17), [ Assign( @@ -741,35 +725,35 @@ Module( Name( 'new_selections', Store(), - lineno=43, + lineno=59, col_offset=8, - end_lineno=43, + end_lineno=59, end_col_offset=22)], List( [], Load(), - lineno=43, + lineno=59, col_offset=25, - end_lineno=43, + end_lineno=59, end_col_offset=27), - lineno=43, + lineno=59, col_offset=8, - end_lineno=43, + end_lineno=59, end_col_offset=27), For( Name( 'selection', Store(), - lineno=45, + lineno=61, col_offset=12, - end_lineno=45, + end_lineno=61, end_col_offset=21), Name( 'selections', Load(), - lineno=45, + lineno=61, col_offset=25, - end_lineno=45, + end_lineno=61, end_col_offset=35), [ Assign( @@ -779,32 +763,32 @@ Module( Name( 'slc', Store(), - lineno=46, + lineno=62, col_offset=12, - end_lineno=46, + end_lineno=62, end_col_offset=15), Name( 'choices', Store(), - lineno=46, + lineno=62, col_offset=17, - end_lineno=46, + end_lineno=62, end_col_offset=24)], Store(), - lineno=46, + lineno=62, col_offset=12, - end_lineno=46, + end_lineno=62, end_col_offset=24)], Name( 'selection', Load(), - lineno=46, + lineno=62, col_offset=27, - end_lineno=46, + end_lineno=62, end_col_offset=36), - lineno=46, + lineno=62, col_offset=12, - end_lineno=46, + end_lineno=62, end_col_offset=36), If( Compare( @@ -812,20 +796,20 @@ Module( Name( 'letters', Load(), - lineno=48, + lineno=64, col_offset=15, - end_lineno=48, + end_lineno=64, end_col_offset=22), Constant( 0, - lineno=48, + lineno=64, col_offset=23, - end_lineno=48, + end_lineno=64, end_col_offset=24), Load(), - lineno=48, + lineno=64, col_offset=15, - end_lineno=48, + end_lineno=64, end_col_offset=25), [ In()], @@ -835,25 +819,25 @@ Module( Name( 'lefty', Load(), - lineno=48, + lineno=64, col_offset=30, - end_lineno=48, + end_lineno=64, end_col_offset=35), Name( 'righty', Load(), - lineno=48, + lineno=64, col_offset=37, - end_lineno=48, + end_lineno=64, end_col_offset=43)], Load(), - lineno=48, + lineno=64, col_offset=29, - end_lineno=48, + end_lineno=64, end_col_offset=44)], - lineno=48, + lineno=64, col_offset=15, - end_lineno=48, + end_lineno=64, end_col_offset=44), [ Assign( @@ -861,53 +845,53 @@ Module( Name( 'curr_choices', Store(), - lineno=49, + lineno=65, col_offset=16, - end_lineno=49, + end_lineno=65, end_col_offset=28)], BinOp( Name( 'choices', Load(), - lineno=49, + lineno=65, col_offset=31, - end_lineno=49, + end_lineno=65, end_col_offset=38), Sub(), Call( Name( 'set', Load(), - lineno=49, + lineno=65, col_offset=41, - end_lineno=49, + end_lineno=65, end_col_offset=44), [ List( [ Constant( 0, - lineno=49, + lineno=65, col_offset=46, - end_lineno=49, + end_lineno=65, end_col_offset=47)], Load(), - lineno=49, + lineno=65, col_offset=45, - end_lineno=49, + end_lineno=65, end_col_offset=48)], [], - lineno=49, + lineno=65, col_offset=41, - end_lineno=49, + end_lineno=65, end_col_offset=49), - lineno=49, + lineno=65, col_offset=31, - end_lineno=49, + end_lineno=65, end_col_offset=49), - lineno=49, + lineno=65, col_offset=16, - end_lineno=49, + end_lineno=65, end_col_offset=49)], [ Assign( @@ -915,39 +899,39 @@ Module( Name( 'curr_choices', Store(), - lineno=52, + lineno=68, col_offset=16, - end_lineno=52, + end_lineno=68, end_col_offset=28)], Name( 'choices', Load(), - lineno=52, + lineno=68, col_offset=31, - end_lineno=52, + end_lineno=68, end_col_offset=38), - lineno=52, + lineno=68, col_offset=16, - end_lineno=52, + end_lineno=68, end_col_offset=38)], - lineno=48, + lineno=64, col_offset=12, - end_lineno=52, + end_lineno=68, end_col_offset=38), For( Name( 'item', Store(), - lineno=54, + lineno=70, col_offset=16, - end_lineno=54, + end_lineno=70, end_col_offset=20), Name( 'curr_choices', Load(), - lineno=54, + lineno=70, col_offset=24, - end_lineno=54, + end_lineno=70, end_col_offset=36), [ Assign( @@ -955,17 +939,17 @@ Module( Name( 'actual', Store(), - lineno=55, + lineno=71, col_offset=16, - end_lineno=55, + end_lineno=71, end_col_offset=22)], BinOp( Name( 'slc', Load(), - lineno=55, + lineno=71, col_offset=25, - end_lineno=55, + end_lineno=71, end_col_offset=28), BitOr(), Dict( @@ -974,40 +958,40 @@ Module( Name( 'letters', Load(), - lineno=55, + lineno=71, col_offset=32, - end_lineno=55, + end_lineno=71, end_col_offset=39), Constant( 0, - lineno=55, + lineno=71, col_offset=40, - end_lineno=55, + end_lineno=71, end_col_offset=41), Load(), - lineno=55, + lineno=71, col_offset=32, - end_lineno=55, + end_lineno=71, end_col_offset=42)], [ Name( 'item', Load(), - lineno=55, + lineno=71, col_offset=44, - end_lineno=55, + end_lineno=71, end_col_offset=48)], - lineno=55, + lineno=71, col_offset=31, - end_lineno=55, + end_lineno=71, end_col_offset=49), - lineno=55, + lineno=71, col_offset=25, - end_lineno=55, + end_lineno=71, end_col_offset=49), - lineno=55, + lineno=71, col_offset=16, - end_lineno=55, + end_lineno=71, end_col_offset=49), Expr( Call( @@ -1015,15 +999,15 @@ Module( Name( 'new_selections', Load(), - lineno=56, + lineno=72, col_offset=16, - end_lineno=56, + end_lineno=72, end_col_offset=30), 'append', Load(), - lineno=56, + lineno=72, col_offset=16, - end_lineno=56, + end_lineno=72, end_col_offset=37), [ Tuple( @@ -1031,26 +1015,26 @@ Module( Name( 'actual', Load(), - lineno=56, + lineno=72, col_offset=39, - end_lineno=56, + end_lineno=72, end_col_offset=45), BinOp( Name( 'choices', Load(), - lineno=56, + lineno=72, col_offset=47, - end_lineno=56, + end_lineno=72, end_col_offset=54), Sub(), Call( Name( 'set', Load(), - lineno=56, + lineno=72, col_offset=57, - end_lineno=56, + end_lineno=72, end_col_offset=60), [ List( @@ -1058,118 +1042,118 @@ Module( Name( 'item', Load(), - lineno=56, + lineno=72, col_offset=62, - end_lineno=56, + end_lineno=72, end_col_offset=66)], Load(), - lineno=56, + lineno=72, col_offset=61, - end_lineno=56, + end_lineno=72, end_col_offset=67)], [], - lineno=56, + lineno=72, col_offset=57, - end_lineno=56, + end_lineno=72, end_col_offset=68), - lineno=56, + lineno=72, col_offset=47, - end_lineno=56, + end_lineno=72, end_col_offset=68)], Load(), - lineno=56, + lineno=72, col_offset=38, - end_lineno=56, + end_lineno=72, end_col_offset=69)], [], - lineno=56, + lineno=72, col_offset=16, - end_lineno=56, + end_lineno=72, end_col_offset=70), - lineno=56, + lineno=72, col_offset=16, - end_lineno=56, + end_lineno=72, end_col_offset=70)], [], - lineno=54, + lineno=70, col_offset=12, - end_lineno=56, + end_lineno=72, end_col_offset=70)], [], - lineno=45, + lineno=61, col_offset=8, - end_lineno=56, + end_lineno=72, end_col_offset=70), Assign( [ Name( 'selections', Store(), - lineno=58, + lineno=74, col_offset=8, - end_lineno=58, + end_lineno=74, end_col_offset=18)], Name( 'new_selections', Load(), - lineno=58, + lineno=74, col_offset=21, - end_lineno=58, + end_lineno=74, end_col_offset=35), - lineno=58, + lineno=74, col_offset=8, - end_lineno=58, + end_lineno=74, end_col_offset=35), Assign( [ Name( 'letters', Store(), - lineno=59, + lineno=75, col_offset=8, - end_lineno=59, + end_lineno=75, end_col_offset=15)], Subscript( Name( 'letters', Load(), - lineno=59, + lineno=75, col_offset=18, - end_lineno=59, + end_lineno=75, end_col_offset=25), Slice( Constant( 1, - lineno=59, + lineno=75, col_offset=26, - end_lineno=59, + end_lineno=75, end_col_offset=27), - lineno=59, + lineno=75, col_offset=26, - end_lineno=59, + end_lineno=75, end_col_offset=28), Load(), - lineno=59, + lineno=75, col_offset=18, - end_lineno=59, + end_lineno=75, end_col_offset=29), - lineno=59, + lineno=75, col_offset=8, - end_lineno=59, + end_lineno=75, end_col_offset=29)], [], - lineno=42, + lineno=58, col_offset=4, - end_lineno=59, + end_lineno=75, end_col_offset=29), Return( ListComp( Name( 'slc', Load(), - lineno=60, + lineno=76, col_offset=12, - end_lineno=60, + end_lineno=76, end_col_offset=15), [ comprehension( @@ -1178,66 +1162,55 @@ Module( Name( 'slc', Store(), - lineno=60, + lineno=76, col_offset=20, - end_lineno=60, + end_lineno=76, end_col_offset=23), Name( '_', Store(), - lineno=60, + lineno=76, col_offset=25, - end_lineno=60, + end_lineno=76, end_col_offset=26)], Store(), - lineno=60, + lineno=76, col_offset=20, - end_lineno=60, + end_lineno=76, end_col_offset=26), Name( 'selections', Load(), - lineno=60, + lineno=76, col_offset=30, - end_lineno=60, + end_lineno=76, end_col_offset=40), [], 0)], - lineno=60, + lineno=76, col_offset=11, - end_lineno=60, + end_lineno=76, end_col_offset=41), - lineno=60, + lineno=76, col_offset=4, - end_lineno=60, + end_lineno=76, end_col_offset=41)], [], - lineno=41, + lineno=55, col_offset=0, - end_lineno=60, + end_lineno=76, end_col_offset=41), - Expr( - Constant( - '\n This exmple comes from ChatGPT\n Prompt: Write a python function that \n reads user settings from a toml file and \n merges them with a dictionary of default \n settings to create a single dictionary. \n If there are any conflicts between the \n two sources of settings, the data from \n the toml file should be used.\n', - lineno=66, - col_offset=0, - end_lineno=75, - end_col_offset=3), - lineno=66, - col_offset=0, - end_lineno=75, - end_col_offset=3), Import( [ alias( 'tomlib', - lineno=76, + lineno=79, col_offset=7, - end_lineno=76, + end_lineno=79, end_col_offset=13)], - lineno=76, + lineno=79, col_offset=0, - end_lineno=76, + end_lineno=79, end_col_offset=13), FunctionDef( 'merge_settings', @@ -1246,15 +1219,15 @@ Module( [ arg( 'default_settings', - lineno=78, + lineno=81, col_offset=19, - end_lineno=78, + end_lineno=81, end_col_offset=35), arg( 'toml_file_path', - lineno=78, + lineno=81, col_offset=37, - end_lineno=78, + end_lineno=81, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], @@ -1267,35 +1240,35 @@ Module( Name( 'open', Load(), - lineno=80, + lineno=83, col_offset=9, - end_lineno=80, + end_lineno=83, end_col_offset=13), [ Name( 'toml_file_path', Load(), - lineno=80, + lineno=83, col_offset=14, - end_lineno=80, + end_lineno=83, end_col_offset=28), Constant( 'r', - lineno=80, + lineno=83, col_offset=30, - end_lineno=80, + end_lineno=83, end_col_offset=33)], [], - lineno=80, + lineno=83, col_offset=9, - end_lineno=80, + end_lineno=83, end_col_offset=34), Name( 'f', Store(), - lineno=80, + lineno=83, col_offset=38, - end_lineno=80, + end_lineno=83, end_col_offset=39))], [ Assign( @@ -1303,271 +1276,271 @@ Module( Name( 'toml_settings', Store(), - lineno=81, + lineno=84, col_offset=8, - end_lineno=81, + end_lineno=84, end_col_offset=21)], Call( Attribute( Name( 'tomlib', Load(), - lineno=81, + lineno=84, col_offset=24, - end_lineno=81, + end_lineno=84, end_col_offset=30), 'load', Load(), - lineno=81, + lineno=84, col_offset=24, - end_lineno=81, + end_lineno=84, end_col_offset=35), [ Name( 'f', Load(), - lineno=81, + lineno=84, col_offset=36, - end_lineno=81, + end_lineno=84, end_col_offset=37)], [], - lineno=81, + lineno=84, col_offset=24, - end_lineno=81, + end_lineno=84, end_col_offset=38), - lineno=81, + lineno=84, col_offset=8, - end_lineno=81, + end_lineno=84, end_col_offset=38)], - lineno=80, + lineno=83, col_offset=4, - end_lineno=81, + end_lineno=84, end_col_offset=38), Assign( [ Name( 'merged_settings', Store(), - lineno=84, + lineno=87, col_offset=4, - end_lineno=84, + end_lineno=87, end_col_offset=19)], BinOp( Call( Name( 'dict', Load(), - lineno=84, + lineno=87, col_offset=22, - end_lineno=84, + end_lineno=87, end_col_offset=26), [ Name( 'default_settings', Load(), - lineno=84, + lineno=87, col_offset=27, - end_lineno=84, + end_lineno=87, end_col_offset=43)], [], - lineno=84, + lineno=87, col_offset=22, - end_lineno=84, + end_lineno=87, end_col_offset=44), BitOr(), Call( Name( 'dict', Load(), - lineno=84, + lineno=87, col_offset=47, - end_lineno=84, + end_lineno=87, end_col_offset=51), [ Name( 'toml_settings', Load(), - lineno=84, + lineno=87, col_offset=52, - end_lineno=84, + end_lineno=87, end_col_offset=65)], [], - lineno=84, + lineno=87, col_offset=47, - end_lineno=84, + end_lineno=87, end_col_offset=66), - lineno=84, + lineno=87, col_offset=22, - end_lineno=84, + end_lineno=87, end_col_offset=66), - lineno=84, + lineno=87, col_offset=4, - end_lineno=84, + end_lineno=87, end_col_offset=66), Return( Name( 'merged_settings', Load(), - lineno=86, + lineno=89, col_offset=11, - end_lineno=86, + end_lineno=89, end_col_offset=26), - lineno=86, + lineno=89, col_offset=4, - end_lineno=86, + end_lineno=89, end_col_offset=26)], [], - lineno=78, + lineno=81, col_offset=0, - end_lineno=86, + end_lineno=89, end_col_offset=26), Assign( [ Name( 'default_settings', Store(), - lineno=89, + lineno=92, col_offset=0, - end_lineno=89, + end_lineno=92, end_col_offset=16)], Dict( [ Constant( 'timeout', - lineno=90, + lineno=93, col_offset=4, - end_lineno=90, + end_lineno=93, end_col_offset=13), Constant( 'retry_count', - lineno=91, + lineno=94, col_offset=4, - end_lineno=91, + end_lineno=94, end_col_offset=17), Constant( 'log_level', - lineno=92, + lineno=95, col_offset=4, - end_lineno=92, + end_lineno=95, end_col_offset=15)], [ Constant( 30, - lineno=90, + lineno=93, col_offset=15, - end_lineno=90, + end_lineno=93, end_col_offset=17), Constant( 3, - lineno=91, + lineno=94, col_offset=19, - end_lineno=91, + end_lineno=94, end_col_offset=20), Constant( 'INFO', - lineno=92, + lineno=95, col_offset=17, - end_lineno=92, + end_lineno=95, end_col_offset=23)], - lineno=89, + lineno=92, col_offset=19, - end_lineno=93, + end_lineno=96, end_col_offset=1), - lineno=89, + lineno=92, col_offset=0, - end_lineno=93, + end_lineno=96, end_col_offset=1), Assign( [ Name( 'toml_file_path', Store(), - lineno=94, + lineno=97, col_offset=0, - end_lineno=94, + end_lineno=97, end_col_offset=14)], Constant( 'settings.toml', - lineno=94, + lineno=97, col_offset=17, - end_lineno=94, + end_lineno=97, end_col_offset=32), - lineno=94, + lineno=97, col_offset=0, - end_lineno=94, + end_lineno=97, end_col_offset=32), Assign( [ Name( 'final_settings', Store(), - lineno=96, + lineno=99, col_offset=0, - end_lineno=96, + end_lineno=99, end_col_offset=14)], Call( Name( 'merge_settings', Load(), - lineno=96, + lineno=99, col_offset=17, - end_lineno=96, + end_lineno=99, end_col_offset=31), [ Name( 'default_settings', Load(), - lineno=96, + lineno=99, col_offset=32, - end_lineno=96, + end_lineno=99, end_col_offset=48), Name( 'toml_file_path', Load(), - lineno=96, + lineno=99, col_offset=50, - end_lineno=96, + end_lineno=99, end_col_offset=64)], [], - lineno=96, + lineno=99, col_offset=17, - end_lineno=96, + end_lineno=99, end_col_offset=65), - lineno=96, + lineno=99, col_offset=0, - end_lineno=96, + end_lineno=99, end_col_offset=65), Expr( Call( Name( 'print', Load(), - lineno=97, + lineno=100, col_offset=0, - end_lineno=97, + end_lineno=100, end_col_offset=5), [ Constant( 'Final Settings:', - lineno=97, + lineno=100, col_offset=6, - end_lineno=97, + end_lineno=100, end_col_offset=23), Name( 'final_settings', Load(), - lineno=97, + lineno=100, col_offset=25, - end_lineno=97, + end_lineno=100, end_col_offset=39)], [], - lineno=97, + lineno=100, col_offset=0, - end_lineno=97, + end_lineno=100, end_col_offset=40), - lineno=97, + lineno=100, col_offset=0, - end_lineno=97, + end_lineno=100, end_col_offset=40)], []) ## END TREE BEFORE ## @@ -1582,15 +1555,15 @@ Module( [ arg( 'placeholder_1', - lineno=2, + lineno=13, col_offset=25, - end_lineno=2, + end_lineno=13, end_col_offset=30), arg( 'placeholder_2', - lineno=2, + lineno=13, col_offset=32, - end_lineno=2, + end_lineno=13, end_col_offset=46)], kwonlyargs=[], kw_defaults=[], @@ -1600,52 +1573,38 @@ Module( Name( 'placeholder_1', Store(), - lineno=11, + lineno=25, col_offset=4, - end_lineno=11, + end_lineno=25, end_col_offset=9), BitOr(), - Call( - Name( - 'dict', - Load(), - lineno=11, - col_offset=13, - end_lineno=11, - end_col_offset=17), - [ - Name( - 'placeholder_2', - Load(), - lineno=11, - col_offset=18, - end_lineno=11, - end_col_offset=32)], - [], - lineno=11, + Name( + 'placeholder_2', + Load(), + lineno=25, col_offset=13, - end_lineno=11, - end_col_offset=33), - lineno=11, + end_lineno=25, + end_col_offset=27), + lineno=25, col_offset=4, - end_lineno=11, - end_col_offset=33), + end_lineno=25, + end_col_offset=27), Return( Name( 'placeholder_1', Load(), - lineno=12, + lineno=26, col_offset=11, - end_lineno=12, + end_lineno=26, end_col_offset=16), - lineno=12, + lineno=26, col_offset=4, - end_lineno=12, + end_lineno=26, end_col_offset=16)], [], - lineno=2, + lineno=13, col_offset=0, - end_lineno=12, + end_lineno=26, end_col_offset=16), FunctionDef( 'placeholder_3', @@ -1654,15 +1613,15 @@ Module( [ arg( 'placeholder_1', - lineno=15, + lineno=29, col_offset=24, - end_lineno=15, + end_lineno=29, end_col_offset=29), arg( 'placeholder_2', - lineno=15, + lineno=29, col_offset=31, - end_lineno=15, + end_lineno=29, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], @@ -1674,171 +1633,171 @@ Module( Name( 'dict', Load(), - lineno=23, + lineno=39, col_offset=11, - end_lineno=23, + end_lineno=39, end_col_offset=15), [ Name( 'placeholder_1', Load(), - lineno=23, + lineno=39, col_offset=16, - end_lineno=23, + end_lineno=39, end_col_offset=21)], [], - lineno=23, + lineno=39, col_offset=11, - end_lineno=23, + end_lineno=39, end_col_offset=22), BitOr(), Call( Name( 'dict', Load(), - lineno=23, + lineno=39, col_offset=25, - end_lineno=23, + end_lineno=39, end_col_offset=29), [ Name( 'placeholder_2', Load(), - lineno=23, + lineno=39, col_offset=30, - end_lineno=23, + end_lineno=39, end_col_offset=44)], [], - lineno=23, + lineno=39, col_offset=25, - end_lineno=23, + end_lineno=39, end_col_offset=45), - lineno=23, + lineno=39, col_offset=11, - end_lineno=23, + end_lineno=39, end_col_offset=45), - lineno=23, + lineno=39, col_offset=4, - end_lineno=23, + end_lineno=39, end_col_offset=45)], [], - lineno=15, + lineno=29, col_offset=0, - end_lineno=23, + end_lineno=39, end_col_offset=45), Assign( [ Name( 'placeholder_1', Store(), - lineno=26, + lineno=42, col_offset=0, - end_lineno=26, + end_lineno=42, end_col_offset=5)], Dict( [ Constant( 'Banana Bread', - lineno=26, + lineno=42, col_offset=10, - end_lineno=26, + end_lineno=42, end_col_offset=24)], [ Dict( [ Constant( 'Banana', - lineno=26, + lineno=42, col_offset=28, - end_lineno=26, + end_lineno=42, end_col_offset=36), Constant( 'Apple', - lineno=26, + lineno=42, col_offset=41, - end_lineno=26, + end_lineno=42, end_col_offset=48), Constant( 'Walnuts', - lineno=26, + lineno=42, col_offset=53, - end_lineno=26, + end_lineno=42, end_col_offset=62), Constant( 'Flour', - lineno=26, + lineno=42, col_offset=67, - end_lineno=26, + end_lineno=42, end_col_offset=74), Constant( 'Eggs', - lineno=26, + lineno=42, col_offset=79, - end_lineno=26, + end_lineno=42, end_col_offset=85), Constant( 'Butter', - lineno=26, + lineno=42, col_offset=90, - end_lineno=26, + end_lineno=42, end_col_offset=98)], [ Constant( 1, - lineno=26, + lineno=42, col_offset=38, - end_lineno=26, + end_lineno=42, end_col_offset=39), Constant( 1, - lineno=26, + lineno=42, col_offset=50, - end_lineno=26, + end_lineno=42, end_col_offset=51), Constant( 1, - lineno=26, + lineno=42, col_offset=64, - end_lineno=26, + end_lineno=42, end_col_offset=65), Constant( 1, - lineno=26, + lineno=42, col_offset=76, - end_lineno=26, + end_lineno=42, end_col_offset=77), Constant( 2, - lineno=26, + lineno=42, col_offset=87, - end_lineno=26, + end_lineno=42, end_col_offset=88), Constant( 1, - lineno=26, + lineno=42, col_offset=100, - end_lineno=26, + end_lineno=42, end_col_offset=101)], - lineno=26, + lineno=42, col_offset=27, - end_lineno=26, + end_lineno=42, end_col_offset=102)], - lineno=26, + lineno=42, col_offset=9, - end_lineno=26, + end_lineno=42, end_col_offset=103), - lineno=26, + lineno=42, col_offset=0, - end_lineno=26, + end_lineno=42, end_col_offset=103), Assign( [ Name( 'placeholder_4', Store(), - lineno=28, + lineno=44, col_offset=0, - end_lineno=28, + end_lineno=44, end_col_offset=20)], Tuple( [ @@ -1846,309 +1805,298 @@ Module( [ Constant( 'Banana Bread', - lineno=28, + lineno=44, col_offset=24, - end_lineno=28, + end_lineno=44, end_col_offset=38), Dict( [ Constant( 'Banana', - lineno=28, + lineno=44, col_offset=41, - end_lineno=28, + end_lineno=44, end_col_offset=49), Constant( 'Walnuts', - lineno=28, + lineno=44, col_offset=55, - end_lineno=28, + end_lineno=44, end_col_offset=64), Constant( 'Flour', - lineno=28, + lineno=44, col_offset=69, - end_lineno=28, + end_lineno=44, end_col_offset=76), Constant( 'Eggs', - lineno=28, + lineno=44, col_offset=81, - end_lineno=28, + end_lineno=44, end_col_offset=87), Constant( 'Butter', - lineno=28, + lineno=44, col_offset=92, - end_lineno=28, + end_lineno=44, end_col_offset=100), Constant( 'Milk', - lineno=28, + lineno=44, col_offset=105, - end_lineno=28, + end_lineno=44, end_col_offset=111), Constant( 'Eggs', - lineno=28, + lineno=44, col_offset=116, - end_lineno=28, + end_lineno=44, end_col_offset=122)], [ Constant( 4, - lineno=28, + lineno=44, col_offset=51, - end_lineno=28, + end_lineno=44, end_col_offset=52), Constant( 2, - lineno=28, + lineno=44, col_offset=66, - end_lineno=28, + end_lineno=44, end_col_offset=67), Constant( 1, - lineno=28, + lineno=44, col_offset=78, - end_lineno=28, + end_lineno=44, end_col_offset=79), Constant( 2, - lineno=28, + lineno=44, col_offset=89, - end_lineno=28, + end_lineno=44, end_col_offset=90), Constant( 1, - lineno=28, + lineno=44, col_offset=102, - end_lineno=28, + end_lineno=44, end_col_offset=103), Constant( 2, - lineno=28, + lineno=44, col_offset=113, - end_lineno=28, + end_lineno=44, end_col_offset=114), Constant( 3, - lineno=28, + lineno=44, col_offset=124, - end_lineno=28, + end_lineno=44, end_col_offset=125)], - lineno=28, + lineno=44, col_offset=40, - end_lineno=28, + end_lineno=44, end_col_offset=126)], Load(), - lineno=28, + lineno=44, col_offset=23, - end_lineno=28, + end_lineno=44, end_col_offset=127)], Load(), - lineno=28, + lineno=44, col_offset=22, - end_lineno=28, + end_lineno=44, end_col_offset=129), - lineno=28, + lineno=44, col_offset=0, - end_lineno=28, + end_lineno=44, end_col_offset=129), Assign( [ Name( 'placeholder_5', Store(), - lineno=30, + lineno=46, col_offset=0, - end_lineno=30, + end_lineno=46, end_col_offset=18)], Dict( [ Constant( 'Banana Bread', - lineno=30, + lineno=46, col_offset=21, - end_lineno=30, + end_lineno=46, end_col_offset=35)], [ Dict( [ Constant( 'Banana', - lineno=30, + lineno=46, col_offset=38, - end_lineno=30, + end_lineno=46, end_col_offset=46), Constant( 'Walnuts', - lineno=30, + lineno=46, col_offset=52, - end_lineno=30, + end_lineno=46, end_col_offset=61), Constant( 'Flour', - lineno=30, + lineno=46, col_offset=66, - end_lineno=30, + end_lineno=46, end_col_offset=73), Constant( 'Eggs', - lineno=30, + lineno=46, col_offset=78, - end_lineno=30, + end_lineno=46, end_col_offset=84), Constant( 'Butter', - lineno=30, + lineno=46, col_offset=89, - end_lineno=30, + end_lineno=46, end_col_offset=97), Constant( 'Milk', - lineno=30, + lineno=46, col_offset=102, - end_lineno=30, + end_lineno=46, end_col_offset=108), Constant( 'Eggs', - lineno=30, + lineno=46, col_offset=113, - end_lineno=30, + end_lineno=46, end_col_offset=119)], [ Constant( 4, - lineno=30, + lineno=46, col_offset=48, - end_lineno=30, + end_lineno=46, end_col_offset=49), Constant( 2, - lineno=30, + lineno=46, col_offset=63, - end_lineno=30, + end_lineno=46, end_col_offset=64), Constant( 1, - lineno=30, + lineno=46, col_offset=75, - end_lineno=30, + end_lineno=46, end_col_offset=76), Constant( 2, - lineno=30, + lineno=46, col_offset=86, - end_lineno=30, + end_lineno=46, end_col_offset=87), Constant( 1, - lineno=30, + lineno=46, col_offset=99, - end_lineno=30, + end_lineno=46, end_col_offset=100), Constant( 2, - lineno=30, + lineno=46, col_offset=110, - end_lineno=30, + end_lineno=46, end_col_offset=111), Constant( 3, - lineno=30, + lineno=46, col_offset=121, - end_lineno=30, + end_lineno=46, end_col_offset=122)], - lineno=30, + lineno=46, col_offset=37, - end_lineno=30, + end_lineno=46, end_col_offset=123)], - lineno=30, + lineno=46, col_offset=20, - end_lineno=30, + end_lineno=46, end_col_offset=124), - lineno=30, + lineno=46, col_offset=0, - end_lineno=30, + end_lineno=46, end_col_offset=124), Expr( Call( Name( 'placeholder_0', Load(), - lineno=32, + lineno=48, col_offset=0, - end_lineno=32, + end_lineno=48, end_col_offset=20), [ Name( 'placeholder_1', Load(), - lineno=32, + lineno=48, col_offset=21, - end_lineno=32, + end_lineno=48, end_col_offset=26), Name( 'placeholder_4', Load(), - lineno=32, + lineno=48, col_offset=28, - end_lineno=32, + end_lineno=48, end_col_offset=48)], [], - lineno=32, + lineno=48, col_offset=0, - end_lineno=32, + end_lineno=48, end_col_offset=49), - lineno=32, + lineno=48, col_offset=0, - end_lineno=32, + end_lineno=48, end_col_offset=49), Expr( Call( Name( 'placeholder_3', Load(), - lineno=35, + lineno=51, col_offset=0, - end_lineno=35, + end_lineno=51, end_col_offset=19), [ Name( 'placeholder_1', Load(), - lineno=35, + lineno=51, col_offset=20, - end_lineno=35, + end_lineno=51, end_col_offset=25), Name( 'placeholder_5', Load(), - lineno=35, + lineno=51, col_offset=27, - end_lineno=35, + end_lineno=51, end_col_offset=45)], [], - lineno=35, + lineno=51, col_offset=0, - end_lineno=35, + end_lineno=51, end_col_offset=46), - lineno=35, + lineno=51, col_offset=0, - end_lineno=35, + end_lineno=51, end_col_offset=46), - Expr( - Constant( - ' Example from `alphametrics` exercise ', - lineno=40, - col_offset=0, - end_lineno=40, - end_col_offset=44), - lineno=40, - col_offset=0, - end_lineno=40, - end_col_offset=44), FunctionDef( 'placeholder_6', arguments( @@ -2156,27 +2104,27 @@ Module( [ arg( 'placeholder_7', - lineno=41, + lineno=55, col_offset=11, - end_lineno=41, + end_lineno=55, end_col_offset=18), arg( 'placeholder_8', - lineno=41, + lineno=55, col_offset=20, - end_lineno=41, + end_lineno=55, end_col_offset=30), arg( 'placeholder_9', - lineno=41, + lineno=55, col_offset=32, - end_lineno=41, + end_lineno=55, end_col_offset=37), arg( 'placeholder_10', - lineno=41, + lineno=55, col_offset=39, - end_lineno=41, + end_lineno=55, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], @@ -2186,9 +2134,9 @@ Module( Name( 'placeholder_7', Load(), - lineno=42, + lineno=58, col_offset=10, - end_lineno=42, + end_lineno=58, end_col_offset=17), [ Assign( @@ -2196,35 +2144,35 @@ Module( Name( 'placeholder_11', Store(), - lineno=43, + lineno=59, col_offset=8, - end_lineno=43, + end_lineno=59, end_col_offset=22)], List( [], Load(), - lineno=43, + lineno=59, col_offset=25, - end_lineno=43, + end_lineno=59, end_col_offset=27), - lineno=43, + lineno=59, col_offset=8, - end_lineno=43, + end_lineno=59, end_col_offset=27), For( Name( 'placeholder_12', Store(), - lineno=45, + lineno=61, col_offset=12, - end_lineno=45, + end_lineno=61, end_col_offset=21), Name( 'placeholder_8', Load(), - lineno=45, + lineno=61, col_offset=25, - end_lineno=45, + end_lineno=61, end_col_offset=35), [ Assign( @@ -2234,32 +2182,32 @@ Module( Name( 'placeholder_13', Store(), - lineno=46, + lineno=62, col_offset=12, - end_lineno=46, + end_lineno=62, end_col_offset=15), Name( 'placeholder_14', Store(), - lineno=46, + lineno=62, col_offset=17, - end_lineno=46, + end_lineno=62, end_col_offset=24)], Store(), - lineno=46, + lineno=62, col_offset=12, - end_lineno=46, + end_lineno=62, end_col_offset=24)], Name( 'placeholder_12', Load(), - lineno=46, + lineno=62, col_offset=27, - end_lineno=46, + end_lineno=62, end_col_offset=36), - lineno=46, + lineno=62, col_offset=12, - end_lineno=46, + end_lineno=62, end_col_offset=36), If( Compare( @@ -2267,20 +2215,20 @@ Module( Name( 'placeholder_7', Load(), - lineno=48, + lineno=64, col_offset=15, - end_lineno=48, + end_lineno=64, end_col_offset=22), Constant( 0, - lineno=48, + lineno=64, col_offset=23, - end_lineno=48, + end_lineno=64, end_col_offset=24), Load(), - lineno=48, + lineno=64, col_offset=15, - end_lineno=48, + end_lineno=64, end_col_offset=25), [ In()], @@ -2290,25 +2238,25 @@ Module( Name( 'placeholder_9', Load(), - lineno=48, + lineno=64, col_offset=30, - end_lineno=48, + end_lineno=64, end_col_offset=35), Name( 'placeholder_10', Load(), - lineno=48, + lineno=64, col_offset=37, - end_lineno=48, + end_lineno=64, end_col_offset=43)], Load(), - lineno=48, + lineno=64, col_offset=29, - end_lineno=48, + end_lineno=64, end_col_offset=44)], - lineno=48, + lineno=64, col_offset=15, - end_lineno=48, + end_lineno=64, end_col_offset=44), [ Assign( @@ -2316,53 +2264,53 @@ Module( Name( 'placeholder_15', Store(), - lineno=49, + lineno=65, col_offset=16, - end_lineno=49, + end_lineno=65, end_col_offset=28)], BinOp( Name( 'placeholder_14', Load(), - lineno=49, + lineno=65, col_offset=31, - end_lineno=49, + end_lineno=65, end_col_offset=38), Sub(), Call( Name( 'set', Load(), - lineno=49, + lineno=65, col_offset=41, - end_lineno=49, + end_lineno=65, end_col_offset=44), [ List( [ Constant( 0, - lineno=49, + lineno=65, col_offset=46, - end_lineno=49, + end_lineno=65, end_col_offset=47)], Load(), - lineno=49, + lineno=65, col_offset=45, - end_lineno=49, + end_lineno=65, end_col_offset=48)], [], - lineno=49, + lineno=65, col_offset=41, - end_lineno=49, + end_lineno=65, end_col_offset=49), - lineno=49, + lineno=65, col_offset=31, - end_lineno=49, + end_lineno=65, end_col_offset=49), - lineno=49, + lineno=65, col_offset=16, - end_lineno=49, + end_lineno=65, end_col_offset=49)], [ Assign( @@ -2370,39 +2318,39 @@ Module( Name( 'placeholder_15', Store(), - lineno=52, + lineno=68, col_offset=16, - end_lineno=52, + end_lineno=68, end_col_offset=28)], Name( 'placeholder_14', Load(), - lineno=52, + lineno=68, col_offset=31, - end_lineno=52, + end_lineno=68, end_col_offset=38), - lineno=52, + lineno=68, col_offset=16, - end_lineno=52, + end_lineno=68, end_col_offset=38)], - lineno=48, + lineno=64, col_offset=12, - end_lineno=52, + end_lineno=68, end_col_offset=38), For( Name( 'placeholder_16', Store(), - lineno=54, + lineno=70, col_offset=16, - end_lineno=54, + end_lineno=70, end_col_offset=20), Name( 'placeholder_15', Load(), - lineno=54, + lineno=70, col_offset=24, - end_lineno=54, + end_lineno=70, end_col_offset=36), [ Assign( @@ -2410,17 +2358,17 @@ Module( Name( 'placeholder_17', Store(), - lineno=55, + lineno=71, col_offset=16, - end_lineno=55, + end_lineno=71, end_col_offset=22)], BinOp( Name( 'placeholder_13', Load(), - lineno=55, + lineno=71, col_offset=25, - end_lineno=55, + end_lineno=71, end_col_offset=28), BitOr(), Dict( @@ -2429,40 +2377,40 @@ Module( Name( 'placeholder_7', Load(), - lineno=55, + lineno=71, col_offset=32, - end_lineno=55, + end_lineno=71, end_col_offset=39), Constant( 0, - lineno=55, + lineno=71, col_offset=40, - end_lineno=55, + end_lineno=71, end_col_offset=41), Load(), - lineno=55, + lineno=71, col_offset=32, - end_lineno=55, + end_lineno=71, end_col_offset=42)], [ Name( 'placeholder_16', Load(), - lineno=55, + lineno=71, col_offset=44, - end_lineno=55, + end_lineno=71, end_col_offset=48)], - lineno=55, + lineno=71, col_offset=31, - end_lineno=55, + end_lineno=71, end_col_offset=49), - lineno=55, + lineno=71, col_offset=25, - end_lineno=55, + end_lineno=71, end_col_offset=49), - lineno=55, + lineno=71, col_offset=16, - end_lineno=55, + end_lineno=71, end_col_offset=49), Expr( Call( @@ -2470,15 +2418,15 @@ Module( Name( 'placeholder_11', Load(), - lineno=56, + lineno=72, col_offset=16, - end_lineno=56, + end_lineno=72, end_col_offset=30), 'append', Load(), - lineno=56, + lineno=72, col_offset=16, - end_lineno=56, + end_lineno=72, end_col_offset=37), [ Tuple( @@ -2486,26 +2434,26 @@ Module( Name( 'placeholder_17', Load(), - lineno=56, + lineno=72, col_offset=39, - end_lineno=56, + end_lineno=72, end_col_offset=45), BinOp( Name( 'placeholder_14', Load(), - lineno=56, + lineno=72, col_offset=47, - end_lineno=56, + end_lineno=72, end_col_offset=54), Sub(), Call( Name( 'set', Load(), - lineno=56, + lineno=72, col_offset=57, - end_lineno=56, + end_lineno=72, end_col_offset=60), [ List( @@ -2513,118 +2461,118 @@ Module( Name( 'placeholder_16', Load(), - lineno=56, + lineno=72, col_offset=62, - end_lineno=56, + end_lineno=72, end_col_offset=66)], Load(), - lineno=56, + lineno=72, col_offset=61, - end_lineno=56, + end_lineno=72, end_col_offset=67)], [], - lineno=56, + lineno=72, col_offset=57, - end_lineno=56, + end_lineno=72, end_col_offset=68), - lineno=56, + lineno=72, col_offset=47, - end_lineno=56, + end_lineno=72, end_col_offset=68)], Load(), - lineno=56, + lineno=72, col_offset=38, - end_lineno=56, + end_lineno=72, end_col_offset=69)], [], - lineno=56, + lineno=72, col_offset=16, - end_lineno=56, + end_lineno=72, end_col_offset=70), - lineno=56, + lineno=72, col_offset=16, - end_lineno=56, + end_lineno=72, end_col_offset=70)], [], - lineno=54, + lineno=70, col_offset=12, - end_lineno=56, + end_lineno=72, end_col_offset=70)], [], - lineno=45, + lineno=61, col_offset=8, - end_lineno=56, + end_lineno=72, end_col_offset=70), Assign( [ Name( 'placeholder_8', Store(), - lineno=58, + lineno=74, col_offset=8, - end_lineno=58, + end_lineno=74, end_col_offset=18)], Name( 'placeholder_11', Load(), - lineno=58, + lineno=74, col_offset=21, - end_lineno=58, + end_lineno=74, end_col_offset=35), - lineno=58, + lineno=74, col_offset=8, - end_lineno=58, + end_lineno=74, end_col_offset=35), Assign( [ Name( 'placeholder_7', Store(), - lineno=59, + lineno=75, col_offset=8, - end_lineno=59, + end_lineno=75, end_col_offset=15)], Subscript( Name( 'placeholder_7', Load(), - lineno=59, + lineno=75, col_offset=18, - end_lineno=59, + end_lineno=75, end_col_offset=25), Slice( Constant( 1, - lineno=59, + lineno=75, col_offset=26, - end_lineno=59, + end_lineno=75, end_col_offset=27), - lineno=59, + lineno=75, col_offset=26, - end_lineno=59, + end_lineno=75, end_col_offset=28), Load(), - lineno=59, + lineno=75, col_offset=18, - end_lineno=59, + end_lineno=75, end_col_offset=29), - lineno=59, + lineno=75, col_offset=8, - end_lineno=59, + end_lineno=75, end_col_offset=29)], [], - lineno=42, + lineno=58, col_offset=4, - end_lineno=59, + end_lineno=75, end_col_offset=29), Return( ListComp( Name( 'placeholder_13', Load(), - lineno=60, + lineno=76, col_offset=12, - end_lineno=60, + end_lineno=76, end_col_offset=15), [ comprehension( @@ -2633,66 +2581,55 @@ Module( Name( 'placeholder_13', Store(), - lineno=60, + lineno=76, col_offset=20, - end_lineno=60, + end_lineno=76, end_col_offset=23), Name( 'placeholder_18', Store(), - lineno=60, + lineno=76, col_offset=25, - end_lineno=60, + end_lineno=76, end_col_offset=26)], Store(), - lineno=60, + lineno=76, col_offset=20, - end_lineno=60, + end_lineno=76, end_col_offset=26), Name( 'placeholder_8', Load(), - lineno=60, + lineno=76, col_offset=30, - end_lineno=60, + end_lineno=76, end_col_offset=40), [], 0)], - lineno=60, + lineno=76, col_offset=11, - end_lineno=60, + end_lineno=76, end_col_offset=41), - lineno=60, + lineno=76, col_offset=4, - end_lineno=60, + end_lineno=76, end_col_offset=41)], [], - lineno=41, + lineno=55, col_offset=0, - end_lineno=60, + end_lineno=76, end_col_offset=41), - Expr( - Constant( - '\n This exmple comes from ChatGPT\n Prompt: Write a python function that \n reads user settings from a toml file and \n merges them with a dictionary of default \n settings to create a single dictionary. \n If there are any conflicts between the \n two sources of settings, the data from \n the toml file should be used.\n', - lineno=66, - col_offset=0, - end_lineno=75, - end_col_offset=3), - lineno=66, - col_offset=0, - end_lineno=75, - end_col_offset=3), Import( [ alias( 'tomlib', - lineno=76, + lineno=79, col_offset=7, - end_lineno=76, + end_lineno=79, end_col_offset=13)], - lineno=76, + lineno=79, col_offset=0, - end_lineno=76, + end_lineno=79, end_col_offset=13), FunctionDef( 'placeholder_19', @@ -2701,15 +2638,15 @@ Module( [ arg( 'placeholder_20', - lineno=78, + lineno=81, col_offset=19, - end_lineno=78, + end_lineno=81, end_col_offset=35), arg( 'placeholder_21', - lineno=78, + lineno=81, col_offset=37, - end_lineno=78, + end_lineno=81, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], @@ -2722,35 +2659,35 @@ Module( Name( 'open', Load(), - lineno=80, + lineno=83, col_offset=9, - end_lineno=80, + end_lineno=83, end_col_offset=13), [ Name( 'placeholder_21', Load(), - lineno=80, + lineno=83, col_offset=14, - end_lineno=80, + end_lineno=83, end_col_offset=28), Constant( 'r', - lineno=80, + lineno=83, col_offset=30, - end_lineno=80, + end_lineno=83, end_col_offset=33)], [], - lineno=80, + lineno=83, col_offset=9, - end_lineno=80, + end_lineno=83, end_col_offset=34), Name( 'placeholder_22', Store(), - lineno=80, + lineno=83, col_offset=38, - end_lineno=80, + end_lineno=83, end_col_offset=39))], [ Assign( @@ -2758,239 +2695,239 @@ Module( Name( 'placeholder_23', Store(), - lineno=81, + lineno=84, col_offset=8, - end_lineno=81, + end_lineno=84, end_col_offset=21)], Call( Attribute( Name( 'tomlib', Load(), - lineno=81, + lineno=84, col_offset=24, - end_lineno=81, + end_lineno=84, end_col_offset=30), 'load', Load(), - lineno=81, + lineno=84, col_offset=24, - end_lineno=81, + end_lineno=84, end_col_offset=35), [ Name( 'placeholder_22', Load(), - lineno=81, + lineno=84, col_offset=36, - end_lineno=81, + end_lineno=84, end_col_offset=37)], [], - lineno=81, + lineno=84, col_offset=24, - end_lineno=81, + end_lineno=84, end_col_offset=38), - lineno=81, + lineno=84, col_offset=8, - end_lineno=81, + end_lineno=84, end_col_offset=38)], - lineno=80, + lineno=83, col_offset=4, - end_lineno=81, + end_lineno=84, end_col_offset=38), Assign( [ Name( 'placeholder_24', Store(), - lineno=84, + lineno=87, col_offset=4, - end_lineno=84, + end_lineno=87, end_col_offset=19)], BinOp( Call( Name( 'dict', Load(), - lineno=84, + lineno=87, col_offset=22, - end_lineno=84, + end_lineno=87, end_col_offset=26), [ Name( 'placeholder_20', Load(), - lineno=84, + lineno=87, col_offset=27, - end_lineno=84, + end_lineno=87, end_col_offset=43)], [], - lineno=84, + lineno=87, col_offset=22, - end_lineno=84, + end_lineno=87, end_col_offset=44), BitOr(), Call( Name( 'dict', Load(), - lineno=84, + lineno=87, col_offset=47, - end_lineno=84, + end_lineno=87, end_col_offset=51), [ Name( 'placeholder_23', Load(), - lineno=84, + lineno=87, col_offset=52, - end_lineno=84, + end_lineno=87, end_col_offset=65)], [], - lineno=84, + lineno=87, col_offset=47, - end_lineno=84, + end_lineno=87, end_col_offset=66), - lineno=84, + lineno=87, col_offset=22, - end_lineno=84, + end_lineno=87, end_col_offset=66), - lineno=84, + lineno=87, col_offset=4, - end_lineno=84, + end_lineno=87, end_col_offset=66), Return( Name( 'placeholder_24', Load(), - lineno=86, + lineno=89, col_offset=11, - end_lineno=86, + end_lineno=89, end_col_offset=26), - lineno=86, + lineno=89, col_offset=4, - end_lineno=86, + end_lineno=89, end_col_offset=26)], [], - lineno=78, + lineno=81, col_offset=0, - end_lineno=86, + end_lineno=89, end_col_offset=26), Assign( [ Name( 'placeholder_20', Store(), - lineno=89, + lineno=92, col_offset=0, - end_lineno=89, + end_lineno=92, end_col_offset=16)], Dict( [ Constant( 'timeout', - lineno=90, + lineno=93, col_offset=4, - end_lineno=90, + end_lineno=93, end_col_offset=13), Constant( 'retry_count', - lineno=91, + lineno=94, col_offset=4, - end_lineno=91, + end_lineno=94, end_col_offset=17), Constant( 'log_level', - lineno=92, + lineno=95, col_offset=4, - end_lineno=92, + end_lineno=95, end_col_offset=15)], [ Constant( 30, - lineno=90, + lineno=93, col_offset=15, - end_lineno=90, + end_lineno=93, end_col_offset=17), Constant( 3, - lineno=91, + lineno=94, col_offset=19, - end_lineno=91, + end_lineno=94, end_col_offset=20), Constant( 'INFO', - lineno=92, + lineno=95, col_offset=17, - end_lineno=92, + end_lineno=95, end_col_offset=23)], - lineno=89, + lineno=92, col_offset=19, - end_lineno=93, + end_lineno=96, end_col_offset=1), - lineno=89, + lineno=92, col_offset=0, - end_lineno=93, + end_lineno=96, end_col_offset=1), Assign( [ Name( 'placeholder_21', Store(), - lineno=94, + lineno=97, col_offset=0, - end_lineno=94, + end_lineno=97, end_col_offset=14)], Constant( 'settings.toml', - lineno=94, + lineno=97, col_offset=17, - end_lineno=94, + end_lineno=97, end_col_offset=32), - lineno=94, + lineno=97, col_offset=0, - end_lineno=94, + end_lineno=97, end_col_offset=32), Assign( [ Name( 'placeholder_25', Store(), - lineno=96, + lineno=99, col_offset=0, - end_lineno=96, + end_lineno=99, end_col_offset=14)], Call( Name( 'placeholder_19', Load(), - lineno=96, + lineno=99, col_offset=17, - end_lineno=96, + end_lineno=99, end_col_offset=31), [ Name( 'placeholder_20', Load(), - lineno=96, + lineno=99, col_offset=32, - end_lineno=96, + end_lineno=99, end_col_offset=48), Name( 'placeholder_21', Load(), - lineno=96, + lineno=99, col_offset=50, - end_lineno=96, + end_lineno=99, end_col_offset=64)], [], - lineno=96, + lineno=99, col_offset=17, - end_lineno=96, + end_lineno=99, end_col_offset=65), - lineno=96, + lineno=99, col_offset=0, - end_lineno=96, + end_lineno=99, end_col_offset=65)], []) ## END NORMALIZED TREE ## \ No newline at end of file diff --git a/test/example-uniondict-normalization/representation.txt b/test/example-uniondict-normalization/representation.txt index eb8e34b..7f4e260 100644 --- a/test/example-uniondict-normalization/representation.txt +++ b/test/example-uniondict-normalization/representation.txt @@ -1 +1 @@ -Module([FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=2, col_offset=25, end_lineno=2, end_col_offset=30), arg('placeholder_2', lineno=2, col_offset=32, end_lineno=2, end_col_offset=46)], kwonlyargs=[], kw_defaults=[], defaults=[]), [AugAssign(Name('placeholder_1', Store(), lineno=11, col_offset=4, end_lineno=11, end_col_offset=9), BitOr(), Call(Name('dict', Load(), lineno=11, col_offset=13, end_lineno=11, end_col_offset=17), [Name('placeholder_2', Load(), lineno=11, col_offset=18, end_lineno=11, end_col_offset=32)], [], lineno=11, col_offset=13, end_lineno=11, end_col_offset=33), lineno=11, col_offset=4, end_lineno=11, end_col_offset=33), Return(Name('placeholder_1', Load(), lineno=12, col_offset=11, end_lineno=12, end_col_offset=16), lineno=12, col_offset=4, end_lineno=12, end_col_offset=16)], [], lineno=2, col_offset=0, end_lineno=12, end_col_offset=16), FunctionDef('placeholder_3', arguments([], [arg('placeholder_1', lineno=15, col_offset=24, end_lineno=15, end_col_offset=29), arg('placeholder_2', lineno=15, col_offset=31, end_lineno=15, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(BinOp(Call(Name('dict', Load(), lineno=23, col_offset=11, end_lineno=23, end_col_offset=15), [Name('placeholder_1', Load(), lineno=23, col_offset=16, end_lineno=23, end_col_offset=21)], [], lineno=23, col_offset=11, end_lineno=23, end_col_offset=22), BitOr(), Call(Name('dict', Load(), lineno=23, col_offset=25, end_lineno=23, end_col_offset=29), [Name('placeholder_2', Load(), lineno=23, col_offset=30, end_lineno=23, end_col_offset=44)], [], lineno=23, col_offset=25, end_lineno=23, end_col_offset=45), lineno=23, col_offset=11, end_lineno=23, end_col_offset=45), lineno=23, col_offset=4, end_lineno=23, end_col_offset=45)], [], lineno=15, col_offset=0, end_lineno=23, end_col_offset=45), Assign([Name('placeholder_1', Store(), lineno=26, col_offset=0, end_lineno=26, end_col_offset=5)], Dict([Constant('Banana Bread', lineno=26, col_offset=10, end_lineno=26, end_col_offset=24)], [Dict([Constant('Banana', lineno=26, col_offset=28, end_lineno=26, end_col_offset=36), Constant('Apple', lineno=26, col_offset=41, end_lineno=26, end_col_offset=48), Constant('Walnuts', lineno=26, col_offset=53, end_lineno=26, end_col_offset=62), Constant('Flour', lineno=26, col_offset=67, end_lineno=26, end_col_offset=74), Constant('Eggs', lineno=26, col_offset=79, end_lineno=26, end_col_offset=85), Constant('Butter', lineno=26, col_offset=90, end_lineno=26, end_col_offset=98)], [Constant(1, lineno=26, col_offset=38, end_lineno=26, end_col_offset=39), Constant(1, lineno=26, col_offset=50, end_lineno=26, end_col_offset=51), Constant(1, lineno=26, col_offset=64, end_lineno=26, end_col_offset=65), Constant(1, lineno=26, col_offset=76, end_lineno=26, end_col_offset=77), Constant(2, lineno=26, col_offset=87, end_lineno=26, end_col_offset=88), Constant(1, lineno=26, col_offset=100, end_lineno=26, end_col_offset=101)], lineno=26, col_offset=27, end_lineno=26, end_col_offset=102)], lineno=26, col_offset=9, end_lineno=26, end_col_offset=103), lineno=26, col_offset=0, end_lineno=26, end_col_offset=103), Assign([Name('placeholder_4', Store(), lineno=28, col_offset=0, end_lineno=28, end_col_offset=20)], Tuple([Tuple([Constant('Banana Bread', lineno=28, col_offset=24, end_lineno=28, end_col_offset=38), Dict([Constant('Banana', lineno=28, col_offset=41, end_lineno=28, end_col_offset=49), Constant('Walnuts', lineno=28, col_offset=55, end_lineno=28, end_col_offset=64), Constant('Flour', lineno=28, col_offset=69, end_lineno=28, end_col_offset=76), Constant('Eggs', lineno=28, col_offset=81, end_lineno=28, end_col_offset=87), Constant('Butter', lineno=28, col_offset=92, end_lineno=28, end_col_offset=100), Constant('Milk', lineno=28, col_offset=105, end_lineno=28, end_col_offset=111), Constant('Eggs', lineno=28, col_offset=116, end_lineno=28, end_col_offset=122)], [Constant(4, lineno=28, col_offset=51, end_lineno=28, end_col_offset=52), Constant(2, lineno=28, col_offset=66, end_lineno=28, end_col_offset=67), Constant(1, lineno=28, col_offset=78, end_lineno=28, end_col_offset=79), Constant(2, lineno=28, col_offset=89, end_lineno=28, end_col_offset=90), Constant(1, lineno=28, col_offset=102, end_lineno=28, end_col_offset=103), Constant(2, lineno=28, col_offset=113, end_lineno=28, end_col_offset=114), Constant(3, lineno=28, col_offset=124, end_lineno=28, end_col_offset=125)], lineno=28, col_offset=40, end_lineno=28, end_col_offset=126)], Load(), lineno=28, col_offset=23, end_lineno=28, end_col_offset=127)], Load(), lineno=28, col_offset=22, end_lineno=28, end_col_offset=129), lineno=28, col_offset=0, end_lineno=28, end_col_offset=129), Assign([Name('placeholder_5', Store(), lineno=30, col_offset=0, end_lineno=30, end_col_offset=18)], Dict([Constant('Banana Bread', lineno=30, col_offset=21, end_lineno=30, end_col_offset=35)], [Dict([Constant('Banana', lineno=30, col_offset=38, end_lineno=30, end_col_offset=46), Constant('Walnuts', lineno=30, col_offset=52, end_lineno=30, end_col_offset=61), Constant('Flour', lineno=30, col_offset=66, end_lineno=30, end_col_offset=73), Constant('Eggs', lineno=30, col_offset=78, end_lineno=30, end_col_offset=84), Constant('Butter', lineno=30, col_offset=89, end_lineno=30, end_col_offset=97), Constant('Milk', lineno=30, col_offset=102, end_lineno=30, end_col_offset=108), Constant('Eggs', lineno=30, col_offset=113, end_lineno=30, end_col_offset=119)], [Constant(4, lineno=30, col_offset=48, end_lineno=30, end_col_offset=49), Constant(2, lineno=30, col_offset=63, end_lineno=30, end_col_offset=64), Constant(1, lineno=30, col_offset=75, end_lineno=30, end_col_offset=76), Constant(2, lineno=30, col_offset=86, end_lineno=30, end_col_offset=87), Constant(1, lineno=30, col_offset=99, end_lineno=30, end_col_offset=100), Constant(2, lineno=30, col_offset=110, end_lineno=30, end_col_offset=111), Constant(3, lineno=30, col_offset=121, end_lineno=30, end_col_offset=122)], lineno=30, col_offset=37, end_lineno=30, end_col_offset=123)], lineno=30, col_offset=20, end_lineno=30, end_col_offset=124), lineno=30, col_offset=0, end_lineno=30, end_col_offset=124), Expr(Call(Name('placeholder_0', Load(), lineno=32, col_offset=0, end_lineno=32, end_col_offset=20), [Name('placeholder_1', Load(), lineno=32, col_offset=21, end_lineno=32, end_col_offset=26), Name('placeholder_4', Load(), lineno=32, col_offset=28, end_lineno=32, end_col_offset=48)], [], lineno=32, col_offset=0, end_lineno=32, end_col_offset=49), lineno=32, col_offset=0, end_lineno=32, end_col_offset=49), Expr(Call(Name('placeholder_3', Load(), lineno=35, col_offset=0, end_lineno=35, end_col_offset=19), [Name('placeholder_1', Load(), lineno=35, col_offset=20, end_lineno=35, end_col_offset=25), Name('placeholder_5', Load(), lineno=35, col_offset=27, end_lineno=35, end_col_offset=45)], [], lineno=35, col_offset=0, end_lineno=35, end_col_offset=46), lineno=35, col_offset=0, end_lineno=35, end_col_offset=46), Expr(Constant(' Example from `alphametrics` exercise ', lineno=40, col_offset=0, end_lineno=40, end_col_offset=44), lineno=40, col_offset=0, end_lineno=40, end_col_offset=44), FunctionDef('placeholder_6', arguments([], [arg('placeholder_7', lineno=41, col_offset=11, end_lineno=41, end_col_offset=18), arg('placeholder_8', lineno=41, col_offset=20, end_lineno=41, end_col_offset=30), arg('placeholder_9', lineno=41, col_offset=32, end_lineno=41, end_col_offset=37), arg('placeholder_10', lineno=41, col_offset=39, end_lineno=41, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [While(Name('placeholder_7', Load(), lineno=42, col_offset=10, end_lineno=42, end_col_offset=17), [Assign([Name('placeholder_11', Store(), lineno=43, col_offset=8, end_lineno=43, end_col_offset=22)], List([], Load(), lineno=43, col_offset=25, end_lineno=43, end_col_offset=27), lineno=43, col_offset=8, end_lineno=43, end_col_offset=27), For(Name('placeholder_12', Store(), lineno=45, col_offset=12, end_lineno=45, end_col_offset=21), Name('placeholder_8', Load(), lineno=45, col_offset=25, end_lineno=45, end_col_offset=35), [Assign([Tuple([Name('placeholder_13', Store(), lineno=46, col_offset=12, end_lineno=46, end_col_offset=15), Name('placeholder_14', Store(), lineno=46, col_offset=17, end_lineno=46, end_col_offset=24)], Store(), lineno=46, col_offset=12, end_lineno=46, end_col_offset=24)], Name('placeholder_12', Load(), lineno=46, col_offset=27, end_lineno=46, end_col_offset=36), lineno=46, col_offset=12, end_lineno=46, end_col_offset=36), If(Compare(Subscript(Name('placeholder_7', Load(), lineno=48, col_offset=15, end_lineno=48, end_col_offset=22), Constant(0, lineno=48, col_offset=23, end_lineno=48, end_col_offset=24), Load(), lineno=48, col_offset=15, end_lineno=48, end_col_offset=25), [In()], [List([Name('placeholder_9', Load(), lineno=48, col_offset=30, end_lineno=48, end_col_offset=35), Name('placeholder_10', Load(), lineno=48, col_offset=37, end_lineno=48, end_col_offset=43)], Load(), lineno=48, col_offset=29, end_lineno=48, end_col_offset=44)], lineno=48, col_offset=15, end_lineno=48, end_col_offset=44), [Assign([Name('placeholder_15', Store(), lineno=49, col_offset=16, end_lineno=49, end_col_offset=28)], BinOp(Name('placeholder_14', Load(), lineno=49, col_offset=31, end_lineno=49, end_col_offset=38), Sub(), Call(Name('set', Load(), lineno=49, col_offset=41, end_lineno=49, end_col_offset=44), [List([Constant(0, lineno=49, col_offset=46, end_lineno=49, end_col_offset=47)], Load(), lineno=49, col_offset=45, end_lineno=49, end_col_offset=48)], [], lineno=49, col_offset=41, end_lineno=49, end_col_offset=49), lineno=49, col_offset=31, end_lineno=49, end_col_offset=49), lineno=49, col_offset=16, end_lineno=49, end_col_offset=49)], [Assign([Name('placeholder_15', Store(), lineno=52, col_offset=16, end_lineno=52, end_col_offset=28)], Name('placeholder_14', Load(), lineno=52, col_offset=31, end_lineno=52, end_col_offset=38), lineno=52, col_offset=16, end_lineno=52, end_col_offset=38)], lineno=48, col_offset=12, end_lineno=52, end_col_offset=38), For(Name('placeholder_16', Store(), lineno=54, col_offset=16, end_lineno=54, end_col_offset=20), Name('placeholder_15', Load(), lineno=54, col_offset=24, end_lineno=54, end_col_offset=36), [Assign([Name('placeholder_17', Store(), lineno=55, col_offset=16, end_lineno=55, end_col_offset=22)], BinOp(Name('placeholder_13', Load(), lineno=55, col_offset=25, end_lineno=55, end_col_offset=28), BitOr(), Dict([Subscript(Name('placeholder_7', Load(), lineno=55, col_offset=32, end_lineno=55, end_col_offset=39), Constant(0, lineno=55, col_offset=40, end_lineno=55, end_col_offset=41), Load(), lineno=55, col_offset=32, end_lineno=55, end_col_offset=42)], [Name('placeholder_16', Load(), lineno=55, col_offset=44, end_lineno=55, end_col_offset=48)], lineno=55, col_offset=31, end_lineno=55, end_col_offset=49), lineno=55, col_offset=25, end_lineno=55, end_col_offset=49), lineno=55, col_offset=16, end_lineno=55, end_col_offset=49), Expr(Call(Attribute(Name('placeholder_11', Load(), lineno=56, col_offset=16, end_lineno=56, end_col_offset=30), 'append', Load(), lineno=56, col_offset=16, end_lineno=56, end_col_offset=37), [Tuple([Name('placeholder_17', Load(), lineno=56, col_offset=39, end_lineno=56, end_col_offset=45), BinOp(Name('placeholder_14', Load(), lineno=56, col_offset=47, end_lineno=56, end_col_offset=54), Sub(), Call(Name('set', Load(), lineno=56, col_offset=57, end_lineno=56, end_col_offset=60), [List([Name('placeholder_16', Load(), lineno=56, col_offset=62, end_lineno=56, end_col_offset=66)], Load(), lineno=56, col_offset=61, end_lineno=56, end_col_offset=67)], [], lineno=56, col_offset=57, end_lineno=56, end_col_offset=68), lineno=56, col_offset=47, end_lineno=56, end_col_offset=68)], Load(), lineno=56, col_offset=38, end_lineno=56, end_col_offset=69)], [], lineno=56, col_offset=16, end_lineno=56, end_col_offset=70), lineno=56, col_offset=16, end_lineno=56, end_col_offset=70)], [], lineno=54, col_offset=12, end_lineno=56, end_col_offset=70)], [], lineno=45, col_offset=8, end_lineno=56, end_col_offset=70), Assign([Name('placeholder_8', Store(), lineno=58, col_offset=8, end_lineno=58, end_col_offset=18)], Name('placeholder_11', Load(), lineno=58, col_offset=21, end_lineno=58, end_col_offset=35), lineno=58, col_offset=8, end_lineno=58, end_col_offset=35), Assign([Name('placeholder_7', Store(), lineno=59, col_offset=8, end_lineno=59, end_col_offset=15)], Subscript(Name('placeholder_7', Load(), lineno=59, col_offset=18, end_lineno=59, end_col_offset=25), Slice(Constant(1, lineno=59, col_offset=26, end_lineno=59, end_col_offset=27), lineno=59, col_offset=26, end_lineno=59, end_col_offset=28), Load(), lineno=59, col_offset=18, end_lineno=59, end_col_offset=29), lineno=59, col_offset=8, end_lineno=59, end_col_offset=29)], [], lineno=42, col_offset=4, end_lineno=59, end_col_offset=29), Return(ListComp(Name('placeholder_13', Load(), lineno=60, col_offset=12, end_lineno=60, end_col_offset=15), [comprehension(Tuple([Name('placeholder_13', Store(), lineno=60, col_offset=20, end_lineno=60, end_col_offset=23), Name('placeholder_18', Store(), lineno=60, col_offset=25, end_lineno=60, end_col_offset=26)], Store(), lineno=60, col_offset=20, end_lineno=60, end_col_offset=26), Name('placeholder_8', Load(), lineno=60, col_offset=30, end_lineno=60, end_col_offset=40), [], 0)], lineno=60, col_offset=11, end_lineno=60, end_col_offset=41), lineno=60, col_offset=4, end_lineno=60, end_col_offset=41)], [], lineno=41, col_offset=0, end_lineno=60, end_col_offset=41), Expr(Constant('\n This exmple comes from ChatGPT\n Prompt: Write a python function that \n reads user settings from a toml file and \n merges them with a dictionary of default \n settings to create a single dictionary. \n If there are any conflicts between the \n two sources of settings, the data from \n the toml file should be used.\n', lineno=66, col_offset=0, end_lineno=75, end_col_offset=3), lineno=66, col_offset=0, end_lineno=75, end_col_offset=3), Import([alias('tomlib', lineno=76, col_offset=7, end_lineno=76, end_col_offset=13)], lineno=76, col_offset=0, end_lineno=76, end_col_offset=13), FunctionDef('placeholder_19', arguments([], [arg('placeholder_20', lineno=78, col_offset=19, end_lineno=78, end_col_offset=35), arg('placeholder_21', lineno=78, col_offset=37, end_lineno=78, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], defaults=[]), [With([withitem(Call(Name('open', Load(), lineno=80, col_offset=9, end_lineno=80, end_col_offset=13), [Name('placeholder_21', Load(), lineno=80, col_offset=14, end_lineno=80, end_col_offset=28), Constant('r', lineno=80, col_offset=30, end_lineno=80, end_col_offset=33)], [], lineno=80, col_offset=9, end_lineno=80, end_col_offset=34), Name('placeholder_22', Store(), lineno=80, col_offset=38, end_lineno=80, end_col_offset=39))], [Assign([Name('placeholder_23', Store(), lineno=81, col_offset=8, end_lineno=81, end_col_offset=21)], Call(Attribute(Name('tomlib', Load(), lineno=81, col_offset=24, end_lineno=81, end_col_offset=30), 'load', Load(), lineno=81, col_offset=24, end_lineno=81, end_col_offset=35), [Name('placeholder_22', Load(), lineno=81, col_offset=36, end_lineno=81, end_col_offset=37)], [], lineno=81, col_offset=24, end_lineno=81, end_col_offset=38), lineno=81, col_offset=8, end_lineno=81, end_col_offset=38)], lineno=80, col_offset=4, end_lineno=81, end_col_offset=38), Assign([Name('placeholder_24', Store(), lineno=84, col_offset=4, end_lineno=84, end_col_offset=19)], BinOp(Call(Name('dict', Load(), lineno=84, col_offset=22, end_lineno=84, end_col_offset=26), [Name('placeholder_20', Load(), lineno=84, col_offset=27, end_lineno=84, end_col_offset=43)], [], lineno=84, col_offset=22, end_lineno=84, end_col_offset=44), BitOr(), Call(Name('dict', Load(), lineno=84, col_offset=47, end_lineno=84, end_col_offset=51), [Name('placeholder_23', Load(), lineno=84, col_offset=52, end_lineno=84, end_col_offset=65)], [], lineno=84, col_offset=47, end_lineno=84, end_col_offset=66), lineno=84, col_offset=22, end_lineno=84, end_col_offset=66), lineno=84, col_offset=4, end_lineno=84, end_col_offset=66), Return(Name('placeholder_24', Load(), lineno=86, col_offset=11, end_lineno=86, end_col_offset=26), lineno=86, col_offset=4, end_lineno=86, end_col_offset=26)], [], lineno=78, col_offset=0, end_lineno=86, end_col_offset=26), Assign([Name('placeholder_20', Store(), lineno=89, col_offset=0, end_lineno=89, end_col_offset=16)], Dict([Constant('timeout', lineno=90, col_offset=4, end_lineno=90, end_col_offset=13), Constant('retry_count', lineno=91, col_offset=4, end_lineno=91, end_col_offset=17), Constant('log_level', lineno=92, col_offset=4, end_lineno=92, end_col_offset=15)], [Constant(30, lineno=90, col_offset=15, end_lineno=90, end_col_offset=17), Constant(3, lineno=91, col_offset=19, end_lineno=91, end_col_offset=20), Constant('INFO', lineno=92, col_offset=17, end_lineno=92, end_col_offset=23)], lineno=89, col_offset=19, end_lineno=93, end_col_offset=1), lineno=89, col_offset=0, end_lineno=93, end_col_offset=1), Assign([Name('placeholder_21', Store(), lineno=94, col_offset=0, end_lineno=94, end_col_offset=14)], Constant('settings.toml', lineno=94, col_offset=17, end_lineno=94, end_col_offset=32), lineno=94, col_offset=0, end_lineno=94, end_col_offset=32), Assign([Name('placeholder_25', Store(), lineno=96, col_offset=0, end_lineno=96, end_col_offset=14)], Call(Name('placeholder_19', Load(), lineno=96, col_offset=17, end_lineno=96, end_col_offset=31), [Name('placeholder_20', Load(), lineno=96, col_offset=32, end_lineno=96, end_col_offset=48), Name('placeholder_21', Load(), lineno=96, col_offset=50, end_lineno=96, end_col_offset=64)], [], lineno=96, col_offset=17, end_lineno=96, end_col_offset=65), lineno=96, col_offset=0, end_lineno=96, end_col_offset=65)], []) \ No newline at end of file +Module([FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=13, col_offset=25, end_lineno=13, end_col_offset=30), arg('placeholder_2', lineno=13, col_offset=32, end_lineno=13, end_col_offset=46)], kwonlyargs=[], kw_defaults=[], defaults=[]), [AugAssign(Name('placeholder_1', Store(), lineno=25, col_offset=4, end_lineno=25, end_col_offset=9), BitOr(), Name('placeholder_2', Load(), lineno=25, col_offset=13, end_lineno=25, end_col_offset=27), lineno=25, col_offset=4, end_lineno=25, end_col_offset=27), Return(Name('placeholder_1', Load(), lineno=26, col_offset=11, end_lineno=26, end_col_offset=16), lineno=26, col_offset=4, end_lineno=26, end_col_offset=16)], [], lineno=13, col_offset=0, end_lineno=26, end_col_offset=16), FunctionDef('placeholder_3', arguments([], [arg('placeholder_1', lineno=29, col_offset=24, end_lineno=29, end_col_offset=29), arg('placeholder_2', lineno=29, col_offset=31, end_lineno=29, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(BinOp(Call(Name('dict', Load(), lineno=39, col_offset=11, end_lineno=39, end_col_offset=15), [Name('placeholder_1', Load(), lineno=39, col_offset=16, end_lineno=39, end_col_offset=21)], [], lineno=39, col_offset=11, end_lineno=39, end_col_offset=22), BitOr(), Call(Name('dict', Load(), lineno=39, col_offset=25, end_lineno=39, end_col_offset=29), [Name('placeholder_2', Load(), lineno=39, col_offset=30, end_lineno=39, end_col_offset=44)], [], lineno=39, col_offset=25, end_lineno=39, end_col_offset=45), lineno=39, col_offset=11, end_lineno=39, end_col_offset=45), lineno=39, col_offset=4, end_lineno=39, end_col_offset=45)], [], lineno=29, col_offset=0, end_lineno=39, end_col_offset=45), Assign([Name('placeholder_1', Store(), lineno=42, col_offset=0, end_lineno=42, end_col_offset=5)], Dict([Constant('Banana Bread', lineno=42, col_offset=10, end_lineno=42, end_col_offset=24)], [Dict([Constant('Banana', lineno=42, col_offset=28, end_lineno=42, end_col_offset=36), Constant('Apple', lineno=42, col_offset=41, end_lineno=42, end_col_offset=48), Constant('Walnuts', lineno=42, col_offset=53, end_lineno=42, end_col_offset=62), Constant('Flour', lineno=42, col_offset=67, end_lineno=42, end_col_offset=74), Constant('Eggs', lineno=42, col_offset=79, end_lineno=42, end_col_offset=85), Constant('Butter', lineno=42, col_offset=90, end_lineno=42, end_col_offset=98)], [Constant(1, lineno=42, col_offset=38, end_lineno=42, end_col_offset=39), Constant(1, lineno=42, col_offset=50, end_lineno=42, end_col_offset=51), Constant(1, lineno=42, col_offset=64, end_lineno=42, end_col_offset=65), Constant(1, lineno=42, col_offset=76, end_lineno=42, end_col_offset=77), Constant(2, lineno=42, col_offset=87, end_lineno=42, end_col_offset=88), Constant(1, lineno=42, col_offset=100, end_lineno=42, end_col_offset=101)], lineno=42, col_offset=27, end_lineno=42, end_col_offset=102)], lineno=42, col_offset=9, end_lineno=42, end_col_offset=103), lineno=42, col_offset=0, end_lineno=42, end_col_offset=103), Assign([Name('placeholder_4', Store(), lineno=44, col_offset=0, end_lineno=44, end_col_offset=20)], Tuple([Tuple([Constant('Banana Bread', lineno=44, col_offset=24, end_lineno=44, end_col_offset=38), Dict([Constant('Banana', lineno=44, col_offset=41, end_lineno=44, end_col_offset=49), Constant('Walnuts', lineno=44, col_offset=55, end_lineno=44, end_col_offset=64), Constant('Flour', lineno=44, col_offset=69, end_lineno=44, end_col_offset=76), Constant('Eggs', lineno=44, col_offset=81, end_lineno=44, end_col_offset=87), Constant('Butter', lineno=44, col_offset=92, end_lineno=44, end_col_offset=100), Constant('Milk', lineno=44, col_offset=105, end_lineno=44, end_col_offset=111), Constant('Eggs', lineno=44, col_offset=116, end_lineno=44, end_col_offset=122)], [Constant(4, lineno=44, col_offset=51, end_lineno=44, end_col_offset=52), Constant(2, lineno=44, col_offset=66, end_lineno=44, end_col_offset=67), Constant(1, lineno=44, col_offset=78, end_lineno=44, end_col_offset=79), Constant(2, lineno=44, col_offset=89, end_lineno=44, end_col_offset=90), Constant(1, lineno=44, col_offset=102, end_lineno=44, end_col_offset=103), Constant(2, lineno=44, col_offset=113, end_lineno=44, end_col_offset=114), Constant(3, lineno=44, col_offset=124, end_lineno=44, end_col_offset=125)], lineno=44, col_offset=40, end_lineno=44, end_col_offset=126)], Load(), lineno=44, col_offset=23, end_lineno=44, end_col_offset=127)], Load(), lineno=44, col_offset=22, end_lineno=44, end_col_offset=129), lineno=44, col_offset=0, end_lineno=44, end_col_offset=129), Assign([Name('placeholder_5', Store(), lineno=46, col_offset=0, end_lineno=46, end_col_offset=18)], Dict([Constant('Banana Bread', lineno=46, col_offset=21, end_lineno=46, end_col_offset=35)], [Dict([Constant('Banana', lineno=46, col_offset=38, end_lineno=46, end_col_offset=46), Constant('Walnuts', lineno=46, col_offset=52, end_lineno=46, end_col_offset=61), Constant('Flour', lineno=46, col_offset=66, end_lineno=46, end_col_offset=73), Constant('Eggs', lineno=46, col_offset=78, end_lineno=46, end_col_offset=84), Constant('Butter', lineno=46, col_offset=89, end_lineno=46, end_col_offset=97), Constant('Milk', lineno=46, col_offset=102, end_lineno=46, end_col_offset=108), Constant('Eggs', lineno=46, col_offset=113, end_lineno=46, end_col_offset=119)], [Constant(4, lineno=46, col_offset=48, end_lineno=46, end_col_offset=49), Constant(2, lineno=46, col_offset=63, end_lineno=46, end_col_offset=64), Constant(1, lineno=46, col_offset=75, end_lineno=46, end_col_offset=76), Constant(2, lineno=46, col_offset=86, end_lineno=46, end_col_offset=87), Constant(1, lineno=46, col_offset=99, end_lineno=46, end_col_offset=100), Constant(2, lineno=46, col_offset=110, end_lineno=46, end_col_offset=111), Constant(3, lineno=46, col_offset=121, end_lineno=46, end_col_offset=122)], lineno=46, col_offset=37, end_lineno=46, end_col_offset=123)], lineno=46, col_offset=20, end_lineno=46, end_col_offset=124), lineno=46, col_offset=0, end_lineno=46, end_col_offset=124), Expr(Call(Name('placeholder_0', Load(), lineno=48, col_offset=0, end_lineno=48, end_col_offset=20), [Name('placeholder_1', Load(), lineno=48, col_offset=21, end_lineno=48, end_col_offset=26), Name('placeholder_4', Load(), lineno=48, col_offset=28, end_lineno=48, end_col_offset=48)], [], lineno=48, col_offset=0, end_lineno=48, end_col_offset=49), lineno=48, col_offset=0, end_lineno=48, end_col_offset=49), Expr(Call(Name('placeholder_3', Load(), lineno=51, col_offset=0, end_lineno=51, end_col_offset=19), [Name('placeholder_1', Load(), lineno=51, col_offset=20, end_lineno=51, end_col_offset=25), Name('placeholder_5', Load(), lineno=51, col_offset=27, end_lineno=51, end_col_offset=45)], [], lineno=51, col_offset=0, end_lineno=51, end_col_offset=46), lineno=51, col_offset=0, end_lineno=51, end_col_offset=46), FunctionDef('placeholder_6', arguments([], [arg('placeholder_7', lineno=55, col_offset=11, end_lineno=55, end_col_offset=18), arg('placeholder_8', lineno=55, col_offset=20, end_lineno=55, end_col_offset=30), arg('placeholder_9', lineno=55, col_offset=32, end_lineno=55, end_col_offset=37), arg('placeholder_10', lineno=55, col_offset=39, end_lineno=55, end_col_offset=45)], kwonlyargs=[], kw_defaults=[], defaults=[]), [While(Name('placeholder_7', Load(), lineno=58, col_offset=10, end_lineno=58, end_col_offset=17), [Assign([Name('placeholder_11', Store(), lineno=59, col_offset=8, end_lineno=59, end_col_offset=22)], List([], Load(), lineno=59, col_offset=25, end_lineno=59, end_col_offset=27), lineno=59, col_offset=8, end_lineno=59, end_col_offset=27), For(Name('placeholder_12', Store(), lineno=61, col_offset=12, end_lineno=61, end_col_offset=21), Name('placeholder_8', Load(), lineno=61, col_offset=25, end_lineno=61, end_col_offset=35), [Assign([Tuple([Name('placeholder_13', Store(), lineno=62, col_offset=12, end_lineno=62, end_col_offset=15), Name('placeholder_14', Store(), lineno=62, col_offset=17, end_lineno=62, end_col_offset=24)], Store(), lineno=62, col_offset=12, end_lineno=62, end_col_offset=24)], Name('placeholder_12', Load(), lineno=62, col_offset=27, end_lineno=62, end_col_offset=36), lineno=62, col_offset=12, end_lineno=62, end_col_offset=36), If(Compare(Subscript(Name('placeholder_7', Load(), lineno=64, col_offset=15, end_lineno=64, end_col_offset=22), Constant(0, lineno=64, col_offset=23, end_lineno=64, end_col_offset=24), Load(), lineno=64, col_offset=15, end_lineno=64, end_col_offset=25), [In()], [List([Name('placeholder_9', Load(), lineno=64, col_offset=30, end_lineno=64, end_col_offset=35), Name('placeholder_10', Load(), lineno=64, col_offset=37, end_lineno=64, end_col_offset=43)], Load(), lineno=64, col_offset=29, end_lineno=64, end_col_offset=44)], lineno=64, col_offset=15, end_lineno=64, end_col_offset=44), [Assign([Name('placeholder_15', Store(), lineno=65, col_offset=16, end_lineno=65, end_col_offset=28)], BinOp(Name('placeholder_14', Load(), lineno=65, col_offset=31, end_lineno=65, end_col_offset=38), Sub(), Call(Name('set', Load(), lineno=65, col_offset=41, end_lineno=65, end_col_offset=44), [List([Constant(0, lineno=65, col_offset=46, end_lineno=65, end_col_offset=47)], Load(), lineno=65, col_offset=45, end_lineno=65, end_col_offset=48)], [], lineno=65, col_offset=41, end_lineno=65, end_col_offset=49), lineno=65, col_offset=31, end_lineno=65, end_col_offset=49), lineno=65, col_offset=16, end_lineno=65, end_col_offset=49)], [Assign([Name('placeholder_15', Store(), lineno=68, col_offset=16, end_lineno=68, end_col_offset=28)], Name('placeholder_14', Load(), lineno=68, col_offset=31, end_lineno=68, end_col_offset=38), lineno=68, col_offset=16, end_lineno=68, end_col_offset=38)], lineno=64, col_offset=12, end_lineno=68, end_col_offset=38), For(Name('placeholder_16', Store(), lineno=70, col_offset=16, end_lineno=70, end_col_offset=20), Name('placeholder_15', Load(), lineno=70, col_offset=24, end_lineno=70, end_col_offset=36), [Assign([Name('placeholder_17', Store(), lineno=71, col_offset=16, end_lineno=71, end_col_offset=22)], BinOp(Name('placeholder_13', Load(), lineno=71, col_offset=25, end_lineno=71, end_col_offset=28), BitOr(), Dict([Subscript(Name('placeholder_7', Load(), lineno=71, col_offset=32, end_lineno=71, end_col_offset=39), Constant(0, lineno=71, col_offset=40, end_lineno=71, end_col_offset=41), Load(), lineno=71, col_offset=32, end_lineno=71, end_col_offset=42)], [Name('placeholder_16', Load(), lineno=71, col_offset=44, end_lineno=71, end_col_offset=48)], lineno=71, col_offset=31, end_lineno=71, end_col_offset=49), lineno=71, col_offset=25, end_lineno=71, end_col_offset=49), lineno=71, col_offset=16, end_lineno=71, end_col_offset=49), Expr(Call(Attribute(Name('placeholder_11', Load(), lineno=72, col_offset=16, end_lineno=72, end_col_offset=30), 'append', Load(), lineno=72, col_offset=16, end_lineno=72, end_col_offset=37), [Tuple([Name('placeholder_17', Load(), lineno=72, col_offset=39, end_lineno=72, end_col_offset=45), BinOp(Name('placeholder_14', Load(), lineno=72, col_offset=47, end_lineno=72, end_col_offset=54), Sub(), Call(Name('set', Load(), lineno=72, col_offset=57, end_lineno=72, end_col_offset=60), [List([Name('placeholder_16', Load(), lineno=72, col_offset=62, end_lineno=72, end_col_offset=66)], Load(), lineno=72, col_offset=61, end_lineno=72, end_col_offset=67)], [], lineno=72, col_offset=57, end_lineno=72, end_col_offset=68), lineno=72, col_offset=47, end_lineno=72, end_col_offset=68)], Load(), lineno=72, col_offset=38, end_lineno=72, end_col_offset=69)], [], lineno=72, col_offset=16, end_lineno=72, end_col_offset=70), lineno=72, col_offset=16, end_lineno=72, end_col_offset=70)], [], lineno=70, col_offset=12, end_lineno=72, end_col_offset=70)], [], lineno=61, col_offset=8, end_lineno=72, end_col_offset=70), Assign([Name('placeholder_8', Store(), lineno=74, col_offset=8, end_lineno=74, end_col_offset=18)], Name('placeholder_11', Load(), lineno=74, col_offset=21, end_lineno=74, end_col_offset=35), lineno=74, col_offset=8, end_lineno=74, end_col_offset=35), Assign([Name('placeholder_7', Store(), lineno=75, col_offset=8, end_lineno=75, end_col_offset=15)], Subscript(Name('placeholder_7', Load(), lineno=75, col_offset=18, end_lineno=75, end_col_offset=25), Slice(Constant(1, lineno=75, col_offset=26, end_lineno=75, end_col_offset=27), lineno=75, col_offset=26, end_lineno=75, end_col_offset=28), Load(), lineno=75, col_offset=18, end_lineno=75, end_col_offset=29), lineno=75, col_offset=8, end_lineno=75, end_col_offset=29)], [], lineno=58, col_offset=4, end_lineno=75, end_col_offset=29), Return(ListComp(Name('placeholder_13', Load(), lineno=76, col_offset=12, end_lineno=76, end_col_offset=15), [comprehension(Tuple([Name('placeholder_13', Store(), lineno=76, col_offset=20, end_lineno=76, end_col_offset=23), Name('placeholder_18', Store(), lineno=76, col_offset=25, end_lineno=76, end_col_offset=26)], Store(), lineno=76, col_offset=20, end_lineno=76, end_col_offset=26), Name('placeholder_8', Load(), lineno=76, col_offset=30, end_lineno=76, end_col_offset=40), [], 0)], lineno=76, col_offset=11, end_lineno=76, end_col_offset=41), lineno=76, col_offset=4, end_lineno=76, end_col_offset=41)], [], lineno=55, col_offset=0, end_lineno=76, end_col_offset=41), Import([alias('tomlib', lineno=79, col_offset=7, end_lineno=79, end_col_offset=13)], lineno=79, col_offset=0, end_lineno=79, end_col_offset=13), FunctionDef('placeholder_19', arguments([], [arg('placeholder_20', lineno=81, col_offset=19, end_lineno=81, end_col_offset=35), arg('placeholder_21', lineno=81, col_offset=37, end_lineno=81, end_col_offset=51)], kwonlyargs=[], kw_defaults=[], defaults=[]), [With([withitem(Call(Name('open', Load(), lineno=83, col_offset=9, end_lineno=83, end_col_offset=13), [Name('placeholder_21', Load(), lineno=83, col_offset=14, end_lineno=83, end_col_offset=28), Constant('r', lineno=83, col_offset=30, end_lineno=83, end_col_offset=33)], [], lineno=83, col_offset=9, end_lineno=83, end_col_offset=34), Name('placeholder_22', Store(), lineno=83, col_offset=38, end_lineno=83, end_col_offset=39))], [Assign([Name('placeholder_23', Store(), lineno=84, col_offset=8, end_lineno=84, end_col_offset=21)], Call(Attribute(Name('tomlib', Load(), lineno=84, col_offset=24, end_lineno=84, end_col_offset=30), 'load', Load(), lineno=84, col_offset=24, end_lineno=84, end_col_offset=35), [Name('placeholder_22', Load(), lineno=84, col_offset=36, end_lineno=84, end_col_offset=37)], [], lineno=84, col_offset=24, end_lineno=84, end_col_offset=38), lineno=84, col_offset=8, end_lineno=84, end_col_offset=38)], lineno=83, col_offset=4, end_lineno=84, end_col_offset=38), Assign([Name('placeholder_24', Store(), lineno=87, col_offset=4, end_lineno=87, end_col_offset=19)], BinOp(Call(Name('dict', Load(), lineno=87, col_offset=22, end_lineno=87, end_col_offset=26), [Name('placeholder_20', Load(), lineno=87, col_offset=27, end_lineno=87, end_col_offset=43)], [], lineno=87, col_offset=22, end_lineno=87, end_col_offset=44), BitOr(), Call(Name('dict', Load(), lineno=87, col_offset=47, end_lineno=87, end_col_offset=51), [Name('placeholder_23', Load(), lineno=87, col_offset=52, end_lineno=87, end_col_offset=65)], [], lineno=87, col_offset=47, end_lineno=87, end_col_offset=66), lineno=87, col_offset=22, end_lineno=87, end_col_offset=66), lineno=87, col_offset=4, end_lineno=87, end_col_offset=66), Return(Name('placeholder_24', Load(), lineno=89, col_offset=11, end_lineno=89, end_col_offset=26), lineno=89, col_offset=4, end_lineno=89, end_col_offset=26)], [], lineno=81, col_offset=0, end_lineno=89, end_col_offset=26), Assign([Name('placeholder_20', Store(), lineno=92, col_offset=0, end_lineno=92, end_col_offset=16)], Dict([Constant('timeout', lineno=93, col_offset=4, end_lineno=93, end_col_offset=13), Constant('retry_count', lineno=94, col_offset=4, end_lineno=94, end_col_offset=17), Constant('log_level', lineno=95, col_offset=4, end_lineno=95, end_col_offset=15)], [Constant(30, lineno=93, col_offset=15, end_lineno=93, end_col_offset=17), Constant(3, lineno=94, col_offset=19, end_lineno=94, end_col_offset=20), Constant('INFO', lineno=95, col_offset=17, end_lineno=95, end_col_offset=23)], lineno=92, col_offset=19, end_lineno=96, end_col_offset=1), lineno=92, col_offset=0, end_lineno=96, end_col_offset=1), Assign([Name('placeholder_21', Store(), lineno=97, col_offset=0, end_lineno=97, end_col_offset=14)], Constant('settings.toml', lineno=97, col_offset=17, end_lineno=97, end_col_offset=32), lineno=97, col_offset=0, end_lineno=97, end_col_offset=32), Assign([Name('placeholder_25', Store(), lineno=99, col_offset=0, end_lineno=99, end_col_offset=14)], Call(Name('placeholder_19', Load(), lineno=99, col_offset=17, end_lineno=99, end_col_offset=31), [Name('placeholder_20', Load(), lineno=99, col_offset=32, end_lineno=99, end_col_offset=48), Name('placeholder_21', Load(), lineno=99, col_offset=50, end_lineno=99, end_col_offset=64)], [], lineno=99, col_offset=17, end_lineno=99, end_col_offset=65), lineno=99, col_offset=0, end_lineno=99, end_col_offset=65)], []) \ No newline at end of file From 0365f28cca9b40316a68849a3c32104f3cadb304 Mon Sep 17 00:00:00 2001 From: brocla Date: Sat, 9 Mar 2024 22:20:05 -0700 Subject: [PATCH 07/14] Add test for Parenthesized Context Mgr - this is a new python feature in 3.10 --- .../.meta/config.json | 10 + .../example_parencontext_normalization.py | 72 + .../mapping.json | 11 + .../representation.json | 3 + .../representation.out | 1410 +++++++++++++++++ .../representation.txt | 1 + 6 files changed, 1507 insertions(+) create mode 100644 test/example-parencontext-normalization/.meta/config.json create mode 100644 test/example-parencontext-normalization/example_parencontext_normalization.py create mode 100644 test/example-parencontext-normalization/mapping.json create mode 100644 test/example-parencontext-normalization/representation.json create mode 100644 test/example-parencontext-normalization/representation.out create mode 100644 test/example-parencontext-normalization/representation.txt diff --git a/test/example-parencontext-normalization/.meta/config.json b/test/example-parencontext-normalization/.meta/config.json new file mode 100644 index 0000000..fe7f9c6 --- /dev/null +++ b/test/example-parencontext-normalization/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [ + "brocla" + ], + "files": { + "solution": [ + "example_parencontext_normalization.py" + ] + } +} \ No newline at end of file diff --git a/test/example-parencontext-normalization/example_parencontext_normalization.py b/test/example-parencontext-normalization/example_parencontext_normalization.py new file mode 100644 index 0000000..fb670c4 --- /dev/null +++ b/test/example-parencontext-normalization/example_parencontext_normalization.py @@ -0,0 +1,72 @@ +"""Examples of Parenthesized Context Managers. New feature in Python 3.10""" + + +#!/usr/bin/python3 +"""convert json to jsonl""" + +from argparse import ArgumentParser +import json + +def main(): + args = parse_args() + + # Context Mgrs + with ( + open(args.in_filename) as in_file, + open(args.out_filename, mode="wt") as out_file, + ): + records = json.load(in_file) + for record in records: + out_file.write(json.dumps(record) + "\n") + + +def parse_args(): + parser = ArgumentParser() + parser.add_argument("in_filename") + parser.add_argument("out_filename") + args = parser.parse_args() + return args + +if __name__ == "__main__": + main() + + + + + +# Examples from python docs +# https://docs.python.org/3/whatsnew/3.10.html#parenthesized-context-managers + + def CtxManager(): pass + def CtxManager1(): pass + def CtxManager2(): pass + def CtxManager3(): pass + + with (CtxManager() as example): + ... + + with ( + CtxManager1(), + CtxManager2() + ): + ... + + with (CtxManager1() as example, + CtxManager2()): + ... + + with (CtxManager1(), + CtxManager2() as example): + ... + + with ( + CtxManager1() as example1, + CtxManager2() as example2 + ): + ... + with ( + CtxManager1() as example1, + CtxManager2() as example2, + CtxManager3() as example3, + ): + ... \ No newline at end of file diff --git a/test/example-parencontext-normalization/mapping.json b/test/example-parencontext-normalization/mapping.json new file mode 100644 index 0000000..a048c72 --- /dev/null +++ b/test/example-parencontext-normalization/mapping.json @@ -0,0 +1,11 @@ +{ + "placeholder_0": "main", + "placeholder_1": "args", + "placeholder_2": "in_file", + "placeholder_3": "mode", + "placeholder_4": "out_file", + "placeholder_5": "records", + "placeholder_6": "record", + "placeholder_7": "parse_args", + "placeholder_8": "parser" +} \ No newline at end of file diff --git a/test/example-parencontext-normalization/representation.json b/test/example-parencontext-normalization/representation.json new file mode 100644 index 0000000..051b2b6 --- /dev/null +++ b/test/example-parencontext-normalization/representation.json @@ -0,0 +1,3 @@ +{ + "version": 2 +} \ No newline at end of file diff --git a/test/example-parencontext-normalization/representation.out b/test/example-parencontext-normalization/representation.out new file mode 100644 index 0000000..5c9319c --- /dev/null +++ b/test/example-parencontext-normalization/representation.out @@ -0,0 +1,1410 @@ +## BEGIN NORMALIZED CODE ## +"""convert json to jsonl""" +from argparse import ArgumentParser +import json + + +def placeholder_0(): + placeholder_1 = parse_args() + with open(placeholder_1.in_filename) as placeholder_2, open( + placeholder_1.out_filename, placeholder_3="wt" + ) as placeholder_4: + placeholder_5 = json.load(placeholder_2) + for placeholder_6 in placeholder_5: + placeholder_4.write(json.dumps(placeholder_6) + "\n") + + +def placeholder_7(): + placeholder_8 = ArgumentParser() + placeholder_8.add_argument("in_filename") + placeholder_8.add_argument("out_filename") + placeholder_1 = placeholder_8.placeholder_7() + return placeholder_1 + +## END NORMALIZED CODE ## + +## BEGIN TREE BEFORE ## +Module( + [ + Expr( + Constant( + 'Examples of Parenthesized Context Managers. New feature in Python 3.10', + lineno=1, + col_offset=0, + end_lineno=1, + end_col_offset=76), + lineno=1, + col_offset=0, + end_lineno=1, + end_col_offset=76), + Expr( + Constant( + 'convert json to jsonl', + lineno=5, + col_offset=0, + end_lineno=5, + end_col_offset=27), + lineno=5, + col_offset=0, + end_lineno=5, + end_col_offset=27), + ImportFrom( + 'argparse', + [ + alias( + 'ArgumentParser', + lineno=7, + col_offset=21, + end_lineno=7, + end_col_offset=35)], + 0, + lineno=7, + col_offset=0, + end_lineno=7, + end_col_offset=35), + Import( + [ + alias( + 'json', + lineno=8, + col_offset=7, + end_lineno=8, + end_col_offset=11)], + lineno=8, + col_offset=0, + end_lineno=8, + end_col_offset=11), + FunctionDef( + 'main', + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Assign( + [ + Name( + 'args', + Store(), + lineno=11, + col_offset=4, + end_lineno=11, + end_col_offset=8)], + Call( + Name( + 'parse_args', + Load(), + lineno=11, + col_offset=11, + end_lineno=11, + end_col_offset=21), + [], + [], + lineno=11, + col_offset=11, + end_lineno=11, + end_col_offset=23), + lineno=11, + col_offset=4, + end_lineno=11, + end_col_offset=23), + With( + [ + withitem( + Call( + Name( + 'open', + Load(), + lineno=15, + col_offset=8, + end_lineno=15, + end_col_offset=12), + [ + Attribute( + Name( + 'args', + Load(), + lineno=15, + col_offset=13, + end_lineno=15, + end_col_offset=17), + 'in_filename', + Load(), + lineno=15, + col_offset=13, + end_lineno=15, + end_col_offset=29)], + [], + lineno=15, + col_offset=8, + end_lineno=15, + end_col_offset=30), + Name( + 'in_file', + Store(), + lineno=15, + col_offset=34, + end_lineno=15, + end_col_offset=41)), + withitem( + Call( + Name( + 'open', + Load(), + lineno=16, + col_offset=8, + end_lineno=16, + end_col_offset=12), + [ + Attribute( + Name( + 'args', + Load(), + lineno=16, + col_offset=13, + end_lineno=16, + end_col_offset=17), + 'out_filename', + Load(), + lineno=16, + col_offset=13, + end_lineno=16, + end_col_offset=30)], + [ + keyword( + 'mode', + Constant( + 'wt', + lineno=16, + col_offset=37, + end_lineno=16, + end_col_offset=41), + lineno=16, + col_offset=32, + end_lineno=16, + end_col_offset=41)], + lineno=16, + col_offset=8, + end_lineno=16, + end_col_offset=42), + Name( + 'out_file', + Store(), + lineno=16, + col_offset=46, + end_lineno=16, + end_col_offset=54))], + [ + Assign( + [ + Name( + 'records', + Store(), + lineno=18, + col_offset=8, + end_lineno=18, + end_col_offset=15)], + Call( + Attribute( + Name( + 'json', + Load(), + lineno=18, + col_offset=18, + end_lineno=18, + end_col_offset=22), + 'load', + Load(), + lineno=18, + col_offset=18, + end_lineno=18, + end_col_offset=27), + [ + Name( + 'in_file', + Load(), + lineno=18, + col_offset=28, + end_lineno=18, + end_col_offset=35)], + [], + lineno=18, + col_offset=18, + end_lineno=18, + end_col_offset=36), + lineno=18, + col_offset=8, + end_lineno=18, + end_col_offset=36), + For( + Name( + 'record', + Store(), + lineno=19, + col_offset=12, + end_lineno=19, + end_col_offset=18), + Name( + 'records', + Load(), + lineno=19, + col_offset=22, + end_lineno=19, + end_col_offset=29), + [ + Expr( + Call( + Attribute( + Name( + 'out_file', + Load(), + lineno=20, + col_offset=12, + end_lineno=20, + end_col_offset=20), + 'write', + Load(), + lineno=20, + col_offset=12, + end_lineno=20, + end_col_offset=26), + [ + BinOp( + Call( + Attribute( + Name( + 'json', + Load(), + lineno=20, + col_offset=27, + end_lineno=20, + end_col_offset=31), + 'dumps', + Load(), + lineno=20, + col_offset=27, + end_lineno=20, + end_col_offset=37), + [ + Name( + 'record', + Load(), + lineno=20, + col_offset=38, + end_lineno=20, + end_col_offset=44)], + [], + lineno=20, + col_offset=27, + end_lineno=20, + end_col_offset=45), + Add(), + Constant( + '\n', + lineno=20, + col_offset=48, + end_lineno=20, + end_col_offset=52), + lineno=20, + col_offset=27, + end_lineno=20, + end_col_offset=52)], + [], + lineno=20, + col_offset=12, + end_lineno=20, + end_col_offset=53), + lineno=20, + col_offset=12, + end_lineno=20, + end_col_offset=53)], + [], + lineno=19, + col_offset=8, + end_lineno=20, + end_col_offset=53)], + lineno=14, + col_offset=4, + end_lineno=20, + end_col_offset=53)], + [], + lineno=10, + col_offset=0, + end_lineno=20, + end_col_offset=53), + FunctionDef( + 'parse_args', + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Assign( + [ + Name( + 'parser', + Store(), + lineno=24, + col_offset=4, + end_lineno=24, + end_col_offset=10)], + Call( + Name( + 'ArgumentParser', + Load(), + lineno=24, + col_offset=13, + end_lineno=24, + end_col_offset=27), + [], + [], + lineno=24, + col_offset=13, + end_lineno=24, + end_col_offset=29), + lineno=24, + col_offset=4, + end_lineno=24, + end_col_offset=29), + Expr( + Call( + Attribute( + Name( + 'parser', + Load(), + lineno=25, + col_offset=4, + end_lineno=25, + end_col_offset=10), + 'add_argument', + Load(), + lineno=25, + col_offset=4, + end_lineno=25, + end_col_offset=23), + [ + Constant( + 'in_filename', + lineno=25, + col_offset=24, + end_lineno=25, + end_col_offset=37)], + [], + lineno=25, + col_offset=4, + end_lineno=25, + end_col_offset=38), + lineno=25, + col_offset=4, + end_lineno=25, + end_col_offset=38), + Expr( + Call( + Attribute( + Name( + 'parser', + Load(), + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=10), + 'add_argument', + Load(), + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=23), + [ + Constant( + 'out_filename', + lineno=26, + col_offset=24, + end_lineno=26, + end_col_offset=38)], + [], + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=39), + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=39), + Assign( + [ + Name( + 'args', + Store(), + lineno=27, + col_offset=4, + end_lineno=27, + end_col_offset=8)], + Call( + Attribute( + Name( + 'parser', + Load(), + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=17), + 'parse_args', + Load(), + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=28), + [], + [], + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=30), + lineno=27, + col_offset=4, + end_lineno=27, + end_col_offset=30), + Return( + Name( + 'args', + Load(), + lineno=28, + col_offset=11, + end_lineno=28, + end_col_offset=15), + lineno=28, + col_offset=4, + end_lineno=28, + end_col_offset=15)], + [], + lineno=23, + col_offset=0, + end_lineno=28, + end_col_offset=15), + If( + Compare( + Name( + '__name__', + Load(), + lineno=30, + col_offset=3, + end_lineno=30, + end_col_offset=11), + [ + Eq()], + [ + Constant( + '__main__', + lineno=30, + col_offset=15, + end_lineno=30, + end_col_offset=25)], + lineno=30, + col_offset=3, + end_lineno=30, + end_col_offset=25), + [ + Expr( + Call( + Name( + 'main', + Load(), + lineno=31, + col_offset=4, + end_lineno=31, + end_col_offset=8), + [], + [], + lineno=31, + col_offset=4, + end_lineno=31, + end_col_offset=10), + lineno=31, + col_offset=4, + end_lineno=31, + end_col_offset=10), + FunctionDef( + 'CtxManager', + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Pass( + lineno=40, + col_offset=22, + end_lineno=40, + end_col_offset=26)], + [], + lineno=40, + col_offset=4, + end_lineno=40, + end_col_offset=26), + FunctionDef( + 'CtxManager1', + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Pass( + lineno=41, + col_offset=23, + end_lineno=41, + end_col_offset=27)], + [], + lineno=41, + col_offset=4, + end_lineno=41, + end_col_offset=27), + FunctionDef( + 'CtxManager2', + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Pass( + lineno=42, + col_offset=23, + end_lineno=42, + end_col_offset=27)], + [], + lineno=42, + col_offset=4, + end_lineno=42, + end_col_offset=27), + FunctionDef( + 'CtxManager3', + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Pass( + lineno=43, + col_offset=23, + end_lineno=43, + end_col_offset=27)], + [], + lineno=43, + col_offset=4, + end_lineno=43, + end_col_offset=27), + With( + [ + withitem( + Call( + Name( + 'CtxManager', + Load(), + lineno=45, + col_offset=10, + end_lineno=45, + end_col_offset=20), + [], + [], + lineno=45, + col_offset=10, + end_lineno=45, + end_col_offset=22), + Name( + 'example', + Store(), + lineno=45, + col_offset=26, + end_lineno=45, + end_col_offset=33))], + [ + Expr( + Constant( + Ellipsis, + lineno=46, + col_offset=8, + end_lineno=46, + end_col_offset=11), + lineno=46, + col_offset=8, + end_lineno=46, + end_col_offset=11)], + lineno=45, + col_offset=4, + end_lineno=46, + end_col_offset=11), + With( + [ + withitem( + Call( + Name( + 'CtxManager1', + Load(), + lineno=49, + col_offset=8, + end_lineno=49, + end_col_offset=19), + [], + [], + lineno=49, + col_offset=8, + end_lineno=49, + end_col_offset=21)), + withitem( + Call( + Name( + 'CtxManager2', + Load(), + lineno=50, + col_offset=8, + end_lineno=50, + end_col_offset=19), + [], + [], + lineno=50, + col_offset=8, + end_lineno=50, + end_col_offset=21))], + [ + Expr( + Constant( + Ellipsis, + lineno=52, + col_offset=8, + end_lineno=52, + end_col_offset=11), + lineno=52, + col_offset=8, + end_lineno=52, + end_col_offset=11)], + lineno=48, + col_offset=4, + end_lineno=52, + end_col_offset=11), + With( + [ + withitem( + Call( + Name( + 'CtxManager1', + Load(), + lineno=54, + col_offset=10, + end_lineno=54, + end_col_offset=21), + [], + [], + lineno=54, + col_offset=10, + end_lineno=54, + end_col_offset=23), + Name( + 'example', + Store(), + lineno=54, + col_offset=27, + end_lineno=54, + end_col_offset=34)), + withitem( + Call( + Name( + 'CtxManager2', + Load(), + lineno=55, + col_offset=8, + end_lineno=55, + end_col_offset=19), + [], + [], + lineno=55, + col_offset=8, + end_lineno=55, + end_col_offset=21))], + [ + Expr( + Constant( + Ellipsis, + lineno=56, + col_offset=8, + end_lineno=56, + end_col_offset=11), + lineno=56, + col_offset=8, + end_lineno=56, + end_col_offset=11)], + lineno=54, + col_offset=4, + end_lineno=56, + end_col_offset=11), + With( + [ + withitem( + Call( + Name( + 'CtxManager1', + Load(), + lineno=58, + col_offset=10, + end_lineno=58, + end_col_offset=21), + [], + [], + lineno=58, + col_offset=10, + end_lineno=58, + end_col_offset=23)), + withitem( + Call( + Name( + 'CtxManager2', + Load(), + lineno=59, + col_offset=8, + end_lineno=59, + end_col_offset=19), + [], + [], + lineno=59, + col_offset=8, + end_lineno=59, + end_col_offset=21), + Name( + 'example', + Store(), + lineno=59, + col_offset=25, + end_lineno=59, + end_col_offset=32))], + [ + Expr( + Constant( + Ellipsis, + lineno=60, + col_offset=8, + end_lineno=60, + end_col_offset=11), + lineno=60, + col_offset=8, + end_lineno=60, + end_col_offset=11)], + lineno=58, + col_offset=4, + end_lineno=60, + end_col_offset=11), + With( + [ + withitem( + Call( + Name( + 'CtxManager1', + Load(), + lineno=63, + col_offset=8, + end_lineno=63, + end_col_offset=19), + [], + [], + lineno=63, + col_offset=8, + end_lineno=63, + end_col_offset=21), + Name( + 'example1', + Store(), + lineno=63, + col_offset=25, + end_lineno=63, + end_col_offset=33)), + withitem( + Call( + Name( + 'CtxManager2', + Load(), + lineno=64, + col_offset=8, + end_lineno=64, + end_col_offset=19), + [], + [], + lineno=64, + col_offset=8, + end_lineno=64, + end_col_offset=21), + Name( + 'example2', + Store(), + lineno=64, + col_offset=25, + end_lineno=64, + end_col_offset=33))], + [ + Expr( + Constant( + Ellipsis, + lineno=66, + col_offset=8, + end_lineno=66, + end_col_offset=11), + lineno=66, + col_offset=8, + end_lineno=66, + end_col_offset=11)], + lineno=62, + col_offset=4, + end_lineno=66, + end_col_offset=11), + With( + [ + withitem( + Call( + Name( + 'CtxManager1', + Load(), + lineno=68, + col_offset=8, + end_lineno=68, + end_col_offset=19), + [], + [], + lineno=68, + col_offset=8, + end_lineno=68, + end_col_offset=21), + Name( + 'example1', + Store(), + lineno=68, + col_offset=25, + end_lineno=68, + end_col_offset=33)), + withitem( + Call( + Name( + 'CtxManager2', + Load(), + lineno=69, + col_offset=8, + end_lineno=69, + end_col_offset=19), + [], + [], + lineno=69, + col_offset=8, + end_lineno=69, + end_col_offset=21), + Name( + 'example2', + Store(), + lineno=69, + col_offset=25, + end_lineno=69, + end_col_offset=33)), + withitem( + Call( + Name( + 'CtxManager3', + Load(), + lineno=70, + col_offset=8, + end_lineno=70, + end_col_offset=19), + [], + [], + lineno=70, + col_offset=8, + end_lineno=70, + end_col_offset=21), + Name( + 'example3', + Store(), + lineno=70, + col_offset=25, + end_lineno=70, + end_col_offset=33))], + [ + Expr( + Constant( + Ellipsis, + lineno=72, + col_offset=8, + end_lineno=72, + end_col_offset=11), + lineno=72, + col_offset=8, + end_lineno=72, + end_col_offset=11)], + lineno=67, + col_offset=4, + end_lineno=72, + end_col_offset=11)], + [], + lineno=30, + col_offset=0, + end_lineno=72, + end_col_offset=11)], + []) +## END TREE BEFORE ## + +## BEGIN NORMALIZED TREE ## +Module( + [ + Expr( + Constant( + 'convert json to jsonl', + lineno=5, + col_offset=0, + end_lineno=5, + end_col_offset=27), + lineno=5, + col_offset=0, + end_lineno=5, + end_col_offset=27), + ImportFrom( + 'argparse', + [ + alias( + 'ArgumentParser', + lineno=7, + col_offset=21, + end_lineno=7, + end_col_offset=35)], + 0, + lineno=7, + col_offset=0, + end_lineno=7, + end_col_offset=35), + Import( + [ + alias( + 'json', + lineno=8, + col_offset=7, + end_lineno=8, + end_col_offset=11)], + lineno=8, + col_offset=0, + end_lineno=8, + end_col_offset=11), + FunctionDef( + 'placeholder_0', + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Assign( + [ + Name( + 'placeholder_1', + Store(), + lineno=11, + col_offset=4, + end_lineno=11, + end_col_offset=8)], + Call( + Name( + 'parse_args', + Load(), + lineno=11, + col_offset=11, + end_lineno=11, + end_col_offset=21), + [], + [], + lineno=11, + col_offset=11, + end_lineno=11, + end_col_offset=23), + lineno=11, + col_offset=4, + end_lineno=11, + end_col_offset=23), + With( + [ + withitem( + Call( + Name( + 'open', + Load(), + lineno=15, + col_offset=8, + end_lineno=15, + end_col_offset=12), + [ + Attribute( + Name( + 'placeholder_1', + Load(), + lineno=15, + col_offset=13, + end_lineno=15, + end_col_offset=17), + 'in_filename', + Load(), + lineno=15, + col_offset=13, + end_lineno=15, + end_col_offset=29)], + [], + lineno=15, + col_offset=8, + end_lineno=15, + end_col_offset=30), + Name( + 'placeholder_2', + Store(), + lineno=15, + col_offset=34, + end_lineno=15, + end_col_offset=41)), + withitem( + Call( + Name( + 'open', + Load(), + lineno=16, + col_offset=8, + end_lineno=16, + end_col_offset=12), + [ + Attribute( + Name( + 'placeholder_1', + Load(), + lineno=16, + col_offset=13, + end_lineno=16, + end_col_offset=17), + 'out_filename', + Load(), + lineno=16, + col_offset=13, + end_lineno=16, + end_col_offset=30)], + [ + keyword( + 'placeholder_3', + Constant( + 'wt', + lineno=16, + col_offset=37, + end_lineno=16, + end_col_offset=41), + lineno=16, + col_offset=32, + end_lineno=16, + end_col_offset=41)], + lineno=16, + col_offset=8, + end_lineno=16, + end_col_offset=42), + Name( + 'placeholder_4', + Store(), + lineno=16, + col_offset=46, + end_lineno=16, + end_col_offset=54))], + [ + Assign( + [ + Name( + 'placeholder_5', + Store(), + lineno=18, + col_offset=8, + end_lineno=18, + end_col_offset=15)], + Call( + Attribute( + Name( + 'json', + Load(), + lineno=18, + col_offset=18, + end_lineno=18, + end_col_offset=22), + 'load', + Load(), + lineno=18, + col_offset=18, + end_lineno=18, + end_col_offset=27), + [ + Name( + 'placeholder_2', + Load(), + lineno=18, + col_offset=28, + end_lineno=18, + end_col_offset=35)], + [], + lineno=18, + col_offset=18, + end_lineno=18, + end_col_offset=36), + lineno=18, + col_offset=8, + end_lineno=18, + end_col_offset=36), + For( + Name( + 'placeholder_6', + Store(), + lineno=19, + col_offset=12, + end_lineno=19, + end_col_offset=18), + Name( + 'placeholder_5', + Load(), + lineno=19, + col_offset=22, + end_lineno=19, + end_col_offset=29), + [ + Expr( + Call( + Attribute( + Name( + 'placeholder_4', + Load(), + lineno=20, + col_offset=12, + end_lineno=20, + end_col_offset=20), + 'write', + Load(), + lineno=20, + col_offset=12, + end_lineno=20, + end_col_offset=26), + [ + BinOp( + Call( + Attribute( + Name( + 'json', + Load(), + lineno=20, + col_offset=27, + end_lineno=20, + end_col_offset=31), + 'dumps', + Load(), + lineno=20, + col_offset=27, + end_lineno=20, + end_col_offset=37), + [ + Name( + 'placeholder_6', + Load(), + lineno=20, + col_offset=38, + end_lineno=20, + end_col_offset=44)], + [], + lineno=20, + col_offset=27, + end_lineno=20, + end_col_offset=45), + Add(), + Constant( + '\n', + lineno=20, + col_offset=48, + end_lineno=20, + end_col_offset=52), + lineno=20, + col_offset=27, + end_lineno=20, + end_col_offset=52)], + [], + lineno=20, + col_offset=12, + end_lineno=20, + end_col_offset=53), + lineno=20, + col_offset=12, + end_lineno=20, + end_col_offset=53)], + [], + lineno=19, + col_offset=8, + end_lineno=20, + end_col_offset=53)], + lineno=14, + col_offset=4, + end_lineno=20, + end_col_offset=53)], + [], + lineno=10, + col_offset=0, + end_lineno=20, + end_col_offset=53), + FunctionDef( + 'placeholder_7', + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Assign( + [ + Name( + 'placeholder_8', + Store(), + lineno=24, + col_offset=4, + end_lineno=24, + end_col_offset=10)], + Call( + Name( + 'ArgumentParser', + Load(), + lineno=24, + col_offset=13, + end_lineno=24, + end_col_offset=27), + [], + [], + lineno=24, + col_offset=13, + end_lineno=24, + end_col_offset=29), + lineno=24, + col_offset=4, + end_lineno=24, + end_col_offset=29), + Expr( + Call( + Attribute( + Name( + 'placeholder_8', + Load(), + lineno=25, + col_offset=4, + end_lineno=25, + end_col_offset=10), + 'add_argument', + Load(), + lineno=25, + col_offset=4, + end_lineno=25, + end_col_offset=23), + [ + Constant( + 'in_filename', + lineno=25, + col_offset=24, + end_lineno=25, + end_col_offset=37)], + [], + lineno=25, + col_offset=4, + end_lineno=25, + end_col_offset=38), + lineno=25, + col_offset=4, + end_lineno=25, + end_col_offset=38), + Expr( + Call( + Attribute( + Name( + 'placeholder_8', + Load(), + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=10), + 'add_argument', + Load(), + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=23), + [ + Constant( + 'out_filename', + lineno=26, + col_offset=24, + end_lineno=26, + end_col_offset=38)], + [], + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=39), + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=39), + Assign( + [ + Name( + 'placeholder_1', + Store(), + lineno=27, + col_offset=4, + end_lineno=27, + end_col_offset=8)], + Call( + Attribute( + Name( + 'placeholder_8', + Load(), + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=17), + 'placeholder_7', + Load(), + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=28), + [], + [], + lineno=27, + col_offset=11, + end_lineno=27, + end_col_offset=30), + lineno=27, + col_offset=4, + end_lineno=27, + end_col_offset=30), + Return( + Name( + 'placeholder_1', + Load(), + lineno=28, + col_offset=11, + end_lineno=28, + end_col_offset=15), + lineno=28, + col_offset=4, + end_lineno=28, + end_col_offset=15)], + [], + lineno=23, + col_offset=0, + end_lineno=28, + end_col_offset=15)], + []) +## END NORMALIZED TREE ## \ No newline at end of file diff --git a/test/example-parencontext-normalization/representation.txt b/test/example-parencontext-normalization/representation.txt new file mode 100644 index 0000000..a540dba --- /dev/null +++ b/test/example-parencontext-normalization/representation.txt @@ -0,0 +1 @@ +Module([Expr(Constant('convert json to jsonl', lineno=5, col_offset=0, end_lineno=5, end_col_offset=27), lineno=5, col_offset=0, end_lineno=5, end_col_offset=27), ImportFrom('argparse', [alias('ArgumentParser', lineno=7, col_offset=21, end_lineno=7, end_col_offset=35)], 0, lineno=7, col_offset=0, end_lineno=7, end_col_offset=35), Import([alias('json', lineno=8, col_offset=7, end_lineno=8, end_col_offset=11)], lineno=8, col_offset=0, end_lineno=8, end_col_offset=11), FunctionDef('placeholder_0', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_1', Store(), lineno=11, col_offset=4, end_lineno=11, end_col_offset=8)], Call(Name('parse_args', Load(), lineno=11, col_offset=11, end_lineno=11, end_col_offset=21), [], [], lineno=11, col_offset=11, end_lineno=11, end_col_offset=23), lineno=11, col_offset=4, end_lineno=11, end_col_offset=23), With([withitem(Call(Name('open', Load(), lineno=15, col_offset=8, end_lineno=15, end_col_offset=12), [Attribute(Name('placeholder_1', Load(), lineno=15, col_offset=13, end_lineno=15, end_col_offset=17), 'in_filename', Load(), lineno=15, col_offset=13, end_lineno=15, end_col_offset=29)], [], lineno=15, col_offset=8, end_lineno=15, end_col_offset=30), Name('placeholder_2', Store(), lineno=15, col_offset=34, end_lineno=15, end_col_offset=41)), withitem(Call(Name('open', Load(), lineno=16, col_offset=8, end_lineno=16, end_col_offset=12), [Attribute(Name('placeholder_1', Load(), lineno=16, col_offset=13, end_lineno=16, end_col_offset=17), 'out_filename', Load(), lineno=16, col_offset=13, end_lineno=16, end_col_offset=30)], [keyword('placeholder_3', Constant('wt', lineno=16, col_offset=37, end_lineno=16, end_col_offset=41), lineno=16, col_offset=32, end_lineno=16, end_col_offset=41)], lineno=16, col_offset=8, end_lineno=16, end_col_offset=42), Name('placeholder_4', Store(), lineno=16, col_offset=46, end_lineno=16, end_col_offset=54))], [Assign([Name('placeholder_5', Store(), lineno=18, col_offset=8, end_lineno=18, end_col_offset=15)], Call(Attribute(Name('json', Load(), lineno=18, col_offset=18, end_lineno=18, end_col_offset=22), 'load', Load(), lineno=18, col_offset=18, end_lineno=18, end_col_offset=27), [Name('placeholder_2', Load(), lineno=18, col_offset=28, end_lineno=18, end_col_offset=35)], [], lineno=18, col_offset=18, end_lineno=18, end_col_offset=36), lineno=18, col_offset=8, end_lineno=18, end_col_offset=36), For(Name('placeholder_6', Store(), lineno=19, col_offset=12, end_lineno=19, end_col_offset=18), Name('placeholder_5', Load(), lineno=19, col_offset=22, end_lineno=19, end_col_offset=29), [Expr(Call(Attribute(Name('placeholder_4', Load(), lineno=20, col_offset=12, end_lineno=20, end_col_offset=20), 'write', Load(), lineno=20, col_offset=12, end_lineno=20, end_col_offset=26), [BinOp(Call(Attribute(Name('json', Load(), lineno=20, col_offset=27, end_lineno=20, end_col_offset=31), 'dumps', Load(), lineno=20, col_offset=27, end_lineno=20, end_col_offset=37), [Name('placeholder_6', Load(), lineno=20, col_offset=38, end_lineno=20, end_col_offset=44)], [], lineno=20, col_offset=27, end_lineno=20, end_col_offset=45), Add(), Constant('\n', lineno=20, col_offset=48, end_lineno=20, end_col_offset=52), lineno=20, col_offset=27, end_lineno=20, end_col_offset=52)], [], lineno=20, col_offset=12, end_lineno=20, end_col_offset=53), lineno=20, col_offset=12, end_lineno=20, end_col_offset=53)], [], lineno=19, col_offset=8, end_lineno=20, end_col_offset=53)], lineno=14, col_offset=4, end_lineno=20, end_col_offset=53)], [], lineno=10, col_offset=0, end_lineno=20, end_col_offset=53), FunctionDef('placeholder_7', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_8', Store(), lineno=24, col_offset=4, end_lineno=24, end_col_offset=10)], Call(Name('ArgumentParser', Load(), lineno=24, col_offset=13, end_lineno=24, end_col_offset=27), [], [], lineno=24, col_offset=13, end_lineno=24, end_col_offset=29), lineno=24, col_offset=4, end_lineno=24, end_col_offset=29), Expr(Call(Attribute(Name('placeholder_8', Load(), lineno=25, col_offset=4, end_lineno=25, end_col_offset=10), 'add_argument', Load(), lineno=25, col_offset=4, end_lineno=25, end_col_offset=23), [Constant('in_filename', lineno=25, col_offset=24, end_lineno=25, end_col_offset=37)], [], lineno=25, col_offset=4, end_lineno=25, end_col_offset=38), lineno=25, col_offset=4, end_lineno=25, end_col_offset=38), Expr(Call(Attribute(Name('placeholder_8', Load(), lineno=26, col_offset=4, end_lineno=26, end_col_offset=10), 'add_argument', Load(), lineno=26, col_offset=4, end_lineno=26, end_col_offset=23), [Constant('out_filename', lineno=26, col_offset=24, end_lineno=26, end_col_offset=38)], [], lineno=26, col_offset=4, end_lineno=26, end_col_offset=39), lineno=26, col_offset=4, end_lineno=26, end_col_offset=39), Assign([Name('placeholder_1', Store(), lineno=27, col_offset=4, end_lineno=27, end_col_offset=8)], Call(Attribute(Name('placeholder_8', Load(), lineno=27, col_offset=11, end_lineno=27, end_col_offset=17), 'placeholder_7', Load(), lineno=27, col_offset=11, end_lineno=27, end_col_offset=28), [], [], lineno=27, col_offset=11, end_lineno=27, end_col_offset=30), lineno=27, col_offset=4, end_lineno=27, end_col_offset=30), Return(Name('placeholder_1', Load(), lineno=28, col_offset=11, end_lineno=28, end_col_offset=15), lineno=28, col_offset=4, end_lineno=28, end_col_offset=15)], [], lineno=23, col_offset=0, end_lineno=28, end_col_offset=15)], []) \ No newline at end of file From a094c4a0dea9a00b8e3cb30550f4cc65761d9432 Mon Sep 17 00:00:00 2001 From: brocla Date: Tue, 19 Mar 2024 19:43:24 -0600 Subject: [PATCH 08/14] Add a second example of parens and Context Managers. - uses two copies of `localcontext` --- .../example_parencontext_normalization.py | 86 +- .../mapping.json | 28 +- .../representation.out | 1820 ++++++++++------- .../representation.txt | 2 +- 4 files changed, 1186 insertions(+), 750 deletions(-) diff --git a/test/example-parencontext-normalization/example_parencontext_normalization.py b/test/example-parencontext-normalization/example_parencontext_normalization.py index fb670c4..be4ddd1 100644 --- a/test/example-parencontext-normalization/example_parencontext_normalization.py +++ b/test/example-parencontext-normalization/example_parencontext_normalization.py @@ -1,6 +1,49 @@ """Examples of Parenthesized Context Managers. New feature in Python 3.10""" + +# This example shows parens around two `localcontext` context mangers. +"""Calculate the fixed interest rate.""" + +from decimal import ROUND_DOWN, ROUND_UP, Decimal, localcontext +import pandas as pd + + +def calc_fixed_rate(spot_price: pd.Series, position_duration: Decimal) -> pd.Series: + """Calculates the fixed rate given trade data. + + Arguments + --------- + spot_price: pd.Series + The spot price. + position_duration: Decimal + The position duration in seconds. + + Returns + ------- + pd.Series + The fixed interest rate. + """ + # Position duration (in seconds) in terms of fraction of year + # This div should round up + # This replicates div up in fixed point + with (localcontext() as ctx_time, + localcontext() as ctx_rate): + ctx_time.prec = 18 + ctx_time.rounding = ROUND_UP + + ctx_rate.prec = 12 + ctx_rate.rounding = ROUND_DOWN + + annualized_time = position_duration / Decimal(60 * 60 * 24 * 365) + fixed_rate = (1 - spot_price) / (spot_price * annualized_time) # type: ignore + return fixed_rate + + + + + +# This example shows a CLI that opens two files with context managers that are grouped by parens. #!/usr/bin/python3 """convert json to jsonl""" @@ -28,45 +71,4 @@ def parse_args(): return args if __name__ == "__main__": - main() - - - - - -# Examples from python docs -# https://docs.python.org/3/whatsnew/3.10.html#parenthesized-context-managers - - def CtxManager(): pass - def CtxManager1(): pass - def CtxManager2(): pass - def CtxManager3(): pass - - with (CtxManager() as example): - ... - - with ( - CtxManager1(), - CtxManager2() - ): - ... - - with (CtxManager1() as example, - CtxManager2()): - ... - - with (CtxManager1(), - CtxManager2() as example): - ... - - with ( - CtxManager1() as example1, - CtxManager2() as example2 - ): - ... - with ( - CtxManager1() as example1, - CtxManager2() as example2, - CtxManager3() as example3, - ): - ... \ No newline at end of file + main() \ No newline at end of file diff --git a/test/example-parencontext-normalization/mapping.json b/test/example-parencontext-normalization/mapping.json index a048c72..207d14d 100644 --- a/test/example-parencontext-normalization/mapping.json +++ b/test/example-parencontext-normalization/mapping.json @@ -1,11 +1,21 @@ { - "placeholder_0": "main", - "placeholder_1": "args", - "placeholder_2": "in_file", - "placeholder_3": "mode", - "placeholder_4": "out_file", - "placeholder_5": "records", - "placeholder_6": "record", - "placeholder_7": "parse_args", - "placeholder_8": "parser" + "placeholder_0": "pd", + "placeholder_1": "calc_fixed_rate", + "placeholder_2": "spot_price", + "placeholder_3": "position_duration", + "placeholder_4": "ctx_time", + "placeholder_5": "ctx_rate", + "placeholder_6": "prec", + "placeholder_7": "rounding", + "placeholder_8": "annualized_time", + "placeholder_9": "fixed_rate", + "placeholder_10": "main", + "placeholder_11": "args", + "placeholder_12": "in_file", + "placeholder_13": "mode", + "placeholder_14": "out_file", + "placeholder_15": "records", + "placeholder_16": "record", + "placeholder_17": "parse_args", + "placeholder_18": "parser" } \ No newline at end of file diff --git a/test/example-parencontext-normalization/representation.out b/test/example-parencontext-normalization/representation.out index 5c9319c..2b63791 100644 --- a/test/example-parencontext-normalization/representation.out +++ b/test/example-parencontext-normalization/representation.out @@ -1,25 +1,41 @@ ## BEGIN NORMALIZED CODE ## -"""convert json to jsonl""" +"""Calculate the fixed interest rate.""" +from decimal import ROUND_DOWN, ROUND_UP, Decimal, localcontext +import pandas as placeholder_0 + + +def placeholder_1(placeholder_2, placeholder_3): + with localcontext() as placeholder_4, localcontext() as placeholder_5: + placeholder_4.placeholder_6 = 18 + placeholder_4.placeholder_7 = ROUND_UP + placeholder_5.placeholder_6 = 12 + placeholder_5.placeholder_7 = ROUND_DOWN + placeholder_8 = placeholder_3 / Decimal(60 * 60 * 24 * 365) + placeholder_9 = (1 - placeholder_2) / (placeholder_2 * placeholder_8) + return placeholder_9 + + +"convert json to jsonl" from argparse import ArgumentParser import json -def placeholder_0(): - placeholder_1 = parse_args() - with open(placeholder_1.in_filename) as placeholder_2, open( - placeholder_1.out_filename, placeholder_3="wt" - ) as placeholder_4: - placeholder_5 = json.load(placeholder_2) - for placeholder_6 in placeholder_5: - placeholder_4.write(json.dumps(placeholder_6) + "\n") +def placeholder_10(): + placeholder_11 = parse_args() + with open(placeholder_11.in_filename) as placeholder_12, open( + placeholder_11.out_filename, placeholder_13="wt" + ) as placeholder_14: + placeholder_15 = json.load(placeholder_12) + for placeholder_16 in placeholder_15: + placeholder_14.write(json.dumps(placeholder_16) + "\n") -def placeholder_7(): - placeholder_8 = ArgumentParser() - placeholder_8.add_argument("in_filename") - placeholder_8.add_argument("out_filename") - placeholder_1 = placeholder_8.placeholder_7() - return placeholder_1 +def placeholder_17(): + placeholder_18 = ArgumentParser() + placeholder_18.add_argument("in_filename") + placeholder_18.add_argument("out_filename") + placeholder_11 = placeholder_18.placeholder_17() + return placeholder_11 ## END NORMALIZED CODE ## @@ -37,42 +53,479 @@ Module( col_offset=0, end_lineno=1, end_col_offset=76), + Expr( + Constant( + 'Calculate the fixed interest rate.', + lineno=6, + col_offset=0, + end_lineno=6, + end_col_offset=40), + lineno=6, + col_offset=0, + end_lineno=6, + end_col_offset=40), + ImportFrom( + 'decimal', + [ + alias( + 'ROUND_DOWN', + lineno=8, + col_offset=20, + end_lineno=8, + end_col_offset=30), + alias( + 'ROUND_UP', + lineno=8, + col_offset=32, + end_lineno=8, + end_col_offset=40), + alias( + 'Decimal', + lineno=8, + col_offset=42, + end_lineno=8, + end_col_offset=49), + alias( + 'localcontext', + lineno=8, + col_offset=51, + end_lineno=8, + end_col_offset=63)], + 0, + lineno=8, + col_offset=0, + end_lineno=8, + end_col_offset=63), + Import( + [ + alias( + 'pandas', + 'pd', + lineno=9, + col_offset=7, + end_lineno=9, + end_col_offset=19)], + lineno=9, + col_offset=0, + end_lineno=9, + end_col_offset=19), + FunctionDef( + 'calc_fixed_rate', + arguments( + [], + [ + arg( + 'spot_price', + Attribute( + Name( + 'pd', + Load(), + lineno=12, + col_offset=32, + end_lineno=12, + end_col_offset=34), + 'Series', + Load(), + lineno=12, + col_offset=32, + end_lineno=12, + end_col_offset=41), + lineno=12, + col_offset=20, + end_lineno=12, + end_col_offset=41), + arg( + 'position_duration', + Name( + 'Decimal', + Load(), + lineno=12, + col_offset=62, + end_lineno=12, + end_col_offset=69), + lineno=12, + col_offset=43, + end_lineno=12, + end_col_offset=69)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Expr( + Constant( + 'Calculates the fixed rate given trade data.\n\n Arguments\n ---------\n spot_price: pd.Series\n The spot price.\n position_duration: Decimal\n The position duration in seconds.\n\n Returns\n -------\n pd.Series\n The fixed interest rate.\n ', + lineno=13, + col_offset=4, + end_lineno=26, + end_col_offset=7), + lineno=13, + col_offset=4, + end_lineno=26, + end_col_offset=7), + With( + [ + withitem( + Call( + Name( + 'localcontext', + Load(), + lineno=30, + col_offset=10, + end_lineno=30, + end_col_offset=22), + [], + [], + lineno=30, + col_offset=10, + end_lineno=30, + end_col_offset=24), + Name( + 'ctx_time', + Store(), + lineno=30, + col_offset=28, + end_lineno=30, + end_col_offset=36)), + withitem( + Call( + Name( + 'localcontext', + Load(), + lineno=31, + col_offset=10, + end_lineno=31, + end_col_offset=22), + [], + [], + lineno=31, + col_offset=10, + end_lineno=31, + end_col_offset=24), + Name( + 'ctx_rate', + Store(), + lineno=31, + col_offset=28, + end_lineno=31, + end_col_offset=36))], + [ + Assign( + [ + Attribute( + Name( + 'ctx_time', + Load(), + lineno=32, + col_offset=8, + end_lineno=32, + end_col_offset=16), + 'prec', + Store(), + lineno=32, + col_offset=8, + end_lineno=32, + end_col_offset=21)], + Constant( + 18, + lineno=32, + col_offset=24, + end_lineno=32, + end_col_offset=26), + lineno=32, + col_offset=8, + end_lineno=32, + end_col_offset=26), + Assign( + [ + Attribute( + Name( + 'ctx_time', + Load(), + lineno=33, + col_offset=8, + end_lineno=33, + end_col_offset=16), + 'rounding', + Store(), + lineno=33, + col_offset=8, + end_lineno=33, + end_col_offset=25)], + Name( + 'ROUND_UP', + Load(), + lineno=33, + col_offset=28, + end_lineno=33, + end_col_offset=36), + lineno=33, + col_offset=8, + end_lineno=33, + end_col_offset=36), + Assign( + [ + Attribute( + Name( + 'ctx_rate', + Load(), + lineno=35, + col_offset=8, + end_lineno=35, + end_col_offset=16), + 'prec', + Store(), + lineno=35, + col_offset=8, + end_lineno=35, + end_col_offset=21)], + Constant( + 12, + lineno=35, + col_offset=24, + end_lineno=35, + end_col_offset=26), + lineno=35, + col_offset=8, + end_lineno=35, + end_col_offset=26), + Assign( + [ + Attribute( + Name( + 'ctx_rate', + Load(), + lineno=36, + col_offset=8, + end_lineno=36, + end_col_offset=16), + 'rounding', + Store(), + lineno=36, + col_offset=8, + end_lineno=36, + end_col_offset=25)], + Name( + 'ROUND_DOWN', + Load(), + lineno=36, + col_offset=28, + end_lineno=36, + end_col_offset=38), + lineno=36, + col_offset=8, + end_lineno=36, + end_col_offset=38), + Assign( + [ + Name( + 'annualized_time', + Store(), + lineno=38, + col_offset=8, + end_lineno=38, + end_col_offset=23)], + BinOp( + Name( + 'position_duration', + Load(), + lineno=38, + col_offset=26, + end_lineno=38, + end_col_offset=43), + Div(), + Call( + Name( + 'Decimal', + Load(), + lineno=38, + col_offset=46, + end_lineno=38, + end_col_offset=53), + [ + BinOp( + BinOp( + BinOp( + Constant( + 60, + lineno=38, + col_offset=54, + end_lineno=38, + end_col_offset=56), + Mult(), + Constant( + 60, + lineno=38, + col_offset=59, + end_lineno=38, + end_col_offset=61), + lineno=38, + col_offset=54, + end_lineno=38, + end_col_offset=61), + Mult(), + Constant( + 24, + lineno=38, + col_offset=64, + end_lineno=38, + end_col_offset=66), + lineno=38, + col_offset=54, + end_lineno=38, + end_col_offset=66), + Mult(), + Constant( + 365, + lineno=38, + col_offset=69, + end_lineno=38, + end_col_offset=72), + lineno=38, + col_offset=54, + end_lineno=38, + end_col_offset=72)], + [], + lineno=38, + col_offset=46, + end_lineno=38, + end_col_offset=73), + lineno=38, + col_offset=26, + end_lineno=38, + end_col_offset=73), + lineno=38, + col_offset=8, + end_lineno=38, + end_col_offset=73), + Assign( + [ + Name( + 'fixed_rate', + Store(), + lineno=39, + col_offset=8, + end_lineno=39, + end_col_offset=18)], + BinOp( + BinOp( + Constant( + 1, + lineno=39, + col_offset=22, + end_lineno=39, + end_col_offset=23), + Sub(), + Name( + 'spot_price', + Load(), + lineno=39, + col_offset=26, + end_lineno=39, + end_col_offset=36), + lineno=39, + col_offset=22, + end_lineno=39, + end_col_offset=36), + Div(), + BinOp( + Name( + 'spot_price', + Load(), + lineno=39, + col_offset=41, + end_lineno=39, + end_col_offset=51), + Mult(), + Name( + 'annualized_time', + Load(), + lineno=39, + col_offset=54, + end_lineno=39, + end_col_offset=69), + lineno=39, + col_offset=41, + end_lineno=39, + end_col_offset=69), + lineno=39, + col_offset=21, + end_lineno=39, + end_col_offset=70), + lineno=39, + col_offset=8, + end_lineno=39, + end_col_offset=70)], + lineno=30, + col_offset=4, + end_lineno=39, + end_col_offset=70), + Return( + Name( + 'fixed_rate', + Load(), + lineno=40, + col_offset=11, + end_lineno=40, + end_col_offset=21), + lineno=40, + col_offset=4, + end_lineno=40, + end_col_offset=21)], + [], + Attribute( + Name( + 'pd', + Load(), + lineno=12, + col_offset=74, + end_lineno=12, + end_col_offset=76), + 'Series', + Load(), + lineno=12, + col_offset=74, + end_lineno=12, + end_col_offset=83), + lineno=12, + col_offset=0, + end_lineno=40, + end_col_offset=21), Expr( Constant( 'convert json to jsonl', - lineno=5, + lineno=48, col_offset=0, - end_lineno=5, + end_lineno=48, end_col_offset=27), - lineno=5, + lineno=48, col_offset=0, - end_lineno=5, + end_lineno=48, end_col_offset=27), ImportFrom( 'argparse', [ alias( 'ArgumentParser', - lineno=7, + lineno=50, col_offset=21, - end_lineno=7, + end_lineno=50, end_col_offset=35)], 0, - lineno=7, + lineno=50, col_offset=0, - end_lineno=7, + end_lineno=50, end_col_offset=35), Import( [ alias( 'json', - lineno=8, + lineno=51, col_offset=7, - end_lineno=8, + end_lineno=51, end_col_offset=11)], - lineno=8, + lineno=51, col_offset=0, - end_lineno=8, + end_lineno=51, end_col_offset=11), FunctionDef( 'main', @@ -88,27 +541,27 @@ Module( Name( 'args', Store(), - lineno=11, + lineno=54, col_offset=4, - end_lineno=11, + end_lineno=54, end_col_offset=8)], Call( Name( 'parse_args', Load(), - lineno=11, + lineno=54, col_offset=11, - end_lineno=11, + end_lineno=54, end_col_offset=21), [], [], - lineno=11, + lineno=54, col_offset=11, - end_lineno=11, + end_lineno=54, end_col_offset=23), - lineno=11, + lineno=54, col_offset=4, - end_lineno=11, + end_lineno=54, end_col_offset=23), With( [ @@ -117,84 +570,84 @@ Module( Name( 'open', Load(), - lineno=15, + lineno=58, col_offset=8, - end_lineno=15, + end_lineno=58, end_col_offset=12), [ Attribute( Name( 'args', Load(), - lineno=15, + lineno=58, col_offset=13, - end_lineno=15, + end_lineno=58, end_col_offset=17), 'in_filename', Load(), - lineno=15, + lineno=58, col_offset=13, - end_lineno=15, + end_lineno=58, end_col_offset=29)], [], - lineno=15, + lineno=58, col_offset=8, - end_lineno=15, + end_lineno=58, end_col_offset=30), Name( 'in_file', Store(), - lineno=15, + lineno=58, col_offset=34, - end_lineno=15, + end_lineno=58, end_col_offset=41)), withitem( Call( Name( 'open', Load(), - lineno=16, + lineno=59, col_offset=8, - end_lineno=16, + end_lineno=59, end_col_offset=12), [ Attribute( Name( 'args', Load(), - lineno=16, + lineno=59, col_offset=13, - end_lineno=16, + end_lineno=59, end_col_offset=17), 'out_filename', Load(), - lineno=16, + lineno=59, col_offset=13, - end_lineno=16, + end_lineno=59, end_col_offset=30)], [ keyword( 'mode', Constant( 'wt', - lineno=16, + lineno=59, col_offset=37, - end_lineno=16, + end_lineno=59, end_col_offset=41), - lineno=16, + lineno=59, col_offset=32, - end_lineno=16, + end_lineno=59, end_col_offset=41)], - lineno=16, + lineno=59, col_offset=8, - end_lineno=16, + end_lineno=59, end_col_offset=42), Name( 'out_file', Store(), - lineno=16, + lineno=59, col_offset=46, - end_lineno=16, + end_lineno=59, end_col_offset=54))], [ Assign( @@ -202,56 +655,56 @@ Module( Name( 'records', Store(), - lineno=18, + lineno=61, col_offset=8, - end_lineno=18, + end_lineno=61, end_col_offset=15)], Call( Attribute( Name( 'json', Load(), - lineno=18, + lineno=61, col_offset=18, - end_lineno=18, + end_lineno=61, end_col_offset=22), 'load', Load(), - lineno=18, + lineno=61, col_offset=18, - end_lineno=18, + end_lineno=61, end_col_offset=27), [ Name( 'in_file', Load(), - lineno=18, + lineno=61, col_offset=28, - end_lineno=18, + end_lineno=61, end_col_offset=35)], [], - lineno=18, + lineno=61, col_offset=18, - end_lineno=18, + end_lineno=61, end_col_offset=36), - lineno=18, + lineno=61, col_offset=8, - end_lineno=18, + end_lineno=61, end_col_offset=36), For( Name( 'record', Store(), - lineno=19, + lineno=62, col_offset=12, - end_lineno=19, + end_lineno=62, end_col_offset=18), Name( 'records', Load(), - lineno=19, + lineno=62, col_offset=22, - end_lineno=19, + end_lineno=62, end_col_offset=29), [ Expr( @@ -260,15 +713,15 @@ Module( Name( 'out_file', Load(), - lineno=20, + lineno=63, col_offset=12, - end_lineno=20, + end_lineno=63, end_col_offset=20), 'write', Load(), - lineno=20, + lineno=63, col_offset=12, - end_lineno=20, + end_lineno=63, end_col_offset=26), [ BinOp( @@ -277,62 +730,62 @@ Module( Name( 'json', Load(), - lineno=20, + lineno=63, col_offset=27, - end_lineno=20, + end_lineno=63, end_col_offset=31), 'dumps', Load(), - lineno=20, + lineno=63, col_offset=27, - end_lineno=20, + end_lineno=63, end_col_offset=37), [ Name( 'record', Load(), - lineno=20, + lineno=63, col_offset=38, - end_lineno=20, + end_lineno=63, end_col_offset=44)], [], - lineno=20, + lineno=63, col_offset=27, - end_lineno=20, + end_lineno=63, end_col_offset=45), Add(), Constant( '\n', - lineno=20, + lineno=63, col_offset=48, - end_lineno=20, + end_lineno=63, end_col_offset=52), - lineno=20, + lineno=63, col_offset=27, - end_lineno=20, + end_lineno=63, end_col_offset=52)], [], - lineno=20, + lineno=63, col_offset=12, - end_lineno=20, + end_lineno=63, end_col_offset=53), - lineno=20, + lineno=63, col_offset=12, - end_lineno=20, + end_lineno=63, end_col_offset=53)], [], - lineno=19, + lineno=62, col_offset=8, - end_lineno=20, + end_lineno=63, end_col_offset=53)], - lineno=14, + lineno=57, col_offset=4, - end_lineno=20, + end_lineno=63, end_col_offset=53)], [], - lineno=10, + lineno=53, col_offset=0, - end_lineno=20, + end_lineno=63, end_col_offset=53), FunctionDef( 'parse_args', @@ -348,27 +801,27 @@ Module( Name( 'parser', Store(), - lineno=24, + lineno=67, col_offset=4, - end_lineno=24, + end_lineno=67, end_col_offset=10)], Call( Name( 'ArgumentParser', Load(), - lineno=24, + lineno=67, col_offset=13, - end_lineno=24, + end_lineno=67, end_col_offset=27), [], [], - lineno=24, + lineno=67, col_offset=13, - end_lineno=24, + end_lineno=67, end_col_offset=29), - lineno=24, + lineno=67, col_offset=4, - end_lineno=24, + end_lineno=67, end_col_offset=29), Expr( Call( @@ -376,31 +829,31 @@ Module( Name( 'parser', Load(), - lineno=25, + lineno=68, col_offset=4, - end_lineno=25, + end_lineno=68, end_col_offset=10), 'add_argument', Load(), - lineno=25, + lineno=68, col_offset=4, - end_lineno=25, + end_lineno=68, end_col_offset=23), [ Constant( 'in_filename', - lineno=25, + lineno=68, col_offset=24, - end_lineno=25, + end_lineno=68, end_col_offset=37)], [], - lineno=25, + lineno=68, col_offset=4, - end_lineno=25, + end_lineno=68, end_col_offset=38), - lineno=25, + lineno=68, col_offset=4, - end_lineno=25, + end_lineno=68, end_col_offset=38), Expr( Call( @@ -408,104 +861,104 @@ Module( Name( 'parser', Load(), - lineno=26, + lineno=69, col_offset=4, - end_lineno=26, + end_lineno=69, end_col_offset=10), 'add_argument', Load(), - lineno=26, + lineno=69, col_offset=4, - end_lineno=26, + end_lineno=69, end_col_offset=23), [ Constant( 'out_filename', - lineno=26, + lineno=69, col_offset=24, - end_lineno=26, + end_lineno=69, end_col_offset=38)], [], - lineno=26, + lineno=69, col_offset=4, - end_lineno=26, + end_lineno=69, end_col_offset=39), - lineno=26, + lineno=69, col_offset=4, - end_lineno=26, + end_lineno=69, end_col_offset=39), Assign( [ Name( 'args', Store(), - lineno=27, + lineno=70, col_offset=4, - end_lineno=27, + end_lineno=70, end_col_offset=8)], Call( Attribute( Name( 'parser', Load(), - lineno=27, + lineno=70, col_offset=11, - end_lineno=27, + end_lineno=70, end_col_offset=17), 'parse_args', Load(), - lineno=27, + lineno=70, col_offset=11, - end_lineno=27, + end_lineno=70, end_col_offset=28), [], [], - lineno=27, + lineno=70, col_offset=11, - end_lineno=27, + end_lineno=70, end_col_offset=30), - lineno=27, + lineno=70, col_offset=4, - end_lineno=27, + end_lineno=70, end_col_offset=30), Return( Name( 'args', Load(), - lineno=28, + lineno=71, col_offset=11, - end_lineno=28, + end_lineno=71, end_col_offset=15), - lineno=28, + lineno=71, col_offset=4, - end_lineno=28, + end_lineno=71, end_col_offset=15)], [], - lineno=23, + lineno=66, col_offset=0, - end_lineno=28, + end_lineno=71, end_col_offset=15), If( Compare( Name( '__name__', Load(), - lineno=30, + lineno=73, col_offset=3, - end_lineno=30, + end_lineno=73, end_col_offset=11), [ Eq()], [ Constant( '__main__', - lineno=30, + lineno=73, col_offset=15, - end_lineno=30, + end_lineno=73, end_col_offset=25)], - lineno=30, + lineno=73, col_offset=3, - end_lineno=30, + end_lineno=73, end_col_offset=25), [ Expr( @@ -513,490 +966,461 @@ Module( Name( 'main', Load(), - lineno=31, + lineno=74, col_offset=4, - end_lineno=31, + end_lineno=74, end_col_offset=8), [], [], - lineno=31, + lineno=74, col_offset=4, - end_lineno=31, + end_lineno=74, end_col_offset=10), - lineno=31, + lineno=74, col_offset=4, - end_lineno=31, - end_col_offset=10), - FunctionDef( - 'CtxManager', - arguments( - [], - [], - kwonlyargs=[], - kw_defaults=[], - defaults=[]), - [ - Pass( - lineno=40, - col_offset=22, - end_lineno=40, - end_col_offset=26)], - [], - lineno=40, - col_offset=4, - end_lineno=40, - end_col_offset=26), - FunctionDef( - 'CtxManager1', - arguments( - [], - [], - kwonlyargs=[], - kw_defaults=[], - defaults=[]), - [ - Pass( - lineno=41, - col_offset=23, - end_lineno=41, - end_col_offset=27)], - [], - lineno=41, - col_offset=4, - end_lineno=41, - end_col_offset=27), - FunctionDef( - 'CtxManager2', - arguments( - [], - [], - kwonlyargs=[], - kw_defaults=[], - defaults=[]), - [ - Pass( - lineno=42, - col_offset=23, - end_lineno=42, - end_col_offset=27)], - [], - lineno=42, - col_offset=4, - end_lineno=42, - end_col_offset=27), - FunctionDef( - 'CtxManager3', - arguments( - [], - [], - kwonlyargs=[], - kw_defaults=[], - defaults=[]), - [ - Pass( - lineno=43, - col_offset=23, - end_lineno=43, - end_col_offset=27)], - [], - lineno=43, - col_offset=4, - end_lineno=43, - end_col_offset=27), + end_lineno=74, + end_col_offset=10)], + [], + lineno=73, + col_offset=0, + end_lineno=74, + end_col_offset=10)], + []) +## END TREE BEFORE ## + +## BEGIN NORMALIZED TREE ## +Module( + [ + Expr( + Constant( + 'Calculate the fixed interest rate.', + lineno=6, + col_offset=0, + end_lineno=6, + end_col_offset=40), + lineno=6, + col_offset=0, + end_lineno=6, + end_col_offset=40), + ImportFrom( + 'decimal', + [ + alias( + 'ROUND_DOWN', + lineno=8, + col_offset=20, + end_lineno=8, + end_col_offset=30), + alias( + 'ROUND_UP', + lineno=8, + col_offset=32, + end_lineno=8, + end_col_offset=40), + alias( + 'Decimal', + lineno=8, + col_offset=42, + end_lineno=8, + end_col_offset=49), + alias( + 'localcontext', + lineno=8, + col_offset=51, + end_lineno=8, + end_col_offset=63)], + 0, + lineno=8, + col_offset=0, + end_lineno=8, + end_col_offset=63), + Import( + [ + alias( + 'pandas', + 'placeholder_0', + lineno=9, + col_offset=7, + end_lineno=9, + end_col_offset=19)], + lineno=9, + col_offset=0, + end_lineno=9, + end_col_offset=19), + FunctionDef( + 'placeholder_1', + arguments( + [], + [ + arg( + 'placeholder_2', + lineno=12, + col_offset=20, + end_lineno=12, + end_col_offset=41), + arg( + 'placeholder_3', + lineno=12, + col_offset=43, + end_lineno=12, + end_col_offset=69)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ With( [ withitem( Call( Name( - 'CtxManager', + 'localcontext', Load(), - lineno=45, + lineno=30, col_offset=10, - end_lineno=45, - end_col_offset=20), + end_lineno=30, + end_col_offset=22), [], [], - lineno=45, + lineno=30, col_offset=10, - end_lineno=45, - end_col_offset=22), + end_lineno=30, + end_col_offset=24), Name( - 'example', + 'placeholder_4', Store(), - lineno=45, - col_offset=26, - end_lineno=45, - end_col_offset=33))], - [ - Expr( - Constant( - Ellipsis, - lineno=46, - col_offset=8, - end_lineno=46, - end_col_offset=11), - lineno=46, - col_offset=8, - end_lineno=46, - end_col_offset=11)], - lineno=45, - col_offset=4, - end_lineno=46, - end_col_offset=11), - With( - [ - withitem( - Call( - Name( - 'CtxManager1', - Load(), - lineno=49, - col_offset=8, - end_lineno=49, - end_col_offset=19), - [], - [], - lineno=49, - col_offset=8, - end_lineno=49, - end_col_offset=21)), + lineno=30, + col_offset=28, + end_lineno=30, + end_col_offset=36)), withitem( Call( Name( - 'CtxManager2', + 'localcontext', Load(), - lineno=50, - col_offset=8, - end_lineno=50, - end_col_offset=19), - [], - [], - lineno=50, - col_offset=8, - end_lineno=50, - end_col_offset=21))], - [ - Expr( - Constant( - Ellipsis, - lineno=52, - col_offset=8, - end_lineno=52, - end_col_offset=11), - lineno=52, - col_offset=8, - end_lineno=52, - end_col_offset=11)], - lineno=48, - col_offset=4, - end_lineno=52, - end_col_offset=11), - With( - [ - withitem( - Call( - Name( - 'CtxManager1', - Load(), - lineno=54, + lineno=31, col_offset=10, - end_lineno=54, - end_col_offset=21), + end_lineno=31, + end_col_offset=22), [], [], - lineno=54, + lineno=31, col_offset=10, - end_lineno=54, - end_col_offset=23), + end_lineno=31, + end_col_offset=24), Name( - 'example', + 'placeholder_5', Store(), - lineno=54, - col_offset=27, - end_lineno=54, - end_col_offset=34)), - withitem( - Call( - Name( - 'CtxManager2', - Load(), - lineno=55, - col_offset=8, - end_lineno=55, - end_col_offset=19), - [], - [], - lineno=55, - col_offset=8, - end_lineno=55, - end_col_offset=21))], + lineno=31, + col_offset=28, + end_lineno=31, + end_col_offset=36))], [ - Expr( - Constant( - Ellipsis, - lineno=56, - col_offset=8, - end_lineno=56, - end_col_offset=11), - lineno=56, - col_offset=8, - end_lineno=56, - end_col_offset=11)], - lineno=54, - col_offset=4, - end_lineno=56, - end_col_offset=11), - With( - [ - withitem( - Call( - Name( - 'CtxManager1', - Load(), - lineno=58, - col_offset=10, - end_lineno=58, - end_col_offset=21), - [], - [], - lineno=58, - col_offset=10, - end_lineno=58, - end_col_offset=23)), - withitem( - Call( - Name( - 'CtxManager2', - Load(), - lineno=59, + Assign( + [ + Attribute( + Name( + 'placeholder_4', + Load(), + lineno=32, + col_offset=8, + end_lineno=32, + end_col_offset=16), + 'placeholder_6', + Store(), + lineno=32, col_offset=8, - end_lineno=59, - end_col_offset=19), - [], - [], - lineno=59, - col_offset=8, - end_lineno=59, - end_col_offset=21), - Name( - 'example', - Store(), - lineno=59, - col_offset=25, - end_lineno=59, - end_col_offset=32))], - [ - Expr( + end_lineno=32, + end_col_offset=21)], Constant( - Ellipsis, - lineno=60, - col_offset=8, - end_lineno=60, - end_col_offset=11), - lineno=60, + 18, + lineno=32, + col_offset=24, + end_lineno=32, + end_col_offset=26), + lineno=32, col_offset=8, - end_lineno=60, - end_col_offset=11)], - lineno=58, - col_offset=4, - end_lineno=60, - end_col_offset=11), - With( - [ - withitem( - Call( - Name( - 'CtxManager1', - Load(), - lineno=63, + end_lineno=32, + end_col_offset=26), + Assign( + [ + Attribute( + Name( + 'placeholder_4', + Load(), + lineno=33, + col_offset=8, + end_lineno=33, + end_col_offset=16), + 'placeholder_7', + Store(), + lineno=33, col_offset=8, - end_lineno=63, - end_col_offset=19), - [], - [], - lineno=63, - col_offset=8, - end_lineno=63, - end_col_offset=21), + end_lineno=33, + end_col_offset=25)], Name( - 'example1', - Store(), - lineno=63, - col_offset=25, - end_lineno=63, - end_col_offset=33)), - withitem( - Call( - Name( - 'CtxManager2', - Load(), - lineno=64, + 'ROUND_UP', + Load(), + lineno=33, + col_offset=28, + end_lineno=33, + end_col_offset=36), + lineno=33, + col_offset=8, + end_lineno=33, + end_col_offset=36), + Assign( + [ + Attribute( + Name( + 'placeholder_5', + Load(), + lineno=35, + col_offset=8, + end_lineno=35, + end_col_offset=16), + 'placeholder_6', + Store(), + lineno=35, col_offset=8, - end_lineno=64, - end_col_offset=19), - [], - [], - lineno=64, - col_offset=8, - end_lineno=64, - end_col_offset=21), - Name( - 'example2', - Store(), - lineno=64, - col_offset=25, - end_lineno=64, - end_col_offset=33))], - [ - Expr( + end_lineno=35, + end_col_offset=21)], Constant( - Ellipsis, - lineno=66, - col_offset=8, - end_lineno=66, - end_col_offset=11), - lineno=66, + 12, + lineno=35, + col_offset=24, + end_lineno=35, + end_col_offset=26), + lineno=35, col_offset=8, - end_lineno=66, - end_col_offset=11)], - lineno=62, - col_offset=4, - end_lineno=66, - end_col_offset=11), - With( - [ - withitem( - Call( - Name( - 'CtxManager1', - Load(), - lineno=68, + end_lineno=35, + end_col_offset=26), + Assign( + [ + Attribute( + Name( + 'placeholder_5', + Load(), + lineno=36, + col_offset=8, + end_lineno=36, + end_col_offset=16), + 'placeholder_7', + Store(), + lineno=36, col_offset=8, - end_lineno=68, - end_col_offset=19), - [], - [], - lineno=68, - col_offset=8, - end_lineno=68, - end_col_offset=21), + end_lineno=36, + end_col_offset=25)], Name( - 'example1', - Store(), - lineno=68, - col_offset=25, - end_lineno=68, - end_col_offset=33)), - withitem( - Call( + 'ROUND_DOWN', + Load(), + lineno=36, + col_offset=28, + end_lineno=36, + end_col_offset=38), + lineno=36, + col_offset=8, + end_lineno=36, + end_col_offset=38), + Assign( + [ Name( - 'CtxManager2', - Load(), - lineno=69, + 'placeholder_8', + Store(), + lineno=38, col_offset=8, - end_lineno=69, - end_col_offset=19), - [], - [], - lineno=69, - col_offset=8, - end_lineno=69, - end_col_offset=21), - Name( - 'example2', - Store(), - lineno=69, - col_offset=25, - end_lineno=69, - end_col_offset=33)), - withitem( - Call( + end_lineno=38, + end_col_offset=23)], + BinOp( Name( - 'CtxManager3', + 'placeholder_3', Load(), - lineno=70, + lineno=38, + col_offset=26, + end_lineno=38, + end_col_offset=43), + Div(), + Call( + Name( + 'Decimal', + Load(), + lineno=38, + col_offset=46, + end_lineno=38, + end_col_offset=53), + [ + BinOp( + BinOp( + BinOp( + Constant( + 60, + lineno=38, + col_offset=54, + end_lineno=38, + end_col_offset=56), + Mult(), + Constant( + 60, + lineno=38, + col_offset=59, + end_lineno=38, + end_col_offset=61), + lineno=38, + col_offset=54, + end_lineno=38, + end_col_offset=61), + Mult(), + Constant( + 24, + lineno=38, + col_offset=64, + end_lineno=38, + end_col_offset=66), + lineno=38, + col_offset=54, + end_lineno=38, + end_col_offset=66), + Mult(), + Constant( + 365, + lineno=38, + col_offset=69, + end_lineno=38, + end_col_offset=72), + lineno=38, + col_offset=54, + end_lineno=38, + end_col_offset=72)], + [], + lineno=38, + col_offset=46, + end_lineno=38, + end_col_offset=73), + lineno=38, + col_offset=26, + end_lineno=38, + end_col_offset=73), + lineno=38, + col_offset=8, + end_lineno=38, + end_col_offset=73), + Assign( + [ + Name( + 'placeholder_9', + Store(), + lineno=39, col_offset=8, - end_lineno=70, - end_col_offset=19), - [], - [], - lineno=70, - col_offset=8, - end_lineno=70, - end_col_offset=21), - Name( - 'example3', - Store(), - lineno=70, - col_offset=25, - end_lineno=70, - end_col_offset=33))], - [ - Expr( - Constant( - Ellipsis, - lineno=72, - col_offset=8, - end_lineno=72, - end_col_offset=11), - lineno=72, + end_lineno=39, + end_col_offset=18)], + BinOp( + BinOp( + Constant( + 1, + lineno=39, + col_offset=22, + end_lineno=39, + end_col_offset=23), + Sub(), + Name( + 'placeholder_2', + Load(), + lineno=39, + col_offset=26, + end_lineno=39, + end_col_offset=36), + lineno=39, + col_offset=22, + end_lineno=39, + end_col_offset=36), + Div(), + BinOp( + Name( + 'placeholder_2', + Load(), + lineno=39, + col_offset=41, + end_lineno=39, + end_col_offset=51), + Mult(), + Name( + 'placeholder_8', + Load(), + lineno=39, + col_offset=54, + end_lineno=39, + end_col_offset=69), + lineno=39, + col_offset=41, + end_lineno=39, + end_col_offset=69), + lineno=39, + col_offset=21, + end_lineno=39, + end_col_offset=70), + lineno=39, col_offset=8, - end_lineno=72, - end_col_offset=11)], - lineno=67, + end_lineno=39, + end_col_offset=70)], + lineno=30, col_offset=4, - end_lineno=72, - end_col_offset=11)], + end_lineno=39, + end_col_offset=70), + Return( + Name( + 'placeholder_9', + Load(), + lineno=40, + col_offset=11, + end_lineno=40, + end_col_offset=21), + lineno=40, + col_offset=4, + end_lineno=40, + end_col_offset=21)], [], - lineno=30, + lineno=12, col_offset=0, - end_lineno=72, - end_col_offset=11)], - []) -## END TREE BEFORE ## - -## BEGIN NORMALIZED TREE ## -Module( - [ + end_lineno=40, + end_col_offset=21), Expr( Constant( 'convert json to jsonl', - lineno=5, + lineno=48, col_offset=0, - end_lineno=5, + end_lineno=48, end_col_offset=27), - lineno=5, + lineno=48, col_offset=0, - end_lineno=5, + end_lineno=48, end_col_offset=27), ImportFrom( 'argparse', [ alias( 'ArgumentParser', - lineno=7, + lineno=50, col_offset=21, - end_lineno=7, + end_lineno=50, end_col_offset=35)], 0, - lineno=7, + lineno=50, col_offset=0, - end_lineno=7, + end_lineno=50, end_col_offset=35), Import( [ alias( 'json', - lineno=8, + lineno=51, col_offset=7, - end_lineno=8, + end_lineno=51, end_col_offset=11)], - lineno=8, + lineno=51, col_offset=0, - end_lineno=8, + end_lineno=51, end_col_offset=11), FunctionDef( - 'placeholder_0', + 'placeholder_10', arguments( [], [], @@ -1007,29 +1431,29 @@ Module( Assign( [ Name( - 'placeholder_1', + 'placeholder_11', Store(), - lineno=11, + lineno=54, col_offset=4, - end_lineno=11, + end_lineno=54, end_col_offset=8)], Call( Name( 'parse_args', Load(), - lineno=11, + lineno=54, col_offset=11, - end_lineno=11, + end_lineno=54, end_col_offset=21), [], [], - lineno=11, + lineno=54, col_offset=11, - end_lineno=11, + end_lineno=54, end_col_offset=23), - lineno=11, + lineno=54, col_offset=4, - end_lineno=11, + end_lineno=54, end_col_offset=23), With( [ @@ -1038,158 +1462,158 @@ Module( Name( 'open', Load(), - lineno=15, + lineno=58, col_offset=8, - end_lineno=15, + end_lineno=58, end_col_offset=12), [ Attribute( Name( - 'placeholder_1', + 'placeholder_11', Load(), - lineno=15, + lineno=58, col_offset=13, - end_lineno=15, + end_lineno=58, end_col_offset=17), 'in_filename', Load(), - lineno=15, + lineno=58, col_offset=13, - end_lineno=15, + end_lineno=58, end_col_offset=29)], [], - lineno=15, + lineno=58, col_offset=8, - end_lineno=15, + end_lineno=58, end_col_offset=30), Name( - 'placeholder_2', + 'placeholder_12', Store(), - lineno=15, + lineno=58, col_offset=34, - end_lineno=15, + end_lineno=58, end_col_offset=41)), withitem( Call( Name( 'open', Load(), - lineno=16, + lineno=59, col_offset=8, - end_lineno=16, + end_lineno=59, end_col_offset=12), [ Attribute( Name( - 'placeholder_1', + 'placeholder_11', Load(), - lineno=16, + lineno=59, col_offset=13, - end_lineno=16, + end_lineno=59, end_col_offset=17), 'out_filename', Load(), - lineno=16, + lineno=59, col_offset=13, - end_lineno=16, + end_lineno=59, end_col_offset=30)], [ keyword( - 'placeholder_3', + 'placeholder_13', Constant( 'wt', - lineno=16, + lineno=59, col_offset=37, - end_lineno=16, + end_lineno=59, end_col_offset=41), - lineno=16, + lineno=59, col_offset=32, - end_lineno=16, + end_lineno=59, end_col_offset=41)], - lineno=16, + lineno=59, col_offset=8, - end_lineno=16, + end_lineno=59, end_col_offset=42), Name( - 'placeholder_4', + 'placeholder_14', Store(), - lineno=16, + lineno=59, col_offset=46, - end_lineno=16, + end_lineno=59, end_col_offset=54))], [ Assign( [ Name( - 'placeholder_5', + 'placeholder_15', Store(), - lineno=18, + lineno=61, col_offset=8, - end_lineno=18, + end_lineno=61, end_col_offset=15)], Call( Attribute( Name( 'json', Load(), - lineno=18, + lineno=61, col_offset=18, - end_lineno=18, + end_lineno=61, end_col_offset=22), 'load', Load(), - lineno=18, + lineno=61, col_offset=18, - end_lineno=18, + end_lineno=61, end_col_offset=27), [ Name( - 'placeholder_2', + 'placeholder_12', Load(), - lineno=18, + lineno=61, col_offset=28, - end_lineno=18, + end_lineno=61, end_col_offset=35)], [], - lineno=18, + lineno=61, col_offset=18, - end_lineno=18, + end_lineno=61, end_col_offset=36), - lineno=18, + lineno=61, col_offset=8, - end_lineno=18, + end_lineno=61, end_col_offset=36), For( Name( - 'placeholder_6', + 'placeholder_16', Store(), - lineno=19, + lineno=62, col_offset=12, - end_lineno=19, + end_lineno=62, end_col_offset=18), Name( - 'placeholder_5', + 'placeholder_15', Load(), - lineno=19, + lineno=62, col_offset=22, - end_lineno=19, + end_lineno=62, end_col_offset=29), [ Expr( Call( Attribute( Name( - 'placeholder_4', + 'placeholder_14', Load(), - lineno=20, + lineno=63, col_offset=12, - end_lineno=20, + end_lineno=63, end_col_offset=20), 'write', Load(), - lineno=20, + lineno=63, col_offset=12, - end_lineno=20, + end_lineno=63, end_col_offset=26), [ BinOp( @@ -1198,65 +1622,65 @@ Module( Name( 'json', Load(), - lineno=20, + lineno=63, col_offset=27, - end_lineno=20, + end_lineno=63, end_col_offset=31), 'dumps', Load(), - lineno=20, + lineno=63, col_offset=27, - end_lineno=20, + end_lineno=63, end_col_offset=37), [ Name( - 'placeholder_6', + 'placeholder_16', Load(), - lineno=20, + lineno=63, col_offset=38, - end_lineno=20, + end_lineno=63, end_col_offset=44)], [], - lineno=20, + lineno=63, col_offset=27, - end_lineno=20, + end_lineno=63, end_col_offset=45), Add(), Constant( '\n', - lineno=20, + lineno=63, col_offset=48, - end_lineno=20, + end_lineno=63, end_col_offset=52), - lineno=20, + lineno=63, col_offset=27, - end_lineno=20, + end_lineno=63, end_col_offset=52)], [], - lineno=20, + lineno=63, col_offset=12, - end_lineno=20, + end_lineno=63, end_col_offset=53), - lineno=20, + lineno=63, col_offset=12, - end_lineno=20, + end_lineno=63, end_col_offset=53)], [], - lineno=19, + lineno=62, col_offset=8, - end_lineno=20, + end_lineno=63, end_col_offset=53)], - lineno=14, + lineno=57, col_offset=4, - end_lineno=20, + end_lineno=63, end_col_offset=53)], [], - lineno=10, + lineno=53, col_offset=0, - end_lineno=20, + end_lineno=63, end_col_offset=53), FunctionDef( - 'placeholder_7', + 'placeholder_17', arguments( [], [], @@ -1267,144 +1691,144 @@ Module( Assign( [ Name( - 'placeholder_8', + 'placeholder_18', Store(), - lineno=24, + lineno=67, col_offset=4, - end_lineno=24, + end_lineno=67, end_col_offset=10)], Call( Name( 'ArgumentParser', Load(), - lineno=24, + lineno=67, col_offset=13, - end_lineno=24, + end_lineno=67, end_col_offset=27), [], [], - lineno=24, + lineno=67, col_offset=13, - end_lineno=24, + end_lineno=67, end_col_offset=29), - lineno=24, + lineno=67, col_offset=4, - end_lineno=24, + end_lineno=67, end_col_offset=29), Expr( Call( Attribute( Name( - 'placeholder_8', + 'placeholder_18', Load(), - lineno=25, + lineno=68, col_offset=4, - end_lineno=25, + end_lineno=68, end_col_offset=10), 'add_argument', Load(), - lineno=25, + lineno=68, col_offset=4, - end_lineno=25, + end_lineno=68, end_col_offset=23), [ Constant( 'in_filename', - lineno=25, + lineno=68, col_offset=24, - end_lineno=25, + end_lineno=68, end_col_offset=37)], [], - lineno=25, + lineno=68, col_offset=4, - end_lineno=25, + end_lineno=68, end_col_offset=38), - lineno=25, + lineno=68, col_offset=4, - end_lineno=25, + end_lineno=68, end_col_offset=38), Expr( Call( Attribute( Name( - 'placeholder_8', + 'placeholder_18', Load(), - lineno=26, + lineno=69, col_offset=4, - end_lineno=26, + end_lineno=69, end_col_offset=10), 'add_argument', Load(), - lineno=26, + lineno=69, col_offset=4, - end_lineno=26, + end_lineno=69, end_col_offset=23), [ Constant( 'out_filename', - lineno=26, + lineno=69, col_offset=24, - end_lineno=26, + end_lineno=69, end_col_offset=38)], [], - lineno=26, + lineno=69, col_offset=4, - end_lineno=26, + end_lineno=69, end_col_offset=39), - lineno=26, + lineno=69, col_offset=4, - end_lineno=26, + end_lineno=69, end_col_offset=39), Assign( [ Name( - 'placeholder_1', + 'placeholder_11', Store(), - lineno=27, + lineno=70, col_offset=4, - end_lineno=27, + end_lineno=70, end_col_offset=8)], Call( Attribute( Name( - 'placeholder_8', + 'placeholder_18', Load(), - lineno=27, + lineno=70, col_offset=11, - end_lineno=27, + end_lineno=70, end_col_offset=17), - 'placeholder_7', + 'placeholder_17', Load(), - lineno=27, + lineno=70, col_offset=11, - end_lineno=27, + end_lineno=70, end_col_offset=28), [], [], - lineno=27, + lineno=70, col_offset=11, - end_lineno=27, + end_lineno=70, end_col_offset=30), - lineno=27, + lineno=70, col_offset=4, - end_lineno=27, + end_lineno=70, end_col_offset=30), Return( Name( - 'placeholder_1', + 'placeholder_11', Load(), - lineno=28, + lineno=71, col_offset=11, - end_lineno=28, + end_lineno=71, end_col_offset=15), - lineno=28, + lineno=71, col_offset=4, - end_lineno=28, + end_lineno=71, end_col_offset=15)], [], - lineno=23, + lineno=66, col_offset=0, - end_lineno=28, + end_lineno=71, end_col_offset=15)], []) ## END NORMALIZED TREE ## \ No newline at end of file diff --git a/test/example-parencontext-normalization/representation.txt b/test/example-parencontext-normalization/representation.txt index a540dba..c56b4e8 100644 --- a/test/example-parencontext-normalization/representation.txt +++ b/test/example-parencontext-normalization/representation.txt @@ -1 +1 @@ -Module([Expr(Constant('convert json to jsonl', lineno=5, col_offset=0, end_lineno=5, end_col_offset=27), lineno=5, col_offset=0, end_lineno=5, end_col_offset=27), ImportFrom('argparse', [alias('ArgumentParser', lineno=7, col_offset=21, end_lineno=7, end_col_offset=35)], 0, lineno=7, col_offset=0, end_lineno=7, end_col_offset=35), Import([alias('json', lineno=8, col_offset=7, end_lineno=8, end_col_offset=11)], lineno=8, col_offset=0, end_lineno=8, end_col_offset=11), FunctionDef('placeholder_0', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_1', Store(), lineno=11, col_offset=4, end_lineno=11, end_col_offset=8)], Call(Name('parse_args', Load(), lineno=11, col_offset=11, end_lineno=11, end_col_offset=21), [], [], lineno=11, col_offset=11, end_lineno=11, end_col_offset=23), lineno=11, col_offset=4, end_lineno=11, end_col_offset=23), With([withitem(Call(Name('open', Load(), lineno=15, col_offset=8, end_lineno=15, end_col_offset=12), [Attribute(Name('placeholder_1', Load(), lineno=15, col_offset=13, end_lineno=15, end_col_offset=17), 'in_filename', Load(), lineno=15, col_offset=13, end_lineno=15, end_col_offset=29)], [], lineno=15, col_offset=8, end_lineno=15, end_col_offset=30), Name('placeholder_2', Store(), lineno=15, col_offset=34, end_lineno=15, end_col_offset=41)), withitem(Call(Name('open', Load(), lineno=16, col_offset=8, end_lineno=16, end_col_offset=12), [Attribute(Name('placeholder_1', Load(), lineno=16, col_offset=13, end_lineno=16, end_col_offset=17), 'out_filename', Load(), lineno=16, col_offset=13, end_lineno=16, end_col_offset=30)], [keyword('placeholder_3', Constant('wt', lineno=16, col_offset=37, end_lineno=16, end_col_offset=41), lineno=16, col_offset=32, end_lineno=16, end_col_offset=41)], lineno=16, col_offset=8, end_lineno=16, end_col_offset=42), Name('placeholder_4', Store(), lineno=16, col_offset=46, end_lineno=16, end_col_offset=54))], [Assign([Name('placeholder_5', Store(), lineno=18, col_offset=8, end_lineno=18, end_col_offset=15)], Call(Attribute(Name('json', Load(), lineno=18, col_offset=18, end_lineno=18, end_col_offset=22), 'load', Load(), lineno=18, col_offset=18, end_lineno=18, end_col_offset=27), [Name('placeholder_2', Load(), lineno=18, col_offset=28, end_lineno=18, end_col_offset=35)], [], lineno=18, col_offset=18, end_lineno=18, end_col_offset=36), lineno=18, col_offset=8, end_lineno=18, end_col_offset=36), For(Name('placeholder_6', Store(), lineno=19, col_offset=12, end_lineno=19, end_col_offset=18), Name('placeholder_5', Load(), lineno=19, col_offset=22, end_lineno=19, end_col_offset=29), [Expr(Call(Attribute(Name('placeholder_4', Load(), lineno=20, col_offset=12, end_lineno=20, end_col_offset=20), 'write', Load(), lineno=20, col_offset=12, end_lineno=20, end_col_offset=26), [BinOp(Call(Attribute(Name('json', Load(), lineno=20, col_offset=27, end_lineno=20, end_col_offset=31), 'dumps', Load(), lineno=20, col_offset=27, end_lineno=20, end_col_offset=37), [Name('placeholder_6', Load(), lineno=20, col_offset=38, end_lineno=20, end_col_offset=44)], [], lineno=20, col_offset=27, end_lineno=20, end_col_offset=45), Add(), Constant('\n', lineno=20, col_offset=48, end_lineno=20, end_col_offset=52), lineno=20, col_offset=27, end_lineno=20, end_col_offset=52)], [], lineno=20, col_offset=12, end_lineno=20, end_col_offset=53), lineno=20, col_offset=12, end_lineno=20, end_col_offset=53)], [], lineno=19, col_offset=8, end_lineno=20, end_col_offset=53)], lineno=14, col_offset=4, end_lineno=20, end_col_offset=53)], [], lineno=10, col_offset=0, end_lineno=20, end_col_offset=53), FunctionDef('placeholder_7', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_8', Store(), lineno=24, col_offset=4, end_lineno=24, end_col_offset=10)], Call(Name('ArgumentParser', Load(), lineno=24, col_offset=13, end_lineno=24, end_col_offset=27), [], [], lineno=24, col_offset=13, end_lineno=24, end_col_offset=29), lineno=24, col_offset=4, end_lineno=24, end_col_offset=29), Expr(Call(Attribute(Name('placeholder_8', Load(), lineno=25, col_offset=4, end_lineno=25, end_col_offset=10), 'add_argument', Load(), lineno=25, col_offset=4, end_lineno=25, end_col_offset=23), [Constant('in_filename', lineno=25, col_offset=24, end_lineno=25, end_col_offset=37)], [], lineno=25, col_offset=4, end_lineno=25, end_col_offset=38), lineno=25, col_offset=4, end_lineno=25, end_col_offset=38), Expr(Call(Attribute(Name('placeholder_8', Load(), lineno=26, col_offset=4, end_lineno=26, end_col_offset=10), 'add_argument', Load(), lineno=26, col_offset=4, end_lineno=26, end_col_offset=23), [Constant('out_filename', lineno=26, col_offset=24, end_lineno=26, end_col_offset=38)], [], lineno=26, col_offset=4, end_lineno=26, end_col_offset=39), lineno=26, col_offset=4, end_lineno=26, end_col_offset=39), Assign([Name('placeholder_1', Store(), lineno=27, col_offset=4, end_lineno=27, end_col_offset=8)], Call(Attribute(Name('placeholder_8', Load(), lineno=27, col_offset=11, end_lineno=27, end_col_offset=17), 'placeholder_7', Load(), lineno=27, col_offset=11, end_lineno=27, end_col_offset=28), [], [], lineno=27, col_offset=11, end_lineno=27, end_col_offset=30), lineno=27, col_offset=4, end_lineno=27, end_col_offset=30), Return(Name('placeholder_1', Load(), lineno=28, col_offset=11, end_lineno=28, end_col_offset=15), lineno=28, col_offset=4, end_lineno=28, end_col_offset=15)], [], lineno=23, col_offset=0, end_lineno=28, end_col_offset=15)], []) \ No newline at end of file +Module([Expr(Constant('Calculate the fixed interest rate.', lineno=6, col_offset=0, end_lineno=6, end_col_offset=40), lineno=6, col_offset=0, end_lineno=6, end_col_offset=40), ImportFrom('decimal', [alias('ROUND_DOWN', lineno=8, col_offset=20, end_lineno=8, end_col_offset=30), alias('ROUND_UP', lineno=8, col_offset=32, end_lineno=8, end_col_offset=40), alias('Decimal', lineno=8, col_offset=42, end_lineno=8, end_col_offset=49), alias('localcontext', lineno=8, col_offset=51, end_lineno=8, end_col_offset=63)], 0, lineno=8, col_offset=0, end_lineno=8, end_col_offset=63), Import([alias('pandas', 'placeholder_0', lineno=9, col_offset=7, end_lineno=9, end_col_offset=19)], lineno=9, col_offset=0, end_lineno=9, end_col_offset=19), FunctionDef('placeholder_1', arguments([], [arg('placeholder_2', lineno=12, col_offset=20, end_lineno=12, end_col_offset=41), arg('placeholder_3', lineno=12, col_offset=43, end_lineno=12, end_col_offset=69)], kwonlyargs=[], kw_defaults=[], defaults=[]), [With([withitem(Call(Name('localcontext', Load(), lineno=30, col_offset=10, end_lineno=30, end_col_offset=22), [], [], lineno=30, col_offset=10, end_lineno=30, end_col_offset=24), Name('placeholder_4', Store(), lineno=30, col_offset=28, end_lineno=30, end_col_offset=36)), withitem(Call(Name('localcontext', Load(), lineno=31, col_offset=10, end_lineno=31, end_col_offset=22), [], [], lineno=31, col_offset=10, end_lineno=31, end_col_offset=24), Name('placeholder_5', Store(), lineno=31, col_offset=28, end_lineno=31, end_col_offset=36))], [Assign([Attribute(Name('placeholder_4', Load(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=16), 'placeholder_6', Store(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=21)], Constant(18, lineno=32, col_offset=24, end_lineno=32, end_col_offset=26), lineno=32, col_offset=8, end_lineno=32, end_col_offset=26), Assign([Attribute(Name('placeholder_4', Load(), lineno=33, col_offset=8, end_lineno=33, end_col_offset=16), 'placeholder_7', Store(), lineno=33, col_offset=8, end_lineno=33, end_col_offset=25)], Name('ROUND_UP', Load(), lineno=33, col_offset=28, end_lineno=33, end_col_offset=36), lineno=33, col_offset=8, end_lineno=33, end_col_offset=36), Assign([Attribute(Name('placeholder_5', Load(), lineno=35, col_offset=8, end_lineno=35, end_col_offset=16), 'placeholder_6', Store(), lineno=35, col_offset=8, end_lineno=35, end_col_offset=21)], Constant(12, lineno=35, col_offset=24, end_lineno=35, end_col_offset=26), lineno=35, col_offset=8, end_lineno=35, end_col_offset=26), Assign([Attribute(Name('placeholder_5', Load(), lineno=36, col_offset=8, end_lineno=36, end_col_offset=16), 'placeholder_7', Store(), lineno=36, col_offset=8, end_lineno=36, end_col_offset=25)], Name('ROUND_DOWN', Load(), lineno=36, col_offset=28, end_lineno=36, end_col_offset=38), lineno=36, col_offset=8, end_lineno=36, end_col_offset=38), Assign([Name('placeholder_8', Store(), lineno=38, col_offset=8, end_lineno=38, end_col_offset=23)], BinOp(Name('placeholder_3', Load(), lineno=38, col_offset=26, end_lineno=38, end_col_offset=43), Div(), Call(Name('Decimal', Load(), lineno=38, col_offset=46, end_lineno=38, end_col_offset=53), [BinOp(BinOp(BinOp(Constant(60, lineno=38, col_offset=54, end_lineno=38, end_col_offset=56), Mult(), Constant(60, lineno=38, col_offset=59, end_lineno=38, end_col_offset=61), lineno=38, col_offset=54, end_lineno=38, end_col_offset=61), Mult(), Constant(24, lineno=38, col_offset=64, end_lineno=38, end_col_offset=66), lineno=38, col_offset=54, end_lineno=38, end_col_offset=66), Mult(), Constant(365, lineno=38, col_offset=69, end_lineno=38, end_col_offset=72), lineno=38, col_offset=54, end_lineno=38, end_col_offset=72)], [], lineno=38, col_offset=46, end_lineno=38, end_col_offset=73), lineno=38, col_offset=26, end_lineno=38, end_col_offset=73), lineno=38, col_offset=8, end_lineno=38, end_col_offset=73), Assign([Name('placeholder_9', Store(), lineno=39, col_offset=8, end_lineno=39, end_col_offset=18)], BinOp(BinOp(Constant(1, lineno=39, col_offset=22, end_lineno=39, end_col_offset=23), Sub(), Name('placeholder_2', Load(), lineno=39, col_offset=26, end_lineno=39, end_col_offset=36), lineno=39, col_offset=22, end_lineno=39, end_col_offset=36), Div(), BinOp(Name('placeholder_2', Load(), lineno=39, col_offset=41, end_lineno=39, end_col_offset=51), Mult(), Name('placeholder_8', Load(), lineno=39, col_offset=54, end_lineno=39, end_col_offset=69), lineno=39, col_offset=41, end_lineno=39, end_col_offset=69), lineno=39, col_offset=21, end_lineno=39, end_col_offset=70), lineno=39, col_offset=8, end_lineno=39, end_col_offset=70)], lineno=30, col_offset=4, end_lineno=39, end_col_offset=70), Return(Name('placeholder_9', Load(), lineno=40, col_offset=11, end_lineno=40, end_col_offset=21), lineno=40, col_offset=4, end_lineno=40, end_col_offset=21)], [], lineno=12, col_offset=0, end_lineno=40, end_col_offset=21), Expr(Constant('convert json to jsonl', lineno=48, col_offset=0, end_lineno=48, end_col_offset=27), lineno=48, col_offset=0, end_lineno=48, end_col_offset=27), ImportFrom('argparse', [alias('ArgumentParser', lineno=50, col_offset=21, end_lineno=50, end_col_offset=35)], 0, lineno=50, col_offset=0, end_lineno=50, end_col_offset=35), Import([alias('json', lineno=51, col_offset=7, end_lineno=51, end_col_offset=11)], lineno=51, col_offset=0, end_lineno=51, end_col_offset=11), FunctionDef('placeholder_10', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_11', Store(), lineno=54, col_offset=4, end_lineno=54, end_col_offset=8)], Call(Name('parse_args', Load(), lineno=54, col_offset=11, end_lineno=54, end_col_offset=21), [], [], lineno=54, col_offset=11, end_lineno=54, end_col_offset=23), lineno=54, col_offset=4, end_lineno=54, end_col_offset=23), With([withitem(Call(Name('open', Load(), lineno=58, col_offset=8, end_lineno=58, end_col_offset=12), [Attribute(Name('placeholder_11', Load(), lineno=58, col_offset=13, end_lineno=58, end_col_offset=17), 'in_filename', Load(), lineno=58, col_offset=13, end_lineno=58, end_col_offset=29)], [], lineno=58, col_offset=8, end_lineno=58, end_col_offset=30), Name('placeholder_12', Store(), lineno=58, col_offset=34, end_lineno=58, end_col_offset=41)), withitem(Call(Name('open', Load(), lineno=59, col_offset=8, end_lineno=59, end_col_offset=12), [Attribute(Name('placeholder_11', Load(), lineno=59, col_offset=13, end_lineno=59, end_col_offset=17), 'out_filename', Load(), lineno=59, col_offset=13, end_lineno=59, end_col_offset=30)], [keyword('placeholder_13', Constant('wt', lineno=59, col_offset=37, end_lineno=59, end_col_offset=41), lineno=59, col_offset=32, end_lineno=59, end_col_offset=41)], lineno=59, col_offset=8, end_lineno=59, end_col_offset=42), Name('placeholder_14', Store(), lineno=59, col_offset=46, end_lineno=59, end_col_offset=54))], [Assign([Name('placeholder_15', Store(), lineno=61, col_offset=8, end_lineno=61, end_col_offset=15)], Call(Attribute(Name('json', Load(), lineno=61, col_offset=18, end_lineno=61, end_col_offset=22), 'load', Load(), lineno=61, col_offset=18, end_lineno=61, end_col_offset=27), [Name('placeholder_12', Load(), lineno=61, col_offset=28, end_lineno=61, end_col_offset=35)], [], lineno=61, col_offset=18, end_lineno=61, end_col_offset=36), lineno=61, col_offset=8, end_lineno=61, end_col_offset=36), For(Name('placeholder_16', Store(), lineno=62, col_offset=12, end_lineno=62, end_col_offset=18), Name('placeholder_15', Load(), lineno=62, col_offset=22, end_lineno=62, end_col_offset=29), [Expr(Call(Attribute(Name('placeholder_14', Load(), lineno=63, col_offset=12, end_lineno=63, end_col_offset=20), 'write', Load(), lineno=63, col_offset=12, end_lineno=63, end_col_offset=26), [BinOp(Call(Attribute(Name('json', Load(), lineno=63, col_offset=27, end_lineno=63, end_col_offset=31), 'dumps', Load(), lineno=63, col_offset=27, end_lineno=63, end_col_offset=37), [Name('placeholder_16', Load(), lineno=63, col_offset=38, end_lineno=63, end_col_offset=44)], [], lineno=63, col_offset=27, end_lineno=63, end_col_offset=45), Add(), Constant('\n', lineno=63, col_offset=48, end_lineno=63, end_col_offset=52), lineno=63, col_offset=27, end_lineno=63, end_col_offset=52)], [], lineno=63, col_offset=12, end_lineno=63, end_col_offset=53), lineno=63, col_offset=12, end_lineno=63, end_col_offset=53)], [], lineno=62, col_offset=8, end_lineno=63, end_col_offset=53)], lineno=57, col_offset=4, end_lineno=63, end_col_offset=53)], [], lineno=53, col_offset=0, end_lineno=63, end_col_offset=53), FunctionDef('placeholder_17', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_18', Store(), lineno=67, col_offset=4, end_lineno=67, end_col_offset=10)], Call(Name('ArgumentParser', Load(), lineno=67, col_offset=13, end_lineno=67, end_col_offset=27), [], [], lineno=67, col_offset=13, end_lineno=67, end_col_offset=29), lineno=67, col_offset=4, end_lineno=67, end_col_offset=29), Expr(Call(Attribute(Name('placeholder_18', Load(), lineno=68, col_offset=4, end_lineno=68, end_col_offset=10), 'add_argument', Load(), lineno=68, col_offset=4, end_lineno=68, end_col_offset=23), [Constant('in_filename', lineno=68, col_offset=24, end_lineno=68, end_col_offset=37)], [], lineno=68, col_offset=4, end_lineno=68, end_col_offset=38), lineno=68, col_offset=4, end_lineno=68, end_col_offset=38), Expr(Call(Attribute(Name('placeholder_18', Load(), lineno=69, col_offset=4, end_lineno=69, end_col_offset=10), 'add_argument', Load(), lineno=69, col_offset=4, end_lineno=69, end_col_offset=23), [Constant('out_filename', lineno=69, col_offset=24, end_lineno=69, end_col_offset=38)], [], lineno=69, col_offset=4, end_lineno=69, end_col_offset=39), lineno=69, col_offset=4, end_lineno=69, end_col_offset=39), Assign([Name('placeholder_11', Store(), lineno=70, col_offset=4, end_lineno=70, end_col_offset=8)], Call(Attribute(Name('placeholder_18', Load(), lineno=70, col_offset=11, end_lineno=70, end_col_offset=17), 'placeholder_17', Load(), lineno=70, col_offset=11, end_lineno=70, end_col_offset=28), [], [], lineno=70, col_offset=11, end_lineno=70, end_col_offset=30), lineno=70, col_offset=4, end_lineno=70, end_col_offset=30), Return(Name('placeholder_11', Load(), lineno=71, col_offset=11, end_lineno=71, end_col_offset=15), lineno=71, col_offset=4, end_lineno=71, end_col_offset=15)], [], lineno=66, col_offset=0, end_lineno=71, end_col_offset=15)], []) \ No newline at end of file From 5d258283689abb0bd1df42b2ad0dbb9f6feb73c5 Mon Sep 17 00:00:00 2001 From: brocla Date: Tue, 19 Mar 2024 20:04:16 -0600 Subject: [PATCH 09/14] Fix `localcontext` example to use separate `with statements. --- .../example_parencontext_normalization.py | 22 +- .../mapping.json | 29 +- .../representation.out | 1341 +++++++++-------- .../representation.txt | 2 +- 4 files changed, 706 insertions(+), 688 deletions(-) diff --git a/test/example-parencontext-normalization/example_parencontext_normalization.py b/test/example-parencontext-normalization/example_parencontext_normalization.py index be4ddd1..fdb8d51 100644 --- a/test/example-parencontext-normalization/example_parencontext_normalization.py +++ b/test/example-parencontext-normalization/example_parencontext_normalization.py @@ -2,7 +2,8 @@ -# This example shows parens around two `localcontext` context mangers. +# This example shows parens around a `localcontext` context mangers. +# Uses two styles of parens. """Calculate the fixed interest rate.""" from decimal import ROUND_DOWN, ROUND_UP, Decimal, localcontext @@ -27,15 +28,18 @@ def calc_fixed_rate(spot_price: pd.Series, position_duration: Decimal) -> pd.Ser # Position duration (in seconds) in terms of fraction of year # This div should round up # This replicates div up in fixed point - with (localcontext() as ctx_time, - localcontext() as ctx_rate): - ctx_time.prec = 18 - ctx_time.rounding = ROUND_UP - - ctx_rate.prec = 12 - ctx_rate.rounding = ROUND_DOWN - + with (localcontext() as ctx): + ctx.prec = 18 + ctx.rounding = ROUND_UP annualized_time = position_duration / Decimal(60 * 60 * 24 * 365) + + # Pandas is smart enough to be able to broadcast with internal Decimal types at runtime + # We keep things in 18 precision here + with ( + localcontext() as ctx + ): + ctx.prec = 18 + ctx.rounding = ROUND_DOWN fixed_rate = (1 - spot_price) / (spot_price * annualized_time) # type: ignore return fixed_rate diff --git a/test/example-parencontext-normalization/mapping.json b/test/example-parencontext-normalization/mapping.json index 207d14d..4b253ea 100644 --- a/test/example-parencontext-normalization/mapping.json +++ b/test/example-parencontext-normalization/mapping.json @@ -3,19 +3,18 @@ "placeholder_1": "calc_fixed_rate", "placeholder_2": "spot_price", "placeholder_3": "position_duration", - "placeholder_4": "ctx_time", - "placeholder_5": "ctx_rate", - "placeholder_6": "prec", - "placeholder_7": "rounding", - "placeholder_8": "annualized_time", - "placeholder_9": "fixed_rate", - "placeholder_10": "main", - "placeholder_11": "args", - "placeholder_12": "in_file", - "placeholder_13": "mode", - "placeholder_14": "out_file", - "placeholder_15": "records", - "placeholder_16": "record", - "placeholder_17": "parse_args", - "placeholder_18": "parser" + "placeholder_4": "ctx", + "placeholder_5": "prec", + "placeholder_6": "rounding", + "placeholder_7": "annualized_time", + "placeholder_8": "fixed_rate", + "placeholder_9": "main", + "placeholder_10": "args", + "placeholder_11": "in_file", + "placeholder_12": "mode", + "placeholder_13": "out_file", + "placeholder_14": "records", + "placeholder_15": "record", + "placeholder_16": "parse_args", + "placeholder_17": "parser" } \ No newline at end of file diff --git a/test/example-parencontext-normalization/representation.out b/test/example-parencontext-normalization/representation.out index 2b63791..bbe3fe3 100644 --- a/test/example-parencontext-normalization/representation.out +++ b/test/example-parencontext-normalization/representation.out @@ -5,14 +5,15 @@ import pandas as placeholder_0 def placeholder_1(placeholder_2, placeholder_3): - with localcontext() as placeholder_4, localcontext() as placeholder_5: - placeholder_4.placeholder_6 = 18 - placeholder_4.placeholder_7 = ROUND_UP - placeholder_5.placeholder_6 = 12 - placeholder_5.placeholder_7 = ROUND_DOWN - placeholder_8 = placeholder_3 / Decimal(60 * 60 * 24 * 365) - placeholder_9 = (1 - placeholder_2) / (placeholder_2 * placeholder_8) - return placeholder_9 + with localcontext() as placeholder_4: + placeholder_4.placeholder_5 = 18 + placeholder_4.placeholder_6 = ROUND_UP + placeholder_7 = placeholder_3 / Decimal(60 * 60 * 24 * 365) + with localcontext() as placeholder_4: + placeholder_4.placeholder_5 = 18 + placeholder_4.placeholder_6 = ROUND_DOWN + placeholder_8 = (1 - placeholder_2) / (placeholder_2 * placeholder_7) + return placeholder_8 "convert json to jsonl" @@ -20,22 +21,22 @@ from argparse import ArgumentParser import json -def placeholder_10(): - placeholder_11 = parse_args() - with open(placeholder_11.in_filename) as placeholder_12, open( - placeholder_11.out_filename, placeholder_13="wt" - ) as placeholder_14: - placeholder_15 = json.load(placeholder_12) - for placeholder_16 in placeholder_15: - placeholder_14.write(json.dumps(placeholder_16) + "\n") +def placeholder_9(): + placeholder_10 = parse_args() + with open(placeholder_10.in_filename) as placeholder_11, open( + placeholder_10.out_filename, placeholder_12="wt" + ) as placeholder_13: + placeholder_14 = json.load(placeholder_11) + for placeholder_15 in placeholder_14: + placeholder_13.write(json.dumps(placeholder_15) + "\n") -def placeholder_17(): - placeholder_18 = ArgumentParser() - placeholder_18.add_argument("in_filename") - placeholder_18.add_argument("out_filename") - placeholder_11 = placeholder_18.placeholder_17() - return placeholder_11 +def placeholder_16(): + placeholder_17 = ArgumentParser() + placeholder_17.add_argument("in_filename") + placeholder_17.add_argument("out_filename") + placeholder_10 = placeholder_17.placeholder_16() + return placeholder_10 ## END NORMALIZED CODE ## @@ -56,58 +57,58 @@ Module( Expr( Constant( 'Calculate the fixed interest rate.', - lineno=6, + lineno=7, col_offset=0, - end_lineno=6, + end_lineno=7, end_col_offset=40), - lineno=6, + lineno=7, col_offset=0, - end_lineno=6, + end_lineno=7, end_col_offset=40), ImportFrom( 'decimal', [ alias( 'ROUND_DOWN', - lineno=8, + lineno=9, col_offset=20, - end_lineno=8, + end_lineno=9, end_col_offset=30), alias( 'ROUND_UP', - lineno=8, + lineno=9, col_offset=32, - end_lineno=8, + end_lineno=9, end_col_offset=40), alias( 'Decimal', - lineno=8, + lineno=9, col_offset=42, - end_lineno=8, + end_lineno=9, end_col_offset=49), alias( 'localcontext', - lineno=8, + lineno=9, col_offset=51, - end_lineno=8, + end_lineno=9, end_col_offset=63)], 0, - lineno=8, + lineno=9, col_offset=0, - end_lineno=8, + end_lineno=9, end_col_offset=63), Import( [ alias( 'pandas', 'pd', - lineno=9, + lineno=10, col_offset=7, - end_lineno=9, + end_lineno=10, end_col_offset=19)], - lineno=9, + lineno=10, col_offset=0, - end_lineno=9, + end_lineno=10, end_col_offset=19), FunctionDef( 'calc_fixed_rate', @@ -120,32 +121,32 @@ Module( Name( 'pd', Load(), - lineno=12, + lineno=13, col_offset=32, - end_lineno=12, + end_lineno=13, end_col_offset=34), 'Series', Load(), - lineno=12, + lineno=13, col_offset=32, - end_lineno=12, + end_lineno=13, end_col_offset=41), - lineno=12, + lineno=13, col_offset=20, - end_lineno=12, + end_lineno=13, end_col_offset=41), arg( 'position_duration', Name( 'Decimal', Load(), - lineno=12, + lineno=13, col_offset=62, - end_lineno=12, + end_lineno=13, end_col_offset=69), - lineno=12, + lineno=13, col_offset=43, - end_lineno=12, + end_lineno=13, end_col_offset=69)], kwonlyargs=[], kw_defaults=[], @@ -154,38 +155,16 @@ Module( Expr( Constant( 'Calculates the fixed rate given trade data.\n\n Arguments\n ---------\n spot_price: pd.Series\n The spot price.\n position_duration: Decimal\n The position duration in seconds.\n\n Returns\n -------\n pd.Series\n The fixed interest rate.\n ', - lineno=13, + lineno=14, col_offset=4, - end_lineno=26, + end_lineno=27, end_col_offset=7), - lineno=13, + lineno=14, col_offset=4, - end_lineno=26, + end_lineno=27, end_col_offset=7), With( [ - withitem( - Call( - Name( - 'localcontext', - Load(), - lineno=30, - col_offset=10, - end_lineno=30, - end_col_offset=22), - [], - [], - lineno=30, - col_offset=10, - end_lineno=30, - end_col_offset=24), - Name( - 'ctx_time', - Store(), - lineno=30, - col_offset=28, - end_lineno=30, - end_col_offset=36)), withitem( Call( Name( @@ -202,144 +181,91 @@ Module( end_lineno=31, end_col_offset=24), Name( - 'ctx_rate', + 'ctx', Store(), lineno=31, col_offset=28, end_lineno=31, - end_col_offset=36))], + end_col_offset=31))], [ Assign( [ Attribute( Name( - 'ctx_time', + 'ctx', Load(), lineno=32, col_offset=8, end_lineno=32, - end_col_offset=16), + end_col_offset=11), 'prec', Store(), lineno=32, col_offset=8, end_lineno=32, - end_col_offset=21)], + end_col_offset=16)], Constant( 18, lineno=32, - col_offset=24, + col_offset=19, end_lineno=32, - end_col_offset=26), + end_col_offset=21), lineno=32, col_offset=8, end_lineno=32, - end_col_offset=26), + end_col_offset=21), Assign( [ Attribute( Name( - 'ctx_time', + 'ctx', Load(), lineno=33, col_offset=8, end_lineno=33, - end_col_offset=16), + end_col_offset=11), 'rounding', Store(), lineno=33, col_offset=8, end_lineno=33, - end_col_offset=25)], + end_col_offset=20)], Name( 'ROUND_UP', Load(), lineno=33, - col_offset=28, + col_offset=23, end_lineno=33, - end_col_offset=36), + end_col_offset=31), lineno=33, col_offset=8, end_lineno=33, - end_col_offset=36), - Assign( - [ - Attribute( - Name( - 'ctx_rate', - Load(), - lineno=35, - col_offset=8, - end_lineno=35, - end_col_offset=16), - 'prec', - Store(), - lineno=35, - col_offset=8, - end_lineno=35, - end_col_offset=21)], - Constant( - 12, - lineno=35, - col_offset=24, - end_lineno=35, - end_col_offset=26), - lineno=35, - col_offset=8, - end_lineno=35, - end_col_offset=26), - Assign( - [ - Attribute( - Name( - 'ctx_rate', - Load(), - lineno=36, - col_offset=8, - end_lineno=36, - end_col_offset=16), - 'rounding', - Store(), - lineno=36, - col_offset=8, - end_lineno=36, - end_col_offset=25)], - Name( - 'ROUND_DOWN', - Load(), - lineno=36, - col_offset=28, - end_lineno=36, - end_col_offset=38), - lineno=36, - col_offset=8, - end_lineno=36, - end_col_offset=38), + end_col_offset=31), Assign( [ Name( 'annualized_time', Store(), - lineno=38, + lineno=34, col_offset=8, - end_lineno=38, + end_lineno=34, end_col_offset=23)], BinOp( Name( 'position_duration', Load(), - lineno=38, + lineno=34, col_offset=26, - end_lineno=38, + end_lineno=34, end_col_offset=43), Div(), Call( Name( 'Decimal', Load(), - lineno=38, + lineno=34, col_offset=46, - end_lineno=38, + end_lineno=34, end_col_offset=53), [ BinOp( @@ -347,185 +273,267 @@ Module( BinOp( Constant( 60, - lineno=38, + lineno=34, col_offset=54, - end_lineno=38, + end_lineno=34, end_col_offset=56), Mult(), Constant( 60, - lineno=38, + lineno=34, col_offset=59, - end_lineno=38, + end_lineno=34, end_col_offset=61), - lineno=38, + lineno=34, col_offset=54, - end_lineno=38, + end_lineno=34, end_col_offset=61), Mult(), Constant( 24, - lineno=38, + lineno=34, col_offset=64, - end_lineno=38, + end_lineno=34, end_col_offset=66), - lineno=38, + lineno=34, col_offset=54, - end_lineno=38, + end_lineno=34, end_col_offset=66), Mult(), Constant( 365, - lineno=38, + lineno=34, col_offset=69, - end_lineno=38, + end_lineno=34, end_col_offset=72), - lineno=38, + lineno=34, col_offset=54, - end_lineno=38, + end_lineno=34, end_col_offset=72)], [], - lineno=38, + lineno=34, col_offset=46, - end_lineno=38, + end_lineno=34, end_col_offset=73), - lineno=38, + lineno=34, col_offset=26, - end_lineno=38, + end_lineno=34, end_col_offset=73), - lineno=38, + lineno=34, + col_offset=8, + end_lineno=34, + end_col_offset=73)], + lineno=31, + col_offset=4, + end_lineno=34, + end_col_offset=73), + With( + [ + withitem( + Call( + Name( + 'localcontext', + Load(), + lineno=39, + col_offset=8, + end_lineno=39, + end_col_offset=20), + [], + [], + lineno=39, + col_offset=8, + end_lineno=39, + end_col_offset=22), + Name( + 'ctx', + Store(), + lineno=39, + col_offset=26, + end_lineno=39, + end_col_offset=29))], + [ + Assign( + [ + Attribute( + Name( + 'ctx', + Load(), + lineno=41, + col_offset=8, + end_lineno=41, + end_col_offset=11), + 'prec', + Store(), + lineno=41, + col_offset=8, + end_lineno=41, + end_col_offset=16)], + Constant( + 18, + lineno=41, + col_offset=19, + end_lineno=41, + end_col_offset=21), + lineno=41, + col_offset=8, + end_lineno=41, + end_col_offset=21), + Assign( + [ + Attribute( + Name( + 'ctx', + Load(), + lineno=42, + col_offset=8, + end_lineno=42, + end_col_offset=11), + 'rounding', + Store(), + lineno=42, + col_offset=8, + end_lineno=42, + end_col_offset=20)], + Name( + 'ROUND_DOWN', + Load(), + lineno=42, + col_offset=23, + end_lineno=42, + end_col_offset=33), + lineno=42, col_offset=8, - end_lineno=38, - end_col_offset=73), + end_lineno=42, + end_col_offset=33), Assign( [ Name( 'fixed_rate', Store(), - lineno=39, + lineno=43, col_offset=8, - end_lineno=39, + end_lineno=43, end_col_offset=18)], BinOp( BinOp( Constant( 1, - lineno=39, + lineno=43, col_offset=22, - end_lineno=39, + end_lineno=43, end_col_offset=23), Sub(), Name( 'spot_price', Load(), - lineno=39, + lineno=43, col_offset=26, - end_lineno=39, + end_lineno=43, end_col_offset=36), - lineno=39, + lineno=43, col_offset=22, - end_lineno=39, + end_lineno=43, end_col_offset=36), Div(), BinOp( Name( 'spot_price', Load(), - lineno=39, + lineno=43, col_offset=41, - end_lineno=39, + end_lineno=43, end_col_offset=51), Mult(), Name( 'annualized_time', Load(), - lineno=39, + lineno=43, col_offset=54, - end_lineno=39, + end_lineno=43, end_col_offset=69), - lineno=39, + lineno=43, col_offset=41, - end_lineno=39, + end_lineno=43, end_col_offset=69), - lineno=39, + lineno=43, col_offset=21, - end_lineno=39, + end_lineno=43, end_col_offset=70), - lineno=39, + lineno=43, col_offset=8, - end_lineno=39, + end_lineno=43, end_col_offset=70)], - lineno=30, + lineno=38, col_offset=4, - end_lineno=39, + end_lineno=43, end_col_offset=70), Return( Name( 'fixed_rate', Load(), - lineno=40, + lineno=44, col_offset=11, - end_lineno=40, + end_lineno=44, end_col_offset=21), - lineno=40, + lineno=44, col_offset=4, - end_lineno=40, + end_lineno=44, end_col_offset=21)], [], Attribute( Name( 'pd', Load(), - lineno=12, + lineno=13, col_offset=74, - end_lineno=12, + end_lineno=13, end_col_offset=76), 'Series', Load(), - lineno=12, + lineno=13, col_offset=74, - end_lineno=12, + end_lineno=13, end_col_offset=83), - lineno=12, + lineno=13, col_offset=0, - end_lineno=40, + end_lineno=44, end_col_offset=21), Expr( Constant( 'convert json to jsonl', - lineno=48, + lineno=52, col_offset=0, - end_lineno=48, + end_lineno=52, end_col_offset=27), - lineno=48, + lineno=52, col_offset=0, - end_lineno=48, + end_lineno=52, end_col_offset=27), ImportFrom( 'argparse', [ alias( 'ArgumentParser', - lineno=50, + lineno=54, col_offset=21, - end_lineno=50, + end_lineno=54, end_col_offset=35)], 0, - lineno=50, + lineno=54, col_offset=0, - end_lineno=50, + end_lineno=54, end_col_offset=35), Import( [ alias( 'json', - lineno=51, + lineno=55, col_offset=7, - end_lineno=51, + end_lineno=55, end_col_offset=11)], - lineno=51, + lineno=55, col_offset=0, - end_lineno=51, + end_lineno=55, end_col_offset=11), FunctionDef( 'main', @@ -541,27 +549,27 @@ Module( Name( 'args', Store(), - lineno=54, + lineno=58, col_offset=4, - end_lineno=54, + end_lineno=58, end_col_offset=8)], Call( Name( 'parse_args', Load(), - lineno=54, + lineno=58, col_offset=11, - end_lineno=54, + end_lineno=58, end_col_offset=21), [], [], - lineno=54, + lineno=58, col_offset=11, - end_lineno=54, + end_lineno=58, end_col_offset=23), - lineno=54, + lineno=58, col_offset=4, - end_lineno=54, + end_lineno=58, end_col_offset=23), With( [ @@ -570,84 +578,84 @@ Module( Name( 'open', Load(), - lineno=58, + lineno=62, col_offset=8, - end_lineno=58, + end_lineno=62, end_col_offset=12), [ Attribute( Name( 'args', Load(), - lineno=58, + lineno=62, col_offset=13, - end_lineno=58, + end_lineno=62, end_col_offset=17), 'in_filename', Load(), - lineno=58, + lineno=62, col_offset=13, - end_lineno=58, + end_lineno=62, end_col_offset=29)], [], - lineno=58, + lineno=62, col_offset=8, - end_lineno=58, + end_lineno=62, end_col_offset=30), Name( 'in_file', Store(), - lineno=58, + lineno=62, col_offset=34, - end_lineno=58, + end_lineno=62, end_col_offset=41)), withitem( Call( Name( 'open', Load(), - lineno=59, + lineno=63, col_offset=8, - end_lineno=59, + end_lineno=63, end_col_offset=12), [ Attribute( Name( 'args', Load(), - lineno=59, + lineno=63, col_offset=13, - end_lineno=59, + end_lineno=63, end_col_offset=17), 'out_filename', Load(), - lineno=59, + lineno=63, col_offset=13, - end_lineno=59, + end_lineno=63, end_col_offset=30)], [ keyword( 'mode', Constant( 'wt', - lineno=59, + lineno=63, col_offset=37, - end_lineno=59, + end_lineno=63, end_col_offset=41), - lineno=59, + lineno=63, col_offset=32, - end_lineno=59, + end_lineno=63, end_col_offset=41)], - lineno=59, + lineno=63, col_offset=8, - end_lineno=59, + end_lineno=63, end_col_offset=42), Name( 'out_file', Store(), - lineno=59, + lineno=63, col_offset=46, - end_lineno=59, + end_lineno=63, end_col_offset=54))], [ Assign( @@ -655,56 +663,56 @@ Module( Name( 'records', Store(), - lineno=61, + lineno=65, col_offset=8, - end_lineno=61, + end_lineno=65, end_col_offset=15)], Call( Attribute( Name( 'json', Load(), - lineno=61, + lineno=65, col_offset=18, - end_lineno=61, + end_lineno=65, end_col_offset=22), 'load', Load(), - lineno=61, + lineno=65, col_offset=18, - end_lineno=61, + end_lineno=65, end_col_offset=27), [ Name( 'in_file', Load(), - lineno=61, + lineno=65, col_offset=28, - end_lineno=61, + end_lineno=65, end_col_offset=35)], [], - lineno=61, + lineno=65, col_offset=18, - end_lineno=61, + end_lineno=65, end_col_offset=36), - lineno=61, + lineno=65, col_offset=8, - end_lineno=61, + end_lineno=65, end_col_offset=36), For( Name( 'record', Store(), - lineno=62, + lineno=66, col_offset=12, - end_lineno=62, + end_lineno=66, end_col_offset=18), Name( 'records', Load(), - lineno=62, + lineno=66, col_offset=22, - end_lineno=62, + end_lineno=66, end_col_offset=29), [ Expr( @@ -713,15 +721,15 @@ Module( Name( 'out_file', Load(), - lineno=63, + lineno=67, col_offset=12, - end_lineno=63, + end_lineno=67, end_col_offset=20), 'write', Load(), - lineno=63, + lineno=67, col_offset=12, - end_lineno=63, + end_lineno=67, end_col_offset=26), [ BinOp( @@ -730,62 +738,62 @@ Module( Name( 'json', Load(), - lineno=63, + lineno=67, col_offset=27, - end_lineno=63, + end_lineno=67, end_col_offset=31), 'dumps', Load(), - lineno=63, + lineno=67, col_offset=27, - end_lineno=63, + end_lineno=67, end_col_offset=37), [ Name( 'record', Load(), - lineno=63, + lineno=67, col_offset=38, - end_lineno=63, + end_lineno=67, end_col_offset=44)], [], - lineno=63, + lineno=67, col_offset=27, - end_lineno=63, + end_lineno=67, end_col_offset=45), Add(), Constant( '\n', - lineno=63, + lineno=67, col_offset=48, - end_lineno=63, + end_lineno=67, end_col_offset=52), - lineno=63, + lineno=67, col_offset=27, - end_lineno=63, + end_lineno=67, end_col_offset=52)], [], - lineno=63, + lineno=67, col_offset=12, - end_lineno=63, + end_lineno=67, end_col_offset=53), - lineno=63, + lineno=67, col_offset=12, - end_lineno=63, + end_lineno=67, end_col_offset=53)], [], - lineno=62, + lineno=66, col_offset=8, - end_lineno=63, + end_lineno=67, end_col_offset=53)], - lineno=57, + lineno=61, col_offset=4, - end_lineno=63, + end_lineno=67, end_col_offset=53)], [], - lineno=53, + lineno=57, col_offset=0, - end_lineno=63, + end_lineno=67, end_col_offset=53), FunctionDef( 'parse_args', @@ -801,27 +809,27 @@ Module( Name( 'parser', Store(), - lineno=67, + lineno=71, col_offset=4, - end_lineno=67, + end_lineno=71, end_col_offset=10)], Call( Name( 'ArgumentParser', Load(), - lineno=67, + lineno=71, col_offset=13, - end_lineno=67, + end_lineno=71, end_col_offset=27), [], [], - lineno=67, + lineno=71, col_offset=13, - end_lineno=67, + end_lineno=71, end_col_offset=29), - lineno=67, + lineno=71, col_offset=4, - end_lineno=67, + end_lineno=71, end_col_offset=29), Expr( Call( @@ -829,31 +837,31 @@ Module( Name( 'parser', Load(), - lineno=68, + lineno=72, col_offset=4, - end_lineno=68, + end_lineno=72, end_col_offset=10), 'add_argument', Load(), - lineno=68, + lineno=72, col_offset=4, - end_lineno=68, + end_lineno=72, end_col_offset=23), [ Constant( 'in_filename', - lineno=68, + lineno=72, col_offset=24, - end_lineno=68, + end_lineno=72, end_col_offset=37)], [], - lineno=68, + lineno=72, col_offset=4, - end_lineno=68, + end_lineno=72, end_col_offset=38), - lineno=68, + lineno=72, col_offset=4, - end_lineno=68, + end_lineno=72, end_col_offset=38), Expr( Call( @@ -861,104 +869,104 @@ Module( Name( 'parser', Load(), - lineno=69, + lineno=73, col_offset=4, - end_lineno=69, + end_lineno=73, end_col_offset=10), 'add_argument', Load(), - lineno=69, + lineno=73, col_offset=4, - end_lineno=69, + end_lineno=73, end_col_offset=23), [ Constant( 'out_filename', - lineno=69, + lineno=73, col_offset=24, - end_lineno=69, + end_lineno=73, end_col_offset=38)], [], - lineno=69, + lineno=73, col_offset=4, - end_lineno=69, + end_lineno=73, end_col_offset=39), - lineno=69, + lineno=73, col_offset=4, - end_lineno=69, + end_lineno=73, end_col_offset=39), Assign( [ Name( 'args', Store(), - lineno=70, + lineno=74, col_offset=4, - end_lineno=70, + end_lineno=74, end_col_offset=8)], Call( Attribute( Name( 'parser', Load(), - lineno=70, + lineno=74, col_offset=11, - end_lineno=70, + end_lineno=74, end_col_offset=17), 'parse_args', Load(), - lineno=70, + lineno=74, col_offset=11, - end_lineno=70, + end_lineno=74, end_col_offset=28), [], [], - lineno=70, + lineno=74, col_offset=11, - end_lineno=70, + end_lineno=74, end_col_offset=30), - lineno=70, + lineno=74, col_offset=4, - end_lineno=70, + end_lineno=74, end_col_offset=30), Return( Name( 'args', Load(), - lineno=71, + lineno=75, col_offset=11, - end_lineno=71, + end_lineno=75, end_col_offset=15), - lineno=71, + lineno=75, col_offset=4, - end_lineno=71, + end_lineno=75, end_col_offset=15)], [], - lineno=66, + lineno=70, col_offset=0, - end_lineno=71, + end_lineno=75, end_col_offset=15), If( Compare( Name( '__name__', Load(), - lineno=73, + lineno=77, col_offset=3, - end_lineno=73, + end_lineno=77, end_col_offset=11), [ Eq()], [ Constant( '__main__', - lineno=73, + lineno=77, col_offset=15, - end_lineno=73, + end_lineno=77, end_col_offset=25)], - lineno=73, + lineno=77, col_offset=3, - end_lineno=73, + end_lineno=77, end_col_offset=25), [ Expr( @@ -966,24 +974,24 @@ Module( Name( 'main', Load(), - lineno=74, + lineno=78, col_offset=4, - end_lineno=74, + end_lineno=78, end_col_offset=8), [], [], - lineno=74, + lineno=78, col_offset=4, - end_lineno=74, + end_lineno=78, end_col_offset=10), - lineno=74, + lineno=78, col_offset=4, - end_lineno=74, + end_lineno=78, end_col_offset=10)], [], - lineno=73, + lineno=77, col_offset=0, - end_lineno=74, + end_lineno=78, end_col_offset=10)], []) ## END TREE BEFORE ## @@ -994,58 +1002,58 @@ Module( Expr( Constant( 'Calculate the fixed interest rate.', - lineno=6, + lineno=7, col_offset=0, - end_lineno=6, + end_lineno=7, end_col_offset=40), - lineno=6, + lineno=7, col_offset=0, - end_lineno=6, + end_lineno=7, end_col_offset=40), ImportFrom( 'decimal', [ alias( 'ROUND_DOWN', - lineno=8, + lineno=9, col_offset=20, - end_lineno=8, + end_lineno=9, end_col_offset=30), alias( 'ROUND_UP', - lineno=8, + lineno=9, col_offset=32, - end_lineno=8, + end_lineno=9, end_col_offset=40), alias( 'Decimal', - lineno=8, + lineno=9, col_offset=42, - end_lineno=8, + end_lineno=9, end_col_offset=49), alias( 'localcontext', - lineno=8, + lineno=9, col_offset=51, - end_lineno=8, + end_lineno=9, end_col_offset=63)], 0, - lineno=8, + lineno=9, col_offset=0, - end_lineno=8, + end_lineno=9, end_col_offset=63), Import( [ alias( 'pandas', 'placeholder_0', - lineno=9, + lineno=10, col_offset=7, - end_lineno=9, + end_lineno=10, end_col_offset=19)], - lineno=9, + lineno=10, col_offset=0, - end_lineno=9, + end_lineno=10, end_col_offset=19), FunctionDef( 'placeholder_1', @@ -1054,15 +1062,15 @@ Module( [ arg( 'placeholder_2', - lineno=12, + lineno=13, col_offset=20, - end_lineno=12, + end_lineno=13, end_col_offset=41), arg( 'placeholder_3', - lineno=12, + lineno=13, col_offset=43, - end_lineno=12, + end_lineno=13, end_col_offset=69)], kwonlyargs=[], kw_defaults=[], @@ -1070,28 +1078,6 @@ Module( [ With( [ - withitem( - Call( - Name( - 'localcontext', - Load(), - lineno=30, - col_offset=10, - end_lineno=30, - end_col_offset=22), - [], - [], - lineno=30, - col_offset=10, - end_lineno=30, - end_col_offset=24), - Name( - 'placeholder_4', - Store(), - lineno=30, - col_offset=28, - end_lineno=30, - end_col_offset=36)), withitem( Call( Name( @@ -1108,12 +1094,12 @@ Module( end_lineno=31, end_col_offset=24), Name( - 'placeholder_5', + 'placeholder_4', Store(), lineno=31, col_offset=28, end_lineno=31, - end_col_offset=36))], + end_col_offset=31))], [ Assign( [ @@ -1124,23 +1110,23 @@ Module( lineno=32, col_offset=8, end_lineno=32, - end_col_offset=16), - 'placeholder_6', + end_col_offset=11), + 'placeholder_5', Store(), lineno=32, col_offset=8, end_lineno=32, - end_col_offset=21)], + end_col_offset=16)], Constant( 18, lineno=32, - col_offset=24, + col_offset=19, end_lineno=32, - end_col_offset=26), + end_col_offset=21), lineno=32, col_offset=8, end_lineno=32, - end_col_offset=26), + end_col_offset=21), Assign( [ Attribute( @@ -1150,102 +1136,49 @@ Module( lineno=33, col_offset=8, end_lineno=33, - end_col_offset=16), - 'placeholder_7', + end_col_offset=11), + 'placeholder_6', Store(), lineno=33, col_offset=8, end_lineno=33, - end_col_offset=25)], + end_col_offset=20)], Name( 'ROUND_UP', Load(), lineno=33, - col_offset=28, + col_offset=23, end_lineno=33, - end_col_offset=36), + end_col_offset=31), lineno=33, col_offset=8, end_lineno=33, - end_col_offset=36), - Assign( - [ - Attribute( - Name( - 'placeholder_5', - Load(), - lineno=35, - col_offset=8, - end_lineno=35, - end_col_offset=16), - 'placeholder_6', - Store(), - lineno=35, - col_offset=8, - end_lineno=35, - end_col_offset=21)], - Constant( - 12, - lineno=35, - col_offset=24, - end_lineno=35, - end_col_offset=26), - lineno=35, - col_offset=8, - end_lineno=35, - end_col_offset=26), - Assign( - [ - Attribute( - Name( - 'placeholder_5', - Load(), - lineno=36, - col_offset=8, - end_lineno=36, - end_col_offset=16), - 'placeholder_7', - Store(), - lineno=36, - col_offset=8, - end_lineno=36, - end_col_offset=25)], - Name( - 'ROUND_DOWN', - Load(), - lineno=36, - col_offset=28, - end_lineno=36, - end_col_offset=38), - lineno=36, - col_offset=8, - end_lineno=36, - end_col_offset=38), + end_col_offset=31), Assign( [ Name( - 'placeholder_8', + 'placeholder_7', Store(), - lineno=38, + lineno=34, col_offset=8, - end_lineno=38, + end_lineno=34, end_col_offset=23)], BinOp( Name( 'placeholder_3', Load(), - lineno=38, + lineno=34, col_offset=26, - end_lineno=38, + end_lineno=34, end_col_offset=43), Div(), Call( Name( 'Decimal', Load(), - lineno=38, + lineno=34, col_offset=46, - end_lineno=38, + end_lineno=34, end_col_offset=53), [ BinOp( @@ -1253,174 +1186,256 @@ Module( BinOp( Constant( 60, - lineno=38, + lineno=34, col_offset=54, - end_lineno=38, + end_lineno=34, end_col_offset=56), Mult(), Constant( 60, - lineno=38, + lineno=34, col_offset=59, - end_lineno=38, + end_lineno=34, end_col_offset=61), - lineno=38, + lineno=34, col_offset=54, - end_lineno=38, + end_lineno=34, end_col_offset=61), Mult(), Constant( 24, - lineno=38, + lineno=34, col_offset=64, - end_lineno=38, + end_lineno=34, end_col_offset=66), - lineno=38, + lineno=34, col_offset=54, - end_lineno=38, + end_lineno=34, end_col_offset=66), Mult(), Constant( 365, - lineno=38, + lineno=34, col_offset=69, - end_lineno=38, + end_lineno=34, end_col_offset=72), - lineno=38, + lineno=34, col_offset=54, - end_lineno=38, + end_lineno=34, end_col_offset=72)], [], - lineno=38, + lineno=34, col_offset=46, - end_lineno=38, + end_lineno=34, end_col_offset=73), - lineno=38, + lineno=34, col_offset=26, - end_lineno=38, + end_lineno=34, end_col_offset=73), - lineno=38, + lineno=34, col_offset=8, - end_lineno=38, - end_col_offset=73), + end_lineno=34, + end_col_offset=73)], + lineno=31, + col_offset=4, + end_lineno=34, + end_col_offset=73), + With( + [ + withitem( + Call( + Name( + 'localcontext', + Load(), + lineno=39, + col_offset=8, + end_lineno=39, + end_col_offset=20), + [], + [], + lineno=39, + col_offset=8, + end_lineno=39, + end_col_offset=22), + Name( + 'placeholder_4', + Store(), + lineno=39, + col_offset=26, + end_lineno=39, + end_col_offset=29))], + [ + Assign( + [ + Attribute( + Name( + 'placeholder_4', + Load(), + lineno=41, + col_offset=8, + end_lineno=41, + end_col_offset=11), + 'placeholder_5', + Store(), + lineno=41, + col_offset=8, + end_lineno=41, + end_col_offset=16)], + Constant( + 18, + lineno=41, + col_offset=19, + end_lineno=41, + end_col_offset=21), + lineno=41, + col_offset=8, + end_lineno=41, + end_col_offset=21), + Assign( + [ + Attribute( + Name( + 'placeholder_4', + Load(), + lineno=42, + col_offset=8, + end_lineno=42, + end_col_offset=11), + 'placeholder_6', + Store(), + lineno=42, + col_offset=8, + end_lineno=42, + end_col_offset=20)], + Name( + 'ROUND_DOWN', + Load(), + lineno=42, + col_offset=23, + end_lineno=42, + end_col_offset=33), + lineno=42, + col_offset=8, + end_lineno=42, + end_col_offset=33), Assign( [ Name( - 'placeholder_9', + 'placeholder_8', Store(), - lineno=39, + lineno=43, col_offset=8, - end_lineno=39, + end_lineno=43, end_col_offset=18)], BinOp( BinOp( Constant( 1, - lineno=39, + lineno=43, col_offset=22, - end_lineno=39, + end_lineno=43, end_col_offset=23), Sub(), Name( 'placeholder_2', Load(), - lineno=39, + lineno=43, col_offset=26, - end_lineno=39, + end_lineno=43, end_col_offset=36), - lineno=39, + lineno=43, col_offset=22, - end_lineno=39, + end_lineno=43, end_col_offset=36), Div(), BinOp( Name( 'placeholder_2', Load(), - lineno=39, + lineno=43, col_offset=41, - end_lineno=39, + end_lineno=43, end_col_offset=51), Mult(), Name( - 'placeholder_8', + 'placeholder_7', Load(), - lineno=39, + lineno=43, col_offset=54, - end_lineno=39, + end_lineno=43, end_col_offset=69), - lineno=39, + lineno=43, col_offset=41, - end_lineno=39, + end_lineno=43, end_col_offset=69), - lineno=39, + lineno=43, col_offset=21, - end_lineno=39, + end_lineno=43, end_col_offset=70), - lineno=39, + lineno=43, col_offset=8, - end_lineno=39, + end_lineno=43, end_col_offset=70)], - lineno=30, + lineno=38, col_offset=4, - end_lineno=39, + end_lineno=43, end_col_offset=70), Return( Name( - 'placeholder_9', + 'placeholder_8', Load(), - lineno=40, + lineno=44, col_offset=11, - end_lineno=40, + end_lineno=44, end_col_offset=21), - lineno=40, + lineno=44, col_offset=4, - end_lineno=40, + end_lineno=44, end_col_offset=21)], [], - lineno=12, + lineno=13, col_offset=0, - end_lineno=40, + end_lineno=44, end_col_offset=21), Expr( Constant( 'convert json to jsonl', - lineno=48, + lineno=52, col_offset=0, - end_lineno=48, + end_lineno=52, end_col_offset=27), - lineno=48, + lineno=52, col_offset=0, - end_lineno=48, + end_lineno=52, end_col_offset=27), ImportFrom( 'argparse', [ alias( 'ArgumentParser', - lineno=50, + lineno=54, col_offset=21, - end_lineno=50, + end_lineno=54, end_col_offset=35)], 0, - lineno=50, + lineno=54, col_offset=0, - end_lineno=50, + end_lineno=54, end_col_offset=35), Import( [ alias( 'json', - lineno=51, + lineno=55, col_offset=7, - end_lineno=51, + end_lineno=55, end_col_offset=11)], - lineno=51, + lineno=55, col_offset=0, - end_lineno=51, + end_lineno=55, end_col_offset=11), FunctionDef( - 'placeholder_10', + 'placeholder_9', arguments( [], [], @@ -1431,29 +1446,29 @@ Module( Assign( [ Name( - 'placeholder_11', + 'placeholder_10', Store(), - lineno=54, + lineno=58, col_offset=4, - end_lineno=54, + end_lineno=58, end_col_offset=8)], Call( Name( 'parse_args', Load(), - lineno=54, + lineno=58, col_offset=11, - end_lineno=54, + end_lineno=58, end_col_offset=21), [], [], - lineno=54, + lineno=58, col_offset=11, - end_lineno=54, + end_lineno=58, end_col_offset=23), - lineno=54, + lineno=58, col_offset=4, - end_lineno=54, + end_lineno=58, end_col_offset=23), With( [ @@ -1462,158 +1477,158 @@ Module( Name( 'open', Load(), - lineno=58, + lineno=62, col_offset=8, - end_lineno=58, + end_lineno=62, end_col_offset=12), [ Attribute( Name( - 'placeholder_11', + 'placeholder_10', Load(), - lineno=58, + lineno=62, col_offset=13, - end_lineno=58, + end_lineno=62, end_col_offset=17), 'in_filename', Load(), - lineno=58, + lineno=62, col_offset=13, - end_lineno=58, + end_lineno=62, end_col_offset=29)], [], - lineno=58, + lineno=62, col_offset=8, - end_lineno=58, + end_lineno=62, end_col_offset=30), Name( - 'placeholder_12', + 'placeholder_11', Store(), - lineno=58, + lineno=62, col_offset=34, - end_lineno=58, + end_lineno=62, end_col_offset=41)), withitem( Call( Name( 'open', Load(), - lineno=59, + lineno=63, col_offset=8, - end_lineno=59, + end_lineno=63, end_col_offset=12), [ Attribute( Name( - 'placeholder_11', + 'placeholder_10', Load(), - lineno=59, + lineno=63, col_offset=13, - end_lineno=59, + end_lineno=63, end_col_offset=17), 'out_filename', Load(), - lineno=59, + lineno=63, col_offset=13, - end_lineno=59, + end_lineno=63, end_col_offset=30)], [ keyword( - 'placeholder_13', + 'placeholder_12', Constant( 'wt', - lineno=59, + lineno=63, col_offset=37, - end_lineno=59, + end_lineno=63, end_col_offset=41), - lineno=59, + lineno=63, col_offset=32, - end_lineno=59, + end_lineno=63, end_col_offset=41)], - lineno=59, + lineno=63, col_offset=8, - end_lineno=59, + end_lineno=63, end_col_offset=42), Name( - 'placeholder_14', + 'placeholder_13', Store(), - lineno=59, + lineno=63, col_offset=46, - end_lineno=59, + end_lineno=63, end_col_offset=54))], [ Assign( [ Name( - 'placeholder_15', + 'placeholder_14', Store(), - lineno=61, + lineno=65, col_offset=8, - end_lineno=61, + end_lineno=65, end_col_offset=15)], Call( Attribute( Name( 'json', Load(), - lineno=61, + lineno=65, col_offset=18, - end_lineno=61, + end_lineno=65, end_col_offset=22), 'load', Load(), - lineno=61, + lineno=65, col_offset=18, - end_lineno=61, + end_lineno=65, end_col_offset=27), [ Name( - 'placeholder_12', + 'placeholder_11', Load(), - lineno=61, + lineno=65, col_offset=28, - end_lineno=61, + end_lineno=65, end_col_offset=35)], [], - lineno=61, + lineno=65, col_offset=18, - end_lineno=61, + end_lineno=65, end_col_offset=36), - lineno=61, + lineno=65, col_offset=8, - end_lineno=61, + end_lineno=65, end_col_offset=36), For( Name( - 'placeholder_16', + 'placeholder_15', Store(), - lineno=62, + lineno=66, col_offset=12, - end_lineno=62, + end_lineno=66, end_col_offset=18), Name( - 'placeholder_15', + 'placeholder_14', Load(), - lineno=62, + lineno=66, col_offset=22, - end_lineno=62, + end_lineno=66, end_col_offset=29), [ Expr( Call( Attribute( Name( - 'placeholder_14', + 'placeholder_13', Load(), - lineno=63, + lineno=67, col_offset=12, - end_lineno=63, + end_lineno=67, end_col_offset=20), 'write', Load(), - lineno=63, + lineno=67, col_offset=12, - end_lineno=63, + end_lineno=67, end_col_offset=26), [ BinOp( @@ -1622,65 +1637,65 @@ Module( Name( 'json', Load(), - lineno=63, + lineno=67, col_offset=27, - end_lineno=63, + end_lineno=67, end_col_offset=31), 'dumps', Load(), - lineno=63, + lineno=67, col_offset=27, - end_lineno=63, + end_lineno=67, end_col_offset=37), [ Name( - 'placeholder_16', + 'placeholder_15', Load(), - lineno=63, + lineno=67, col_offset=38, - end_lineno=63, + end_lineno=67, end_col_offset=44)], [], - lineno=63, + lineno=67, col_offset=27, - end_lineno=63, + end_lineno=67, end_col_offset=45), Add(), Constant( '\n', - lineno=63, + lineno=67, col_offset=48, - end_lineno=63, + end_lineno=67, end_col_offset=52), - lineno=63, + lineno=67, col_offset=27, - end_lineno=63, + end_lineno=67, end_col_offset=52)], [], - lineno=63, + lineno=67, col_offset=12, - end_lineno=63, + end_lineno=67, end_col_offset=53), - lineno=63, + lineno=67, col_offset=12, - end_lineno=63, + end_lineno=67, end_col_offset=53)], [], - lineno=62, + lineno=66, col_offset=8, - end_lineno=63, + end_lineno=67, end_col_offset=53)], - lineno=57, + lineno=61, col_offset=4, - end_lineno=63, + end_lineno=67, end_col_offset=53)], [], - lineno=53, + lineno=57, col_offset=0, - end_lineno=63, + end_lineno=67, end_col_offset=53), FunctionDef( - 'placeholder_17', + 'placeholder_16', arguments( [], [], @@ -1691,144 +1706,144 @@ Module( Assign( [ Name( - 'placeholder_18', + 'placeholder_17', Store(), - lineno=67, + lineno=71, col_offset=4, - end_lineno=67, + end_lineno=71, end_col_offset=10)], Call( Name( 'ArgumentParser', Load(), - lineno=67, + lineno=71, col_offset=13, - end_lineno=67, + end_lineno=71, end_col_offset=27), [], [], - lineno=67, + lineno=71, col_offset=13, - end_lineno=67, + end_lineno=71, end_col_offset=29), - lineno=67, + lineno=71, col_offset=4, - end_lineno=67, + end_lineno=71, end_col_offset=29), Expr( Call( Attribute( Name( - 'placeholder_18', + 'placeholder_17', Load(), - lineno=68, + lineno=72, col_offset=4, - end_lineno=68, + end_lineno=72, end_col_offset=10), 'add_argument', Load(), - lineno=68, + lineno=72, col_offset=4, - end_lineno=68, + end_lineno=72, end_col_offset=23), [ Constant( 'in_filename', - lineno=68, + lineno=72, col_offset=24, - end_lineno=68, + end_lineno=72, end_col_offset=37)], [], - lineno=68, + lineno=72, col_offset=4, - end_lineno=68, + end_lineno=72, end_col_offset=38), - lineno=68, + lineno=72, col_offset=4, - end_lineno=68, + end_lineno=72, end_col_offset=38), Expr( Call( Attribute( Name( - 'placeholder_18', + 'placeholder_17', Load(), - lineno=69, + lineno=73, col_offset=4, - end_lineno=69, + end_lineno=73, end_col_offset=10), 'add_argument', Load(), - lineno=69, + lineno=73, col_offset=4, - end_lineno=69, + end_lineno=73, end_col_offset=23), [ Constant( 'out_filename', - lineno=69, + lineno=73, col_offset=24, - end_lineno=69, + end_lineno=73, end_col_offset=38)], [], - lineno=69, + lineno=73, col_offset=4, - end_lineno=69, + end_lineno=73, end_col_offset=39), - lineno=69, + lineno=73, col_offset=4, - end_lineno=69, + end_lineno=73, end_col_offset=39), Assign( [ Name( - 'placeholder_11', + 'placeholder_10', Store(), - lineno=70, + lineno=74, col_offset=4, - end_lineno=70, + end_lineno=74, end_col_offset=8)], Call( Attribute( Name( - 'placeholder_18', + 'placeholder_17', Load(), - lineno=70, + lineno=74, col_offset=11, - end_lineno=70, + end_lineno=74, end_col_offset=17), - 'placeholder_17', + 'placeholder_16', Load(), - lineno=70, + lineno=74, col_offset=11, - end_lineno=70, + end_lineno=74, end_col_offset=28), [], [], - lineno=70, + lineno=74, col_offset=11, - end_lineno=70, + end_lineno=74, end_col_offset=30), - lineno=70, + lineno=74, col_offset=4, - end_lineno=70, + end_lineno=74, end_col_offset=30), Return( Name( - 'placeholder_11', + 'placeholder_10', Load(), - lineno=71, + lineno=75, col_offset=11, - end_lineno=71, + end_lineno=75, end_col_offset=15), - lineno=71, + lineno=75, col_offset=4, - end_lineno=71, + end_lineno=75, end_col_offset=15)], [], - lineno=66, + lineno=70, col_offset=0, - end_lineno=71, + end_lineno=75, end_col_offset=15)], []) ## END NORMALIZED TREE ## \ No newline at end of file diff --git a/test/example-parencontext-normalization/representation.txt b/test/example-parencontext-normalization/representation.txt index c56b4e8..83cb243 100644 --- a/test/example-parencontext-normalization/representation.txt +++ b/test/example-parencontext-normalization/representation.txt @@ -1 +1 @@ -Module([Expr(Constant('Calculate the fixed interest rate.', lineno=6, col_offset=0, end_lineno=6, end_col_offset=40), lineno=6, col_offset=0, end_lineno=6, end_col_offset=40), ImportFrom('decimal', [alias('ROUND_DOWN', lineno=8, col_offset=20, end_lineno=8, end_col_offset=30), alias('ROUND_UP', lineno=8, col_offset=32, end_lineno=8, end_col_offset=40), alias('Decimal', lineno=8, col_offset=42, end_lineno=8, end_col_offset=49), alias('localcontext', lineno=8, col_offset=51, end_lineno=8, end_col_offset=63)], 0, lineno=8, col_offset=0, end_lineno=8, end_col_offset=63), Import([alias('pandas', 'placeholder_0', lineno=9, col_offset=7, end_lineno=9, end_col_offset=19)], lineno=9, col_offset=0, end_lineno=9, end_col_offset=19), FunctionDef('placeholder_1', arguments([], [arg('placeholder_2', lineno=12, col_offset=20, end_lineno=12, end_col_offset=41), arg('placeholder_3', lineno=12, col_offset=43, end_lineno=12, end_col_offset=69)], kwonlyargs=[], kw_defaults=[], defaults=[]), [With([withitem(Call(Name('localcontext', Load(), lineno=30, col_offset=10, end_lineno=30, end_col_offset=22), [], [], lineno=30, col_offset=10, end_lineno=30, end_col_offset=24), Name('placeholder_4', Store(), lineno=30, col_offset=28, end_lineno=30, end_col_offset=36)), withitem(Call(Name('localcontext', Load(), lineno=31, col_offset=10, end_lineno=31, end_col_offset=22), [], [], lineno=31, col_offset=10, end_lineno=31, end_col_offset=24), Name('placeholder_5', Store(), lineno=31, col_offset=28, end_lineno=31, end_col_offset=36))], [Assign([Attribute(Name('placeholder_4', Load(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=16), 'placeholder_6', Store(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=21)], Constant(18, lineno=32, col_offset=24, end_lineno=32, end_col_offset=26), lineno=32, col_offset=8, end_lineno=32, end_col_offset=26), Assign([Attribute(Name('placeholder_4', Load(), lineno=33, col_offset=8, end_lineno=33, end_col_offset=16), 'placeholder_7', Store(), lineno=33, col_offset=8, end_lineno=33, end_col_offset=25)], Name('ROUND_UP', Load(), lineno=33, col_offset=28, end_lineno=33, end_col_offset=36), lineno=33, col_offset=8, end_lineno=33, end_col_offset=36), Assign([Attribute(Name('placeholder_5', Load(), lineno=35, col_offset=8, end_lineno=35, end_col_offset=16), 'placeholder_6', Store(), lineno=35, col_offset=8, end_lineno=35, end_col_offset=21)], Constant(12, lineno=35, col_offset=24, end_lineno=35, end_col_offset=26), lineno=35, col_offset=8, end_lineno=35, end_col_offset=26), Assign([Attribute(Name('placeholder_5', Load(), lineno=36, col_offset=8, end_lineno=36, end_col_offset=16), 'placeholder_7', Store(), lineno=36, col_offset=8, end_lineno=36, end_col_offset=25)], Name('ROUND_DOWN', Load(), lineno=36, col_offset=28, end_lineno=36, end_col_offset=38), lineno=36, col_offset=8, end_lineno=36, end_col_offset=38), Assign([Name('placeholder_8', Store(), lineno=38, col_offset=8, end_lineno=38, end_col_offset=23)], BinOp(Name('placeholder_3', Load(), lineno=38, col_offset=26, end_lineno=38, end_col_offset=43), Div(), Call(Name('Decimal', Load(), lineno=38, col_offset=46, end_lineno=38, end_col_offset=53), [BinOp(BinOp(BinOp(Constant(60, lineno=38, col_offset=54, end_lineno=38, end_col_offset=56), Mult(), Constant(60, lineno=38, col_offset=59, end_lineno=38, end_col_offset=61), lineno=38, col_offset=54, end_lineno=38, end_col_offset=61), Mult(), Constant(24, lineno=38, col_offset=64, end_lineno=38, end_col_offset=66), lineno=38, col_offset=54, end_lineno=38, end_col_offset=66), Mult(), Constant(365, lineno=38, col_offset=69, end_lineno=38, end_col_offset=72), lineno=38, col_offset=54, end_lineno=38, end_col_offset=72)], [], lineno=38, col_offset=46, end_lineno=38, end_col_offset=73), lineno=38, col_offset=26, end_lineno=38, end_col_offset=73), lineno=38, col_offset=8, end_lineno=38, end_col_offset=73), Assign([Name('placeholder_9', Store(), lineno=39, col_offset=8, end_lineno=39, end_col_offset=18)], BinOp(BinOp(Constant(1, lineno=39, col_offset=22, end_lineno=39, end_col_offset=23), Sub(), Name('placeholder_2', Load(), lineno=39, col_offset=26, end_lineno=39, end_col_offset=36), lineno=39, col_offset=22, end_lineno=39, end_col_offset=36), Div(), BinOp(Name('placeholder_2', Load(), lineno=39, col_offset=41, end_lineno=39, end_col_offset=51), Mult(), Name('placeholder_8', Load(), lineno=39, col_offset=54, end_lineno=39, end_col_offset=69), lineno=39, col_offset=41, end_lineno=39, end_col_offset=69), lineno=39, col_offset=21, end_lineno=39, end_col_offset=70), lineno=39, col_offset=8, end_lineno=39, end_col_offset=70)], lineno=30, col_offset=4, end_lineno=39, end_col_offset=70), Return(Name('placeholder_9', Load(), lineno=40, col_offset=11, end_lineno=40, end_col_offset=21), lineno=40, col_offset=4, end_lineno=40, end_col_offset=21)], [], lineno=12, col_offset=0, end_lineno=40, end_col_offset=21), Expr(Constant('convert json to jsonl', lineno=48, col_offset=0, end_lineno=48, end_col_offset=27), lineno=48, col_offset=0, end_lineno=48, end_col_offset=27), ImportFrom('argparse', [alias('ArgumentParser', lineno=50, col_offset=21, end_lineno=50, end_col_offset=35)], 0, lineno=50, col_offset=0, end_lineno=50, end_col_offset=35), Import([alias('json', lineno=51, col_offset=7, end_lineno=51, end_col_offset=11)], lineno=51, col_offset=0, end_lineno=51, end_col_offset=11), FunctionDef('placeholder_10', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_11', Store(), lineno=54, col_offset=4, end_lineno=54, end_col_offset=8)], Call(Name('parse_args', Load(), lineno=54, col_offset=11, end_lineno=54, end_col_offset=21), [], [], lineno=54, col_offset=11, end_lineno=54, end_col_offset=23), lineno=54, col_offset=4, end_lineno=54, end_col_offset=23), With([withitem(Call(Name('open', Load(), lineno=58, col_offset=8, end_lineno=58, end_col_offset=12), [Attribute(Name('placeholder_11', Load(), lineno=58, col_offset=13, end_lineno=58, end_col_offset=17), 'in_filename', Load(), lineno=58, col_offset=13, end_lineno=58, end_col_offset=29)], [], lineno=58, col_offset=8, end_lineno=58, end_col_offset=30), Name('placeholder_12', Store(), lineno=58, col_offset=34, end_lineno=58, end_col_offset=41)), withitem(Call(Name('open', Load(), lineno=59, col_offset=8, end_lineno=59, end_col_offset=12), [Attribute(Name('placeholder_11', Load(), lineno=59, col_offset=13, end_lineno=59, end_col_offset=17), 'out_filename', Load(), lineno=59, col_offset=13, end_lineno=59, end_col_offset=30)], [keyword('placeholder_13', Constant('wt', lineno=59, col_offset=37, end_lineno=59, end_col_offset=41), lineno=59, col_offset=32, end_lineno=59, end_col_offset=41)], lineno=59, col_offset=8, end_lineno=59, end_col_offset=42), Name('placeholder_14', Store(), lineno=59, col_offset=46, end_lineno=59, end_col_offset=54))], [Assign([Name('placeholder_15', Store(), lineno=61, col_offset=8, end_lineno=61, end_col_offset=15)], Call(Attribute(Name('json', Load(), lineno=61, col_offset=18, end_lineno=61, end_col_offset=22), 'load', Load(), lineno=61, col_offset=18, end_lineno=61, end_col_offset=27), [Name('placeholder_12', Load(), lineno=61, col_offset=28, end_lineno=61, end_col_offset=35)], [], lineno=61, col_offset=18, end_lineno=61, end_col_offset=36), lineno=61, col_offset=8, end_lineno=61, end_col_offset=36), For(Name('placeholder_16', Store(), lineno=62, col_offset=12, end_lineno=62, end_col_offset=18), Name('placeholder_15', Load(), lineno=62, col_offset=22, end_lineno=62, end_col_offset=29), [Expr(Call(Attribute(Name('placeholder_14', Load(), lineno=63, col_offset=12, end_lineno=63, end_col_offset=20), 'write', Load(), lineno=63, col_offset=12, end_lineno=63, end_col_offset=26), [BinOp(Call(Attribute(Name('json', Load(), lineno=63, col_offset=27, end_lineno=63, end_col_offset=31), 'dumps', Load(), lineno=63, col_offset=27, end_lineno=63, end_col_offset=37), [Name('placeholder_16', Load(), lineno=63, col_offset=38, end_lineno=63, end_col_offset=44)], [], lineno=63, col_offset=27, end_lineno=63, end_col_offset=45), Add(), Constant('\n', lineno=63, col_offset=48, end_lineno=63, end_col_offset=52), lineno=63, col_offset=27, end_lineno=63, end_col_offset=52)], [], lineno=63, col_offset=12, end_lineno=63, end_col_offset=53), lineno=63, col_offset=12, end_lineno=63, end_col_offset=53)], [], lineno=62, col_offset=8, end_lineno=63, end_col_offset=53)], lineno=57, col_offset=4, end_lineno=63, end_col_offset=53)], [], lineno=53, col_offset=0, end_lineno=63, end_col_offset=53), FunctionDef('placeholder_17', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_18', Store(), lineno=67, col_offset=4, end_lineno=67, end_col_offset=10)], Call(Name('ArgumentParser', Load(), lineno=67, col_offset=13, end_lineno=67, end_col_offset=27), [], [], lineno=67, col_offset=13, end_lineno=67, end_col_offset=29), lineno=67, col_offset=4, end_lineno=67, end_col_offset=29), Expr(Call(Attribute(Name('placeholder_18', Load(), lineno=68, col_offset=4, end_lineno=68, end_col_offset=10), 'add_argument', Load(), lineno=68, col_offset=4, end_lineno=68, end_col_offset=23), [Constant('in_filename', lineno=68, col_offset=24, end_lineno=68, end_col_offset=37)], [], lineno=68, col_offset=4, end_lineno=68, end_col_offset=38), lineno=68, col_offset=4, end_lineno=68, end_col_offset=38), Expr(Call(Attribute(Name('placeholder_18', Load(), lineno=69, col_offset=4, end_lineno=69, end_col_offset=10), 'add_argument', Load(), lineno=69, col_offset=4, end_lineno=69, end_col_offset=23), [Constant('out_filename', lineno=69, col_offset=24, end_lineno=69, end_col_offset=38)], [], lineno=69, col_offset=4, end_lineno=69, end_col_offset=39), lineno=69, col_offset=4, end_lineno=69, end_col_offset=39), Assign([Name('placeholder_11', Store(), lineno=70, col_offset=4, end_lineno=70, end_col_offset=8)], Call(Attribute(Name('placeholder_18', Load(), lineno=70, col_offset=11, end_lineno=70, end_col_offset=17), 'placeholder_17', Load(), lineno=70, col_offset=11, end_lineno=70, end_col_offset=28), [], [], lineno=70, col_offset=11, end_lineno=70, end_col_offset=30), lineno=70, col_offset=4, end_lineno=70, end_col_offset=30), Return(Name('placeholder_11', Load(), lineno=71, col_offset=11, end_lineno=71, end_col_offset=15), lineno=71, col_offset=4, end_lineno=71, end_col_offset=15)], [], lineno=66, col_offset=0, end_lineno=71, end_col_offset=15)], []) \ No newline at end of file +Module([Expr(Constant('Calculate the fixed interest rate.', lineno=7, col_offset=0, end_lineno=7, end_col_offset=40), lineno=7, col_offset=0, end_lineno=7, end_col_offset=40), ImportFrom('decimal', [alias('ROUND_DOWN', lineno=9, col_offset=20, end_lineno=9, end_col_offset=30), alias('ROUND_UP', lineno=9, col_offset=32, end_lineno=9, end_col_offset=40), alias('Decimal', lineno=9, col_offset=42, end_lineno=9, end_col_offset=49), alias('localcontext', lineno=9, col_offset=51, end_lineno=9, end_col_offset=63)], 0, lineno=9, col_offset=0, end_lineno=9, end_col_offset=63), Import([alias('pandas', 'placeholder_0', lineno=10, col_offset=7, end_lineno=10, end_col_offset=19)], lineno=10, col_offset=0, end_lineno=10, end_col_offset=19), FunctionDef('placeholder_1', arguments([], [arg('placeholder_2', lineno=13, col_offset=20, end_lineno=13, end_col_offset=41), arg('placeholder_3', lineno=13, col_offset=43, end_lineno=13, end_col_offset=69)], kwonlyargs=[], kw_defaults=[], defaults=[]), [With([withitem(Call(Name('localcontext', Load(), lineno=31, col_offset=10, end_lineno=31, end_col_offset=22), [], [], lineno=31, col_offset=10, end_lineno=31, end_col_offset=24), Name('placeholder_4', Store(), lineno=31, col_offset=28, end_lineno=31, end_col_offset=31))], [Assign([Attribute(Name('placeholder_4', Load(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=11), 'placeholder_5', Store(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=16)], Constant(18, lineno=32, col_offset=19, end_lineno=32, end_col_offset=21), lineno=32, col_offset=8, end_lineno=32, end_col_offset=21), Assign([Attribute(Name('placeholder_4', Load(), lineno=33, col_offset=8, end_lineno=33, end_col_offset=11), 'placeholder_6', Store(), lineno=33, col_offset=8, end_lineno=33, end_col_offset=20)], Name('ROUND_UP', Load(), lineno=33, col_offset=23, end_lineno=33, end_col_offset=31), lineno=33, col_offset=8, end_lineno=33, end_col_offset=31), Assign([Name('placeholder_7', Store(), lineno=34, col_offset=8, end_lineno=34, end_col_offset=23)], BinOp(Name('placeholder_3', Load(), lineno=34, col_offset=26, end_lineno=34, end_col_offset=43), Div(), Call(Name('Decimal', Load(), lineno=34, col_offset=46, end_lineno=34, end_col_offset=53), [BinOp(BinOp(BinOp(Constant(60, lineno=34, col_offset=54, end_lineno=34, end_col_offset=56), Mult(), Constant(60, lineno=34, col_offset=59, end_lineno=34, end_col_offset=61), lineno=34, col_offset=54, end_lineno=34, end_col_offset=61), Mult(), Constant(24, lineno=34, col_offset=64, end_lineno=34, end_col_offset=66), lineno=34, col_offset=54, end_lineno=34, end_col_offset=66), Mult(), Constant(365, lineno=34, col_offset=69, end_lineno=34, end_col_offset=72), lineno=34, col_offset=54, end_lineno=34, end_col_offset=72)], [], lineno=34, col_offset=46, end_lineno=34, end_col_offset=73), lineno=34, col_offset=26, end_lineno=34, end_col_offset=73), lineno=34, col_offset=8, end_lineno=34, end_col_offset=73)], lineno=31, col_offset=4, end_lineno=34, end_col_offset=73), With([withitem(Call(Name('localcontext', Load(), lineno=39, col_offset=8, end_lineno=39, end_col_offset=20), [], [], lineno=39, col_offset=8, end_lineno=39, end_col_offset=22), Name('placeholder_4', Store(), lineno=39, col_offset=26, end_lineno=39, end_col_offset=29))], [Assign([Attribute(Name('placeholder_4', Load(), lineno=41, col_offset=8, end_lineno=41, end_col_offset=11), 'placeholder_5', Store(), lineno=41, col_offset=8, end_lineno=41, end_col_offset=16)], Constant(18, lineno=41, col_offset=19, end_lineno=41, end_col_offset=21), lineno=41, col_offset=8, end_lineno=41, end_col_offset=21), Assign([Attribute(Name('placeholder_4', Load(), lineno=42, col_offset=8, end_lineno=42, end_col_offset=11), 'placeholder_6', Store(), lineno=42, col_offset=8, end_lineno=42, end_col_offset=20)], Name('ROUND_DOWN', Load(), lineno=42, col_offset=23, end_lineno=42, end_col_offset=33), lineno=42, col_offset=8, end_lineno=42, end_col_offset=33), Assign([Name('placeholder_8', Store(), lineno=43, col_offset=8, end_lineno=43, end_col_offset=18)], BinOp(BinOp(Constant(1, lineno=43, col_offset=22, end_lineno=43, end_col_offset=23), Sub(), Name('placeholder_2', Load(), lineno=43, col_offset=26, end_lineno=43, end_col_offset=36), lineno=43, col_offset=22, end_lineno=43, end_col_offset=36), Div(), BinOp(Name('placeholder_2', Load(), lineno=43, col_offset=41, end_lineno=43, end_col_offset=51), Mult(), Name('placeholder_7', Load(), lineno=43, col_offset=54, end_lineno=43, end_col_offset=69), lineno=43, col_offset=41, end_lineno=43, end_col_offset=69), lineno=43, col_offset=21, end_lineno=43, end_col_offset=70), lineno=43, col_offset=8, end_lineno=43, end_col_offset=70)], lineno=38, col_offset=4, end_lineno=43, end_col_offset=70), Return(Name('placeholder_8', Load(), lineno=44, col_offset=11, end_lineno=44, end_col_offset=21), lineno=44, col_offset=4, end_lineno=44, end_col_offset=21)], [], lineno=13, col_offset=0, end_lineno=44, end_col_offset=21), Expr(Constant('convert json to jsonl', lineno=52, col_offset=0, end_lineno=52, end_col_offset=27), lineno=52, col_offset=0, end_lineno=52, end_col_offset=27), ImportFrom('argparse', [alias('ArgumentParser', lineno=54, col_offset=21, end_lineno=54, end_col_offset=35)], 0, lineno=54, col_offset=0, end_lineno=54, end_col_offset=35), Import([alias('json', lineno=55, col_offset=7, end_lineno=55, end_col_offset=11)], lineno=55, col_offset=0, end_lineno=55, end_col_offset=11), FunctionDef('placeholder_9', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_10', Store(), lineno=58, col_offset=4, end_lineno=58, end_col_offset=8)], Call(Name('parse_args', Load(), lineno=58, col_offset=11, end_lineno=58, end_col_offset=21), [], [], lineno=58, col_offset=11, end_lineno=58, end_col_offset=23), lineno=58, col_offset=4, end_lineno=58, end_col_offset=23), With([withitem(Call(Name('open', Load(), lineno=62, col_offset=8, end_lineno=62, end_col_offset=12), [Attribute(Name('placeholder_10', Load(), lineno=62, col_offset=13, end_lineno=62, end_col_offset=17), 'in_filename', Load(), lineno=62, col_offset=13, end_lineno=62, end_col_offset=29)], [], lineno=62, col_offset=8, end_lineno=62, end_col_offset=30), Name('placeholder_11', Store(), lineno=62, col_offset=34, end_lineno=62, end_col_offset=41)), withitem(Call(Name('open', Load(), lineno=63, col_offset=8, end_lineno=63, end_col_offset=12), [Attribute(Name('placeholder_10', Load(), lineno=63, col_offset=13, end_lineno=63, end_col_offset=17), 'out_filename', Load(), lineno=63, col_offset=13, end_lineno=63, end_col_offset=30)], [keyword('placeholder_12', Constant('wt', lineno=63, col_offset=37, end_lineno=63, end_col_offset=41), lineno=63, col_offset=32, end_lineno=63, end_col_offset=41)], lineno=63, col_offset=8, end_lineno=63, end_col_offset=42), Name('placeholder_13', Store(), lineno=63, col_offset=46, end_lineno=63, end_col_offset=54))], [Assign([Name('placeholder_14', Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=15)], Call(Attribute(Name('json', Load(), lineno=65, col_offset=18, end_lineno=65, end_col_offset=22), 'load', Load(), lineno=65, col_offset=18, end_lineno=65, end_col_offset=27), [Name('placeholder_11', Load(), lineno=65, col_offset=28, end_lineno=65, end_col_offset=35)], [], lineno=65, col_offset=18, end_lineno=65, end_col_offset=36), lineno=65, col_offset=8, end_lineno=65, end_col_offset=36), For(Name('placeholder_15', Store(), lineno=66, col_offset=12, end_lineno=66, end_col_offset=18), Name('placeholder_14', Load(), lineno=66, col_offset=22, end_lineno=66, end_col_offset=29), [Expr(Call(Attribute(Name('placeholder_13', Load(), lineno=67, col_offset=12, end_lineno=67, end_col_offset=20), 'write', Load(), lineno=67, col_offset=12, end_lineno=67, end_col_offset=26), [BinOp(Call(Attribute(Name('json', Load(), lineno=67, col_offset=27, end_lineno=67, end_col_offset=31), 'dumps', Load(), lineno=67, col_offset=27, end_lineno=67, end_col_offset=37), [Name('placeholder_15', Load(), lineno=67, col_offset=38, end_lineno=67, end_col_offset=44)], [], lineno=67, col_offset=27, end_lineno=67, end_col_offset=45), Add(), Constant('\n', lineno=67, col_offset=48, end_lineno=67, end_col_offset=52), lineno=67, col_offset=27, end_lineno=67, end_col_offset=52)], [], lineno=67, col_offset=12, end_lineno=67, end_col_offset=53), lineno=67, col_offset=12, end_lineno=67, end_col_offset=53)], [], lineno=66, col_offset=8, end_lineno=67, end_col_offset=53)], lineno=61, col_offset=4, end_lineno=67, end_col_offset=53)], [], lineno=57, col_offset=0, end_lineno=67, end_col_offset=53), FunctionDef('placeholder_16', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_17', Store(), lineno=71, col_offset=4, end_lineno=71, end_col_offset=10)], Call(Name('ArgumentParser', Load(), lineno=71, col_offset=13, end_lineno=71, end_col_offset=27), [], [], lineno=71, col_offset=13, end_lineno=71, end_col_offset=29), lineno=71, col_offset=4, end_lineno=71, end_col_offset=29), Expr(Call(Attribute(Name('placeholder_17', Load(), lineno=72, col_offset=4, end_lineno=72, end_col_offset=10), 'add_argument', Load(), lineno=72, col_offset=4, end_lineno=72, end_col_offset=23), [Constant('in_filename', lineno=72, col_offset=24, end_lineno=72, end_col_offset=37)], [], lineno=72, col_offset=4, end_lineno=72, end_col_offset=38), lineno=72, col_offset=4, end_lineno=72, end_col_offset=38), Expr(Call(Attribute(Name('placeholder_17', Load(), lineno=73, col_offset=4, end_lineno=73, end_col_offset=10), 'add_argument', Load(), lineno=73, col_offset=4, end_lineno=73, end_col_offset=23), [Constant('out_filename', lineno=73, col_offset=24, end_lineno=73, end_col_offset=38)], [], lineno=73, col_offset=4, end_lineno=73, end_col_offset=39), lineno=73, col_offset=4, end_lineno=73, end_col_offset=39), Assign([Name('placeholder_10', Store(), lineno=74, col_offset=4, end_lineno=74, end_col_offset=8)], Call(Attribute(Name('placeholder_17', Load(), lineno=74, col_offset=11, end_lineno=74, end_col_offset=17), 'placeholder_16', Load(), lineno=74, col_offset=11, end_lineno=74, end_col_offset=28), [], [], lineno=74, col_offset=11, end_lineno=74, end_col_offset=30), lineno=74, col_offset=4, end_lineno=74, end_col_offset=30), Return(Name('placeholder_10', Load(), lineno=75, col_offset=11, end_lineno=75, end_col_offset=15), lineno=75, col_offset=4, end_lineno=75, end_col_offset=15)], [], lineno=70, col_offset=0, end_lineno=75, end_col_offset=15)], []) \ No newline at end of file From 1c4b42b2b03e6a1cb32356c82ca39fb398d61722 Mon Sep 17 00:00:00 2001 From: BethanyG Date: Thu, 21 Mar 2024 16:24:58 -0700 Subject: [PATCH 10/14] Per issue 54 comments, needed to adjust visit_Expr code to account for unassigned expressions that were not Constants. --- representer/normalizer.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/representer/normalizer.py b/representer/normalizer.py index 9938975..a195dc4 100644 --- a/representer/normalizer.py +++ b/representer/normalizer.py @@ -10,6 +10,8 @@ Assign, AsyncFunctionDef, Attribute, + BinOp, + BoolOp, Call, ClassDef, Compare, @@ -22,6 +24,7 @@ GeneratorExp, Global, If, + Lambda, ListComp, Load, Module, @@ -31,7 +34,9 @@ SetComp, Str, Store, + UnaryOp, Yield, + YieldFrom, alias, arg, get_docstring, @@ -311,13 +316,8 @@ def visit_Expr(self, node: Expr) -> Optional[Expr]: if node.value.func.id == 'print': return None - # Pass through generator code. - if isinstance(node.value, Yield): - return node - - - # Eliminate previously registered docstrings - if not isinstance(node.value, Call): + if isinstance(node.value, Constant) and not isinstance(node.value, Call): + # eliminate registered docstrings if utils.md5sum(node.value.value) in self._docstring_cache: return None From 0ac4bee81ce5342d2f36ecbeb54426d1ef7fdfae Mon Sep 17 00:00:00 2001 From: BethanyG Date: Thu, 21 Mar 2024 16:26:34 -0700 Subject: [PATCH 11/14] Adjusted golden tests due to better placeholder assignment after visit_Expr fix. --- test/practice-linked-list/representation.out | 18 +++++++++------ test/practice-nth-prime/representation.out | 8 +++---- .../representation.out | 8 +++---- .../representation.out | 10 ++++----- test/practice-pov/representation.out | 8 +++---- .../representation.out | 22 +++++++++---------- 6 files changed, 39 insertions(+), 35 deletions(-) diff --git a/test/practice-linked-list/representation.out b/test/practice-linked-list/representation.out index db6907b..c7ce1b7 100644 --- a/test/practice-linked-list/representation.out +++ b/test/practice-linked-list/representation.out @@ -18,7 +18,11 @@ class placeholder_6: def placeholder_11(self): placeholder_12 = self.placeholder_7 while placeholder_12: - yield (current_node.value, current_node.succeeding, current_node.prev) + yield ( + placeholder_12.placeholder_2, + placeholder_12.placeholder_3, + placeholder_12.placeholder_5, + ) placeholder_12 = placeholder_12.placeholder_3 def placeholder_13(self, placeholder_14): @@ -2504,13 +2508,13 @@ Module( [ Attribute( Name( - 'current_node', + 'placeholder_12', Load(), lineno=20, col_offset=19, end_lineno=20, end_col_offset=31), - 'value', + 'placeholder_2', Load(), lineno=20, col_offset=19, @@ -2518,13 +2522,13 @@ Module( end_col_offset=37), Attribute( Name( - 'current_node', + 'placeholder_12', Load(), lineno=20, col_offset=39, end_lineno=20, end_col_offset=51), - 'succeeding', + 'placeholder_3', Load(), lineno=20, col_offset=39, @@ -2532,13 +2536,13 @@ Module( end_col_offset=62), Attribute( Name( - 'current_node', + 'placeholder_12', Load(), lineno=20, col_offset=64, end_lineno=20, end_col_offset=76), - 'prev', + 'placeholder_5', Load(), lineno=20, col_offset=64, diff --git a/test/practice-nth-prime/representation.out b/test/practice-nth-prime/representation.out index 2d83d9c..5a60c5d 100644 --- a/test/practice-nth-prime/representation.out +++ b/test/practice-nth-prime/representation.out @@ -29,8 +29,8 @@ def placeholder_9(): yield 2 yield 3 for placeholder_1 in count(6, 6): - yield (number - 1) - yield (number + 1) + yield (placeholder_1 - 1) + yield (placeholder_1 + 1) ## END NORMALIZED CODE ## @@ -1269,7 +1269,7 @@ Module( Yield( BinOp( Name( - 'number', + 'placeholder_1', Load(), lineno=33, col_offset=14, @@ -1298,7 +1298,7 @@ Module( Yield( BinOp( Name( - 'number', + 'placeholder_1', Load(), lineno=34, col_offset=14, diff --git a/test/practice-palindrome-products/representation.out b/test/practice-palindrome-products/representation.out index 2dc7886..9c79eca 100644 --- a/test/practice-palindrome-products/representation.out +++ b/test/practice-palindrome-products/representation.out @@ -79,7 +79,7 @@ def placeholder_16(placeholder_2, placeholder_1, placeholder_7=False): while placeholder_24 <= placeholder_23: placeholder_9 = placeholder_25(placeholder_24, placeholder_21) if placeholder_17 <= placeholder_9 <= placeholder_18: - yield palindrome + yield placeholder_9 elif placeholder_9 > placeholder_18: break placeholder_24 += 1 @@ -87,7 +87,7 @@ def placeholder_16(placeholder_2, placeholder_1, placeholder_7=False): while placeholder_24 >= placeholder_22: placeholder_9 = placeholder_25(placeholder_24, placeholder_21) if placeholder_17 <= placeholder_9 <= placeholder_18: - yield palindrome + yield placeholder_9 elif placeholder_9 < placeholder_17: break placeholder_24 -= 1 @@ -4129,7 +4129,7 @@ Module( Expr( Yield( Name( - 'palindrome', + 'placeholder_9', Load(), lineno=82, col_offset=26, @@ -4307,7 +4307,7 @@ Module( Expr( Yield( Name( - 'palindrome', + 'placeholder_9', Load(), lineno=93, col_offset=26, diff --git a/test/practice-perfect-numbers/representation.out b/test/practice-perfect-numbers/representation.out index dbb4b88..5014eef 100644 --- a/test/practice-perfect-numbers/representation.out +++ b/test/practice-perfect-numbers/representation.out @@ -5,9 +5,9 @@ import math def placeholder_0(placeholder_1): for placeholder_2 in range(2, int(math.sqrt(placeholder_1)) + 1): if placeholder_1 % placeholder_2 == 0: - yield index + yield placeholder_2 if placeholder_2 * placeholder_2 != placeholder_1: - yield (number // index) + yield (placeholder_1 // placeholder_2) def placeholder_3(placeholder_1): @@ -709,7 +709,7 @@ Module( Expr( Yield( Name( - 'index', + 'placeholder_2', Load(), lineno=12, col_offset=18, @@ -764,7 +764,7 @@ Module( Yield( BinOp( Name( - 'number', + 'placeholder_1', Load(), lineno=14, col_offset=22, @@ -772,7 +772,7 @@ Module( end_col_offset=28), FloorDiv(), Name( - 'index', + 'placeholder_2', Load(), lineno=14, col_offset=32, diff --git a/test/practice-pov/representation.out b/test/practice-pov/representation.out index 67e4060..0b44fdb 100644 --- a/test/practice-pov/representation.out +++ b/test/practice-pov/representation.out @@ -25,10 +25,10 @@ class placeholder_0: return self.placeholder_4() == placeholder_9.placeholder_4() def placeholder_11(self): - yield self.label + yield self.placeholder_2 for placeholder_12 in self.placeholder_3: for placeholder_13 in placeholder_12: - yield grandchild + yield placeholder_13 def placeholder_14(self): return placeholder_0( @@ -2452,7 +2452,7 @@ Module( col_offset=14, end_lineno=22, end_col_offset=18), - 'label', + 'placeholder_2', Load(), lineno=22, col_offset=14, @@ -2508,7 +2508,7 @@ Module( Expr( Yield( Name( - 'grandchild', + 'placeholder_13', Load(), lineno=25, col_offset=22, diff --git a/test/practice-pythagorean-triplet/representation.out b/test/practice-pythagorean-triplet/representation.out index 9c3713a..c016b97 100644 --- a/test/practice-pythagorean-triplet/representation.out +++ b/test/practice-pythagorean-triplet/representation.out @@ -15,7 +15,7 @@ def placeholder_0(placeholder_1, placeholder_2): placeholder_8 = placeholder_8 + placeholder_5 placeholder_9 = placeholder_9 + placeholder_6 while placeholder_9 <= placeholder_2: - yield [alpha, beta, gamma] + yield [placeholder_7, placeholder_8, placeholder_9] placeholder_7 = placeholder_7 + placeholder_4 placeholder_8 = placeholder_8 + placeholder_5 placeholder_9 = placeholder_9 + placeholder_6 @@ -29,7 +29,7 @@ def placeholder_10(placeholder_3): if (placeholder_13 - placeholder_12) % 2 == 1 and gcd( placeholder_13, placeholder_12 ) == 1: - yield (member, idx) + yield (placeholder_13, placeholder_12) def placeholder_14(placeholder_3): @@ -41,7 +41,7 @@ def placeholder_14(placeholder_3): placeholder_9 = placeholder_17 + placeholder_18 if placeholder_7 > placeholder_8: placeholder_7, placeholder_8 = (placeholder_8, placeholder_7) - yield (alpha, beta, gamma) + yield (placeholder_7, placeholder_8, placeholder_9) def placeholder_19(placeholder_20): @@ -1787,21 +1787,21 @@ Module( List( [ Name( - 'alpha', + 'placeholder_7', Load(), lineno=17, col_offset=23, end_lineno=17, end_col_offset=28), Name( - 'beta', + 'placeholder_8', Load(), lineno=17, col_offset=30, end_lineno=17, end_col_offset=34), Name( - 'gamma', + 'placeholder_9', Load(), lineno=17, col_offset=36, @@ -2235,14 +2235,14 @@ Module( Tuple( [ Name( - 'member', + 'placeholder_13', Load(), lineno=30, col_offset=22, end_lineno=30, end_col_offset=28), Name( - 'idx', + 'placeholder_12', Load(), lineno=30, col_offset=30, @@ -2597,21 +2597,21 @@ Module( Tuple( [ Name( - 'alpha', + 'placeholder_7', Load(), lineno=49, col_offset=14, end_lineno=49, end_col_offset=19), Name( - 'beta', + 'placeholder_8', Load(), lineno=49, col_offset=21, end_lineno=49, end_col_offset=25), Name( - 'gamma', + 'placeholder_9', Load(), lineno=49, col_offset=27, From d26f27e5f0295d199f9b820670fc28966483c6de Mon Sep 17 00:00:00 2001 From: BethanyG Date: Thu, 21 Mar 2024 16:27:04 -0700 Subject: [PATCH 12/14] Adjusted golden tests due to better placeholder assignment after visit_Expr fix. --- test/practice-linked-list/representation.txt | 2 +- test/practice-nth-prime/representation.txt | 2 +- test/practice-palindrome-products/representation.txt | 2 +- test/practice-perfect-numbers/representation.txt | 2 +- test/practice-pov/representation.txt | 2 +- test/practice-pythagorean-triplet/representation.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/practice-linked-list/representation.txt b/test/practice-linked-list/representation.txt index 9755cc7..cd1cfda 100644 --- a/test/practice-linked-list/representation.txt +++ b/test/practice-linked-list/representation.txt @@ -1 +1 @@ -Module([ClassDef('placeholder_0', [], [], [FunctionDef('placeholder_1', arguments([], [arg('self', lineno=2, col_offset=17, end_lineno=2, end_col_offset=21), arg('placeholder_2', lineno=2, col_offset=23, end_lineno=2, end_col_offset=28), arg('placeholder_3', lineno=2, col_offset=30, end_lineno=2, end_col_offset=40), arg('placeholder_4', lineno=2, col_offset=47, end_lineno=2, end_col_offset=55)], kwonlyargs=[], kw_defaults=[], defaults=[Constant(None, lineno=2, col_offset=41, end_lineno=2, end_col_offset=45), Constant(None, lineno=2, col_offset=56, end_lineno=2, end_col_offset=60)]), [Assign([Attribute(Name('self', Load(), lineno=3, col_offset=8, end_lineno=3, end_col_offset=12), 'placeholder_2', Store(), lineno=3, col_offset=8, end_lineno=3, end_col_offset=18)], Name('placeholder_2', Load(), lineno=3, col_offset=21, end_lineno=3, end_col_offset=26), lineno=3, col_offset=8, end_lineno=3, end_col_offset=26), Assign([Attribute(Name('self', Load(), lineno=4, col_offset=8, end_lineno=4, end_col_offset=12), 'placeholder_3', Store(), lineno=4, col_offset=8, end_lineno=4, end_col_offset=23)], Name('placeholder_3', Load(), lineno=4, col_offset=26, end_lineno=4, end_col_offset=36), lineno=4, col_offset=8, end_lineno=4, end_col_offset=36), Assign([Attribute(Name('self', Load(), lineno=5, col_offset=8, end_lineno=5, end_col_offset=12), 'placeholder_5', Store(), lineno=5, col_offset=8, end_lineno=5, end_col_offset=17)], Name('placeholder_4', Load(), lineno=5, col_offset=20, end_lineno=5, end_col_offset=28), lineno=5, col_offset=8, end_lineno=5, end_col_offset=28)], [], lineno=2, col_offset=4, end_lineno=5, end_col_offset=28)], [], lineno=1, col_offset=0, end_lineno=5, end_col_offset=28), ClassDef('placeholder_6', [], [], [FunctionDef('placeholder_1', arguments([], [arg('self', lineno=9, col_offset=17, end_lineno=9, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Attribute(Name('self', Load(), lineno=10, col_offset=8, end_lineno=10, end_col_offset=12), 'placeholder_7', Store(), lineno=10, col_offset=8, end_lineno=10, end_col_offset=17)], Constant(None, lineno=10, col_offset=20, end_lineno=10, end_col_offset=24), lineno=10, col_offset=8, end_lineno=10, end_col_offset=24), Assign([Attribute(Name('self', Load(), lineno=11, col_offset=8, end_lineno=11, end_col_offset=12), 'placeholder_8', Store(), lineno=11, col_offset=8, end_lineno=11, end_col_offset=17)], Constant(None, lineno=11, col_offset=20, end_lineno=11, end_col_offset=24), lineno=11, col_offset=8, end_lineno=11, end_col_offset=24), Assign([Attribute(Name('self', Load(), lineno=12, col_offset=8, end_lineno=12, end_col_offset=12), 'placeholder_9', Store(), lineno=12, col_offset=8, end_lineno=12, end_col_offset=19)], Constant(0, lineno=12, col_offset=22, end_lineno=12, end_col_offset=23), lineno=12, col_offset=8, end_lineno=12, end_col_offset=23)], [], lineno=9, col_offset=4, end_lineno=12, end_col_offset=23), FunctionDef('placeholder_10', arguments([], [arg('self', lineno=14, col_offset=16, end_lineno=14, end_col_offset=20)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Attribute(Name('self', Load(), lineno=15, col_offset=15, end_lineno=15, end_col_offset=19), 'placeholder_9', Load(), lineno=15, col_offset=15, end_lineno=15, end_col_offset=26), lineno=15, col_offset=8, end_lineno=15, end_col_offset=26)], [], lineno=14, col_offset=4, end_lineno=15, end_col_offset=26), FunctionDef('placeholder_11', arguments([], [arg('self', lineno=17, col_offset=17, end_lineno=17, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_12', Store(), lineno=18, col_offset=8, end_lineno=18, end_col_offset=20)], Attribute(Name('self', Load(), lineno=18, col_offset=23, end_lineno=18, end_col_offset=27), 'placeholder_7', Load(), lineno=18, col_offset=23, end_lineno=18, end_col_offset=32), lineno=18, col_offset=8, end_lineno=18, end_col_offset=32), While(Name('placeholder_12', Load(), lineno=19, col_offset=14, end_lineno=19, end_col_offset=26), [Expr(Yield(Tuple([Attribute(Name('current_node', Load(), lineno=20, col_offset=19, end_lineno=20, end_col_offset=31), 'value', Load(), lineno=20, col_offset=19, end_lineno=20, end_col_offset=37), Attribute(Name('current_node', Load(), lineno=20, col_offset=39, end_lineno=20, end_col_offset=51), 'succeeding', Load(), lineno=20, col_offset=39, end_lineno=20, end_col_offset=62), Attribute(Name('current_node', Load(), lineno=20, col_offset=64, end_lineno=20, end_col_offset=76), 'prev', Load(), lineno=20, col_offset=64, end_lineno=20, end_col_offset=81)], Load(), lineno=20, col_offset=18, end_lineno=20, end_col_offset=82), lineno=20, col_offset=12, end_lineno=20, end_col_offset=82), lineno=20, col_offset=12, end_lineno=20, end_col_offset=82), Assign([Name('placeholder_12', Store(), lineno=21, col_offset=12, end_lineno=21, end_col_offset=24)], Attribute(Name('placeholder_12', Load(), lineno=21, col_offset=27, end_lineno=21, end_col_offset=39), 'placeholder_3', Load(), lineno=21, col_offset=27, end_lineno=21, end_col_offset=50), lineno=21, col_offset=12, end_lineno=21, end_col_offset=50)], [], lineno=19, col_offset=8, end_lineno=21, end_col_offset=50)], [], lineno=17, col_offset=4, end_lineno=21, end_col_offset=50), FunctionDef('placeholder_13', arguments([], [arg('self', lineno=23, col_offset=15, end_lineno=23, end_col_offset=19), arg('placeholder_14', lineno=23, col_offset=21, end_lineno=23, end_col_offset=30)], kwonlyargs=[], kw_defaults=[], defaults=[]), [If(Compare(Attribute(Name('self', Load(), lineno=24, col_offset=11, end_lineno=24, end_col_offset=15), 'placeholder_9', Load(), lineno=24, col_offset=11, end_lineno=24, end_col_offset=22), [Eq()], [Constant(0, lineno=24, col_offset=26, end_lineno=24, end_col_offset=27)], lineno=24, col_offset=11, end_lineno=24, end_col_offset=27), [Raise(Call(Name('ValueError', Load(), lineno=25, col_offset=18, end_lineno=25, end_col_offset=28), [Constant('Value not found', lineno=25, col_offset=29, end_lineno=25, end_col_offset=46)], [], lineno=25, col_offset=18, end_lineno=25, end_col_offset=47), lineno=25, col_offset=12, end_lineno=25, end_col_offset=47)], [], lineno=24, col_offset=8, end_lineno=25, end_col_offset=47), Assign([Name('placeholder_15', Store(), lineno=26, col_offset=8, end_lineno=26, end_col_offset=13)], Constant(False, lineno=26, col_offset=16, end_lineno=26, end_col_offset=21), lineno=26, col_offset=8, end_lineno=26, end_col_offset=21), Assign([Name('placeholder_16', Store(), lineno=27, col_offset=8, end_lineno=27, end_col_offset=12)], Attribute(Name('self', Load(), lineno=27, col_offset=15, end_lineno=27, end_col_offset=19), 'placeholder_7', Load(), lineno=27, col_offset=15, end_lineno=27, end_col_offset=24), lineno=27, col_offset=8, end_lineno=27, end_col_offset=24), For(Tuple([Name('placeholder_2', Store(), lineno=29, col_offset=12, end_lineno=29, end_col_offset=17), Name('placeholder_3', Store(), lineno=29, col_offset=19, end_lineno=29, end_col_offset=29), Name('placeholder_5', Store(), lineno=29, col_offset=31, end_lineno=29, end_col_offset=35)], Store(), lineno=29, col_offset=12, end_lineno=29, end_col_offset=35), Name('self', Load(), lineno=29, col_offset=39, end_lineno=29, end_col_offset=43), [If(Compare(Name('placeholder_2', Load(), lineno=30, col_offset=15, end_lineno=30, end_col_offset=20), [Eq()], [Name('placeholder_14', Load(), lineno=30, col_offset=24, end_lineno=30, end_col_offset=33)], lineno=30, col_offset=15, end_lineno=30, end_col_offset=33), [If(Name('placeholder_5', Load(), lineno=31, col_offset=19, end_lineno=31, end_col_offset=23), [Assign([Attribute(Attribute(Name('placeholder_16', Load(), lineno=32, col_offset=20, end_lineno=32, end_col_offset=24), 'placeholder_5', Load(), lineno=32, col_offset=20, end_lineno=32, end_col_offset=29), 'placeholder_3', Store(), lineno=32, col_offset=20, end_lineno=32, end_col_offset=40)], Name('placeholder_3', Load(), lineno=32, col_offset=43, end_lineno=32, end_col_offset=53), lineno=32, col_offset=20, end_lineno=32, end_col_offset=53)], [Assign([Attribute(Name('self', Load(), lineno=34, col_offset=20, end_lineno=34, end_col_offset=24), 'placeholder_7', Store(), lineno=34, col_offset=20, end_lineno=34, end_col_offset=29)], Name('placeholder_3', Load(), lineno=34, col_offset=32, end_lineno=34, end_col_offset=42), lineno=34, col_offset=20, end_lineno=34, end_col_offset=42)], lineno=31, col_offset=16, end_lineno=34, end_col_offset=42), If(Name('placeholder_3', Load(), lineno=35, col_offset=19, end_lineno=35, end_col_offset=29), [Assign([Attribute(Attribute(Name('placeholder_16', Load(), lineno=36, col_offset=20, end_lineno=36, end_col_offset=24), 'placeholder_3', Load(), lineno=36, col_offset=20, end_lineno=36, end_col_offset=35), 'placeholder_5', Store(), lineno=36, col_offset=20, end_lineno=36, end_col_offset=40)], Name('placeholder_5', Load(), lineno=36, col_offset=43, end_lineno=36, end_col_offset=47), lineno=36, col_offset=20, end_lineno=36, end_col_offset=47)], [Assign([Attribute(Name('self', Load(), lineno=38, col_offset=20, end_lineno=38, end_col_offset=24), 'placeholder_8', Store(), lineno=38, col_offset=20, end_lineno=38, end_col_offset=29)], Name('placeholder_5', Load(), lineno=38, col_offset=32, end_lineno=38, end_col_offset=36), lineno=38, col_offset=20, end_lineno=38, end_col_offset=36)], lineno=35, col_offset=16, end_lineno=38, end_col_offset=36), Assign([Name('placeholder_15', Store(), lineno=40, col_offset=16, end_lineno=40, end_col_offset=21)], Constant(True, lineno=40, col_offset=24, end_lineno=40, end_col_offset=28), lineno=40, col_offset=16, end_lineno=40, end_col_offset=28), AugAssign(Attribute(Name('self', Load(), lineno=41, col_offset=16, end_lineno=41, end_col_offset=20), 'placeholder_9', Store(), lineno=41, col_offset=16, end_lineno=41, end_col_offset=27), Sub(), Constant(1, lineno=41, col_offset=31, end_lineno=41, end_col_offset=32), lineno=41, col_offset=16, end_lineno=41, end_col_offset=32), Break(lineno=42, col_offset=16, end_lineno=42, end_col_offset=21)], [], lineno=30, col_offset=12, end_lineno=42, end_col_offset=21), Assign([Name('placeholder_16', Store(), lineno=43, col_offset=12, end_lineno=43, end_col_offset=16)], Attribute(Name('placeholder_16', Load(), lineno=43, col_offset=19, end_lineno=43, end_col_offset=23), 'placeholder_3', Load(), lineno=43, col_offset=19, end_lineno=43, end_col_offset=34), lineno=43, col_offset=12, end_lineno=43, end_col_offset=34)], [], lineno=29, col_offset=8, end_lineno=43, end_col_offset=34), If(UnaryOp(Not(), Name('placeholder_15', Load(), lineno=44, col_offset=15, end_lineno=44, end_col_offset=20), lineno=44, col_offset=11, end_lineno=44, end_col_offset=20), [Raise(Call(Name('ValueError', Load(), lineno=45, col_offset=18, end_lineno=45, end_col_offset=28), [Constant('Value not found', lineno=45, col_offset=29, end_lineno=45, end_col_offset=46)], [], lineno=45, col_offset=18, end_lineno=45, end_col_offset=47), lineno=45, col_offset=12, end_lineno=45, end_col_offset=47)], [], lineno=44, col_offset=8, end_lineno=45, end_col_offset=47)], [], lineno=23, col_offset=4, end_lineno=45, end_col_offset=47), FunctionDef('placeholder_17', arguments([], [arg('self', lineno=47, col_offset=13, end_lineno=47, end_col_offset=17), arg('placeholder_2', lineno=47, col_offset=19, end_lineno=47, end_col_offset=24)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_18', Store(), lineno=48, col_offset=8, end_lineno=48, end_col_offset=16)], Call(Name('placeholder_0', Load(), lineno=48, col_offset=19, end_lineno=48, end_col_offset=23), [Name('placeholder_2', Load(), lineno=48, col_offset=24, end_lineno=48, end_col_offset=29)], [], lineno=48, col_offset=19, end_lineno=48, end_col_offset=30), lineno=48, col_offset=8, end_lineno=48, end_col_offset=30), If(UnaryOp(Not(), Attribute(Name('self', Load(), lineno=49, col_offset=15, end_lineno=49, end_col_offset=19), 'placeholder_7', Load(), lineno=49, col_offset=15, end_lineno=49, end_col_offset=24), lineno=49, col_offset=11, end_lineno=49, end_col_offset=24), [Assign([Attribute(Name('self', Load(), lineno=50, col_offset=12, end_lineno=50, end_col_offset=16), 'placeholder_7', Store(), lineno=50, col_offset=12, end_lineno=50, end_col_offset=21), Attribute(Name('self', Load(), lineno=50, col_offset=24, end_lineno=50, end_col_offset=28), 'placeholder_8', Store(), lineno=50, col_offset=24, end_lineno=50, end_col_offset=33)], Name('placeholder_18', Load(), lineno=50, col_offset=36, end_lineno=50, end_col_offset=44), lineno=50, col_offset=12, end_lineno=50, end_col_offset=44)], [Assign([Attribute(Name('placeholder_18', Load(), lineno=52, col_offset=12, end_lineno=52, end_col_offset=20), 'placeholder_5', Store(), lineno=52, col_offset=12, end_lineno=52, end_col_offset=25)], Attribute(Name('self', Load(), lineno=52, col_offset=28, end_lineno=52, end_col_offset=32), 'placeholder_8', Load(), lineno=52, col_offset=28, end_lineno=52, end_col_offset=37), lineno=52, col_offset=12, end_lineno=52, end_col_offset=37), Assign([Attribute(Attribute(Name('self', Load(), lineno=53, col_offset=12, end_lineno=53, end_col_offset=16), 'placeholder_8', Load(), lineno=53, col_offset=12, end_lineno=53, end_col_offset=21), 'placeholder_3', Store(), lineno=53, col_offset=12, end_lineno=53, end_col_offset=32)], Name('placeholder_18', Load(), lineno=53, col_offset=35, end_lineno=53, end_col_offset=43), lineno=53, col_offset=12, end_lineno=53, end_col_offset=43), Assign([Attribute(Name('self', Load(), lineno=54, col_offset=12, end_lineno=54, end_col_offset=16), 'placeholder_8', Store(), lineno=54, col_offset=12, end_lineno=54, end_col_offset=21)], Name('placeholder_18', Load(), lineno=54, col_offset=24, end_lineno=54, end_col_offset=32), lineno=54, col_offset=12, end_lineno=54, end_col_offset=32)], lineno=49, col_offset=8, end_lineno=54, end_col_offset=32), AugAssign(Attribute(Name('self', Load(), lineno=56, col_offset=8, end_lineno=56, end_col_offset=12), 'placeholder_9', Store(), lineno=56, col_offset=8, end_lineno=56, end_col_offset=19), Add(), Constant(1, lineno=56, col_offset=23, end_lineno=56, end_col_offset=24), lineno=56, col_offset=8, end_lineno=56, end_col_offset=24)], [], lineno=47, col_offset=4, end_lineno=56, end_col_offset=24), FunctionDef('placeholder_19', arguments([], [arg('self', lineno=58, col_offset=12, end_lineno=58, end_col_offset=16)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_16', Store(), lineno=59, col_offset=8, end_lineno=59, end_col_offset=12)], Attribute(Name('self', Load(), lineno=59, col_offset=15, end_lineno=59, end_col_offset=19), 'placeholder_8', Load(), lineno=59, col_offset=15, end_lineno=59, end_col_offset=24), lineno=59, col_offset=8, end_lineno=59, end_col_offset=24), If(Compare(Attribute(Name('self', Load(), lineno=61, col_offset=11, end_lineno=61, end_col_offset=15), 'placeholder_9', Load(), lineno=61, col_offset=11, end_lineno=61, end_col_offset=22), [Eq()], [Constant(0, lineno=61, col_offset=26, end_lineno=61, end_col_offset=27)], lineno=61, col_offset=11, end_lineno=61, end_col_offset=27), [Raise(Call(Name('IndexError', Load(), lineno=62, col_offset=18, end_lineno=62, end_col_offset=28), [Constant('List is empty', lineno=62, col_offset=29, end_lineno=62, end_col_offset=44)], [], lineno=62, col_offset=18, end_lineno=62, end_col_offset=45), lineno=62, col_offset=12, end_lineno=62, end_col_offset=45)], [], lineno=61, col_offset=8, end_lineno=62, end_col_offset=45), If(BoolOp(Or(), [Compare(Name('placeholder_16', Load(), lineno=63, col_offset=11, end_lineno=63, end_col_offset=15), [Is()], [Constant(None, lineno=63, col_offset=19, end_lineno=63, end_col_offset=23)], lineno=63, col_offset=11, end_lineno=63, end_col_offset=23), Compare(Attribute(Name('placeholder_16', Load(), lineno=63, col_offset=27, end_lineno=63, end_col_offset=31), 'placeholder_5', Load(), lineno=63, col_offset=27, end_lineno=63, end_col_offset=36), [Is()], [Constant(None, lineno=63, col_offset=40, end_lineno=63, end_col_offset=44)], lineno=63, col_offset=27, end_lineno=63, end_col_offset=44)], lineno=63, col_offset=11, end_lineno=63, end_col_offset=44), [Assign([Attribute(Name('self', Load(), lineno=64, col_offset=12, end_lineno=64, end_col_offset=16), 'placeholder_7', Store(), lineno=64, col_offset=12, end_lineno=64, end_col_offset=21), Attribute(Name('self', Load(), lineno=64, col_offset=24, end_lineno=64, end_col_offset=28), 'placeholder_8', Store(), lineno=64, col_offset=24, end_lineno=64, end_col_offset=33)], Constant(None, lineno=64, col_offset=36, end_lineno=64, end_col_offset=40), lineno=64, col_offset=12, end_lineno=64, end_col_offset=40)], [Assign([Attribute(Name('self', Load(), lineno=66, col_offset=12, end_lineno=66, end_col_offset=16), 'placeholder_8', Store(), lineno=66, col_offset=12, end_lineno=66, end_col_offset=21)], Attribute(Attribute(Name('self', Load(), lineno=66, col_offset=24, end_lineno=66, end_col_offset=28), 'placeholder_8', Load(), lineno=66, col_offset=24, end_lineno=66, end_col_offset=33), 'placeholder_5', Load(), lineno=66, col_offset=24, end_lineno=66, end_col_offset=38), lineno=66, col_offset=12, end_lineno=66, end_col_offset=38), Assign([Attribute(Attribute(Name('self', Load(), lineno=67, col_offset=12, end_lineno=67, end_col_offset=16), 'placeholder_8', Load(), lineno=67, col_offset=12, end_lineno=67, end_col_offset=21), 'placeholder_3', Store(), lineno=67, col_offset=12, end_lineno=67, end_col_offset=32)], Constant(None, lineno=67, col_offset=35, end_lineno=67, end_col_offset=39), lineno=67, col_offset=12, end_lineno=67, end_col_offset=39)], lineno=63, col_offset=8, end_lineno=67, end_col_offset=39), AugAssign(Attribute(Name('self', Load(), lineno=68, col_offset=8, end_lineno=68, end_col_offset=12), 'placeholder_9', Store(), lineno=68, col_offset=8, end_lineno=68, end_col_offset=19), Sub(), Constant(1, lineno=68, col_offset=23, end_lineno=68, end_col_offset=24), lineno=68, col_offset=8, end_lineno=68, end_col_offset=24), Return(Attribute(Name('placeholder_16', Load(), lineno=70, col_offset=15, end_lineno=70, end_col_offset=19), 'placeholder_2', Load(), lineno=70, col_offset=15, end_lineno=70, end_col_offset=25), lineno=70, col_offset=8, end_lineno=70, end_col_offset=25)], [], lineno=58, col_offset=4, end_lineno=70, end_col_offset=25), FunctionDef('placeholder_20', arguments([], [arg('self', lineno=72, col_offset=14, end_lineno=72, end_col_offset=18)], kwonlyargs=[], kw_defaults=[], defaults=[]), [If(Compare(Attribute(Name('self', Load(), lineno=73, col_offset=11, end_lineno=73, end_col_offset=15), 'placeholder_9', Load(), lineno=73, col_offset=11, end_lineno=73, end_col_offset=22), [Eq()], [Constant(0, lineno=73, col_offset=26, end_lineno=73, end_col_offset=27)], lineno=73, col_offset=11, end_lineno=73, end_col_offset=27), [Raise(Call(Name('IndexError', Load(), lineno=74, col_offset=18, end_lineno=74, end_col_offset=28), [Constant('List is empty', lineno=74, col_offset=29, end_lineno=74, end_col_offset=44)], [], lineno=74, col_offset=18, end_lineno=74, end_col_offset=45), lineno=74, col_offset=12, end_lineno=74, end_col_offset=45)], [], lineno=73, col_offset=8, end_lineno=74, end_col_offset=45), Assign([Name('placeholder_16', Store(), lineno=75, col_offset=8, end_lineno=75, end_col_offset=12)], Attribute(Name('self', Load(), lineno=75, col_offset=15, end_lineno=75, end_col_offset=19), 'placeholder_7', Load(), lineno=75, col_offset=15, end_lineno=75, end_col_offset=24), lineno=75, col_offset=8, end_lineno=75, end_col_offset=24), If(BoolOp(Or(), [Compare(Name('placeholder_16', Load(), lineno=76, col_offset=11, end_lineno=76, end_col_offset=15), [Is()], [Constant(None, lineno=76, col_offset=19, end_lineno=76, end_col_offset=23)], lineno=76, col_offset=11, end_lineno=76, end_col_offset=23), Compare(Attribute(Name('placeholder_16', Load(), lineno=76, col_offset=27, end_lineno=76, end_col_offset=31), 'placeholder_3', Load(), lineno=76, col_offset=27, end_lineno=76, end_col_offset=42), [Is()], [Constant(None, lineno=76, col_offset=46, end_lineno=76, end_col_offset=50)], lineno=76, col_offset=27, end_lineno=76, end_col_offset=50)], lineno=76, col_offset=11, end_lineno=76, end_col_offset=50), [Assign([Attribute(Name('self', Load(), lineno=77, col_offset=12, end_lineno=77, end_col_offset=16), 'placeholder_7', Store(), lineno=77, col_offset=12, end_lineno=77, end_col_offset=21), Attribute(Name('self', Load(), lineno=77, col_offset=24, end_lineno=77, end_col_offset=28), 'placeholder_8', Store(), lineno=77, col_offset=24, end_lineno=77, end_col_offset=33)], Constant(None, lineno=77, col_offset=36, end_lineno=77, end_col_offset=40), lineno=77, col_offset=12, end_lineno=77, end_col_offset=40)], [Assign([Attribute(Name('self', Load(), lineno=79, col_offset=12, end_lineno=79, end_col_offset=16), 'placeholder_7', Store(), lineno=79, col_offset=12, end_lineno=79, end_col_offset=21)], Attribute(Attribute(Name('self', Load(), lineno=79, col_offset=24, end_lineno=79, end_col_offset=28), 'placeholder_7', Load(), lineno=79, col_offset=24, end_lineno=79, end_col_offset=33), 'placeholder_3', Load(), lineno=79, col_offset=24, end_lineno=79, end_col_offset=44), lineno=79, col_offset=12, end_lineno=79, end_col_offset=44), Assign([Attribute(Attribute(Name('self', Load(), lineno=80, col_offset=12, end_lineno=80, end_col_offset=16), 'placeholder_7', Load(), lineno=80, col_offset=12, end_lineno=80, end_col_offset=21), 'placeholder_5', Store(), lineno=80, col_offset=12, end_lineno=80, end_col_offset=26)], Constant(None, lineno=80, col_offset=29, end_lineno=80, end_col_offset=33), lineno=80, col_offset=12, end_lineno=80, end_col_offset=33)], lineno=76, col_offset=8, end_lineno=80, end_col_offset=33), AugAssign(Attribute(Name('self', Load(), lineno=81, col_offset=8, end_lineno=81, end_col_offset=12), 'placeholder_9', Store(), lineno=81, col_offset=8, end_lineno=81, end_col_offset=19), Sub(), Constant(1, lineno=81, col_offset=23, end_lineno=81, end_col_offset=24), lineno=81, col_offset=8, end_lineno=81, end_col_offset=24), Return(Attribute(Name('placeholder_16', Load(), lineno=83, col_offset=15, end_lineno=83, end_col_offset=19), 'placeholder_2', Load(), lineno=83, col_offset=15, end_lineno=83, end_col_offset=25), lineno=83, col_offset=8, end_lineno=83, end_col_offset=25)], [], lineno=72, col_offset=4, end_lineno=83, end_col_offset=25), FunctionDef('placeholder_21', arguments([], [arg('self', lineno=85, col_offset=16, end_lineno=85, end_col_offset=20), arg('placeholder_2', lineno=85, col_offset=22, end_lineno=85, end_col_offset=27)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_18', Store(), lineno=86, col_offset=8, end_lineno=86, end_col_offset=16)], Call(Name('placeholder_0', Load(), lineno=86, col_offset=19, end_lineno=86, end_col_offset=23), [Name('placeholder_2', Load(), lineno=86, col_offset=24, end_lineno=86, end_col_offset=29)], [], lineno=86, col_offset=19, end_lineno=86, end_col_offset=30), lineno=86, col_offset=8, end_lineno=86, end_col_offset=30), If(UnaryOp(Not(), Attribute(Name('self', Load(), lineno=87, col_offset=15, end_lineno=87, end_col_offset=19), 'placeholder_7', Load(), lineno=87, col_offset=15, end_lineno=87, end_col_offset=24), lineno=87, col_offset=11, end_lineno=87, end_col_offset=24), [Assign([Attribute(Name('self', Load(), lineno=88, col_offset=12, end_lineno=88, end_col_offset=16), 'placeholder_7', Store(), lineno=88, col_offset=12, end_lineno=88, end_col_offset=21), Attribute(Name('self', Load(), lineno=88, col_offset=24, end_lineno=88, end_col_offset=28), 'placeholder_8', Store(), lineno=88, col_offset=24, end_lineno=88, end_col_offset=33)], Name('placeholder_18', Load(), lineno=88, col_offset=36, end_lineno=88, end_col_offset=44), lineno=88, col_offset=12, end_lineno=88, end_col_offset=44)], [Assign([Attribute(Name('placeholder_18', Load(), lineno=90, col_offset=12, end_lineno=90, end_col_offset=20), 'placeholder_3', Store(), lineno=90, col_offset=12, end_lineno=90, end_col_offset=31)], Attribute(Name('self', Load(), lineno=90, col_offset=34, end_lineno=90, end_col_offset=38), 'placeholder_7', Load(), lineno=90, col_offset=34, end_lineno=90, end_col_offset=43), lineno=90, col_offset=12, end_lineno=90, end_col_offset=43), Assign([Attribute(Attribute(Name('self', Load(), lineno=91, col_offset=12, end_lineno=91, end_col_offset=16), 'placeholder_7', Load(), lineno=91, col_offset=12, end_lineno=91, end_col_offset=21), 'placeholder_5', Store(), lineno=91, col_offset=12, end_lineno=91, end_col_offset=26)], Name('placeholder_18', Load(), lineno=91, col_offset=29, end_lineno=91, end_col_offset=37), lineno=91, col_offset=12, end_lineno=91, end_col_offset=37), Assign([Attribute(Name('self', Load(), lineno=92, col_offset=12, end_lineno=92, end_col_offset=16), 'placeholder_7', Store(), lineno=92, col_offset=12, end_lineno=92, end_col_offset=21)], Name('placeholder_18', Load(), lineno=92, col_offset=24, end_lineno=92, end_col_offset=32), lineno=92, col_offset=12, end_lineno=92, end_col_offset=32)], lineno=87, col_offset=8, end_lineno=92, end_col_offset=32), AugAssign(Attribute(Name('self', Load(), lineno=94, col_offset=8, end_lineno=94, end_col_offset=12), 'placeholder_9', Store(), lineno=94, col_offset=8, end_lineno=94, end_col_offset=19), Add(), Constant(1, lineno=94, col_offset=23, end_lineno=94, end_col_offset=24), lineno=94, col_offset=8, end_lineno=94, end_col_offset=24)], [], lineno=85, col_offset=4, end_lineno=94, end_col_offset=24)], [], lineno=8, col_offset=0, end_lineno=94, end_col_offset=24)], []) \ No newline at end of file +Module([ClassDef('placeholder_0', [], [], [FunctionDef('placeholder_1', arguments([], [arg('self', lineno=2, col_offset=17, end_lineno=2, end_col_offset=21), arg('placeholder_2', lineno=2, col_offset=23, end_lineno=2, end_col_offset=28), arg('placeholder_3', lineno=2, col_offset=30, end_lineno=2, end_col_offset=40), arg('placeholder_4', lineno=2, col_offset=47, end_lineno=2, end_col_offset=55)], kwonlyargs=[], kw_defaults=[], defaults=[Constant(None, lineno=2, col_offset=41, end_lineno=2, end_col_offset=45), Constant(None, lineno=2, col_offset=56, end_lineno=2, end_col_offset=60)]), [Assign([Attribute(Name('self', Load(), lineno=3, col_offset=8, end_lineno=3, end_col_offset=12), 'placeholder_2', Store(), lineno=3, col_offset=8, end_lineno=3, end_col_offset=18)], Name('placeholder_2', Load(), lineno=3, col_offset=21, end_lineno=3, end_col_offset=26), lineno=3, col_offset=8, end_lineno=3, end_col_offset=26), Assign([Attribute(Name('self', Load(), lineno=4, col_offset=8, end_lineno=4, end_col_offset=12), 'placeholder_3', Store(), lineno=4, col_offset=8, end_lineno=4, end_col_offset=23)], Name('placeholder_3', Load(), lineno=4, col_offset=26, end_lineno=4, end_col_offset=36), lineno=4, col_offset=8, end_lineno=4, end_col_offset=36), Assign([Attribute(Name('self', Load(), lineno=5, col_offset=8, end_lineno=5, end_col_offset=12), 'placeholder_5', Store(), lineno=5, col_offset=8, end_lineno=5, end_col_offset=17)], Name('placeholder_4', Load(), lineno=5, col_offset=20, end_lineno=5, end_col_offset=28), lineno=5, col_offset=8, end_lineno=5, end_col_offset=28)], [], lineno=2, col_offset=4, end_lineno=5, end_col_offset=28)], [], lineno=1, col_offset=0, end_lineno=5, end_col_offset=28), ClassDef('placeholder_6', [], [], [FunctionDef('placeholder_1', arguments([], [arg('self', lineno=9, col_offset=17, end_lineno=9, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Attribute(Name('self', Load(), lineno=10, col_offset=8, end_lineno=10, end_col_offset=12), 'placeholder_7', Store(), lineno=10, col_offset=8, end_lineno=10, end_col_offset=17)], Constant(None, lineno=10, col_offset=20, end_lineno=10, end_col_offset=24), lineno=10, col_offset=8, end_lineno=10, end_col_offset=24), Assign([Attribute(Name('self', Load(), lineno=11, col_offset=8, end_lineno=11, end_col_offset=12), 'placeholder_8', Store(), lineno=11, col_offset=8, end_lineno=11, end_col_offset=17)], Constant(None, lineno=11, col_offset=20, end_lineno=11, end_col_offset=24), lineno=11, col_offset=8, end_lineno=11, end_col_offset=24), Assign([Attribute(Name('self', Load(), lineno=12, col_offset=8, end_lineno=12, end_col_offset=12), 'placeholder_9', Store(), lineno=12, col_offset=8, end_lineno=12, end_col_offset=19)], Constant(0, lineno=12, col_offset=22, end_lineno=12, end_col_offset=23), lineno=12, col_offset=8, end_lineno=12, end_col_offset=23)], [], lineno=9, col_offset=4, end_lineno=12, end_col_offset=23), FunctionDef('placeholder_10', arguments([], [arg('self', lineno=14, col_offset=16, end_lineno=14, end_col_offset=20)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Attribute(Name('self', Load(), lineno=15, col_offset=15, end_lineno=15, end_col_offset=19), 'placeholder_9', Load(), lineno=15, col_offset=15, end_lineno=15, end_col_offset=26), lineno=15, col_offset=8, end_lineno=15, end_col_offset=26)], [], lineno=14, col_offset=4, end_lineno=15, end_col_offset=26), FunctionDef('placeholder_11', arguments([], [arg('self', lineno=17, col_offset=17, end_lineno=17, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_12', Store(), lineno=18, col_offset=8, end_lineno=18, end_col_offset=20)], Attribute(Name('self', Load(), lineno=18, col_offset=23, end_lineno=18, end_col_offset=27), 'placeholder_7', Load(), lineno=18, col_offset=23, end_lineno=18, end_col_offset=32), lineno=18, col_offset=8, end_lineno=18, end_col_offset=32), While(Name('placeholder_12', Load(), lineno=19, col_offset=14, end_lineno=19, end_col_offset=26), [Expr(Yield(Tuple([Attribute(Name('placeholder_12', Load(), lineno=20, col_offset=19, end_lineno=20, end_col_offset=31), 'placeholder_2', Load(), lineno=20, col_offset=19, end_lineno=20, end_col_offset=37), Attribute(Name('placeholder_12', Load(), lineno=20, col_offset=39, end_lineno=20, end_col_offset=51), 'placeholder_3', Load(), lineno=20, col_offset=39, end_lineno=20, end_col_offset=62), Attribute(Name('placeholder_12', Load(), lineno=20, col_offset=64, end_lineno=20, end_col_offset=76), 'placeholder_5', Load(), lineno=20, col_offset=64, end_lineno=20, end_col_offset=81)], Load(), lineno=20, col_offset=18, end_lineno=20, end_col_offset=82), lineno=20, col_offset=12, end_lineno=20, end_col_offset=82), lineno=20, col_offset=12, end_lineno=20, end_col_offset=82), Assign([Name('placeholder_12', Store(), lineno=21, col_offset=12, end_lineno=21, end_col_offset=24)], Attribute(Name('placeholder_12', Load(), lineno=21, col_offset=27, end_lineno=21, end_col_offset=39), 'placeholder_3', Load(), lineno=21, col_offset=27, end_lineno=21, end_col_offset=50), lineno=21, col_offset=12, end_lineno=21, end_col_offset=50)], [], lineno=19, col_offset=8, end_lineno=21, end_col_offset=50)], [], lineno=17, col_offset=4, end_lineno=21, end_col_offset=50), FunctionDef('placeholder_13', arguments([], [arg('self', lineno=23, col_offset=15, end_lineno=23, end_col_offset=19), arg('placeholder_14', lineno=23, col_offset=21, end_lineno=23, end_col_offset=30)], kwonlyargs=[], kw_defaults=[], defaults=[]), [If(Compare(Attribute(Name('self', Load(), lineno=24, col_offset=11, end_lineno=24, end_col_offset=15), 'placeholder_9', Load(), lineno=24, col_offset=11, end_lineno=24, end_col_offset=22), [Eq()], [Constant(0, lineno=24, col_offset=26, end_lineno=24, end_col_offset=27)], lineno=24, col_offset=11, end_lineno=24, end_col_offset=27), [Raise(Call(Name('ValueError', Load(), lineno=25, col_offset=18, end_lineno=25, end_col_offset=28), [Constant('Value not found', lineno=25, col_offset=29, end_lineno=25, end_col_offset=46)], [], lineno=25, col_offset=18, end_lineno=25, end_col_offset=47), lineno=25, col_offset=12, end_lineno=25, end_col_offset=47)], [], lineno=24, col_offset=8, end_lineno=25, end_col_offset=47), Assign([Name('placeholder_15', Store(), lineno=26, col_offset=8, end_lineno=26, end_col_offset=13)], Constant(False, lineno=26, col_offset=16, end_lineno=26, end_col_offset=21), lineno=26, col_offset=8, end_lineno=26, end_col_offset=21), Assign([Name('placeholder_16', Store(), lineno=27, col_offset=8, end_lineno=27, end_col_offset=12)], Attribute(Name('self', Load(), lineno=27, col_offset=15, end_lineno=27, end_col_offset=19), 'placeholder_7', Load(), lineno=27, col_offset=15, end_lineno=27, end_col_offset=24), lineno=27, col_offset=8, end_lineno=27, end_col_offset=24), For(Tuple([Name('placeholder_2', Store(), lineno=29, col_offset=12, end_lineno=29, end_col_offset=17), Name('placeholder_3', Store(), lineno=29, col_offset=19, end_lineno=29, end_col_offset=29), Name('placeholder_5', Store(), lineno=29, col_offset=31, end_lineno=29, end_col_offset=35)], Store(), lineno=29, col_offset=12, end_lineno=29, end_col_offset=35), Name('self', Load(), lineno=29, col_offset=39, end_lineno=29, end_col_offset=43), [If(Compare(Name('placeholder_2', Load(), lineno=30, col_offset=15, end_lineno=30, end_col_offset=20), [Eq()], [Name('placeholder_14', Load(), lineno=30, col_offset=24, end_lineno=30, end_col_offset=33)], lineno=30, col_offset=15, end_lineno=30, end_col_offset=33), [If(Name('placeholder_5', Load(), lineno=31, col_offset=19, end_lineno=31, end_col_offset=23), [Assign([Attribute(Attribute(Name('placeholder_16', Load(), lineno=32, col_offset=20, end_lineno=32, end_col_offset=24), 'placeholder_5', Load(), lineno=32, col_offset=20, end_lineno=32, end_col_offset=29), 'placeholder_3', Store(), lineno=32, col_offset=20, end_lineno=32, end_col_offset=40)], Name('placeholder_3', Load(), lineno=32, col_offset=43, end_lineno=32, end_col_offset=53), lineno=32, col_offset=20, end_lineno=32, end_col_offset=53)], [Assign([Attribute(Name('self', Load(), lineno=34, col_offset=20, end_lineno=34, end_col_offset=24), 'placeholder_7', Store(), lineno=34, col_offset=20, end_lineno=34, end_col_offset=29)], Name('placeholder_3', Load(), lineno=34, col_offset=32, end_lineno=34, end_col_offset=42), lineno=34, col_offset=20, end_lineno=34, end_col_offset=42)], lineno=31, col_offset=16, end_lineno=34, end_col_offset=42), If(Name('placeholder_3', Load(), lineno=35, col_offset=19, end_lineno=35, end_col_offset=29), [Assign([Attribute(Attribute(Name('placeholder_16', Load(), lineno=36, col_offset=20, end_lineno=36, end_col_offset=24), 'placeholder_3', Load(), lineno=36, col_offset=20, end_lineno=36, end_col_offset=35), 'placeholder_5', Store(), lineno=36, col_offset=20, end_lineno=36, end_col_offset=40)], Name('placeholder_5', Load(), lineno=36, col_offset=43, end_lineno=36, end_col_offset=47), lineno=36, col_offset=20, end_lineno=36, end_col_offset=47)], [Assign([Attribute(Name('self', Load(), lineno=38, col_offset=20, end_lineno=38, end_col_offset=24), 'placeholder_8', Store(), lineno=38, col_offset=20, end_lineno=38, end_col_offset=29)], Name('placeholder_5', Load(), lineno=38, col_offset=32, end_lineno=38, end_col_offset=36), lineno=38, col_offset=20, end_lineno=38, end_col_offset=36)], lineno=35, col_offset=16, end_lineno=38, end_col_offset=36), Assign([Name('placeholder_15', Store(), lineno=40, col_offset=16, end_lineno=40, end_col_offset=21)], Constant(True, lineno=40, col_offset=24, end_lineno=40, end_col_offset=28), lineno=40, col_offset=16, end_lineno=40, end_col_offset=28), AugAssign(Attribute(Name('self', Load(), lineno=41, col_offset=16, end_lineno=41, end_col_offset=20), 'placeholder_9', Store(), lineno=41, col_offset=16, end_lineno=41, end_col_offset=27), Sub(), Constant(1, lineno=41, col_offset=31, end_lineno=41, end_col_offset=32), lineno=41, col_offset=16, end_lineno=41, end_col_offset=32), Break(lineno=42, col_offset=16, end_lineno=42, end_col_offset=21)], [], lineno=30, col_offset=12, end_lineno=42, end_col_offset=21), Assign([Name('placeholder_16', Store(), lineno=43, col_offset=12, end_lineno=43, end_col_offset=16)], Attribute(Name('placeholder_16', Load(), lineno=43, col_offset=19, end_lineno=43, end_col_offset=23), 'placeholder_3', Load(), lineno=43, col_offset=19, end_lineno=43, end_col_offset=34), lineno=43, col_offset=12, end_lineno=43, end_col_offset=34)], [], lineno=29, col_offset=8, end_lineno=43, end_col_offset=34), If(UnaryOp(Not(), Name('placeholder_15', Load(), lineno=44, col_offset=15, end_lineno=44, end_col_offset=20), lineno=44, col_offset=11, end_lineno=44, end_col_offset=20), [Raise(Call(Name('ValueError', Load(), lineno=45, col_offset=18, end_lineno=45, end_col_offset=28), [Constant('Value not found', lineno=45, col_offset=29, end_lineno=45, end_col_offset=46)], [], lineno=45, col_offset=18, end_lineno=45, end_col_offset=47), lineno=45, col_offset=12, end_lineno=45, end_col_offset=47)], [], lineno=44, col_offset=8, end_lineno=45, end_col_offset=47)], [], lineno=23, col_offset=4, end_lineno=45, end_col_offset=47), FunctionDef('placeholder_17', arguments([], [arg('self', lineno=47, col_offset=13, end_lineno=47, end_col_offset=17), arg('placeholder_2', lineno=47, col_offset=19, end_lineno=47, end_col_offset=24)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_18', Store(), lineno=48, col_offset=8, end_lineno=48, end_col_offset=16)], Call(Name('placeholder_0', Load(), lineno=48, col_offset=19, end_lineno=48, end_col_offset=23), [Name('placeholder_2', Load(), lineno=48, col_offset=24, end_lineno=48, end_col_offset=29)], [], lineno=48, col_offset=19, end_lineno=48, end_col_offset=30), lineno=48, col_offset=8, end_lineno=48, end_col_offset=30), If(UnaryOp(Not(), Attribute(Name('self', Load(), lineno=49, col_offset=15, end_lineno=49, end_col_offset=19), 'placeholder_7', Load(), lineno=49, col_offset=15, end_lineno=49, end_col_offset=24), lineno=49, col_offset=11, end_lineno=49, end_col_offset=24), [Assign([Attribute(Name('self', Load(), lineno=50, col_offset=12, end_lineno=50, end_col_offset=16), 'placeholder_7', Store(), lineno=50, col_offset=12, end_lineno=50, end_col_offset=21), Attribute(Name('self', Load(), lineno=50, col_offset=24, end_lineno=50, end_col_offset=28), 'placeholder_8', Store(), lineno=50, col_offset=24, end_lineno=50, end_col_offset=33)], Name('placeholder_18', Load(), lineno=50, col_offset=36, end_lineno=50, end_col_offset=44), lineno=50, col_offset=12, end_lineno=50, end_col_offset=44)], [Assign([Attribute(Name('placeholder_18', Load(), lineno=52, col_offset=12, end_lineno=52, end_col_offset=20), 'placeholder_5', Store(), lineno=52, col_offset=12, end_lineno=52, end_col_offset=25)], Attribute(Name('self', Load(), lineno=52, col_offset=28, end_lineno=52, end_col_offset=32), 'placeholder_8', Load(), lineno=52, col_offset=28, end_lineno=52, end_col_offset=37), lineno=52, col_offset=12, end_lineno=52, end_col_offset=37), Assign([Attribute(Attribute(Name('self', Load(), lineno=53, col_offset=12, end_lineno=53, end_col_offset=16), 'placeholder_8', Load(), lineno=53, col_offset=12, end_lineno=53, end_col_offset=21), 'placeholder_3', Store(), lineno=53, col_offset=12, end_lineno=53, end_col_offset=32)], Name('placeholder_18', Load(), lineno=53, col_offset=35, end_lineno=53, end_col_offset=43), lineno=53, col_offset=12, end_lineno=53, end_col_offset=43), Assign([Attribute(Name('self', Load(), lineno=54, col_offset=12, end_lineno=54, end_col_offset=16), 'placeholder_8', Store(), lineno=54, col_offset=12, end_lineno=54, end_col_offset=21)], Name('placeholder_18', Load(), lineno=54, col_offset=24, end_lineno=54, end_col_offset=32), lineno=54, col_offset=12, end_lineno=54, end_col_offset=32)], lineno=49, col_offset=8, end_lineno=54, end_col_offset=32), AugAssign(Attribute(Name('self', Load(), lineno=56, col_offset=8, end_lineno=56, end_col_offset=12), 'placeholder_9', Store(), lineno=56, col_offset=8, end_lineno=56, end_col_offset=19), Add(), Constant(1, lineno=56, col_offset=23, end_lineno=56, end_col_offset=24), lineno=56, col_offset=8, end_lineno=56, end_col_offset=24)], [], lineno=47, col_offset=4, end_lineno=56, end_col_offset=24), FunctionDef('placeholder_19', arguments([], [arg('self', lineno=58, col_offset=12, end_lineno=58, end_col_offset=16)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_16', Store(), lineno=59, col_offset=8, end_lineno=59, end_col_offset=12)], Attribute(Name('self', Load(), lineno=59, col_offset=15, end_lineno=59, end_col_offset=19), 'placeholder_8', Load(), lineno=59, col_offset=15, end_lineno=59, end_col_offset=24), lineno=59, col_offset=8, end_lineno=59, end_col_offset=24), If(Compare(Attribute(Name('self', Load(), lineno=61, col_offset=11, end_lineno=61, end_col_offset=15), 'placeholder_9', Load(), lineno=61, col_offset=11, end_lineno=61, end_col_offset=22), [Eq()], [Constant(0, lineno=61, col_offset=26, end_lineno=61, end_col_offset=27)], lineno=61, col_offset=11, end_lineno=61, end_col_offset=27), [Raise(Call(Name('IndexError', Load(), lineno=62, col_offset=18, end_lineno=62, end_col_offset=28), [Constant('List is empty', lineno=62, col_offset=29, end_lineno=62, end_col_offset=44)], [], lineno=62, col_offset=18, end_lineno=62, end_col_offset=45), lineno=62, col_offset=12, end_lineno=62, end_col_offset=45)], [], lineno=61, col_offset=8, end_lineno=62, end_col_offset=45), If(BoolOp(Or(), [Compare(Name('placeholder_16', Load(), lineno=63, col_offset=11, end_lineno=63, end_col_offset=15), [Is()], [Constant(None, lineno=63, col_offset=19, end_lineno=63, end_col_offset=23)], lineno=63, col_offset=11, end_lineno=63, end_col_offset=23), Compare(Attribute(Name('placeholder_16', Load(), lineno=63, col_offset=27, end_lineno=63, end_col_offset=31), 'placeholder_5', Load(), lineno=63, col_offset=27, end_lineno=63, end_col_offset=36), [Is()], [Constant(None, lineno=63, col_offset=40, end_lineno=63, end_col_offset=44)], lineno=63, col_offset=27, end_lineno=63, end_col_offset=44)], lineno=63, col_offset=11, end_lineno=63, end_col_offset=44), [Assign([Attribute(Name('self', Load(), lineno=64, col_offset=12, end_lineno=64, end_col_offset=16), 'placeholder_7', Store(), lineno=64, col_offset=12, end_lineno=64, end_col_offset=21), Attribute(Name('self', Load(), lineno=64, col_offset=24, end_lineno=64, end_col_offset=28), 'placeholder_8', Store(), lineno=64, col_offset=24, end_lineno=64, end_col_offset=33)], Constant(None, lineno=64, col_offset=36, end_lineno=64, end_col_offset=40), lineno=64, col_offset=12, end_lineno=64, end_col_offset=40)], [Assign([Attribute(Name('self', Load(), lineno=66, col_offset=12, end_lineno=66, end_col_offset=16), 'placeholder_8', Store(), lineno=66, col_offset=12, end_lineno=66, end_col_offset=21)], Attribute(Attribute(Name('self', Load(), lineno=66, col_offset=24, end_lineno=66, end_col_offset=28), 'placeholder_8', Load(), lineno=66, col_offset=24, end_lineno=66, end_col_offset=33), 'placeholder_5', Load(), lineno=66, col_offset=24, end_lineno=66, end_col_offset=38), lineno=66, col_offset=12, end_lineno=66, end_col_offset=38), Assign([Attribute(Attribute(Name('self', Load(), lineno=67, col_offset=12, end_lineno=67, end_col_offset=16), 'placeholder_8', Load(), lineno=67, col_offset=12, end_lineno=67, end_col_offset=21), 'placeholder_3', Store(), lineno=67, col_offset=12, end_lineno=67, end_col_offset=32)], Constant(None, lineno=67, col_offset=35, end_lineno=67, end_col_offset=39), lineno=67, col_offset=12, end_lineno=67, end_col_offset=39)], lineno=63, col_offset=8, end_lineno=67, end_col_offset=39), AugAssign(Attribute(Name('self', Load(), lineno=68, col_offset=8, end_lineno=68, end_col_offset=12), 'placeholder_9', Store(), lineno=68, col_offset=8, end_lineno=68, end_col_offset=19), Sub(), Constant(1, lineno=68, col_offset=23, end_lineno=68, end_col_offset=24), lineno=68, col_offset=8, end_lineno=68, end_col_offset=24), Return(Attribute(Name('placeholder_16', Load(), lineno=70, col_offset=15, end_lineno=70, end_col_offset=19), 'placeholder_2', Load(), lineno=70, col_offset=15, end_lineno=70, end_col_offset=25), lineno=70, col_offset=8, end_lineno=70, end_col_offset=25)], [], lineno=58, col_offset=4, end_lineno=70, end_col_offset=25), FunctionDef('placeholder_20', arguments([], [arg('self', lineno=72, col_offset=14, end_lineno=72, end_col_offset=18)], kwonlyargs=[], kw_defaults=[], defaults=[]), [If(Compare(Attribute(Name('self', Load(), lineno=73, col_offset=11, end_lineno=73, end_col_offset=15), 'placeholder_9', Load(), lineno=73, col_offset=11, end_lineno=73, end_col_offset=22), [Eq()], [Constant(0, lineno=73, col_offset=26, end_lineno=73, end_col_offset=27)], lineno=73, col_offset=11, end_lineno=73, end_col_offset=27), [Raise(Call(Name('IndexError', Load(), lineno=74, col_offset=18, end_lineno=74, end_col_offset=28), [Constant('List is empty', lineno=74, col_offset=29, end_lineno=74, end_col_offset=44)], [], lineno=74, col_offset=18, end_lineno=74, end_col_offset=45), lineno=74, col_offset=12, end_lineno=74, end_col_offset=45)], [], lineno=73, col_offset=8, end_lineno=74, end_col_offset=45), Assign([Name('placeholder_16', Store(), lineno=75, col_offset=8, end_lineno=75, end_col_offset=12)], Attribute(Name('self', Load(), lineno=75, col_offset=15, end_lineno=75, end_col_offset=19), 'placeholder_7', Load(), lineno=75, col_offset=15, end_lineno=75, end_col_offset=24), lineno=75, col_offset=8, end_lineno=75, end_col_offset=24), If(BoolOp(Or(), [Compare(Name('placeholder_16', Load(), lineno=76, col_offset=11, end_lineno=76, end_col_offset=15), [Is()], [Constant(None, lineno=76, col_offset=19, end_lineno=76, end_col_offset=23)], lineno=76, col_offset=11, end_lineno=76, end_col_offset=23), Compare(Attribute(Name('placeholder_16', Load(), lineno=76, col_offset=27, end_lineno=76, end_col_offset=31), 'placeholder_3', Load(), lineno=76, col_offset=27, end_lineno=76, end_col_offset=42), [Is()], [Constant(None, lineno=76, col_offset=46, end_lineno=76, end_col_offset=50)], lineno=76, col_offset=27, end_lineno=76, end_col_offset=50)], lineno=76, col_offset=11, end_lineno=76, end_col_offset=50), [Assign([Attribute(Name('self', Load(), lineno=77, col_offset=12, end_lineno=77, end_col_offset=16), 'placeholder_7', Store(), lineno=77, col_offset=12, end_lineno=77, end_col_offset=21), Attribute(Name('self', Load(), lineno=77, col_offset=24, end_lineno=77, end_col_offset=28), 'placeholder_8', Store(), lineno=77, col_offset=24, end_lineno=77, end_col_offset=33)], Constant(None, lineno=77, col_offset=36, end_lineno=77, end_col_offset=40), lineno=77, col_offset=12, end_lineno=77, end_col_offset=40)], [Assign([Attribute(Name('self', Load(), lineno=79, col_offset=12, end_lineno=79, end_col_offset=16), 'placeholder_7', Store(), lineno=79, col_offset=12, end_lineno=79, end_col_offset=21)], Attribute(Attribute(Name('self', Load(), lineno=79, col_offset=24, end_lineno=79, end_col_offset=28), 'placeholder_7', Load(), lineno=79, col_offset=24, end_lineno=79, end_col_offset=33), 'placeholder_3', Load(), lineno=79, col_offset=24, end_lineno=79, end_col_offset=44), lineno=79, col_offset=12, end_lineno=79, end_col_offset=44), Assign([Attribute(Attribute(Name('self', Load(), lineno=80, col_offset=12, end_lineno=80, end_col_offset=16), 'placeholder_7', Load(), lineno=80, col_offset=12, end_lineno=80, end_col_offset=21), 'placeholder_5', Store(), lineno=80, col_offset=12, end_lineno=80, end_col_offset=26)], Constant(None, lineno=80, col_offset=29, end_lineno=80, end_col_offset=33), lineno=80, col_offset=12, end_lineno=80, end_col_offset=33)], lineno=76, col_offset=8, end_lineno=80, end_col_offset=33), AugAssign(Attribute(Name('self', Load(), lineno=81, col_offset=8, end_lineno=81, end_col_offset=12), 'placeholder_9', Store(), lineno=81, col_offset=8, end_lineno=81, end_col_offset=19), Sub(), Constant(1, lineno=81, col_offset=23, end_lineno=81, end_col_offset=24), lineno=81, col_offset=8, end_lineno=81, end_col_offset=24), Return(Attribute(Name('placeholder_16', Load(), lineno=83, col_offset=15, end_lineno=83, end_col_offset=19), 'placeholder_2', Load(), lineno=83, col_offset=15, end_lineno=83, end_col_offset=25), lineno=83, col_offset=8, end_lineno=83, end_col_offset=25)], [], lineno=72, col_offset=4, end_lineno=83, end_col_offset=25), FunctionDef('placeholder_21', arguments([], [arg('self', lineno=85, col_offset=16, end_lineno=85, end_col_offset=20), arg('placeholder_2', lineno=85, col_offset=22, end_lineno=85, end_col_offset=27)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_18', Store(), lineno=86, col_offset=8, end_lineno=86, end_col_offset=16)], Call(Name('placeholder_0', Load(), lineno=86, col_offset=19, end_lineno=86, end_col_offset=23), [Name('placeholder_2', Load(), lineno=86, col_offset=24, end_lineno=86, end_col_offset=29)], [], lineno=86, col_offset=19, end_lineno=86, end_col_offset=30), lineno=86, col_offset=8, end_lineno=86, end_col_offset=30), If(UnaryOp(Not(), Attribute(Name('self', Load(), lineno=87, col_offset=15, end_lineno=87, end_col_offset=19), 'placeholder_7', Load(), lineno=87, col_offset=15, end_lineno=87, end_col_offset=24), lineno=87, col_offset=11, end_lineno=87, end_col_offset=24), [Assign([Attribute(Name('self', Load(), lineno=88, col_offset=12, end_lineno=88, end_col_offset=16), 'placeholder_7', Store(), lineno=88, col_offset=12, end_lineno=88, end_col_offset=21), Attribute(Name('self', Load(), lineno=88, col_offset=24, end_lineno=88, end_col_offset=28), 'placeholder_8', Store(), lineno=88, col_offset=24, end_lineno=88, end_col_offset=33)], Name('placeholder_18', Load(), lineno=88, col_offset=36, end_lineno=88, end_col_offset=44), lineno=88, col_offset=12, end_lineno=88, end_col_offset=44)], [Assign([Attribute(Name('placeholder_18', Load(), lineno=90, col_offset=12, end_lineno=90, end_col_offset=20), 'placeholder_3', Store(), lineno=90, col_offset=12, end_lineno=90, end_col_offset=31)], Attribute(Name('self', Load(), lineno=90, col_offset=34, end_lineno=90, end_col_offset=38), 'placeholder_7', Load(), lineno=90, col_offset=34, end_lineno=90, end_col_offset=43), lineno=90, col_offset=12, end_lineno=90, end_col_offset=43), Assign([Attribute(Attribute(Name('self', Load(), lineno=91, col_offset=12, end_lineno=91, end_col_offset=16), 'placeholder_7', Load(), lineno=91, col_offset=12, end_lineno=91, end_col_offset=21), 'placeholder_5', Store(), lineno=91, col_offset=12, end_lineno=91, end_col_offset=26)], Name('placeholder_18', Load(), lineno=91, col_offset=29, end_lineno=91, end_col_offset=37), lineno=91, col_offset=12, end_lineno=91, end_col_offset=37), Assign([Attribute(Name('self', Load(), lineno=92, col_offset=12, end_lineno=92, end_col_offset=16), 'placeholder_7', Store(), lineno=92, col_offset=12, end_lineno=92, end_col_offset=21)], Name('placeholder_18', Load(), lineno=92, col_offset=24, end_lineno=92, end_col_offset=32), lineno=92, col_offset=12, end_lineno=92, end_col_offset=32)], lineno=87, col_offset=8, end_lineno=92, end_col_offset=32), AugAssign(Attribute(Name('self', Load(), lineno=94, col_offset=8, end_lineno=94, end_col_offset=12), 'placeholder_9', Store(), lineno=94, col_offset=8, end_lineno=94, end_col_offset=19), Add(), Constant(1, lineno=94, col_offset=23, end_lineno=94, end_col_offset=24), lineno=94, col_offset=8, end_lineno=94, end_col_offset=24)], [], lineno=85, col_offset=4, end_lineno=94, end_col_offset=24)], [], lineno=8, col_offset=0, end_lineno=94, end_col_offset=24)], []) \ No newline at end of file diff --git a/test/practice-nth-prime/representation.txt b/test/practice-nth-prime/representation.txt index f59c08c..c96b56b 100644 --- a/test/practice-nth-prime/representation.txt +++ b/test/practice-nth-prime/representation.txt @@ -1 +1 @@ -Module([ImportFrom('itertools', [alias('count', lineno=1, col_offset=22, end_lineno=1, end_col_offset=27)], 0, lineno=1, col_offset=0, end_lineno=1, end_col_offset=27), ImportFrom('math', [alias('sqrt', lineno=2, col_offset=17, end_lineno=2, end_col_offset=21)], 0, lineno=2, col_offset=0, end_lineno=2, end_col_offset=21), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=5, col_offset=10, end_lineno=5, end_col_offset=16)], kwonlyargs=[], kw_defaults=[], defaults=[]), [If(Compare(Name('placeholder_1', Load(), lineno=6, col_offset=7, end_lineno=6, end_col_offset=13), [Lt()], [Constant(1, lineno=6, col_offset=16, end_lineno=6, end_col_offset=17)], lineno=6, col_offset=7, end_lineno=6, end_col_offset=17), [Raise(Call(Name('ValueError', Load(), lineno=7, col_offset=14, end_lineno=7, end_col_offset=24), [Constant('there is no zeroth prime', lineno=7, col_offset=25, end_lineno=7, end_col_offset=51)], [], lineno=7, col_offset=14, end_lineno=7, end_col_offset=52), lineno=7, col_offset=8, end_lineno=7, end_col_offset=52)], [], lineno=6, col_offset=4, end_lineno=7, end_col_offset=52), Assign([Name('placeholder_2', Store(), lineno=9, col_offset=4, end_lineno=9, end_col_offset=9)], List([], Load(), lineno=9, col_offset=12, end_lineno=9, end_col_offset=14), lineno=9, col_offset=4, end_lineno=9, end_col_offset=14), Assign([Name('placeholder_3', Store(), lineno=10, col_offset=4, end_lineno=10, end_col_offset=14)], Call(Name('prime_candidates', Load(), lineno=10, col_offset=17, end_lineno=10, end_col_offset=33), [], [], lineno=10, col_offset=17, end_lineno=10, end_col_offset=35), lineno=10, col_offset=4, end_lineno=10, end_col_offset=35), FunctionDef('placeholder_4', arguments([], [arg('placeholder_5', lineno=12, col_offset=17, end_lineno=12, end_col_offset=26)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_6', Store(), lineno=13, col_offset=8, end_lineno=13, end_col_offset=22)], Call(Name('sqrt', Load(), lineno=13, col_offset=25, end_lineno=13, end_col_offset=29), [Name('placeholder_5', Load(), lineno=13, col_offset=30, end_lineno=13, end_col_offset=39)], [], lineno=13, col_offset=25, end_lineno=13, end_col_offset=40), lineno=13, col_offset=8, end_lineno=13, end_col_offset=40), For(Name('placeholder_7', Store(), lineno=14, col_offset=12, end_lineno=14, end_col_offset=16), Name('placeholder_2', Load(), lineno=14, col_offset=20, end_lineno=14, end_col_offset=25), [If(Compare(Name('placeholder_7', Load(), lineno=15, col_offset=15, end_lineno=15, end_col_offset=19), [Gt()], [Name('placeholder_6', Load(), lineno=15, col_offset=22, end_lineno=15, end_col_offset=36)], lineno=15, col_offset=15, end_lineno=15, end_col_offset=36), [Return(Constant(True, lineno=16, col_offset=23, end_lineno=16, end_col_offset=27), lineno=16, col_offset=16, end_lineno=16, end_col_offset=27)], [If(Compare(BinOp(Name('placeholder_5', Load(), lineno=17, col_offset=17, end_lineno=17, end_col_offset=26), Mod(), Name('placeholder_7', Load(), lineno=17, col_offset=29, end_lineno=17, end_col_offset=33), lineno=17, col_offset=17, end_lineno=17, end_col_offset=33), [Eq()], [Constant(0, lineno=17, col_offset=37, end_lineno=17, end_col_offset=38)], lineno=17, col_offset=17, end_lineno=17, end_col_offset=38), [Return(Constant(False, lineno=18, col_offset=23, end_lineno=18, end_col_offset=28), lineno=18, col_offset=16, end_lineno=18, end_col_offset=28)], [], lineno=17, col_offset=12, end_lineno=18, end_col_offset=28)], lineno=15, col_offset=12, end_lineno=18, end_col_offset=28)], [], lineno=14, col_offset=8, end_lineno=18, end_col_offset=28), Return(Constant(True, lineno=19, col_offset=15, end_lineno=19, end_col_offset=19), lineno=19, col_offset=8, end_lineno=19, end_col_offset=19)], [], lineno=12, col_offset=4, end_lineno=19, end_col_offset=19), While(Compare(Call(Name('len', Load(), lineno=21, col_offset=10, end_lineno=21, end_col_offset=13), [Name('placeholder_2', Load(), lineno=21, col_offset=14, end_lineno=21, end_col_offset=19)], [], lineno=21, col_offset=10, end_lineno=21, end_col_offset=20), [Lt()], [Name('placeholder_1', Load(), lineno=21, col_offset=23, end_lineno=21, end_col_offset=29)], lineno=21, col_offset=10, end_lineno=21, end_col_offset=29), [Assign([Name('placeholder_8', Store(), lineno=22, col_offset=8, end_lineno=22, end_col_offset=16)], Call(Name('next', Load(), lineno=22, col_offset=19, end_lineno=22, end_col_offset=23), [Name('placeholder_3', Load(), lineno=22, col_offset=24, end_lineno=22, end_col_offset=34)], [], lineno=22, col_offset=19, end_lineno=22, end_col_offset=35), lineno=22, col_offset=8, end_lineno=22, end_col_offset=35), If(Call(Name('placeholder_4', Load(), lineno=23, col_offset=11, end_lineno=23, end_col_offset=19), [Name('placeholder_8', Load(), lineno=23, col_offset=20, end_lineno=23, end_col_offset=28)], [], lineno=23, col_offset=11, end_lineno=23, end_col_offset=29), [Expr(Call(Attribute(Name('placeholder_2', Load(), lineno=24, col_offset=12, end_lineno=24, end_col_offset=17), 'append', Load(), lineno=24, col_offset=12, end_lineno=24, end_col_offset=24), [Name('placeholder_8', Load(), lineno=24, col_offset=25, end_lineno=24, end_col_offset=33)], [], lineno=24, col_offset=12, end_lineno=24, end_col_offset=34), lineno=24, col_offset=12, end_lineno=24, end_col_offset=34)], [], lineno=23, col_offset=8, end_lineno=24, end_col_offset=34)], [], lineno=21, col_offset=4, end_lineno=24, end_col_offset=34), Return(Subscript(Name('placeholder_2', Load(), lineno=26, col_offset=11, end_lineno=26, end_col_offset=16), BinOp(Name('placeholder_1', Load(), lineno=26, col_offset=17, end_lineno=26, end_col_offset=23), Sub(), Constant(1, lineno=26, col_offset=26, end_lineno=26, end_col_offset=27), lineno=26, col_offset=17, end_lineno=26, end_col_offset=27), Load(), lineno=26, col_offset=11, end_lineno=26, end_col_offset=28), lineno=26, col_offset=4, end_lineno=26, end_col_offset=28)], [], lineno=5, col_offset=0, end_lineno=26, end_col_offset=28), FunctionDef('placeholder_9', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Expr(Yield(Constant(2, lineno=30, col_offset=10, end_lineno=30, end_col_offset=11), lineno=30, col_offset=4, end_lineno=30, end_col_offset=11), lineno=30, col_offset=4, end_lineno=30, end_col_offset=11), Expr(Yield(Constant(3, lineno=31, col_offset=10, end_lineno=31, end_col_offset=11), lineno=31, col_offset=4, end_lineno=31, end_col_offset=11), lineno=31, col_offset=4, end_lineno=31, end_col_offset=11), For(Name('placeholder_1', Store(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=14), Call(Name('count', Load(), lineno=32, col_offset=18, end_lineno=32, end_col_offset=23), [Constant(6, lineno=32, col_offset=24, end_lineno=32, end_col_offset=25), Constant(6, lineno=32, col_offset=27, end_lineno=32, end_col_offset=28)], [], lineno=32, col_offset=18, end_lineno=32, end_col_offset=29), [Expr(Yield(BinOp(Name('number', Load(), lineno=33, col_offset=14, end_lineno=33, end_col_offset=20), Sub(), Constant(1, lineno=33, col_offset=23, end_lineno=33, end_col_offset=24), lineno=33, col_offset=14, end_lineno=33, end_col_offset=24), lineno=33, col_offset=8, end_lineno=33, end_col_offset=24), lineno=33, col_offset=8, end_lineno=33, end_col_offset=24), Expr(Yield(BinOp(Name('number', Load(), lineno=34, col_offset=14, end_lineno=34, end_col_offset=20), Add(), Constant(1, lineno=34, col_offset=23, end_lineno=34, end_col_offset=24), lineno=34, col_offset=14, end_lineno=34, end_col_offset=24), lineno=34, col_offset=8, end_lineno=34, end_col_offset=24), lineno=34, col_offset=8, end_lineno=34, end_col_offset=24)], [], lineno=32, col_offset=4, end_lineno=34, end_col_offset=24)], [], lineno=29, col_offset=0, end_lineno=34, end_col_offset=24)], []) \ No newline at end of file +Module([ImportFrom('itertools', [alias('count', lineno=1, col_offset=22, end_lineno=1, end_col_offset=27)], 0, lineno=1, col_offset=0, end_lineno=1, end_col_offset=27), ImportFrom('math', [alias('sqrt', lineno=2, col_offset=17, end_lineno=2, end_col_offset=21)], 0, lineno=2, col_offset=0, end_lineno=2, end_col_offset=21), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=5, col_offset=10, end_lineno=5, end_col_offset=16)], kwonlyargs=[], kw_defaults=[], defaults=[]), [If(Compare(Name('placeholder_1', Load(), lineno=6, col_offset=7, end_lineno=6, end_col_offset=13), [Lt()], [Constant(1, lineno=6, col_offset=16, end_lineno=6, end_col_offset=17)], lineno=6, col_offset=7, end_lineno=6, end_col_offset=17), [Raise(Call(Name('ValueError', Load(), lineno=7, col_offset=14, end_lineno=7, end_col_offset=24), [Constant('there is no zeroth prime', lineno=7, col_offset=25, end_lineno=7, end_col_offset=51)], [], lineno=7, col_offset=14, end_lineno=7, end_col_offset=52), lineno=7, col_offset=8, end_lineno=7, end_col_offset=52)], [], lineno=6, col_offset=4, end_lineno=7, end_col_offset=52), Assign([Name('placeholder_2', Store(), lineno=9, col_offset=4, end_lineno=9, end_col_offset=9)], List([], Load(), lineno=9, col_offset=12, end_lineno=9, end_col_offset=14), lineno=9, col_offset=4, end_lineno=9, end_col_offset=14), Assign([Name('placeholder_3', Store(), lineno=10, col_offset=4, end_lineno=10, end_col_offset=14)], Call(Name('prime_candidates', Load(), lineno=10, col_offset=17, end_lineno=10, end_col_offset=33), [], [], lineno=10, col_offset=17, end_lineno=10, end_col_offset=35), lineno=10, col_offset=4, end_lineno=10, end_col_offset=35), FunctionDef('placeholder_4', arguments([], [arg('placeholder_5', lineno=12, col_offset=17, end_lineno=12, end_col_offset=26)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_6', Store(), lineno=13, col_offset=8, end_lineno=13, end_col_offset=22)], Call(Name('sqrt', Load(), lineno=13, col_offset=25, end_lineno=13, end_col_offset=29), [Name('placeholder_5', Load(), lineno=13, col_offset=30, end_lineno=13, end_col_offset=39)], [], lineno=13, col_offset=25, end_lineno=13, end_col_offset=40), lineno=13, col_offset=8, end_lineno=13, end_col_offset=40), For(Name('placeholder_7', Store(), lineno=14, col_offset=12, end_lineno=14, end_col_offset=16), Name('placeholder_2', Load(), lineno=14, col_offset=20, end_lineno=14, end_col_offset=25), [If(Compare(Name('placeholder_7', Load(), lineno=15, col_offset=15, end_lineno=15, end_col_offset=19), [Gt()], [Name('placeholder_6', Load(), lineno=15, col_offset=22, end_lineno=15, end_col_offset=36)], lineno=15, col_offset=15, end_lineno=15, end_col_offset=36), [Return(Constant(True, lineno=16, col_offset=23, end_lineno=16, end_col_offset=27), lineno=16, col_offset=16, end_lineno=16, end_col_offset=27)], [If(Compare(BinOp(Name('placeholder_5', Load(), lineno=17, col_offset=17, end_lineno=17, end_col_offset=26), Mod(), Name('placeholder_7', Load(), lineno=17, col_offset=29, end_lineno=17, end_col_offset=33), lineno=17, col_offset=17, end_lineno=17, end_col_offset=33), [Eq()], [Constant(0, lineno=17, col_offset=37, end_lineno=17, end_col_offset=38)], lineno=17, col_offset=17, end_lineno=17, end_col_offset=38), [Return(Constant(False, lineno=18, col_offset=23, end_lineno=18, end_col_offset=28), lineno=18, col_offset=16, end_lineno=18, end_col_offset=28)], [], lineno=17, col_offset=12, end_lineno=18, end_col_offset=28)], lineno=15, col_offset=12, end_lineno=18, end_col_offset=28)], [], lineno=14, col_offset=8, end_lineno=18, end_col_offset=28), Return(Constant(True, lineno=19, col_offset=15, end_lineno=19, end_col_offset=19), lineno=19, col_offset=8, end_lineno=19, end_col_offset=19)], [], lineno=12, col_offset=4, end_lineno=19, end_col_offset=19), While(Compare(Call(Name('len', Load(), lineno=21, col_offset=10, end_lineno=21, end_col_offset=13), [Name('placeholder_2', Load(), lineno=21, col_offset=14, end_lineno=21, end_col_offset=19)], [], lineno=21, col_offset=10, end_lineno=21, end_col_offset=20), [Lt()], [Name('placeholder_1', Load(), lineno=21, col_offset=23, end_lineno=21, end_col_offset=29)], lineno=21, col_offset=10, end_lineno=21, end_col_offset=29), [Assign([Name('placeholder_8', Store(), lineno=22, col_offset=8, end_lineno=22, end_col_offset=16)], Call(Name('next', Load(), lineno=22, col_offset=19, end_lineno=22, end_col_offset=23), [Name('placeholder_3', Load(), lineno=22, col_offset=24, end_lineno=22, end_col_offset=34)], [], lineno=22, col_offset=19, end_lineno=22, end_col_offset=35), lineno=22, col_offset=8, end_lineno=22, end_col_offset=35), If(Call(Name('placeholder_4', Load(), lineno=23, col_offset=11, end_lineno=23, end_col_offset=19), [Name('placeholder_8', Load(), lineno=23, col_offset=20, end_lineno=23, end_col_offset=28)], [], lineno=23, col_offset=11, end_lineno=23, end_col_offset=29), [Expr(Call(Attribute(Name('placeholder_2', Load(), lineno=24, col_offset=12, end_lineno=24, end_col_offset=17), 'append', Load(), lineno=24, col_offset=12, end_lineno=24, end_col_offset=24), [Name('placeholder_8', Load(), lineno=24, col_offset=25, end_lineno=24, end_col_offset=33)], [], lineno=24, col_offset=12, end_lineno=24, end_col_offset=34), lineno=24, col_offset=12, end_lineno=24, end_col_offset=34)], [], lineno=23, col_offset=8, end_lineno=24, end_col_offset=34)], [], lineno=21, col_offset=4, end_lineno=24, end_col_offset=34), Return(Subscript(Name('placeholder_2', Load(), lineno=26, col_offset=11, end_lineno=26, end_col_offset=16), BinOp(Name('placeholder_1', Load(), lineno=26, col_offset=17, end_lineno=26, end_col_offset=23), Sub(), Constant(1, lineno=26, col_offset=26, end_lineno=26, end_col_offset=27), lineno=26, col_offset=17, end_lineno=26, end_col_offset=27), Load(), lineno=26, col_offset=11, end_lineno=26, end_col_offset=28), lineno=26, col_offset=4, end_lineno=26, end_col_offset=28)], [], lineno=5, col_offset=0, end_lineno=26, end_col_offset=28), FunctionDef('placeholder_9', arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), [Expr(Yield(Constant(2, lineno=30, col_offset=10, end_lineno=30, end_col_offset=11), lineno=30, col_offset=4, end_lineno=30, end_col_offset=11), lineno=30, col_offset=4, end_lineno=30, end_col_offset=11), Expr(Yield(Constant(3, lineno=31, col_offset=10, end_lineno=31, end_col_offset=11), lineno=31, col_offset=4, end_lineno=31, end_col_offset=11), lineno=31, col_offset=4, end_lineno=31, end_col_offset=11), For(Name('placeholder_1', Store(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=14), Call(Name('count', Load(), lineno=32, col_offset=18, end_lineno=32, end_col_offset=23), [Constant(6, lineno=32, col_offset=24, end_lineno=32, end_col_offset=25), Constant(6, lineno=32, col_offset=27, end_lineno=32, end_col_offset=28)], [], lineno=32, col_offset=18, end_lineno=32, end_col_offset=29), [Expr(Yield(BinOp(Name('placeholder_1', Load(), lineno=33, col_offset=14, end_lineno=33, end_col_offset=20), Sub(), Constant(1, lineno=33, col_offset=23, end_lineno=33, end_col_offset=24), lineno=33, col_offset=14, end_lineno=33, end_col_offset=24), lineno=33, col_offset=8, end_lineno=33, end_col_offset=24), lineno=33, col_offset=8, end_lineno=33, end_col_offset=24), Expr(Yield(BinOp(Name('placeholder_1', Load(), lineno=34, col_offset=14, end_lineno=34, end_col_offset=20), Add(), Constant(1, lineno=34, col_offset=23, end_lineno=34, end_col_offset=24), lineno=34, col_offset=14, end_lineno=34, end_col_offset=24), lineno=34, col_offset=8, end_lineno=34, end_col_offset=24), lineno=34, col_offset=8, end_lineno=34, end_col_offset=24)], [], lineno=32, col_offset=4, end_lineno=34, end_col_offset=24)], [], lineno=29, col_offset=0, end_lineno=34, end_col_offset=24)], []) \ No newline at end of file diff --git a/test/practice-palindrome-products/representation.txt b/test/practice-palindrome-products/representation.txt index 3dcc07e..787e6a1 100644 --- a/test/practice-palindrome-products/representation.txt +++ b/test/practice-palindrome-products/representation.txt @@ -1 +1 @@ -Module([ImportFrom('itertools', [alias('chain', lineno=1, col_offset=22, end_lineno=1, end_col_offset=27)], 0, lineno=1, col_offset=0, end_lineno=1, end_col_offset=27), ImportFrom('math', [alias('log10', lineno=2, col_offset=17, end_lineno=2, end_col_offset=22), alias('floor', lineno=2, col_offset=24, end_lineno=2, end_col_offset=29), alias('ceil', lineno=2, col_offset=31, end_lineno=2, end_col_offset=35)], 0, lineno=2, col_offset=0, end_lineno=2, end_col_offset=35), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=5, col_offset=12, end_lineno=5, end_col_offset=22), arg('placeholder_2', lineno=5, col_offset=24, end_lineno=5, end_col_offset=34)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Call(Name('get_extreme_palindrome_with_factors', Load(), lineno=6, col_offset=11, end_lineno=6, end_col_offset=46), [Name('placeholder_2', Load(), lineno=6, col_offset=47, end_lineno=6, end_col_offset=57), Name('placeholder_1', Load(), lineno=6, col_offset=59, end_lineno=6, end_col_offset=69), Constant('largest', lineno=6, col_offset=71, end_lineno=6, end_col_offset=80)], [], lineno=6, col_offset=11, end_lineno=6, end_col_offset=81), lineno=6, col_offset=4, end_lineno=6, end_col_offset=81)], [], lineno=5, col_offset=0, end_lineno=6, end_col_offset=81), FunctionDef('placeholder_3', arguments([], [arg('placeholder_2', lineno=9, col_offset=13, end_lineno=9, end_col_offset=23), arg('placeholder_1', lineno=9, col_offset=25, end_lineno=9, end_col_offset=35)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Call(Name('get_extreme_palindrome_with_factors', Load(), lineno=10, col_offset=11, end_lineno=10, end_col_offset=46), [Name('placeholder_2', Load(), lineno=10, col_offset=47, end_lineno=10, end_col_offset=57), Name('placeholder_1', Load(), lineno=10, col_offset=59, end_lineno=10, end_col_offset=69), Constant('smallest', lineno=10, col_offset=71, end_lineno=10, end_col_offset=81)], [], lineno=10, col_offset=11, end_lineno=10, end_col_offset=82), lineno=10, col_offset=4, end_lineno=10, end_col_offset=82)], [], lineno=9, col_offset=0, end_lineno=10, end_col_offset=82), FunctionDef('placeholder_4', arguments([], [arg('placeholder_2', lineno=13, col_offset=40, end_lineno=13, end_col_offset=50), arg('placeholder_1', lineno=13, col_offset=52, end_lineno=13, end_col_offset=62), arg('placeholder_5', lineno=13, col_offset=64, end_lineno=13, end_col_offset=71)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_6', Store(), lineno=14, col_offset=4, end_lineno=14, end_col_offset=21)], Call(Name('palindromes', Load(), lineno=14, col_offset=24, end_lineno=14, end_col_offset=35), [Name('placeholder_2', Load(), lineno=14, col_offset=36, end_lineno=14, end_col_offset=46), Name('placeholder_1', Load(), lineno=14, col_offset=48, end_lineno=14, end_col_offset=58)], [keyword('placeholder_7', Compare(Name('placeholder_5', Load(), lineno=14, col_offset=69, end_lineno=14, end_col_offset=76), [Eq()], [Constant('largest', lineno=14, col_offset=80, end_lineno=14, end_col_offset=89)], lineno=14, col_offset=69, end_lineno=14, end_col_offset=89), lineno=14, col_offset=60, end_lineno=14, end_col_offset=90)], lineno=14, col_offset=24, end_lineno=14, end_col_offset=91), lineno=14, col_offset=4, end_lineno=14, end_col_offset=91), Assign([Name('placeholder_8', Store(), lineno=15, col_offset=4, end_lineno=15, end_col_offset=16)], Constant(None, lineno=15, col_offset=19, end_lineno=15, end_col_offset=23), lineno=15, col_offset=4, end_lineno=15, end_col_offset=23), For(Name('placeholder_9', Store(), lineno=16, col_offset=8, end_lineno=16, end_col_offset=18), Name('placeholder_6', Load(), lineno=16, col_offset=22, end_lineno=16, end_col_offset=39), [Assign([Name('placeholder_8', Store(), lineno=17, col_offset=8, end_lineno=17, end_col_offset=20)], GeneratorExp(Tuple([Name('placeholder_10', Load(), lineno=17, col_offset=25, end_lineno=17, end_col_offset=31), BinOp(Name('placeholder_9', Load(), lineno=17, col_offset=33, end_lineno=17, end_col_offset=43), FloorDiv(), Name('placeholder_10', Load(), lineno=17, col_offset=47, end_lineno=17, end_col_offset=53), lineno=17, col_offset=33, end_lineno=17, end_col_offset=53)], Load(), lineno=17, col_offset=24, end_lineno=17, end_col_offset=54), [comprehension(Name('placeholder_10', Store(), lineno=18, col_offset=28, end_lineno=18, end_col_offset=34), Call(Name('range', Load(), lineno=18, col_offset=38, end_lineno=18, end_col_offset=43), [Name('placeholder_1', Load(), lineno=18, col_offset=44, end_lineno=18, end_col_offset=54), BinOp(Name('placeholder_2', Load(), lineno=18, col_offset=56, end_lineno=18, end_col_offset=66), Add(), Constant(1, lineno=18, col_offset=69, end_lineno=18, end_col_offset=70), lineno=18, col_offset=56, end_lineno=18, end_col_offset=70)], [], lineno=18, col_offset=38, end_lineno=18, end_col_offset=71), [Compare(BinOp(Name('placeholder_9', Load(), lineno=19, col_offset=27, end_lineno=19, end_col_offset=37), Mod(), Name('placeholder_10', Load(), lineno=19, col_offset=40, end_lineno=19, end_col_offset=46), lineno=19, col_offset=27, end_lineno=19, end_col_offset=46), [Eq()], [Constant(0, lineno=19, col_offset=50, end_lineno=19, end_col_offset=51)], lineno=19, col_offset=27, end_lineno=19, end_col_offset=51)], 0)], lineno=17, col_offset=23, end_lineno=19, end_col_offset=52), lineno=17, col_offset=8, end_lineno=19, end_col_offset=52), Assign([Name('placeholder_8', Store(), lineno=20, col_offset=8, end_lineno=20, end_col_offset=20)], Call(Name('list', Load(), lineno=20, col_offset=23, end_lineno=20, end_col_offset=27), [GeneratorExp(Name('placeholder_11', Load(), lineno=20, col_offset=28, end_lineno=20, end_col_offset=32), [comprehension(Name('placeholder_11', Store(), lineno=20, col_offset=37, end_lineno=20, end_col_offset=41), Name('placeholder_8', Load(), lineno=20, col_offset=45, end_lineno=20, end_col_offset=57), [Compare(Name('placeholder_1', Load(), lineno=21, col_offset=31, end_lineno=21, end_col_offset=41), [LtE(), LtE()], [Subscript(Name('placeholder_11', Load(), lineno=21, col_offset=45, end_lineno=21, end_col_offset=49), Constant(1, lineno=21, col_offset=50, end_lineno=21, end_col_offset=51), Load(), lineno=21, col_offset=45, end_lineno=21, end_col_offset=52), Name('placeholder_2', Load(), lineno=21, col_offset=56, end_lineno=21, end_col_offset=66)], lineno=21, col_offset=31, end_lineno=21, end_col_offset=66)], 0)], lineno=20, col_offset=27, end_lineno=21, end_col_offset=67)], [], lineno=20, col_offset=23, end_lineno=21, end_col_offset=67), lineno=20, col_offset=8, end_lineno=21, end_col_offset=67), If(Compare(Call(Name('len', Load(), lineno=22, col_offset=11, end_lineno=22, end_col_offset=14), [Name('placeholder_8', Load(), lineno=22, col_offset=15, end_lineno=22, end_col_offset=27)], [], lineno=22, col_offset=11, end_lineno=22, end_col_offset=28), [Gt()], [Constant(0, lineno=22, col_offset=31, end_lineno=22, end_col_offset=32)], lineno=22, col_offset=11, end_lineno=22, end_col_offset=32), [Break(lineno=23, col_offset=12, end_lineno=23, end_col_offset=17)], [], lineno=22, col_offset=8, end_lineno=23, end_col_offset=17)], [], lineno=16, col_offset=4, end_lineno=23, end_col_offset=17), If(UnaryOp(Not(), Name('placeholder_8', Load(), lineno=25, col_offset=11, end_lineno=25, end_col_offset=23), lineno=25, col_offset=7, end_lineno=25, end_col_offset=23), [Return(Tuple([Constant(None, lineno=26, col_offset=16, end_lineno=26, end_col_offset=20), List([], Load(), lineno=26, col_offset=22, end_lineno=26, end_col_offset=24)], Load(), lineno=26, col_offset=15, end_lineno=26, end_col_offset=25), lineno=26, col_offset=8, end_lineno=26, end_col_offset=25)], [], lineno=25, col_offset=4, end_lineno=26, end_col_offset=25), Return(Tuple([Name('placeholder_9', Load(), lineno=28, col_offset=12, end_lineno=28, end_col_offset=22), Name('placeholder_8', Load(), lineno=28, col_offset=24, end_lineno=28, end_col_offset=36)], Load(), lineno=28, col_offset=11, end_lineno=28, end_col_offset=37), lineno=28, col_offset=4, end_lineno=28, end_col_offset=37)], [], lineno=13, col_offset=0, end_lineno=28, end_col_offset=37), FunctionDef('placeholder_12', arguments([], [arg('placeholder_13', lineno=31, col_offset=16, end_lineno=31, end_col_offset=22)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_14', Store(), lineno=32, col_offset=4, end_lineno=32, end_col_offset=17)], Constant(0, lineno=32, col_offset=20, end_lineno=32, end_col_offset=21), lineno=32, col_offset=4, end_lineno=32, end_col_offset=21), While(Compare(Name('placeholder_13', Load(), lineno=33, col_offset=10, end_lineno=33, end_col_offset=16), [Gt()], [Constant(0, lineno=33, col_offset=19, end_lineno=33, end_col_offset=20)], lineno=33, col_offset=10, end_lineno=33, end_col_offset=20), [AugAssign(Name('placeholder_14', Store(), lineno=34, col_offset=8, end_lineno=34, end_col_offset=21), Mult(), Constant(10, lineno=34, col_offset=25, end_lineno=34, end_col_offset=27), lineno=34, col_offset=8, end_lineno=34, end_col_offset=27), AugAssign(Name('placeholder_14', Store(), lineno=35, col_offset=8, end_lineno=35, end_col_offset=21), Add(), BinOp(Name('placeholder_13', Load(), lineno=35, col_offset=26, end_lineno=35, end_col_offset=32), Mod(), Constant(10, lineno=35, col_offset=35, end_lineno=35, end_col_offset=37), lineno=35, col_offset=26, end_lineno=35, end_col_offset=37), lineno=35, col_offset=8, end_lineno=35, end_col_offset=38), AugAssign(Name('placeholder_13', Store(), lineno=36, col_offset=8, end_lineno=36, end_col_offset=14), FloorDiv(), Constant(10, lineno=36, col_offset=19, end_lineno=36, end_col_offset=21), lineno=36, col_offset=8, end_lineno=36, end_col_offset=21)], [], lineno=33, col_offset=4, end_lineno=36, end_col_offset=21), Return(Name('placeholder_14', Load(), lineno=37, col_offset=11, end_lineno=37, end_col_offset=24), lineno=37, col_offset=4, end_lineno=37, end_col_offset=24)], [], lineno=31, col_offset=0, end_lineno=37, end_col_offset=24), FunctionDef('placeholder_15', arguments([], [arg('placeholder_13', lineno=40, col_offset=15, end_lineno=40, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Call(Name('int', Load(), lineno=41, col_offset=11, end_lineno=41, end_col_offset=14), [Call(Name('floor', Load(), lineno=41, col_offset=15, end_lineno=41, end_col_offset=20), [BinOp(Call(Name('log10', Load(), lineno=41, col_offset=21, end_lineno=41, end_col_offset=26), [Name('placeholder_13', Load(), lineno=41, col_offset=27, end_lineno=41, end_col_offset=33)], [], lineno=41, col_offset=21, end_lineno=41, end_col_offset=34), Add(), Constant(1, lineno=41, col_offset=37, end_lineno=41, end_col_offset=38), lineno=41, col_offset=21, end_lineno=41, end_col_offset=38)], [], lineno=41, col_offset=15, end_lineno=41, end_col_offset=39)], [], lineno=41, col_offset=11, end_lineno=41, end_col_offset=40), lineno=41, col_offset=4, end_lineno=41, end_col_offset=40)], [], lineno=40, col_offset=0, end_lineno=41, end_col_offset=40), FunctionDef('placeholder_16', arguments([], [arg('placeholder_2', lineno=44, col_offset=16, end_lineno=44, end_col_offset=26), arg('placeholder_1', lineno=44, col_offset=28, end_lineno=44, end_col_offset=38), arg('placeholder_7', lineno=44, col_offset=40, end_lineno=44, end_col_offset=47)], kwonlyargs=[], kw_defaults=[], defaults=[Constant(False, lineno=44, col_offset=48, end_lineno=44, end_col_offset=53)]), [If(Compare(Name('placeholder_2', Load(), lineno=51, col_offset=7, end_lineno=51, end_col_offset=17), [Lt()], [Name('placeholder_1', Load(), lineno=51, col_offset=20, end_lineno=51, end_col_offset=30)], lineno=51, col_offset=7, end_lineno=51, end_col_offset=30), [Raise(Call(Name('ValueError', Load(), lineno=52, col_offset=14, end_lineno=52, end_col_offset=24), [Constant('min must be <= max', lineno=52, col_offset=25, end_lineno=52, end_col_offset=45)], [], lineno=52, col_offset=14, end_lineno=52, end_col_offset=46), lineno=52, col_offset=8, end_lineno=52, end_col_offset=46)], [], lineno=51, col_offset=4, end_lineno=52, end_col_offset=46), Assign([Name('placeholder_17', Store(), lineno=54, col_offset=4, end_lineno=54, end_col_offset=11)], BinOp(Name('placeholder_1', Load(), lineno=54, col_offset=14, end_lineno=54, end_col_offset=24), Pow(), Constant(2, lineno=54, col_offset=28, end_lineno=54, end_col_offset=29), lineno=54, col_offset=14, end_lineno=54, end_col_offset=29), lineno=54, col_offset=4, end_lineno=54, end_col_offset=29), Assign([Name('placeholder_18', Store(), lineno=55, col_offset=4, end_lineno=55, end_col_offset=11)], BinOp(Name('placeholder_2', Load(), lineno=55, col_offset=14, end_lineno=55, end_col_offset=24), Pow(), Constant(2, lineno=55, col_offset=28, end_lineno=55, end_col_offset=29), lineno=55, col_offset=14, end_lineno=55, end_col_offset=29), lineno=55, col_offset=4, end_lineno=55, end_col_offset=29), FunctionDef('placeholder_19', arguments([], [arg('placeholder_20', lineno=57, col_offset=34, end_lineno=57, end_col_offset=45), arg('placeholder_7', lineno=57, col_offset=47, end_lineno=57, end_col_offset=54)], kwonlyargs=[], kw_defaults=[], defaults=[Name('placeholder_7', Load(), lineno=57, col_offset=55, end_lineno=57, end_col_offset=62)]), [Assign([Name('placeholder_21', Store(), lineno=63, col_offset=8, end_lineno=63, end_col_offset=15)], Compare(BinOp(Name('placeholder_20', Load(), lineno=63, col_offset=19, end_lineno=63, end_col_offset=30), Mod(), Constant(2, lineno=63, col_offset=33, end_lineno=63, end_col_offset=34), lineno=63, col_offset=19, end_lineno=63, end_col_offset=34), [Eq()], [Constant(0, lineno=63, col_offset=38, end_lineno=63, end_col_offset=39)], lineno=63, col_offset=19, end_lineno=63, end_col_offset=39), lineno=63, col_offset=8, end_lineno=63, end_col_offset=40), Assign([Name('placeholder_22', Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=21)], Call(Name('max', Load(), lineno=65, col_offset=24, end_lineno=65, end_col_offset=27), [BinOp(Constant(10, lineno=65, col_offset=28, end_lineno=65, end_col_offset=30), Pow(), BinOp(Call(Name('int', Load(), lineno=65, col_offset=35, end_lineno=65, end_col_offset=38), [Call(Name('ceil', Load(), lineno=65, col_offset=39, end_lineno=65, end_col_offset=43), [BinOp(Name('placeholder_20', Load(), lineno=65, col_offset=44, end_lineno=65, end_col_offset=55), Div(), Constant(2, lineno=65, col_offset=58, end_lineno=65, end_col_offset=59), lineno=65, col_offset=44, end_lineno=65, end_col_offset=59)], [], lineno=65, col_offset=39, end_lineno=65, end_col_offset=60)], [], lineno=65, col_offset=35, end_lineno=65, end_col_offset=61), Sub(), Constant(1, lineno=65, col_offset=64, end_lineno=65, end_col_offset=65), lineno=65, col_offset=35, end_lineno=65, end_col_offset=65), lineno=65, col_offset=28, end_lineno=65, end_col_offset=66), BinOp(Name('placeholder_17', Load(), lineno=66, col_offset=28, end_lineno=66, end_col_offset=35), FloorDiv(), BinOp(Constant(10, lineno=66, col_offset=40, end_lineno=66, end_col_offset=42), Pow(), BinOp(Name('placeholder_20', Load(), lineno=66, col_offset=47, end_lineno=66, end_col_offset=58), FloorDiv(), Constant(2, lineno=66, col_offset=62, end_lineno=66, end_col_offset=63), lineno=66, col_offset=47, end_lineno=66, end_col_offset=63), lineno=66, col_offset=40, end_lineno=66, end_col_offset=64), lineno=66, col_offset=28, end_lineno=66, end_col_offset=65)], [], lineno=65, col_offset=24, end_lineno=66, end_col_offset=66), lineno=65, col_offset=8, end_lineno=66, end_col_offset=66), Assign([Name('placeholder_23', Store(), lineno=67, col_offset=8, end_lineno=67, end_col_offset=21)], Call(Name('min', Load(), lineno=67, col_offset=24, end_lineno=67, end_col_offset=27), [BinOp(BinOp(Constant(10, lineno=67, col_offset=29, end_lineno=67, end_col_offset=31), Pow(), Call(Name('int', Load(), lineno=67, col_offset=35, end_lineno=67, end_col_offset=38), [Call(Name('ceil', Load(), lineno=67, col_offset=39, end_lineno=67, end_col_offset=43), [BinOp(Name('placeholder_20', Load(), lineno=67, col_offset=44, end_lineno=67, end_col_offset=55), Div(), Constant(2, lineno=67, col_offset=58, end_lineno=67, end_col_offset=59), lineno=67, col_offset=44, end_lineno=67, end_col_offset=59)], [], lineno=67, col_offset=39, end_lineno=67, end_col_offset=60)], [], lineno=67, col_offset=35, end_lineno=67, end_col_offset=61), lineno=67, col_offset=29, end_lineno=67, end_col_offset=61), Sub(), Constant(1, lineno=67, col_offset=65, end_lineno=67, end_col_offset=66), lineno=67, col_offset=28, end_lineno=67, end_col_offset=66), BinOp(Name('placeholder_18', Load(), lineno=68, col_offset=28, end_lineno=68, end_col_offset=35), FloorDiv(), BinOp(Constant(10, lineno=68, col_offset=40, end_lineno=68, end_col_offset=42), Pow(), BinOp(Name('placeholder_20', Load(), lineno=68, col_offset=47, end_lineno=68, end_col_offset=58), FloorDiv(), Constant(2, lineno=68, col_offset=62, end_lineno=68, end_col_offset=63), lineno=68, col_offset=47, end_lineno=68, end_col_offset=63), lineno=68, col_offset=40, end_lineno=68, end_col_offset=64), lineno=68, col_offset=28, end_lineno=68, end_col_offset=65)], [], lineno=67, col_offset=24, end_lineno=68, end_col_offset=66), lineno=67, col_offset=8, end_lineno=68, end_col_offset=66), Assign([Name('placeholder_24', Store(), lineno=70, col_offset=8, end_lineno=70, end_col_offset=25)], IfExp(UnaryOp(Not(), Name('placeholder_7', Load(), lineno=70, col_offset=49, end_lineno=70, end_col_offset=56), lineno=70, col_offset=45, end_lineno=70, end_col_offset=56), Name('placeholder_22', Load(), lineno=70, col_offset=28, end_lineno=70, end_col_offset=41), Name('placeholder_23', Load(), lineno=70, col_offset=62, end_lineno=70, end_col_offset=75), lineno=70, col_offset=28, end_lineno=70, end_col_offset=75), lineno=70, col_offset=8, end_lineno=70, end_col_offset=75), FunctionDef('placeholder_25', arguments([], [arg('placeholder_26', lineno=72, col_offset=28, end_lineno=72, end_col_offset=37), arg('placeholder_21', lineno=72, col_offset=39, end_lineno=72, end_col_offset=46)], kwonlyargs=[], kw_defaults=[], defaults=[Constant(False, lineno=72, col_offset=47, end_lineno=72, end_col_offset=52)]), [Assign([Name('placeholder_27', Store(), lineno=73, col_offset=12, end_lineno=73, end_col_offset=22)], IfExp(Name('placeholder_21', Load(), lineno=74, col_offset=29, end_lineno=74, end_col_offset=36), Call(Name('placeholder_12', Load(), lineno=73, col_offset=26, end_lineno=73, end_col_offset=37), [Name('placeholder_26', Load(), lineno=73, col_offset=38, end_lineno=73, end_col_offset=47)], [], lineno=73, col_offset=26, end_lineno=73, end_col_offset=48), Call(Name('placeholder_12', Load(), lineno=75, col_offset=31, end_lineno=75, end_col_offset=42), [BinOp(Name('placeholder_26', Load(), lineno=75, col_offset=43, end_lineno=75, end_col_offset=52), FloorDiv(), Constant(10, lineno=75, col_offset=56, end_lineno=75, end_col_offset=58), lineno=75, col_offset=43, end_lineno=75, end_col_offset=58)], [], lineno=75, col_offset=31, end_lineno=75, end_col_offset=59), lineno=73, col_offset=26, end_lineno=75, end_col_offset=59), lineno=73, col_offset=12, end_lineno=75, end_col_offset=60), Return(BinOp(BinOp(Name('placeholder_26', Load(), lineno=76, col_offset=20, end_lineno=76, end_col_offset=29), Mult(), BinOp(Constant(10, lineno=76, col_offset=33, end_lineno=76, end_col_offset=35), Pow(), BinOp(Name('placeholder_20', Load(), lineno=76, col_offset=40, end_lineno=76, end_col_offset=51), FloorDiv(), Constant(2, lineno=76, col_offset=55, end_lineno=76, end_col_offset=56), lineno=76, col_offset=40, end_lineno=76, end_col_offset=56), lineno=76, col_offset=33, end_lineno=76, end_col_offset=57), lineno=76, col_offset=20, end_lineno=76, end_col_offset=58), Add(), Name('placeholder_27', Load(), lineno=76, col_offset=62, end_lineno=76, end_col_offset=72), lineno=76, col_offset=19, end_lineno=76, end_col_offset=72), lineno=76, col_offset=12, end_lineno=76, end_col_offset=72)], [], lineno=72, col_offset=8, end_lineno=76, end_col_offset=72), If(UnaryOp(Not(), Name('placeholder_7', Load(), lineno=78, col_offset=15, end_lineno=78, end_col_offset=22), lineno=78, col_offset=11, end_lineno=78, end_col_offset=22), [While(Compare(Name('placeholder_24', Load(), lineno=79, col_offset=18, end_lineno=79, end_col_offset=35), [LtE()], [Name('placeholder_23', Load(), lineno=79, col_offset=39, end_lineno=79, end_col_offset=52)], lineno=79, col_offset=18, end_lineno=79, end_col_offset=52), [Assign([Name('placeholder_9', Store(), lineno=80, col_offset=16, end_lineno=80, end_col_offset=26)], Call(Name('placeholder_25', Load(), lineno=80, col_offset=29, end_lineno=80, end_col_offset=44), [Name('placeholder_24', Load(), lineno=80, col_offset=45, end_lineno=80, end_col_offset=62), Name('placeholder_21', Load(), lineno=80, col_offset=64, end_lineno=80, end_col_offset=71)], [], lineno=80, col_offset=29, end_lineno=80, end_col_offset=72), lineno=80, col_offset=16, end_lineno=80, end_col_offset=72), If(Compare(Name('placeholder_17', Load(), lineno=81, col_offset=19, end_lineno=81, end_col_offset=26), [LtE(), LtE()], [Name('placeholder_9', Load(), lineno=81, col_offset=30, end_lineno=81, end_col_offset=40), Name('placeholder_18', Load(), lineno=81, col_offset=44, end_lineno=81, end_col_offset=51)], lineno=81, col_offset=19, end_lineno=81, end_col_offset=51), [Expr(Yield(Name('palindrome', Load(), lineno=82, col_offset=26, end_lineno=82, end_col_offset=36), lineno=82, col_offset=20, end_lineno=82, end_col_offset=36), lineno=82, col_offset=20, end_lineno=82, end_col_offset=36)], [If(Compare(Name('placeholder_9', Load(), lineno=83, col_offset=21, end_lineno=83, end_col_offset=31), [Gt()], [Name('placeholder_18', Load(), lineno=83, col_offset=34, end_lineno=83, end_col_offset=41)], lineno=83, col_offset=21, end_lineno=83, end_col_offset=41), [Break(lineno=87, col_offset=20, end_lineno=87, end_col_offset=25)], [], lineno=83, col_offset=16, end_lineno=87, end_col_offset=25)], lineno=81, col_offset=16, end_lineno=87, end_col_offset=25), AugAssign(Name('placeholder_24', Store(), lineno=88, col_offset=16, end_lineno=88, end_col_offset=33), Add(), Constant(1, lineno=88, col_offset=37, end_lineno=88, end_col_offset=38), lineno=88, col_offset=16, end_lineno=88, end_col_offset=38)], [], lineno=79, col_offset=12, end_lineno=88, end_col_offset=38)], [While(Compare(Name('placeholder_24', Load(), lineno=90, col_offset=18, end_lineno=90, end_col_offset=35), [GtE()], [Name('placeholder_22', Load(), lineno=90, col_offset=39, end_lineno=90, end_col_offset=52)], lineno=90, col_offset=18, end_lineno=90, end_col_offset=52), [Assign([Name('placeholder_9', Store(), lineno=91, col_offset=16, end_lineno=91, end_col_offset=26)], Call(Name('placeholder_25', Load(), lineno=91, col_offset=29, end_lineno=91, end_col_offset=44), [Name('placeholder_24', Load(), lineno=91, col_offset=45, end_lineno=91, end_col_offset=62), Name('placeholder_21', Load(), lineno=91, col_offset=64, end_lineno=91, end_col_offset=71)], [], lineno=91, col_offset=29, end_lineno=91, end_col_offset=72), lineno=91, col_offset=16, end_lineno=91, end_col_offset=72), If(Compare(Name('placeholder_17', Load(), lineno=92, col_offset=19, end_lineno=92, end_col_offset=26), [LtE(), LtE()], [Name('placeholder_9', Load(), lineno=92, col_offset=30, end_lineno=92, end_col_offset=40), Name('placeholder_18', Load(), lineno=92, col_offset=44, end_lineno=92, end_col_offset=51)], lineno=92, col_offset=19, end_lineno=92, end_col_offset=51), [Expr(Yield(Name('palindrome', Load(), lineno=93, col_offset=26, end_lineno=93, end_col_offset=36), lineno=93, col_offset=20, end_lineno=93, end_col_offset=36), lineno=93, col_offset=20, end_lineno=93, end_col_offset=36)], [If(Compare(Name('placeholder_9', Load(), lineno=94, col_offset=21, end_lineno=94, end_col_offset=31), [Lt()], [Name('placeholder_17', Load(), lineno=94, col_offset=34, end_lineno=94, end_col_offset=41)], lineno=94, col_offset=21, end_lineno=94, end_col_offset=41), [Break(lineno=98, col_offset=20, end_lineno=98, end_col_offset=25)], [], lineno=94, col_offset=16, end_lineno=98, end_col_offset=25)], lineno=92, col_offset=16, end_lineno=98, end_col_offset=25), AugAssign(Name('placeholder_24', Store(), lineno=99, col_offset=16, end_lineno=99, end_col_offset=33), Sub(), Constant(1, lineno=99, col_offset=37, end_lineno=99, end_col_offset=38), lineno=99, col_offset=16, end_lineno=99, end_col_offset=38)], [], lineno=90, col_offset=12, end_lineno=99, end_col_offset=38)], lineno=78, col_offset=8, end_lineno=99, end_col_offset=38)], [], lineno=57, col_offset=4, end_lineno=99, end_col_offset=38), Assign([Name('placeholder_28', Store(), lineno=101, col_offset=4, end_lineno=101, end_col_offset=10)], Call(Name('placeholder_15', Load(), lineno=101, col_offset=13, end_lineno=101, end_col_offset=23), [Name('placeholder_17', Load(), lineno=101, col_offset=24, end_lineno=101, end_col_offset=31)], [], lineno=101, col_offset=13, end_lineno=101, end_col_offset=32), lineno=101, col_offset=4, end_lineno=101, end_col_offset=32), Assign([Name('placeholder_29', Store(), lineno=102, col_offset=4, end_lineno=102, end_col_offset=10)], Call(Name('placeholder_15', Load(), lineno=102, col_offset=13, end_lineno=102, end_col_offset=23), [Name('placeholder_18', Load(), lineno=102, col_offset=24, end_lineno=102, end_col_offset=31)], [], lineno=102, col_offset=13, end_lineno=102, end_col_offset=32), lineno=102, col_offset=4, end_lineno=102, end_col_offset=32), Assign([Name('placeholder_30', Store(), lineno=104, col_offset=4, end_lineno=104, end_col_offset=11)], IfExp(UnaryOp(Not(), Name('placeholder_7', Load(), lineno=105, col_offset=22, end_lineno=105, end_col_offset=29), lineno=105, col_offset=18, end_lineno=105, end_col_offset=29), Call(Name('range', Load(), lineno=104, col_offset=15, end_lineno=104, end_col_offset=20), [Name('placeholder_28', Load(), lineno=104, col_offset=21, end_lineno=104, end_col_offset=27), BinOp(Name('placeholder_29', Load(), lineno=104, col_offset=29, end_lineno=104, end_col_offset=35), Add(), Constant(1, lineno=104, col_offset=38, end_lineno=104, end_col_offset=39), lineno=104, col_offset=29, end_lineno=104, end_col_offset=39)], [], lineno=104, col_offset=15, end_lineno=104, end_col_offset=40), Call(Name('range', Load(), lineno=106, col_offset=20, end_lineno=106, end_col_offset=25), [Name('placeholder_29', Load(), lineno=106, col_offset=26, end_lineno=106, end_col_offset=32), BinOp(Name('placeholder_28', Load(), lineno=106, col_offset=34, end_lineno=106, end_col_offset=40), Sub(), Constant(1, lineno=106, col_offset=43, end_lineno=106, end_col_offset=44), lineno=106, col_offset=34, end_lineno=106, end_col_offset=44), UnaryOp(USub(), Constant(1, lineno=106, col_offset=47, end_lineno=106, end_col_offset=48), lineno=106, col_offset=46, end_lineno=106, end_col_offset=48)], [], lineno=106, col_offset=20, end_lineno=106, end_col_offset=49), lineno=104, col_offset=15, end_lineno=106, end_col_offset=49), lineno=104, col_offset=4, end_lineno=106, end_col_offset=50), Return(Call(Name('chain', Load(), lineno=108, col_offset=11, end_lineno=108, end_col_offset=16), [Starred(Call(Name('map', Load(), lineno=108, col_offset=18, end_lineno=108, end_col_offset=21), [Name('placeholder_19', Load(), lineno=108, col_offset=22, end_lineno=108, end_col_offset=47), Name('placeholder_30', Load(), lineno=108, col_offset=49, end_lineno=108, end_col_offset=56)], [], lineno=108, col_offset=18, end_lineno=108, end_col_offset=57), Load(), lineno=108, col_offset=17, end_lineno=108, end_col_offset=57)], [], lineno=108, col_offset=11, end_lineno=108, end_col_offset=58), lineno=108, col_offset=4, end_lineno=108, end_col_offset=58)], [], lineno=44, col_offset=0, end_lineno=108, end_col_offset=58)], []) \ No newline at end of file +Module([ImportFrom('itertools', [alias('chain', lineno=1, col_offset=22, end_lineno=1, end_col_offset=27)], 0, lineno=1, col_offset=0, end_lineno=1, end_col_offset=27), ImportFrom('math', [alias('log10', lineno=2, col_offset=17, end_lineno=2, end_col_offset=22), alias('floor', lineno=2, col_offset=24, end_lineno=2, end_col_offset=29), alias('ceil', lineno=2, col_offset=31, end_lineno=2, end_col_offset=35)], 0, lineno=2, col_offset=0, end_lineno=2, end_col_offset=35), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=5, col_offset=12, end_lineno=5, end_col_offset=22), arg('placeholder_2', lineno=5, col_offset=24, end_lineno=5, end_col_offset=34)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Call(Name('get_extreme_palindrome_with_factors', Load(), lineno=6, col_offset=11, end_lineno=6, end_col_offset=46), [Name('placeholder_2', Load(), lineno=6, col_offset=47, end_lineno=6, end_col_offset=57), Name('placeholder_1', Load(), lineno=6, col_offset=59, end_lineno=6, end_col_offset=69), Constant('largest', lineno=6, col_offset=71, end_lineno=6, end_col_offset=80)], [], lineno=6, col_offset=11, end_lineno=6, end_col_offset=81), lineno=6, col_offset=4, end_lineno=6, end_col_offset=81)], [], lineno=5, col_offset=0, end_lineno=6, end_col_offset=81), FunctionDef('placeholder_3', arguments([], [arg('placeholder_2', lineno=9, col_offset=13, end_lineno=9, end_col_offset=23), arg('placeholder_1', lineno=9, col_offset=25, end_lineno=9, end_col_offset=35)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Call(Name('get_extreme_palindrome_with_factors', Load(), lineno=10, col_offset=11, end_lineno=10, end_col_offset=46), [Name('placeholder_2', Load(), lineno=10, col_offset=47, end_lineno=10, end_col_offset=57), Name('placeholder_1', Load(), lineno=10, col_offset=59, end_lineno=10, end_col_offset=69), Constant('smallest', lineno=10, col_offset=71, end_lineno=10, end_col_offset=81)], [], lineno=10, col_offset=11, end_lineno=10, end_col_offset=82), lineno=10, col_offset=4, end_lineno=10, end_col_offset=82)], [], lineno=9, col_offset=0, end_lineno=10, end_col_offset=82), FunctionDef('placeholder_4', arguments([], [arg('placeholder_2', lineno=13, col_offset=40, end_lineno=13, end_col_offset=50), arg('placeholder_1', lineno=13, col_offset=52, end_lineno=13, end_col_offset=62), arg('placeholder_5', lineno=13, col_offset=64, end_lineno=13, end_col_offset=71)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_6', Store(), lineno=14, col_offset=4, end_lineno=14, end_col_offset=21)], Call(Name('palindromes', Load(), lineno=14, col_offset=24, end_lineno=14, end_col_offset=35), [Name('placeholder_2', Load(), lineno=14, col_offset=36, end_lineno=14, end_col_offset=46), Name('placeholder_1', Load(), lineno=14, col_offset=48, end_lineno=14, end_col_offset=58)], [keyword('placeholder_7', Compare(Name('placeholder_5', Load(), lineno=14, col_offset=69, end_lineno=14, end_col_offset=76), [Eq()], [Constant('largest', lineno=14, col_offset=80, end_lineno=14, end_col_offset=89)], lineno=14, col_offset=69, end_lineno=14, end_col_offset=89), lineno=14, col_offset=60, end_lineno=14, end_col_offset=90)], lineno=14, col_offset=24, end_lineno=14, end_col_offset=91), lineno=14, col_offset=4, end_lineno=14, end_col_offset=91), Assign([Name('placeholder_8', Store(), lineno=15, col_offset=4, end_lineno=15, end_col_offset=16)], Constant(None, lineno=15, col_offset=19, end_lineno=15, end_col_offset=23), lineno=15, col_offset=4, end_lineno=15, end_col_offset=23), For(Name('placeholder_9', Store(), lineno=16, col_offset=8, end_lineno=16, end_col_offset=18), Name('placeholder_6', Load(), lineno=16, col_offset=22, end_lineno=16, end_col_offset=39), [Assign([Name('placeholder_8', Store(), lineno=17, col_offset=8, end_lineno=17, end_col_offset=20)], GeneratorExp(Tuple([Name('placeholder_10', Load(), lineno=17, col_offset=25, end_lineno=17, end_col_offset=31), BinOp(Name('placeholder_9', Load(), lineno=17, col_offset=33, end_lineno=17, end_col_offset=43), FloorDiv(), Name('placeholder_10', Load(), lineno=17, col_offset=47, end_lineno=17, end_col_offset=53), lineno=17, col_offset=33, end_lineno=17, end_col_offset=53)], Load(), lineno=17, col_offset=24, end_lineno=17, end_col_offset=54), [comprehension(Name('placeholder_10', Store(), lineno=18, col_offset=28, end_lineno=18, end_col_offset=34), Call(Name('range', Load(), lineno=18, col_offset=38, end_lineno=18, end_col_offset=43), [Name('placeholder_1', Load(), lineno=18, col_offset=44, end_lineno=18, end_col_offset=54), BinOp(Name('placeholder_2', Load(), lineno=18, col_offset=56, end_lineno=18, end_col_offset=66), Add(), Constant(1, lineno=18, col_offset=69, end_lineno=18, end_col_offset=70), lineno=18, col_offset=56, end_lineno=18, end_col_offset=70)], [], lineno=18, col_offset=38, end_lineno=18, end_col_offset=71), [Compare(BinOp(Name('placeholder_9', Load(), lineno=19, col_offset=27, end_lineno=19, end_col_offset=37), Mod(), Name('placeholder_10', Load(), lineno=19, col_offset=40, end_lineno=19, end_col_offset=46), lineno=19, col_offset=27, end_lineno=19, end_col_offset=46), [Eq()], [Constant(0, lineno=19, col_offset=50, end_lineno=19, end_col_offset=51)], lineno=19, col_offset=27, end_lineno=19, end_col_offset=51)], 0)], lineno=17, col_offset=23, end_lineno=19, end_col_offset=52), lineno=17, col_offset=8, end_lineno=19, end_col_offset=52), Assign([Name('placeholder_8', Store(), lineno=20, col_offset=8, end_lineno=20, end_col_offset=20)], Call(Name('list', Load(), lineno=20, col_offset=23, end_lineno=20, end_col_offset=27), [GeneratorExp(Name('placeholder_11', Load(), lineno=20, col_offset=28, end_lineno=20, end_col_offset=32), [comprehension(Name('placeholder_11', Store(), lineno=20, col_offset=37, end_lineno=20, end_col_offset=41), Name('placeholder_8', Load(), lineno=20, col_offset=45, end_lineno=20, end_col_offset=57), [Compare(Name('placeholder_1', Load(), lineno=21, col_offset=31, end_lineno=21, end_col_offset=41), [LtE(), LtE()], [Subscript(Name('placeholder_11', Load(), lineno=21, col_offset=45, end_lineno=21, end_col_offset=49), Constant(1, lineno=21, col_offset=50, end_lineno=21, end_col_offset=51), Load(), lineno=21, col_offset=45, end_lineno=21, end_col_offset=52), Name('placeholder_2', Load(), lineno=21, col_offset=56, end_lineno=21, end_col_offset=66)], lineno=21, col_offset=31, end_lineno=21, end_col_offset=66)], 0)], lineno=20, col_offset=27, end_lineno=21, end_col_offset=67)], [], lineno=20, col_offset=23, end_lineno=21, end_col_offset=67), lineno=20, col_offset=8, end_lineno=21, end_col_offset=67), If(Compare(Call(Name('len', Load(), lineno=22, col_offset=11, end_lineno=22, end_col_offset=14), [Name('placeholder_8', Load(), lineno=22, col_offset=15, end_lineno=22, end_col_offset=27)], [], lineno=22, col_offset=11, end_lineno=22, end_col_offset=28), [Gt()], [Constant(0, lineno=22, col_offset=31, end_lineno=22, end_col_offset=32)], lineno=22, col_offset=11, end_lineno=22, end_col_offset=32), [Break(lineno=23, col_offset=12, end_lineno=23, end_col_offset=17)], [], lineno=22, col_offset=8, end_lineno=23, end_col_offset=17)], [], lineno=16, col_offset=4, end_lineno=23, end_col_offset=17), If(UnaryOp(Not(), Name('placeholder_8', Load(), lineno=25, col_offset=11, end_lineno=25, end_col_offset=23), lineno=25, col_offset=7, end_lineno=25, end_col_offset=23), [Return(Tuple([Constant(None, lineno=26, col_offset=16, end_lineno=26, end_col_offset=20), List([], Load(), lineno=26, col_offset=22, end_lineno=26, end_col_offset=24)], Load(), lineno=26, col_offset=15, end_lineno=26, end_col_offset=25), lineno=26, col_offset=8, end_lineno=26, end_col_offset=25)], [], lineno=25, col_offset=4, end_lineno=26, end_col_offset=25), Return(Tuple([Name('placeholder_9', Load(), lineno=28, col_offset=12, end_lineno=28, end_col_offset=22), Name('placeholder_8', Load(), lineno=28, col_offset=24, end_lineno=28, end_col_offset=36)], Load(), lineno=28, col_offset=11, end_lineno=28, end_col_offset=37), lineno=28, col_offset=4, end_lineno=28, end_col_offset=37)], [], lineno=13, col_offset=0, end_lineno=28, end_col_offset=37), FunctionDef('placeholder_12', arguments([], [arg('placeholder_13', lineno=31, col_offset=16, end_lineno=31, end_col_offset=22)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_14', Store(), lineno=32, col_offset=4, end_lineno=32, end_col_offset=17)], Constant(0, lineno=32, col_offset=20, end_lineno=32, end_col_offset=21), lineno=32, col_offset=4, end_lineno=32, end_col_offset=21), While(Compare(Name('placeholder_13', Load(), lineno=33, col_offset=10, end_lineno=33, end_col_offset=16), [Gt()], [Constant(0, lineno=33, col_offset=19, end_lineno=33, end_col_offset=20)], lineno=33, col_offset=10, end_lineno=33, end_col_offset=20), [AugAssign(Name('placeholder_14', Store(), lineno=34, col_offset=8, end_lineno=34, end_col_offset=21), Mult(), Constant(10, lineno=34, col_offset=25, end_lineno=34, end_col_offset=27), lineno=34, col_offset=8, end_lineno=34, end_col_offset=27), AugAssign(Name('placeholder_14', Store(), lineno=35, col_offset=8, end_lineno=35, end_col_offset=21), Add(), BinOp(Name('placeholder_13', Load(), lineno=35, col_offset=26, end_lineno=35, end_col_offset=32), Mod(), Constant(10, lineno=35, col_offset=35, end_lineno=35, end_col_offset=37), lineno=35, col_offset=26, end_lineno=35, end_col_offset=37), lineno=35, col_offset=8, end_lineno=35, end_col_offset=38), AugAssign(Name('placeholder_13', Store(), lineno=36, col_offset=8, end_lineno=36, end_col_offset=14), FloorDiv(), Constant(10, lineno=36, col_offset=19, end_lineno=36, end_col_offset=21), lineno=36, col_offset=8, end_lineno=36, end_col_offset=21)], [], lineno=33, col_offset=4, end_lineno=36, end_col_offset=21), Return(Name('placeholder_14', Load(), lineno=37, col_offset=11, end_lineno=37, end_col_offset=24), lineno=37, col_offset=4, end_lineno=37, end_col_offset=24)], [], lineno=31, col_offset=0, end_lineno=37, end_col_offset=24), FunctionDef('placeholder_15', arguments([], [arg('placeholder_13', lineno=40, col_offset=15, end_lineno=40, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Call(Name('int', Load(), lineno=41, col_offset=11, end_lineno=41, end_col_offset=14), [Call(Name('floor', Load(), lineno=41, col_offset=15, end_lineno=41, end_col_offset=20), [BinOp(Call(Name('log10', Load(), lineno=41, col_offset=21, end_lineno=41, end_col_offset=26), [Name('placeholder_13', Load(), lineno=41, col_offset=27, end_lineno=41, end_col_offset=33)], [], lineno=41, col_offset=21, end_lineno=41, end_col_offset=34), Add(), Constant(1, lineno=41, col_offset=37, end_lineno=41, end_col_offset=38), lineno=41, col_offset=21, end_lineno=41, end_col_offset=38)], [], lineno=41, col_offset=15, end_lineno=41, end_col_offset=39)], [], lineno=41, col_offset=11, end_lineno=41, end_col_offset=40), lineno=41, col_offset=4, end_lineno=41, end_col_offset=40)], [], lineno=40, col_offset=0, end_lineno=41, end_col_offset=40), FunctionDef('placeholder_16', arguments([], [arg('placeholder_2', lineno=44, col_offset=16, end_lineno=44, end_col_offset=26), arg('placeholder_1', lineno=44, col_offset=28, end_lineno=44, end_col_offset=38), arg('placeholder_7', lineno=44, col_offset=40, end_lineno=44, end_col_offset=47)], kwonlyargs=[], kw_defaults=[], defaults=[Constant(False, lineno=44, col_offset=48, end_lineno=44, end_col_offset=53)]), [If(Compare(Name('placeholder_2', Load(), lineno=51, col_offset=7, end_lineno=51, end_col_offset=17), [Lt()], [Name('placeholder_1', Load(), lineno=51, col_offset=20, end_lineno=51, end_col_offset=30)], lineno=51, col_offset=7, end_lineno=51, end_col_offset=30), [Raise(Call(Name('ValueError', Load(), lineno=52, col_offset=14, end_lineno=52, end_col_offset=24), [Constant('min must be <= max', lineno=52, col_offset=25, end_lineno=52, end_col_offset=45)], [], lineno=52, col_offset=14, end_lineno=52, end_col_offset=46), lineno=52, col_offset=8, end_lineno=52, end_col_offset=46)], [], lineno=51, col_offset=4, end_lineno=52, end_col_offset=46), Assign([Name('placeholder_17', Store(), lineno=54, col_offset=4, end_lineno=54, end_col_offset=11)], BinOp(Name('placeholder_1', Load(), lineno=54, col_offset=14, end_lineno=54, end_col_offset=24), Pow(), Constant(2, lineno=54, col_offset=28, end_lineno=54, end_col_offset=29), lineno=54, col_offset=14, end_lineno=54, end_col_offset=29), lineno=54, col_offset=4, end_lineno=54, end_col_offset=29), Assign([Name('placeholder_18', Store(), lineno=55, col_offset=4, end_lineno=55, end_col_offset=11)], BinOp(Name('placeholder_2', Load(), lineno=55, col_offset=14, end_lineno=55, end_col_offset=24), Pow(), Constant(2, lineno=55, col_offset=28, end_lineno=55, end_col_offset=29), lineno=55, col_offset=14, end_lineno=55, end_col_offset=29), lineno=55, col_offset=4, end_lineno=55, end_col_offset=29), FunctionDef('placeholder_19', arguments([], [arg('placeholder_20', lineno=57, col_offset=34, end_lineno=57, end_col_offset=45), arg('placeholder_7', lineno=57, col_offset=47, end_lineno=57, end_col_offset=54)], kwonlyargs=[], kw_defaults=[], defaults=[Name('placeholder_7', Load(), lineno=57, col_offset=55, end_lineno=57, end_col_offset=62)]), [Assign([Name('placeholder_21', Store(), lineno=63, col_offset=8, end_lineno=63, end_col_offset=15)], Compare(BinOp(Name('placeholder_20', Load(), lineno=63, col_offset=19, end_lineno=63, end_col_offset=30), Mod(), Constant(2, lineno=63, col_offset=33, end_lineno=63, end_col_offset=34), lineno=63, col_offset=19, end_lineno=63, end_col_offset=34), [Eq()], [Constant(0, lineno=63, col_offset=38, end_lineno=63, end_col_offset=39)], lineno=63, col_offset=19, end_lineno=63, end_col_offset=39), lineno=63, col_offset=8, end_lineno=63, end_col_offset=40), Assign([Name('placeholder_22', Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=21)], Call(Name('max', Load(), lineno=65, col_offset=24, end_lineno=65, end_col_offset=27), [BinOp(Constant(10, lineno=65, col_offset=28, end_lineno=65, end_col_offset=30), Pow(), BinOp(Call(Name('int', Load(), lineno=65, col_offset=35, end_lineno=65, end_col_offset=38), [Call(Name('ceil', Load(), lineno=65, col_offset=39, end_lineno=65, end_col_offset=43), [BinOp(Name('placeholder_20', Load(), lineno=65, col_offset=44, end_lineno=65, end_col_offset=55), Div(), Constant(2, lineno=65, col_offset=58, end_lineno=65, end_col_offset=59), lineno=65, col_offset=44, end_lineno=65, end_col_offset=59)], [], lineno=65, col_offset=39, end_lineno=65, end_col_offset=60)], [], lineno=65, col_offset=35, end_lineno=65, end_col_offset=61), Sub(), Constant(1, lineno=65, col_offset=64, end_lineno=65, end_col_offset=65), lineno=65, col_offset=35, end_lineno=65, end_col_offset=65), lineno=65, col_offset=28, end_lineno=65, end_col_offset=66), BinOp(Name('placeholder_17', Load(), lineno=66, col_offset=28, end_lineno=66, end_col_offset=35), FloorDiv(), BinOp(Constant(10, lineno=66, col_offset=40, end_lineno=66, end_col_offset=42), Pow(), BinOp(Name('placeholder_20', Load(), lineno=66, col_offset=47, end_lineno=66, end_col_offset=58), FloorDiv(), Constant(2, lineno=66, col_offset=62, end_lineno=66, end_col_offset=63), lineno=66, col_offset=47, end_lineno=66, end_col_offset=63), lineno=66, col_offset=40, end_lineno=66, end_col_offset=64), lineno=66, col_offset=28, end_lineno=66, end_col_offset=65)], [], lineno=65, col_offset=24, end_lineno=66, end_col_offset=66), lineno=65, col_offset=8, end_lineno=66, end_col_offset=66), Assign([Name('placeholder_23', Store(), lineno=67, col_offset=8, end_lineno=67, end_col_offset=21)], Call(Name('min', Load(), lineno=67, col_offset=24, end_lineno=67, end_col_offset=27), [BinOp(BinOp(Constant(10, lineno=67, col_offset=29, end_lineno=67, end_col_offset=31), Pow(), Call(Name('int', Load(), lineno=67, col_offset=35, end_lineno=67, end_col_offset=38), [Call(Name('ceil', Load(), lineno=67, col_offset=39, end_lineno=67, end_col_offset=43), [BinOp(Name('placeholder_20', Load(), lineno=67, col_offset=44, end_lineno=67, end_col_offset=55), Div(), Constant(2, lineno=67, col_offset=58, end_lineno=67, end_col_offset=59), lineno=67, col_offset=44, end_lineno=67, end_col_offset=59)], [], lineno=67, col_offset=39, end_lineno=67, end_col_offset=60)], [], lineno=67, col_offset=35, end_lineno=67, end_col_offset=61), lineno=67, col_offset=29, end_lineno=67, end_col_offset=61), Sub(), Constant(1, lineno=67, col_offset=65, end_lineno=67, end_col_offset=66), lineno=67, col_offset=28, end_lineno=67, end_col_offset=66), BinOp(Name('placeholder_18', Load(), lineno=68, col_offset=28, end_lineno=68, end_col_offset=35), FloorDiv(), BinOp(Constant(10, lineno=68, col_offset=40, end_lineno=68, end_col_offset=42), Pow(), BinOp(Name('placeholder_20', Load(), lineno=68, col_offset=47, end_lineno=68, end_col_offset=58), FloorDiv(), Constant(2, lineno=68, col_offset=62, end_lineno=68, end_col_offset=63), lineno=68, col_offset=47, end_lineno=68, end_col_offset=63), lineno=68, col_offset=40, end_lineno=68, end_col_offset=64), lineno=68, col_offset=28, end_lineno=68, end_col_offset=65)], [], lineno=67, col_offset=24, end_lineno=68, end_col_offset=66), lineno=67, col_offset=8, end_lineno=68, end_col_offset=66), Assign([Name('placeholder_24', Store(), lineno=70, col_offset=8, end_lineno=70, end_col_offset=25)], IfExp(UnaryOp(Not(), Name('placeholder_7', Load(), lineno=70, col_offset=49, end_lineno=70, end_col_offset=56), lineno=70, col_offset=45, end_lineno=70, end_col_offset=56), Name('placeholder_22', Load(), lineno=70, col_offset=28, end_lineno=70, end_col_offset=41), Name('placeholder_23', Load(), lineno=70, col_offset=62, end_lineno=70, end_col_offset=75), lineno=70, col_offset=28, end_lineno=70, end_col_offset=75), lineno=70, col_offset=8, end_lineno=70, end_col_offset=75), FunctionDef('placeholder_25', arguments([], [arg('placeholder_26', lineno=72, col_offset=28, end_lineno=72, end_col_offset=37), arg('placeholder_21', lineno=72, col_offset=39, end_lineno=72, end_col_offset=46)], kwonlyargs=[], kw_defaults=[], defaults=[Constant(False, lineno=72, col_offset=47, end_lineno=72, end_col_offset=52)]), [Assign([Name('placeholder_27', Store(), lineno=73, col_offset=12, end_lineno=73, end_col_offset=22)], IfExp(Name('placeholder_21', Load(), lineno=74, col_offset=29, end_lineno=74, end_col_offset=36), Call(Name('placeholder_12', Load(), lineno=73, col_offset=26, end_lineno=73, end_col_offset=37), [Name('placeholder_26', Load(), lineno=73, col_offset=38, end_lineno=73, end_col_offset=47)], [], lineno=73, col_offset=26, end_lineno=73, end_col_offset=48), Call(Name('placeholder_12', Load(), lineno=75, col_offset=31, end_lineno=75, end_col_offset=42), [BinOp(Name('placeholder_26', Load(), lineno=75, col_offset=43, end_lineno=75, end_col_offset=52), FloorDiv(), Constant(10, lineno=75, col_offset=56, end_lineno=75, end_col_offset=58), lineno=75, col_offset=43, end_lineno=75, end_col_offset=58)], [], lineno=75, col_offset=31, end_lineno=75, end_col_offset=59), lineno=73, col_offset=26, end_lineno=75, end_col_offset=59), lineno=73, col_offset=12, end_lineno=75, end_col_offset=60), Return(BinOp(BinOp(Name('placeholder_26', Load(), lineno=76, col_offset=20, end_lineno=76, end_col_offset=29), Mult(), BinOp(Constant(10, lineno=76, col_offset=33, end_lineno=76, end_col_offset=35), Pow(), BinOp(Name('placeholder_20', Load(), lineno=76, col_offset=40, end_lineno=76, end_col_offset=51), FloorDiv(), Constant(2, lineno=76, col_offset=55, end_lineno=76, end_col_offset=56), lineno=76, col_offset=40, end_lineno=76, end_col_offset=56), lineno=76, col_offset=33, end_lineno=76, end_col_offset=57), lineno=76, col_offset=20, end_lineno=76, end_col_offset=58), Add(), Name('placeholder_27', Load(), lineno=76, col_offset=62, end_lineno=76, end_col_offset=72), lineno=76, col_offset=19, end_lineno=76, end_col_offset=72), lineno=76, col_offset=12, end_lineno=76, end_col_offset=72)], [], lineno=72, col_offset=8, end_lineno=76, end_col_offset=72), If(UnaryOp(Not(), Name('placeholder_7', Load(), lineno=78, col_offset=15, end_lineno=78, end_col_offset=22), lineno=78, col_offset=11, end_lineno=78, end_col_offset=22), [While(Compare(Name('placeholder_24', Load(), lineno=79, col_offset=18, end_lineno=79, end_col_offset=35), [LtE()], [Name('placeholder_23', Load(), lineno=79, col_offset=39, end_lineno=79, end_col_offset=52)], lineno=79, col_offset=18, end_lineno=79, end_col_offset=52), [Assign([Name('placeholder_9', Store(), lineno=80, col_offset=16, end_lineno=80, end_col_offset=26)], Call(Name('placeholder_25', Load(), lineno=80, col_offset=29, end_lineno=80, end_col_offset=44), [Name('placeholder_24', Load(), lineno=80, col_offset=45, end_lineno=80, end_col_offset=62), Name('placeholder_21', Load(), lineno=80, col_offset=64, end_lineno=80, end_col_offset=71)], [], lineno=80, col_offset=29, end_lineno=80, end_col_offset=72), lineno=80, col_offset=16, end_lineno=80, end_col_offset=72), If(Compare(Name('placeholder_17', Load(), lineno=81, col_offset=19, end_lineno=81, end_col_offset=26), [LtE(), LtE()], [Name('placeholder_9', Load(), lineno=81, col_offset=30, end_lineno=81, end_col_offset=40), Name('placeholder_18', Load(), lineno=81, col_offset=44, end_lineno=81, end_col_offset=51)], lineno=81, col_offset=19, end_lineno=81, end_col_offset=51), [Expr(Yield(Name('placeholder_9', Load(), lineno=82, col_offset=26, end_lineno=82, end_col_offset=36), lineno=82, col_offset=20, end_lineno=82, end_col_offset=36), lineno=82, col_offset=20, end_lineno=82, end_col_offset=36)], [If(Compare(Name('placeholder_9', Load(), lineno=83, col_offset=21, end_lineno=83, end_col_offset=31), [Gt()], [Name('placeholder_18', Load(), lineno=83, col_offset=34, end_lineno=83, end_col_offset=41)], lineno=83, col_offset=21, end_lineno=83, end_col_offset=41), [Break(lineno=87, col_offset=20, end_lineno=87, end_col_offset=25)], [], lineno=83, col_offset=16, end_lineno=87, end_col_offset=25)], lineno=81, col_offset=16, end_lineno=87, end_col_offset=25), AugAssign(Name('placeholder_24', Store(), lineno=88, col_offset=16, end_lineno=88, end_col_offset=33), Add(), Constant(1, lineno=88, col_offset=37, end_lineno=88, end_col_offset=38), lineno=88, col_offset=16, end_lineno=88, end_col_offset=38)], [], lineno=79, col_offset=12, end_lineno=88, end_col_offset=38)], [While(Compare(Name('placeholder_24', Load(), lineno=90, col_offset=18, end_lineno=90, end_col_offset=35), [GtE()], [Name('placeholder_22', Load(), lineno=90, col_offset=39, end_lineno=90, end_col_offset=52)], lineno=90, col_offset=18, end_lineno=90, end_col_offset=52), [Assign([Name('placeholder_9', Store(), lineno=91, col_offset=16, end_lineno=91, end_col_offset=26)], Call(Name('placeholder_25', Load(), lineno=91, col_offset=29, end_lineno=91, end_col_offset=44), [Name('placeholder_24', Load(), lineno=91, col_offset=45, end_lineno=91, end_col_offset=62), Name('placeholder_21', Load(), lineno=91, col_offset=64, end_lineno=91, end_col_offset=71)], [], lineno=91, col_offset=29, end_lineno=91, end_col_offset=72), lineno=91, col_offset=16, end_lineno=91, end_col_offset=72), If(Compare(Name('placeholder_17', Load(), lineno=92, col_offset=19, end_lineno=92, end_col_offset=26), [LtE(), LtE()], [Name('placeholder_9', Load(), lineno=92, col_offset=30, end_lineno=92, end_col_offset=40), Name('placeholder_18', Load(), lineno=92, col_offset=44, end_lineno=92, end_col_offset=51)], lineno=92, col_offset=19, end_lineno=92, end_col_offset=51), [Expr(Yield(Name('placeholder_9', Load(), lineno=93, col_offset=26, end_lineno=93, end_col_offset=36), lineno=93, col_offset=20, end_lineno=93, end_col_offset=36), lineno=93, col_offset=20, end_lineno=93, end_col_offset=36)], [If(Compare(Name('placeholder_9', Load(), lineno=94, col_offset=21, end_lineno=94, end_col_offset=31), [Lt()], [Name('placeholder_17', Load(), lineno=94, col_offset=34, end_lineno=94, end_col_offset=41)], lineno=94, col_offset=21, end_lineno=94, end_col_offset=41), [Break(lineno=98, col_offset=20, end_lineno=98, end_col_offset=25)], [], lineno=94, col_offset=16, end_lineno=98, end_col_offset=25)], lineno=92, col_offset=16, end_lineno=98, end_col_offset=25), AugAssign(Name('placeholder_24', Store(), lineno=99, col_offset=16, end_lineno=99, end_col_offset=33), Sub(), Constant(1, lineno=99, col_offset=37, end_lineno=99, end_col_offset=38), lineno=99, col_offset=16, end_lineno=99, end_col_offset=38)], [], lineno=90, col_offset=12, end_lineno=99, end_col_offset=38)], lineno=78, col_offset=8, end_lineno=99, end_col_offset=38)], [], lineno=57, col_offset=4, end_lineno=99, end_col_offset=38), Assign([Name('placeholder_28', Store(), lineno=101, col_offset=4, end_lineno=101, end_col_offset=10)], Call(Name('placeholder_15', Load(), lineno=101, col_offset=13, end_lineno=101, end_col_offset=23), [Name('placeholder_17', Load(), lineno=101, col_offset=24, end_lineno=101, end_col_offset=31)], [], lineno=101, col_offset=13, end_lineno=101, end_col_offset=32), lineno=101, col_offset=4, end_lineno=101, end_col_offset=32), Assign([Name('placeholder_29', Store(), lineno=102, col_offset=4, end_lineno=102, end_col_offset=10)], Call(Name('placeholder_15', Load(), lineno=102, col_offset=13, end_lineno=102, end_col_offset=23), [Name('placeholder_18', Load(), lineno=102, col_offset=24, end_lineno=102, end_col_offset=31)], [], lineno=102, col_offset=13, end_lineno=102, end_col_offset=32), lineno=102, col_offset=4, end_lineno=102, end_col_offset=32), Assign([Name('placeholder_30', Store(), lineno=104, col_offset=4, end_lineno=104, end_col_offset=11)], IfExp(UnaryOp(Not(), Name('placeholder_7', Load(), lineno=105, col_offset=22, end_lineno=105, end_col_offset=29), lineno=105, col_offset=18, end_lineno=105, end_col_offset=29), Call(Name('range', Load(), lineno=104, col_offset=15, end_lineno=104, end_col_offset=20), [Name('placeholder_28', Load(), lineno=104, col_offset=21, end_lineno=104, end_col_offset=27), BinOp(Name('placeholder_29', Load(), lineno=104, col_offset=29, end_lineno=104, end_col_offset=35), Add(), Constant(1, lineno=104, col_offset=38, end_lineno=104, end_col_offset=39), lineno=104, col_offset=29, end_lineno=104, end_col_offset=39)], [], lineno=104, col_offset=15, end_lineno=104, end_col_offset=40), Call(Name('range', Load(), lineno=106, col_offset=20, end_lineno=106, end_col_offset=25), [Name('placeholder_29', Load(), lineno=106, col_offset=26, end_lineno=106, end_col_offset=32), BinOp(Name('placeholder_28', Load(), lineno=106, col_offset=34, end_lineno=106, end_col_offset=40), Sub(), Constant(1, lineno=106, col_offset=43, end_lineno=106, end_col_offset=44), lineno=106, col_offset=34, end_lineno=106, end_col_offset=44), UnaryOp(USub(), Constant(1, lineno=106, col_offset=47, end_lineno=106, end_col_offset=48), lineno=106, col_offset=46, end_lineno=106, end_col_offset=48)], [], lineno=106, col_offset=20, end_lineno=106, end_col_offset=49), lineno=104, col_offset=15, end_lineno=106, end_col_offset=49), lineno=104, col_offset=4, end_lineno=106, end_col_offset=50), Return(Call(Name('chain', Load(), lineno=108, col_offset=11, end_lineno=108, end_col_offset=16), [Starred(Call(Name('map', Load(), lineno=108, col_offset=18, end_lineno=108, end_col_offset=21), [Name('placeholder_19', Load(), lineno=108, col_offset=22, end_lineno=108, end_col_offset=47), Name('placeholder_30', Load(), lineno=108, col_offset=49, end_lineno=108, end_col_offset=56)], [], lineno=108, col_offset=18, end_lineno=108, end_col_offset=57), Load(), lineno=108, col_offset=17, end_lineno=108, end_col_offset=57)], [], lineno=108, col_offset=11, end_lineno=108, end_col_offset=58), lineno=108, col_offset=4, end_lineno=108, end_col_offset=58)], [], lineno=44, col_offset=0, end_lineno=108, end_col_offset=58)], []) \ No newline at end of file diff --git a/test/practice-perfect-numbers/representation.txt b/test/practice-perfect-numbers/representation.txt index f65daf1..5356284 100644 --- a/test/practice-perfect-numbers/representation.txt +++ b/test/practice-perfect-numbers/representation.txt @@ -1 +1 @@ -Module([Import([alias('math', lineno=1, col_offset=7, end_lineno=1, end_col_offset=11)], lineno=1, col_offset=0, end_lineno=1, end_col_offset=11), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=3, col_offset=22, end_lineno=3, end_col_offset=28)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_2', Store(), lineno=10, col_offset=8, end_lineno=10, end_col_offset=13), Call(Name('range', Load(), lineno=10, col_offset=17, end_lineno=10, end_col_offset=22), [Constant(2, lineno=10, col_offset=23, end_lineno=10, end_col_offset=24), BinOp(Call(Name('int', Load(), lineno=10, col_offset=26, end_lineno=10, end_col_offset=29), [Call(Attribute(Name('math', Load(), lineno=10, col_offset=30, end_lineno=10, end_col_offset=34), 'sqrt', Load(), lineno=10, col_offset=30, end_lineno=10, end_col_offset=39), [Name('placeholder_1', Load(), lineno=10, col_offset=40, end_lineno=10, end_col_offset=46)], [], lineno=10, col_offset=30, end_lineno=10, end_col_offset=47)], [], lineno=10, col_offset=26, end_lineno=10, end_col_offset=48), Add(), Constant(1, lineno=10, col_offset=51, end_lineno=10, end_col_offset=52), lineno=10, col_offset=26, end_lineno=10, end_col_offset=52)], [], lineno=10, col_offset=17, end_lineno=10, end_col_offset=53), [If(Compare(BinOp(Name('placeholder_1', Load(), lineno=11, col_offset=11, end_lineno=11, end_col_offset=17), Mod(), Name('placeholder_2', Load(), lineno=11, col_offset=20, end_lineno=11, end_col_offset=25), lineno=11, col_offset=11, end_lineno=11, end_col_offset=25), [Eq()], [Constant(0, lineno=11, col_offset=29, end_lineno=11, end_col_offset=30)], lineno=11, col_offset=11, end_lineno=11, end_col_offset=30), [Expr(Yield(Name('index', Load(), lineno=12, col_offset=18, end_lineno=12, end_col_offset=23), lineno=12, col_offset=12, end_lineno=12, end_col_offset=23), lineno=12, col_offset=12, end_lineno=12, end_col_offset=23), If(Compare(BinOp(Name('placeholder_2', Load(), lineno=13, col_offset=15, end_lineno=13, end_col_offset=20), Mult(), Name('placeholder_2', Load(), lineno=13, col_offset=23, end_lineno=13, end_col_offset=28), lineno=13, col_offset=15, end_lineno=13, end_col_offset=28), [NotEq()], [Name('placeholder_1', Load(), lineno=13, col_offset=32, end_lineno=13, end_col_offset=38)], lineno=13, col_offset=15, end_lineno=13, end_col_offset=38), [Expr(Yield(BinOp(Name('number', Load(), lineno=14, col_offset=22, end_lineno=14, end_col_offset=28), FloorDiv(), Name('index', Load(), lineno=14, col_offset=32, end_lineno=14, end_col_offset=37), lineno=14, col_offset=22, end_lineno=14, end_col_offset=37), lineno=14, col_offset=16, end_lineno=14, end_col_offset=37), lineno=14, col_offset=16, end_lineno=14, end_col_offset=37)], [], lineno=13, col_offset=12, end_lineno=14, end_col_offset=37)], [], lineno=11, col_offset=8, end_lineno=14, end_col_offset=37)], [], lineno=10, col_offset=4, end_lineno=14, end_col_offset=37)], [], lineno=3, col_offset=0, end_lineno=14, end_col_offset=37), FunctionDef('placeholder_3', arguments([], [arg('placeholder_1', lineno=17, col_offset=13, end_lineno=17, end_col_offset=19)], kwonlyargs=[], kw_defaults=[], defaults=[]), [If(Compare(Name('placeholder_1', Load(), lineno=24, col_offset=7, end_lineno=24, end_col_offset=13), [LtE()], [Constant(0, lineno=24, col_offset=17, end_lineno=24, end_col_offset=18)], lineno=24, col_offset=7, end_lineno=24, end_col_offset=18), [Raise(Call(Name('ValueError', Load(), lineno=25, col_offset=14, end_lineno=25, end_col_offset=24), [Constant('Classification is only possible for positive integers.', lineno=25, col_offset=25, end_lineno=25, end_col_offset=81)], [], lineno=25, col_offset=14, end_lineno=25, end_col_offset=82), lineno=25, col_offset=8, end_lineno=25, end_col_offset=82)], [], lineno=24, col_offset=4, end_lineno=25, end_col_offset=82), Assign([Name('placeholder_4', Store(), lineno=27, col_offset=4, end_lineno=27, end_col_offset=15)], BinOp(Call(Name('sum', Load(), lineno=27, col_offset=18, end_lineno=27, end_col_offset=21), [Call(Name('placeholder_0', Load(), lineno=27, col_offset=22, end_lineno=27, end_col_offset=39), [Name('placeholder_1', Load(), lineno=27, col_offset=40, end_lineno=27, end_col_offset=46)], [], lineno=27, col_offset=22, end_lineno=27, end_col_offset=47)], [], lineno=27, col_offset=18, end_lineno=27, end_col_offset=48), Add(), IfExp(Compare(Name('placeholder_1', Load(), lineno=27, col_offset=57, end_lineno=27, end_col_offset=63), [Gt()], [Constant(1, lineno=27, col_offset=66, end_lineno=27, end_col_offset=67)], lineno=27, col_offset=57, end_lineno=27, end_col_offset=67), Constant(1, lineno=27, col_offset=52, end_lineno=27, end_col_offset=53), Constant(0, lineno=27, col_offset=73, end_lineno=27, end_col_offset=74), lineno=27, col_offset=52, end_lineno=27, end_col_offset=74), lineno=27, col_offset=18, end_lineno=27, end_col_offset=75), lineno=27, col_offset=4, end_lineno=27, end_col_offset=75), If(Compare(Name('placeholder_4', Load(), lineno=29, col_offset=7, end_lineno=29, end_col_offset=18), [Lt()], [Name('placeholder_1', Load(), lineno=29, col_offset=21, end_lineno=29, end_col_offset=27)], lineno=29, col_offset=7, end_lineno=29, end_col_offset=27), [Return(Constant('deficient', lineno=30, col_offset=15, end_lineno=30, end_col_offset=26), lineno=30, col_offset=8, end_lineno=30, end_col_offset=26)], [If(Compare(Name('placeholder_4', Load(), lineno=31, col_offset=9, end_lineno=31, end_col_offset=20), [Eq()], [Name('placeholder_1', Load(), lineno=31, col_offset=24, end_lineno=31, end_col_offset=30)], lineno=31, col_offset=9, end_lineno=31, end_col_offset=30), [Return(Constant('perfect', lineno=32, col_offset=15, end_lineno=32, end_col_offset=24), lineno=32, col_offset=8, end_lineno=32, end_col_offset=24)], [Return(Constant('abundant', lineno=34, col_offset=15, end_lineno=34, end_col_offset=25), lineno=34, col_offset=8, end_lineno=34, end_col_offset=25)], lineno=31, col_offset=4, end_lineno=34, end_col_offset=25)], lineno=29, col_offset=4, end_lineno=34, end_col_offset=25)], [], lineno=17, col_offset=0, end_lineno=34, end_col_offset=25)], []) \ No newline at end of file +Module([Import([alias('math', lineno=1, col_offset=7, end_lineno=1, end_col_offset=11)], lineno=1, col_offset=0, end_lineno=1, end_col_offset=11), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=3, col_offset=22, end_lineno=3, end_col_offset=28)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_2', Store(), lineno=10, col_offset=8, end_lineno=10, end_col_offset=13), Call(Name('range', Load(), lineno=10, col_offset=17, end_lineno=10, end_col_offset=22), [Constant(2, lineno=10, col_offset=23, end_lineno=10, end_col_offset=24), BinOp(Call(Name('int', Load(), lineno=10, col_offset=26, end_lineno=10, end_col_offset=29), [Call(Attribute(Name('math', Load(), lineno=10, col_offset=30, end_lineno=10, end_col_offset=34), 'sqrt', Load(), lineno=10, col_offset=30, end_lineno=10, end_col_offset=39), [Name('placeholder_1', Load(), lineno=10, col_offset=40, end_lineno=10, end_col_offset=46)], [], lineno=10, col_offset=30, end_lineno=10, end_col_offset=47)], [], lineno=10, col_offset=26, end_lineno=10, end_col_offset=48), Add(), Constant(1, lineno=10, col_offset=51, end_lineno=10, end_col_offset=52), lineno=10, col_offset=26, end_lineno=10, end_col_offset=52)], [], lineno=10, col_offset=17, end_lineno=10, end_col_offset=53), [If(Compare(BinOp(Name('placeholder_1', Load(), lineno=11, col_offset=11, end_lineno=11, end_col_offset=17), Mod(), Name('placeholder_2', Load(), lineno=11, col_offset=20, end_lineno=11, end_col_offset=25), lineno=11, col_offset=11, end_lineno=11, end_col_offset=25), [Eq()], [Constant(0, lineno=11, col_offset=29, end_lineno=11, end_col_offset=30)], lineno=11, col_offset=11, end_lineno=11, end_col_offset=30), [Expr(Yield(Name('placeholder_2', Load(), lineno=12, col_offset=18, end_lineno=12, end_col_offset=23), lineno=12, col_offset=12, end_lineno=12, end_col_offset=23), lineno=12, col_offset=12, end_lineno=12, end_col_offset=23), If(Compare(BinOp(Name('placeholder_2', Load(), lineno=13, col_offset=15, end_lineno=13, end_col_offset=20), Mult(), Name('placeholder_2', Load(), lineno=13, col_offset=23, end_lineno=13, end_col_offset=28), lineno=13, col_offset=15, end_lineno=13, end_col_offset=28), [NotEq()], [Name('placeholder_1', Load(), lineno=13, col_offset=32, end_lineno=13, end_col_offset=38)], lineno=13, col_offset=15, end_lineno=13, end_col_offset=38), [Expr(Yield(BinOp(Name('placeholder_1', Load(), lineno=14, col_offset=22, end_lineno=14, end_col_offset=28), FloorDiv(), Name('placeholder_2', Load(), lineno=14, col_offset=32, end_lineno=14, end_col_offset=37), lineno=14, col_offset=22, end_lineno=14, end_col_offset=37), lineno=14, col_offset=16, end_lineno=14, end_col_offset=37), lineno=14, col_offset=16, end_lineno=14, end_col_offset=37)], [], lineno=13, col_offset=12, end_lineno=14, end_col_offset=37)], [], lineno=11, col_offset=8, end_lineno=14, end_col_offset=37)], [], lineno=10, col_offset=4, end_lineno=14, end_col_offset=37)], [], lineno=3, col_offset=0, end_lineno=14, end_col_offset=37), FunctionDef('placeholder_3', arguments([], [arg('placeholder_1', lineno=17, col_offset=13, end_lineno=17, end_col_offset=19)], kwonlyargs=[], kw_defaults=[], defaults=[]), [If(Compare(Name('placeholder_1', Load(), lineno=24, col_offset=7, end_lineno=24, end_col_offset=13), [LtE()], [Constant(0, lineno=24, col_offset=17, end_lineno=24, end_col_offset=18)], lineno=24, col_offset=7, end_lineno=24, end_col_offset=18), [Raise(Call(Name('ValueError', Load(), lineno=25, col_offset=14, end_lineno=25, end_col_offset=24), [Constant('Classification is only possible for positive integers.', lineno=25, col_offset=25, end_lineno=25, end_col_offset=81)], [], lineno=25, col_offset=14, end_lineno=25, end_col_offset=82), lineno=25, col_offset=8, end_lineno=25, end_col_offset=82)], [], lineno=24, col_offset=4, end_lineno=25, end_col_offset=82), Assign([Name('placeholder_4', Store(), lineno=27, col_offset=4, end_lineno=27, end_col_offset=15)], BinOp(Call(Name('sum', Load(), lineno=27, col_offset=18, end_lineno=27, end_col_offset=21), [Call(Name('placeholder_0', Load(), lineno=27, col_offset=22, end_lineno=27, end_col_offset=39), [Name('placeholder_1', Load(), lineno=27, col_offset=40, end_lineno=27, end_col_offset=46)], [], lineno=27, col_offset=22, end_lineno=27, end_col_offset=47)], [], lineno=27, col_offset=18, end_lineno=27, end_col_offset=48), Add(), IfExp(Compare(Name('placeholder_1', Load(), lineno=27, col_offset=57, end_lineno=27, end_col_offset=63), [Gt()], [Constant(1, lineno=27, col_offset=66, end_lineno=27, end_col_offset=67)], lineno=27, col_offset=57, end_lineno=27, end_col_offset=67), Constant(1, lineno=27, col_offset=52, end_lineno=27, end_col_offset=53), Constant(0, lineno=27, col_offset=73, end_lineno=27, end_col_offset=74), lineno=27, col_offset=52, end_lineno=27, end_col_offset=74), lineno=27, col_offset=18, end_lineno=27, end_col_offset=75), lineno=27, col_offset=4, end_lineno=27, end_col_offset=75), If(Compare(Name('placeholder_4', Load(), lineno=29, col_offset=7, end_lineno=29, end_col_offset=18), [Lt()], [Name('placeholder_1', Load(), lineno=29, col_offset=21, end_lineno=29, end_col_offset=27)], lineno=29, col_offset=7, end_lineno=29, end_col_offset=27), [Return(Constant('deficient', lineno=30, col_offset=15, end_lineno=30, end_col_offset=26), lineno=30, col_offset=8, end_lineno=30, end_col_offset=26)], [If(Compare(Name('placeholder_4', Load(), lineno=31, col_offset=9, end_lineno=31, end_col_offset=20), [Eq()], [Name('placeholder_1', Load(), lineno=31, col_offset=24, end_lineno=31, end_col_offset=30)], lineno=31, col_offset=9, end_lineno=31, end_col_offset=30), [Return(Constant('perfect', lineno=32, col_offset=15, end_lineno=32, end_col_offset=24), lineno=32, col_offset=8, end_lineno=32, end_col_offset=24)], [Return(Constant('abundant', lineno=34, col_offset=15, end_lineno=34, end_col_offset=25), lineno=34, col_offset=8, end_lineno=34, end_col_offset=25)], lineno=31, col_offset=4, end_lineno=34, end_col_offset=25)], lineno=29, col_offset=4, end_lineno=34, end_col_offset=25)], [], lineno=17, col_offset=0, end_lineno=34, end_col_offset=25)], []) \ No newline at end of file diff --git a/test/practice-pov/representation.txt b/test/practice-pov/representation.txt index 075a2e2..0024dcc 100644 --- a/test/practice-pov/representation.txt +++ b/test/practice-pov/representation.txt @@ -1 +1 @@ -Module([ImportFrom('json', [alias('dumps', lineno=1, col_offset=17, end_lineno=1, end_col_offset=22)], 0, lineno=1, col_offset=0, end_lineno=1, end_col_offset=22), ClassDef('placeholder_0', [], [], [FunctionDef('placeholder_1', arguments([], [arg('self', lineno=5, col_offset=17, end_lineno=5, end_col_offset=21), arg('placeholder_2', lineno=5, col_offset=23, end_lineno=5, end_col_offset=28), arg('placeholder_3', lineno=5, col_offset=30, end_lineno=5, end_col_offset=38)], kwonlyargs=[], kw_defaults=[], defaults=[Constant(None, lineno=5, col_offset=39, end_lineno=5, end_col_offset=43)]), [Assign([Attribute(Name('self', Load(), lineno=6, col_offset=8, end_lineno=6, end_col_offset=12), 'placeholder_2', Store(), lineno=6, col_offset=8, end_lineno=6, end_col_offset=18)], Name('placeholder_2', Load(), lineno=6, col_offset=21, end_lineno=6, end_col_offset=26), lineno=6, col_offset=8, end_lineno=6, end_col_offset=26), Assign([Attribute(Name('self', Load(), lineno=7, col_offset=8, end_lineno=7, end_col_offset=12), 'placeholder_3', Store(), lineno=7, col_offset=8, end_lineno=7, end_col_offset=21)], IfExp(Compare(Name('placeholder_3', Load(), lineno=7, col_offset=36, end_lineno=7, end_col_offset=44), [IsNot()], [Constant(None, lineno=7, col_offset=52, end_lineno=7, end_col_offset=56)], lineno=7, col_offset=36, end_lineno=7, end_col_offset=56), Name('placeholder_3', Load(), lineno=7, col_offset=24, end_lineno=7, end_col_offset=32), List([], Load(), lineno=7, col_offset=62, end_lineno=7, end_col_offset=64), lineno=7, col_offset=24, end_lineno=7, end_col_offset=64), lineno=7, col_offset=8, end_lineno=7, end_col_offset=64)], [], lineno=5, col_offset=4, end_lineno=7, end_col_offset=64), FunctionDef('placeholder_4', arguments([], [arg('self', lineno=9, col_offset=17, end_lineno=9, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Dict([Attribute(Name('self', Load(), lineno=10, col_offset=16, end_lineno=10, end_col_offset=20), 'placeholder_2', Load(), lineno=10, col_offset=16, end_lineno=10, end_col_offset=26)], [ListComp(Call(Attribute(Name('placeholder_5', Load(), lineno=10, col_offset=29, end_lineno=10, end_col_offset=35), 'placeholder_4', Load(), lineno=10, col_offset=29, end_lineno=10, end_col_offset=44), [], [], lineno=10, col_offset=29, end_lineno=10, end_col_offset=46), [comprehension(Name('placeholder_5', Store(), lineno=10, col_offset=51, end_lineno=10, end_col_offset=57), Call(Name('sorted', Load(), lineno=10, col_offset=61, end_lineno=10, end_col_offset=67), [Attribute(Name('self', Load(), lineno=10, col_offset=68, end_lineno=10, end_col_offset=72), 'placeholder_3', Load(), lineno=10, col_offset=68, end_lineno=10, end_col_offset=81)], [], lineno=10, col_offset=61, end_lineno=10, end_col_offset=82), [], 0)], lineno=10, col_offset=28, end_lineno=10, end_col_offset=83)], lineno=10, col_offset=15, end_lineno=10, end_col_offset=84), lineno=10, col_offset=8, end_lineno=10, end_col_offset=84)], [], lineno=9, col_offset=4, end_lineno=10, end_col_offset=84), FunctionDef('placeholder_6', arguments([], [arg('self', lineno=12, col_offset=16, end_lineno=12, end_col_offset=20), arg('placeholder_7', lineno=12, col_offset=22, end_lineno=12, end_col_offset=28)], kwonlyargs=[], kw_defaults=[], defaults=[Constant(None, lineno=12, col_offset=29, end_lineno=12, end_col_offset=33)]), [Return(Call(Name('dumps', Load(), lineno=13, col_offset=15, end_lineno=13, end_col_offset=20), [Call(Attribute(Name('self', Load(), lineno=13, col_offset=21, end_lineno=13, end_col_offset=25), 'placeholder_4', Load(), lineno=13, col_offset=21, end_lineno=13, end_col_offset=34), [], [], lineno=13, col_offset=21, end_lineno=13, end_col_offset=36)], [keyword('placeholder_7', Name('placeholder_7', Load(), lineno=13, col_offset=45, end_lineno=13, end_col_offset=51), lineno=13, col_offset=38, end_lineno=13, end_col_offset=51)], lineno=13, col_offset=15, end_lineno=13, end_col_offset=52), lineno=13, col_offset=8, end_lineno=13, end_col_offset=52)], [], lineno=12, col_offset=4, end_lineno=13, end_col_offset=52), FunctionDef('placeholder_8', arguments([], [arg('self', lineno=15, col_offset=15, end_lineno=15, end_col_offset=19), arg('placeholder_9', lineno=15, col_offset=21, end_lineno=15, end_col_offset=26)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Compare(Attribute(Name('self', Load(), lineno=16, col_offset=15, end_lineno=16, end_col_offset=19), 'placeholder_2', Load(), lineno=16, col_offset=15, end_lineno=16, end_col_offset=25), [Lt()], [Attribute(Name('placeholder_9', Load(), lineno=16, col_offset=28, end_lineno=16, end_col_offset=33), 'placeholder_2', Load(), lineno=16, col_offset=28, end_lineno=16, end_col_offset=39)], lineno=16, col_offset=15, end_lineno=16, end_col_offset=39), lineno=16, col_offset=8, end_lineno=16, end_col_offset=39)], [], lineno=15, col_offset=4, end_lineno=16, end_col_offset=39), FunctionDef('placeholder_10', arguments([], [arg('self', lineno=18, col_offset=15, end_lineno=18, end_col_offset=19), arg('placeholder_9', lineno=18, col_offset=21, end_lineno=18, end_col_offset=26)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Compare(Call(Attribute(Name('self', Load(), lineno=19, col_offset=15, end_lineno=19, end_col_offset=19), 'placeholder_4', Load(), lineno=19, col_offset=15, end_lineno=19, end_col_offset=28), [], [], lineno=19, col_offset=15, end_lineno=19, end_col_offset=30), [Eq()], [Call(Attribute(Name('placeholder_9', Load(), lineno=19, col_offset=34, end_lineno=19, end_col_offset=39), 'placeholder_4', Load(), lineno=19, col_offset=34, end_lineno=19, end_col_offset=48), [], [], lineno=19, col_offset=34, end_lineno=19, end_col_offset=50)], lineno=19, col_offset=15, end_lineno=19, end_col_offset=50), lineno=19, col_offset=8, end_lineno=19, end_col_offset=50)], [], lineno=18, col_offset=4, end_lineno=19, end_col_offset=50), FunctionDef('placeholder_11', arguments([], [arg('self', lineno=21, col_offset=17, end_lineno=21, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Expr(Yield(Attribute(Name('self', Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=18), 'label', Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=24), lineno=22, col_offset=8, end_lineno=22, end_col_offset=24), lineno=22, col_offset=8, end_lineno=22, end_col_offset=24), For(Name('placeholder_12', Store(), lineno=23, col_offset=12, end_lineno=23, end_col_offset=17), Attribute(Name('self', Load(), lineno=23, col_offset=21, end_lineno=23, end_col_offset=25), 'placeholder_3', Load(), lineno=23, col_offset=21, end_lineno=23, end_col_offset=34), [For(Name('placeholder_13', Store(), lineno=24, col_offset=16, end_lineno=24, end_col_offset=26), Name('placeholder_12', Load(), lineno=24, col_offset=30, end_lineno=24, end_col_offset=35), [Expr(Yield(Name('grandchild', Load(), lineno=25, col_offset=22, end_lineno=25, end_col_offset=32), lineno=25, col_offset=16, end_lineno=25, end_col_offset=32), lineno=25, col_offset=16, end_lineno=25, end_col_offset=32)], [], lineno=24, col_offset=12, end_lineno=25, end_col_offset=32)], [], lineno=23, col_offset=8, end_lineno=25, end_col_offset=32)], [], lineno=21, col_offset=4, end_lineno=25, end_col_offset=32), FunctionDef('placeholder_14', arguments([], [arg('self', lineno=27, col_offset=12, end_lineno=27, end_col_offset=16)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Call(Name('placeholder_0', Load(), lineno=28, col_offset=15, end_lineno=28, end_col_offset=19), [Attribute(Name('self', Load(), lineno=28, col_offset=20, end_lineno=28, end_col_offset=24), 'placeholder_2', Load(), lineno=28, col_offset=20, end_lineno=28, end_col_offset=30), ListComp(Call(Attribute(Name('placeholder_5', Load(), lineno=28, col_offset=33, end_lineno=28, end_col_offset=39), 'placeholder_14', Load(), lineno=28, col_offset=33, end_lineno=28, end_col_offset=43), [], [], lineno=28, col_offset=33, end_lineno=28, end_col_offset=45), [comprehension(Name('placeholder_5', Store(), lineno=28, col_offset=50, end_lineno=28, end_col_offset=56), Attribute(Name('self', Load(), lineno=28, col_offset=60, end_lineno=28, end_col_offset=64), 'placeholder_3', Load(), lineno=28, col_offset=60, end_lineno=28, end_col_offset=73), [], 0)], lineno=28, col_offset=32, end_lineno=28, end_col_offset=74)], [], lineno=28, col_offset=15, end_lineno=28, end_col_offset=75), lineno=28, col_offset=8, end_lineno=28, end_col_offset=75)], [], lineno=27, col_offset=4, end_lineno=28, end_col_offset=75), FunctionDef('placeholder_15', arguments([], [arg('self', lineno=30, col_offset=12, end_lineno=30, end_col_offset=16), arg('placeholder_9', lineno=30, col_offset=18, end_lineno=30, end_col_offset=23)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_16', Store(), lineno=31, col_offset=8, end_lineno=31, end_col_offset=12)], Call(Attribute(Name('self', Load(), lineno=31, col_offset=15, end_lineno=31, end_col_offset=19), 'placeholder_14', Load(), lineno=31, col_offset=15, end_lineno=31, end_col_offset=23), [], [], lineno=31, col_offset=15, end_lineno=31, end_col_offset=25), lineno=31, col_offset=8, end_lineno=31, end_col_offset=25), Expr(Call(Attribute(Attribute(Name('placeholder_16', Load(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=12), 'placeholder_3', Load(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=21), 'append', Load(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=28), [Name('placeholder_9', Load(), lineno=32, col_offset=29, end_lineno=32, end_col_offset=34)], [], lineno=32, col_offset=8, end_lineno=32, end_col_offset=35), lineno=32, col_offset=8, end_lineno=32, end_col_offset=35), Return(Name('placeholder_16', Load(), lineno=33, col_offset=15, end_lineno=33, end_col_offset=19), lineno=33, col_offset=8, end_lineno=33, end_col_offset=19)], [], lineno=30, col_offset=4, end_lineno=33, end_col_offset=19), FunctionDef('placeholder_17', arguments([], [arg('self', lineno=35, col_offset=15, end_lineno=35, end_col_offset=19), arg('placeholder_18', lineno=35, col_offset=21, end_lineno=35, end_col_offset=25)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_16', Store(), lineno=36, col_offset=8, end_lineno=36, end_col_offset=12)], Call(Attribute(Name('self', Load(), lineno=36, col_offset=15, end_lineno=36, end_col_offset=19), 'placeholder_14', Load(), lineno=36, col_offset=15, end_lineno=36, end_col_offset=23), [], [], lineno=36, col_offset=15, end_lineno=36, end_col_offset=25), lineno=36, col_offset=8, end_lineno=36, end_col_offset=25), For(Name('placeholder_12', Store(), lineno=37, col_offset=12, end_lineno=37, end_col_offset=17), Call(Name('list', Load(), lineno=37, col_offset=21, end_lineno=37, end_col_offset=25), [Attribute(Name('placeholder_16', Load(), lineno=37, col_offset=26, end_lineno=37, end_col_offset=30), 'placeholder_3', Load(), lineno=37, col_offset=26, end_lineno=37, end_col_offset=39)], [], lineno=37, col_offset=21, end_lineno=37, end_col_offset=40), [Expr(Call(Attribute(Attribute(Name('placeholder_16', Load(), lineno=38, col_offset=12, end_lineno=38, end_col_offset=16), 'placeholder_3', Load(), lineno=38, col_offset=12, end_lineno=38, end_col_offset=25), 'placeholder_17', Load(), lineno=38, col_offset=12, end_lineno=38, end_col_offset=32), [Name('placeholder_12', Load(), lineno=38, col_offset=33, end_lineno=38, end_col_offset=38)], [], lineno=38, col_offset=12, end_lineno=38, end_col_offset=39), lineno=38, col_offset=12, end_lineno=38, end_col_offset=39), If(Compare(Attribute(Name('placeholder_12', Load(), lineno=39, col_offset=15, end_lineno=39, end_col_offset=20), 'placeholder_2', Load(), lineno=39, col_offset=15, end_lineno=39, end_col_offset=26), [Eq()], [Name('placeholder_18', Load(), lineno=39, col_offset=30, end_lineno=39, end_col_offset=34)], lineno=39, col_offset=15, end_lineno=39, end_col_offset=34), [Break(lineno=40, col_offset=16, end_lineno=40, end_col_offset=21)], [], lineno=39, col_offset=12, end_lineno=40, end_col_offset=21), Expr(Call(Attribute(Attribute(Name('placeholder_16', Load(), lineno=41, col_offset=12, end_lineno=41, end_col_offset=16), 'placeholder_3', Load(), lineno=41, col_offset=12, end_lineno=41, end_col_offset=25), 'append', Load(), lineno=41, col_offset=12, end_lineno=41, end_col_offset=32), [Call(Attribute(Name('placeholder_12', Load(), lineno=41, col_offset=33, end_lineno=41, end_col_offset=38), 'placeholder_17', Load(), lineno=41, col_offset=33, end_lineno=41, end_col_offset=45), [Name('placeholder_18', Load(), lineno=41, col_offset=46, end_lineno=41, end_col_offset=50)], [], lineno=41, col_offset=33, end_lineno=41, end_col_offset=51)], [], lineno=41, col_offset=12, end_lineno=41, end_col_offset=52), lineno=41, col_offset=12, end_lineno=41, end_col_offset=52)], [], lineno=37, col_offset=8, end_lineno=41, end_col_offset=52), Return(Name('placeholder_16', Load(), lineno=42, col_offset=15, end_lineno=42, end_col_offset=19), lineno=42, col_offset=8, end_lineno=42, end_col_offset=19)], [], lineno=35, col_offset=4, end_lineno=42, end_col_offset=19), FunctionDef('placeholder_19', arguments([], [arg('self', lineno=44, col_offset=17, end_lineno=44, end_col_offset=21), arg('placeholder_20', lineno=44, col_offset=23, end_lineno=44, end_col_offset=32)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_21', Store(), lineno=45, col_offset=8, end_lineno=45, end_col_offset=13)], List([Name('self', Load(), lineno=45, col_offset=17, end_lineno=45, end_col_offset=21)], Load(), lineno=45, col_offset=16, end_lineno=45, end_col_offset=22), lineno=45, col_offset=8, end_lineno=45, end_col_offset=22), Assign([Name('placeholder_22', Store(), lineno=46, col_offset=8, end_lineno=46, end_col_offset=15)], Call(Name('set', Load(), lineno=46, col_offset=18, end_lineno=46, end_col_offset=21), [], [], lineno=46, col_offset=18, end_lineno=46, end_col_offset=23), lineno=46, col_offset=8, end_lineno=46, end_col_offset=23), While(Name('placeholder_21', Load(), lineno=48, col_offset=14, end_lineno=48, end_col_offset=19), [Assign([Name('placeholder_16', Store(), lineno=49, col_offset=12, end_lineno=49, end_col_offset=16)], Call(Attribute(Name('placeholder_21', Load(), lineno=49, col_offset=19, end_lineno=49, end_col_offset=24), 'pop', Load(), lineno=49, col_offset=19, end_lineno=49, end_col_offset=28), [Constant(0, lineno=49, col_offset=29, end_lineno=49, end_col_offset=30)], [], lineno=49, col_offset=19, end_lineno=49, end_col_offset=31), lineno=49, col_offset=12, end_lineno=49, end_col_offset=31), If(Compare(Attribute(Name('placeholder_16', Load(), lineno=50, col_offset=15, end_lineno=50, end_col_offset=19), 'placeholder_2', Load(), lineno=50, col_offset=15, end_lineno=50, end_col_offset=25), [In()], [Name('placeholder_22', Load(), lineno=50, col_offset=29, end_lineno=50, end_col_offset=36)], lineno=50, col_offset=15, end_lineno=50, end_col_offset=36), [Continue(lineno=51, col_offset=16, end_lineno=51, end_col_offset=24)], [], lineno=50, col_offset=12, end_lineno=51, end_col_offset=24), Expr(Call(Attribute(Name('placeholder_22', Load(), lineno=53, col_offset=12, end_lineno=53, end_col_offset=19), 'placeholder_15', Load(), lineno=53, col_offset=12, end_lineno=53, end_col_offset=23), [Attribute(Name('placeholder_16', Load(), lineno=53, col_offset=24, end_lineno=53, end_col_offset=28), 'placeholder_2', Load(), lineno=53, col_offset=24, end_lineno=53, end_col_offset=34)], [], lineno=53, col_offset=12, end_lineno=53, end_col_offset=35), lineno=53, col_offset=12, end_lineno=53, end_col_offset=35), If(Compare(Name('placeholder_20', Load(), lineno=54, col_offset=15, end_lineno=54, end_col_offset=24), [Eq()], [Attribute(Name('placeholder_16', Load(), lineno=54, col_offset=28, end_lineno=54, end_col_offset=32), 'placeholder_2', Load(), lineno=54, col_offset=28, end_lineno=54, end_col_offset=38)], lineno=54, col_offset=15, end_lineno=54, end_col_offset=38), [Return(Name('placeholder_16', Load(), lineno=55, col_offset=23, end_lineno=55, end_col_offset=27), lineno=55, col_offset=16, end_lineno=55, end_col_offset=27)], [], lineno=54, col_offset=12, end_lineno=55, end_col_offset=27), For(Name('placeholder_12', Store(), lineno=57, col_offset=16, end_lineno=57, end_col_offset=21), Attribute(Name('placeholder_16', Load(), lineno=57, col_offset=25, end_lineno=57, end_col_offset=29), 'placeholder_3', Load(), lineno=57, col_offset=25, end_lineno=57, end_col_offset=38), [Expr(Call(Attribute(Name('placeholder_21', Load(), lineno=58, col_offset=16, end_lineno=58, end_col_offset=21), 'append', Load(), lineno=58, col_offset=16, end_lineno=58, end_col_offset=28), [Call(Attribute(Name('placeholder_12', Load(), lineno=58, col_offset=29, end_lineno=58, end_col_offset=34), 'placeholder_15', Load(), lineno=58, col_offset=29, end_lineno=58, end_col_offset=38), [Call(Attribute(Name('placeholder_16', Load(), lineno=58, col_offset=39, end_lineno=58, end_col_offset=43), 'placeholder_17', Load(), lineno=58, col_offset=39, end_lineno=58, end_col_offset=50), [Attribute(Name('placeholder_12', Load(), lineno=58, col_offset=51, end_lineno=58, end_col_offset=56), 'placeholder_2', Load(), lineno=58, col_offset=51, end_lineno=58, end_col_offset=62)], [], lineno=58, col_offset=39, end_lineno=58, end_col_offset=63)], [], lineno=58, col_offset=29, end_lineno=58, end_col_offset=64)], [], lineno=58, col_offset=16, end_lineno=58, end_col_offset=65), lineno=58, col_offset=16, end_lineno=58, end_col_offset=65)], [], lineno=57, col_offset=12, end_lineno=58, end_col_offset=65)], [], lineno=48, col_offset=8, end_lineno=58, end_col_offset=65), Raise(Call(Name('ValueError', Load(), lineno=60, col_offset=14, end_lineno=60, end_col_offset=24), [Constant('Tree could not be reoriented', lineno=60, col_offset=25, end_lineno=60, end_col_offset=55)], [], lineno=60, col_offset=14, end_lineno=60, end_col_offset=56), lineno=60, col_offset=8, end_lineno=60, end_col_offset=56)], [], lineno=44, col_offset=4, end_lineno=60, end_col_offset=56), FunctionDef('placeholder_23', arguments([], [arg('self', lineno=64, col_offset=16, end_lineno=64, end_col_offset=20), arg('placeholder_20', lineno=64, col_offset=22, end_lineno=64, end_col_offset=31), arg('placeholder_24', lineno=64, col_offset=33, end_lineno=64, end_col_offset=40)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_25', Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=17)], Call(Attribute(Name('self', Load(), lineno=65, col_offset=20, end_lineno=65, end_col_offset=24), 'placeholder_19', Load(), lineno=65, col_offset=20, end_lineno=65, end_col_offset=33), [Name('placeholder_20', Load(), lineno=65, col_offset=34, end_lineno=65, end_col_offset=43)], [], lineno=65, col_offset=20, end_lineno=65, end_col_offset=44), lineno=65, col_offset=8, end_lineno=65, end_col_offset=44), Assign([Name('placeholder_21', Store(), lineno=66, col_offset=8, end_lineno=66, end_col_offset=13)], Attribute(Name('placeholder_25', Load(), lineno=66, col_offset=16, end_lineno=66, end_col_offset=25), 'placeholder_3', Load(), lineno=66, col_offset=16, end_lineno=66, end_col_offset=34), lineno=66, col_offset=8, end_lineno=66, end_col_offset=34), Assign([Name('placeholder_26', Store(), lineno=67, col_offset=8, end_lineno=67, end_col_offset=12)], List([Name('placeholder_20', Load(), lineno=67, col_offset=16, end_lineno=67, end_col_offset=25)], Load(), lineno=67, col_offset=15, end_lineno=67, end_col_offset=26), lineno=67, col_offset=8, end_lineno=67, end_col_offset=26), While(Compare(Subscript(Name('placeholder_26', Load(), lineno=69, col_offset=14, end_lineno=69, end_col_offset=18), UnaryOp(USub(), Constant(1, lineno=69, col_offset=20, end_lineno=69, end_col_offset=21), lineno=69, col_offset=19, end_lineno=69, end_col_offset=21), Load(), lineno=69, col_offset=14, end_lineno=69, end_col_offset=22), [NotEq()], [Name('placeholder_24', Load(), lineno=69, col_offset=26, end_lineno=69, end_col_offset=33)], lineno=69, col_offset=14, end_lineno=69, end_col_offset=33), [Try([Assign([Name('placeholder_16', Store(), lineno=71, col_offset=16, end_lineno=71, end_col_offset=20)], Call(Attribute(Name('placeholder_21', Load(), lineno=71, col_offset=23, end_lineno=71, end_col_offset=28), 'pop', Load(), lineno=71, col_offset=23, end_lineno=71, end_col_offset=32), [], [], lineno=71, col_offset=23, end_lineno=71, end_col_offset=34), lineno=71, col_offset=16, end_lineno=71, end_col_offset=34)], [ExceptHandler(Name('IndexError', Load(), lineno=72, col_offset=19, end_lineno=72, end_col_offset=29), 'placeholder_27', [Raise(Call(Name('ValueError', Load(), lineno=73, col_offset=22, end_lineno=73, end_col_offset=32), [Constant('No path found', lineno=73, col_offset=33, end_lineno=73, end_col_offset=48)], [], lineno=73, col_offset=22, end_lineno=73, end_col_offset=49), Name('placeholder_27', Load(), lineno=73, col_offset=55, end_lineno=73, end_col_offset=60), lineno=73, col_offset=16, end_lineno=73, end_col_offset=60)], lineno=72, col_offset=12, end_lineno=73, end_col_offset=60)], [], [], lineno=70, col_offset=12, end_lineno=73, end_col_offset=60), If(Compare(Name('placeholder_24', Load(), lineno=74, col_offset=15, end_lineno=74, end_col_offset=22), [In()], [Name('placeholder_16', Load(), lineno=74, col_offset=26, end_lineno=74, end_col_offset=30)], lineno=74, col_offset=15, end_lineno=74, end_col_offset=30), [Expr(Call(Attribute(Name('placeholder_26', Load(), lineno=75, col_offset=16, end_lineno=75, end_col_offset=20), 'append', Load(), lineno=75, col_offset=16, end_lineno=75, end_col_offset=27), [Attribute(Name('placeholder_16', Load(), lineno=75, col_offset=28, end_lineno=75, end_col_offset=32), 'placeholder_2', Load(), lineno=75, col_offset=28, end_lineno=75, end_col_offset=38)], [], lineno=75, col_offset=16, end_lineno=75, end_col_offset=39), lineno=75, col_offset=16, end_lineno=75, end_col_offset=39), Assign([Name('placeholder_21', Store(), lineno=76, col_offset=16, end_lineno=76, end_col_offset=21)], Attribute(Name('placeholder_16', Load(), lineno=76, col_offset=24, end_lineno=76, end_col_offset=28), 'placeholder_3', Load(), lineno=76, col_offset=24, end_lineno=76, end_col_offset=37), lineno=76, col_offset=16, end_lineno=76, end_col_offset=37)], [], lineno=74, col_offset=12, end_lineno=76, end_col_offset=37)], [], lineno=69, col_offset=8, end_lineno=76, end_col_offset=37), Return(Name('placeholder_26', Load(), lineno=77, col_offset=15, end_lineno=77, end_col_offset=19), lineno=77, col_offset=8, end_lineno=77, end_col_offset=19)], [], lineno=64, col_offset=4, end_lineno=77, end_col_offset=19)], [], lineno=4, col_offset=0, end_lineno=77, end_col_offset=19)], []) \ No newline at end of file +Module([ImportFrom('json', [alias('dumps', lineno=1, col_offset=17, end_lineno=1, end_col_offset=22)], 0, lineno=1, col_offset=0, end_lineno=1, end_col_offset=22), ClassDef('placeholder_0', [], [], [FunctionDef('placeholder_1', arguments([], [arg('self', lineno=5, col_offset=17, end_lineno=5, end_col_offset=21), arg('placeholder_2', lineno=5, col_offset=23, end_lineno=5, end_col_offset=28), arg('placeholder_3', lineno=5, col_offset=30, end_lineno=5, end_col_offset=38)], kwonlyargs=[], kw_defaults=[], defaults=[Constant(None, lineno=5, col_offset=39, end_lineno=5, end_col_offset=43)]), [Assign([Attribute(Name('self', Load(), lineno=6, col_offset=8, end_lineno=6, end_col_offset=12), 'placeholder_2', Store(), lineno=6, col_offset=8, end_lineno=6, end_col_offset=18)], Name('placeholder_2', Load(), lineno=6, col_offset=21, end_lineno=6, end_col_offset=26), lineno=6, col_offset=8, end_lineno=6, end_col_offset=26), Assign([Attribute(Name('self', Load(), lineno=7, col_offset=8, end_lineno=7, end_col_offset=12), 'placeholder_3', Store(), lineno=7, col_offset=8, end_lineno=7, end_col_offset=21)], IfExp(Compare(Name('placeholder_3', Load(), lineno=7, col_offset=36, end_lineno=7, end_col_offset=44), [IsNot()], [Constant(None, lineno=7, col_offset=52, end_lineno=7, end_col_offset=56)], lineno=7, col_offset=36, end_lineno=7, end_col_offset=56), Name('placeholder_3', Load(), lineno=7, col_offset=24, end_lineno=7, end_col_offset=32), List([], Load(), lineno=7, col_offset=62, end_lineno=7, end_col_offset=64), lineno=7, col_offset=24, end_lineno=7, end_col_offset=64), lineno=7, col_offset=8, end_lineno=7, end_col_offset=64)], [], lineno=5, col_offset=4, end_lineno=7, end_col_offset=64), FunctionDef('placeholder_4', arguments([], [arg('self', lineno=9, col_offset=17, end_lineno=9, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Dict([Attribute(Name('self', Load(), lineno=10, col_offset=16, end_lineno=10, end_col_offset=20), 'placeholder_2', Load(), lineno=10, col_offset=16, end_lineno=10, end_col_offset=26)], [ListComp(Call(Attribute(Name('placeholder_5', Load(), lineno=10, col_offset=29, end_lineno=10, end_col_offset=35), 'placeholder_4', Load(), lineno=10, col_offset=29, end_lineno=10, end_col_offset=44), [], [], lineno=10, col_offset=29, end_lineno=10, end_col_offset=46), [comprehension(Name('placeholder_5', Store(), lineno=10, col_offset=51, end_lineno=10, end_col_offset=57), Call(Name('sorted', Load(), lineno=10, col_offset=61, end_lineno=10, end_col_offset=67), [Attribute(Name('self', Load(), lineno=10, col_offset=68, end_lineno=10, end_col_offset=72), 'placeholder_3', Load(), lineno=10, col_offset=68, end_lineno=10, end_col_offset=81)], [], lineno=10, col_offset=61, end_lineno=10, end_col_offset=82), [], 0)], lineno=10, col_offset=28, end_lineno=10, end_col_offset=83)], lineno=10, col_offset=15, end_lineno=10, end_col_offset=84), lineno=10, col_offset=8, end_lineno=10, end_col_offset=84)], [], lineno=9, col_offset=4, end_lineno=10, end_col_offset=84), FunctionDef('placeholder_6', arguments([], [arg('self', lineno=12, col_offset=16, end_lineno=12, end_col_offset=20), arg('placeholder_7', lineno=12, col_offset=22, end_lineno=12, end_col_offset=28)], kwonlyargs=[], kw_defaults=[], defaults=[Constant(None, lineno=12, col_offset=29, end_lineno=12, end_col_offset=33)]), [Return(Call(Name('dumps', Load(), lineno=13, col_offset=15, end_lineno=13, end_col_offset=20), [Call(Attribute(Name('self', Load(), lineno=13, col_offset=21, end_lineno=13, end_col_offset=25), 'placeholder_4', Load(), lineno=13, col_offset=21, end_lineno=13, end_col_offset=34), [], [], lineno=13, col_offset=21, end_lineno=13, end_col_offset=36)], [keyword('placeholder_7', Name('placeholder_7', Load(), lineno=13, col_offset=45, end_lineno=13, end_col_offset=51), lineno=13, col_offset=38, end_lineno=13, end_col_offset=51)], lineno=13, col_offset=15, end_lineno=13, end_col_offset=52), lineno=13, col_offset=8, end_lineno=13, end_col_offset=52)], [], lineno=12, col_offset=4, end_lineno=13, end_col_offset=52), FunctionDef('placeholder_8', arguments([], [arg('self', lineno=15, col_offset=15, end_lineno=15, end_col_offset=19), arg('placeholder_9', lineno=15, col_offset=21, end_lineno=15, end_col_offset=26)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Compare(Attribute(Name('self', Load(), lineno=16, col_offset=15, end_lineno=16, end_col_offset=19), 'placeholder_2', Load(), lineno=16, col_offset=15, end_lineno=16, end_col_offset=25), [Lt()], [Attribute(Name('placeholder_9', Load(), lineno=16, col_offset=28, end_lineno=16, end_col_offset=33), 'placeholder_2', Load(), lineno=16, col_offset=28, end_lineno=16, end_col_offset=39)], lineno=16, col_offset=15, end_lineno=16, end_col_offset=39), lineno=16, col_offset=8, end_lineno=16, end_col_offset=39)], [], lineno=15, col_offset=4, end_lineno=16, end_col_offset=39), FunctionDef('placeholder_10', arguments([], [arg('self', lineno=18, col_offset=15, end_lineno=18, end_col_offset=19), arg('placeholder_9', lineno=18, col_offset=21, end_lineno=18, end_col_offset=26)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Compare(Call(Attribute(Name('self', Load(), lineno=19, col_offset=15, end_lineno=19, end_col_offset=19), 'placeholder_4', Load(), lineno=19, col_offset=15, end_lineno=19, end_col_offset=28), [], [], lineno=19, col_offset=15, end_lineno=19, end_col_offset=30), [Eq()], [Call(Attribute(Name('placeholder_9', Load(), lineno=19, col_offset=34, end_lineno=19, end_col_offset=39), 'placeholder_4', Load(), lineno=19, col_offset=34, end_lineno=19, end_col_offset=48), [], [], lineno=19, col_offset=34, end_lineno=19, end_col_offset=50)], lineno=19, col_offset=15, end_lineno=19, end_col_offset=50), lineno=19, col_offset=8, end_lineno=19, end_col_offset=50)], [], lineno=18, col_offset=4, end_lineno=19, end_col_offset=50), FunctionDef('placeholder_11', arguments([], [arg('self', lineno=21, col_offset=17, end_lineno=21, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Expr(Yield(Attribute(Name('self', Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=18), 'placeholder_2', Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=24), lineno=22, col_offset=8, end_lineno=22, end_col_offset=24), lineno=22, col_offset=8, end_lineno=22, end_col_offset=24), For(Name('placeholder_12', Store(), lineno=23, col_offset=12, end_lineno=23, end_col_offset=17), Attribute(Name('self', Load(), lineno=23, col_offset=21, end_lineno=23, end_col_offset=25), 'placeholder_3', Load(), lineno=23, col_offset=21, end_lineno=23, end_col_offset=34), [For(Name('placeholder_13', Store(), lineno=24, col_offset=16, end_lineno=24, end_col_offset=26), Name('placeholder_12', Load(), lineno=24, col_offset=30, end_lineno=24, end_col_offset=35), [Expr(Yield(Name('placeholder_13', Load(), lineno=25, col_offset=22, end_lineno=25, end_col_offset=32), lineno=25, col_offset=16, end_lineno=25, end_col_offset=32), lineno=25, col_offset=16, end_lineno=25, end_col_offset=32)], [], lineno=24, col_offset=12, end_lineno=25, end_col_offset=32)], [], lineno=23, col_offset=8, end_lineno=25, end_col_offset=32)], [], lineno=21, col_offset=4, end_lineno=25, end_col_offset=32), FunctionDef('placeholder_14', arguments([], [arg('self', lineno=27, col_offset=12, end_lineno=27, end_col_offset=16)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(Call(Name('placeholder_0', Load(), lineno=28, col_offset=15, end_lineno=28, end_col_offset=19), [Attribute(Name('self', Load(), lineno=28, col_offset=20, end_lineno=28, end_col_offset=24), 'placeholder_2', Load(), lineno=28, col_offset=20, end_lineno=28, end_col_offset=30), ListComp(Call(Attribute(Name('placeholder_5', Load(), lineno=28, col_offset=33, end_lineno=28, end_col_offset=39), 'placeholder_14', Load(), lineno=28, col_offset=33, end_lineno=28, end_col_offset=43), [], [], lineno=28, col_offset=33, end_lineno=28, end_col_offset=45), [comprehension(Name('placeholder_5', Store(), lineno=28, col_offset=50, end_lineno=28, end_col_offset=56), Attribute(Name('self', Load(), lineno=28, col_offset=60, end_lineno=28, end_col_offset=64), 'placeholder_3', Load(), lineno=28, col_offset=60, end_lineno=28, end_col_offset=73), [], 0)], lineno=28, col_offset=32, end_lineno=28, end_col_offset=74)], [], lineno=28, col_offset=15, end_lineno=28, end_col_offset=75), lineno=28, col_offset=8, end_lineno=28, end_col_offset=75)], [], lineno=27, col_offset=4, end_lineno=28, end_col_offset=75), FunctionDef('placeholder_15', arguments([], [arg('self', lineno=30, col_offset=12, end_lineno=30, end_col_offset=16), arg('placeholder_9', lineno=30, col_offset=18, end_lineno=30, end_col_offset=23)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_16', Store(), lineno=31, col_offset=8, end_lineno=31, end_col_offset=12)], Call(Attribute(Name('self', Load(), lineno=31, col_offset=15, end_lineno=31, end_col_offset=19), 'placeholder_14', Load(), lineno=31, col_offset=15, end_lineno=31, end_col_offset=23), [], [], lineno=31, col_offset=15, end_lineno=31, end_col_offset=25), lineno=31, col_offset=8, end_lineno=31, end_col_offset=25), Expr(Call(Attribute(Attribute(Name('placeholder_16', Load(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=12), 'placeholder_3', Load(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=21), 'append', Load(), lineno=32, col_offset=8, end_lineno=32, end_col_offset=28), [Name('placeholder_9', Load(), lineno=32, col_offset=29, end_lineno=32, end_col_offset=34)], [], lineno=32, col_offset=8, end_lineno=32, end_col_offset=35), lineno=32, col_offset=8, end_lineno=32, end_col_offset=35), Return(Name('placeholder_16', Load(), lineno=33, col_offset=15, end_lineno=33, end_col_offset=19), lineno=33, col_offset=8, end_lineno=33, end_col_offset=19)], [], lineno=30, col_offset=4, end_lineno=33, end_col_offset=19), FunctionDef('placeholder_17', arguments([], [arg('self', lineno=35, col_offset=15, end_lineno=35, end_col_offset=19), arg('placeholder_18', lineno=35, col_offset=21, end_lineno=35, end_col_offset=25)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_16', Store(), lineno=36, col_offset=8, end_lineno=36, end_col_offset=12)], Call(Attribute(Name('self', Load(), lineno=36, col_offset=15, end_lineno=36, end_col_offset=19), 'placeholder_14', Load(), lineno=36, col_offset=15, end_lineno=36, end_col_offset=23), [], [], lineno=36, col_offset=15, end_lineno=36, end_col_offset=25), lineno=36, col_offset=8, end_lineno=36, end_col_offset=25), For(Name('placeholder_12', Store(), lineno=37, col_offset=12, end_lineno=37, end_col_offset=17), Call(Name('list', Load(), lineno=37, col_offset=21, end_lineno=37, end_col_offset=25), [Attribute(Name('placeholder_16', Load(), lineno=37, col_offset=26, end_lineno=37, end_col_offset=30), 'placeholder_3', Load(), lineno=37, col_offset=26, end_lineno=37, end_col_offset=39)], [], lineno=37, col_offset=21, end_lineno=37, end_col_offset=40), [Expr(Call(Attribute(Attribute(Name('placeholder_16', Load(), lineno=38, col_offset=12, end_lineno=38, end_col_offset=16), 'placeholder_3', Load(), lineno=38, col_offset=12, end_lineno=38, end_col_offset=25), 'placeholder_17', Load(), lineno=38, col_offset=12, end_lineno=38, end_col_offset=32), [Name('placeholder_12', Load(), lineno=38, col_offset=33, end_lineno=38, end_col_offset=38)], [], lineno=38, col_offset=12, end_lineno=38, end_col_offset=39), lineno=38, col_offset=12, end_lineno=38, end_col_offset=39), If(Compare(Attribute(Name('placeholder_12', Load(), lineno=39, col_offset=15, end_lineno=39, end_col_offset=20), 'placeholder_2', Load(), lineno=39, col_offset=15, end_lineno=39, end_col_offset=26), [Eq()], [Name('placeholder_18', Load(), lineno=39, col_offset=30, end_lineno=39, end_col_offset=34)], lineno=39, col_offset=15, end_lineno=39, end_col_offset=34), [Break(lineno=40, col_offset=16, end_lineno=40, end_col_offset=21)], [], lineno=39, col_offset=12, end_lineno=40, end_col_offset=21), Expr(Call(Attribute(Attribute(Name('placeholder_16', Load(), lineno=41, col_offset=12, end_lineno=41, end_col_offset=16), 'placeholder_3', Load(), lineno=41, col_offset=12, end_lineno=41, end_col_offset=25), 'append', Load(), lineno=41, col_offset=12, end_lineno=41, end_col_offset=32), [Call(Attribute(Name('placeholder_12', Load(), lineno=41, col_offset=33, end_lineno=41, end_col_offset=38), 'placeholder_17', Load(), lineno=41, col_offset=33, end_lineno=41, end_col_offset=45), [Name('placeholder_18', Load(), lineno=41, col_offset=46, end_lineno=41, end_col_offset=50)], [], lineno=41, col_offset=33, end_lineno=41, end_col_offset=51)], [], lineno=41, col_offset=12, end_lineno=41, end_col_offset=52), lineno=41, col_offset=12, end_lineno=41, end_col_offset=52)], [], lineno=37, col_offset=8, end_lineno=41, end_col_offset=52), Return(Name('placeholder_16', Load(), lineno=42, col_offset=15, end_lineno=42, end_col_offset=19), lineno=42, col_offset=8, end_lineno=42, end_col_offset=19)], [], lineno=35, col_offset=4, end_lineno=42, end_col_offset=19), FunctionDef('placeholder_19', arguments([], [arg('self', lineno=44, col_offset=17, end_lineno=44, end_col_offset=21), arg('placeholder_20', lineno=44, col_offset=23, end_lineno=44, end_col_offset=32)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_21', Store(), lineno=45, col_offset=8, end_lineno=45, end_col_offset=13)], List([Name('self', Load(), lineno=45, col_offset=17, end_lineno=45, end_col_offset=21)], Load(), lineno=45, col_offset=16, end_lineno=45, end_col_offset=22), lineno=45, col_offset=8, end_lineno=45, end_col_offset=22), Assign([Name('placeholder_22', Store(), lineno=46, col_offset=8, end_lineno=46, end_col_offset=15)], Call(Name('set', Load(), lineno=46, col_offset=18, end_lineno=46, end_col_offset=21), [], [], lineno=46, col_offset=18, end_lineno=46, end_col_offset=23), lineno=46, col_offset=8, end_lineno=46, end_col_offset=23), While(Name('placeholder_21', Load(), lineno=48, col_offset=14, end_lineno=48, end_col_offset=19), [Assign([Name('placeholder_16', Store(), lineno=49, col_offset=12, end_lineno=49, end_col_offset=16)], Call(Attribute(Name('placeholder_21', Load(), lineno=49, col_offset=19, end_lineno=49, end_col_offset=24), 'pop', Load(), lineno=49, col_offset=19, end_lineno=49, end_col_offset=28), [Constant(0, lineno=49, col_offset=29, end_lineno=49, end_col_offset=30)], [], lineno=49, col_offset=19, end_lineno=49, end_col_offset=31), lineno=49, col_offset=12, end_lineno=49, end_col_offset=31), If(Compare(Attribute(Name('placeholder_16', Load(), lineno=50, col_offset=15, end_lineno=50, end_col_offset=19), 'placeholder_2', Load(), lineno=50, col_offset=15, end_lineno=50, end_col_offset=25), [In()], [Name('placeholder_22', Load(), lineno=50, col_offset=29, end_lineno=50, end_col_offset=36)], lineno=50, col_offset=15, end_lineno=50, end_col_offset=36), [Continue(lineno=51, col_offset=16, end_lineno=51, end_col_offset=24)], [], lineno=50, col_offset=12, end_lineno=51, end_col_offset=24), Expr(Call(Attribute(Name('placeholder_22', Load(), lineno=53, col_offset=12, end_lineno=53, end_col_offset=19), 'placeholder_15', Load(), lineno=53, col_offset=12, end_lineno=53, end_col_offset=23), [Attribute(Name('placeholder_16', Load(), lineno=53, col_offset=24, end_lineno=53, end_col_offset=28), 'placeholder_2', Load(), lineno=53, col_offset=24, end_lineno=53, end_col_offset=34)], [], lineno=53, col_offset=12, end_lineno=53, end_col_offset=35), lineno=53, col_offset=12, end_lineno=53, end_col_offset=35), If(Compare(Name('placeholder_20', Load(), lineno=54, col_offset=15, end_lineno=54, end_col_offset=24), [Eq()], [Attribute(Name('placeholder_16', Load(), lineno=54, col_offset=28, end_lineno=54, end_col_offset=32), 'placeholder_2', Load(), lineno=54, col_offset=28, end_lineno=54, end_col_offset=38)], lineno=54, col_offset=15, end_lineno=54, end_col_offset=38), [Return(Name('placeholder_16', Load(), lineno=55, col_offset=23, end_lineno=55, end_col_offset=27), lineno=55, col_offset=16, end_lineno=55, end_col_offset=27)], [], lineno=54, col_offset=12, end_lineno=55, end_col_offset=27), For(Name('placeholder_12', Store(), lineno=57, col_offset=16, end_lineno=57, end_col_offset=21), Attribute(Name('placeholder_16', Load(), lineno=57, col_offset=25, end_lineno=57, end_col_offset=29), 'placeholder_3', Load(), lineno=57, col_offset=25, end_lineno=57, end_col_offset=38), [Expr(Call(Attribute(Name('placeholder_21', Load(), lineno=58, col_offset=16, end_lineno=58, end_col_offset=21), 'append', Load(), lineno=58, col_offset=16, end_lineno=58, end_col_offset=28), [Call(Attribute(Name('placeholder_12', Load(), lineno=58, col_offset=29, end_lineno=58, end_col_offset=34), 'placeholder_15', Load(), lineno=58, col_offset=29, end_lineno=58, end_col_offset=38), [Call(Attribute(Name('placeholder_16', Load(), lineno=58, col_offset=39, end_lineno=58, end_col_offset=43), 'placeholder_17', Load(), lineno=58, col_offset=39, end_lineno=58, end_col_offset=50), [Attribute(Name('placeholder_12', Load(), lineno=58, col_offset=51, end_lineno=58, end_col_offset=56), 'placeholder_2', Load(), lineno=58, col_offset=51, end_lineno=58, end_col_offset=62)], [], lineno=58, col_offset=39, end_lineno=58, end_col_offset=63)], [], lineno=58, col_offset=29, end_lineno=58, end_col_offset=64)], [], lineno=58, col_offset=16, end_lineno=58, end_col_offset=65), lineno=58, col_offset=16, end_lineno=58, end_col_offset=65)], [], lineno=57, col_offset=12, end_lineno=58, end_col_offset=65)], [], lineno=48, col_offset=8, end_lineno=58, end_col_offset=65), Raise(Call(Name('ValueError', Load(), lineno=60, col_offset=14, end_lineno=60, end_col_offset=24), [Constant('Tree could not be reoriented', lineno=60, col_offset=25, end_lineno=60, end_col_offset=55)], [], lineno=60, col_offset=14, end_lineno=60, end_col_offset=56), lineno=60, col_offset=8, end_lineno=60, end_col_offset=56)], [], lineno=44, col_offset=4, end_lineno=60, end_col_offset=56), FunctionDef('placeholder_23', arguments([], [arg('self', lineno=64, col_offset=16, end_lineno=64, end_col_offset=20), arg('placeholder_20', lineno=64, col_offset=22, end_lineno=64, end_col_offset=31), arg('placeholder_24', lineno=64, col_offset=33, end_lineno=64, end_col_offset=40)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_25', Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=17)], Call(Attribute(Name('self', Load(), lineno=65, col_offset=20, end_lineno=65, end_col_offset=24), 'placeholder_19', Load(), lineno=65, col_offset=20, end_lineno=65, end_col_offset=33), [Name('placeholder_20', Load(), lineno=65, col_offset=34, end_lineno=65, end_col_offset=43)], [], lineno=65, col_offset=20, end_lineno=65, end_col_offset=44), lineno=65, col_offset=8, end_lineno=65, end_col_offset=44), Assign([Name('placeholder_21', Store(), lineno=66, col_offset=8, end_lineno=66, end_col_offset=13)], Attribute(Name('placeholder_25', Load(), lineno=66, col_offset=16, end_lineno=66, end_col_offset=25), 'placeholder_3', Load(), lineno=66, col_offset=16, end_lineno=66, end_col_offset=34), lineno=66, col_offset=8, end_lineno=66, end_col_offset=34), Assign([Name('placeholder_26', Store(), lineno=67, col_offset=8, end_lineno=67, end_col_offset=12)], List([Name('placeholder_20', Load(), lineno=67, col_offset=16, end_lineno=67, end_col_offset=25)], Load(), lineno=67, col_offset=15, end_lineno=67, end_col_offset=26), lineno=67, col_offset=8, end_lineno=67, end_col_offset=26), While(Compare(Subscript(Name('placeholder_26', Load(), lineno=69, col_offset=14, end_lineno=69, end_col_offset=18), UnaryOp(USub(), Constant(1, lineno=69, col_offset=20, end_lineno=69, end_col_offset=21), lineno=69, col_offset=19, end_lineno=69, end_col_offset=21), Load(), lineno=69, col_offset=14, end_lineno=69, end_col_offset=22), [NotEq()], [Name('placeholder_24', Load(), lineno=69, col_offset=26, end_lineno=69, end_col_offset=33)], lineno=69, col_offset=14, end_lineno=69, end_col_offset=33), [Try([Assign([Name('placeholder_16', Store(), lineno=71, col_offset=16, end_lineno=71, end_col_offset=20)], Call(Attribute(Name('placeholder_21', Load(), lineno=71, col_offset=23, end_lineno=71, end_col_offset=28), 'pop', Load(), lineno=71, col_offset=23, end_lineno=71, end_col_offset=32), [], [], lineno=71, col_offset=23, end_lineno=71, end_col_offset=34), lineno=71, col_offset=16, end_lineno=71, end_col_offset=34)], [ExceptHandler(Name('IndexError', Load(), lineno=72, col_offset=19, end_lineno=72, end_col_offset=29), 'placeholder_27', [Raise(Call(Name('ValueError', Load(), lineno=73, col_offset=22, end_lineno=73, end_col_offset=32), [Constant('No path found', lineno=73, col_offset=33, end_lineno=73, end_col_offset=48)], [], lineno=73, col_offset=22, end_lineno=73, end_col_offset=49), Name('placeholder_27', Load(), lineno=73, col_offset=55, end_lineno=73, end_col_offset=60), lineno=73, col_offset=16, end_lineno=73, end_col_offset=60)], lineno=72, col_offset=12, end_lineno=73, end_col_offset=60)], [], [], lineno=70, col_offset=12, end_lineno=73, end_col_offset=60), If(Compare(Name('placeholder_24', Load(), lineno=74, col_offset=15, end_lineno=74, end_col_offset=22), [In()], [Name('placeholder_16', Load(), lineno=74, col_offset=26, end_lineno=74, end_col_offset=30)], lineno=74, col_offset=15, end_lineno=74, end_col_offset=30), [Expr(Call(Attribute(Name('placeholder_26', Load(), lineno=75, col_offset=16, end_lineno=75, end_col_offset=20), 'append', Load(), lineno=75, col_offset=16, end_lineno=75, end_col_offset=27), [Attribute(Name('placeholder_16', Load(), lineno=75, col_offset=28, end_lineno=75, end_col_offset=32), 'placeholder_2', Load(), lineno=75, col_offset=28, end_lineno=75, end_col_offset=38)], [], lineno=75, col_offset=16, end_lineno=75, end_col_offset=39), lineno=75, col_offset=16, end_lineno=75, end_col_offset=39), Assign([Name('placeholder_21', Store(), lineno=76, col_offset=16, end_lineno=76, end_col_offset=21)], Attribute(Name('placeholder_16', Load(), lineno=76, col_offset=24, end_lineno=76, end_col_offset=28), 'placeholder_3', Load(), lineno=76, col_offset=24, end_lineno=76, end_col_offset=37), lineno=76, col_offset=16, end_lineno=76, end_col_offset=37)], [], lineno=74, col_offset=12, end_lineno=76, end_col_offset=37)], [], lineno=69, col_offset=8, end_lineno=76, end_col_offset=37), Return(Name('placeholder_26', Load(), lineno=77, col_offset=15, end_lineno=77, end_col_offset=19), lineno=77, col_offset=8, end_lineno=77, end_col_offset=19)], [], lineno=64, col_offset=4, end_lineno=77, end_col_offset=19)], [], lineno=4, col_offset=0, end_lineno=77, end_col_offset=19)], []) \ No newline at end of file diff --git a/test/practice-pythagorean-triplet/representation.txt b/test/practice-pythagorean-triplet/representation.txt index 92937ef..f5db43f 100644 --- a/test/practice-pythagorean-triplet/representation.txt +++ b/test/practice-pythagorean-triplet/representation.txt @@ -1 +1 @@ -Module([ImportFrom('math', [alias('sqrt', lineno=1, col_offset=17, end_lineno=1, end_col_offset=21), alias('ceil', lineno=1, col_offset=23, end_lineno=1, end_col_offset=27), alias('gcd', lineno=1, col_offset=29, end_lineno=1, end_col_offset=32)], 0, lineno=1, col_offset=0, end_lineno=1, end_col_offset=32), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=4, col_offset=22, end_lineno=4, end_col_offset=27), arg('placeholder_2', lineno=4, col_offset=29, end_lineno=4, end_col_offset=32)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_3', Store(), lineno=5, col_offset=8, end_lineno=5, end_col_offset=13), Call(Name('range', Load(), lineno=5, col_offset=17, end_lineno=5, end_col_offset=22), [Constant(4, lineno=5, col_offset=23, end_lineno=5, end_col_offset=24), BinOp(Name('placeholder_2', Load(), lineno=5, col_offset=26, end_lineno=5, end_col_offset=29), Add(), Constant(1, lineno=5, col_offset=32, end_lineno=5, end_col_offset=33), lineno=5, col_offset=26, end_lineno=5, end_col_offset=33), Constant(4, lineno=5, col_offset=35, end_lineno=5, end_col_offset=36)], [], lineno=5, col_offset=17, end_lineno=5, end_col_offset=37), [For(Tuple([Name('placeholder_4', Store(), lineno=6, col_offset=12, end_lineno=6, end_col_offset=17), Name('placeholder_5', Store(), lineno=6, col_offset=19, end_lineno=6, end_col_offset=24), Name('placeholder_6', Store(), lineno=6, col_offset=26, end_lineno=6, end_col_offset=31)], Store(), lineno=6, col_offset=12, end_lineno=6, end_col_offset=31), Call(Name('primitive_triplets', Load(), lineno=6, col_offset=35, end_lineno=6, end_col_offset=53), [Name('placeholder_3', Load(), lineno=6, col_offset=54, end_lineno=6, end_col_offset=59)], [], lineno=6, col_offset=35, end_lineno=6, end_col_offset=60), [Assign([Name('placeholder_7', Store(), lineno=7, col_offset=12, end_lineno=7, end_col_offset=17)], Name('placeholder_4', Load(), lineno=7, col_offset=20, end_lineno=7, end_col_offset=25), lineno=7, col_offset=12, end_lineno=7, end_col_offset=25), Assign([Name('placeholder_8', Store(), lineno=8, col_offset=12, end_lineno=8, end_col_offset=16)], Name('placeholder_5', Load(), lineno=8, col_offset=19, end_lineno=8, end_col_offset=24), lineno=8, col_offset=12, end_lineno=8, end_col_offset=24), Assign([Name('placeholder_9', Store(), lineno=9, col_offset=12, end_lineno=9, end_col_offset=17)], Name('placeholder_6', Load(), lineno=9, col_offset=20, end_lineno=9, end_col_offset=25), lineno=9, col_offset=12, end_lineno=9, end_col_offset=25), While(Compare(Name('placeholder_7', Load(), lineno=11, col_offset=18, end_lineno=11, end_col_offset=23), [Lt()], [Name('placeholder_1', Load(), lineno=11, col_offset=26, end_lineno=11, end_col_offset=31)], lineno=11, col_offset=18, end_lineno=11, end_col_offset=31), [Assign([Name('placeholder_7', Store(), lineno=12, col_offset=16, end_lineno=12, end_col_offset=21)], BinOp(Name('placeholder_7', Load(), lineno=12, col_offset=24, end_lineno=12, end_col_offset=29), Add(), Name('placeholder_4', Load(), lineno=12, col_offset=32, end_lineno=12, end_col_offset=37), lineno=12, col_offset=24, end_lineno=12, end_col_offset=37), lineno=12, col_offset=16, end_lineno=12, end_col_offset=37), Assign([Name('placeholder_8', Store(), lineno=13, col_offset=16, end_lineno=13, end_col_offset=20)], BinOp(Name('placeholder_8', Load(), lineno=13, col_offset=23, end_lineno=13, end_col_offset=27), Add(), Name('placeholder_5', Load(), lineno=13, col_offset=30, end_lineno=13, end_col_offset=35), lineno=13, col_offset=23, end_lineno=13, end_col_offset=35), lineno=13, col_offset=16, end_lineno=13, end_col_offset=35), Assign([Name('placeholder_9', Store(), lineno=14, col_offset=16, end_lineno=14, end_col_offset=21)], BinOp(Name('placeholder_9', Load(), lineno=14, col_offset=24, end_lineno=14, end_col_offset=29), Add(), Name('placeholder_6', Load(), lineno=14, col_offset=32, end_lineno=14, end_col_offset=37), lineno=14, col_offset=24, end_lineno=14, end_col_offset=37), lineno=14, col_offset=16, end_lineno=14, end_col_offset=37)], [], lineno=11, col_offset=12, end_lineno=14, end_col_offset=37), While(Compare(Name('placeholder_9', Load(), lineno=16, col_offset=18, end_lineno=16, end_col_offset=23), [LtE()], [Name('placeholder_2', Load(), lineno=16, col_offset=27, end_lineno=16, end_col_offset=30)], lineno=16, col_offset=18, end_lineno=16, end_col_offset=30), [Expr(Yield(List([Name('alpha', Load(), lineno=17, col_offset=23, end_lineno=17, end_col_offset=28), Name('beta', Load(), lineno=17, col_offset=30, end_lineno=17, end_col_offset=34), Name('gamma', Load(), lineno=17, col_offset=36, end_lineno=17, end_col_offset=41)], Load(), lineno=17, col_offset=22, end_lineno=17, end_col_offset=42), lineno=17, col_offset=16, end_lineno=17, end_col_offset=42), lineno=17, col_offset=16, end_lineno=17, end_col_offset=42), Assign([Name('placeholder_7', Store(), lineno=19, col_offset=16, end_lineno=19, end_col_offset=21)], BinOp(Name('placeholder_7', Load(), lineno=19, col_offset=24, end_lineno=19, end_col_offset=29), Add(), Name('placeholder_4', Load(), lineno=19, col_offset=32, end_lineno=19, end_col_offset=37), lineno=19, col_offset=24, end_lineno=19, end_col_offset=37), lineno=19, col_offset=16, end_lineno=19, end_col_offset=37), Assign([Name('placeholder_8', Store(), lineno=20, col_offset=16, end_lineno=20, end_col_offset=20)], BinOp(Name('placeholder_8', Load(), lineno=20, col_offset=23, end_lineno=20, end_col_offset=27), Add(), Name('placeholder_5', Load(), lineno=20, col_offset=30, end_lineno=20, end_col_offset=35), lineno=20, col_offset=23, end_lineno=20, end_col_offset=35), lineno=20, col_offset=16, end_lineno=20, end_col_offset=35), Assign([Name('placeholder_9', Store(), lineno=21, col_offset=16, end_lineno=21, end_col_offset=21)], BinOp(Name('placeholder_9', Load(), lineno=21, col_offset=24, end_lineno=21, end_col_offset=29), Add(), Name('placeholder_6', Load(), lineno=21, col_offset=32, end_lineno=21, end_col_offset=37), lineno=21, col_offset=24, end_lineno=21, end_col_offset=37), lineno=21, col_offset=16, end_lineno=21, end_col_offset=37)], [], lineno=16, col_offset=12, end_lineno=21, end_col_offset=37)], [], lineno=6, col_offset=8, end_lineno=21, end_col_offset=37)], [], lineno=5, col_offset=4, end_lineno=21, end_col_offset=37)], [], lineno=4, col_offset=0, end_lineno=21, end_col_offset=37), FunctionDef('placeholder_10', arguments([], [arg('placeholder_3', lineno=24, col_offset=23, end_lineno=24, end_col_offset=28)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_11', Store(), lineno=25, col_offset=4, end_lineno=25, end_col_offset=8)], BinOp(Name('placeholder_3', Load(), lineno=25, col_offset=11, end_lineno=25, end_col_offset=16), FloorDiv(), Constant(2, lineno=25, col_offset=20, end_lineno=25, end_col_offset=21), lineno=25, col_offset=11, end_lineno=25, end_col_offset=21), lineno=25, col_offset=4, end_lineno=25, end_col_offset=21), For(Name('placeholder_12', Store(), lineno=26, col_offset=8, end_lineno=26, end_col_offset=11), Call(Name('range', Load(), lineno=26, col_offset=15, end_lineno=26, end_col_offset=20), [Constant(1, lineno=26, col_offset=21, end_lineno=26, end_col_offset=22), Call(Name('int', Load(), lineno=26, col_offset=24, end_lineno=26, end_col_offset=27), [Call(Name('ceil', Load(), lineno=26, col_offset=28, end_lineno=26, end_col_offset=32), [Call(Name('sqrt', Load(), lineno=26, col_offset=33, end_lineno=26, end_col_offset=37), [Name('placeholder_11', Load(), lineno=26, col_offset=38, end_lineno=26, end_col_offset=42)], [], lineno=26, col_offset=33, end_lineno=26, end_col_offset=43)], [], lineno=26, col_offset=28, end_lineno=26, end_col_offset=44)], [], lineno=26, col_offset=24, end_lineno=26, end_col_offset=45)], [], lineno=26, col_offset=15, end_lineno=26, end_col_offset=46), [If(Compare(BinOp(Name('placeholder_11', Load(), lineno=27, col_offset=11, end_lineno=27, end_col_offset=15), Mod(), Name('placeholder_12', Load(), lineno=27, col_offset=18, end_lineno=27, end_col_offset=21), lineno=27, col_offset=11, end_lineno=27, end_col_offset=21), [Eq()], [Constant(0, lineno=27, col_offset=25, end_lineno=27, end_col_offset=26)], lineno=27, col_offset=11, end_lineno=27, end_col_offset=26), [Assign([Name('placeholder_13', Store(), lineno=28, col_offset=12, end_lineno=28, end_col_offset=18)], BinOp(Name('placeholder_11', Load(), lineno=28, col_offset=21, end_lineno=28, end_col_offset=25), FloorDiv(), Name('placeholder_12', Load(), lineno=28, col_offset=29, end_lineno=28, end_col_offset=32), lineno=28, col_offset=21, end_lineno=28, end_col_offset=32), lineno=28, col_offset=12, end_lineno=28, end_col_offset=32), If(BoolOp(And(), [Compare(BinOp(BinOp(Name('placeholder_13', Load(), lineno=29, col_offset=16, end_lineno=29, end_col_offset=22), Sub(), Name('placeholder_12', Load(), lineno=29, col_offset=25, end_lineno=29, end_col_offset=28), lineno=29, col_offset=16, end_lineno=29, end_col_offset=28), Mod(), Constant(2, lineno=29, col_offset=32, end_lineno=29, end_col_offset=33), lineno=29, col_offset=15, end_lineno=29, end_col_offset=33), [Eq()], [Constant(1, lineno=29, col_offset=37, end_lineno=29, end_col_offset=38)], lineno=29, col_offset=15, end_lineno=29, end_col_offset=38), Compare(Call(Name('gcd', Load(), lineno=29, col_offset=43, end_lineno=29, end_col_offset=46), [Name('placeholder_13', Load(), lineno=29, col_offset=47, end_lineno=29, end_col_offset=53), Name('placeholder_12', Load(), lineno=29, col_offset=55, end_lineno=29, end_col_offset=58)], [], lineno=29, col_offset=43, end_lineno=29, end_col_offset=59), [Eq()], [Constant(1, lineno=29, col_offset=63, end_lineno=29, end_col_offset=64)], lineno=29, col_offset=43, end_lineno=29, end_col_offset=64)], lineno=29, col_offset=15, end_lineno=29, end_col_offset=64), [Expr(Yield(Tuple([Name('member', Load(), lineno=30, col_offset=22, end_lineno=30, end_col_offset=28), Name('idx', Load(), lineno=30, col_offset=30, end_lineno=30, end_col_offset=33)], Load(), lineno=30, col_offset=22, end_lineno=30, end_col_offset=33), lineno=30, col_offset=16, end_lineno=30, end_col_offset=33), lineno=30, col_offset=16, end_lineno=30, end_col_offset=33)], [], lineno=29, col_offset=12, end_lineno=30, end_col_offset=33)], [], lineno=27, col_offset=8, end_lineno=30, end_col_offset=33)], [], lineno=26, col_offset=4, end_lineno=30, end_col_offset=33)], [], lineno=24, col_offset=0, end_lineno=30, end_col_offset=33), FunctionDef('placeholder_14', arguments([], [arg('placeholder_3', lineno=33, col_offset=23, end_lineno=33, end_col_offset=28)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Tuple([Name('placeholder_15', Store(), lineno=38, col_offset=8, end_lineno=38, end_col_offset=16), Name('placeholder_16', Store(), lineno=38, col_offset=18, end_lineno=38, end_col_offset=26)], Store(), lineno=38, col_offset=8, end_lineno=38, end_col_offset=26), Call(Name('placeholder_10', Load(), lineno=38, col_offset=30, end_lineno=38, end_col_offset=48), [Name('placeholder_3', Load(), lineno=38, col_offset=49, end_lineno=38, end_col_offset=54)], [], lineno=38, col_offset=30, end_lineno=38, end_col_offset=55), [Assign([Name('placeholder_17', Store(), lineno=39, col_offset=8, end_lineno=39, end_col_offset=14)], BinOp(Name('placeholder_15', Load(), lineno=39, col_offset=17, end_lineno=39, end_col_offset=25), Pow(), Constant(2, lineno=39, col_offset=29, end_lineno=39, end_col_offset=30), lineno=39, col_offset=17, end_lineno=39, end_col_offset=30), lineno=39, col_offset=8, end_lineno=39, end_col_offset=30), Assign([Name('placeholder_18', Store(), lineno=40, col_offset=8, end_lineno=40, end_col_offset=14)], BinOp(Name('placeholder_16', Load(), lineno=40, col_offset=17, end_lineno=40, end_col_offset=25), Pow(), Constant(2, lineno=40, col_offset=29, end_lineno=40, end_col_offset=30), lineno=40, col_offset=17, end_lineno=40, end_col_offset=30), lineno=40, col_offset=8, end_lineno=40, end_col_offset=30), Assign([Name('placeholder_7', Store(), lineno=42, col_offset=8, end_lineno=42, end_col_offset=13)], BinOp(Name('placeholder_17', Load(), lineno=42, col_offset=16, end_lineno=42, end_col_offset=22), Sub(), Name('placeholder_18', Load(), lineno=42, col_offset=25, end_lineno=42, end_col_offset=31), lineno=42, col_offset=16, end_lineno=42, end_col_offset=31), lineno=42, col_offset=8, end_lineno=42, end_col_offset=31), Assign([Name('placeholder_8', Store(), lineno=43, col_offset=8, end_lineno=43, end_col_offset=12)], BinOp(BinOp(Constant(2, lineno=43, col_offset=15, end_lineno=43, end_col_offset=16), Mult(), Name('placeholder_15', Load(), lineno=43, col_offset=19, end_lineno=43, end_col_offset=27), lineno=43, col_offset=15, end_lineno=43, end_col_offset=27), Mult(), Name('placeholder_16', Load(), lineno=43, col_offset=30, end_lineno=43, end_col_offset=38), lineno=43, col_offset=15, end_lineno=43, end_col_offset=38), lineno=43, col_offset=8, end_lineno=43, end_col_offset=38), Assign([Name('placeholder_9', Store(), lineno=44, col_offset=8, end_lineno=44, end_col_offset=13)], BinOp(Name('placeholder_17', Load(), lineno=44, col_offset=16, end_lineno=44, end_col_offset=22), Add(), Name('placeholder_18', Load(), lineno=44, col_offset=25, end_lineno=44, end_col_offset=31), lineno=44, col_offset=16, end_lineno=44, end_col_offset=31), lineno=44, col_offset=8, end_lineno=44, end_col_offset=31), If(Compare(Name('placeholder_7', Load(), lineno=46, col_offset=11, end_lineno=46, end_col_offset=16), [Gt()], [Name('placeholder_8', Load(), lineno=46, col_offset=19, end_lineno=46, end_col_offset=23)], lineno=46, col_offset=11, end_lineno=46, end_col_offset=23), [Assign([Tuple([Name('placeholder_7', Store(), lineno=47, col_offset=12, end_lineno=47, end_col_offset=17), Name('placeholder_8', Store(), lineno=47, col_offset=19, end_lineno=47, end_col_offset=23)], Store(), lineno=47, col_offset=12, end_lineno=47, end_col_offset=23)], Tuple([Name('placeholder_8', Load(), lineno=47, col_offset=26, end_lineno=47, end_col_offset=30), Name('placeholder_7', Load(), lineno=47, col_offset=32, end_lineno=47, end_col_offset=37)], Load(), lineno=47, col_offset=26, end_lineno=47, end_col_offset=37), lineno=47, col_offset=12, end_lineno=47, end_col_offset=37)], [], lineno=46, col_offset=8, end_lineno=47, end_col_offset=37), Expr(Yield(Tuple([Name('alpha', Load(), lineno=49, col_offset=14, end_lineno=49, end_col_offset=19), Name('beta', Load(), lineno=49, col_offset=21, end_lineno=49, end_col_offset=25), Name('gamma', Load(), lineno=49, col_offset=27, end_lineno=49, end_col_offset=32)], Load(), lineno=49, col_offset=14, end_lineno=49, end_col_offset=32), lineno=49, col_offset=8, end_lineno=49, end_col_offset=32), lineno=49, col_offset=8, end_lineno=49, end_col_offset=32)], [], lineno=38, col_offset=4, end_lineno=49, end_col_offset=32)], [], lineno=33, col_offset=0, end_lineno=49, end_col_offset=32), FunctionDef('placeholder_19', arguments([], [arg('placeholder_20', lineno=52, col_offset=22, end_lineno=52, end_col_offset=28)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(ListComp(Name('placeholder_21', Load(), lineno=54, col_offset=8, end_lineno=54, end_col_offset=15), [comprehension(Name('placeholder_21', Store(), lineno=54, col_offset=20, end_lineno=54, end_col_offset=27), Call(Name('placeholder_0', Load(), lineno=55, col_offset=11, end_lineno=55, end_col_offset=28), [Constant(1, lineno=55, col_offset=29, end_lineno=55, end_col_offset=30), BinOp(Name('placeholder_20', Load(), lineno=55, col_offset=32, end_lineno=55, end_col_offset=38), FloorDiv(), Constant(2, lineno=55, col_offset=42, end_lineno=55, end_col_offset=43), lineno=55, col_offset=32, end_lineno=55, end_col_offset=43)], [], lineno=55, col_offset=11, end_lineno=55, end_col_offset=44), [Compare(Call(Name('sum', Load(), lineno=56, col_offset=11, end_lineno=56, end_col_offset=14), [Name('placeholder_21', Load(), lineno=56, col_offset=15, end_lineno=56, end_col_offset=22)], [], lineno=56, col_offset=11, end_lineno=56, end_col_offset=23), [Eq()], [Name('placeholder_20', Load(), lineno=56, col_offset=27, end_lineno=56, end_col_offset=33)], lineno=56, col_offset=11, end_lineno=56, end_col_offset=33)], 0)], lineno=53, col_offset=11, end_lineno=57, end_col_offset=9), lineno=53, col_offset=4, end_lineno=57, end_col_offset=9)], [], lineno=52, col_offset=0, end_lineno=57, end_col_offset=9)], []) \ No newline at end of file +Module([ImportFrom('math', [alias('sqrt', lineno=1, col_offset=17, end_lineno=1, end_col_offset=21), alias('ceil', lineno=1, col_offset=23, end_lineno=1, end_col_offset=27), alias('gcd', lineno=1, col_offset=29, end_lineno=1, end_col_offset=32)], 0, lineno=1, col_offset=0, end_lineno=1, end_col_offset=32), FunctionDef('placeholder_0', arguments([], [arg('placeholder_1', lineno=4, col_offset=22, end_lineno=4, end_col_offset=27), arg('placeholder_2', lineno=4, col_offset=29, end_lineno=4, end_col_offset=32)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_3', Store(), lineno=5, col_offset=8, end_lineno=5, end_col_offset=13), Call(Name('range', Load(), lineno=5, col_offset=17, end_lineno=5, end_col_offset=22), [Constant(4, lineno=5, col_offset=23, end_lineno=5, end_col_offset=24), BinOp(Name('placeholder_2', Load(), lineno=5, col_offset=26, end_lineno=5, end_col_offset=29), Add(), Constant(1, lineno=5, col_offset=32, end_lineno=5, end_col_offset=33), lineno=5, col_offset=26, end_lineno=5, end_col_offset=33), Constant(4, lineno=5, col_offset=35, end_lineno=5, end_col_offset=36)], [], lineno=5, col_offset=17, end_lineno=5, end_col_offset=37), [For(Tuple([Name('placeholder_4', Store(), lineno=6, col_offset=12, end_lineno=6, end_col_offset=17), Name('placeholder_5', Store(), lineno=6, col_offset=19, end_lineno=6, end_col_offset=24), Name('placeholder_6', Store(), lineno=6, col_offset=26, end_lineno=6, end_col_offset=31)], Store(), lineno=6, col_offset=12, end_lineno=6, end_col_offset=31), Call(Name('primitive_triplets', Load(), lineno=6, col_offset=35, end_lineno=6, end_col_offset=53), [Name('placeholder_3', Load(), lineno=6, col_offset=54, end_lineno=6, end_col_offset=59)], [], lineno=6, col_offset=35, end_lineno=6, end_col_offset=60), [Assign([Name('placeholder_7', Store(), lineno=7, col_offset=12, end_lineno=7, end_col_offset=17)], Name('placeholder_4', Load(), lineno=7, col_offset=20, end_lineno=7, end_col_offset=25), lineno=7, col_offset=12, end_lineno=7, end_col_offset=25), Assign([Name('placeholder_8', Store(), lineno=8, col_offset=12, end_lineno=8, end_col_offset=16)], Name('placeholder_5', Load(), lineno=8, col_offset=19, end_lineno=8, end_col_offset=24), lineno=8, col_offset=12, end_lineno=8, end_col_offset=24), Assign([Name('placeholder_9', Store(), lineno=9, col_offset=12, end_lineno=9, end_col_offset=17)], Name('placeholder_6', Load(), lineno=9, col_offset=20, end_lineno=9, end_col_offset=25), lineno=9, col_offset=12, end_lineno=9, end_col_offset=25), While(Compare(Name('placeholder_7', Load(), lineno=11, col_offset=18, end_lineno=11, end_col_offset=23), [Lt()], [Name('placeholder_1', Load(), lineno=11, col_offset=26, end_lineno=11, end_col_offset=31)], lineno=11, col_offset=18, end_lineno=11, end_col_offset=31), [Assign([Name('placeholder_7', Store(), lineno=12, col_offset=16, end_lineno=12, end_col_offset=21)], BinOp(Name('placeholder_7', Load(), lineno=12, col_offset=24, end_lineno=12, end_col_offset=29), Add(), Name('placeholder_4', Load(), lineno=12, col_offset=32, end_lineno=12, end_col_offset=37), lineno=12, col_offset=24, end_lineno=12, end_col_offset=37), lineno=12, col_offset=16, end_lineno=12, end_col_offset=37), Assign([Name('placeholder_8', Store(), lineno=13, col_offset=16, end_lineno=13, end_col_offset=20)], BinOp(Name('placeholder_8', Load(), lineno=13, col_offset=23, end_lineno=13, end_col_offset=27), Add(), Name('placeholder_5', Load(), lineno=13, col_offset=30, end_lineno=13, end_col_offset=35), lineno=13, col_offset=23, end_lineno=13, end_col_offset=35), lineno=13, col_offset=16, end_lineno=13, end_col_offset=35), Assign([Name('placeholder_9', Store(), lineno=14, col_offset=16, end_lineno=14, end_col_offset=21)], BinOp(Name('placeholder_9', Load(), lineno=14, col_offset=24, end_lineno=14, end_col_offset=29), Add(), Name('placeholder_6', Load(), lineno=14, col_offset=32, end_lineno=14, end_col_offset=37), lineno=14, col_offset=24, end_lineno=14, end_col_offset=37), lineno=14, col_offset=16, end_lineno=14, end_col_offset=37)], [], lineno=11, col_offset=12, end_lineno=14, end_col_offset=37), While(Compare(Name('placeholder_9', Load(), lineno=16, col_offset=18, end_lineno=16, end_col_offset=23), [LtE()], [Name('placeholder_2', Load(), lineno=16, col_offset=27, end_lineno=16, end_col_offset=30)], lineno=16, col_offset=18, end_lineno=16, end_col_offset=30), [Expr(Yield(List([Name('placeholder_7', Load(), lineno=17, col_offset=23, end_lineno=17, end_col_offset=28), Name('placeholder_8', Load(), lineno=17, col_offset=30, end_lineno=17, end_col_offset=34), Name('placeholder_9', Load(), lineno=17, col_offset=36, end_lineno=17, end_col_offset=41)], Load(), lineno=17, col_offset=22, end_lineno=17, end_col_offset=42), lineno=17, col_offset=16, end_lineno=17, end_col_offset=42), lineno=17, col_offset=16, end_lineno=17, end_col_offset=42), Assign([Name('placeholder_7', Store(), lineno=19, col_offset=16, end_lineno=19, end_col_offset=21)], BinOp(Name('placeholder_7', Load(), lineno=19, col_offset=24, end_lineno=19, end_col_offset=29), Add(), Name('placeholder_4', Load(), lineno=19, col_offset=32, end_lineno=19, end_col_offset=37), lineno=19, col_offset=24, end_lineno=19, end_col_offset=37), lineno=19, col_offset=16, end_lineno=19, end_col_offset=37), Assign([Name('placeholder_8', Store(), lineno=20, col_offset=16, end_lineno=20, end_col_offset=20)], BinOp(Name('placeholder_8', Load(), lineno=20, col_offset=23, end_lineno=20, end_col_offset=27), Add(), Name('placeholder_5', Load(), lineno=20, col_offset=30, end_lineno=20, end_col_offset=35), lineno=20, col_offset=23, end_lineno=20, end_col_offset=35), lineno=20, col_offset=16, end_lineno=20, end_col_offset=35), Assign([Name('placeholder_9', Store(), lineno=21, col_offset=16, end_lineno=21, end_col_offset=21)], BinOp(Name('placeholder_9', Load(), lineno=21, col_offset=24, end_lineno=21, end_col_offset=29), Add(), Name('placeholder_6', Load(), lineno=21, col_offset=32, end_lineno=21, end_col_offset=37), lineno=21, col_offset=24, end_lineno=21, end_col_offset=37), lineno=21, col_offset=16, end_lineno=21, end_col_offset=37)], [], lineno=16, col_offset=12, end_lineno=21, end_col_offset=37)], [], lineno=6, col_offset=8, end_lineno=21, end_col_offset=37)], [], lineno=5, col_offset=4, end_lineno=21, end_col_offset=37)], [], lineno=4, col_offset=0, end_lineno=21, end_col_offset=37), FunctionDef('placeholder_10', arguments([], [arg('placeholder_3', lineno=24, col_offset=23, end_lineno=24, end_col_offset=28)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_11', Store(), lineno=25, col_offset=4, end_lineno=25, end_col_offset=8)], BinOp(Name('placeholder_3', Load(), lineno=25, col_offset=11, end_lineno=25, end_col_offset=16), FloorDiv(), Constant(2, lineno=25, col_offset=20, end_lineno=25, end_col_offset=21), lineno=25, col_offset=11, end_lineno=25, end_col_offset=21), lineno=25, col_offset=4, end_lineno=25, end_col_offset=21), For(Name('placeholder_12', Store(), lineno=26, col_offset=8, end_lineno=26, end_col_offset=11), Call(Name('range', Load(), lineno=26, col_offset=15, end_lineno=26, end_col_offset=20), [Constant(1, lineno=26, col_offset=21, end_lineno=26, end_col_offset=22), Call(Name('int', Load(), lineno=26, col_offset=24, end_lineno=26, end_col_offset=27), [Call(Name('ceil', Load(), lineno=26, col_offset=28, end_lineno=26, end_col_offset=32), [Call(Name('sqrt', Load(), lineno=26, col_offset=33, end_lineno=26, end_col_offset=37), [Name('placeholder_11', Load(), lineno=26, col_offset=38, end_lineno=26, end_col_offset=42)], [], lineno=26, col_offset=33, end_lineno=26, end_col_offset=43)], [], lineno=26, col_offset=28, end_lineno=26, end_col_offset=44)], [], lineno=26, col_offset=24, end_lineno=26, end_col_offset=45)], [], lineno=26, col_offset=15, end_lineno=26, end_col_offset=46), [If(Compare(BinOp(Name('placeholder_11', Load(), lineno=27, col_offset=11, end_lineno=27, end_col_offset=15), Mod(), Name('placeholder_12', Load(), lineno=27, col_offset=18, end_lineno=27, end_col_offset=21), lineno=27, col_offset=11, end_lineno=27, end_col_offset=21), [Eq()], [Constant(0, lineno=27, col_offset=25, end_lineno=27, end_col_offset=26)], lineno=27, col_offset=11, end_lineno=27, end_col_offset=26), [Assign([Name('placeholder_13', Store(), lineno=28, col_offset=12, end_lineno=28, end_col_offset=18)], BinOp(Name('placeholder_11', Load(), lineno=28, col_offset=21, end_lineno=28, end_col_offset=25), FloorDiv(), Name('placeholder_12', Load(), lineno=28, col_offset=29, end_lineno=28, end_col_offset=32), lineno=28, col_offset=21, end_lineno=28, end_col_offset=32), lineno=28, col_offset=12, end_lineno=28, end_col_offset=32), If(BoolOp(And(), [Compare(BinOp(BinOp(Name('placeholder_13', Load(), lineno=29, col_offset=16, end_lineno=29, end_col_offset=22), Sub(), Name('placeholder_12', Load(), lineno=29, col_offset=25, end_lineno=29, end_col_offset=28), lineno=29, col_offset=16, end_lineno=29, end_col_offset=28), Mod(), Constant(2, lineno=29, col_offset=32, end_lineno=29, end_col_offset=33), lineno=29, col_offset=15, end_lineno=29, end_col_offset=33), [Eq()], [Constant(1, lineno=29, col_offset=37, end_lineno=29, end_col_offset=38)], lineno=29, col_offset=15, end_lineno=29, end_col_offset=38), Compare(Call(Name('gcd', Load(), lineno=29, col_offset=43, end_lineno=29, end_col_offset=46), [Name('placeholder_13', Load(), lineno=29, col_offset=47, end_lineno=29, end_col_offset=53), Name('placeholder_12', Load(), lineno=29, col_offset=55, end_lineno=29, end_col_offset=58)], [], lineno=29, col_offset=43, end_lineno=29, end_col_offset=59), [Eq()], [Constant(1, lineno=29, col_offset=63, end_lineno=29, end_col_offset=64)], lineno=29, col_offset=43, end_lineno=29, end_col_offset=64)], lineno=29, col_offset=15, end_lineno=29, end_col_offset=64), [Expr(Yield(Tuple([Name('placeholder_13', Load(), lineno=30, col_offset=22, end_lineno=30, end_col_offset=28), Name('placeholder_12', Load(), lineno=30, col_offset=30, end_lineno=30, end_col_offset=33)], Load(), lineno=30, col_offset=22, end_lineno=30, end_col_offset=33), lineno=30, col_offset=16, end_lineno=30, end_col_offset=33), lineno=30, col_offset=16, end_lineno=30, end_col_offset=33)], [], lineno=29, col_offset=12, end_lineno=30, end_col_offset=33)], [], lineno=27, col_offset=8, end_lineno=30, end_col_offset=33)], [], lineno=26, col_offset=4, end_lineno=30, end_col_offset=33)], [], lineno=24, col_offset=0, end_lineno=30, end_col_offset=33), FunctionDef('placeholder_14', arguments([], [arg('placeholder_3', lineno=33, col_offset=23, end_lineno=33, end_col_offset=28)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Tuple([Name('placeholder_15', Store(), lineno=38, col_offset=8, end_lineno=38, end_col_offset=16), Name('placeholder_16', Store(), lineno=38, col_offset=18, end_lineno=38, end_col_offset=26)], Store(), lineno=38, col_offset=8, end_lineno=38, end_col_offset=26), Call(Name('placeholder_10', Load(), lineno=38, col_offset=30, end_lineno=38, end_col_offset=48), [Name('placeholder_3', Load(), lineno=38, col_offset=49, end_lineno=38, end_col_offset=54)], [], lineno=38, col_offset=30, end_lineno=38, end_col_offset=55), [Assign([Name('placeholder_17', Store(), lineno=39, col_offset=8, end_lineno=39, end_col_offset=14)], BinOp(Name('placeholder_15', Load(), lineno=39, col_offset=17, end_lineno=39, end_col_offset=25), Pow(), Constant(2, lineno=39, col_offset=29, end_lineno=39, end_col_offset=30), lineno=39, col_offset=17, end_lineno=39, end_col_offset=30), lineno=39, col_offset=8, end_lineno=39, end_col_offset=30), Assign([Name('placeholder_18', Store(), lineno=40, col_offset=8, end_lineno=40, end_col_offset=14)], BinOp(Name('placeholder_16', Load(), lineno=40, col_offset=17, end_lineno=40, end_col_offset=25), Pow(), Constant(2, lineno=40, col_offset=29, end_lineno=40, end_col_offset=30), lineno=40, col_offset=17, end_lineno=40, end_col_offset=30), lineno=40, col_offset=8, end_lineno=40, end_col_offset=30), Assign([Name('placeholder_7', Store(), lineno=42, col_offset=8, end_lineno=42, end_col_offset=13)], BinOp(Name('placeholder_17', Load(), lineno=42, col_offset=16, end_lineno=42, end_col_offset=22), Sub(), Name('placeholder_18', Load(), lineno=42, col_offset=25, end_lineno=42, end_col_offset=31), lineno=42, col_offset=16, end_lineno=42, end_col_offset=31), lineno=42, col_offset=8, end_lineno=42, end_col_offset=31), Assign([Name('placeholder_8', Store(), lineno=43, col_offset=8, end_lineno=43, end_col_offset=12)], BinOp(BinOp(Constant(2, lineno=43, col_offset=15, end_lineno=43, end_col_offset=16), Mult(), Name('placeholder_15', Load(), lineno=43, col_offset=19, end_lineno=43, end_col_offset=27), lineno=43, col_offset=15, end_lineno=43, end_col_offset=27), Mult(), Name('placeholder_16', Load(), lineno=43, col_offset=30, end_lineno=43, end_col_offset=38), lineno=43, col_offset=15, end_lineno=43, end_col_offset=38), lineno=43, col_offset=8, end_lineno=43, end_col_offset=38), Assign([Name('placeholder_9', Store(), lineno=44, col_offset=8, end_lineno=44, end_col_offset=13)], BinOp(Name('placeholder_17', Load(), lineno=44, col_offset=16, end_lineno=44, end_col_offset=22), Add(), Name('placeholder_18', Load(), lineno=44, col_offset=25, end_lineno=44, end_col_offset=31), lineno=44, col_offset=16, end_lineno=44, end_col_offset=31), lineno=44, col_offset=8, end_lineno=44, end_col_offset=31), If(Compare(Name('placeholder_7', Load(), lineno=46, col_offset=11, end_lineno=46, end_col_offset=16), [Gt()], [Name('placeholder_8', Load(), lineno=46, col_offset=19, end_lineno=46, end_col_offset=23)], lineno=46, col_offset=11, end_lineno=46, end_col_offset=23), [Assign([Tuple([Name('placeholder_7', Store(), lineno=47, col_offset=12, end_lineno=47, end_col_offset=17), Name('placeholder_8', Store(), lineno=47, col_offset=19, end_lineno=47, end_col_offset=23)], Store(), lineno=47, col_offset=12, end_lineno=47, end_col_offset=23)], Tuple([Name('placeholder_8', Load(), lineno=47, col_offset=26, end_lineno=47, end_col_offset=30), Name('placeholder_7', Load(), lineno=47, col_offset=32, end_lineno=47, end_col_offset=37)], Load(), lineno=47, col_offset=26, end_lineno=47, end_col_offset=37), lineno=47, col_offset=12, end_lineno=47, end_col_offset=37)], [], lineno=46, col_offset=8, end_lineno=47, end_col_offset=37), Expr(Yield(Tuple([Name('placeholder_7', Load(), lineno=49, col_offset=14, end_lineno=49, end_col_offset=19), Name('placeholder_8', Load(), lineno=49, col_offset=21, end_lineno=49, end_col_offset=25), Name('placeholder_9', Load(), lineno=49, col_offset=27, end_lineno=49, end_col_offset=32)], Load(), lineno=49, col_offset=14, end_lineno=49, end_col_offset=32), lineno=49, col_offset=8, end_lineno=49, end_col_offset=32), lineno=49, col_offset=8, end_lineno=49, end_col_offset=32)], [], lineno=38, col_offset=4, end_lineno=49, end_col_offset=32)], [], lineno=33, col_offset=0, end_lineno=49, end_col_offset=32), FunctionDef('placeholder_19', arguments([], [arg('placeholder_20', lineno=52, col_offset=22, end_lineno=52, end_col_offset=28)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(ListComp(Name('placeholder_21', Load(), lineno=54, col_offset=8, end_lineno=54, end_col_offset=15), [comprehension(Name('placeholder_21', Store(), lineno=54, col_offset=20, end_lineno=54, end_col_offset=27), Call(Name('placeholder_0', Load(), lineno=55, col_offset=11, end_lineno=55, end_col_offset=28), [Constant(1, lineno=55, col_offset=29, end_lineno=55, end_col_offset=30), BinOp(Name('placeholder_20', Load(), lineno=55, col_offset=32, end_lineno=55, end_col_offset=38), FloorDiv(), Constant(2, lineno=55, col_offset=42, end_lineno=55, end_col_offset=43), lineno=55, col_offset=32, end_lineno=55, end_col_offset=43)], [], lineno=55, col_offset=11, end_lineno=55, end_col_offset=44), [Compare(Call(Name('sum', Load(), lineno=56, col_offset=11, end_lineno=56, end_col_offset=14), [Name('placeholder_21', Load(), lineno=56, col_offset=15, end_lineno=56, end_col_offset=22)], [], lineno=56, col_offset=11, end_lineno=56, end_col_offset=23), [Eq()], [Name('placeholder_20', Load(), lineno=56, col_offset=27, end_lineno=56, end_col_offset=33)], lineno=56, col_offset=11, end_lineno=56, end_col_offset=33)], 0)], lineno=53, col_offset=11, end_lineno=57, end_col_offset=9), lineno=53, col_offset=4, end_lineno=57, end_col_offset=9)], [], lineno=52, col_offset=0, end_lineno=57, end_col_offset=9)], []) \ No newline at end of file From e25dc4d5986c7aed1939c70d869bb90983a60953 Mon Sep 17 00:00:00 2001 From: BethanyG Date: Thu, 21 Mar 2024 16:28:00 -0700 Subject: [PATCH 13/14] Added new goledn test for hanging expressions as a result of the visit_Expr fix. --- .../.meta/config.json | 10 + .../example_expression_normalization.py | 157 + .../mapping.json | 50 + .../representation.json | 3 + .../representation.out | 5005 +++++++++++++++++ .../representation.txt | 1 + 6 files changed, 5226 insertions(+) create mode 100644 test/example-expression-normalization/.meta/config.json create mode 100644 test/example-expression-normalization/example_expression_normalization.py create mode 100644 test/example-expression-normalization/mapping.json create mode 100644 test/example-expression-normalization/representation.json create mode 100644 test/example-expression-normalization/representation.out create mode 100644 test/example-expression-normalization/representation.txt diff --git a/test/example-expression-normalization/.meta/config.json b/test/example-expression-normalization/.meta/config.json new file mode 100644 index 0000000..986ac91 --- /dev/null +++ b/test/example-expression-normalization/.meta/config.json @@ -0,0 +1,10 @@ +{ + "authors": [ + "bethanyg","brocla" + ], + "files": { + "solution": [ + "example_expression_normalization.py" + ] + } +} \ No newline at end of file diff --git a/test/example-expression-normalization/example_expression_normalization.py b/test/example-expression-normalization/example_expression_normalization.py new file mode 100644 index 0000000..e5e4e93 --- /dev/null +++ b/test/example-expression-normalization/example_expression_normalization.py @@ -0,0 +1,157 @@ +"""Hanging Module docstring. + + This is to make sure that the Expression changes don't munge things""" + + +import unittest +import pytest +from dataclass import dataclass +from Enum import Flag + + +# Examples of "Hanging Expressions (expressions not assigned to a name)" +# These have been barfing in the representer, due to bad refrences when +# checking the cache. + +# hanging uninitialized dataclass +@dataclass +class Point: + """Docstring to test removal.""" + x: int = 0 + y: int = 0 + + +# Hanging try/except +try: + 1/0 +except: + pass + + +# Random addition +5+6 + + +# Hanging print() (should get removed) +print(5+6) + + +# Various hanging comprehensions and genexps +(item for item in range(8)) +[item for item in range(16)] +{item for item in "a b c d e f g h i".split()} +{key:value for key, value in ((1, "a"),(2, "b"),(3, "c"),(5, "e"))} + +# Hanging and not hanging lambdas +lambda : {key:value for key, value in ((1, "a"),(2, "b"),(3, "c"),(5, "e"))} +test_assign_name = lambda : {item for item in "a b c d e f g h i".split()} + + +# hanging "constants" +-a +THIS_IS_A_CONSTANT = "It would be stupid if this exploded." + +"""Random Hanging String""" + + +# hanging Enum +class Allergene(Flag): + eggs = auto() + peanuts = auto() + shellfish = auto() + strawberries = auto() + tomatoes = auto() + chocolate = auto() + pollen = auto() + cats = auto() + +# The below is a hanging try/except from Guido's Gorgeous Lasagna exercise. + +# For this first exercise, it is really important to be clear about how we are importing names for tests. +# To that end, we are putting a try/catch around imports and throwing specific messages to help students +# decode that they need to create and title their constants and functions in a specific way. +try: + from lasagna import (EXPECTED_BAKE_TIME, + bake_time_remaining, + preparation_time_in_minutes, + elapsed_time_in_minutes) + +# Here, we are separating the constant import errors from the function name import errors +except ImportError as import_fail: + message = import_fail.args[0].split('(', maxsplit=1) + item_name = import_fail.args[0].split()[3] + + if 'EXPECTED_BAKE_TIME' in item_name: + # pylint: disable=raise-missing-from + raise ImportError(f'\n\nMISSING CONSTANT --> \nWe can not find or import the constant {item_name} in your' + " 'lasagna.py' file.\nDid you misname or forget to define it?") from None + else: + item_name = item_name[:-1] + "()'" + # pylint: disable=raise-missing-from + raise ImportError("\n\nMISSING FUNCTION --> In your 'lasagna.py' file, we can not find or import the" + f' function named {item_name}. \nDid you misname or forget to define it?') from None + + +# The below examples overlap with other tests, but are here to show that +# the docstring removals don't alter other expression-type code. + + +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 + ] + + +# yield from and yield examples +from typing import Iterable +def flatten(iterable): + def go(it): + for e in it: + if isinstance(e, Iterable) and not isinstance(e, str): + yield from go(e) + else: + yield e + return [e for e in go(iterable) if e is not None] + + + +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) + } + + +def first_item_greater_than_N(iterable, N): + if any((item := x) > N for x in iterable): + return item + return None + + +def generate_codes(seat_numbers, flight_id): + """Generate codes for a ticket. + + :param seat_numbers: list[str] - list of seat numbers. + :param flight_id: str - string containing the flight identifier. + :return: generator - generator that yields 12 character long ticket codes. + + """ + return ( + base.ljust(12, "0") for seat in seat_numbers if (base := f"{seat}{flight_id}") + ) diff --git a/test/example-expression-normalization/mapping.json b/test/example-expression-normalization/mapping.json new file mode 100644 index 0000000..3fce420 --- /dev/null +++ b/test/example-expression-normalization/mapping.json @@ -0,0 +1,50 @@ +{ + "placeholder_0": "Point", + "placeholder_1": "x", + "placeholder_2": "y", + "placeholder_3": "item", + "placeholder_4": "key", + "placeholder_5": "value", + "placeholder_6": "test_assign_name", + "placeholder_7": "THIS_IS_A_CONSTANT", + "placeholder_8": "Allergene", + "placeholder_9": "eggs", + "placeholder_10": "peanuts", + "placeholder_11": "shellfish", + "placeholder_12": "strawberries", + "placeholder_13": "tomatoes", + "placeholder_14": "chocolate", + "placeholder_15": "pollen", + "placeholder_16": "cats", + "placeholder_17": "import_fail", + "placeholder_18": "message", + "placeholder_19": "maxsplit", + "placeholder_20": "item_name", + "placeholder_21": "slices", + "placeholder_22": "series", + "placeholder_23": "length", + "placeholder_24": "i", + "placeholder_25": "_", + "placeholder_26": "sub_str", + "placeholder_27": "flatten", + "placeholder_28": "iterable", + "placeholder_29": "go", + "placeholder_30": "it", + "placeholder_31": "e", + "placeholder_32": "check_height", + "placeholder_33": "grid", + "placeholder_34": "height", + "placeholder_35": "nswe_points", + "placeholder_36": "point", + "placeholder_37": "nswe_offsets", + "placeholder_38": "offset", + "placeholder_39": "neighbor", + "placeholder_40": "first_item_greater_than_N", + "placeholder_41": "N", + "placeholder_42": "placeholder_3", + "placeholder_43": "generate_codes", + "placeholder_44": "seat_numbers", + "placeholder_45": "flight_id", + "placeholder_46": "seat", + "placeholder_47": "base" +} \ No newline at end of file diff --git a/test/example-expression-normalization/representation.json b/test/example-expression-normalization/representation.json new file mode 100644 index 0000000..051b2b6 --- /dev/null +++ b/test/example-expression-normalization/representation.json @@ -0,0 +1,3 @@ +{ + "version": 2 +} \ No newline at end of file diff --git a/test/example-expression-normalization/representation.out b/test/example-expression-normalization/representation.out new file mode 100644 index 0000000..a17ac5a --- /dev/null +++ b/test/example-expression-normalization/representation.out @@ -0,0 +1,5005 @@ +## BEGIN NORMALIZED CODE ## +import unittest +import pytest +from dataclass import dataclass +from Enum import Flag + + +@dataclass +class placeholder_0: + placeholder_1 = 0 + placeholder_2 = 0 + + +try: + 1 / 0 +except: + pass +5 + 6 +(placeholder_3 for placeholder_3 in range(8)) +[placeholder_3 for placeholder_3 in range(16)] +{placeholder_3 for placeholder_3 in "a b c d e f g h i".split()} +{ + placeholder_4: placeholder_5 + for placeholder_4, placeholder_5 in ((1, "a"), (2, "b"), (3, "c"), (5, "e")) +} +lambda: { + placeholder_4: placeholder_5 + for placeholder_4, placeholder_5 in ((1, "a"), (2, "b"), (3, "c"), (5, "e")) +} +placeholder_6 = lambda: {placeholder_3 for placeholder_3 in "a b c d e f g h i".split()} +-a +placeholder_7 = "It would be stupid if this exploded." +"Random Hanging String" + + +class placeholder_8(Flag): + placeholder_9 = auto() + placeholder_10 = auto() + placeholder_11 = auto() + placeholder_12 = auto() + placeholder_13 = auto() + placeholder_14 = auto() + placeholder_15 = auto() + placeholder_16 = auto() + + +try: + from lasagna import ( + EXPECTED_BAKE_TIME, + bake_time_remaining, + preparation_time_in_minutes, + elapsed_time_in_minutes, + ) +except ImportError as placeholder_17: + placeholder_18 = placeholder_17.args[0].split("(", placeholder_19=1) + placeholder_20 = placeholder_17.args[0].split()[3] + if "EXPECTED_BAKE_TIME" in placeholder_20: + raise ImportError( + f"\n\nMISSING CONSTANT --> \nWe can not find or import the constant {placeholder_20} in your 'lasagna.py' file.\nDid you misname or forget to define it?" + ) from None + else: + placeholder_20 = placeholder_20[:-1] + "()'" + raise ImportError( + f"\n\nMISSING FUNCTION --> In your 'lasagna.py' file, we can not find or import the function named {placeholder_20}. \nDid you misname or forget to define it?" + ) from None + + +def placeholder_21(placeholder_22, placeholder_23): + return [ + placeholder_26 + for placeholder_24, placeholder_25 in enumerate(placeholder_22) + if len( + ( + placeholder_26 := placeholder_22[ + placeholder_24 : placeholder_24 + placeholder_23 + ] + ) + ) + == placeholder_23 + ] + + +from typing import Iterable + + +def placeholder_27(placeholder_28): + def placeholder_29(placeholder_30): + for placeholder_31 in placeholder_30: + if isinstance(placeholder_31, Iterable) and ( + not isinstance(placeholder_31, str) + ): + yield from placeholder_29(placeholder_31) + else: + yield placeholder_31 + + return [ + placeholder_31 + for placeholder_31 in placeholder_29(placeholder_28) + if placeholder_31 is not None + ] + + +def placeholder_32(placeholder_33): + if (placeholder_34 := len(placeholder_33)) % 3: + raise ValueError("grid rows not a multiple of 4") + return placeholder_34 + + +def placeholder_35(self, placeholder_36): + placeholder_37 = set([(1, 0), (-1, 0), (0, -1), (0, 1)]) + return { + placeholder_39 + for placeholder_38 in placeholder_37 + if self.on_the_board((placeholder_39 := (placeholder_36 + placeholder_38))) + } + + +def placeholder_40(placeholder_28, placeholder_41): + if any( + ( + (placeholder_42 := placeholder_1) > placeholder_41 + for placeholder_1 in placeholder_28 + ) + ): + return placeholder_3 + return None + + +def placeholder_43(placeholder_44, placeholder_45): + return ( + placeholder_47.ljust(12, "0") + for placeholder_46 in placeholder_44 + if (placeholder_47 := f"{placeholder_46}{placeholder_45}") + ) + +## END NORMALIZED CODE ## + +## BEGIN TREE BEFORE ## +Module( + [ + Expr( + Constant( + "Hanging Module docstring.\n\n This is to make sure that the Expression changes don't munge things", + lineno=1, + col_offset=0, + end_lineno=3, + end_col_offset=71), + lineno=1, + col_offset=0, + end_lineno=3, + end_col_offset=71), + Import( + [ + alias( + 'unittest', + lineno=6, + col_offset=7, + end_lineno=6, + end_col_offset=15)], + lineno=6, + col_offset=0, + end_lineno=6, + end_col_offset=15), + Import( + [ + alias( + 'pytest', + lineno=7, + col_offset=7, + end_lineno=7, + end_col_offset=13)], + lineno=7, + col_offset=0, + end_lineno=7, + end_col_offset=13), + ImportFrom( + 'dataclass', + [ + alias( + 'dataclass', + lineno=8, + col_offset=22, + end_lineno=8, + end_col_offset=31)], + 0, + lineno=8, + col_offset=0, + end_lineno=8, + end_col_offset=31), + ImportFrom( + 'Enum', + [ + alias( + 'Flag', + lineno=9, + col_offset=17, + end_lineno=9, + end_col_offset=21)], + 0, + lineno=9, + col_offset=0, + end_lineno=9, + end_col_offset=21), + ClassDef( + 'Point', + [], + [], + [ + Expr( + Constant( + 'Docstring to test removal.', + lineno=19, + col_offset=4, + end_lineno=19, + end_col_offset=36), + lineno=19, + col_offset=4, + end_lineno=19, + end_col_offset=36), + AnnAssign( + Name( + 'x', + Store(), + lineno=20, + col_offset=4, + end_lineno=20, + end_col_offset=5), + Name( + 'int', + Load(), + lineno=20, + col_offset=7, + end_lineno=20, + end_col_offset=10), + Constant( + 0, + lineno=20, + col_offset=13, + end_lineno=20, + end_col_offset=14), + 1, + lineno=20, + col_offset=4, + end_lineno=20, + end_col_offset=14), + AnnAssign( + Name( + 'y', + Store(), + lineno=21, + col_offset=4, + end_lineno=21, + end_col_offset=5), + Name( + 'int', + Load(), + lineno=21, + col_offset=7, + end_lineno=21, + end_col_offset=10), + Constant( + 0, + lineno=21, + col_offset=13, + end_lineno=21, + end_col_offset=14), + 1, + lineno=21, + col_offset=4, + end_lineno=21, + end_col_offset=14)], + [ + Name( + 'dataclass', + Load(), + lineno=17, + col_offset=1, + end_lineno=17, + end_col_offset=10)], + lineno=18, + col_offset=0, + end_lineno=21, + end_col_offset=14), + Try( + [ + Expr( + BinOp( + Constant( + 1, + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=5), + Div(), + Constant( + 0, + lineno=26, + col_offset=6, + end_lineno=26, + end_col_offset=7), + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=7), + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=7)], + [ + ExceptHandler( + body=[ + Pass( + lineno=28, + col_offset=4, + end_lineno=28, + end_col_offset=8)], + lineno=27, + col_offset=0, + end_lineno=28, + end_col_offset=8)], + [], + [], + lineno=25, + col_offset=0, + end_lineno=28, + end_col_offset=8), + Expr( + BinOp( + Constant( + 5, + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=1), + Add(), + Constant( + 6, + lineno=32, + col_offset=2, + end_lineno=32, + end_col_offset=3), + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=3), + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=3), + Expr( + Call( + Name( + 'print', + Load(), + lineno=36, + col_offset=0, + end_lineno=36, + end_col_offset=5), + [ + BinOp( + Constant( + 5, + lineno=36, + col_offset=6, + end_lineno=36, + end_col_offset=7), + Add(), + Constant( + 6, + lineno=36, + col_offset=8, + end_lineno=36, + end_col_offset=9), + lineno=36, + col_offset=6, + end_lineno=36, + end_col_offset=9)], + [], + lineno=36, + col_offset=0, + end_lineno=36, + end_col_offset=10), + lineno=36, + col_offset=0, + end_lineno=36, + end_col_offset=10), + Expr( + GeneratorExp( + Name( + 'item', + Load(), + lineno=40, + col_offset=1, + end_lineno=40, + end_col_offset=5), + [ + comprehension( + Name( + 'item', + Store(), + lineno=40, + col_offset=10, + end_lineno=40, + end_col_offset=14), + Call( + Name( + 'range', + Load(), + lineno=40, + col_offset=18, + end_lineno=40, + end_col_offset=23), + [ + Constant( + 8, + lineno=40, + col_offset=24, + end_lineno=40, + end_col_offset=25)], + [], + lineno=40, + col_offset=18, + end_lineno=40, + end_col_offset=26), + [], + 0)], + lineno=40, + col_offset=0, + end_lineno=40, + end_col_offset=27), + lineno=40, + col_offset=0, + end_lineno=40, + end_col_offset=27), + Expr( + ListComp( + Name( + 'item', + Load(), + lineno=41, + col_offset=1, + end_lineno=41, + end_col_offset=5), + [ + comprehension( + Name( + 'item', + Store(), + lineno=41, + col_offset=10, + end_lineno=41, + end_col_offset=14), + Call( + Name( + 'range', + Load(), + lineno=41, + col_offset=18, + end_lineno=41, + end_col_offset=23), + [ + Constant( + 16, + lineno=41, + col_offset=24, + end_lineno=41, + end_col_offset=26)], + [], + lineno=41, + col_offset=18, + end_lineno=41, + end_col_offset=27), + [], + 0)], + lineno=41, + col_offset=0, + end_lineno=41, + end_col_offset=28), + lineno=41, + col_offset=0, + end_lineno=41, + end_col_offset=28), + Expr( + SetComp( + Name( + 'item', + Load(), + lineno=42, + col_offset=1, + end_lineno=42, + end_col_offset=5), + [ + comprehension( + Name( + 'item', + Store(), + lineno=42, + col_offset=10, + end_lineno=42, + end_col_offset=14), + Call( + Attribute( + Constant( + 'a b c d e f g h i', + lineno=42, + col_offset=18, + end_lineno=42, + end_col_offset=37), + 'split', + Load(), + lineno=42, + col_offset=18, + end_lineno=42, + end_col_offset=43), + [], + [], + lineno=42, + col_offset=18, + end_lineno=42, + end_col_offset=45), + [], + 0)], + lineno=42, + col_offset=0, + end_lineno=42, + end_col_offset=46), + lineno=42, + col_offset=0, + end_lineno=42, + end_col_offset=46), + Expr( + DictComp( + Name( + 'key', + Load(), + lineno=43, + col_offset=1, + end_lineno=43, + end_col_offset=4), + Name( + 'value', + Load(), + lineno=43, + col_offset=5, + end_lineno=43, + end_col_offset=10), + [ + comprehension( + Tuple( + [ + Name( + 'key', + Store(), + lineno=43, + col_offset=15, + end_lineno=43, + end_col_offset=18), + Name( + 'value', + Store(), + lineno=43, + col_offset=20, + end_lineno=43, + end_col_offset=25)], + Store(), + lineno=43, + col_offset=15, + end_lineno=43, + end_col_offset=25), + Tuple( + [ + Tuple( + [ + Constant( + 1, + lineno=43, + col_offset=31, + end_lineno=43, + end_col_offset=32), + Constant( + 'a', + lineno=43, + col_offset=34, + end_lineno=43, + end_col_offset=37)], + Load(), + lineno=43, + col_offset=30, + end_lineno=43, + end_col_offset=38), + Tuple( + [ + Constant( + 2, + lineno=43, + col_offset=40, + end_lineno=43, + end_col_offset=41), + Constant( + 'b', + lineno=43, + col_offset=43, + end_lineno=43, + end_col_offset=46)], + Load(), + lineno=43, + col_offset=39, + end_lineno=43, + end_col_offset=47), + Tuple( + [ + Constant( + 3, + lineno=43, + col_offset=49, + end_lineno=43, + end_col_offset=50), + Constant( + 'c', + lineno=43, + col_offset=52, + end_lineno=43, + end_col_offset=55)], + Load(), + lineno=43, + col_offset=48, + end_lineno=43, + end_col_offset=56), + Tuple( + [ + Constant( + 5, + lineno=43, + col_offset=58, + end_lineno=43, + end_col_offset=59), + Constant( + 'e', + lineno=43, + col_offset=61, + end_lineno=43, + end_col_offset=64)], + Load(), + lineno=43, + col_offset=57, + end_lineno=43, + end_col_offset=65)], + Load(), + lineno=43, + col_offset=29, + end_lineno=43, + end_col_offset=66), + [], + 0)], + lineno=43, + col_offset=0, + end_lineno=43, + end_col_offset=67), + lineno=43, + col_offset=0, + end_lineno=43, + end_col_offset=67), + Expr( + Lambda( + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + DictComp( + Name( + 'key', + Load(), + lineno=46, + col_offset=10, + end_lineno=46, + end_col_offset=13), + Name( + 'value', + Load(), + lineno=46, + col_offset=14, + end_lineno=46, + end_col_offset=19), + [ + comprehension( + Tuple( + [ + Name( + 'key', + Store(), + lineno=46, + col_offset=24, + end_lineno=46, + end_col_offset=27), + Name( + 'value', + Store(), + lineno=46, + col_offset=29, + end_lineno=46, + end_col_offset=34)], + Store(), + lineno=46, + col_offset=24, + end_lineno=46, + end_col_offset=34), + Tuple( + [ + Tuple( + [ + Constant( + 1, + lineno=46, + col_offset=40, + end_lineno=46, + end_col_offset=41), + Constant( + 'a', + lineno=46, + col_offset=43, + end_lineno=46, + end_col_offset=46)], + Load(), + lineno=46, + col_offset=39, + end_lineno=46, + end_col_offset=47), + Tuple( + [ + Constant( + 2, + lineno=46, + col_offset=49, + end_lineno=46, + end_col_offset=50), + Constant( + 'b', + lineno=46, + col_offset=52, + end_lineno=46, + end_col_offset=55)], + Load(), + lineno=46, + col_offset=48, + end_lineno=46, + end_col_offset=56), + Tuple( + [ + Constant( + 3, + lineno=46, + col_offset=58, + end_lineno=46, + end_col_offset=59), + Constant( + 'c', + lineno=46, + col_offset=61, + end_lineno=46, + end_col_offset=64)], + Load(), + lineno=46, + col_offset=57, + end_lineno=46, + end_col_offset=65), + Tuple( + [ + Constant( + 5, + lineno=46, + col_offset=67, + end_lineno=46, + end_col_offset=68), + Constant( + 'e', + lineno=46, + col_offset=70, + end_lineno=46, + end_col_offset=73)], + Load(), + lineno=46, + col_offset=66, + end_lineno=46, + end_col_offset=74)], + Load(), + lineno=46, + col_offset=38, + end_lineno=46, + end_col_offset=75), + [], + 0)], + lineno=46, + col_offset=9, + end_lineno=46, + end_col_offset=76), + lineno=46, + col_offset=0, + end_lineno=46, + end_col_offset=76), + lineno=46, + col_offset=0, + end_lineno=46, + end_col_offset=76), + Assign( + [ + Name( + 'test_assign_name', + Store(), + lineno=47, + col_offset=0, + end_lineno=47, + end_col_offset=16)], + Lambda( + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + SetComp( + Name( + 'item', + Load(), + lineno=47, + col_offset=29, + end_lineno=47, + end_col_offset=33), + [ + comprehension( + Name( + 'item', + Store(), + lineno=47, + col_offset=38, + end_lineno=47, + end_col_offset=42), + Call( + Attribute( + Constant( + 'a b c d e f g h i', + lineno=47, + col_offset=46, + end_lineno=47, + end_col_offset=65), + 'split', + Load(), + lineno=47, + col_offset=46, + end_lineno=47, + end_col_offset=71), + [], + [], + lineno=47, + col_offset=46, + end_lineno=47, + end_col_offset=73), + [], + 0)], + lineno=47, + col_offset=28, + end_lineno=47, + end_col_offset=74), + lineno=47, + col_offset=19, + end_lineno=47, + end_col_offset=74), + lineno=47, + col_offset=0, + end_lineno=47, + end_col_offset=74), + Expr( + UnaryOp( + USub(), + Name( + 'a', + Load(), + lineno=51, + col_offset=1, + end_lineno=51, + end_col_offset=2), + lineno=51, + col_offset=0, + end_lineno=51, + end_col_offset=2), + lineno=51, + col_offset=0, + end_lineno=51, + end_col_offset=2), + Assign( + [ + Name( + 'THIS_IS_A_CONSTANT', + Store(), + lineno=52, + col_offset=0, + end_lineno=52, + end_col_offset=18)], + Constant( + 'It would be stupid if this exploded.', + lineno=52, + col_offset=21, + end_lineno=52, + end_col_offset=59), + lineno=52, + col_offset=0, + end_lineno=52, + end_col_offset=59), + Expr( + Constant( + 'Random Hanging String', + lineno=54, + col_offset=0, + end_lineno=54, + end_col_offset=27), + lineno=54, + col_offset=0, + end_lineno=54, + end_col_offset=27), + ClassDef( + 'Allergene', + [ + Name( + 'Flag', + Load(), + lineno=58, + col_offset=16, + end_lineno=58, + end_col_offset=20)], + [], + [ + Assign( + [ + Name( + 'eggs', + Store(), + lineno=59, + col_offset=4, + end_lineno=59, + end_col_offset=8)], + Call( + Name( + 'auto', + Load(), + lineno=59, + col_offset=11, + end_lineno=59, + end_col_offset=15), + [], + [], + lineno=59, + col_offset=11, + end_lineno=59, + end_col_offset=17), + lineno=59, + col_offset=4, + end_lineno=59, + end_col_offset=17), + Assign( + [ + Name( + 'peanuts', + Store(), + lineno=60, + col_offset=4, + end_lineno=60, + end_col_offset=11)], + Call( + Name( + 'auto', + Load(), + lineno=60, + col_offset=14, + end_lineno=60, + end_col_offset=18), + [], + [], + lineno=60, + col_offset=14, + end_lineno=60, + end_col_offset=20), + lineno=60, + col_offset=4, + end_lineno=60, + end_col_offset=20), + Assign( + [ + Name( + 'shellfish', + Store(), + lineno=61, + col_offset=4, + end_lineno=61, + end_col_offset=13)], + Call( + Name( + 'auto', + Load(), + lineno=61, + col_offset=16, + end_lineno=61, + end_col_offset=20), + [], + [], + lineno=61, + col_offset=16, + end_lineno=61, + end_col_offset=22), + lineno=61, + col_offset=4, + end_lineno=61, + end_col_offset=22), + Assign( + [ + Name( + 'strawberries', + Store(), + lineno=62, + col_offset=4, + end_lineno=62, + end_col_offset=16)], + Call( + Name( + 'auto', + Load(), + lineno=62, + col_offset=19, + end_lineno=62, + end_col_offset=23), + [], + [], + lineno=62, + col_offset=19, + end_lineno=62, + end_col_offset=25), + lineno=62, + col_offset=4, + end_lineno=62, + end_col_offset=25), + Assign( + [ + Name( + 'tomatoes', + Store(), + lineno=63, + col_offset=4, + end_lineno=63, + end_col_offset=12)], + Call( + Name( + 'auto', + Load(), + lineno=63, + col_offset=15, + end_lineno=63, + end_col_offset=19), + [], + [], + lineno=63, + col_offset=15, + end_lineno=63, + end_col_offset=21), + lineno=63, + col_offset=4, + end_lineno=63, + end_col_offset=21), + Assign( + [ + Name( + 'chocolate', + Store(), + lineno=64, + col_offset=4, + end_lineno=64, + end_col_offset=13)], + Call( + Name( + 'auto', + Load(), + lineno=64, + col_offset=16, + end_lineno=64, + end_col_offset=20), + [], + [], + lineno=64, + col_offset=16, + end_lineno=64, + end_col_offset=22), + lineno=64, + col_offset=4, + end_lineno=64, + end_col_offset=22), + Assign( + [ + Name( + 'pollen', + Store(), + lineno=65, + col_offset=4, + end_lineno=65, + end_col_offset=10)], + Call( + Name( + 'auto', + Load(), + lineno=65, + col_offset=13, + end_lineno=65, + end_col_offset=17), + [], + [], + lineno=65, + col_offset=13, + end_lineno=65, + end_col_offset=19), + lineno=65, + col_offset=4, + end_lineno=65, + end_col_offset=19), + Assign( + [ + Name( + 'cats', + Store(), + lineno=66, + col_offset=4, + end_lineno=66, + end_col_offset=8)], + Call( + Name( + 'auto', + Load(), + lineno=66, + col_offset=11, + end_lineno=66, + end_col_offset=15), + [], + [], + lineno=66, + col_offset=11, + end_lineno=66, + end_col_offset=17), + lineno=66, + col_offset=4, + end_lineno=66, + end_col_offset=17)], + [], + lineno=58, + col_offset=0, + end_lineno=66, + end_col_offset=17), + Try( + [ + ImportFrom( + 'lasagna', + [ + alias( + 'EXPECTED_BAKE_TIME', + lineno=74, + col_offset=25, + end_lineno=74, + end_col_offset=43), + alias( + 'bake_time_remaining', + lineno=75, + col_offset=25, + end_lineno=75, + end_col_offset=44), + alias( + 'preparation_time_in_minutes', + lineno=76, + col_offset=25, + end_lineno=76, + end_col_offset=52), + alias( + 'elapsed_time_in_minutes', + lineno=77, + col_offset=25, + end_lineno=77, + end_col_offset=48)], + 0, + lineno=74, + col_offset=4, + end_lineno=77, + end_col_offset=49)], + [ + ExceptHandler( + Name( + 'ImportError', + Load(), + lineno=80, + col_offset=7, + end_lineno=80, + end_col_offset=18), + 'import_fail', + [ + Assign( + [ + Name( + 'message', + Store(), + lineno=81, + col_offset=4, + end_lineno=81, + end_col_offset=11)], + Call( + Attribute( + Subscript( + Attribute( + Name( + 'import_fail', + Load(), + lineno=81, + col_offset=14, + end_lineno=81, + end_col_offset=25), + 'args', + Load(), + lineno=81, + col_offset=14, + end_lineno=81, + end_col_offset=30), + Constant( + 0, + lineno=81, + col_offset=31, + end_lineno=81, + end_col_offset=32), + Load(), + lineno=81, + col_offset=14, + end_lineno=81, + end_col_offset=33), + 'split', + Load(), + lineno=81, + col_offset=14, + end_lineno=81, + end_col_offset=39), + [ + Constant( + '(', + lineno=81, + col_offset=40, + end_lineno=81, + end_col_offset=43)], + [ + keyword( + 'maxsplit', + Constant( + 1, + lineno=81, + col_offset=54, + end_lineno=81, + end_col_offset=55), + lineno=81, + col_offset=45, + end_lineno=81, + end_col_offset=55)], + lineno=81, + col_offset=14, + end_lineno=81, + end_col_offset=56), + lineno=81, + col_offset=4, + end_lineno=81, + end_col_offset=56), + Assign( + [ + Name( + 'item_name', + Store(), + lineno=82, + col_offset=4, + end_lineno=82, + end_col_offset=13)], + Subscript( + Call( + Attribute( + Subscript( + Attribute( + Name( + 'import_fail', + Load(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=27), + 'args', + Load(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=32), + Constant( + 0, + lineno=82, + col_offset=33, + end_lineno=82, + end_col_offset=34), + Load(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=35), + 'split', + Load(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=41), + [], + [], + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=43), + Constant( + 3, + lineno=82, + col_offset=44, + end_lineno=82, + end_col_offset=45), + Load(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=46), + lineno=82, + col_offset=4, + end_lineno=82, + end_col_offset=46), + If( + Compare( + Constant( + 'EXPECTED_BAKE_TIME', + lineno=84, + col_offset=7, + end_lineno=84, + end_col_offset=27), + [ + In()], + [ + Name( + 'item_name', + Load(), + lineno=84, + col_offset=31, + end_lineno=84, + end_col_offset=40)], + lineno=84, + col_offset=7, + end_lineno=84, + end_col_offset=40), + [ + Raise( + Call( + Name( + 'ImportError', + Load(), + lineno=86, + col_offset=14, + end_lineno=86, + end_col_offset=25), + [ + JoinedStr( + [ + Constant( + '\n\nMISSING CONSTANT --> \nWe can not find or import the constant ', + lineno=86, + col_offset=26, + end_lineno=87, + end_col_offset=88), + FormattedValue( + Name( + 'item_name', + Load(), + lineno=86, + col_offset=95, + end_lineno=86, + end_col_offset=104), + -1, + lineno=86, + col_offset=26, + end_lineno=87, + end_col_offset=88), + Constant( + " in your 'lasagna.py' file.\nDid you misname or forget to define it?", + lineno=86, + col_offset=26, + end_lineno=87, + end_col_offset=88)], + lineno=86, + col_offset=26, + end_lineno=87, + end_col_offset=88)], + [], + lineno=86, + col_offset=14, + end_lineno=87, + end_col_offset=89), + Constant( + None, + lineno=87, + col_offset=95, + end_lineno=87, + end_col_offset=99), + lineno=86, + col_offset=8, + end_lineno=87, + end_col_offset=99)], + [ + Assign( + [ + Name( + 'item_name', + Store(), + lineno=89, + col_offset=8, + end_lineno=89, + end_col_offset=17)], + BinOp( + Subscript( + Name( + 'item_name', + Load(), + lineno=89, + col_offset=20, + end_lineno=89, + end_col_offset=29), + Slice( + upper=UnaryOp( + USub(), + Constant( + 1, + lineno=89, + col_offset=32, + end_lineno=89, + end_col_offset=33), + lineno=89, + col_offset=31, + end_lineno=89, + end_col_offset=33), + lineno=89, + col_offset=30, + end_lineno=89, + end_col_offset=33), + Load(), + lineno=89, + col_offset=20, + end_lineno=89, + end_col_offset=34), + Add(), + Constant( + "()'", + lineno=89, + col_offset=37, + end_lineno=89, + end_col_offset=42), + lineno=89, + col_offset=20, + end_lineno=89, + end_col_offset=42), + lineno=89, + col_offset=8, + end_lineno=89, + end_col_offset=42), + Raise( + Call( + Name( + 'ImportError', + Load(), + lineno=91, + col_offset=14, + end_lineno=91, + end_col_offset=25), + [ + JoinedStr( + [ + Constant( + "\n\nMISSING FUNCTION --> In your 'lasagna.py' file, we can not find or import the function named ", + lineno=91, + col_offset=26, + end_lineno=92, + end_col_offset=99), + FormattedValue( + Name( + 'item_name', + Load(), + lineno=92, + col_offset=45, + end_lineno=92, + end_col_offset=54), + -1, + lineno=91, + col_offset=26, + end_lineno=92, + end_col_offset=99), + Constant( + '. \nDid you misname or forget to define it?', + lineno=91, + col_offset=26, + end_lineno=92, + end_col_offset=99)], + lineno=91, + col_offset=26, + end_lineno=92, + end_col_offset=99)], + [], + lineno=91, + col_offset=14, + end_lineno=92, + end_col_offset=100), + Constant( + None, + lineno=92, + col_offset=106, + end_lineno=92, + end_col_offset=110), + lineno=91, + col_offset=8, + end_lineno=92, + end_col_offset=110)], + lineno=84, + col_offset=4, + end_lineno=92, + end_col_offset=110)], + lineno=80, + col_offset=0, + end_lineno=92, + end_col_offset=110)], + [], + [], + lineno=73, + col_offset=0, + end_lineno=92, + end_col_offset=110), + FunctionDef( + 'slices', + arguments( + [], + [ + arg( + 'series', + lineno=99, + col_offset=11, + end_lineno=99, + end_col_offset=17), + arg( + 'length', + lineno=99, + col_offset=19, + end_lineno=99, + 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=100, + col_offset=4, + end_lineno=103, + end_col_offset=7), + lineno=100, + col_offset=4, + end_lineno=103, + end_col_offset=7), + Return( + ListComp( + Name( + 'sub_str', + Load(), + lineno=105, + col_offset=8, + end_lineno=105, + end_col_offset=15), + [ + comprehension( + Tuple( + [ + Name( + 'i', + Store(), + lineno=106, + col_offset=12, + end_lineno=106, + end_col_offset=13), + Name( + '_', + Store(), + lineno=106, + col_offset=15, + end_lineno=106, + end_col_offset=16)], + Store(), + lineno=106, + col_offset=12, + end_lineno=106, + end_col_offset=16), + Call( + Name( + 'enumerate', + Load(), + lineno=106, + col_offset=20, + end_lineno=106, + end_col_offset=29), + [ + Name( + 'series', + Load(), + lineno=106, + col_offset=30, + end_lineno=106, + end_col_offset=36)], + [], + lineno=106, + col_offset=20, + end_lineno=106, + end_col_offset=37), + [ + Compare( + Call( + Name( + 'len', + Load(), + lineno=107, + col_offset=11, + end_lineno=107, + end_col_offset=14), + [ + NamedExpr( + Name( + 'sub_str', + Store(), + lineno=107, + col_offset=15, + end_lineno=107, + end_col_offset=22), + Subscript( + Name( + 'series', + Load(), + lineno=107, + col_offset=26, + end_lineno=107, + end_col_offset=32), + Slice( + Name( + 'i', + Load(), + lineno=107, + col_offset=33, + end_lineno=107, + end_col_offset=34), + BinOp( + Name( + 'i', + Load(), + lineno=107, + col_offset=37, + end_lineno=107, + end_col_offset=38), + Add(), + Name( + 'length', + Load(), + lineno=107, + col_offset=41, + end_lineno=107, + end_col_offset=47), + lineno=107, + col_offset=37, + end_lineno=107, + end_col_offset=47), + lineno=107, + col_offset=33, + end_lineno=107, + end_col_offset=47), + Load(), + lineno=107, + col_offset=26, + end_lineno=107, + end_col_offset=48), + lineno=107, + col_offset=15, + end_lineno=107, + end_col_offset=48)], + [], + lineno=107, + col_offset=11, + end_lineno=107, + end_col_offset=49), + [ + Eq()], + [ + Name( + 'length', + Load(), + lineno=107, + col_offset=53, + end_lineno=107, + end_col_offset=59)], + lineno=107, + col_offset=11, + end_lineno=107, + end_col_offset=59)], + 0)], + lineno=104, + col_offset=11, + end_lineno=108, + end_col_offset=5), + lineno=104, + col_offset=4, + end_lineno=108, + end_col_offset=5)], + [], + lineno=99, + col_offset=0, + end_lineno=108, + end_col_offset=5), + ImportFrom( + 'typing', + [ + alias( + 'Iterable', + lineno=112, + col_offset=19, + end_lineno=112, + end_col_offset=27)], + 0, + lineno=112, + col_offset=0, + end_lineno=112, + end_col_offset=27), + FunctionDef( + 'flatten', + arguments( + [], + [ + arg( + 'iterable', + lineno=113, + col_offset=12, + end_lineno=113, + end_col_offset=20)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + FunctionDef( + 'go', + arguments( + [], + [ + arg( + 'it', + lineno=114, + col_offset=11, + end_lineno=114, + end_col_offset=13)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + For( + Name( + 'e', + Store(), + lineno=115, + col_offset=12, + end_lineno=115, + end_col_offset=13), + Name( + 'it', + Load(), + lineno=115, + col_offset=17, + end_lineno=115, + end_col_offset=19), + [ + If( + BoolOp( + And(), + [ + Call( + Name( + 'isinstance', + Load(), + lineno=116, + col_offset=15, + end_lineno=116, + end_col_offset=25), + [ + Name( + 'e', + Load(), + lineno=116, + col_offset=26, + end_lineno=116, + end_col_offset=27), + Name( + 'Iterable', + Load(), + lineno=116, + col_offset=29, + end_lineno=116, + end_col_offset=37)], + [], + lineno=116, + col_offset=15, + end_lineno=116, + end_col_offset=38), + UnaryOp( + Not(), + Call( + Name( + 'isinstance', + Load(), + lineno=116, + col_offset=47, + end_lineno=116, + end_col_offset=57), + [ + Name( + 'e', + Load(), + lineno=116, + col_offset=58, + end_lineno=116, + end_col_offset=59), + Name( + 'str', + Load(), + lineno=116, + col_offset=61, + end_lineno=116, + end_col_offset=64)], + [], + lineno=116, + col_offset=47, + end_lineno=116, + end_col_offset=65), + lineno=116, + col_offset=43, + end_lineno=116, + end_col_offset=65)], + lineno=116, + col_offset=15, + end_lineno=116, + end_col_offset=65), + [ + Expr( + YieldFrom( + Call( + Name( + 'go', + Load(), + lineno=117, + col_offset=27, + end_lineno=117, + end_col_offset=29), + [ + Name( + 'e', + Load(), + lineno=117, + col_offset=30, + end_lineno=117, + end_col_offset=31)], + [], + lineno=117, + col_offset=27, + end_lineno=117, + end_col_offset=32), + lineno=117, + col_offset=16, + end_lineno=117, + end_col_offset=32), + lineno=117, + col_offset=16, + end_lineno=117, + end_col_offset=32)], + [ + Expr( + Yield( + Name( + 'e', + Load(), + lineno=119, + col_offset=22, + end_lineno=119, + end_col_offset=23), + lineno=119, + col_offset=16, + end_lineno=119, + end_col_offset=23), + lineno=119, + col_offset=16, + end_lineno=119, + end_col_offset=23)], + lineno=116, + col_offset=12, + end_lineno=119, + end_col_offset=23)], + [], + lineno=115, + col_offset=8, + end_lineno=119, + end_col_offset=23)], + [], + lineno=114, + col_offset=4, + end_lineno=119, + end_col_offset=23), + Return( + ListComp( + Name( + 'e', + Load(), + lineno=120, + col_offset=12, + end_lineno=120, + end_col_offset=13), + [ + comprehension( + Name( + 'e', + Store(), + lineno=120, + col_offset=18, + end_lineno=120, + end_col_offset=19), + Call( + Name( + 'go', + Load(), + lineno=120, + col_offset=23, + end_lineno=120, + end_col_offset=25), + [ + Name( + 'iterable', + Load(), + lineno=120, + col_offset=26, + end_lineno=120, + end_col_offset=34)], + [], + lineno=120, + col_offset=23, + end_lineno=120, + end_col_offset=35), + [ + Compare( + Name( + 'e', + Load(), + lineno=120, + col_offset=39, + end_lineno=120, + end_col_offset=40), + [ + IsNot()], + [ + Constant( + None, + lineno=120, + col_offset=48, + end_lineno=120, + end_col_offset=52)], + lineno=120, + col_offset=39, + end_lineno=120, + end_col_offset=52)], + 0)], + lineno=120, + col_offset=11, + end_lineno=120, + end_col_offset=53), + lineno=120, + col_offset=4, + end_lineno=120, + end_col_offset=53)], + [], + lineno=113, + col_offset=0, + end_lineno=120, + end_col_offset=53), + FunctionDef( + 'check_height', + arguments( + [], + [ + arg( + 'grid', + lineno=124, + col_offset=17, + end_lineno=124, + end_col_offset=21)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Expr( + Constant( + 'check that row count is a multiple of 4', + lineno=125, + col_offset=4, + end_lineno=125, + end_col_offset=49), + lineno=125, + col_offset=4, + end_lineno=125, + end_col_offset=49), + If( + BinOp( + NamedExpr( + Name( + 'height', + Store(), + lineno=126, + col_offset=8, + end_lineno=126, + end_col_offset=14), + Call( + Name( + 'len', + Load(), + lineno=126, + col_offset=18, + end_lineno=126, + end_col_offset=21), + [ + Name( + 'grid', + Load(), + lineno=126, + col_offset=22, + end_lineno=126, + end_col_offset=26)], + [], + lineno=126, + col_offset=18, + end_lineno=126, + end_col_offset=27), + lineno=126, + col_offset=8, + end_lineno=126, + end_col_offset=27), + Mod(), + Constant( + 3, + lineno=126, + col_offset=31, + end_lineno=126, + end_col_offset=32), + lineno=126, + col_offset=7, + end_lineno=126, + end_col_offset=32), + [ + Raise( + Call( + Name( + 'ValueError', + Load(), + lineno=127, + col_offset=14, + end_lineno=127, + end_col_offset=24), + [ + Constant( + 'grid rows not a multiple of 4', + lineno=127, + col_offset=25, + end_lineno=127, + end_col_offset=56)], + [], + lineno=127, + col_offset=14, + end_lineno=127, + end_col_offset=57), + lineno=127, + col_offset=8, + end_lineno=127, + end_col_offset=57)], + [], + lineno=126, + col_offset=4, + end_lineno=127, + end_col_offset=57), + Return( + Name( + 'height', + Load(), + lineno=128, + col_offset=11, + end_lineno=128, + end_col_offset=17), + lineno=128, + col_offset=4, + end_lineno=128, + end_col_offset=17)], + [], + lineno=124, + col_offset=0, + end_lineno=128, + end_col_offset=17), + FunctionDef( + 'nswe_points', + arguments( + [], + [ + arg( + 'self', + lineno=131, + col_offset=16, + end_lineno=131, + end_col_offset=20), + arg( + 'point', + lineno=131, + col_offset=22, + end_lineno=131, + end_col_offset=27)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Expr( + Constant( + 'return a set of four adjacent points', + lineno=132, + col_offset=4, + end_lineno=132, + end_col_offset=46), + lineno=132, + col_offset=4, + end_lineno=132, + end_col_offset=46), + Assign( + [ + Name( + 'nswe_offsets', + Store(), + lineno=133, + col_offset=4, + end_lineno=133, + end_col_offset=16)], + Call( + Name( + 'set', + Load(), + lineno=133, + col_offset=19, + end_lineno=133, + end_col_offset=22), + [ + List( + [ + Tuple( + [ + Constant( + 1, + lineno=133, + col_offset=25, + end_lineno=133, + end_col_offset=26), + Constant( + 0, + lineno=133, + col_offset=28, + end_lineno=133, + end_col_offset=29)], + Load(), + lineno=133, + col_offset=24, + end_lineno=133, + end_col_offset=30), + Tuple( + [ + UnaryOp( + USub(), + Constant( + 1, + lineno=133, + col_offset=34, + end_lineno=133, + end_col_offset=35), + lineno=133, + col_offset=33, + end_lineno=133, + end_col_offset=35), + Constant( + 0, + lineno=133, + col_offset=37, + end_lineno=133, + end_col_offset=38)], + Load(), + lineno=133, + col_offset=32, + end_lineno=133, + end_col_offset=39), + Tuple( + [ + Constant( + 0, + lineno=133, + col_offset=42, + end_lineno=133, + end_col_offset=43), + UnaryOp( + USub(), + Constant( + 1, + lineno=133, + col_offset=46, + end_lineno=133, + end_col_offset=47), + lineno=133, + col_offset=45, + end_lineno=133, + end_col_offset=47)], + Load(), + lineno=133, + col_offset=41, + end_lineno=133, + end_col_offset=48), + Tuple( + [ + Constant( + 0, + lineno=133, + col_offset=51, + end_lineno=133, + end_col_offset=52), + Constant( + 1, + lineno=133, + col_offset=54, + end_lineno=133, + end_col_offset=55)], + Load(), + lineno=133, + col_offset=50, + end_lineno=133, + end_col_offset=56)], + Load(), + lineno=133, + col_offset=23, + end_lineno=133, + end_col_offset=57)], + [], + lineno=133, + col_offset=19, + end_lineno=133, + end_col_offset=58), + lineno=133, + col_offset=4, + end_lineno=133, + end_col_offset=58), + Return( + SetComp( + Name( + 'neighbor', + Load(), + lineno=135, + col_offset=8, + end_lineno=135, + end_col_offset=16), + [ + comprehension( + Name( + 'offset', + Store(), + lineno=136, + col_offset=12, + end_lineno=136, + end_col_offset=18), + Name( + 'nswe_offsets', + Load(), + lineno=136, + col_offset=22, + end_lineno=136, + end_col_offset=34), + [ + Call( + Attribute( + Name( + 'self', + Load(), + lineno=137, + col_offset=11, + end_lineno=137, + end_col_offset=15), + 'on_the_board', + Load(), + lineno=137, + col_offset=11, + end_lineno=137, + end_col_offset=28), + [ + NamedExpr( + Name( + 'neighbor', + Store(), + lineno=137, + col_offset=29, + end_lineno=137, + end_col_offset=37), + BinOp( + Name( + 'point', + Load(), + lineno=137, + col_offset=41, + end_lineno=137, + end_col_offset=46), + Add(), + Name( + 'offset', + Load(), + lineno=137, + col_offset=49, + end_lineno=137, + end_col_offset=55), + lineno=137, + col_offset=41, + end_lineno=137, + end_col_offset=55), + lineno=137, + col_offset=29, + end_lineno=137, + end_col_offset=55)], + [], + lineno=137, + col_offset=11, + end_lineno=137, + end_col_offset=56)], + 0)], + lineno=134, + col_offset=11, + end_lineno=138, + end_col_offset=5), + lineno=134, + col_offset=4, + end_lineno=138, + end_col_offset=5)], + [], + lineno=131, + col_offset=0, + end_lineno=138, + end_col_offset=5), + FunctionDef( + 'first_item_greater_than_N', + arguments( + [], + [ + arg( + 'iterable', + lineno=141, + col_offset=30, + end_lineno=141, + end_col_offset=38), + arg( + 'N', + lineno=141, + col_offset=40, + end_lineno=141, + end_col_offset=41)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + If( + Call( + Name( + 'any', + Load(), + lineno=142, + col_offset=7, + end_lineno=142, + end_col_offset=10), + [ + GeneratorExp( + Compare( + NamedExpr( + Name( + 'item', + Store(), + lineno=142, + col_offset=12, + end_lineno=142, + end_col_offset=16), + Name( + 'x', + Load(), + lineno=142, + col_offset=20, + end_lineno=142, + end_col_offset=21), + lineno=142, + col_offset=12, + end_lineno=142, + end_col_offset=21), + [ + Gt()], + [ + Name( + 'N', + Load(), + lineno=142, + col_offset=25, + end_lineno=142, + end_col_offset=26)], + lineno=142, + col_offset=11, + end_lineno=142, + end_col_offset=26), + [ + comprehension( + Name( + 'x', + Store(), + lineno=142, + col_offset=31, + end_lineno=142, + end_col_offset=32), + Name( + 'iterable', + Load(), + lineno=142, + col_offset=36, + end_lineno=142, + end_col_offset=44), + [], + 0)], + lineno=142, + col_offset=10, + end_lineno=142, + end_col_offset=45)], + [], + lineno=142, + col_offset=7, + end_lineno=142, + end_col_offset=45), + [ + Return( + Name( + 'item', + Load(), + lineno=143, + col_offset=15, + end_lineno=143, + end_col_offset=19), + lineno=143, + col_offset=8, + end_lineno=143, + end_col_offset=19)], + [], + lineno=142, + col_offset=4, + end_lineno=143, + end_col_offset=19), + Return( + Constant( + None, + lineno=144, + col_offset=11, + end_lineno=144, + end_col_offset=15), + lineno=144, + col_offset=4, + end_lineno=144, + end_col_offset=15)], + [], + lineno=141, + col_offset=0, + end_lineno=144, + end_col_offset=15), + FunctionDef( + 'generate_codes', + arguments( + [], + [ + arg( + 'seat_numbers', + lineno=147, + col_offset=19, + end_lineno=147, + end_col_offset=31), + arg( + 'flight_id', + lineno=147, + col_offset=33, + end_lineno=147, + end_col_offset=42)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Expr( + Constant( + 'Generate codes for a ticket.\n\n :param seat_numbers: list[str] - list of seat numbers.\n :param flight_id: str - string containing the flight identifier.\n :return: generator - generator that yields 12 character long ticket codes.\n\n ', + lineno=148, + col_offset=4, + end_lineno=154, + end_col_offset=7), + lineno=148, + col_offset=4, + end_lineno=154, + end_col_offset=7), + Return( + GeneratorExp( + Call( + Attribute( + Name( + 'base', + Load(), + lineno=156, + col_offset=8, + end_lineno=156, + end_col_offset=12), + 'ljust', + Load(), + lineno=156, + col_offset=8, + end_lineno=156, + end_col_offset=18), + [ + Constant( + 12, + lineno=156, + col_offset=19, + end_lineno=156, + end_col_offset=21), + Constant( + '0', + lineno=156, + col_offset=23, + end_lineno=156, + end_col_offset=26)], + [], + lineno=156, + col_offset=8, + end_lineno=156, + end_col_offset=27), + [ + comprehension( + Name( + 'seat', + Store(), + lineno=156, + col_offset=32, + end_lineno=156, + end_col_offset=36), + Name( + 'seat_numbers', + Load(), + lineno=156, + col_offset=40, + end_lineno=156, + end_col_offset=52), + [ + NamedExpr( + Name( + 'base', + Store(), + lineno=156, + col_offset=57, + end_lineno=156, + end_col_offset=61), + JoinedStr( + [ + FormattedValue( + Name( + 'seat', + Load(), + lineno=156, + col_offset=68, + end_lineno=156, + end_col_offset=72), + -1, + lineno=156, + col_offset=65, + end_lineno=156, + end_col_offset=85), + FormattedValue( + Name( + 'flight_id', + Load(), + lineno=156, + col_offset=74, + end_lineno=156, + end_col_offset=83), + -1, + lineno=156, + col_offset=65, + end_lineno=156, + end_col_offset=85)], + lineno=156, + col_offset=65, + end_lineno=156, + end_col_offset=85), + lineno=156, + col_offset=57, + end_lineno=156, + end_col_offset=85)], + 0)], + lineno=155, + col_offset=11, + end_lineno=157, + end_col_offset=5), + lineno=155, + col_offset=4, + end_lineno=157, + end_col_offset=5)], + [], + lineno=147, + col_offset=0, + end_lineno=157, + end_col_offset=5)], + []) +## END TREE BEFORE ## + +## BEGIN NORMALIZED TREE ## +Module( + [ + Import( + [ + alias( + 'unittest', + lineno=6, + col_offset=7, + end_lineno=6, + end_col_offset=15)], + lineno=6, + col_offset=0, + end_lineno=6, + end_col_offset=15), + Import( + [ + alias( + 'pytest', + lineno=7, + col_offset=7, + end_lineno=7, + end_col_offset=13)], + lineno=7, + col_offset=0, + end_lineno=7, + end_col_offset=13), + ImportFrom( + 'dataclass', + [ + alias( + 'dataclass', + lineno=8, + col_offset=22, + end_lineno=8, + end_col_offset=31)], + 0, + lineno=8, + col_offset=0, + end_lineno=8, + end_col_offset=31), + ImportFrom( + 'Enum', + [ + alias( + 'Flag', + lineno=9, + col_offset=17, + end_lineno=9, + end_col_offset=21)], + 0, + lineno=9, + col_offset=0, + end_lineno=9, + end_col_offset=21), + ClassDef( + 'placeholder_0', + [], + [], + [ + Assign( + [ + Name( + 'placeholder_1', + Store(), + lineno=20, + col_offset=4, + end_lineno=20, + end_col_offset=5)], + Constant( + 0, + lineno=20, + col_offset=13, + end_lineno=20, + end_col_offset=14), + lineno=20), + Assign( + [ + Name( + 'placeholder_2', + Store(), + lineno=21, + col_offset=4, + end_lineno=21, + end_col_offset=5)], + Constant( + 0, + lineno=21, + col_offset=13, + end_lineno=21, + end_col_offset=14), + lineno=21)], + [ + Name( + 'dataclass', + Load(), + lineno=17, + col_offset=1, + end_lineno=17, + end_col_offset=10)], + lineno=18, + col_offset=0, + end_lineno=21, + end_col_offset=14), + Try( + [ + Expr( + BinOp( + Constant( + 1, + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=5), + Div(), + Constant( + 0, + lineno=26, + col_offset=6, + end_lineno=26, + end_col_offset=7), + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=7), + lineno=26, + col_offset=4, + end_lineno=26, + end_col_offset=7)], + [ + ExceptHandler( + body=[ + Pass( + lineno=28, + col_offset=4, + end_lineno=28, + end_col_offset=8)], + lineno=27, + col_offset=0, + end_lineno=28, + end_col_offset=8)], + [], + [], + lineno=25, + col_offset=0, + end_lineno=28, + end_col_offset=8), + Expr( + BinOp( + Constant( + 5, + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=1), + Add(), + Constant( + 6, + lineno=32, + col_offset=2, + end_lineno=32, + end_col_offset=3), + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=3), + lineno=32, + col_offset=0, + end_lineno=32, + end_col_offset=3), + Expr( + GeneratorExp( + Name( + 'placeholder_3', + Load(), + lineno=40, + col_offset=1, + end_lineno=40, + end_col_offset=5), + [ + comprehension( + Name( + 'placeholder_3', + Store(), + lineno=40, + col_offset=10, + end_lineno=40, + end_col_offset=14), + Call( + Name( + 'range', + Load(), + lineno=40, + col_offset=18, + end_lineno=40, + end_col_offset=23), + [ + Constant( + 8, + lineno=40, + col_offset=24, + end_lineno=40, + end_col_offset=25)], + [], + lineno=40, + col_offset=18, + end_lineno=40, + end_col_offset=26), + [], + 0)], + lineno=40, + col_offset=0, + end_lineno=40, + end_col_offset=27), + lineno=40, + col_offset=0, + end_lineno=40, + end_col_offset=27), + Expr( + ListComp( + Name( + 'placeholder_3', + Load(), + lineno=41, + col_offset=1, + end_lineno=41, + end_col_offset=5), + [ + comprehension( + Name( + 'placeholder_3', + Store(), + lineno=41, + col_offset=10, + end_lineno=41, + end_col_offset=14), + Call( + Name( + 'range', + Load(), + lineno=41, + col_offset=18, + end_lineno=41, + end_col_offset=23), + [ + Constant( + 16, + lineno=41, + col_offset=24, + end_lineno=41, + end_col_offset=26)], + [], + lineno=41, + col_offset=18, + end_lineno=41, + end_col_offset=27), + [], + 0)], + lineno=41, + col_offset=0, + end_lineno=41, + end_col_offset=28), + lineno=41, + col_offset=0, + end_lineno=41, + end_col_offset=28), + Expr( + SetComp( + Name( + 'placeholder_3', + Load(), + lineno=42, + col_offset=1, + end_lineno=42, + end_col_offset=5), + [ + comprehension( + Name( + 'placeholder_3', + Store(), + lineno=42, + col_offset=10, + end_lineno=42, + end_col_offset=14), + Call( + Attribute( + Constant( + 'a b c d e f g h i', + lineno=42, + col_offset=18, + end_lineno=42, + end_col_offset=37), + 'split', + Load(), + lineno=42, + col_offset=18, + end_lineno=42, + end_col_offset=43), + [], + [], + lineno=42, + col_offset=18, + end_lineno=42, + end_col_offset=45), + [], + 0)], + lineno=42, + col_offset=0, + end_lineno=42, + end_col_offset=46), + lineno=42, + col_offset=0, + end_lineno=42, + end_col_offset=46), + Expr( + DictComp( + Name( + 'placeholder_4', + Load(), + lineno=43, + col_offset=1, + end_lineno=43, + end_col_offset=4), + Name( + 'placeholder_5', + Load(), + lineno=43, + col_offset=5, + end_lineno=43, + end_col_offset=10), + [ + comprehension( + Tuple( + [ + Name( + 'placeholder_4', + Store(), + lineno=43, + col_offset=15, + end_lineno=43, + end_col_offset=18), + Name( + 'placeholder_5', + Store(), + lineno=43, + col_offset=20, + end_lineno=43, + end_col_offset=25)], + Store(), + lineno=43, + col_offset=15, + end_lineno=43, + end_col_offset=25), + Tuple( + [ + Tuple( + [ + Constant( + 1, + lineno=43, + col_offset=31, + end_lineno=43, + end_col_offset=32), + Constant( + 'a', + lineno=43, + col_offset=34, + end_lineno=43, + end_col_offset=37)], + Load(), + lineno=43, + col_offset=30, + end_lineno=43, + end_col_offset=38), + Tuple( + [ + Constant( + 2, + lineno=43, + col_offset=40, + end_lineno=43, + end_col_offset=41), + Constant( + 'b', + lineno=43, + col_offset=43, + end_lineno=43, + end_col_offset=46)], + Load(), + lineno=43, + col_offset=39, + end_lineno=43, + end_col_offset=47), + Tuple( + [ + Constant( + 3, + lineno=43, + col_offset=49, + end_lineno=43, + end_col_offset=50), + Constant( + 'c', + lineno=43, + col_offset=52, + end_lineno=43, + end_col_offset=55)], + Load(), + lineno=43, + col_offset=48, + end_lineno=43, + end_col_offset=56), + Tuple( + [ + Constant( + 5, + lineno=43, + col_offset=58, + end_lineno=43, + end_col_offset=59), + Constant( + 'e', + lineno=43, + col_offset=61, + end_lineno=43, + end_col_offset=64)], + Load(), + lineno=43, + col_offset=57, + end_lineno=43, + end_col_offset=65)], + Load(), + lineno=43, + col_offset=29, + end_lineno=43, + end_col_offset=66), + [], + 0)], + lineno=43, + col_offset=0, + end_lineno=43, + end_col_offset=67), + lineno=43, + col_offset=0, + end_lineno=43, + end_col_offset=67), + Expr( + Lambda( + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + DictComp( + Name( + 'placeholder_4', + Load(), + lineno=46, + col_offset=10, + end_lineno=46, + end_col_offset=13), + Name( + 'placeholder_5', + Load(), + lineno=46, + col_offset=14, + end_lineno=46, + end_col_offset=19), + [ + comprehension( + Tuple( + [ + Name( + 'placeholder_4', + Store(), + lineno=46, + col_offset=24, + end_lineno=46, + end_col_offset=27), + Name( + 'placeholder_5', + Store(), + lineno=46, + col_offset=29, + end_lineno=46, + end_col_offset=34)], + Store(), + lineno=46, + col_offset=24, + end_lineno=46, + end_col_offset=34), + Tuple( + [ + Tuple( + [ + Constant( + 1, + lineno=46, + col_offset=40, + end_lineno=46, + end_col_offset=41), + Constant( + 'a', + lineno=46, + col_offset=43, + end_lineno=46, + end_col_offset=46)], + Load(), + lineno=46, + col_offset=39, + end_lineno=46, + end_col_offset=47), + Tuple( + [ + Constant( + 2, + lineno=46, + col_offset=49, + end_lineno=46, + end_col_offset=50), + Constant( + 'b', + lineno=46, + col_offset=52, + end_lineno=46, + end_col_offset=55)], + Load(), + lineno=46, + col_offset=48, + end_lineno=46, + end_col_offset=56), + Tuple( + [ + Constant( + 3, + lineno=46, + col_offset=58, + end_lineno=46, + end_col_offset=59), + Constant( + 'c', + lineno=46, + col_offset=61, + end_lineno=46, + end_col_offset=64)], + Load(), + lineno=46, + col_offset=57, + end_lineno=46, + end_col_offset=65), + Tuple( + [ + Constant( + 5, + lineno=46, + col_offset=67, + end_lineno=46, + end_col_offset=68), + Constant( + 'e', + lineno=46, + col_offset=70, + end_lineno=46, + end_col_offset=73)], + Load(), + lineno=46, + col_offset=66, + end_lineno=46, + end_col_offset=74)], + Load(), + lineno=46, + col_offset=38, + end_lineno=46, + end_col_offset=75), + [], + 0)], + lineno=46, + col_offset=9, + end_lineno=46, + end_col_offset=76), + lineno=46, + col_offset=0, + end_lineno=46, + end_col_offset=76), + lineno=46, + col_offset=0, + end_lineno=46, + end_col_offset=76), + Assign( + [ + Name( + 'placeholder_6', + Store(), + lineno=47, + col_offset=0, + end_lineno=47, + end_col_offset=16)], + Lambda( + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + SetComp( + Name( + 'placeholder_3', + Load(), + lineno=47, + col_offset=29, + end_lineno=47, + end_col_offset=33), + [ + comprehension( + Name( + 'placeholder_3', + Store(), + lineno=47, + col_offset=38, + end_lineno=47, + end_col_offset=42), + Call( + Attribute( + Constant( + 'a b c d e f g h i', + lineno=47, + col_offset=46, + end_lineno=47, + end_col_offset=65), + 'split', + Load(), + lineno=47, + col_offset=46, + end_lineno=47, + end_col_offset=71), + [], + [], + lineno=47, + col_offset=46, + end_lineno=47, + end_col_offset=73), + [], + 0)], + lineno=47, + col_offset=28, + end_lineno=47, + end_col_offset=74), + lineno=47, + col_offset=19, + end_lineno=47, + end_col_offset=74), + lineno=47, + col_offset=0, + end_lineno=47, + end_col_offset=74), + Expr( + UnaryOp( + USub(), + Name( + 'a', + Load(), + lineno=51, + col_offset=1, + end_lineno=51, + end_col_offset=2), + lineno=51, + col_offset=0, + end_lineno=51, + end_col_offset=2), + lineno=51, + col_offset=0, + end_lineno=51, + end_col_offset=2), + Assign( + [ + Name( + 'placeholder_7', + Store(), + lineno=52, + col_offset=0, + end_lineno=52, + end_col_offset=18)], + Constant( + 'It would be stupid if this exploded.', + lineno=52, + col_offset=21, + end_lineno=52, + end_col_offset=59), + lineno=52, + col_offset=0, + end_lineno=52, + end_col_offset=59), + Expr( + Constant( + 'Random Hanging String', + lineno=54, + col_offset=0, + end_lineno=54, + end_col_offset=27), + lineno=54, + col_offset=0, + end_lineno=54, + end_col_offset=27), + ClassDef( + 'placeholder_8', + [ + Name( + 'Flag', + Load(), + lineno=58, + col_offset=16, + end_lineno=58, + end_col_offset=20)], + [], + [ + Assign( + [ + Name( + 'placeholder_9', + Store(), + lineno=59, + col_offset=4, + end_lineno=59, + end_col_offset=8)], + Call( + Name( + 'auto', + Load(), + lineno=59, + col_offset=11, + end_lineno=59, + end_col_offset=15), + [], + [], + lineno=59, + col_offset=11, + end_lineno=59, + end_col_offset=17), + lineno=59, + col_offset=4, + end_lineno=59, + end_col_offset=17), + Assign( + [ + Name( + 'placeholder_10', + Store(), + lineno=60, + col_offset=4, + end_lineno=60, + end_col_offset=11)], + Call( + Name( + 'auto', + Load(), + lineno=60, + col_offset=14, + end_lineno=60, + end_col_offset=18), + [], + [], + lineno=60, + col_offset=14, + end_lineno=60, + end_col_offset=20), + lineno=60, + col_offset=4, + end_lineno=60, + end_col_offset=20), + Assign( + [ + Name( + 'placeholder_11', + Store(), + lineno=61, + col_offset=4, + end_lineno=61, + end_col_offset=13)], + Call( + Name( + 'auto', + Load(), + lineno=61, + col_offset=16, + end_lineno=61, + end_col_offset=20), + [], + [], + lineno=61, + col_offset=16, + end_lineno=61, + end_col_offset=22), + lineno=61, + col_offset=4, + end_lineno=61, + end_col_offset=22), + Assign( + [ + Name( + 'placeholder_12', + Store(), + lineno=62, + col_offset=4, + end_lineno=62, + end_col_offset=16)], + Call( + Name( + 'auto', + Load(), + lineno=62, + col_offset=19, + end_lineno=62, + end_col_offset=23), + [], + [], + lineno=62, + col_offset=19, + end_lineno=62, + end_col_offset=25), + lineno=62, + col_offset=4, + end_lineno=62, + end_col_offset=25), + Assign( + [ + Name( + 'placeholder_13', + Store(), + lineno=63, + col_offset=4, + end_lineno=63, + end_col_offset=12)], + Call( + Name( + 'auto', + Load(), + lineno=63, + col_offset=15, + end_lineno=63, + end_col_offset=19), + [], + [], + lineno=63, + col_offset=15, + end_lineno=63, + end_col_offset=21), + lineno=63, + col_offset=4, + end_lineno=63, + end_col_offset=21), + Assign( + [ + Name( + 'placeholder_14', + Store(), + lineno=64, + col_offset=4, + end_lineno=64, + end_col_offset=13)], + Call( + Name( + 'auto', + Load(), + lineno=64, + col_offset=16, + end_lineno=64, + end_col_offset=20), + [], + [], + lineno=64, + col_offset=16, + end_lineno=64, + end_col_offset=22), + lineno=64, + col_offset=4, + end_lineno=64, + end_col_offset=22), + Assign( + [ + Name( + 'placeholder_15', + Store(), + lineno=65, + col_offset=4, + end_lineno=65, + end_col_offset=10)], + Call( + Name( + 'auto', + Load(), + lineno=65, + col_offset=13, + end_lineno=65, + end_col_offset=17), + [], + [], + lineno=65, + col_offset=13, + end_lineno=65, + end_col_offset=19), + lineno=65, + col_offset=4, + end_lineno=65, + end_col_offset=19), + Assign( + [ + Name( + 'placeholder_16', + Store(), + lineno=66, + col_offset=4, + end_lineno=66, + end_col_offset=8)], + Call( + Name( + 'auto', + Load(), + lineno=66, + col_offset=11, + end_lineno=66, + end_col_offset=15), + [], + [], + lineno=66, + col_offset=11, + end_lineno=66, + end_col_offset=17), + lineno=66, + col_offset=4, + end_lineno=66, + end_col_offset=17)], + [], + lineno=58, + col_offset=0, + end_lineno=66, + end_col_offset=17), + Try( + [ + ImportFrom( + 'lasagna', + [ + alias( + 'EXPECTED_BAKE_TIME', + lineno=74, + col_offset=25, + end_lineno=74, + end_col_offset=43), + alias( + 'bake_time_remaining', + lineno=75, + col_offset=25, + end_lineno=75, + end_col_offset=44), + alias( + 'preparation_time_in_minutes', + lineno=76, + col_offset=25, + end_lineno=76, + end_col_offset=52), + alias( + 'elapsed_time_in_minutes', + lineno=77, + col_offset=25, + end_lineno=77, + end_col_offset=48)], + 0, + lineno=74, + col_offset=4, + end_lineno=77, + end_col_offset=49)], + [ + ExceptHandler( + Name( + 'ImportError', + Load(), + lineno=80, + col_offset=7, + end_lineno=80, + end_col_offset=18), + 'placeholder_17', + [ + Assign( + [ + Name( + 'placeholder_18', + Store(), + lineno=81, + col_offset=4, + end_lineno=81, + end_col_offset=11)], + Call( + Attribute( + Subscript( + Attribute( + Name( + 'placeholder_17', + Load(), + lineno=81, + col_offset=14, + end_lineno=81, + end_col_offset=25), + 'args', + Load(), + lineno=81, + col_offset=14, + end_lineno=81, + end_col_offset=30), + Constant( + 0, + lineno=81, + col_offset=31, + end_lineno=81, + end_col_offset=32), + Load(), + lineno=81, + col_offset=14, + end_lineno=81, + end_col_offset=33), + 'split', + Load(), + lineno=81, + col_offset=14, + end_lineno=81, + end_col_offset=39), + [ + Constant( + '(', + lineno=81, + col_offset=40, + end_lineno=81, + end_col_offset=43)], + [ + keyword( + 'placeholder_19', + Constant( + 1, + lineno=81, + col_offset=54, + end_lineno=81, + end_col_offset=55), + lineno=81, + col_offset=45, + end_lineno=81, + end_col_offset=55)], + lineno=81, + col_offset=14, + end_lineno=81, + end_col_offset=56), + lineno=81, + col_offset=4, + end_lineno=81, + end_col_offset=56), + Assign( + [ + Name( + 'placeholder_20', + Store(), + lineno=82, + col_offset=4, + end_lineno=82, + end_col_offset=13)], + Subscript( + Call( + Attribute( + Subscript( + Attribute( + Name( + 'placeholder_17', + Load(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=27), + 'args', + Load(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=32), + Constant( + 0, + lineno=82, + col_offset=33, + end_lineno=82, + end_col_offset=34), + Load(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=35), + 'split', + Load(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=41), + [], + [], + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=43), + Constant( + 3, + lineno=82, + col_offset=44, + end_lineno=82, + end_col_offset=45), + Load(), + lineno=82, + col_offset=16, + end_lineno=82, + end_col_offset=46), + lineno=82, + col_offset=4, + end_lineno=82, + end_col_offset=46), + If( + Compare( + Constant( + 'EXPECTED_BAKE_TIME', + lineno=84, + col_offset=7, + end_lineno=84, + end_col_offset=27), + [ + In()], + [ + Name( + 'placeholder_20', + Load(), + lineno=84, + col_offset=31, + end_lineno=84, + end_col_offset=40)], + lineno=84, + col_offset=7, + end_lineno=84, + end_col_offset=40), + [ + Raise( + Call( + Name( + 'ImportError', + Load(), + lineno=86, + col_offset=14, + end_lineno=86, + end_col_offset=25), + [ + JoinedStr( + [ + Constant( + '\n\nMISSING CONSTANT --> \nWe can not find or import the constant ', + lineno=86, + col_offset=26, + end_lineno=87, + end_col_offset=88), + FormattedValue( + Name( + 'placeholder_20', + Load(), + lineno=86, + col_offset=95, + end_lineno=86, + end_col_offset=104), + -1, + lineno=86, + col_offset=26, + end_lineno=87, + end_col_offset=88), + Constant( + " in your 'lasagna.py' file.\nDid you misname or forget to define it?", + lineno=86, + col_offset=26, + end_lineno=87, + end_col_offset=88)], + lineno=86, + col_offset=26, + end_lineno=87, + end_col_offset=88)], + [], + lineno=86, + col_offset=14, + end_lineno=87, + end_col_offset=89), + Constant( + None, + lineno=87, + col_offset=95, + end_lineno=87, + end_col_offset=99), + lineno=86, + col_offset=8, + end_lineno=87, + end_col_offset=99)], + [ + Assign( + [ + Name( + 'placeholder_20', + Store(), + lineno=89, + col_offset=8, + end_lineno=89, + end_col_offset=17)], + BinOp( + Subscript( + Name( + 'placeholder_20', + Load(), + lineno=89, + col_offset=20, + end_lineno=89, + end_col_offset=29), + Slice( + upper=UnaryOp( + USub(), + Constant( + 1, + lineno=89, + col_offset=32, + end_lineno=89, + end_col_offset=33), + lineno=89, + col_offset=31, + end_lineno=89, + end_col_offset=33), + lineno=89, + col_offset=30, + end_lineno=89, + end_col_offset=33), + Load(), + lineno=89, + col_offset=20, + end_lineno=89, + end_col_offset=34), + Add(), + Constant( + "()'", + lineno=89, + col_offset=37, + end_lineno=89, + end_col_offset=42), + lineno=89, + col_offset=20, + end_lineno=89, + end_col_offset=42), + lineno=89, + col_offset=8, + end_lineno=89, + end_col_offset=42), + Raise( + Call( + Name( + 'ImportError', + Load(), + lineno=91, + col_offset=14, + end_lineno=91, + end_col_offset=25), + [ + JoinedStr( + [ + Constant( + "\n\nMISSING FUNCTION --> In your 'lasagna.py' file, we can not find or import the function named ", + lineno=91, + col_offset=26, + end_lineno=92, + end_col_offset=99), + FormattedValue( + Name( + 'placeholder_20', + Load(), + lineno=92, + col_offset=45, + end_lineno=92, + end_col_offset=54), + -1, + lineno=91, + col_offset=26, + end_lineno=92, + end_col_offset=99), + Constant( + '. \nDid you misname or forget to define it?', + lineno=91, + col_offset=26, + end_lineno=92, + end_col_offset=99)], + lineno=91, + col_offset=26, + end_lineno=92, + end_col_offset=99)], + [], + lineno=91, + col_offset=14, + end_lineno=92, + end_col_offset=100), + Constant( + None, + lineno=92, + col_offset=106, + end_lineno=92, + end_col_offset=110), + lineno=91, + col_offset=8, + end_lineno=92, + end_col_offset=110)], + lineno=84, + col_offset=4, + end_lineno=92, + end_col_offset=110)], + lineno=80, + col_offset=0, + end_lineno=92, + end_col_offset=110)], + [], + [], + lineno=73, + col_offset=0, + end_lineno=92, + end_col_offset=110), + FunctionDef( + 'placeholder_21', + arguments( + [], + [ + arg( + 'placeholder_22', + lineno=99, + col_offset=11, + end_lineno=99, + end_col_offset=17), + arg( + 'placeholder_23', + lineno=99, + col_offset=19, + end_lineno=99, + end_col_offset=25)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Return( + ListComp( + Name( + 'placeholder_26', + Load(), + lineno=105, + col_offset=8, + end_lineno=105, + end_col_offset=15), + [ + comprehension( + Tuple( + [ + Name( + 'placeholder_24', + Store(), + lineno=106, + col_offset=12, + end_lineno=106, + end_col_offset=13), + Name( + 'placeholder_25', + Store(), + lineno=106, + col_offset=15, + end_lineno=106, + end_col_offset=16)], + Store(), + lineno=106, + col_offset=12, + end_lineno=106, + end_col_offset=16), + Call( + Name( + 'enumerate', + Load(), + lineno=106, + col_offset=20, + end_lineno=106, + end_col_offset=29), + [ + Name( + 'placeholder_22', + Load(), + lineno=106, + col_offset=30, + end_lineno=106, + end_col_offset=36)], + [], + lineno=106, + col_offset=20, + end_lineno=106, + end_col_offset=37), + [ + Compare( + Call( + Name( + 'len', + Load(), + lineno=107, + col_offset=11, + end_lineno=107, + end_col_offset=14), + [ + NamedExpr( + Name( + 'placeholder_26', + Store(), + lineno=107, + col_offset=15, + end_lineno=107, + end_col_offset=22), + Subscript( + Name( + 'placeholder_22', + Load(), + lineno=107, + col_offset=26, + end_lineno=107, + end_col_offset=32), + Slice( + Name( + 'placeholder_24', + Load(), + lineno=107, + col_offset=33, + end_lineno=107, + end_col_offset=34), + BinOp( + Name( + 'placeholder_24', + Load(), + lineno=107, + col_offset=37, + end_lineno=107, + end_col_offset=38), + Add(), + Name( + 'placeholder_23', + Load(), + lineno=107, + col_offset=41, + end_lineno=107, + end_col_offset=47), + lineno=107, + col_offset=37, + end_lineno=107, + end_col_offset=47), + lineno=107, + col_offset=33, + end_lineno=107, + end_col_offset=47), + Load(), + lineno=107, + col_offset=26, + end_lineno=107, + end_col_offset=48), + lineno=107, + col_offset=15, + end_lineno=107, + end_col_offset=48)], + [], + lineno=107, + col_offset=11, + end_lineno=107, + end_col_offset=49), + [ + Eq()], + [ + Name( + 'placeholder_23', + Load(), + lineno=107, + col_offset=53, + end_lineno=107, + end_col_offset=59)], + lineno=107, + col_offset=11, + end_lineno=107, + end_col_offset=59)], + 0)], + lineno=104, + col_offset=11, + end_lineno=108, + end_col_offset=5), + lineno=104, + col_offset=4, + end_lineno=108, + end_col_offset=5)], + [], + lineno=99, + col_offset=0, + end_lineno=108, + end_col_offset=5), + ImportFrom( + 'typing', + [ + alias( + 'Iterable', + lineno=112, + col_offset=19, + end_lineno=112, + end_col_offset=27)], + 0, + lineno=112, + col_offset=0, + end_lineno=112, + end_col_offset=27), + FunctionDef( + 'placeholder_27', + arguments( + [], + [ + arg( + 'placeholder_28', + lineno=113, + col_offset=12, + end_lineno=113, + end_col_offset=20)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + FunctionDef( + 'placeholder_29', + arguments( + [], + [ + arg( + 'placeholder_30', + lineno=114, + col_offset=11, + end_lineno=114, + end_col_offset=13)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + For( + Name( + 'placeholder_31', + Store(), + lineno=115, + col_offset=12, + end_lineno=115, + end_col_offset=13), + Name( + 'placeholder_30', + Load(), + lineno=115, + col_offset=17, + end_lineno=115, + end_col_offset=19), + [ + If( + BoolOp( + And(), + [ + Call( + Name( + 'isinstance', + Load(), + lineno=116, + col_offset=15, + end_lineno=116, + end_col_offset=25), + [ + Name( + 'placeholder_31', + Load(), + lineno=116, + col_offset=26, + end_lineno=116, + end_col_offset=27), + Name( + 'Iterable', + Load(), + lineno=116, + col_offset=29, + end_lineno=116, + end_col_offset=37)], + [], + lineno=116, + col_offset=15, + end_lineno=116, + end_col_offset=38), + UnaryOp( + Not(), + Call( + Name( + 'isinstance', + Load(), + lineno=116, + col_offset=47, + end_lineno=116, + end_col_offset=57), + [ + Name( + 'placeholder_31', + Load(), + lineno=116, + col_offset=58, + end_lineno=116, + end_col_offset=59), + Name( + 'str', + Load(), + lineno=116, + col_offset=61, + end_lineno=116, + end_col_offset=64)], + [], + lineno=116, + col_offset=47, + end_lineno=116, + end_col_offset=65), + lineno=116, + col_offset=43, + end_lineno=116, + end_col_offset=65)], + lineno=116, + col_offset=15, + end_lineno=116, + end_col_offset=65), + [ + Expr( + YieldFrom( + Call( + Name( + 'placeholder_29', + Load(), + lineno=117, + col_offset=27, + end_lineno=117, + end_col_offset=29), + [ + Name( + 'placeholder_31', + Load(), + lineno=117, + col_offset=30, + end_lineno=117, + end_col_offset=31)], + [], + lineno=117, + col_offset=27, + end_lineno=117, + end_col_offset=32), + lineno=117, + col_offset=16, + end_lineno=117, + end_col_offset=32), + lineno=117, + col_offset=16, + end_lineno=117, + end_col_offset=32)], + [ + Expr( + Yield( + Name( + 'placeholder_31', + Load(), + lineno=119, + col_offset=22, + end_lineno=119, + end_col_offset=23), + lineno=119, + col_offset=16, + end_lineno=119, + end_col_offset=23), + lineno=119, + col_offset=16, + end_lineno=119, + end_col_offset=23)], + lineno=116, + col_offset=12, + end_lineno=119, + end_col_offset=23)], + [], + lineno=115, + col_offset=8, + end_lineno=119, + end_col_offset=23)], + [], + lineno=114, + col_offset=4, + end_lineno=119, + end_col_offset=23), + Return( + ListComp( + Name( + 'placeholder_31', + Load(), + lineno=120, + col_offset=12, + end_lineno=120, + end_col_offset=13), + [ + comprehension( + Name( + 'placeholder_31', + Store(), + lineno=120, + col_offset=18, + end_lineno=120, + end_col_offset=19), + Call( + Name( + 'placeholder_29', + Load(), + lineno=120, + col_offset=23, + end_lineno=120, + end_col_offset=25), + [ + Name( + 'placeholder_28', + Load(), + lineno=120, + col_offset=26, + end_lineno=120, + end_col_offset=34)], + [], + lineno=120, + col_offset=23, + end_lineno=120, + end_col_offset=35), + [ + Compare( + Name( + 'placeholder_31', + Load(), + lineno=120, + col_offset=39, + end_lineno=120, + end_col_offset=40), + [ + IsNot()], + [ + Constant( + None, + lineno=120, + col_offset=48, + end_lineno=120, + end_col_offset=52)], + lineno=120, + col_offset=39, + end_lineno=120, + end_col_offset=52)], + 0)], + lineno=120, + col_offset=11, + end_lineno=120, + end_col_offset=53), + lineno=120, + col_offset=4, + end_lineno=120, + end_col_offset=53)], + [], + lineno=113, + col_offset=0, + end_lineno=120, + end_col_offset=53), + FunctionDef( + 'placeholder_32', + arguments( + [], + [ + arg( + 'placeholder_33', + lineno=124, + col_offset=17, + end_lineno=124, + end_col_offset=21)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + If( + BinOp( + NamedExpr( + Name( + 'placeholder_34', + Store(), + lineno=126, + col_offset=8, + end_lineno=126, + end_col_offset=14), + Call( + Name( + 'len', + Load(), + lineno=126, + col_offset=18, + end_lineno=126, + end_col_offset=21), + [ + Name( + 'placeholder_33', + Load(), + lineno=126, + col_offset=22, + end_lineno=126, + end_col_offset=26)], + [], + lineno=126, + col_offset=18, + end_lineno=126, + end_col_offset=27), + lineno=126, + col_offset=8, + end_lineno=126, + end_col_offset=27), + Mod(), + Constant( + 3, + lineno=126, + col_offset=31, + end_lineno=126, + end_col_offset=32), + lineno=126, + col_offset=7, + end_lineno=126, + end_col_offset=32), + [ + Raise( + Call( + Name( + 'ValueError', + Load(), + lineno=127, + col_offset=14, + end_lineno=127, + end_col_offset=24), + [ + Constant( + 'grid rows not a multiple of 4', + lineno=127, + col_offset=25, + end_lineno=127, + end_col_offset=56)], + [], + lineno=127, + col_offset=14, + end_lineno=127, + end_col_offset=57), + lineno=127, + col_offset=8, + end_lineno=127, + end_col_offset=57)], + [], + lineno=126, + col_offset=4, + end_lineno=127, + end_col_offset=57), + Return( + Name( + 'placeholder_34', + Load(), + lineno=128, + col_offset=11, + end_lineno=128, + end_col_offset=17), + lineno=128, + col_offset=4, + end_lineno=128, + end_col_offset=17)], + [], + lineno=124, + col_offset=0, + end_lineno=128, + end_col_offset=17), + FunctionDef( + 'placeholder_35', + arguments( + [], + [ + arg( + 'self', + lineno=131, + col_offset=16, + end_lineno=131, + end_col_offset=20), + arg( + 'placeholder_36', + lineno=131, + col_offset=22, + end_lineno=131, + end_col_offset=27)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Assign( + [ + Name( + 'placeholder_37', + Store(), + lineno=133, + col_offset=4, + end_lineno=133, + end_col_offset=16)], + Call( + Name( + 'set', + Load(), + lineno=133, + col_offset=19, + end_lineno=133, + end_col_offset=22), + [ + List( + [ + Tuple( + [ + Constant( + 1, + lineno=133, + col_offset=25, + end_lineno=133, + end_col_offset=26), + Constant( + 0, + lineno=133, + col_offset=28, + end_lineno=133, + end_col_offset=29)], + Load(), + lineno=133, + col_offset=24, + end_lineno=133, + end_col_offset=30), + Tuple( + [ + UnaryOp( + USub(), + Constant( + 1, + lineno=133, + col_offset=34, + end_lineno=133, + end_col_offset=35), + lineno=133, + col_offset=33, + end_lineno=133, + end_col_offset=35), + Constant( + 0, + lineno=133, + col_offset=37, + end_lineno=133, + end_col_offset=38)], + Load(), + lineno=133, + col_offset=32, + end_lineno=133, + end_col_offset=39), + Tuple( + [ + Constant( + 0, + lineno=133, + col_offset=42, + end_lineno=133, + end_col_offset=43), + UnaryOp( + USub(), + Constant( + 1, + lineno=133, + col_offset=46, + end_lineno=133, + end_col_offset=47), + lineno=133, + col_offset=45, + end_lineno=133, + end_col_offset=47)], + Load(), + lineno=133, + col_offset=41, + end_lineno=133, + end_col_offset=48), + Tuple( + [ + Constant( + 0, + lineno=133, + col_offset=51, + end_lineno=133, + end_col_offset=52), + Constant( + 1, + lineno=133, + col_offset=54, + end_lineno=133, + end_col_offset=55)], + Load(), + lineno=133, + col_offset=50, + end_lineno=133, + end_col_offset=56)], + Load(), + lineno=133, + col_offset=23, + end_lineno=133, + end_col_offset=57)], + [], + lineno=133, + col_offset=19, + end_lineno=133, + end_col_offset=58), + lineno=133, + col_offset=4, + end_lineno=133, + end_col_offset=58), + Return( + SetComp( + Name( + 'placeholder_39', + Load(), + lineno=135, + col_offset=8, + end_lineno=135, + end_col_offset=16), + [ + comprehension( + Name( + 'placeholder_38', + Store(), + lineno=136, + col_offset=12, + end_lineno=136, + end_col_offset=18), + Name( + 'placeholder_37', + Load(), + lineno=136, + col_offset=22, + end_lineno=136, + end_col_offset=34), + [ + Call( + Attribute( + Name( + 'self', + Load(), + lineno=137, + col_offset=11, + end_lineno=137, + end_col_offset=15), + 'on_the_board', + Load(), + lineno=137, + col_offset=11, + end_lineno=137, + end_col_offset=28), + [ + NamedExpr( + Name( + 'placeholder_39', + Store(), + lineno=137, + col_offset=29, + end_lineno=137, + end_col_offset=37), + BinOp( + Name( + 'placeholder_36', + Load(), + lineno=137, + col_offset=41, + end_lineno=137, + end_col_offset=46), + Add(), + Name( + 'placeholder_38', + Load(), + lineno=137, + col_offset=49, + end_lineno=137, + end_col_offset=55), + lineno=137, + col_offset=41, + end_lineno=137, + end_col_offset=55), + lineno=137, + col_offset=29, + end_lineno=137, + end_col_offset=55)], + [], + lineno=137, + col_offset=11, + end_lineno=137, + end_col_offset=56)], + 0)], + lineno=134, + col_offset=11, + end_lineno=138, + end_col_offset=5), + lineno=134, + col_offset=4, + end_lineno=138, + end_col_offset=5)], + [], + lineno=131, + col_offset=0, + end_lineno=138, + end_col_offset=5), + FunctionDef( + 'placeholder_40', + arguments( + [], + [ + arg( + 'placeholder_28', + lineno=141, + col_offset=30, + end_lineno=141, + end_col_offset=38), + arg( + 'placeholder_41', + lineno=141, + col_offset=40, + end_lineno=141, + end_col_offset=41)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + If( + Call( + Name( + 'any', + Load(), + lineno=142, + col_offset=7, + end_lineno=142, + end_col_offset=10), + [ + GeneratorExp( + Compare( + NamedExpr( + Name( + 'placeholder_42', + Store(), + lineno=142, + col_offset=12, + end_lineno=142, + end_col_offset=16), + Name( + 'placeholder_1', + Load(), + lineno=142, + col_offset=20, + end_lineno=142, + end_col_offset=21), + lineno=142, + col_offset=12, + end_lineno=142, + end_col_offset=21), + [ + Gt()], + [ + Name( + 'placeholder_41', + Load(), + lineno=142, + col_offset=25, + end_lineno=142, + end_col_offset=26)], + lineno=142, + col_offset=11, + end_lineno=142, + end_col_offset=26), + [ + comprehension( + Name( + 'placeholder_1', + Store(), + lineno=142, + col_offset=31, + end_lineno=142, + end_col_offset=32), + Name( + 'placeholder_28', + Load(), + lineno=142, + col_offset=36, + end_lineno=142, + end_col_offset=44), + [], + 0)], + lineno=142, + col_offset=10, + end_lineno=142, + end_col_offset=45)], + [], + lineno=142, + col_offset=7, + end_lineno=142, + end_col_offset=45), + [ + Return( + Name( + 'placeholder_3', + Load(), + lineno=143, + col_offset=15, + end_lineno=143, + end_col_offset=19), + lineno=143, + col_offset=8, + end_lineno=143, + end_col_offset=19)], + [], + lineno=142, + col_offset=4, + end_lineno=143, + end_col_offset=19), + Return( + Constant( + None, + lineno=144, + col_offset=11, + end_lineno=144, + end_col_offset=15), + lineno=144, + col_offset=4, + end_lineno=144, + end_col_offset=15)], + [], + lineno=141, + col_offset=0, + end_lineno=144, + end_col_offset=15), + FunctionDef( + 'placeholder_43', + arguments( + [], + [ + arg( + 'placeholder_44', + lineno=147, + col_offset=19, + end_lineno=147, + end_col_offset=31), + arg( + 'placeholder_45', + lineno=147, + col_offset=33, + end_lineno=147, + end_col_offset=42)], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Return( + GeneratorExp( + Call( + Attribute( + Name( + 'placeholder_47', + Load(), + lineno=156, + col_offset=8, + end_lineno=156, + end_col_offset=12), + 'ljust', + Load(), + lineno=156, + col_offset=8, + end_lineno=156, + end_col_offset=18), + [ + Constant( + 12, + lineno=156, + col_offset=19, + end_lineno=156, + end_col_offset=21), + Constant( + '0', + lineno=156, + col_offset=23, + end_lineno=156, + end_col_offset=26)], + [], + lineno=156, + col_offset=8, + end_lineno=156, + end_col_offset=27), + [ + comprehension( + Name( + 'placeholder_46', + Store(), + lineno=156, + col_offset=32, + end_lineno=156, + end_col_offset=36), + Name( + 'placeholder_44', + Load(), + lineno=156, + col_offset=40, + end_lineno=156, + end_col_offset=52), + [ + NamedExpr( + Name( + 'placeholder_47', + Store(), + lineno=156, + col_offset=57, + end_lineno=156, + end_col_offset=61), + JoinedStr( + [ + FormattedValue( + Name( + 'placeholder_46', + Load(), + lineno=156, + col_offset=68, + end_lineno=156, + end_col_offset=72), + -1, + lineno=156, + col_offset=65, + end_lineno=156, + end_col_offset=85), + FormattedValue( + Name( + 'placeholder_45', + Load(), + lineno=156, + col_offset=74, + end_lineno=156, + end_col_offset=83), + -1, + lineno=156, + col_offset=65, + end_lineno=156, + end_col_offset=85)], + lineno=156, + col_offset=65, + end_lineno=156, + end_col_offset=85), + lineno=156, + col_offset=57, + end_lineno=156, + end_col_offset=85)], + 0)], + lineno=155, + col_offset=11, + end_lineno=157, + end_col_offset=5), + lineno=155, + col_offset=4, + end_lineno=157, + end_col_offset=5)], + [], + lineno=147, + col_offset=0, + end_lineno=157, + end_col_offset=5)], + []) +## END NORMALIZED TREE ## \ No newline at end of file diff --git a/test/example-expression-normalization/representation.txt b/test/example-expression-normalization/representation.txt new file mode 100644 index 0000000..4b95728 --- /dev/null +++ b/test/example-expression-normalization/representation.txt @@ -0,0 +1 @@ +Module([Import([alias('unittest', lineno=6, col_offset=7, end_lineno=6, end_col_offset=15)], lineno=6, col_offset=0, end_lineno=6, end_col_offset=15), Import([alias('pytest', lineno=7, col_offset=7, end_lineno=7, end_col_offset=13)], lineno=7, col_offset=0, end_lineno=7, end_col_offset=13), ImportFrom('dataclass', [alias('dataclass', lineno=8, col_offset=22, end_lineno=8, end_col_offset=31)], 0, lineno=8, col_offset=0, end_lineno=8, end_col_offset=31), ImportFrom('Enum', [alias('Flag', lineno=9, col_offset=17, end_lineno=9, end_col_offset=21)], 0, lineno=9, col_offset=0, end_lineno=9, end_col_offset=21), ClassDef('placeholder_0', [], [], [Assign([Name('placeholder_1', Store(), lineno=20, col_offset=4, end_lineno=20, end_col_offset=5)], Constant(0, lineno=20, col_offset=13, end_lineno=20, end_col_offset=14), lineno=20), Assign([Name('placeholder_2', Store(), lineno=21, col_offset=4, end_lineno=21, end_col_offset=5)], Constant(0, lineno=21, col_offset=13, end_lineno=21, end_col_offset=14), lineno=21)], [Name('dataclass', Load(), lineno=17, col_offset=1, end_lineno=17, end_col_offset=10)], lineno=18, col_offset=0, end_lineno=21, end_col_offset=14), Try([Expr(BinOp(Constant(1, lineno=26, col_offset=4, end_lineno=26, end_col_offset=5), Div(), Constant(0, lineno=26, col_offset=6, end_lineno=26, end_col_offset=7), lineno=26, col_offset=4, end_lineno=26, end_col_offset=7), lineno=26, col_offset=4, end_lineno=26, end_col_offset=7)], [ExceptHandler(body=[Pass(lineno=28, col_offset=4, end_lineno=28, end_col_offset=8)], lineno=27, col_offset=0, end_lineno=28, end_col_offset=8)], [], [], lineno=25, col_offset=0, end_lineno=28, end_col_offset=8), Expr(BinOp(Constant(5, lineno=32, col_offset=0, end_lineno=32, end_col_offset=1), Add(), Constant(6, lineno=32, col_offset=2, end_lineno=32, end_col_offset=3), lineno=32, col_offset=0, end_lineno=32, end_col_offset=3), lineno=32, col_offset=0, end_lineno=32, end_col_offset=3), Expr(GeneratorExp(Name('placeholder_3', Load(), lineno=40, col_offset=1, end_lineno=40, end_col_offset=5), [comprehension(Name('placeholder_3', Store(), lineno=40, col_offset=10, end_lineno=40, end_col_offset=14), Call(Name('range', Load(), lineno=40, col_offset=18, end_lineno=40, end_col_offset=23), [Constant(8, lineno=40, col_offset=24, end_lineno=40, end_col_offset=25)], [], lineno=40, col_offset=18, end_lineno=40, end_col_offset=26), [], 0)], lineno=40, col_offset=0, end_lineno=40, end_col_offset=27), lineno=40, col_offset=0, end_lineno=40, end_col_offset=27), Expr(ListComp(Name('placeholder_3', Load(), lineno=41, col_offset=1, end_lineno=41, end_col_offset=5), [comprehension(Name('placeholder_3', Store(), lineno=41, col_offset=10, end_lineno=41, end_col_offset=14), Call(Name('range', Load(), lineno=41, col_offset=18, end_lineno=41, end_col_offset=23), [Constant(16, lineno=41, col_offset=24, end_lineno=41, end_col_offset=26)], [], lineno=41, col_offset=18, end_lineno=41, end_col_offset=27), [], 0)], lineno=41, col_offset=0, end_lineno=41, end_col_offset=28), lineno=41, col_offset=0, end_lineno=41, end_col_offset=28), Expr(SetComp(Name('placeholder_3', Load(), lineno=42, col_offset=1, end_lineno=42, end_col_offset=5), [comprehension(Name('placeholder_3', Store(), lineno=42, col_offset=10, end_lineno=42, end_col_offset=14), Call(Attribute(Constant('a b c d e f g h i', lineno=42, col_offset=18, end_lineno=42, end_col_offset=37), 'split', Load(), lineno=42, col_offset=18, end_lineno=42, end_col_offset=43), [], [], lineno=42, col_offset=18, end_lineno=42, end_col_offset=45), [], 0)], lineno=42, col_offset=0, end_lineno=42, end_col_offset=46), lineno=42, col_offset=0, end_lineno=42, end_col_offset=46), Expr(DictComp(Name('placeholder_4', Load(), lineno=43, col_offset=1, end_lineno=43, end_col_offset=4), Name('placeholder_5', Load(), lineno=43, col_offset=5, end_lineno=43, end_col_offset=10), [comprehension(Tuple([Name('placeholder_4', Store(), lineno=43, col_offset=15, end_lineno=43, end_col_offset=18), Name('placeholder_5', Store(), lineno=43, col_offset=20, end_lineno=43, end_col_offset=25)], Store(), lineno=43, col_offset=15, end_lineno=43, end_col_offset=25), Tuple([Tuple([Constant(1, lineno=43, col_offset=31, end_lineno=43, end_col_offset=32), Constant('a', lineno=43, col_offset=34, end_lineno=43, end_col_offset=37)], Load(), lineno=43, col_offset=30, end_lineno=43, end_col_offset=38), Tuple([Constant(2, lineno=43, col_offset=40, end_lineno=43, end_col_offset=41), Constant('b', lineno=43, col_offset=43, end_lineno=43, end_col_offset=46)], Load(), lineno=43, col_offset=39, end_lineno=43, end_col_offset=47), Tuple([Constant(3, lineno=43, col_offset=49, end_lineno=43, end_col_offset=50), Constant('c', lineno=43, col_offset=52, end_lineno=43, end_col_offset=55)], Load(), lineno=43, col_offset=48, end_lineno=43, end_col_offset=56), Tuple([Constant(5, lineno=43, col_offset=58, end_lineno=43, end_col_offset=59), Constant('e', lineno=43, col_offset=61, end_lineno=43, end_col_offset=64)], Load(), lineno=43, col_offset=57, end_lineno=43, end_col_offset=65)], Load(), lineno=43, col_offset=29, end_lineno=43, end_col_offset=66), [], 0)], lineno=43, col_offset=0, end_lineno=43, end_col_offset=67), lineno=43, col_offset=0, end_lineno=43, end_col_offset=67), Expr(Lambda(arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), DictComp(Name('placeholder_4', Load(), lineno=46, col_offset=10, end_lineno=46, end_col_offset=13), Name('placeholder_5', Load(), lineno=46, col_offset=14, end_lineno=46, end_col_offset=19), [comprehension(Tuple([Name('placeholder_4', Store(), lineno=46, col_offset=24, end_lineno=46, end_col_offset=27), Name('placeholder_5', Store(), lineno=46, col_offset=29, end_lineno=46, end_col_offset=34)], Store(), lineno=46, col_offset=24, end_lineno=46, end_col_offset=34), Tuple([Tuple([Constant(1, lineno=46, col_offset=40, end_lineno=46, end_col_offset=41), Constant('a', lineno=46, col_offset=43, end_lineno=46, end_col_offset=46)], Load(), lineno=46, col_offset=39, end_lineno=46, end_col_offset=47), Tuple([Constant(2, lineno=46, col_offset=49, end_lineno=46, end_col_offset=50), Constant('b', lineno=46, col_offset=52, end_lineno=46, end_col_offset=55)], Load(), lineno=46, col_offset=48, end_lineno=46, end_col_offset=56), Tuple([Constant(3, lineno=46, col_offset=58, end_lineno=46, end_col_offset=59), Constant('c', lineno=46, col_offset=61, end_lineno=46, end_col_offset=64)], Load(), lineno=46, col_offset=57, end_lineno=46, end_col_offset=65), Tuple([Constant(5, lineno=46, col_offset=67, end_lineno=46, end_col_offset=68), Constant('e', lineno=46, col_offset=70, end_lineno=46, end_col_offset=73)], Load(), lineno=46, col_offset=66, end_lineno=46, end_col_offset=74)], Load(), lineno=46, col_offset=38, end_lineno=46, end_col_offset=75), [], 0)], lineno=46, col_offset=9, end_lineno=46, end_col_offset=76), lineno=46, col_offset=0, end_lineno=46, end_col_offset=76), lineno=46, col_offset=0, end_lineno=46, end_col_offset=76), Assign([Name('placeholder_6', Store(), lineno=47, col_offset=0, end_lineno=47, end_col_offset=16)], Lambda(arguments([], [], kwonlyargs=[], kw_defaults=[], defaults=[]), SetComp(Name('placeholder_3', Load(), lineno=47, col_offset=29, end_lineno=47, end_col_offset=33), [comprehension(Name('placeholder_3', Store(), lineno=47, col_offset=38, end_lineno=47, end_col_offset=42), Call(Attribute(Constant('a b c d e f g h i', lineno=47, col_offset=46, end_lineno=47, end_col_offset=65), 'split', Load(), lineno=47, col_offset=46, end_lineno=47, end_col_offset=71), [], [], lineno=47, col_offset=46, end_lineno=47, end_col_offset=73), [], 0)], lineno=47, col_offset=28, end_lineno=47, end_col_offset=74), lineno=47, col_offset=19, end_lineno=47, end_col_offset=74), lineno=47, col_offset=0, end_lineno=47, end_col_offset=74), Expr(UnaryOp(USub(), Name('a', Load(), lineno=51, col_offset=1, end_lineno=51, end_col_offset=2), lineno=51, col_offset=0, end_lineno=51, end_col_offset=2), lineno=51, col_offset=0, end_lineno=51, end_col_offset=2), Assign([Name('placeholder_7', Store(), lineno=52, col_offset=0, end_lineno=52, end_col_offset=18)], Constant('It would be stupid if this exploded.', lineno=52, col_offset=21, end_lineno=52, end_col_offset=59), lineno=52, col_offset=0, end_lineno=52, end_col_offset=59), Expr(Constant('Random Hanging String', lineno=54, col_offset=0, end_lineno=54, end_col_offset=27), lineno=54, col_offset=0, end_lineno=54, end_col_offset=27), ClassDef('placeholder_8', [Name('Flag', Load(), lineno=58, col_offset=16, end_lineno=58, end_col_offset=20)], [], [Assign([Name('placeholder_9', Store(), lineno=59, col_offset=4, end_lineno=59, end_col_offset=8)], Call(Name('auto', Load(), lineno=59, col_offset=11, end_lineno=59, end_col_offset=15), [], [], lineno=59, col_offset=11, end_lineno=59, end_col_offset=17), lineno=59, col_offset=4, end_lineno=59, end_col_offset=17), Assign([Name('placeholder_10', Store(), lineno=60, col_offset=4, end_lineno=60, end_col_offset=11)], Call(Name('auto', Load(), lineno=60, col_offset=14, end_lineno=60, end_col_offset=18), [], [], lineno=60, col_offset=14, end_lineno=60, end_col_offset=20), lineno=60, col_offset=4, end_lineno=60, end_col_offset=20), Assign([Name('placeholder_11', Store(), lineno=61, col_offset=4, end_lineno=61, end_col_offset=13)], Call(Name('auto', Load(), lineno=61, col_offset=16, end_lineno=61, end_col_offset=20), [], [], lineno=61, col_offset=16, end_lineno=61, end_col_offset=22), lineno=61, col_offset=4, end_lineno=61, end_col_offset=22), Assign([Name('placeholder_12', Store(), lineno=62, col_offset=4, end_lineno=62, end_col_offset=16)], Call(Name('auto', Load(), lineno=62, col_offset=19, end_lineno=62, end_col_offset=23), [], [], lineno=62, col_offset=19, end_lineno=62, end_col_offset=25), lineno=62, col_offset=4, end_lineno=62, end_col_offset=25), Assign([Name('placeholder_13', Store(), lineno=63, col_offset=4, end_lineno=63, end_col_offset=12)], Call(Name('auto', Load(), lineno=63, col_offset=15, end_lineno=63, end_col_offset=19), [], [], lineno=63, col_offset=15, end_lineno=63, end_col_offset=21), lineno=63, col_offset=4, end_lineno=63, end_col_offset=21), Assign([Name('placeholder_14', Store(), lineno=64, col_offset=4, end_lineno=64, end_col_offset=13)], Call(Name('auto', Load(), lineno=64, col_offset=16, end_lineno=64, end_col_offset=20), [], [], lineno=64, col_offset=16, end_lineno=64, end_col_offset=22), lineno=64, col_offset=4, end_lineno=64, end_col_offset=22), Assign([Name('placeholder_15', Store(), lineno=65, col_offset=4, end_lineno=65, end_col_offset=10)], Call(Name('auto', Load(), lineno=65, col_offset=13, end_lineno=65, end_col_offset=17), [], [], lineno=65, col_offset=13, end_lineno=65, end_col_offset=19), lineno=65, col_offset=4, end_lineno=65, end_col_offset=19), Assign([Name('placeholder_16', Store(), lineno=66, col_offset=4, end_lineno=66, end_col_offset=8)], Call(Name('auto', Load(), lineno=66, col_offset=11, end_lineno=66, end_col_offset=15), [], [], lineno=66, col_offset=11, end_lineno=66, end_col_offset=17), lineno=66, col_offset=4, end_lineno=66, end_col_offset=17)], [], lineno=58, col_offset=0, end_lineno=66, end_col_offset=17), Try([ImportFrom('lasagna', [alias('EXPECTED_BAKE_TIME', lineno=74, col_offset=25, end_lineno=74, end_col_offset=43), alias('bake_time_remaining', lineno=75, col_offset=25, end_lineno=75, end_col_offset=44), alias('preparation_time_in_minutes', lineno=76, col_offset=25, end_lineno=76, end_col_offset=52), alias('elapsed_time_in_minutes', lineno=77, col_offset=25, end_lineno=77, end_col_offset=48)], 0, lineno=74, col_offset=4, end_lineno=77, end_col_offset=49)], [ExceptHandler(Name('ImportError', Load(), lineno=80, col_offset=7, end_lineno=80, end_col_offset=18), 'placeholder_17', [Assign([Name('placeholder_18', Store(), lineno=81, col_offset=4, end_lineno=81, end_col_offset=11)], Call(Attribute(Subscript(Attribute(Name('placeholder_17', Load(), lineno=81, col_offset=14, end_lineno=81, end_col_offset=25), 'args', Load(), lineno=81, col_offset=14, end_lineno=81, end_col_offset=30), Constant(0, lineno=81, col_offset=31, end_lineno=81, end_col_offset=32), Load(), lineno=81, col_offset=14, end_lineno=81, end_col_offset=33), 'split', Load(), lineno=81, col_offset=14, end_lineno=81, end_col_offset=39), [Constant('(', lineno=81, col_offset=40, end_lineno=81, end_col_offset=43)], [keyword('placeholder_19', Constant(1, lineno=81, col_offset=54, end_lineno=81, end_col_offset=55), lineno=81, col_offset=45, end_lineno=81, end_col_offset=55)], lineno=81, col_offset=14, end_lineno=81, end_col_offset=56), lineno=81, col_offset=4, end_lineno=81, end_col_offset=56), Assign([Name('placeholder_20', Store(), lineno=82, col_offset=4, end_lineno=82, end_col_offset=13)], Subscript(Call(Attribute(Subscript(Attribute(Name('placeholder_17', Load(), lineno=82, col_offset=16, end_lineno=82, end_col_offset=27), 'args', Load(), lineno=82, col_offset=16, end_lineno=82, end_col_offset=32), Constant(0, lineno=82, col_offset=33, end_lineno=82, end_col_offset=34), Load(), lineno=82, col_offset=16, end_lineno=82, end_col_offset=35), 'split', Load(), lineno=82, col_offset=16, end_lineno=82, end_col_offset=41), [], [], lineno=82, col_offset=16, end_lineno=82, end_col_offset=43), Constant(3, lineno=82, col_offset=44, end_lineno=82, end_col_offset=45), Load(), lineno=82, col_offset=16, end_lineno=82, end_col_offset=46), lineno=82, col_offset=4, end_lineno=82, end_col_offset=46), If(Compare(Constant('EXPECTED_BAKE_TIME', lineno=84, col_offset=7, end_lineno=84, end_col_offset=27), [In()], [Name('placeholder_20', Load(), lineno=84, col_offset=31, end_lineno=84, end_col_offset=40)], lineno=84, col_offset=7, end_lineno=84, end_col_offset=40), [Raise(Call(Name('ImportError', Load(), lineno=86, col_offset=14, end_lineno=86, end_col_offset=25), [JoinedStr([Constant('\n\nMISSING CONSTANT --> \nWe can not find or import the constant ', lineno=86, col_offset=26, end_lineno=87, end_col_offset=88), FormattedValue(Name('placeholder_20', Load(), lineno=86, col_offset=95, end_lineno=86, end_col_offset=104), -1, lineno=86, col_offset=26, end_lineno=87, end_col_offset=88), Constant(" in your 'lasagna.py' file.\nDid you misname or forget to define it?", lineno=86, col_offset=26, end_lineno=87, end_col_offset=88)], lineno=86, col_offset=26, end_lineno=87, end_col_offset=88)], [], lineno=86, col_offset=14, end_lineno=87, end_col_offset=89), Constant(None, lineno=87, col_offset=95, end_lineno=87, end_col_offset=99), lineno=86, col_offset=8, end_lineno=87, end_col_offset=99)], [Assign([Name('placeholder_20', Store(), lineno=89, col_offset=8, end_lineno=89, end_col_offset=17)], BinOp(Subscript(Name('placeholder_20', Load(), lineno=89, col_offset=20, end_lineno=89, end_col_offset=29), Slice(upper=UnaryOp(USub(), Constant(1, lineno=89, col_offset=32, end_lineno=89, end_col_offset=33), lineno=89, col_offset=31, end_lineno=89, end_col_offset=33), lineno=89, col_offset=30, end_lineno=89, end_col_offset=33), Load(), lineno=89, col_offset=20, end_lineno=89, end_col_offset=34), Add(), Constant("()'", lineno=89, col_offset=37, end_lineno=89, end_col_offset=42), lineno=89, col_offset=20, end_lineno=89, end_col_offset=42), lineno=89, col_offset=8, end_lineno=89, end_col_offset=42), Raise(Call(Name('ImportError', Load(), lineno=91, col_offset=14, end_lineno=91, end_col_offset=25), [JoinedStr([Constant("\n\nMISSING FUNCTION --> In your 'lasagna.py' file, we can not find or import the function named ", lineno=91, col_offset=26, end_lineno=92, end_col_offset=99), FormattedValue(Name('placeholder_20', Load(), lineno=92, col_offset=45, end_lineno=92, end_col_offset=54), -1, lineno=91, col_offset=26, end_lineno=92, end_col_offset=99), Constant('. \nDid you misname or forget to define it?', lineno=91, col_offset=26, end_lineno=92, end_col_offset=99)], lineno=91, col_offset=26, end_lineno=92, end_col_offset=99)], [], lineno=91, col_offset=14, end_lineno=92, end_col_offset=100), Constant(None, lineno=92, col_offset=106, end_lineno=92, end_col_offset=110), lineno=91, col_offset=8, end_lineno=92, end_col_offset=110)], lineno=84, col_offset=4, end_lineno=92, end_col_offset=110)], lineno=80, col_offset=0, end_lineno=92, end_col_offset=110)], [], [], lineno=73, col_offset=0, end_lineno=92, end_col_offset=110), FunctionDef('placeholder_21', arguments([], [arg('placeholder_22', lineno=99, col_offset=11, end_lineno=99, end_col_offset=17), arg('placeholder_23', lineno=99, col_offset=19, end_lineno=99, end_col_offset=25)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(ListComp(Name('placeholder_26', Load(), lineno=105, col_offset=8, end_lineno=105, end_col_offset=15), [comprehension(Tuple([Name('placeholder_24', Store(), lineno=106, col_offset=12, end_lineno=106, end_col_offset=13), Name('placeholder_25', Store(), lineno=106, col_offset=15, end_lineno=106, end_col_offset=16)], Store(), lineno=106, col_offset=12, end_lineno=106, end_col_offset=16), Call(Name('enumerate', Load(), lineno=106, col_offset=20, end_lineno=106, end_col_offset=29), [Name('placeholder_22', Load(), lineno=106, col_offset=30, end_lineno=106, end_col_offset=36)], [], lineno=106, col_offset=20, end_lineno=106, end_col_offset=37), [Compare(Call(Name('len', Load(), lineno=107, col_offset=11, end_lineno=107, end_col_offset=14), [NamedExpr(Name('placeholder_26', Store(), lineno=107, col_offset=15, end_lineno=107, end_col_offset=22), Subscript(Name('placeholder_22', Load(), lineno=107, col_offset=26, end_lineno=107, end_col_offset=32), Slice(Name('placeholder_24', Load(), lineno=107, col_offset=33, end_lineno=107, end_col_offset=34), BinOp(Name('placeholder_24', Load(), lineno=107, col_offset=37, end_lineno=107, end_col_offset=38), Add(), Name('placeholder_23', Load(), lineno=107, col_offset=41, end_lineno=107, end_col_offset=47), lineno=107, col_offset=37, end_lineno=107, end_col_offset=47), lineno=107, col_offset=33, end_lineno=107, end_col_offset=47), Load(), lineno=107, col_offset=26, end_lineno=107, end_col_offset=48), lineno=107, col_offset=15, end_lineno=107, end_col_offset=48)], [], lineno=107, col_offset=11, end_lineno=107, end_col_offset=49), [Eq()], [Name('placeholder_23', Load(), lineno=107, col_offset=53, end_lineno=107, end_col_offset=59)], lineno=107, col_offset=11, end_lineno=107, end_col_offset=59)], 0)], lineno=104, col_offset=11, end_lineno=108, end_col_offset=5), lineno=104, col_offset=4, end_lineno=108, end_col_offset=5)], [], lineno=99, col_offset=0, end_lineno=108, end_col_offset=5), ImportFrom('typing', [alias('Iterable', lineno=112, col_offset=19, end_lineno=112, end_col_offset=27)], 0, lineno=112, col_offset=0, end_lineno=112, end_col_offset=27), FunctionDef('placeholder_27', arguments([], [arg('placeholder_28', lineno=113, col_offset=12, end_lineno=113, end_col_offset=20)], kwonlyargs=[], kw_defaults=[], defaults=[]), [FunctionDef('placeholder_29', arguments([], [arg('placeholder_30', lineno=114, col_offset=11, end_lineno=114, end_col_offset=13)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_31', Store(), lineno=115, col_offset=12, end_lineno=115, end_col_offset=13), Name('placeholder_30', Load(), lineno=115, col_offset=17, end_lineno=115, end_col_offset=19), [If(BoolOp(And(), [Call(Name('isinstance', Load(), lineno=116, col_offset=15, end_lineno=116, end_col_offset=25), [Name('placeholder_31', Load(), lineno=116, col_offset=26, end_lineno=116, end_col_offset=27), Name('Iterable', Load(), lineno=116, col_offset=29, end_lineno=116, end_col_offset=37)], [], lineno=116, col_offset=15, end_lineno=116, end_col_offset=38), UnaryOp(Not(), Call(Name('isinstance', Load(), lineno=116, col_offset=47, end_lineno=116, end_col_offset=57), [Name('placeholder_31', Load(), lineno=116, col_offset=58, end_lineno=116, end_col_offset=59), Name('str', Load(), lineno=116, col_offset=61, end_lineno=116, end_col_offset=64)], [], lineno=116, col_offset=47, end_lineno=116, end_col_offset=65), lineno=116, col_offset=43, end_lineno=116, end_col_offset=65)], lineno=116, col_offset=15, end_lineno=116, end_col_offset=65), [Expr(YieldFrom(Call(Name('placeholder_29', Load(), lineno=117, col_offset=27, end_lineno=117, end_col_offset=29), [Name('placeholder_31', Load(), lineno=117, col_offset=30, end_lineno=117, end_col_offset=31)], [], lineno=117, col_offset=27, end_lineno=117, end_col_offset=32), lineno=117, col_offset=16, end_lineno=117, end_col_offset=32), lineno=117, col_offset=16, end_lineno=117, end_col_offset=32)], [Expr(Yield(Name('placeholder_31', Load(), lineno=119, col_offset=22, end_lineno=119, end_col_offset=23), lineno=119, col_offset=16, end_lineno=119, end_col_offset=23), lineno=119, col_offset=16, end_lineno=119, end_col_offset=23)], lineno=116, col_offset=12, end_lineno=119, end_col_offset=23)], [], lineno=115, col_offset=8, end_lineno=119, end_col_offset=23)], [], lineno=114, col_offset=4, end_lineno=119, end_col_offset=23), Return(ListComp(Name('placeholder_31', Load(), lineno=120, col_offset=12, end_lineno=120, end_col_offset=13), [comprehension(Name('placeholder_31', Store(), lineno=120, col_offset=18, end_lineno=120, end_col_offset=19), Call(Name('placeholder_29', Load(), lineno=120, col_offset=23, end_lineno=120, end_col_offset=25), [Name('placeholder_28', Load(), lineno=120, col_offset=26, end_lineno=120, end_col_offset=34)], [], lineno=120, col_offset=23, end_lineno=120, end_col_offset=35), [Compare(Name('placeholder_31', Load(), lineno=120, col_offset=39, end_lineno=120, end_col_offset=40), [IsNot()], [Constant(None, lineno=120, col_offset=48, end_lineno=120, end_col_offset=52)], lineno=120, col_offset=39, end_lineno=120, end_col_offset=52)], 0)], lineno=120, col_offset=11, end_lineno=120, end_col_offset=53), lineno=120, col_offset=4, end_lineno=120, end_col_offset=53)], [], lineno=113, col_offset=0, end_lineno=120, end_col_offset=53), FunctionDef('placeholder_32', arguments([], [arg('placeholder_33', lineno=124, col_offset=17, end_lineno=124, end_col_offset=21)], kwonlyargs=[], kw_defaults=[], defaults=[]), [If(BinOp(NamedExpr(Name('placeholder_34', Store(), lineno=126, col_offset=8, end_lineno=126, end_col_offset=14), Call(Name('len', Load(), lineno=126, col_offset=18, end_lineno=126, end_col_offset=21), [Name('placeholder_33', Load(), lineno=126, col_offset=22, end_lineno=126, end_col_offset=26)], [], lineno=126, col_offset=18, end_lineno=126, end_col_offset=27), lineno=126, col_offset=8, end_lineno=126, end_col_offset=27), Mod(), Constant(3, lineno=126, col_offset=31, end_lineno=126, end_col_offset=32), lineno=126, col_offset=7, end_lineno=126, end_col_offset=32), [Raise(Call(Name('ValueError', Load(), lineno=127, col_offset=14, end_lineno=127, end_col_offset=24), [Constant('grid rows not a multiple of 4', lineno=127, col_offset=25, end_lineno=127, end_col_offset=56)], [], lineno=127, col_offset=14, end_lineno=127, end_col_offset=57), lineno=127, col_offset=8, end_lineno=127, end_col_offset=57)], [], lineno=126, col_offset=4, end_lineno=127, end_col_offset=57), Return(Name('placeholder_34', Load(), lineno=128, col_offset=11, end_lineno=128, end_col_offset=17), lineno=128, col_offset=4, end_lineno=128, end_col_offset=17)], [], lineno=124, col_offset=0, end_lineno=128, end_col_offset=17), FunctionDef('placeholder_35', arguments([], [arg('self', lineno=131, col_offset=16, end_lineno=131, end_col_offset=20), arg('placeholder_36', lineno=131, col_offset=22, end_lineno=131, end_col_offset=27)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_37', Store(), lineno=133, col_offset=4, end_lineno=133, end_col_offset=16)], Call(Name('set', Load(), lineno=133, col_offset=19, end_lineno=133, end_col_offset=22), [List([Tuple([Constant(1, lineno=133, col_offset=25, end_lineno=133, end_col_offset=26), Constant(0, lineno=133, col_offset=28, end_lineno=133, end_col_offset=29)], Load(), lineno=133, col_offset=24, end_lineno=133, end_col_offset=30), Tuple([UnaryOp(USub(), Constant(1, lineno=133, col_offset=34, end_lineno=133, end_col_offset=35), lineno=133, col_offset=33, end_lineno=133, end_col_offset=35), Constant(0, lineno=133, col_offset=37, end_lineno=133, end_col_offset=38)], Load(), lineno=133, col_offset=32, end_lineno=133, end_col_offset=39), Tuple([Constant(0, lineno=133, col_offset=42, end_lineno=133, end_col_offset=43), UnaryOp(USub(), Constant(1, lineno=133, col_offset=46, end_lineno=133, end_col_offset=47), lineno=133, col_offset=45, end_lineno=133, end_col_offset=47)], Load(), lineno=133, col_offset=41, end_lineno=133, end_col_offset=48), Tuple([Constant(0, lineno=133, col_offset=51, end_lineno=133, end_col_offset=52), Constant(1, lineno=133, col_offset=54, end_lineno=133, end_col_offset=55)], Load(), lineno=133, col_offset=50, end_lineno=133, end_col_offset=56)], Load(), lineno=133, col_offset=23, end_lineno=133, end_col_offset=57)], [], lineno=133, col_offset=19, end_lineno=133, end_col_offset=58), lineno=133, col_offset=4, end_lineno=133, end_col_offset=58), Return(SetComp(Name('placeholder_39', Load(), lineno=135, col_offset=8, end_lineno=135, end_col_offset=16), [comprehension(Name('placeholder_38', Store(), lineno=136, col_offset=12, end_lineno=136, end_col_offset=18), Name('placeholder_37', Load(), lineno=136, col_offset=22, end_lineno=136, end_col_offset=34), [Call(Attribute(Name('self', Load(), lineno=137, col_offset=11, end_lineno=137, end_col_offset=15), 'on_the_board', Load(), lineno=137, col_offset=11, end_lineno=137, end_col_offset=28), [NamedExpr(Name('placeholder_39', Store(), lineno=137, col_offset=29, end_lineno=137, end_col_offset=37), BinOp(Name('placeholder_36', Load(), lineno=137, col_offset=41, end_lineno=137, end_col_offset=46), Add(), Name('placeholder_38', Load(), lineno=137, col_offset=49, end_lineno=137, end_col_offset=55), lineno=137, col_offset=41, end_lineno=137, end_col_offset=55), lineno=137, col_offset=29, end_lineno=137, end_col_offset=55)], [], lineno=137, col_offset=11, end_lineno=137, end_col_offset=56)], 0)], lineno=134, col_offset=11, end_lineno=138, end_col_offset=5), lineno=134, col_offset=4, end_lineno=138, end_col_offset=5)], [], lineno=131, col_offset=0, end_lineno=138, end_col_offset=5), FunctionDef('placeholder_40', arguments([], [arg('placeholder_28', lineno=141, col_offset=30, end_lineno=141, end_col_offset=38), arg('placeholder_41', lineno=141, col_offset=40, end_lineno=141, end_col_offset=41)], kwonlyargs=[], kw_defaults=[], defaults=[]), [If(Call(Name('any', Load(), lineno=142, col_offset=7, end_lineno=142, end_col_offset=10), [GeneratorExp(Compare(NamedExpr(Name('placeholder_42', Store(), lineno=142, col_offset=12, end_lineno=142, end_col_offset=16), Name('placeholder_1', Load(), lineno=142, col_offset=20, end_lineno=142, end_col_offset=21), lineno=142, col_offset=12, end_lineno=142, end_col_offset=21), [Gt()], [Name('placeholder_41', Load(), lineno=142, col_offset=25, end_lineno=142, end_col_offset=26)], lineno=142, col_offset=11, end_lineno=142, end_col_offset=26), [comprehension(Name('placeholder_1', Store(), lineno=142, col_offset=31, end_lineno=142, end_col_offset=32), Name('placeholder_28', Load(), lineno=142, col_offset=36, end_lineno=142, end_col_offset=44), [], 0)], lineno=142, col_offset=10, end_lineno=142, end_col_offset=45)], [], lineno=142, col_offset=7, end_lineno=142, end_col_offset=45), [Return(Name('placeholder_3', Load(), lineno=143, col_offset=15, end_lineno=143, end_col_offset=19), lineno=143, col_offset=8, end_lineno=143, end_col_offset=19)], [], lineno=142, col_offset=4, end_lineno=143, end_col_offset=19), Return(Constant(None, lineno=144, col_offset=11, end_lineno=144, end_col_offset=15), lineno=144, col_offset=4, end_lineno=144, end_col_offset=15)], [], lineno=141, col_offset=0, end_lineno=144, end_col_offset=15), FunctionDef('placeholder_43', arguments([], [arg('placeholder_44', lineno=147, col_offset=19, end_lineno=147, end_col_offset=31), arg('placeholder_45', lineno=147, col_offset=33, end_lineno=147, end_col_offset=42)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Return(GeneratorExp(Call(Attribute(Name('placeholder_47', Load(), lineno=156, col_offset=8, end_lineno=156, end_col_offset=12), 'ljust', Load(), lineno=156, col_offset=8, end_lineno=156, end_col_offset=18), [Constant(12, lineno=156, col_offset=19, end_lineno=156, end_col_offset=21), Constant('0', lineno=156, col_offset=23, end_lineno=156, end_col_offset=26)], [], lineno=156, col_offset=8, end_lineno=156, end_col_offset=27), [comprehension(Name('placeholder_46', Store(), lineno=156, col_offset=32, end_lineno=156, end_col_offset=36), Name('placeholder_44', Load(), lineno=156, col_offset=40, end_lineno=156, end_col_offset=52), [NamedExpr(Name('placeholder_47', Store(), lineno=156, col_offset=57, end_lineno=156, end_col_offset=61), JoinedStr([FormattedValue(Name('placeholder_46', Load(), lineno=156, col_offset=68, end_lineno=156, end_col_offset=72), -1, lineno=156, col_offset=65, end_lineno=156, end_col_offset=85), FormattedValue(Name('placeholder_45', Load(), lineno=156, col_offset=74, end_lineno=156, end_col_offset=83), -1, lineno=156, col_offset=65, end_lineno=156, end_col_offset=85)], lineno=156, col_offset=65, end_lineno=156, end_col_offset=85), lineno=156, col_offset=57, end_lineno=156, end_col_offset=85)], 0)], lineno=155, col_offset=11, end_lineno=157, end_col_offset=5), lineno=155, col_offset=4, end_lineno=157, end_col_offset=5)], [], lineno=147, col_offset=0, end_lineno=157, end_col_offset=5)], []) \ No newline at end of file From ff715658348597f7450048a9d8fecbad547a890c Mon Sep 17 00:00:00 2001 From: BethanyG Date: Thu, 21 Mar 2024 16:28:59 -0700 Subject: [PATCH 14/14] Adjusted golden tests due to better placeholder assignment after visit_Expr fix. --- test/concept-plane-tickets/representation.out | 18 +++++++++--------- test/concept-plane-tickets/representation.txt | 2 +- .../representation.out | 18 +++++++++--------- .../representation.txt | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/test/concept-plane-tickets/representation.out b/test/concept-plane-tickets/representation.out index d7add39..fed1f4c 100644 --- a/test/concept-plane-tickets/representation.out +++ b/test/concept-plane-tickets/representation.out @@ -6,7 +6,7 @@ placeholder_0 = ["A", "B", "C", "D"] def placeholder_1(placeholder_2): for placeholder_3 in range(placeholder_2): - yield SEATS_IN_ROW[seat % 4] + yield placeholder_0[placeholder_3 % 4] def placeholder_4(placeholder_2): @@ -15,7 +15,7 @@ def placeholder_4(placeholder_2): for placeholder_3 in range(placeholder_2): placeholder_6 = math.ceil((placeholder_3 + 1) / 4) if placeholder_6 != 13: - yield f"{str(row_number)}{next(letters)}" + yield f"{str(placeholder_6)}{next(placeholder_5)}" def placeholder_7(placeholder_8): @@ -31,7 +31,7 @@ def placeholder_7(placeholder_8): def placeholder_12(placeholder_13, placeholder_14): for placeholder_3 in placeholder_13: placeholder_15 = f"{placeholder_3}{placeholder_14}" - yield (base_string + "0" * (12 - len(base_string))) + yield (placeholder_15 + "0" * (12 - len(placeholder_15))) ## END NORMALIZED CODE ## @@ -1023,7 +1023,7 @@ Module( Yield( Subscript( Name( - 'SEATS_IN_ROW', + 'placeholder_0', Load(), lineno=22, col_offset=14, @@ -1031,7 +1031,7 @@ Module( end_col_offset=26), BinOp( Name( - 'seat', + 'placeholder_3', Load(), lineno=22, col_offset=27, @@ -1318,7 +1318,7 @@ Module( end_col_offset=24), [ Name( - 'row_number', + 'placeholder_6', Load(), lineno=47, col_offset=25, @@ -1345,7 +1345,7 @@ Module( end_col_offset=42), [ Name( - 'letters', + 'placeholder_5', Load(), lineno=47, col_offset=43, @@ -1663,7 +1663,7 @@ Module( Yield( BinOp( Name( - 'base_string', + 'placeholder_15', Load(), lineno=80, col_offset=14, @@ -1696,7 +1696,7 @@ Module( end_col_offset=43), [ Name( - 'base_string', + 'placeholder_15', Load(), lineno=80, col_offset=44, diff --git a/test/concept-plane-tickets/representation.txt b/test/concept-plane-tickets/representation.txt index 7a2615a..daae570 100644 --- a/test/concept-plane-tickets/representation.txt +++ b/test/concept-plane-tickets/representation.txt @@ -1 +1 @@ -Module([Import([alias('math', lineno=3, col_offset=7, end_lineno=3, end_col_offset=11)], lineno=3, col_offset=0, end_lineno=3, end_col_offset=11), Assign([Name('placeholder_0', Store(), lineno=5, col_offset=0, end_lineno=5, end_col_offset=12)], List([Constant('A', lineno=5, col_offset=16, end_lineno=5, end_col_offset=19), Constant('B', lineno=5, col_offset=21, end_lineno=5, end_col_offset=24), Constant('C', lineno=5, col_offset=26, end_lineno=5, end_col_offset=29), Constant('D', lineno=5, col_offset=31, end_lineno=5, end_col_offset=34)], Load(), lineno=5, col_offset=15, end_lineno=5, end_col_offset=35), lineno=5, col_offset=0, end_lineno=5, end_col_offset=35), FunctionDef('placeholder_1', arguments([], [arg('placeholder_2', lineno=8, col_offset=26, end_lineno=8, end_col_offset=32)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_3', Store(), lineno=21, col_offset=8, end_lineno=21, end_col_offset=12), Call(Name('range', Load(), lineno=21, col_offset=16, end_lineno=21, end_col_offset=21), [Name('placeholder_2', Load(), lineno=21, col_offset=22, end_lineno=21, end_col_offset=28)], [], lineno=21, col_offset=16, end_lineno=21, end_col_offset=29), [Expr(Yield(Subscript(Name('SEATS_IN_ROW', Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=26), BinOp(Name('seat', Load(), lineno=22, col_offset=27, end_lineno=22, end_col_offset=31), Mod(), Constant(4, lineno=22, col_offset=34, end_lineno=22, end_col_offset=35), lineno=22, col_offset=27, end_lineno=22, end_col_offset=35), Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=36), lineno=22, col_offset=8, end_lineno=22, end_col_offset=36), lineno=22, col_offset=8, end_lineno=22, end_col_offset=36)], [], lineno=21, col_offset=4, end_lineno=22, end_col_offset=36)], [], lineno=8, col_offset=0, end_lineno=22, end_col_offset=36), FunctionDef('placeholder_4', arguments([], [arg('placeholder_2', lineno=25, col_offset=19, end_lineno=25, end_col_offset=25)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_2', Store(), lineno=42, col_offset=4, end_lineno=42, end_col_offset=10)], IfExp(Compare(Name('placeholder_2', Load(), lineno=42, col_offset=27, end_lineno=42, end_col_offset=33), [GtE()], [Constant(13, lineno=42, col_offset=37, end_lineno=42, end_col_offset=39)], lineno=42, col_offset=27, end_lineno=42, end_col_offset=39), BinOp(Name('placeholder_2', Load(), lineno=42, col_offset=13, end_lineno=42, end_col_offset=19), Add(), Constant(4, lineno=42, col_offset=22, end_lineno=42, end_col_offset=23), lineno=42, col_offset=13, end_lineno=42, end_col_offset=23), Name('placeholder_2', Load(), lineno=42, col_offset=45, end_lineno=42, end_col_offset=51), lineno=42, col_offset=13, end_lineno=42, end_col_offset=51), lineno=42, col_offset=4, end_lineno=42, end_col_offset=51), Assign([Name('placeholder_5', Store(), lineno=43, col_offset=4, end_lineno=43, end_col_offset=11)], Call(Name('placeholder_1', Load(), lineno=43, col_offset=14, end_lineno=43, end_col_offset=35), [Name('placeholder_2', Load(), lineno=43, col_offset=36, end_lineno=43, end_col_offset=42)], [], lineno=43, col_offset=14, end_lineno=43, end_col_offset=43), lineno=43, col_offset=4, end_lineno=43, end_col_offset=43), For(Name('placeholder_3', Store(), lineno=44, col_offset=8, end_lineno=44, end_col_offset=12), Call(Name('range', Load(), lineno=44, col_offset=16, end_lineno=44, end_col_offset=21), [Name('placeholder_2', Load(), lineno=44, col_offset=22, end_lineno=44, end_col_offset=28)], [], lineno=44, col_offset=16, end_lineno=44, end_col_offset=29), [Assign([Name('placeholder_6', Store(), lineno=45, col_offset=8, end_lineno=45, end_col_offset=18)], Call(Attribute(Name('math', Load(), lineno=45, col_offset=21, end_lineno=45, end_col_offset=25), 'ceil', Load(), lineno=45, col_offset=21, end_lineno=45, end_col_offset=30), [BinOp(BinOp(Name('placeholder_3', Load(), lineno=45, col_offset=32, end_lineno=45, end_col_offset=36), Add(), Constant(1, lineno=45, col_offset=37, end_lineno=45, end_col_offset=38), lineno=45, col_offset=32, end_lineno=45, end_col_offset=38), Div(), Constant(4, lineno=45, col_offset=42, end_lineno=45, end_col_offset=43), lineno=45, col_offset=31, end_lineno=45, end_col_offset=43)], [], lineno=45, col_offset=21, end_lineno=45, end_col_offset=44), lineno=45, col_offset=8, end_lineno=45, end_col_offset=44), If(Compare(Name('placeholder_6', Load(), lineno=46, col_offset=11, end_lineno=46, end_col_offset=21), [NotEq()], [Constant(13, lineno=46, col_offset=25, end_lineno=46, end_col_offset=27)], lineno=46, col_offset=11, end_lineno=46, end_col_offset=27), [Expr(Yield(JoinedStr([FormattedValue(Call(Name('str', Load(), lineno=47, col_offset=21, end_lineno=47, end_col_offset=24), [Name('row_number', Load(), lineno=47, col_offset=25, end_lineno=47, end_col_offset=35)], [], lineno=47, col_offset=21, end_lineno=47, end_col_offset=36), -1, lineno=47, col_offset=18, end_lineno=47, end_col_offset=53), FormattedValue(Call(Name('next', Load(), lineno=47, col_offset=38, end_lineno=47, end_col_offset=42), [Name('letters', Load(), lineno=47, col_offset=43, end_lineno=47, end_col_offset=50)], [], lineno=47, col_offset=38, end_lineno=47, end_col_offset=51), -1, lineno=47, col_offset=18, end_lineno=47, end_col_offset=53)], lineno=47, col_offset=18, end_lineno=47, end_col_offset=53), lineno=47, col_offset=12, end_lineno=47, end_col_offset=53), lineno=47, col_offset=12, end_lineno=47, end_col_offset=53)], [], lineno=46, col_offset=8, end_lineno=47, end_col_offset=53)], [], lineno=44, col_offset=4, end_lineno=47, end_col_offset=53)], [], lineno=25, col_offset=0, end_lineno=47, end_col_offset=53), FunctionDef('placeholder_7', arguments([], [arg('placeholder_8', lineno=53, col_offset=17, end_lineno=53, end_col_offset=27)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_2', Store(), lineno=63, col_offset=4, end_lineno=63, end_col_offset=10)], Call(Name('len', Load(), lineno=63, col_offset=13, end_lineno=63, end_col_offset=16), [Name('placeholder_8', Load(), lineno=63, col_offset=17, end_lineno=63, end_col_offset=27)], [], lineno=63, col_offset=13, end_lineno=63, end_col_offset=28), lineno=63, col_offset=4, end_lineno=63, end_col_offset=28), Assign([Name('placeholder_9', Store(), lineno=64, col_offset=4, end_lineno=64, end_col_offset=10)], Dict([], [], lineno=64, col_offset=13, end_lineno=64, end_col_offset=15), lineno=64, col_offset=4, end_lineno=64, end_col_offset=15), For(Tuple([Name('placeholder_10', Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=17), Name('placeholder_11', Store(), lineno=65, col_offset=19, end_lineno=65, end_col_offset=30)], Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=30), Call(Name('zip', Load(), lineno=65, col_offset=34, end_lineno=65, end_col_offset=37), [Name('placeholder_8', Load(), lineno=65, col_offset=38, end_lineno=65, end_col_offset=48), Call(Name('placeholder_4', Load(), lineno=65, col_offset=50, end_lineno=65, end_col_offset=64), [Name('placeholder_2', Load(), lineno=65, col_offset=65, end_lineno=65, end_col_offset=71)], [], lineno=65, col_offset=50, end_lineno=65, end_col_offset=72)], [], lineno=65, col_offset=34, end_lineno=65, end_col_offset=73), [Assign([Subscript(Name('placeholder_9', Load(), lineno=66, col_offset=8, end_lineno=66, end_col_offset=14), Name('placeholder_10', Load(), lineno=66, col_offset=15, end_lineno=66, end_col_offset=24), Store(), lineno=66, col_offset=8, end_lineno=66, end_col_offset=25)], Name('placeholder_11', Load(), lineno=66, col_offset=28, end_lineno=66, end_col_offset=39), lineno=66, col_offset=8, end_lineno=66, end_col_offset=39)], [], lineno=65, col_offset=4, end_lineno=66, end_col_offset=39), Return(Name('placeholder_9', Load(), lineno=67, col_offset=11, end_lineno=67, end_col_offset=17), lineno=67, col_offset=4, end_lineno=67, end_col_offset=17)], [], lineno=53, col_offset=0, end_lineno=67, end_col_offset=17), FunctionDef('placeholder_12', arguments([], [arg('placeholder_13', lineno=69, col_offset=19, end_lineno=69, end_col_offset=31), arg('placeholder_14', lineno=69, col_offset=33, end_lineno=69, end_col_offset=42)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_3', Store(), lineno=78, col_offset=8, end_lineno=78, end_col_offset=12), Name('placeholder_13', Load(), lineno=78, col_offset=16, end_lineno=78, end_col_offset=28), [Assign([Name('placeholder_15', Store(), lineno=79, col_offset=8, end_lineno=79, end_col_offset=19)], JoinedStr([FormattedValue(Name('placeholder_3', Load(), lineno=79, col_offset=25, end_lineno=79, end_col_offset=29), -1, lineno=79, col_offset=22, end_lineno=79, end_col_offset=42), FormattedValue(Name('placeholder_14', Load(), lineno=79, col_offset=31, end_lineno=79, end_col_offset=40), -1, lineno=79, col_offset=22, end_lineno=79, end_col_offset=42)], lineno=79, col_offset=22, end_lineno=79, end_col_offset=42), lineno=79, col_offset=8, end_lineno=79, end_col_offset=42), Expr(Yield(BinOp(Name('base_string', Load(), lineno=80, col_offset=14, end_lineno=80, end_col_offset=25), Add(), BinOp(Constant('0', lineno=80, col_offset=28, end_lineno=80, end_col_offset=31), Mult(), BinOp(Constant(12, lineno=80, col_offset=35, end_lineno=80, end_col_offset=37), Sub(), Call(Name('len', Load(), lineno=80, col_offset=40, end_lineno=80, end_col_offset=43), [Name('base_string', Load(), lineno=80, col_offset=44, end_lineno=80, end_col_offset=55)], [], lineno=80, col_offset=40, end_lineno=80, end_col_offset=56), lineno=80, col_offset=35, end_lineno=80, end_col_offset=56), lineno=80, col_offset=28, end_lineno=80, end_col_offset=57), lineno=80, col_offset=14, end_lineno=80, end_col_offset=57), lineno=80, col_offset=8, end_lineno=80, end_col_offset=57), lineno=80, col_offset=8, end_lineno=80, end_col_offset=57)], [], lineno=78, col_offset=4, end_lineno=80, end_col_offset=57)], [], lineno=69, col_offset=0, end_lineno=80, end_col_offset=57)], []) \ No newline at end of file +Module([Import([alias('math', lineno=3, col_offset=7, end_lineno=3, end_col_offset=11)], lineno=3, col_offset=0, end_lineno=3, end_col_offset=11), Assign([Name('placeholder_0', Store(), lineno=5, col_offset=0, end_lineno=5, end_col_offset=12)], List([Constant('A', lineno=5, col_offset=16, end_lineno=5, end_col_offset=19), Constant('B', lineno=5, col_offset=21, end_lineno=5, end_col_offset=24), Constant('C', lineno=5, col_offset=26, end_lineno=5, end_col_offset=29), Constant('D', lineno=5, col_offset=31, end_lineno=5, end_col_offset=34)], Load(), lineno=5, col_offset=15, end_lineno=5, end_col_offset=35), lineno=5, col_offset=0, end_lineno=5, end_col_offset=35), FunctionDef('placeholder_1', arguments([], [arg('placeholder_2', lineno=8, col_offset=26, end_lineno=8, end_col_offset=32)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_3', Store(), lineno=21, col_offset=8, end_lineno=21, end_col_offset=12), Call(Name('range', Load(), lineno=21, col_offset=16, end_lineno=21, end_col_offset=21), [Name('placeholder_2', Load(), lineno=21, col_offset=22, end_lineno=21, end_col_offset=28)], [], lineno=21, col_offset=16, end_lineno=21, end_col_offset=29), [Expr(Yield(Subscript(Name('placeholder_0', Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=26), BinOp(Name('placeholder_3', Load(), lineno=22, col_offset=27, end_lineno=22, end_col_offset=31), Mod(), Constant(4, lineno=22, col_offset=34, end_lineno=22, end_col_offset=35), lineno=22, col_offset=27, end_lineno=22, end_col_offset=35), Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=36), lineno=22, col_offset=8, end_lineno=22, end_col_offset=36), lineno=22, col_offset=8, end_lineno=22, end_col_offset=36)], [], lineno=21, col_offset=4, end_lineno=22, end_col_offset=36)], [], lineno=8, col_offset=0, end_lineno=22, end_col_offset=36), FunctionDef('placeholder_4', arguments([], [arg('placeholder_2', lineno=25, col_offset=19, end_lineno=25, end_col_offset=25)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_2', Store(), lineno=42, col_offset=4, end_lineno=42, end_col_offset=10)], IfExp(Compare(Name('placeholder_2', Load(), lineno=42, col_offset=27, end_lineno=42, end_col_offset=33), [GtE()], [Constant(13, lineno=42, col_offset=37, end_lineno=42, end_col_offset=39)], lineno=42, col_offset=27, end_lineno=42, end_col_offset=39), BinOp(Name('placeholder_2', Load(), lineno=42, col_offset=13, end_lineno=42, end_col_offset=19), Add(), Constant(4, lineno=42, col_offset=22, end_lineno=42, end_col_offset=23), lineno=42, col_offset=13, end_lineno=42, end_col_offset=23), Name('placeholder_2', Load(), lineno=42, col_offset=45, end_lineno=42, end_col_offset=51), lineno=42, col_offset=13, end_lineno=42, end_col_offset=51), lineno=42, col_offset=4, end_lineno=42, end_col_offset=51), Assign([Name('placeholder_5', Store(), lineno=43, col_offset=4, end_lineno=43, end_col_offset=11)], Call(Name('placeholder_1', Load(), lineno=43, col_offset=14, end_lineno=43, end_col_offset=35), [Name('placeholder_2', Load(), lineno=43, col_offset=36, end_lineno=43, end_col_offset=42)], [], lineno=43, col_offset=14, end_lineno=43, end_col_offset=43), lineno=43, col_offset=4, end_lineno=43, end_col_offset=43), For(Name('placeholder_3', Store(), lineno=44, col_offset=8, end_lineno=44, end_col_offset=12), Call(Name('range', Load(), lineno=44, col_offset=16, end_lineno=44, end_col_offset=21), [Name('placeholder_2', Load(), lineno=44, col_offset=22, end_lineno=44, end_col_offset=28)], [], lineno=44, col_offset=16, end_lineno=44, end_col_offset=29), [Assign([Name('placeholder_6', Store(), lineno=45, col_offset=8, end_lineno=45, end_col_offset=18)], Call(Attribute(Name('math', Load(), lineno=45, col_offset=21, end_lineno=45, end_col_offset=25), 'ceil', Load(), lineno=45, col_offset=21, end_lineno=45, end_col_offset=30), [BinOp(BinOp(Name('placeholder_3', Load(), lineno=45, col_offset=32, end_lineno=45, end_col_offset=36), Add(), Constant(1, lineno=45, col_offset=37, end_lineno=45, end_col_offset=38), lineno=45, col_offset=32, end_lineno=45, end_col_offset=38), Div(), Constant(4, lineno=45, col_offset=42, end_lineno=45, end_col_offset=43), lineno=45, col_offset=31, end_lineno=45, end_col_offset=43)], [], lineno=45, col_offset=21, end_lineno=45, end_col_offset=44), lineno=45, col_offset=8, end_lineno=45, end_col_offset=44), If(Compare(Name('placeholder_6', Load(), lineno=46, col_offset=11, end_lineno=46, end_col_offset=21), [NotEq()], [Constant(13, lineno=46, col_offset=25, end_lineno=46, end_col_offset=27)], lineno=46, col_offset=11, end_lineno=46, end_col_offset=27), [Expr(Yield(JoinedStr([FormattedValue(Call(Name('str', Load(), lineno=47, col_offset=21, end_lineno=47, end_col_offset=24), [Name('placeholder_6', Load(), lineno=47, col_offset=25, end_lineno=47, end_col_offset=35)], [], lineno=47, col_offset=21, end_lineno=47, end_col_offset=36), -1, lineno=47, col_offset=18, end_lineno=47, end_col_offset=53), FormattedValue(Call(Name('next', Load(), lineno=47, col_offset=38, end_lineno=47, end_col_offset=42), [Name('placeholder_5', Load(), lineno=47, col_offset=43, end_lineno=47, end_col_offset=50)], [], lineno=47, col_offset=38, end_lineno=47, end_col_offset=51), -1, lineno=47, col_offset=18, end_lineno=47, end_col_offset=53)], lineno=47, col_offset=18, end_lineno=47, end_col_offset=53), lineno=47, col_offset=12, end_lineno=47, end_col_offset=53), lineno=47, col_offset=12, end_lineno=47, end_col_offset=53)], [], lineno=46, col_offset=8, end_lineno=47, end_col_offset=53)], [], lineno=44, col_offset=4, end_lineno=47, end_col_offset=53)], [], lineno=25, col_offset=0, end_lineno=47, end_col_offset=53), FunctionDef('placeholder_7', arguments([], [arg('placeholder_8', lineno=53, col_offset=17, end_lineno=53, end_col_offset=27)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_2', Store(), lineno=63, col_offset=4, end_lineno=63, end_col_offset=10)], Call(Name('len', Load(), lineno=63, col_offset=13, end_lineno=63, end_col_offset=16), [Name('placeholder_8', Load(), lineno=63, col_offset=17, end_lineno=63, end_col_offset=27)], [], lineno=63, col_offset=13, end_lineno=63, end_col_offset=28), lineno=63, col_offset=4, end_lineno=63, end_col_offset=28), Assign([Name('placeholder_9', Store(), lineno=64, col_offset=4, end_lineno=64, end_col_offset=10)], Dict([], [], lineno=64, col_offset=13, end_lineno=64, end_col_offset=15), lineno=64, col_offset=4, end_lineno=64, end_col_offset=15), For(Tuple([Name('placeholder_10', Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=17), Name('placeholder_11', Store(), lineno=65, col_offset=19, end_lineno=65, end_col_offset=30)], Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=30), Call(Name('zip', Load(), lineno=65, col_offset=34, end_lineno=65, end_col_offset=37), [Name('placeholder_8', Load(), lineno=65, col_offset=38, end_lineno=65, end_col_offset=48), Call(Name('placeholder_4', Load(), lineno=65, col_offset=50, end_lineno=65, end_col_offset=64), [Name('placeholder_2', Load(), lineno=65, col_offset=65, end_lineno=65, end_col_offset=71)], [], lineno=65, col_offset=50, end_lineno=65, end_col_offset=72)], [], lineno=65, col_offset=34, end_lineno=65, end_col_offset=73), [Assign([Subscript(Name('placeholder_9', Load(), lineno=66, col_offset=8, end_lineno=66, end_col_offset=14), Name('placeholder_10', Load(), lineno=66, col_offset=15, end_lineno=66, end_col_offset=24), Store(), lineno=66, col_offset=8, end_lineno=66, end_col_offset=25)], Name('placeholder_11', Load(), lineno=66, col_offset=28, end_lineno=66, end_col_offset=39), lineno=66, col_offset=8, end_lineno=66, end_col_offset=39)], [], lineno=65, col_offset=4, end_lineno=66, end_col_offset=39), Return(Name('placeholder_9', Load(), lineno=67, col_offset=11, end_lineno=67, end_col_offset=17), lineno=67, col_offset=4, end_lineno=67, end_col_offset=17)], [], lineno=53, col_offset=0, end_lineno=67, end_col_offset=17), FunctionDef('placeholder_12', arguments([], [arg('placeholder_13', lineno=69, col_offset=19, end_lineno=69, end_col_offset=31), arg('placeholder_14', lineno=69, col_offset=33, end_lineno=69, end_col_offset=42)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_3', Store(), lineno=78, col_offset=8, end_lineno=78, end_col_offset=12), Name('placeholder_13', Load(), lineno=78, col_offset=16, end_lineno=78, end_col_offset=28), [Assign([Name('placeholder_15', Store(), lineno=79, col_offset=8, end_lineno=79, end_col_offset=19)], JoinedStr([FormattedValue(Name('placeholder_3', Load(), lineno=79, col_offset=25, end_lineno=79, end_col_offset=29), -1, lineno=79, col_offset=22, end_lineno=79, end_col_offset=42), FormattedValue(Name('placeholder_14', Load(), lineno=79, col_offset=31, end_lineno=79, end_col_offset=40), -1, lineno=79, col_offset=22, end_lineno=79, end_col_offset=42)], lineno=79, col_offset=22, end_lineno=79, end_col_offset=42), lineno=79, col_offset=8, end_lineno=79, end_col_offset=42), Expr(Yield(BinOp(Name('placeholder_15', Load(), lineno=80, col_offset=14, end_lineno=80, end_col_offset=25), Add(), BinOp(Constant('0', lineno=80, col_offset=28, end_lineno=80, end_col_offset=31), Mult(), BinOp(Constant(12, lineno=80, col_offset=35, end_lineno=80, end_col_offset=37), Sub(), Call(Name('len', Load(), lineno=80, col_offset=40, end_lineno=80, end_col_offset=43), [Name('placeholder_15', Load(), lineno=80, col_offset=44, end_lineno=80, end_col_offset=55)], [], lineno=80, col_offset=40, end_lineno=80, end_col_offset=56), lineno=80, col_offset=35, end_lineno=80, end_col_offset=56), lineno=80, col_offset=28, end_lineno=80, end_col_offset=57), lineno=80, col_offset=14, end_lineno=80, end_col_offset=57), lineno=80, col_offset=8, end_lineno=80, end_col_offset=57), lineno=80, col_offset=8, end_lineno=80, end_col_offset=57)], [], lineno=78, col_offset=4, end_lineno=80, end_col_offset=57)], [], lineno=69, col_offset=0, end_lineno=80, end_col_offset=57)], []) \ No newline at end of file diff --git a/test/example-generator-normalization/representation.out b/test/example-generator-normalization/representation.out index d7add39..fed1f4c 100644 --- a/test/example-generator-normalization/representation.out +++ b/test/example-generator-normalization/representation.out @@ -6,7 +6,7 @@ placeholder_0 = ["A", "B", "C", "D"] def placeholder_1(placeholder_2): for placeholder_3 in range(placeholder_2): - yield SEATS_IN_ROW[seat % 4] + yield placeholder_0[placeholder_3 % 4] def placeholder_4(placeholder_2): @@ -15,7 +15,7 @@ def placeholder_4(placeholder_2): for placeholder_3 in range(placeholder_2): placeholder_6 = math.ceil((placeholder_3 + 1) / 4) if placeholder_6 != 13: - yield f"{str(row_number)}{next(letters)}" + yield f"{str(placeholder_6)}{next(placeholder_5)}" def placeholder_7(placeholder_8): @@ -31,7 +31,7 @@ def placeholder_7(placeholder_8): def placeholder_12(placeholder_13, placeholder_14): for placeholder_3 in placeholder_13: placeholder_15 = f"{placeholder_3}{placeholder_14}" - yield (base_string + "0" * (12 - len(base_string))) + yield (placeholder_15 + "0" * (12 - len(placeholder_15))) ## END NORMALIZED CODE ## @@ -1023,7 +1023,7 @@ Module( Yield( Subscript( Name( - 'SEATS_IN_ROW', + 'placeholder_0', Load(), lineno=22, col_offset=14, @@ -1031,7 +1031,7 @@ Module( end_col_offset=26), BinOp( Name( - 'seat', + 'placeholder_3', Load(), lineno=22, col_offset=27, @@ -1318,7 +1318,7 @@ Module( end_col_offset=24), [ Name( - 'row_number', + 'placeholder_6', Load(), lineno=47, col_offset=25, @@ -1345,7 +1345,7 @@ Module( end_col_offset=42), [ Name( - 'letters', + 'placeholder_5', Load(), lineno=47, col_offset=43, @@ -1663,7 +1663,7 @@ Module( Yield( BinOp( Name( - 'base_string', + 'placeholder_15', Load(), lineno=80, col_offset=14, @@ -1696,7 +1696,7 @@ Module( end_col_offset=43), [ Name( - 'base_string', + 'placeholder_15', Load(), lineno=80, col_offset=44, diff --git a/test/example-generator-normalization/representation.txt b/test/example-generator-normalization/representation.txt index 7a2615a..daae570 100644 --- a/test/example-generator-normalization/representation.txt +++ b/test/example-generator-normalization/representation.txt @@ -1 +1 @@ -Module([Import([alias('math', lineno=3, col_offset=7, end_lineno=3, end_col_offset=11)], lineno=3, col_offset=0, end_lineno=3, end_col_offset=11), Assign([Name('placeholder_0', Store(), lineno=5, col_offset=0, end_lineno=5, end_col_offset=12)], List([Constant('A', lineno=5, col_offset=16, end_lineno=5, end_col_offset=19), Constant('B', lineno=5, col_offset=21, end_lineno=5, end_col_offset=24), Constant('C', lineno=5, col_offset=26, end_lineno=5, end_col_offset=29), Constant('D', lineno=5, col_offset=31, end_lineno=5, end_col_offset=34)], Load(), lineno=5, col_offset=15, end_lineno=5, end_col_offset=35), lineno=5, col_offset=0, end_lineno=5, end_col_offset=35), FunctionDef('placeholder_1', arguments([], [arg('placeholder_2', lineno=8, col_offset=26, end_lineno=8, end_col_offset=32)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_3', Store(), lineno=21, col_offset=8, end_lineno=21, end_col_offset=12), Call(Name('range', Load(), lineno=21, col_offset=16, end_lineno=21, end_col_offset=21), [Name('placeholder_2', Load(), lineno=21, col_offset=22, end_lineno=21, end_col_offset=28)], [], lineno=21, col_offset=16, end_lineno=21, end_col_offset=29), [Expr(Yield(Subscript(Name('SEATS_IN_ROW', Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=26), BinOp(Name('seat', Load(), lineno=22, col_offset=27, end_lineno=22, end_col_offset=31), Mod(), Constant(4, lineno=22, col_offset=34, end_lineno=22, end_col_offset=35), lineno=22, col_offset=27, end_lineno=22, end_col_offset=35), Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=36), lineno=22, col_offset=8, end_lineno=22, end_col_offset=36), lineno=22, col_offset=8, end_lineno=22, end_col_offset=36)], [], lineno=21, col_offset=4, end_lineno=22, end_col_offset=36)], [], lineno=8, col_offset=0, end_lineno=22, end_col_offset=36), FunctionDef('placeholder_4', arguments([], [arg('placeholder_2', lineno=25, col_offset=19, end_lineno=25, end_col_offset=25)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_2', Store(), lineno=42, col_offset=4, end_lineno=42, end_col_offset=10)], IfExp(Compare(Name('placeholder_2', Load(), lineno=42, col_offset=27, end_lineno=42, end_col_offset=33), [GtE()], [Constant(13, lineno=42, col_offset=37, end_lineno=42, end_col_offset=39)], lineno=42, col_offset=27, end_lineno=42, end_col_offset=39), BinOp(Name('placeholder_2', Load(), lineno=42, col_offset=13, end_lineno=42, end_col_offset=19), Add(), Constant(4, lineno=42, col_offset=22, end_lineno=42, end_col_offset=23), lineno=42, col_offset=13, end_lineno=42, end_col_offset=23), Name('placeholder_2', Load(), lineno=42, col_offset=45, end_lineno=42, end_col_offset=51), lineno=42, col_offset=13, end_lineno=42, end_col_offset=51), lineno=42, col_offset=4, end_lineno=42, end_col_offset=51), Assign([Name('placeholder_5', Store(), lineno=43, col_offset=4, end_lineno=43, end_col_offset=11)], Call(Name('placeholder_1', Load(), lineno=43, col_offset=14, end_lineno=43, end_col_offset=35), [Name('placeholder_2', Load(), lineno=43, col_offset=36, end_lineno=43, end_col_offset=42)], [], lineno=43, col_offset=14, end_lineno=43, end_col_offset=43), lineno=43, col_offset=4, end_lineno=43, end_col_offset=43), For(Name('placeholder_3', Store(), lineno=44, col_offset=8, end_lineno=44, end_col_offset=12), Call(Name('range', Load(), lineno=44, col_offset=16, end_lineno=44, end_col_offset=21), [Name('placeholder_2', Load(), lineno=44, col_offset=22, end_lineno=44, end_col_offset=28)], [], lineno=44, col_offset=16, end_lineno=44, end_col_offset=29), [Assign([Name('placeholder_6', Store(), lineno=45, col_offset=8, end_lineno=45, end_col_offset=18)], Call(Attribute(Name('math', Load(), lineno=45, col_offset=21, end_lineno=45, end_col_offset=25), 'ceil', Load(), lineno=45, col_offset=21, end_lineno=45, end_col_offset=30), [BinOp(BinOp(Name('placeholder_3', Load(), lineno=45, col_offset=32, end_lineno=45, end_col_offset=36), Add(), Constant(1, lineno=45, col_offset=37, end_lineno=45, end_col_offset=38), lineno=45, col_offset=32, end_lineno=45, end_col_offset=38), Div(), Constant(4, lineno=45, col_offset=42, end_lineno=45, end_col_offset=43), lineno=45, col_offset=31, end_lineno=45, end_col_offset=43)], [], lineno=45, col_offset=21, end_lineno=45, end_col_offset=44), lineno=45, col_offset=8, end_lineno=45, end_col_offset=44), If(Compare(Name('placeholder_6', Load(), lineno=46, col_offset=11, end_lineno=46, end_col_offset=21), [NotEq()], [Constant(13, lineno=46, col_offset=25, end_lineno=46, end_col_offset=27)], lineno=46, col_offset=11, end_lineno=46, end_col_offset=27), [Expr(Yield(JoinedStr([FormattedValue(Call(Name('str', Load(), lineno=47, col_offset=21, end_lineno=47, end_col_offset=24), [Name('row_number', Load(), lineno=47, col_offset=25, end_lineno=47, end_col_offset=35)], [], lineno=47, col_offset=21, end_lineno=47, end_col_offset=36), -1, lineno=47, col_offset=18, end_lineno=47, end_col_offset=53), FormattedValue(Call(Name('next', Load(), lineno=47, col_offset=38, end_lineno=47, end_col_offset=42), [Name('letters', Load(), lineno=47, col_offset=43, end_lineno=47, end_col_offset=50)], [], lineno=47, col_offset=38, end_lineno=47, end_col_offset=51), -1, lineno=47, col_offset=18, end_lineno=47, end_col_offset=53)], lineno=47, col_offset=18, end_lineno=47, end_col_offset=53), lineno=47, col_offset=12, end_lineno=47, end_col_offset=53), lineno=47, col_offset=12, end_lineno=47, end_col_offset=53)], [], lineno=46, col_offset=8, end_lineno=47, end_col_offset=53)], [], lineno=44, col_offset=4, end_lineno=47, end_col_offset=53)], [], lineno=25, col_offset=0, end_lineno=47, end_col_offset=53), FunctionDef('placeholder_7', arguments([], [arg('placeholder_8', lineno=53, col_offset=17, end_lineno=53, end_col_offset=27)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_2', Store(), lineno=63, col_offset=4, end_lineno=63, end_col_offset=10)], Call(Name('len', Load(), lineno=63, col_offset=13, end_lineno=63, end_col_offset=16), [Name('placeholder_8', Load(), lineno=63, col_offset=17, end_lineno=63, end_col_offset=27)], [], lineno=63, col_offset=13, end_lineno=63, end_col_offset=28), lineno=63, col_offset=4, end_lineno=63, end_col_offset=28), Assign([Name('placeholder_9', Store(), lineno=64, col_offset=4, end_lineno=64, end_col_offset=10)], Dict([], [], lineno=64, col_offset=13, end_lineno=64, end_col_offset=15), lineno=64, col_offset=4, end_lineno=64, end_col_offset=15), For(Tuple([Name('placeholder_10', Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=17), Name('placeholder_11', Store(), lineno=65, col_offset=19, end_lineno=65, end_col_offset=30)], Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=30), Call(Name('zip', Load(), lineno=65, col_offset=34, end_lineno=65, end_col_offset=37), [Name('placeholder_8', Load(), lineno=65, col_offset=38, end_lineno=65, end_col_offset=48), Call(Name('placeholder_4', Load(), lineno=65, col_offset=50, end_lineno=65, end_col_offset=64), [Name('placeholder_2', Load(), lineno=65, col_offset=65, end_lineno=65, end_col_offset=71)], [], lineno=65, col_offset=50, end_lineno=65, end_col_offset=72)], [], lineno=65, col_offset=34, end_lineno=65, end_col_offset=73), [Assign([Subscript(Name('placeholder_9', Load(), lineno=66, col_offset=8, end_lineno=66, end_col_offset=14), Name('placeholder_10', Load(), lineno=66, col_offset=15, end_lineno=66, end_col_offset=24), Store(), lineno=66, col_offset=8, end_lineno=66, end_col_offset=25)], Name('placeholder_11', Load(), lineno=66, col_offset=28, end_lineno=66, end_col_offset=39), lineno=66, col_offset=8, end_lineno=66, end_col_offset=39)], [], lineno=65, col_offset=4, end_lineno=66, end_col_offset=39), Return(Name('placeholder_9', Load(), lineno=67, col_offset=11, end_lineno=67, end_col_offset=17), lineno=67, col_offset=4, end_lineno=67, end_col_offset=17)], [], lineno=53, col_offset=0, end_lineno=67, end_col_offset=17), FunctionDef('placeholder_12', arguments([], [arg('placeholder_13', lineno=69, col_offset=19, end_lineno=69, end_col_offset=31), arg('placeholder_14', lineno=69, col_offset=33, end_lineno=69, end_col_offset=42)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_3', Store(), lineno=78, col_offset=8, end_lineno=78, end_col_offset=12), Name('placeholder_13', Load(), lineno=78, col_offset=16, end_lineno=78, end_col_offset=28), [Assign([Name('placeholder_15', Store(), lineno=79, col_offset=8, end_lineno=79, end_col_offset=19)], JoinedStr([FormattedValue(Name('placeholder_3', Load(), lineno=79, col_offset=25, end_lineno=79, end_col_offset=29), -1, lineno=79, col_offset=22, end_lineno=79, end_col_offset=42), FormattedValue(Name('placeholder_14', Load(), lineno=79, col_offset=31, end_lineno=79, end_col_offset=40), -1, lineno=79, col_offset=22, end_lineno=79, end_col_offset=42)], lineno=79, col_offset=22, end_lineno=79, end_col_offset=42), lineno=79, col_offset=8, end_lineno=79, end_col_offset=42), Expr(Yield(BinOp(Name('base_string', Load(), lineno=80, col_offset=14, end_lineno=80, end_col_offset=25), Add(), BinOp(Constant('0', lineno=80, col_offset=28, end_lineno=80, end_col_offset=31), Mult(), BinOp(Constant(12, lineno=80, col_offset=35, end_lineno=80, end_col_offset=37), Sub(), Call(Name('len', Load(), lineno=80, col_offset=40, end_lineno=80, end_col_offset=43), [Name('base_string', Load(), lineno=80, col_offset=44, end_lineno=80, end_col_offset=55)], [], lineno=80, col_offset=40, end_lineno=80, end_col_offset=56), lineno=80, col_offset=35, end_lineno=80, end_col_offset=56), lineno=80, col_offset=28, end_lineno=80, end_col_offset=57), lineno=80, col_offset=14, end_lineno=80, end_col_offset=57), lineno=80, col_offset=8, end_lineno=80, end_col_offset=57), lineno=80, col_offset=8, end_lineno=80, end_col_offset=57)], [], lineno=78, col_offset=4, end_lineno=80, end_col_offset=57)], [], lineno=69, col_offset=0, end_lineno=80, end_col_offset=57)], []) \ No newline at end of file +Module([Import([alias('math', lineno=3, col_offset=7, end_lineno=3, end_col_offset=11)], lineno=3, col_offset=0, end_lineno=3, end_col_offset=11), Assign([Name('placeholder_0', Store(), lineno=5, col_offset=0, end_lineno=5, end_col_offset=12)], List([Constant('A', lineno=5, col_offset=16, end_lineno=5, end_col_offset=19), Constant('B', lineno=5, col_offset=21, end_lineno=5, end_col_offset=24), Constant('C', lineno=5, col_offset=26, end_lineno=5, end_col_offset=29), Constant('D', lineno=5, col_offset=31, end_lineno=5, end_col_offset=34)], Load(), lineno=5, col_offset=15, end_lineno=5, end_col_offset=35), lineno=5, col_offset=0, end_lineno=5, end_col_offset=35), FunctionDef('placeholder_1', arguments([], [arg('placeholder_2', lineno=8, col_offset=26, end_lineno=8, end_col_offset=32)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_3', Store(), lineno=21, col_offset=8, end_lineno=21, end_col_offset=12), Call(Name('range', Load(), lineno=21, col_offset=16, end_lineno=21, end_col_offset=21), [Name('placeholder_2', Load(), lineno=21, col_offset=22, end_lineno=21, end_col_offset=28)], [], lineno=21, col_offset=16, end_lineno=21, end_col_offset=29), [Expr(Yield(Subscript(Name('placeholder_0', Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=26), BinOp(Name('placeholder_3', Load(), lineno=22, col_offset=27, end_lineno=22, end_col_offset=31), Mod(), Constant(4, lineno=22, col_offset=34, end_lineno=22, end_col_offset=35), lineno=22, col_offset=27, end_lineno=22, end_col_offset=35), Load(), lineno=22, col_offset=14, end_lineno=22, end_col_offset=36), lineno=22, col_offset=8, end_lineno=22, end_col_offset=36), lineno=22, col_offset=8, end_lineno=22, end_col_offset=36)], [], lineno=21, col_offset=4, end_lineno=22, end_col_offset=36)], [], lineno=8, col_offset=0, end_lineno=22, end_col_offset=36), FunctionDef('placeholder_4', arguments([], [arg('placeholder_2', lineno=25, col_offset=19, end_lineno=25, end_col_offset=25)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_2', Store(), lineno=42, col_offset=4, end_lineno=42, end_col_offset=10)], IfExp(Compare(Name('placeholder_2', Load(), lineno=42, col_offset=27, end_lineno=42, end_col_offset=33), [GtE()], [Constant(13, lineno=42, col_offset=37, end_lineno=42, end_col_offset=39)], lineno=42, col_offset=27, end_lineno=42, end_col_offset=39), BinOp(Name('placeholder_2', Load(), lineno=42, col_offset=13, end_lineno=42, end_col_offset=19), Add(), Constant(4, lineno=42, col_offset=22, end_lineno=42, end_col_offset=23), lineno=42, col_offset=13, end_lineno=42, end_col_offset=23), Name('placeholder_2', Load(), lineno=42, col_offset=45, end_lineno=42, end_col_offset=51), lineno=42, col_offset=13, end_lineno=42, end_col_offset=51), lineno=42, col_offset=4, end_lineno=42, end_col_offset=51), Assign([Name('placeholder_5', Store(), lineno=43, col_offset=4, end_lineno=43, end_col_offset=11)], Call(Name('placeholder_1', Load(), lineno=43, col_offset=14, end_lineno=43, end_col_offset=35), [Name('placeholder_2', Load(), lineno=43, col_offset=36, end_lineno=43, end_col_offset=42)], [], lineno=43, col_offset=14, end_lineno=43, end_col_offset=43), lineno=43, col_offset=4, end_lineno=43, end_col_offset=43), For(Name('placeholder_3', Store(), lineno=44, col_offset=8, end_lineno=44, end_col_offset=12), Call(Name('range', Load(), lineno=44, col_offset=16, end_lineno=44, end_col_offset=21), [Name('placeholder_2', Load(), lineno=44, col_offset=22, end_lineno=44, end_col_offset=28)], [], lineno=44, col_offset=16, end_lineno=44, end_col_offset=29), [Assign([Name('placeholder_6', Store(), lineno=45, col_offset=8, end_lineno=45, end_col_offset=18)], Call(Attribute(Name('math', Load(), lineno=45, col_offset=21, end_lineno=45, end_col_offset=25), 'ceil', Load(), lineno=45, col_offset=21, end_lineno=45, end_col_offset=30), [BinOp(BinOp(Name('placeholder_3', Load(), lineno=45, col_offset=32, end_lineno=45, end_col_offset=36), Add(), Constant(1, lineno=45, col_offset=37, end_lineno=45, end_col_offset=38), lineno=45, col_offset=32, end_lineno=45, end_col_offset=38), Div(), Constant(4, lineno=45, col_offset=42, end_lineno=45, end_col_offset=43), lineno=45, col_offset=31, end_lineno=45, end_col_offset=43)], [], lineno=45, col_offset=21, end_lineno=45, end_col_offset=44), lineno=45, col_offset=8, end_lineno=45, end_col_offset=44), If(Compare(Name('placeholder_6', Load(), lineno=46, col_offset=11, end_lineno=46, end_col_offset=21), [NotEq()], [Constant(13, lineno=46, col_offset=25, end_lineno=46, end_col_offset=27)], lineno=46, col_offset=11, end_lineno=46, end_col_offset=27), [Expr(Yield(JoinedStr([FormattedValue(Call(Name('str', Load(), lineno=47, col_offset=21, end_lineno=47, end_col_offset=24), [Name('placeholder_6', Load(), lineno=47, col_offset=25, end_lineno=47, end_col_offset=35)], [], lineno=47, col_offset=21, end_lineno=47, end_col_offset=36), -1, lineno=47, col_offset=18, end_lineno=47, end_col_offset=53), FormattedValue(Call(Name('next', Load(), lineno=47, col_offset=38, end_lineno=47, end_col_offset=42), [Name('placeholder_5', Load(), lineno=47, col_offset=43, end_lineno=47, end_col_offset=50)], [], lineno=47, col_offset=38, end_lineno=47, end_col_offset=51), -1, lineno=47, col_offset=18, end_lineno=47, end_col_offset=53)], lineno=47, col_offset=18, end_lineno=47, end_col_offset=53), lineno=47, col_offset=12, end_lineno=47, end_col_offset=53), lineno=47, col_offset=12, end_lineno=47, end_col_offset=53)], [], lineno=46, col_offset=8, end_lineno=47, end_col_offset=53)], [], lineno=44, col_offset=4, end_lineno=47, end_col_offset=53)], [], lineno=25, col_offset=0, end_lineno=47, end_col_offset=53), FunctionDef('placeholder_7', arguments([], [arg('placeholder_8', lineno=53, col_offset=17, end_lineno=53, end_col_offset=27)], kwonlyargs=[], kw_defaults=[], defaults=[]), [Assign([Name('placeholder_2', Store(), lineno=63, col_offset=4, end_lineno=63, end_col_offset=10)], Call(Name('len', Load(), lineno=63, col_offset=13, end_lineno=63, end_col_offset=16), [Name('placeholder_8', Load(), lineno=63, col_offset=17, end_lineno=63, end_col_offset=27)], [], lineno=63, col_offset=13, end_lineno=63, end_col_offset=28), lineno=63, col_offset=4, end_lineno=63, end_col_offset=28), Assign([Name('placeholder_9', Store(), lineno=64, col_offset=4, end_lineno=64, end_col_offset=10)], Dict([], [], lineno=64, col_offset=13, end_lineno=64, end_col_offset=15), lineno=64, col_offset=4, end_lineno=64, end_col_offset=15), For(Tuple([Name('placeholder_10', Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=17), Name('placeholder_11', Store(), lineno=65, col_offset=19, end_lineno=65, end_col_offset=30)], Store(), lineno=65, col_offset=8, end_lineno=65, end_col_offset=30), Call(Name('zip', Load(), lineno=65, col_offset=34, end_lineno=65, end_col_offset=37), [Name('placeholder_8', Load(), lineno=65, col_offset=38, end_lineno=65, end_col_offset=48), Call(Name('placeholder_4', Load(), lineno=65, col_offset=50, end_lineno=65, end_col_offset=64), [Name('placeholder_2', Load(), lineno=65, col_offset=65, end_lineno=65, end_col_offset=71)], [], lineno=65, col_offset=50, end_lineno=65, end_col_offset=72)], [], lineno=65, col_offset=34, end_lineno=65, end_col_offset=73), [Assign([Subscript(Name('placeholder_9', Load(), lineno=66, col_offset=8, end_lineno=66, end_col_offset=14), Name('placeholder_10', Load(), lineno=66, col_offset=15, end_lineno=66, end_col_offset=24), Store(), lineno=66, col_offset=8, end_lineno=66, end_col_offset=25)], Name('placeholder_11', Load(), lineno=66, col_offset=28, end_lineno=66, end_col_offset=39), lineno=66, col_offset=8, end_lineno=66, end_col_offset=39)], [], lineno=65, col_offset=4, end_lineno=66, end_col_offset=39), Return(Name('placeholder_9', Load(), lineno=67, col_offset=11, end_lineno=67, end_col_offset=17), lineno=67, col_offset=4, end_lineno=67, end_col_offset=17)], [], lineno=53, col_offset=0, end_lineno=67, end_col_offset=17), FunctionDef('placeholder_12', arguments([], [arg('placeholder_13', lineno=69, col_offset=19, end_lineno=69, end_col_offset=31), arg('placeholder_14', lineno=69, col_offset=33, end_lineno=69, end_col_offset=42)], kwonlyargs=[], kw_defaults=[], defaults=[]), [For(Name('placeholder_3', Store(), lineno=78, col_offset=8, end_lineno=78, end_col_offset=12), Name('placeholder_13', Load(), lineno=78, col_offset=16, end_lineno=78, end_col_offset=28), [Assign([Name('placeholder_15', Store(), lineno=79, col_offset=8, end_lineno=79, end_col_offset=19)], JoinedStr([FormattedValue(Name('placeholder_3', Load(), lineno=79, col_offset=25, end_lineno=79, end_col_offset=29), -1, lineno=79, col_offset=22, end_lineno=79, end_col_offset=42), FormattedValue(Name('placeholder_14', Load(), lineno=79, col_offset=31, end_lineno=79, end_col_offset=40), -1, lineno=79, col_offset=22, end_lineno=79, end_col_offset=42)], lineno=79, col_offset=22, end_lineno=79, end_col_offset=42), lineno=79, col_offset=8, end_lineno=79, end_col_offset=42), Expr(Yield(BinOp(Name('placeholder_15', Load(), lineno=80, col_offset=14, end_lineno=80, end_col_offset=25), Add(), BinOp(Constant('0', lineno=80, col_offset=28, end_lineno=80, end_col_offset=31), Mult(), BinOp(Constant(12, lineno=80, col_offset=35, end_lineno=80, end_col_offset=37), Sub(), Call(Name('len', Load(), lineno=80, col_offset=40, end_lineno=80, end_col_offset=43), [Name('placeholder_15', Load(), lineno=80, col_offset=44, end_lineno=80, end_col_offset=55)], [], lineno=80, col_offset=40, end_lineno=80, end_col_offset=56), lineno=80, col_offset=35, end_lineno=80, end_col_offset=56), lineno=80, col_offset=28, end_lineno=80, end_col_offset=57), lineno=80, col_offset=14, end_lineno=80, end_col_offset=57), lineno=80, col_offset=8, end_lineno=80, end_col_offset=57), lineno=80, col_offset=8, end_lineno=80, end_col_offset=57)], [], lineno=78, col_offset=4, end_lineno=80, end_col_offset=57)], [], lineno=69, col_offset=0, end_lineno=80, end_col_offset=57)], []) \ No newline at end of file