def test_identity_isnot_body_var(): assert lambda_is_identity(ast.parse("lambda x: x1")) is False
def test_identity_is(): assert lambda_is_identity(ast.parse("lambda x: x")) is True
def test_identity_isnot_args(): assert lambda_is_identity(ast.parse("lambda x,y: x")) is False
def make_Select(source, selection): 'Make a select, and return source is selection is an identity' return source if lambda_is_identity(selection) else Select( source, selection)
def make_Select(source: ast.AST, selection: ast.AST): 'Make a select, and return source is selection is an identity' return source if lambda_is_identity(selection) else function_call( 'Select', [source, selection])
def test_identity_isnot_body_var(): assert lambda_is_identity(ast.parse('lambda x: x1')) == False
def test_identity_isnot_args(): assert lambda_is_identity(ast.parse('lambda x,y: x')) == False
def test_identity_is(): assert lambda_is_identity(ast.parse('lambda x: x')) == True