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..fdb8d51 --- /dev/null +++ b/test/example-parencontext-normalization/example_parencontext_normalization.py @@ -0,0 +1,78 @@ +"""Examples of Parenthesized Context Managers. New feature in Python 3.10""" + + + +# 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 +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): + 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 + + + + + +# This example shows a CLI that opens two files with context managers that are grouped by parens. +#!/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() \ 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..4b253ea --- /dev/null +++ b/test/example-parencontext-normalization/mapping.json @@ -0,0 +1,20 @@ +{ + "placeholder_0": "pd", + "placeholder_1": "calc_fixed_rate", + "placeholder_2": "spot_price", + "placeholder_3": "position_duration", + "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.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..bbe3fe3 --- /dev/null +++ b/test/example-parencontext-normalization/representation.out @@ -0,0 +1,1849 @@ +## BEGIN NORMALIZED CODE ## +"""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: + 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" +from argparse import ArgumentParser +import json + + +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_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 ## + +## 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( + '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', + 'pd', + 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( + 'calc_fixed_rate', + arguments( + [], + [ + arg( + 'spot_price', + Attribute( + Name( + 'pd', + Load(), + lineno=13, + col_offset=32, + end_lineno=13, + end_col_offset=34), + 'Series', + Load(), + lineno=13, + col_offset=32, + end_lineno=13, + end_col_offset=41), + lineno=13, + col_offset=20, + end_lineno=13, + end_col_offset=41), + arg( + 'position_duration', + Name( + 'Decimal', + Load(), + lineno=13, + col_offset=62, + end_lineno=13, + end_col_offset=69), + lineno=13, + col_offset=43, + end_lineno=13, + 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=14, + col_offset=4, + end_lineno=27, + end_col_offset=7), + lineno=14, + col_offset=4, + end_lineno=27, + end_col_offset=7), + 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( + 'ctx', + Store(), + lineno=31, + col_offset=28, + end_lineno=31, + end_col_offset=31))], + [ + Assign( + [ + Attribute( + Name( + 'ctx', + Load(), + lineno=32, + col_offset=8, + end_lineno=32, + end_col_offset=11), + 'prec', + 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( + 'ctx', + Load(), + lineno=33, + col_offset=8, + end_lineno=33, + end_col_offset=11), + 'rounding', + 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( + 'annualized_time', + Store(), + lineno=34, + col_offset=8, + end_lineno=34, + end_col_offset=23)], + BinOp( + Name( + 'position_duration', + 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( + '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=42, + end_col_offset=33), + Assign( + [ + Name( + 'fixed_rate', + 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( + 'spot_price', + 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( + 'spot_price', + Load(), + lineno=43, + col_offset=41, + end_lineno=43, + end_col_offset=51), + Mult(), + Name( + 'annualized_time', + 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( + 'fixed_rate', + 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)], + [], + Attribute( + Name( + 'pd', + Load(), + lineno=13, + col_offset=74, + end_lineno=13, + end_col_offset=76), + 'Series', + Load(), + lineno=13, + col_offset=74, + end_lineno=13, + end_col_offset=83), + 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( + 'main', + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Assign( + [ + Name( + 'args', + 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( + 'args', + 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( + 'in_file', + 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( + 'args', + 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( + 'mode', + 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( + 'out_file', + Store(), + lineno=63, + col_offset=46, + end_lineno=63, + end_col_offset=54))], + [ + Assign( + [ + Name( + 'records', + 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( + 'in_file', + 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( + 'record', + Store(), + lineno=66, + col_offset=12, + end_lineno=66, + end_col_offset=18), + Name( + 'records', + Load(), + lineno=66, + col_offset=22, + end_lineno=66, + end_col_offset=29), + [ + Expr( + Call( + Attribute( + Name( + 'out_file', + 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( + 'record', + 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( + 'parse_args', + arguments( + [], + [], + kwonlyargs=[], + kw_defaults=[], + defaults=[]), + [ + Assign( + [ + Name( + 'parser', + 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( + 'parser', + 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( + 'parser', + 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( + 'args', + Store(), + lineno=74, + col_offset=4, + end_lineno=74, + end_col_offset=8)], + Call( + Attribute( + Name( + 'parser', + Load(), + lineno=74, + col_offset=11, + end_lineno=74, + end_col_offset=17), + 'parse_args', + 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( + 'args', + 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), + If( + Compare( + Name( + '__name__', + Load(), + lineno=77, + col_offset=3, + end_lineno=77, + end_col_offset=11), + [ + Eq()], + [ + Constant( + '__main__', + lineno=77, + col_offset=15, + end_lineno=77, + end_col_offset=25)], + lineno=77, + col_offset=3, + end_lineno=77, + end_col_offset=25), + [ + Expr( + Call( + Name( + 'main', + Load(), + lineno=78, + col_offset=4, + end_lineno=78, + end_col_offset=8), + [], + [], + lineno=78, + col_offset=4, + end_lineno=78, + end_col_offset=10), + lineno=78, + col_offset=4, + end_lineno=78, + end_col_offset=10)], + [], + lineno=77, + col_offset=0, + end_lineno=78, + end_col_offset=10)], + []) +## END TREE BEFORE ## + +## BEGIN NORMALIZED TREE ## +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)], + []) +## 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..83cb243 --- /dev/null +++ b/test/example-parencontext-normalization/representation.txt @@ -0,0 +1 @@ +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