123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756 |
- Module(body=[Assign(targets=[Name(id='bugs',
- ctx=Store())],
- value=List(elts=[Num(n=-0.5),
- Num(n=-0.025),
- Num(n=-0.055),
- Num(n=0.045),
- Num(n=-0.0025),
- Num(n=-0.0035),
- Num(n=0.0045),
- Num(n=0.0055),
- Num(n=-250),
- Num(n=-350),
- Num(n=-450),
- Num(n=-550)],
- ctx=Load())),
- FunctionDef(name='helper',
- args=arguments(args=[Name(id='iterable',
- ctx=Param()),
- Name(id='expect',
- ctx=Param()),
- Name(id='n',
- ctx=Param())],
- vararg=None,
- kwarg=None,
- defaults=[Name(id='None',
- ctx=Load())]),
- body=[If(test=Name(id='n',
- ctx=Load()),
- body=[For(target=Name(id='i',
- ctx=Store()),
- iter=Name(id='iterable',
- ctx=Load()),
- body=[Assign(targets=[Name(id='r',
- ctx=Store())],
- value=Call(func=Name(id='round',
- ctx=Load()),
- args=[Name(id='i',
- ctx=Load()),
- Name(id='n',
- ctx=Load())],
- keywords=[],
- starargs=None,
- kwargs=None)),
- If(test=BoolOp(op=And(),
- values=[Compare(left=Call(func=Name(id='abs',
- ctx=Load()),
- args=[BinOp(left=Name(id='r',
- ctx=Load()),
- op=Sub(),
- right=Name(id='expect',
- ctx=Load()))],
- keywords=[],
- starargs=None,
- kwargs=None),
- ops=[Gt()],
- comparators=[BinOp(left=Num(n=1),
- op=Div(),
- right=BinOp(left=Num(n=10.0),
- op=Pow(),
- right=BinOp(left=Name(id='n',
- ctx=Load()),
- op=Add(),
- right=Num(n=1))))]),
- Compare(left=Name(id='i',
- ctx=Load()),
- ops=[NotIn()],
- comparators=[Name(id='bugs',
- ctx=Load())])]),
- body=[Print(dest=None,
- values=[Name(id='False',
- ctx=Load()),
- Name(id='i',
- ctx=Load()),
- Str(s=' expected: '),
- Name(id='expect',
- ctx=Load()),
- Str(s=' result: '),
- Name(id='r',
- ctx=Load()),
- Call(func=Name(id='abs',
- ctx=Load()),
- args=[BinOp(left=Name(id='r',
- ctx=Load()),
- op=Sub(),
- right=Name(id='expect',
- ctx=Load()))],
- keywords=[],
- starargs=None,
- kwargs=None)],
- nl=True)],
- orelse=[])],
- orelse=[])],
- orelse=[For(target=Name(id='i',
- ctx=Store()),
- iter=Name(id='iterable',
- ctx=Load()),
- body=[Assign(targets=[Name(id='r',
- ctx=Store())],
- value=Call(func=Name(id='round',
- ctx=Load()),
- args=[Name(id='i',
- ctx=Load())],
- keywords=[],
- starargs=None,
- kwargs=None)),
- If(test=BoolOp(op=And(),
- values=[Compare(left=Call(func=Name(id='abs',
- ctx=Load()),
- args=[BinOp(left=Name(id='r',
- ctx=Load()),
- op=Sub(),
- right=Name(id='expect',
- ctx=Load()))],
- keywords=[],
- starargs=None,
- kwargs=None),
- ops=[Gt()],
- comparators=[Num(n=1e-06)]),
- Compare(left=Name(id='i',
- ctx=Load()),
- ops=[NotIn()],
- comparators=[Name(id='bugs',
- ctx=Load())])]),
- body=[Print(dest=None,
- values=[Name(id='False',
- ctx=Load()),
- Name(id='i',
- ctx=Load()),
- Str(s=' expected: '),
- Name(id='expect',
- ctx=Load()),
- Str(s=' result: '),
- Name(id='r',
- ctx=Load()),
- Call(func=Name(id='abs',
- ctx=Load()),
- args=[BinOp(left=Name(id='r',
- ctx=Load()),
- op=Sub(),
- right=Name(id='expect',
- ctx=Load()))],
- keywords=[],
- starargs=None,
- kwargs=None)],
- nl=True)],
- orelse=[])],
- orelse=[])])],
- decorator_list=[]),
- Print(dest=None,
- values=[Str(s='\n-1.4 to 1.4, no ndigit')],
- nl=True),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=10.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-5),
- Num(n=-15),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=10.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=4),
- Num(n=-5),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=0)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=10.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=5),
- Num(n=15)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=1)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Print(dest=None,
- values=[Str(s='\n-1.49 to 1.49, no ndigit')],
- nl=True),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=100.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-50),
- Num(n=-150),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=100.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=40),
- Num(n=-50),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=0)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=100.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=50),
- Num(n=150)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=1)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Print(dest=None,
- values=[Str(s='\n-0.064 to -0.025, ndigit=2')],
- nl=True),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=1000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-25),
- Num(n=-35),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=-0.03),
- Num(n=2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=1000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-35),
- Num(n=-46),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=-0.04),
- Num(n=2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=1000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-46),
- Num(n=-55),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=-0.05),
- Num(n=2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=1000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-55),
- Num(n=-65),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=-0.06),
- Num(n=2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Print(dest=None,
- values=[Str(s='\n0.025 to 0.064, ndigit=2')],
- nl=True),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=1000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=25),
- Num(n=35)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=0.03),
- Num(n=2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=1000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=35),
- Num(n=46)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=0.04),
- Num(n=2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=1000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=46),
- Num(n=55)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=0.05),
- Num(n=2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=1000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=55),
- Num(n=65)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=0.06),
- Num(n=2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Print(dest=None,
- values=[Str(s='\n-0.0064 to -0.0025, ndigit=3')],
- nl=True),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=10000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-25),
- Num(n=-35),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=-0.003),
- Num(n=3)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=10000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-35),
- Num(n=-46),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=-0.004),
- Num(n=3)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=10000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-46),
- Num(n=-56),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=-0.005),
- Num(n=3)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=10000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-56),
- Num(n=-65),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=-0.006),
- Num(n=3)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Print(dest=None,
- values=[Str(s='\n0.0025 to 0.0064, ndigit=3')],
- nl=True),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=10000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=25),
- Num(n=35)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=0.003),
- Num(n=3)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=10000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=35),
- Num(n=46)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=0.004),
- Num(n=3)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=10000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=46),
- Num(n=56)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=0.005),
- Num(n=3)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[ListComp(elt=BinOp(left=Name(id='x',
- ctx=Load()),
- op=Div(),
- right=Num(n=10000.0)),
- generators=[comprehension(target=Name(id='x',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=56),
- Num(n=65)],
- keywords=[],
- starargs=None,
- kwargs=None),
- ifs=[])]),
- Num(n=0.006),
- Num(n=3)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Print(dest=None,
- values=[Str(s='\n-649 to -250, ndigit=-2')],
- nl=True),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-250),
- Num(n=-350),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- Num(n=-300),
- Num(n=-2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-350),
- Num(n=-450),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- Num(n=-400),
- Num(n=-2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-450),
- Num(n=-550),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- Num(n=-500),
- Num(n=-2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=-550),
- Num(n=-650),
- Num(n=-1)],
- keywords=[],
- starargs=None,
- kwargs=None),
- Num(n=-600),
- Num(n=-2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Print(dest=None,
- values=[Str(s='\n250 to 649, ndigit=-2')],
- nl=True),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=250),
- Num(n=350)],
- keywords=[],
- starargs=None,
- kwargs=None),
- Num(n=300),
- Num(n=-2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=350),
- Num(n=450)],
- keywords=[],
- starargs=None,
- kwargs=None),
- Num(n=400),
- Num(n=-2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=450),
- Num(n=550)],
- keywords=[],
- starargs=None,
- kwargs=None),
- Num(n=500),
- Num(n=-2)],
- keywords=[],
- starargs=None,
- kwargs=None)),
- Expr(value=Call(func=Name(id='helper',
- ctx=Load()),
- args=[Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=550),
- Num(n=650)],
- keywords=[],
- starargs=None,
- kwargs=None),
- Num(n=600),
- Num(n=-2)],
- keywords=[],
- starargs=None,
- kwargs=None))])
|