This hack solves it only in the context of this simple example, but not if python_repl added as a tool to an AgentExecutor. At the core, the issue seems to be caused by Python scopes, but my knowledge ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results