-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcomplex_demo.py
More file actions
32 lines (25 loc) · 839 Bytes
/
complex_demo.py
File metadata and controls
32 lines (25 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def process_data(data, enable_tracing=True, scale_factor=2):
"""
Modern version of process data for the main branch.
Supports comprehensive tracing and dynamic scaling.
"""
if enable_tracing:
print("TRACE: Starting process data on main branch")
results = []
# Block 1 - Refactored type-safe processing
results = [
item * scale_factor for item in data
if isinstance(item, int) and item % 2 == 0 # Only process even integers
]
if enable_tracing:
print(f"TRACE: Middle of process data, found {len(results)} valid items")
# Block 2
for item in results:
print(f"Result item: {item}")
print("Ending process data")
return results
def main():
sample_data = [1, 2, "a", 3]
process_data(sample_data)
if __name__ == "__main__":
main()