Summary
A shallow copy is performed when a context needs to be split into several parts. This works fine if the context is just storing primitive values like integers and strings. This does not work if there are nested structures within the context.
Implementation
https://www.delftstack.com/howto/python/python-copy-dictionary/#deep-copy-with-copy-module-in-python