Module Expr Str Import alias Import alias ImportFrom alias ImportFrom alias alias alias identifier alias identifier alias identifier FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Str Str decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad Str attr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Str decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Str ListLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str ListLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str ListLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str ListLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr ListLoad Str Str Str Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr ListLoad Str Str Str Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str Str decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Dict Str Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Dict Str Str Str Str Str Expr Call AttributeLoad NameLoad attr Str Dict Str Str Str Str Str decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam defaults vararg body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Str Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Str Expr Call NameLoad Str decorator_list decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr
N/A N/A 
Test Copperhead abstract syntax tree parsing and manipulation.
 N/A unittest N/A __builtin__ copperhead prelude copperhead.compiler pltools pyast coresyntax S rewrites F passes P expr N/A N/A text N/A N/A N/A N/A N/A pyast expression_from_text text N/A stmt N/A N/A text N/A N/A N/A N/A N/A pyast statement_from_text text N/A ExprParsingTests N/A N/A unittest TestCase N/A setUp N/A N/A self N/A N/A N/A N/A tearDown N/A N/A self N/A N/A N/A N/A testLiterals N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A str N/A expr 1 1 N/A N/A N/A self assertEqual N/A str N/A expr x x N/A N/A N/A self assertEqual N/A repr N/A expr 1 Number(1) N/A N/A N/A self assertEqual N/A repr N/A expr x Name('x') N/A testOperators N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A str N/A expr 1+2 op_add(1, 2) N/A N/A N/A self assertEqual N/A str N/A expr 1>>2 op_rshift(1, 2) N/A N/A N/A self assertEqual N/A str N/A expr 1<2 cmp_lt(1, 2) N/A N/A N/A self assertEqual N/A str N/A expr x and y and (32*2) op_band(x, op_band(y, op_mul(32, 2))) N/A testMap N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A str N/A expr map(fmad, a, x, y) map(fmad, a, x, y) N/A testIf N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A str N/A expr x if True else y x if True else y N/A testLambda N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A str N/A expr lambda x: lambda y: x+y lambda x: lambda y: op_add(x, y) N/A testComprehensions N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A str N/A expr [x+3 for x in range(10)] map(lambda x: op_add(x, 3), range(10)) N/A N/A N/A self assertEqual N/A str N/A expr [x+y for x,y in zip(range(10),range(10))] map(lambda x, y: op_add(x, y), range(10), range(10)) N/A testSubscripts N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A str N/A expr A[i] A[i] N/A N/A N/A self assertEqual N/A repr N/A expr A[10] Subscript(Name('A'), Number(10)) N/A N/A N/A self assertEqual N/A repr N/A expr A[i] Subscript(Name('A'), Name('i')) N/A N/A StmtParsingTests N/A N/A unittest TestCase N/A setUp N/A N/A self N/A N/A N/A N/A tearDown N/A N/A self N/A N/A N/A N/A match N/A N/A self src ref N/A N/A N/A code N/A stmt src N/A text N/A N/A join N/A map str code N/A N/A N/A self assertEqual text ref N/A testBindings N/A N/A self N/A N/A N/A N/A N/A self match x = 4 x = 4 N/A testReturn N/A N/A self N/A N/A N/A N/A N/A self match return x+y return op_add(x, y) N/A testProcedure N/A N/A self N/A N/A N/A N/A N/A self match def f(a,b): return a * b - 4 def f(a, b):
    return op_sub(op_mul(a, b), 4) N/A testCond N/A N/A self N/A N/A N/A N/A N/A self match if x<1: return x
else:  return 1/x if cmp_lt(x, 1):
    return x
else:
    return op_div(1, x) N/A N/A FreeVariableTests N/A N/A unittest TestCase N/A setUp N/A N/A self N/A N/A N/A N/A self env N/A N/A pltools Environment N/A prelude __dict__ N/A __builtin__ __dict__ N/A tearDown N/A N/A self N/A N/A N/A N/A check N/A N/A self src vars N/A N/A N/A f N/A N/A S free_variables src N/A self env N/A N/A N/A self assertEqual N/A sorted f N/A sorted N/A list vars N/A testLiterals N/A N/A self N/A N/A N/A N/A N/A self check N/A expr 32 N/A N/A N/A N/A self check N/A expr True and False N/A N/A N/A N/A self check N/A expr None N/A N/A N/A N/A self check N/A expr True and x x N/A testSimple N/A N/A self N/A N/A N/A N/A N/A self check N/A expr x+y xy N/A N/A N/A self check N/A expr f(g(x, y)) fgxy N/A testLambda N/A N/A self N/A N/A N/A N/A N/A self check N/A expr lambda x: y*x y N/A N/A N/A self check N/A expr lambda y: lambda x: y*x N/A N/A testClosure N/A N/A self N/A N/A N/A N/A N/A self check N/A N/A S Closure N/A N/A N/A S Name a N/A N/A S Name b N/A N/A S Lambda N/A map N/A S Name N/A x y z N/A N/A S And N/A map N/A S Name N/A w x y z abw N/A testBindings N/A N/A self N/A N/A N/A N/A N/A self check N/A stmt x=3+y y N/A N/A N/A self check N/A stmt x=3; z=x+y y N/A N/A N/A self check N/A stmt x=3; z=x+y; return z y N/A N/A N/A self check N/A stmt f = lambda x: (x+y, f) fy N/A N/A SubstitutionTests N/A N/A unittest TestCase N/A setUp N/A N/A self N/A N/A N/A N/A tearDown N/A N/A self N/A N/A N/A N/A check N/A N/A self src subst ref N/A N/A N/A e N/A expr src N/A code N/A N/A S substituted_expression e subst N/A N/A N/A self assertEqual N/A str code ref N/A testExpressions N/A N/A self N/A N/A N/A N/A N/A self check x+y N/A x x_1 op_add(x_1, y) N/A testLambda N/A N/A self N/A N/A N/A N/A N/A self check lambda x: y*x N/A x y x_1 y_1 lambda x: op_mul(y_1, x) N/A N/A N/A self check lambda y: lambda x: y*x N/A x y x_1 y_1 lambda y: lambda x: op_mul(y, x) N/A N/A SyntaxErrorTests N/A N/A unittest TestCase N/A check N/A N/A self fn N/A args N/A N/A N/A N/A self assertRaises SyntaxError fn args N/A testCond N/A N/A self N/A N/A N/A N/A N/A self check stmt 
if True:
  return False
 N/A testArity N/A N/A self N/A N/A N/A N/A N/A self check N/A F arity_check N/A stmt 
a = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) N/A N/A N/A self check N/A F arity_check N/A stmt 
def foo(a, b, c, d, e, f, g, h, i, j, k):
  return 0
 N/A N/A N/A self check N/A P run_compilation N/A P frontend N/A stmt 
def foo(x):
  def sub(a, b, c, d, e, f, g, h, i, j):
    return a + b + c + d + e + f + g + h + i + j + x 
  return sub(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
 N/A N/A P Compilation silence True N/A testReturn N/A N/A self N/A N/A N/A N/A N/A self check N/A F return_check N/A stmt 
def foo(x):
  y = x
 N/A N/A N/A self check N/A F return_check N/A stmt 
def foo(x):
  if True:
    return x
  else:
    y = x
 N/A N/A N/A self check N/A F return_check N/A stmt 
def foo(x):
  if True:
    y = x
  else:
    return x
 N/A N/A N/A self check N/A F return_check N/A stmt 
def foo(x):
  if True:
    y = x
  else:
    y = x
 N/A testBuiltin N/A N/A self N/A N/A N/A N/A N/A self check N/A F builtin_check N/A stmt 
def map(x):
  return x
 N/A N/A N/A self check N/A F builtin_check N/A stmt 
def zip(x):
  return x
 N/A N/A N/A self check N/A F builtin_check N/A stmt 
def op_add(x):
  return x
 N/A N/A stmt 
def foo(x):
  return x
 N/A N/A N/A N/A __name__ __main__ N/A N/A N/A N/A unittest main