def _prepare_globals(code: str, globals_: dict[str, Any]) -> None:
  """Prepare globals for code execution, injecting __name__ if needed."""
  if re.search(r"if\s+__name__\s*==\s*['\"]__main__['\"]", code):
    globals_['__name__'] = '__main__'
Prepare globals for code execution, injecting __name__ if needed.
src/google/adk/code_executors/unsafe_local_code_executor.py