Complete the code to import the line_profiler module.
import [1]
The line_profiler module is imported to profile code line-by-line.
Complete the code to create a LineProfiler object.
profiler = [1]()The LineProfiler class creates a profiler object for line-by-line profiling.
Fix the error in the code to add a function to the profiler.
profiler.[1](my_function)The method add_function adds a function to the profiler to be tracked.
Fill both blanks to run the profiler on a function and print the stats.
profiler.[1](my_function) profiler.[2]()
Use run to execute the function under profiling, then print_stats to show results.
Fill all three blanks to decorate a function, run it, and print profiling results.
@profiler.[1] def my_function(): total = 0 for i in range(1000): total += i return total my_function() profiler.[2](my_function) profiler.[3]()
Use @profiler.profile to decorate the function, add_function to add it, then print_stats to show results.
