This copies the dict so it should be O(n) according to [this](https://wiki.python.org/moin/TimeComplexity#dict). We could just use `main.__dict__.update({'context_key': context_key})`, which should be constant time. But this would leave `context_key` in the engines namespace.