Code structure change: Added a new filtering block to the process_data function. This represents adding a significant new code block that changes the function's behavior. Key changes: - Added new if block: `if len(result) > 0:` - Added nested for loop for filtering: `for num in result:` - Added conditional filtering: `if num < 10:` - Added early return with filtered results This pattern shows how functions evolve by adding new processing blocks while maintaining the existing structure.

Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1def process_data(data):
2 """Process data with validation"""
3 if not data:
4 return None
5
6 # Basic processing
7 result = []
8 for item in data:
9 if item > 0:
10 result.append(item * 2)
11
12 return result
13
14def main():
15 data = [1, -2, 3, -4, 5]
16 processed = process_data(data)
17 print(f"Processed: {processed}")
18
19if __name__ == "__main__":
20 main()

After

1def process_data(data):
2 """Process data with validation and filtering"""
3 if not data:
4 return None
5
6 # Basic processing
7 result = []
8 for item in data:
9 if item > 0:
10 result.append(item * 2)
11
12 # Added: Additional filtering block
13 if len(result) > 0:
14 filtered = []
15 for num in result:
16 if num < 10:
17 filtered.append(num)
18 return filtered
19
20 return result
21
22def main():
23 data = [1, -2, 3, -4, 5]
24 processed = process_data(data)
…lines 25–28 unchanged (4 lines)

Before

module
function_definition
def "def"
identifier "process_data"
parameters
( "("
identifier "data"
) ")"
: ":"
block
expression_statement
string
string_start "\"\"\""
string_content "Process data with validation"
string_end "\"\"\""
if_statement
if "if"
not_operator
not "not"
identifier "data"
: ":"
block
return_statement
return "return"
none "None"
comment "# Basic processing"
expression_statement
assignment
identifier "result"
= "="
list
[ "["
] "]"
for_statement (+28 nodes collapsed)
return_statement
return "return"
identifier "result"
function_definition (+52 nodes collapsed)
if_statement
if "if"
comparison_operator
identifier "__name__"
== "=="
string
string_start "\""
string_content "__main__"
string_end "\""
: ":"
block
expression_statement
call
identifier "main"
argument_list
( "("
) ")"

After

module
function_definition
def "def"
identifier "process_data"
parameters
( "("
identifier "data"
) ")"
: ":"
block
expression_statement
string
string_start "\"\"\""
string_content "Process data with validation and filtering"
string_end "\"\"\""
if_statement
if "if"
not_operator
not "not"
identifier "data"
: ":"
block
return_statement
return "return"
none "None"
comment "# Basic processing"
expression_statement
assignment
identifier "result"
= "="
list
[ "["
] "]"
for_statement (+28 nodes collapsed)
comment "# Added: Additional filtering block"
if_statement
if "if"
comparison_operator
call
identifier "len"
argument_list
( "("
identifier "result"
) ")"
> ">"
integer "0"
: ":"
block
expression_statement
assignment
identifier "filtered"
= "="
list
[ "["
] "]"
for_statement
for "for"
identifier "num"
in "in"
identifier "result"
: ":"
block
if_statement
if "if"
comparison_operator
identifier "num"
< "<"
integer "10"
: ":"
block
expression_statement
call
attribute
identifier "filtered"
. "."
identifier "append"
argument_list
( "("
identifier "num"
) ")"
return_statement
return "return"
identifier "filtered"
return_statement
return "return"
identifier "result"
function_definition (+52 nodes collapsed)
if_statement
if "if"
comparison_operator
identifier "__name__"
== "=="
string
string_start "\""
string_content "__main__"
string_end "\""
: ":"
block
expression_statement
call
identifier "main"
argument_list
( "("
) ")"