A Python automation script extracts routing table entries from a Junos device. The data structure contains deeply nested dictionaries and lists. The engineer needs to perform a deep copy of this deserialized JSON structure before modifying it. Which Python module provides the deepcopy function needed to duplicate nested containers safely?
The `copy` module supplies `deepcopy()`, which recursively duplicates every nested dictionary and list rather than merely copying top-level references. This satisfies the stem's requirement to duplicate a deeply nested deserialised JSON structure safely, ensuring modifications to the copy leave the original routing table data unaltered.
Why this answer
The 'copy' module in the Python standard library provides the deepcopy() function, which recursively clones nested dictionaries and lists.