@elizaos/sweagent-root 2.0.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +270 -0
- package/package.json +71 -0
- package/python/LICENSE +21 -0
- package/python/config/README.md +15 -0
- package/python/config/bash_only.yaml +222 -0
- package/python/config/benchmarks/250212_sweagent_heavy_sbl.yaml +188 -0
- package/python/config/benchmarks/250225_anthropic_filemap_simple_review.yaml +75 -0
- package/python/config/benchmarks/250522_anthropic_filemap_simple_review.yaml +92 -0
- package/python/config/benchmarks/250526_anthropic_filemap_simple_review_sbl.yaml +93 -0
- package/python/config/benchmarks/anthropic_filemap_multilingual.yaml +66 -0
- package/python/config/coding_challenge.yaml +104 -0
- package/python/config/default.yaml +69 -0
- package/python/config/default_backticks.yaml +69 -0
- package/python/config/default_mm_no_images.yaml +82 -0
- package/python/config/default_mm_with_images.yaml +83 -0
- package/python/config/demo/default.yaml +80 -0
- package/python/config/demo/no_instructions.yaml +69 -0
- package/python/config/demo/only_bash.yaml +60 -0
- package/python/config/exotic/default_shell.yaml +52 -0
- package/python/config/exotic/windowed_replace.yaml +125 -0
- package/python/config/exotic/windowed_replace_late_repro.yaml +127 -0
- package/python/config/human/human.yaml +24 -0
- package/python/config/human/human_demo.yaml +52 -0
- package/python/config/sweagent_0_7/07.yaml +101 -0
- package/python/config/sweagent_0_7/07_fcalling.yaml +100 -0
- package/python/config/sweagent_0_7/07_from_url.yaml +114 -0
- package/python/config/sweagent_0_7/07_thought_action.yaml +102 -0
- package/python/config/sweagent_0_7/07_thought_action_xml.yaml +96 -0
- package/python/mlc_config.json +44 -0
- package/python/pyproject.toml +262 -0
- package/python/sweagent/__init__.py +114 -0
- package/python/sweagent/__main__.py +4 -0
- package/python/sweagent/agent/__init__.py +0 -0
- package/python/sweagent/agent/action_sampler.py +317 -0
- package/python/sweagent/agent/agents.py +1294 -0
- package/python/sweagent/agent/extra/shell_agent.py +106 -0
- package/python/sweagent/agent/history_processors.py +399 -0
- package/python/sweagent/agent/hooks/__init__.py +0 -0
- package/python/sweagent/agent/hooks/abstract.py +139 -0
- package/python/sweagent/agent/hooks/status.py +34 -0
- package/python/sweagent/agent/models.py +896 -0
- package/python/sweagent/agent/problem_statement.py +312 -0
- package/python/sweagent/agent/reviewer.py +664 -0
- package/python/sweagent/environment/__init__.py +0 -0
- package/python/sweagent/environment/hooks/__init__.py +0 -0
- package/python/sweagent/environment/hooks/abstract.py +60 -0
- package/python/sweagent/environment/hooks/status.py +28 -0
- package/python/sweagent/environment/repo.py +219 -0
- package/python/sweagent/environment/swe_env.py +276 -0
- package/python/sweagent/exceptions.py +54 -0
- package/python/sweagent/inspector/README.md +6 -0
- package/python/sweagent/inspector/__init__.py +0 -0
- package/python/sweagent/inspector/favicon.ico +0 -0
- package/python/sweagent/inspector/fileViewer.js +354 -0
- package/python/sweagent/inspector/icons/computer.png +0 -0
- package/python/sweagent/inspector/icons/edit_icon.svg +11 -0
- package/python/sweagent/inspector/icons/swe-agent-logo-50.png +0 -0
- package/python/sweagent/inspector/icons/swellama_blue.png +0 -0
- package/python/sweagent/inspector/icons/swellama_brown.png +0 -0
- package/python/sweagent/inspector/icons/swellama_grey.png +0 -0
- package/python/sweagent/inspector/icons/swellama_tan.png +0 -0
- package/python/sweagent/inspector/index.html +25 -0
- package/python/sweagent/inspector/server.py +354 -0
- package/python/sweagent/inspector/static.py +169 -0
- package/python/sweagent/inspector/style.css +454 -0
- package/python/sweagent/run/__init__.py +0 -0
- package/python/sweagent/run/_progress.py +158 -0
- package/python/sweagent/run/batch_instances.py +419 -0
- package/python/sweagent/run/common.py +387 -0
- package/python/sweagent/run/compare_runs.py +123 -0
- package/python/sweagent/run/extract_pred.py +19 -0
- package/python/sweagent/run/hooks/__init__.py +0 -0
- package/python/sweagent/run/hooks/abstract.py +67 -0
- package/python/sweagent/run/hooks/apply_patch.py +106 -0
- package/python/sweagent/run/hooks/open_pr.py +244 -0
- package/python/sweagent/run/hooks/swe_bench_evaluate.py +113 -0
- package/python/sweagent/run/inspector_cli.py +493 -0
- package/python/sweagent/run/merge_predictions.py +64 -0
- package/python/sweagent/run/quick_stats.py +96 -0
- package/python/sweagent/run/remove_unfinished.py +63 -0
- package/python/sweagent/run/rich_test.py +91 -0
- package/python/sweagent/run/run.py +147 -0
- package/python/sweagent/run/run_batch.py +442 -0
- package/python/sweagent/run/run_replay.py +219 -0
- package/python/sweagent/run/run_shell.py +155 -0
- package/python/sweagent/run/run_single.py +225 -0
- package/python/sweagent/run/run_traj_to_demo.py +85 -0
- package/python/sweagent/tools/__init__.py +0 -0
- package/python/sweagent/tools/bundle.py +57 -0
- package/python/sweagent/tools/commands.py +220 -0
- package/python/sweagent/tools/parsing.py +619 -0
- package/python/sweagent/tools/tools.py +430 -0
- package/python/sweagent/tools/utils.py +108 -0
- package/python/sweagent/types.py +102 -0
- package/python/sweagent/utils/__init__.py +0 -0
- package/python/sweagent/utils/config.py +80 -0
- package/python/sweagent/utils/files.py +27 -0
- package/python/sweagent/utils/github.py +118 -0
- package/python/sweagent/utils/jinja_warnings.py +14 -0
- package/python/sweagent/utils/log.py +175 -0
- package/python/sweagent/utils/patch_formatter.py +152 -0
- package/python/sweagent/utils/serialization.py +45 -0
- package/python/tests/__init__.py +0 -0
- package/python/tests/conftest.py +191 -0
- package/python/tests/test_agent.py +258 -0
- package/python/tests/test_batch_instance.py +43 -0
- package/python/tests/test_commands/_interactive_dummy.py +35 -0
- package/python/tests/test_commands/interactive_dummy_wrapper.sh +29 -0
- package/python/tests/test_data/config_files/dummy_interactive.yaml +62 -0
- package/python/tests/test_data/data_sources/ctf/crypto/Katy/Dockerfile +20 -0
- package/python/tests/test_data/data_sources/ctf/crypto/Katy/README.md +13 -0
- package/python/tests/test_data/data_sources/ctf/crypto/Katy/challenge.json +12 -0
- package/python/tests/test_data/data_sources/ctf/crypto/Katy/customrandom.c +50 -0
- package/python/tests/test_data/data_sources/ctf/crypto/Katy/docker-compose.yml +14 -0
- package/python/tests/test_data/data_sources/ctf/crypto/Katy/release +0 -0
- package/python/tests/test_data/data_sources/ctf/crypto/Katy/server +0 -0
- package/python/tests/test_data/data_sources/ctf/crypto/Katy/solver.py +12 -0
- package/python/tests/test_data/data_sources/ctf/forensics/flash/README.md +16 -0
- package/python/tests/test_data/data_sources/ctf/forensics/flash/challenge.json +9 -0
- package/python/tests/test_data/data_sources/ctf/forensics/flash/flash_c8429a430278283c0e571baebca3d139.zip +0 -0
- package/python/tests/test_data/data_sources/ctf/misc/networking_1/README.md +15 -0
- package/python/tests/test_data/data_sources/ctf/misc/networking_1/challenge.json +10 -0
- package/python/tests/test_data/data_sources/ctf/misc/networking_1/networking.pcap +0 -0
- package/python/tests/test_data/data_sources/ctf/pwn/warmup/Dockerfile +28 -0
- package/python/tests/test_data/data_sources/ctf/pwn/warmup/README.md +14 -0
- package/python/tests/test_data/data_sources/ctf/pwn/warmup/challenge.json +14 -0
- package/python/tests/test_data/data_sources/ctf/pwn/warmup/docker-compose.yml +14 -0
- package/python/tests/test_data/data_sources/ctf/pwn/warmup/flag.txt +1 -0
- package/python/tests/test_data/data_sources/ctf/pwn/warmup/warmup +0 -0
- package/python/tests/test_data/data_sources/ctf/pwn/warmup/warmup.c +26 -0
- package/python/tests/test_data/data_sources/ctf/pwn/warmup/warmup.py +9 -0
- package/python/tests/test_data/data_sources/ctf/rev/rock/README.md +14 -0
- package/python/tests/test_data/data_sources/ctf/rev/rock/challenge.json +8 -0
- package/python/tests/test_data/data_sources/ctf/rev/rock/rock +0 -0
- package/python/tests/test_data/data_sources/ctf/rev/rock/rock.cpp +167 -0
- package/python/tests/test_data/data_sources/ctf/rev/rock/solution.cpp +24 -0
- package/python/tests/test_data/data_sources/ctf/rev/rock/test_solver/solution.py +6 -0
- package/python/tests/test_data/data_sources/ctf/rev/rock/test_solver/test.sh +10 -0
- package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/000-default.conf +18 -0
- package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/Dockerfile +20 -0
- package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/cgi/file.pl +38 -0
- package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/cgi/forms.pl +40 -0
- package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/cgi/hello.pl +11 -0
- package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/challenge.json +12 -0
- package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/docker-compose.yml +14 -0
- package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/flag +1 -0
- package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/index.html +11 -0
- package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/solution.txt +1 -0
- package/python/tests/test_data/data_sources/debug_20240322.json +1 -0
- package/python/tests/test_data/data_sources/expert_instances.yaml +16 -0
- package/python/tests/test_data/data_sources/human_eval.json +1 -0
- package/python/tests/test_data/data_sources/simple_instances.yaml +3 -0
- package/python/tests/test_data/data_sources/simple_instances_long.yaml +30 -0
- package/python/tests/test_data/data_sources/swe-bench-dev-easy.json +1 -0
- package/python/tests/test_data/data_sources/swe-bench-dev-easy_first_only.json +1 -0
- package/python/tests/test_data/data_sources/swe-bench-lite-test.json +1 -0
- package/python/tests/test_data/trajectories/gpt4__swe-agent-test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/6e44b9__sweagenttestrepo-1c2844.traj +342 -0
- package/python/tests/test_data/trajectories/gpt4__swe-agent-test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/solution_missing_colon.py +15 -0
- package/python/tests/test_data/trajectories/gpt4__swe-agent__test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/args.yaml +518 -0
- package/python/tests/test_data/trajectories/gpt4__swe-agent__test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/swe-agent__test-repo-i1.traj +124 -0
- package/python/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/all_preds.jsonl +1 -0
- package/python/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/args.yaml +520 -0
- package/python/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/patches/pydicom__pydicom-1458.patch +18 -0
- package/python/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/pydicom__pydicom-1458.traj +257 -0
- package/python/tests/test_env.py +66 -0
- package/python/tests/test_env_utils.py +129 -0
- package/python/tests/test_history_processors.py +40 -0
- package/python/tests/test_models.py +23 -0
- package/python/tests/test_openai_live.py +164 -0
- package/python/tests/test_packaging.py +7 -0
- package/python/tests/test_parsing.py +131 -0
- package/python/tests/test_problem_statement_multimodal.py +111 -0
- package/python/tests/test_quick_stats.py +42 -0
- package/python/tests/test_run.py +37 -0
- package/python/tests/test_run_batch.py +110 -0
- package/python/tests/test_run_hooks.py +114 -0
- package/python/tests/test_run_replay.py +33 -0
- package/python/tests/test_run_single.py +125 -0
- package/python/tests/test_tools_command_parsing.py +193 -0
- package/python/tests/test_utils.py +15 -0
- package/python/tests/tools/__init__.py +0 -0
- package/python/tests/tools/conftest.py +12 -0
- package/python/tests/tools/test_default_utils.py +153 -0
- package/python/tests/tools/test_edit_replace.py +0 -0
- package/python/tests/tools/test_split_string.py +82 -0
- package/python/tests/utils.py +29 -0
- package/python/tools/diff_state/bin/_state_diff_state +52 -0
- package/python/tools/diff_state/config.yaml +2 -0
- package/python/tools/edit_anthropic/bin/_state_anthropic +21 -0
- package/python/tools/edit_anthropic/bin/str_replace_editor +710 -0
- package/python/tools/edit_anthropic/config.yaml +56 -0
- package/python/tools/edit_anthropic/install.sh +3 -0
- package/python/tools/filemap/bin/filemap +45 -0
- package/python/tools/filemap/config.yaml +9 -0
- package/python/tools/filemap/install.sh +2 -0
- package/python/tools/forfeit/bin/exit_forfeit +5 -0
- package/python/tools/forfeit/config.yaml +5 -0
- package/python/tools/image_tools/bin/view_image +36 -0
- package/python/tools/image_tools/config.yaml +9 -0
- package/python/tools/multilingual_setup/bin/do_nothing +2 -0
- package/python/tools/multilingual_setup/config.yaml +1 -0
- package/python/tools/multilingual_setup/install.sh +45 -0
- package/python/tools/registry/bin/_read_env +10 -0
- package/python/tools/registry/bin/_write_env +10 -0
- package/python/tools/registry/config.yaml +1 -0
- package/python/tools/registry/install.sh +6 -0
- package/python/tools/registry/lib/__init__.py +0 -0
- package/python/tools/registry/lib/registry.py +56 -0
- package/python/tools/review_on_submit_m/README.md +6 -0
- package/python/tools/review_on_submit_m/bin/submit +54 -0
- package/python/tools/review_on_submit_m/config.yaml +6 -0
- package/python/tools/review_on_submit_m/install.sh +0 -0
- package/python/tools/search/bin/find_file +31 -0
- package/python/tools/search/bin/search_dir +39 -0
- package/python/tools/search/bin/search_file +55 -0
- package/python/tools/search/config.yaml +37 -0
- package/python/tools/search/install.sh +3 -0
- package/python/tools/submit/bin/submit +17 -0
- package/python/tools/submit/config.yaml +5 -0
- package/python/tools/web_browser/bin/click_mouse +41 -0
- package/python/tools/web_browser/bin/close_site +28 -0
- package/python/tools/web_browser/bin/double_click_mouse +37 -0
- package/python/tools/web_browser/bin/drag_mouse +46 -0
- package/python/tools/web_browser/bin/execute_script_on_page +39 -0
- package/python/tools/web_browser/bin/get_console_output +48 -0
- package/python/tools/web_browser/bin/move_mouse +35 -0
- package/python/tools/web_browser/bin/navigate_back +33 -0
- package/python/tools/web_browser/bin/navigate_forward +33 -0
- package/python/tools/web_browser/bin/open_site +36 -0
- package/python/tools/web_browser/bin/press_keys_on_page +51 -0
- package/python/tools/web_browser/bin/reload_page +33 -0
- package/python/tools/web_browser/bin/run_web_browser_server +394 -0
- package/python/tools/web_browser/bin/screenshot_site +38 -0
- package/python/tools/web_browser/bin/scroll_on_page +40 -0
- package/python/tools/web_browser/bin/set_browser_window_size +40 -0
- package/python/tools/web_browser/bin/type_text +34 -0
- package/python/tools/web_browser/bin/wait_time +39 -0
- package/python/tools/web_browser/config.yaml +155 -0
- package/python/tools/web_browser/install.sh +22 -0
- package/python/tools/web_browser/lib/browser_manager.py +404 -0
- package/python/tools/web_browser/lib/web_browser_config.py +33 -0
- package/python/tools/web_browser/lib/web_browser_utils.py +126 -0
- package/python/tools/web_browser/test_console.html +1 -0
- package/python/tools/windowed/bin/_state +25 -0
- package/python/tools/windowed/bin/create +29 -0
- package/python/tools/windowed/bin/goto +37 -0
- package/python/tools/windowed/bin/open +49 -0
- package/python/tools/windowed/bin/scroll_down +12 -0
- package/python/tools/windowed/bin/scroll_up +13 -0
- package/python/tools/windowed/config.yaml +38 -0
- package/python/tools/windowed/install.sh +15 -0
- package/python/tools/windowed/lib/__init__.py +0 -0
- package/python/tools/windowed/lib/flake8_utils.py +147 -0
- package/python/tools/windowed/lib/windowed_file.py +312 -0
- package/python/tools/windowed_edit_linting/bin/edit +128 -0
- package/python/tools/windowed_edit_linting/config.yaml +31 -0
- package/python/tools/windowed_edit_linting/install.sh +5 -0
- package/python/tools/windowed_edit_replace/bin/edit +172 -0
- package/python/tools/windowed_edit_replace/bin/insert +77 -0
- package/python/tools/windowed_edit_replace/config.yaml +60 -0
- package/python/tools/windowed_edit_replace/install.sh +5 -0
- package/python/tools/windowed_edit_rewrite/bin/edit +78 -0
- package/python/tools/windowed_edit_rewrite/config.yaml +11 -0
- package/python/tools/windowed_edit_rewrite/install.sh +5 -0
- package/python/trajectories/demonstrations/ctf/crypto/BabyEncryption.traj +318 -0
- package/python/trajectories/demonstrations/ctf/crypto/BabyTimeCapsule.traj +197 -0
- package/python/trajectories/demonstrations/ctf/crypto/eps.traj +289 -0
- package/python/trajectories/demonstrations/ctf/crypto/katy.traj +368 -0
- package/python/trajectories/demonstrations/ctf/forensics/flash.traj +102 -0
- package/python/trajectories/demonstrations/ctf/misc/networking_1.traj +102 -0
- package/python/trajectories/demonstrations/ctf/pwn/warmup.traj +159 -0
- package/python/trajectories/demonstrations/ctf/rev/rock.traj +251 -0
- package/python/trajectories/demonstrations/ctf/web/i_got_id_demo.traj +422 -0
- package/python/trajectories/demonstrations/function_calling_simple.traj +151 -0
- package/python/trajectories/demonstrations/human_thought__swe-bench-HumanEvalFix-python__lcb__t-0.00__p-0.95__c-4.00__install-0/humanevalfix-python-0.traj +129 -0
- package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default__t-0.20__p-0.95__c-2.00__install-1___install_from_source/marshmallow-code__marshmallow-1867.traj +318 -0
- package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default_sys-env_cursors_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj +251 -0
- package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default_sys-env_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj +399 -0
- package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__function_calling__install-1/marshmallow-code__marshmallow-1867.traj +594 -0
- package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__function_calling_replace__install-1/marshmallow-code__marshmallow-1867.traj +592 -0
- package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__function_calling_replace_from_source/marshmallow-code__marshmallow-1867.traj +3316 -0
- package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__xml_sys-env_cursors_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj +251 -0
- package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__xml_sys-env_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj +399 -0
- package/python/trajectories/demonstrations/str_replace_anthropic_demo.yaml +432 -0
- package/rust/Cargo.toml +100 -0
- package/rust/README.md +49 -0
- package/rust/src/agent/action_sampler.rs +130 -0
- package/rust/src/agent/agents.rs +1029 -0
- package/rust/src/agent/history_processors.rs +277 -0
- package/rust/src/agent/hooks/mod.rs +208 -0
- package/rust/src/agent/mod.rs +24 -0
- package/rust/src/agent/models.rs +837 -0
- package/rust/src/agent/problem_statement.rs +355 -0
- package/rust/src/agent/reviewer.rs +505 -0
- package/rust/src/bin/sweagent.rs +784 -0
- package/rust/src/environment/deployment.rs +631 -0
- package/rust/src/environment/hooks/mod.rs +114 -0
- package/rust/src/environment/mod.rs +16 -0
- package/rust/src/environment/repo.rs +265 -0
- package/rust/src/environment/runtime.rs +237 -0
- package/rust/src/environment/swe_env.rs +248 -0
- package/rust/src/exceptions.rs +228 -0
- package/rust/src/lib.rs +68 -0
- package/rust/src/monitoring.rs +482 -0
- package/rust/src/run/hooks/mod.rs +134 -0
- package/rust/src/run/mod.rs +12 -0
- package/rust/src/run/run_batch.rs +563 -0
- package/rust/src/run/run_single.rs +196 -0
- package/rust/src/tools/bundle.rs +224 -0
- package/rust/src/tools/commands.rs +173 -0
- package/rust/src/tools/mod.rs +295 -0
- package/rust/src/tools/parsing.rs +354 -0
- package/rust/src/tools/registry.rs +143 -0
- package/rust/src/types.rs +554 -0
- package/rust/src/utils/config.rs +105 -0
- package/rust/src/utils/files.rs +137 -0
- package/rust/src/utils/github.rs +171 -0
- package/rust/src/utils/log.rs +65 -0
- package/rust/src/utils/mod.rs +17 -0
- package/rust/src/utils/serialization.rs +181 -0
- package/rust/src/utils/template.rs +173 -0
- package/typescript/README.md +335 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"repo": "django/django", "instance_id": "django__django-16255", "base_commit": "444b6da7cc229a58a2c476a52e45233001dc7073", "patch": "diff --git a/django/contrib/sitemaps/__init__.py b/django/contrib/sitemaps/__init__.py\n--- a/django/contrib/sitemaps/__init__.py\n+++ b/django/contrib/sitemaps/__init__.py\n@@ -167,7 +167,7 @@ def get_latest_lastmod(self):\n return None\n if callable(self.lastmod):\n try:\n- return max([self.lastmod(item) for item in self.items()])\n+ return max([self.lastmod(item) for item in self.items()], default=None)\n except TypeError:\n return None\n else:\n", "test_patch": "diff --git a/tests/sitemaps_tests/test_http.py b/tests/sitemaps_tests/test_http.py\n--- a/tests/sitemaps_tests/test_http.py\n+++ b/tests/sitemaps_tests/test_http.py\n@@ -507,6 +507,16 @@ def test_callable_sitemod_full(self):\n self.assertXMLEqual(index_response.content.decode(), expected_content_index)\n self.assertXMLEqual(sitemap_response.content.decode(), expected_content_sitemap)\n \n+ def test_callable_sitemod_no_items(self):\n+ index_response = self.client.get(\"/callable-lastmod-no-items/index.xml\")\n+ self.assertNotIn(\"Last-Modified\", index_response)\n+ expected_content_index = \"\"\"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+ <sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n+ <sitemap><loc>http://example.com/simple/sitemap-callable-lastmod.xml</loc></sitemap>\n+ </sitemapindex>\n+ \"\"\"\n+ self.assertXMLEqual(index_response.content.decode(), expected_content_index)\n+\n \n # RemovedInDjango50Warning\n class DeprecatedTests(SitemapTestsBase):\ndiff --git a/tests/sitemaps_tests/urls/http.py b/tests/sitemaps_tests/urls/http.py\n--- a/tests/sitemaps_tests/urls/http.py\n+++ b/tests/sitemaps_tests/urls/http.py\n@@ -114,6 +114,16 @@ def lastmod(self, obj):\n return obj.lastmod\n \n \n+class CallableLastmodNoItemsSitemap(Sitemap):\n+ location = \"/location/\"\n+\n+ def items(self):\n+ return []\n+\n+ def lastmod(self, obj):\n+ return obj.lastmod\n+\n+\n class GetLatestLastmodNoneSiteMap(Sitemap):\n changefreq = \"never\"\n priority = 0.5\n@@ -233,6 +243,10 @@ def testmodelview(request, id):\n \"callable-lastmod\": CallableLastmodFullSitemap,\n }\n \n+callable_lastmod_no_items_sitemap = {\n+ \"callable-lastmod\": CallableLastmodNoItemsSitemap,\n+}\n+\n urlpatterns = [\n path(\"simple/index.xml\", views.index, {\"sitemaps\": simple_sitemaps}),\n path(\"simple-paged/index.xml\", views.index, {\"sitemaps\": simple_sitemaps_paged}),\n@@ -417,6 +431,11 @@ def testmodelview(request, id):\n views.sitemap,\n {\"sitemaps\": callable_lastmod_full_sitemap},\n ),\n+ path(\n+ \"callable-lastmod-no-items/index.xml\",\n+ views.index,\n+ {\"sitemaps\": callable_lastmod_no_items_sitemap},\n+ ),\n path(\n \"generic-lastmod/index.xml\",\n views.index,\n", "problem_statement": "Sitemaps without items raise ValueError on callable lastmod.\nDescription\n\t\nWhen sitemap contains not items, but supports returning lastmod for an item, it fails with a ValueError:\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py\", line 55, in inner\n\tresponse = get_response(request)\n File \"/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py\", line 197, in _get_response\n\tresponse = wrapped_callback(request, *callback_args, **callback_kwargs)\n File \"/usr/local/lib/python3.10/site-packages/django/utils/decorators.py\", line 133, in _wrapped_view\n\tresponse = view_func(request, *args, **kwargs)\n File \"/usr/local/lib/python3.10/site-packages/django/contrib/sitemaps/views.py\", line 34, in inner\n\tresponse = func(request, *args, **kwargs)\n File \"/usr/local/lib/python3.10/site-packages/django/contrib/sitemaps/views.py\", line 76, in index\n\tsite_lastmod = site.get_latest_lastmod()\n File \"/usr/local/lib/python3.10/site-packages/django/contrib/sitemaps/__init__.py\", line 170, in get_latest_lastmod\n\treturn max([self.lastmod(item) for item in self.items()])\nException Type: ValueError at /sitemap.xml\nException Value: max() arg is an empty sequence\nSomething like this might be a solution:\n\t def get_latest_lastmod(self):\n\t\t if not hasattr(self, \"lastmod\"):\n\t\t\t return None\n\t\t if callable(self.lastmod):\n\t\t\t try:\n\t\t\t\t return max([self.lastmod(item) for item in self.items()])\n-\t\t\texcept TypeError:\n+\t\t\texcept (TypeError, ValueError):\n\t\t\t\t return None\n\t\t else:\n\t\t\t return self.lastmod\n", "hints_text": "Thanks for the report.\nThe default argument of max() can be used.", "created_at": "2022-11-04T13:49:40Z", "version": "4.2", "FAIL_TO_PASS": ["test_callable_sitemod_no_items (sitemaps_tests.test_http.HTTPSitemapTests)"], "PASS_TO_PASS": ["A cached sitemap index can be rendered (#2713).", "A i18n sitemap index with limited languages can be rendered.", "A i18n sitemap index with x-default can be rendered.", "A i18n sitemap with alternate/hreflang links can be rendered.", "A simple i18n sitemap index can be rendered, without logging variable", "A simple sitemap can be rendered", "A simple sitemap can be rendered with a custom template", "A simple sitemap index can be rendered", "A simple sitemap index can be rendered with a custom template", "A simple sitemap section can be rendered", "A sitemap may have multiple pages.", "A sitemap may not be callable.", "All items in the sitemap have `lastmod`. The `Last-Modified` header", "Check to make sure that the raw item is included with each", "Check we get ImproperlyConfigured if we don't pass a site object to", "Check we get ImproperlyConfigured when we don't pass a site object to", "Last-Modified header is missing when sitemap has no lastmod", "Last-Modified header is omitted when lastmod not on all items", "Last-Modified header is set correctly", "Not all items have `lastmod`. Therefore the `Last-Modified` header", "The Last-Modified header is omitted when lastmod isn't found in all", "The Last-Modified header is set to the most recent sitemap lastmod.", "The Last-Modified header should be converted from timezone aware dates", "The Last-Modified header should be support dates (without time).", "The priority value should not be localized.", "lastmod datestamp shows timezones if Sitemap.get_latest_lastmod", "sitemapindex.lastmod is included when Sitemap.lastmod is", "sitemapindex.lastmod is omitted when Sitemap.lastmod is", "test_empty_page (sitemaps_tests.test_http.HTTPSitemapTests)", "test_empty_sitemap (sitemaps_tests.test_http.HTTPSitemapTests)", "test_no_section (sitemaps_tests.test_http.HTTPSitemapTests)", "test_page_not_int (sitemaps_tests.test_http.HTTPSitemapTests)", "test_requestsite_sitemap (sitemaps_tests.test_http.HTTPSitemapTests)", "test_simple_sitemap_custom_index_warning (sitemaps_tests.test_http.DeprecatedTests)", "test_sitemap_without_entries (sitemaps_tests.test_http.HTTPSitemapTests)", "test_x_robots_sitemap (sitemaps_tests.test_http.HTTPSitemapTests)"], "environment_setup_commit": "0fbdb9784da915fce5dcc1fe82bac9b4785749e5"}, {"repo": "sympy/sympy", "instance_id": "sympy__sympy-13031", "base_commit": "2dfa7457f20ee187fbb09b5b6a1631da4458388c", "patch": "diff --git a/sympy/matrices/sparse.py b/sympy/matrices/sparse.py\n--- a/sympy/matrices/sparse.py\n+++ b/sympy/matrices/sparse.py\n@@ -985,8 +985,10 @@ def col_join(self, other):\n >>> C == A.row_insert(A.rows, Matrix(B))\n True\n \"\"\"\n- if not self:\n- return type(self)(other)\n+ # A null matrix can always be stacked (see #10770)\n+ if self.rows == 0 and self.cols != other.cols:\n+ return self._new(0, other.cols, []).col_join(other)\n+\n A, B = self, other\n if not A.cols == B.cols:\n raise ShapeError()\n@@ -1191,8 +1193,10 @@ def row_join(self, other):\n >>> C == A.col_insert(A.cols, B)\n True\n \"\"\"\n- if not self:\n- return type(self)(other)\n+ # A null matrix can always be stacked (see #10770)\n+ if self.cols == 0 and self.rows != other.rows:\n+ return self._new(other.rows, 0, []).row_join(other)\n+\n A, B = self, other\n if not A.rows == B.rows:\n raise ShapeError()\n", "test_patch": "diff --git a/sympy/matrices/tests/test_sparse.py b/sympy/matrices/tests/test_sparse.py\n--- a/sympy/matrices/tests/test_sparse.py\n+++ b/sympy/matrices/tests/test_sparse.py\n@@ -26,6 +26,12 @@ def sparse_zeros(n):\n assert type(a.row_join(b)) == type(a)\n assert type(a.col_join(b)) == type(a)\n \n+ # make sure 0 x n matrices get stacked correctly\n+ sparse_matrices = [SparseMatrix.zeros(0, n) for n in range(4)]\n+ assert SparseMatrix.hstack(*sparse_matrices) == Matrix(0, 6, [])\n+ sparse_matrices = [SparseMatrix.zeros(n, 0) for n in range(4)]\n+ assert SparseMatrix.vstack(*sparse_matrices) == Matrix(6, 0, [])\n+\n # test element assignment\n a = SparseMatrix((\n (1, 0),\n", "problem_statement": "Behavior of Matrix hstack and vstack changed in sympy 1.1\nIn sympy 1.0:\r\n```\r\nimport sympy as sy\r\nM1 = sy.Matrix.zeros(0, 0)\r\nM2 = sy.Matrix.zeros(0, 1)\r\nM3 = sy.Matrix.zeros(0, 2)\r\nM4 = sy.Matrix.zeros(0, 3)\r\nsy.Matrix.hstack(M1, M2, M3, M4).shape\r\n```\r\nreturns \r\n`(0, 6)`\r\n\r\nNow, same in sympy 1.1:\r\n```\r\nimport sympy as sy\r\nM1 = sy.Matrix.zeros(0, 0)\r\nM2 = sy.Matrix.zeros(0, 1)\r\nM3 = sy.Matrix.zeros(0, 2)\r\nM4 = sy.Matrix.zeros(0, 3)\r\nsy.Matrix.hstack(M1, M2, M3, M4).shape\r\n```\r\nreturns\r\n`(0, 3)\r\n`\r\nwhereas:\r\n```\r\nimport sympy as sy\r\nM1 = sy.Matrix.zeros(1, 0)\r\nM2 = sy.Matrix.zeros(1, 1)\r\nM3 = sy.Matrix.zeros(1, 2)\r\nM4 = sy.Matrix.zeros(1, 3)\r\nsy.Matrix.hstack(M1, M2, M3, M4).shape\r\n```\r\nreturns\r\n`(1, 6)\r\n`\n", "hints_text": "CC @siefkenj \nI update my comment in case someone already read it. We still have an issue with matrices shape in [pyphs](https://github.com/pyphs/pyphs/issues/49#issuecomment-316618994), but hstack and vstack seem ok in sympy 1.1.1rc1:\r\n\r\n```\r\n>>> import sympy as sy\r\n>>> sy.__version__\r\n'1.1.1rc1'\r\n>>> '1.1.1rc1'\r\n'1.1.1rc1'\r\n>>> matrices = [sy.Matrix.zeros(0, n) for n in range(4)]\r\n>>> sy.Matrix.hstack(*matrices).shape\r\n(0, 6)\r\n>>> matrices = [sy.Matrix.zeros(1, n) for n in range(4)]\r\n>>> sy.Matrix.hstack(*matrices).shape\r\n(1, 6)\r\n>>> matrices = [sy.Matrix.zeros(n, 0) for n in range(4)]\r\n>>> sy.Matrix.vstack(*matrices).shape\r\n(6, 0)\r\n>>> matrices = [sy.Matrix.zeros(1, n) for n in range(4)]\r\n>>> sy.Matrix.hstack(*matrices).shape\r\n(1, 6)\r\n>>> \r\n```\nThe problem is solved with Matrix but not SparseMatrix:\r\n```\r\n>>> import sympy as sy\r\n>>> sy.__version__\r\n'1.1.1rc1'\r\n>>> matrices = [Matrix.zeros(0, n) for n in range(4)]\r\n>>> Matrix.hstack(*matrices)\r\nMatrix(0, 6, [])\r\n>>> sparse_matrices = [SparseMatrix.zeros(0, n) for n in range(4)]\r\n>>> SparseMatrix.hstack(*sparse_matrices)\r\nMatrix(0, 3, [])\r\n>>> \r\n```\nBisected to 27e9ee425819fa09a4cbb8179fb38939cc693249. Should we revert that commit? CC @aravindkanna\nAny thoughts? This is the last fix to potentially go in the 1.1.1 release, but I want to cut a release candidate today or tomorrow, so speak now, or hold your peace (until the next major release).\nI am away at a conference. The change should be almost identical to the fix for dense matrices, if someone can manage to get a patch in. I *might* be able to do it tomorrow.\nOkay. I've looked this over and its convoluted...\r\n\r\n`SparseMatrix` should impliment `_eval_col_join`. `col_join` should not be implemented. It is, and that is what `hstack` is calling, which is why my previous patch didn't fix `SparseMatrix`s as well. However, the patch that @asmeurer referenced ensures that `SparseMatrix.row_join(DenseMatrix)` returns a `SparseMatrix` whereas `CommonMatrix.row_join(SparseMatrix, DenseMatrix)` returns a `classof(SparseMatrix, DenseMatrix)` which happens to be a `DenseMatrix`. I don't think that these should behave differently. This API needs to be better thought out.\nSo is there a simple fix that can be made for the release or should this be postponed?", "created_at": "2017-07-23T15:48:13Z", "version": "1.1", "FAIL_TO_PASS": ["test_sparse_matrix"], "PASS_TO_PASS": ["test_CL_RL", "test_add", "test_copyin", "test_errors", "test_len", "test_sparse_solve", "test_sparse_zeros_sparse_eye", "test_trace", "test_transpose"], "environment_setup_commit": "ec9e3c0436fbff934fa84e22bf07f1b3ef5bfac3"}, {"repo": "pytest-dev/pytest", "instance_id": "pytest-dev__pytest-11143", "base_commit": "6995257cf470d2143ad1683824962de4071c0eb7", "patch": "diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py\n--- a/src/_pytest/assertion/rewrite.py\n+++ b/src/_pytest/assertion/rewrite.py\n@@ -676,6 +676,7 @@ def run(self, mod: ast.Module) -> None:\n expect_docstring\n and isinstance(item, ast.Expr)\n and isinstance(item.value, ast.Constant)\n+ and isinstance(item.value.value, str)\n ):\n doc = item.value.value\n if self.is_rewrite_disabled(doc):\n", "test_patch": "diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py\n--- a/testing/test_assertrewrite.py\n+++ b/testing/test_assertrewrite.py\n@@ -2042,3 +2042,17 @@ def test_max_increased_verbosity(self, pytester: Pytester) -> None:\n self.create_test_file(pytester, DEFAULT_REPR_MAX_SIZE * 10)\n result = pytester.runpytest(\"-vv\")\n result.stdout.no_fnmatch_line(\"*xxx...xxx*\")\n+\n+\n+class TestIssue11140:\n+ def test_constant_not_picked_as_module_docstring(self, pytester: Pytester) -> None:\n+ pytester.makepyfile(\n+ \"\"\"\\\n+ 0\n+\n+ def test_foo():\n+ pass\n+ \"\"\"\n+ )\n+ result = pytester.runpytest()\n+ assert result.ret == 0\n", "problem_statement": "Rewrite fails when first expression of file is a number and mistaken as docstring \n<!--\r\nThanks for submitting an issue!\r\n\r\nQuick check-list while reporting bugs:\r\n-->\r\n\r\n- [x] a detailed description of the bug or problem you are having\r\n- [x] output of `pip list` from the virtual environment you are using\r\n- [x] pytest and operating system versions\r\n- [x] minimal example if possible\r\n```\r\nInstalling collected packages: zipp, six, PyYAML, python-dateutil, MarkupSafe, importlib-metadata, watchdog, tomli, soupsieve, pyyaml-env-tag, pycparser, pluggy, packaging, mergedeep, Markdown, jinja2, iniconfig, ghp-import, exceptiongroup, click, websockets, urllib3, tqdm, smmap, pytest, pyee, mkdocs, lxml, importlib-resources, idna, cssselect, charset-normalizer, cffi, certifi, beautifulsoup4, attrs, appdirs, w3lib, typing-extensions, texttable, requests, pyzstd, pytest-metadata, pyquery, pyppmd, pyppeteer, pynacl, pymdown-extensions, pycryptodomex, pybcj, pyasn1, py, psutil, parse, multivolumefile, mkdocs-autorefs, inflate64, gitdb, fake-useragent, cryptography, comtypes, bs4, brotli, bcrypt, allure-python-commons, xlwt, xlrd, rsa, requests-html, pywinauto, python-i18n, python-dotenv, pytest-rerunfailures, pytest-html, pytest-check, PySocks, py7zr, paramiko, mkdocstrings, loguru, GitPython, ftputil, crcmod, chardet, brotlicffi, allure-pytest\r\nSuccessfully installed GitPython-3.1.31 Markdown-3.3.7 MarkupSafe-2.1.3 PySocks-1.7.1 PyYAML-6.0 allure-pytest-2.13.2 allure-python-commons-2.13.2 appdirs-1.4.4 attrs-23.1.0 bcrypt-4.0.1 beautifulsoup4-4.12.2 brotli-1.0.9 brotlicffi-1.0.9.2 bs4-0.0.1 certifi-2023.5.7 cffi-1.15.1 chardet-5.1.0 charset-normalizer-3.1.0 click-8.1.3 comtypes-1.2.0 crcmod-1.7 cryptography-41.0.1 cssselect-1.2.0 exceptiongroup-1.1.1 fake-useragent-1.1.3 ftputil-5.0.4 ghp-import-2.1.0 gitdb-4.0.10 idna-3.4 importlib-metadata-6.7.0 importlib-resources-5.12.0 inflate64-0.3.1 iniconfig-2.0.0 jinja2-3.1.2 loguru-0.7.0 lxml-4.9.2 mergedeep-1.3.4 mkdocs-1.4.3 mkdocs-autorefs-0.4.1 mkdocstrings-0.22.0 multivolumefile-0.2.3 packaging-23.1 paramiko-3.2.0 parse-1.19.1 pluggy-1.2.0 psutil-5.9.5 py-1.11.0 py7zr-0.20.5 pyasn1-0.5.0 pybcj-1.0.1 pycparser-2.21 pycryptodomex-3.18.0 pyee-8.2.2 pymdown-extensions-10.0.1 pynacl-1.5.0 pyppeteer-1.0.2 pyppmd-1.0.0 pyquery-2.0.0 pytest-7.4.0 pytest-check-2.1.5 pytest-html-3.2.0 pytest-metadata-3.0.0 pytest-rerunfailures-11.1.2 python-dateutil-2.8.2 python-dotenv-1.0.0 python-i18n-0.3.9 pywinauto-0.6.6 pyyaml-env-tag-0.1 pyzstd-0.15.9 requests-2.31.0 requests-html-0.10.0 rsa-4.9 six-1.16.0 smmap-5.0.0 soupsieve-2.4.1 texttable-1.6.7 tomli-2.0.1 tqdm-4.65.0 typing-extensions-4.6.3 urllib3-1.26.16 w3lib-2.1.1 watchdog-3.0.0 websockets-10.4 xlrd-2.0.1 xlwt-1.3.0 zipp-3.15.0\r\n```\r\nuse `pytest -k xxx`\uff0c report an error\uff1a`TypeError: argument of type 'int' is not iterable`\r\n\r\nit seems a error in collecting testcase\r\n```\r\n==================================== ERRORS ====================================\r\n_ ERROR collecting testcases/\u57fa\u7ebf/\u4ee3\u7406\u7b56\u7565/SOCKS\u4e8c\u7ea7\u4ee3\u7406\u8fed\u4ee3\u4e8c/\u5728\u7ebf\u7528\u6237/\u5728\u7ebf\u7528\u6237\u66f4\u65b0/\u4e0a\u7ebf\u7528\u6237/test_socks_user_011.py _\r\n/usr/local/lib/python3.8/site-packages/_pytest/runner.py:341: in from_call\r\n result: Optional[TResult] = func()\r\n/usr/local/lib/python3.8/site-packages/_pytest/runner.py:372: in <lambda>\r\n call = CallInfo.from_call(lambda: list(collector.collect()), \"collect\")\r\n/usr/local/lib/python3.8/site-packages/_pytest/python.py:531: in collect\r\n self._inject_setup_module_fixture()\r\n/usr/local/lib/python3.8/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture\r\n self.obj, (\"setUpModule\", \"setup_module\")\r\n/usr/local/lib/python3.8/site-packages/_pytest/python.py:310: in obj\r\n self._obj = obj = self._getobj()\r\n/usr/local/lib/python3.8/site-packages/_pytest/python.py:528: in _getobj\r\n return self._importtestmodule()\r\n/usr/local/lib/python3.8/site-packages/_pytest/python.py:617: in _importtestmodule\r\n mod = import_path(self.path, mode=importmode, root=self.config.rootpath)\r\n/usr/local/lib/python3.8/site-packages/_pytest/pathlib.py:565: in import_path\r\n importlib.import_module(module_name)\r\n/usr/local/lib/python3.8/importlib/__init__.py:127: in import_module\r\n return _bootstrap._gcd_import(name[level:], package, level)\r\n<frozen importlib._bootstrap>:1014: in _gcd_import\r\n ???\r\n<frozen importlib._bootstrap>:991: in _find_and_load\r\n ???\r\n<frozen importlib._bootstrap>:975: in _find_and_load_unlocked\r\n ???\r\n<frozen importlib._bootstrap>:671: in _load_unlocked\r\n ???\r\n/usr/local/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:169: in exec_module\r\n source_stat, co = _rewrite_test(fn, self.config)\r\n/usr/local/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:352: in _rewrite_test\r\n rewrite_asserts(tree, source, strfn, config)\r\n/usr/local/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:413: in rewrite_asserts\r\n AssertionRewriter(module_path, config, source).run(mod)\r\n/usr/local/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:695: in run\r\n if self.is_rewrite_disabled(doc):\r\n/usr/local/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:760: in is_rewrite_disabled\r\n return \"PYTEST_DONT_REWRITE\" in docstring\r\nE TypeError: argument of type 'int' is not iterable\r\n```\n", "hints_text": "more details are needed - based on the exception, the docstring is a integer, that seems completely wrong\nI run it pass lasttime in 2023-6-20 17:07:23. it run in docker and install newest pytest before run testcase everytime . maybe some commit cause it recently. \r\nI run it can pass in 7.2.0 a few minutes ago.\r\n\r\n`pytest ini`\r\n```\r\n[pytest]\r\nlog_cli = false\r\nlog_cli_level = debug\r\nlog_cli_format = %(asctime)s %(levelname)s %(message)s\r\nlog_cli_date_format = %Y-%m-%d %H:%M:%S\r\n\r\naddopts = -v -s\r\n\r\nfilterwarnings =\r\n ignore::UserWarning\r\n\r\nmarkers=\r\n case_id: mark test id to upload on tp\r\n case_level_bvt: testcase level bvt\r\n case_level_1: testcase level level 1\r\n case_level_2: testcase level level 2\r\n case_level_3: testcase level level 3\r\n case_status_pass: mark case as PASS\r\n case_status_fail: mark case as FAILED\r\n case_status_not_finish: mark case as CODEING\r\n case_status_not_run: mark case as FINISH\r\n case_not_run: mark case as DONT RUN\r\n run_env: mark run this case on which environment\r\n ```\r\n \r\n`testcase:`\r\n```\r\n@pytest.fixture(autouse=True)\r\ndef default_setup_teardown():\r\n xxxx\r\n\r\n@allure.feature(\"\u521d\u59cb\u72b6\u6001\")\r\nclass TestDefauleName:\r\n @allure.title(\"\u4e0a\u7ebf\u4e00\u4e2a\u57df\u7528\u6237\uff0c\u7528\u6237\u540d\u548c\u7ec4\u540d\u6b63\u786e\")\r\n @pytest.mark.case_level_1\r\n @pytest.mark.case_id(\"tc_proxyheard_insert_011\")\r\n def test_tc_proxyheard_insert_011(self):\r\n xxxx\r\n ```\nthanks for the update\r\n\r\ni took the liberty to edit your comments to use markdown code blocks for ease of reading\r\n\r\nfrom the given information the problem is still unclear\r\n\r\nplease try running with `--assert=plain` for verification\r\n\r\nthe error indicates that the python ast parser somehow ends up with a integer as the docstring for `test_socks_user_011.py` the reason is still unclear based on the redacted information\nI run with --assert=plain and it has passed\r\n\r\npython3 -m pytest -k helloworld --assert=plain\r\n```\r\ntestcases/smoke_testcase/test_helloworld.py::TestGuardProcess::test_hello_world 2023-06-25 08:54:17.659 | INFO | NAC_AIO.testcases.smoke_testcase.test_helloworld:test_hello_world:15 - Great! Frame Work is working\r\nPASSED\r\ntotal: 1648\r\npassed: 1\r\nfailed: 0\r\nerror: 0\r\npass_rate 100.00%\r\n\r\n================================================================================= 1 passed, 1647 deselected in 12.28s =================================================================================\r\n```\nIt seems to me that we have a potential bug in the ast transformer where's in case the first expression of a file is a integer, we mistake it as a docstring\n\nCan you verify the first expression in the file that fails?\nyou are right this file first expression is a 0 . It can pass after I delete it \r\nthank you!\nMinimal reproducer:\r\n\r\n```python\r\n0\r\n```\r\n\r\n(yes, just that, in a .py file)", "created_at": "2023-06-26T06:44:43Z", "version": "8.0", "FAIL_TO_PASS": ["testing/test_assertrewrite.py::TestIssue11140::test_constant_not_picked_as_module_docstring"], "PASS_TO_PASS": ["testing/test_assertrewrite.py::TestAssertionPass::test_hook_call", "testing/test_assertrewrite.py::TestAssertionPass::test_hook_call_with_parens", "testing/test_assertrewrite.py::TestAssertionPass::test_hook_not_called_without_cmd_option", "testing/test_assertrewrite.py::TestAssertionPass::test_hook_not_called_without_hookimpl", "testing/test_assertrewrite.py::TestAssertionPass::test_option_default", "testing/test_assertrewrite.py::TestAssertionRewrite::test_assert_already_has_message", "testing/test_assertrewrite.py::TestAssertionRewrite::test_assert_raising__bool__in_comparison", "testing/test_assertrewrite.py::TestAssertionRewrite::test_assertion_message", "testing/test_assertrewrite.py::TestAssertionRewrite::test_assertion_message_escape", "testing/test_assertrewrite.py::TestAssertionRewrite::test_assertion_message_expr", "testing/test_assertrewrite.py::TestAssertionRewrite::test_assertion_message_multiline", "testing/test_assertrewrite.py::TestAssertionRewrite::test_assertion_message_tuple", "testing/test_assertrewrite.py::TestAssertionRewrite::test_assertion_messages_bytes", "testing/test_assertrewrite.py::TestAssertionRewrite::test_assertrepr_compare_same_width", "testing/test_assertrewrite.py::TestAssertionRewrite::test_at_operator_issue1290", "testing/test_assertrewrite.py::TestAssertionRewrite::test_attribute", "testing/test_assertrewrite.py::TestAssertionRewrite::test_binary_op", "testing/test_assertrewrite.py::TestAssertionRewrite::test_boolop", "testing/test_assertrewrite.py::TestAssertionRewrite::test_boolop_percent", "testing/test_assertrewrite.py::TestAssertionRewrite::test_call", "testing/test_assertrewrite.py::TestAssertionRewrite::test_comparisons", "testing/test_assertrewrite.py::TestAssertionRewrite::test_custom_repr", "testing/test_assertrewrite.py::TestAssertionRewrite::test_custom_repr_non_ascii", "testing/test_assertrewrite.py::TestAssertionRewrite::test_custom_reprcompare", "testing/test_assertrewrite.py::TestAssertionRewrite::test_dont_rewrite", "testing/test_assertrewrite.py::TestAssertionRewrite::test_dont_rewrite_if_hasattr_fails", "testing/test_assertrewrite.py::TestAssertionRewrite::test_dont_rewrite_plugin", "testing/test_assertrewrite.py::TestAssertionRewrite::test_formatchar", "testing/test_assertrewrite.py::TestAssertionRewrite::test_honors_pep_235", "testing/test_assertrewrite.py::TestAssertionRewrite::test_len", "testing/test_assertrewrite.py::TestAssertionRewrite::test_location_is_set", "testing/test_assertrewrite.py::TestAssertionRewrite::test_name", "testing/test_assertrewrite.py::TestAssertionRewrite::test_place_initial_imports", "testing/test_assertrewrite.py::TestAssertionRewrite::test_rewrites_plugin_as_a_package", "testing/test_assertrewrite.py::TestAssertionRewrite::test_short_circuit_evaluation", "testing/test_assertrewrite.py::TestAssertionRewrite::test_starred_with_side_effect", "testing/test_assertrewrite.py::TestAssertionRewrite::test_unary_op", "testing/test_assertrewrite.py::TestAssertionRewriteHookDetails::test_get_data_support", "testing/test_assertrewrite.py::TestAssertionRewriteHookDetails::test_read_pyc", "testing/test_assertrewrite.py::TestAssertionRewriteHookDetails::test_read_pyc_more_invalid", "testing/test_assertrewrite.py::TestAssertionRewriteHookDetails::test_read_pyc_success", "testing/test_assertrewrite.py::TestAssertionRewriteHookDetails::test_reload_is_same_and_reloads", "testing/test_assertrewrite.py::TestAssertionRewriteHookDetails::test_resources_provider_for_loader", "testing/test_assertrewrite.py::TestAssertionRewriteHookDetails::test_sys_meta_path_munged", "testing/test_assertrewrite.py::TestAssertionRewriteHookDetails::test_write_pyc", "testing/test_assertrewrite.py::TestEarlyRewriteBailout::test_basic", "testing/test_assertrewrite.py::TestEarlyRewriteBailout::test_cwd_changed", "testing/test_assertrewrite.py::TestEarlyRewriteBailout::test_pattern_contains_subdirectories", "testing/test_assertrewrite.py::TestIssue10743::test_assertion_inline_walrus_operator", "testing/test_assertrewrite.py::TestIssue10743::test_assertion_inline_walrus_operator_reverse", "testing/test_assertrewrite.py::TestIssue10743::test_assertion_walrus_no_variable_name_conflict", "testing/test_assertrewrite.py::TestIssue10743::test_assertion_walrus_operator", "testing/test_assertrewrite.py::TestIssue10743::test_assertion_walrus_operator_boolean_composite", "testing/test_assertrewrite.py::TestIssue10743::test_assertion_walrus_operator_boolean_none_fails", "testing/test_assertrewrite.py::TestIssue10743::test_assertion_walrus_operator_compare_boolean_fails", "testing/test_assertrewrite.py::TestIssue10743::test_assertion_walrus_operator_dont_rewrite", "testing/test_assertrewrite.py::TestIssue10743::test_assertion_walrus_operator_fail_assertion", "testing/test_assertrewrite.py::TestIssue10743::test_assertion_walrus_operator_true_assertion_and_changes_variable_value", "testing/test_assertrewrite.py::TestIssue10743::test_assertion_walrus_operator_value_changes_cleared_after_each_test", "testing/test_assertrewrite.py::TestIssue11028::test_assertion_walrus_operator_equals_operand_function", "testing/test_assertrewrite.py::TestIssue11028::test_assertion_walrus_operator_equals_operand_function_arg_as_function", "testing/test_assertrewrite.py::TestIssue11028::test_assertion_walrus_operator_equals_operand_function_keyword_arg", "testing/test_assertrewrite.py::TestIssue11028::test_assertion_walrus_operator_gt_operand_function", "testing/test_assertrewrite.py::TestIssue11028::test_assertion_walrus_operator_in_operand", "testing/test_assertrewrite.py::TestIssue11028::test_assertion_walrus_operator_in_operand_json_dumps", "testing/test_assertrewrite.py::TestIssue2121::test_rewrite_python_files_contain_subdirs", "testing/test_assertrewrite.py::TestIssue925::test_long_case", "testing/test_assertrewrite.py::TestIssue925::test_many_brackets", "testing/test_assertrewrite.py::TestIssue925::test_simple_case", "testing/test_assertrewrite.py::TestPyCacheDir::test_get_cache_dir[/tmp/pycs-/home/projects/src/foo.py-/tmp/pycs/home/projects/src]", "testing/test_assertrewrite.py::TestPyCacheDir::test_get_cache_dir[None-/home/projects/src/foo.py-/home/projects/src/__pycache__]", "testing/test_assertrewrite.py::TestPyCacheDir::test_get_cache_dir[None-d:/projects/src/foo.py-d:/projects/src/__pycache__]", "testing/test_assertrewrite.py::TestPyCacheDir::test_get_cache_dir[c:/tmp/pycs-d:/projects/src/foo.py-c:/tmp/pycs/projects/src]", "testing/test_assertrewrite.py::TestPyCacheDir::test_sys_pycache_prefix_integration", "testing/test_assertrewrite.py::TestReprSizeVerbosity::test_default_verbosity", "testing/test_assertrewrite.py::TestReprSizeVerbosity::test_get_maxsize_for_saferepr[0-240]", "testing/test_assertrewrite.py::TestReprSizeVerbosity::test_get_maxsize_for_saferepr[1-2400]", "testing/test_assertrewrite.py::TestReprSizeVerbosity::test_get_maxsize_for_saferepr[2-None]", "testing/test_assertrewrite.py::TestReprSizeVerbosity::test_get_maxsize_for_saferepr[3-None]", "testing/test_assertrewrite.py::TestReprSizeVerbosity::test_increased_verbosity", "testing/test_assertrewrite.py::TestReprSizeVerbosity::test_max_increased_verbosity", "testing/test_assertrewrite.py::TestRewriteOnImport::test_cached_pyc_includes_pytest_version", "testing/test_assertrewrite.py::TestRewriteOnImport::test_dont_write_bytecode", "testing/test_assertrewrite.py::TestRewriteOnImport::test_load_resource_via_files_with_rewrite", "testing/test_assertrewrite.py::TestRewriteOnImport::test_orphaned_pyc_file", "testing/test_assertrewrite.py::TestRewriteOnImport::test_package", "testing/test_assertrewrite.py::TestRewriteOnImport::test_package_without__init__py", "testing/test_assertrewrite.py::TestRewriteOnImport::test_pyc_vs_pyo", "testing/test_assertrewrite.py::TestRewriteOnImport::test_pycache_is_a_file", "testing/test_assertrewrite.py::TestRewriteOnImport::test_pycache_is_readonly", "testing/test_assertrewrite.py::TestRewriteOnImport::test_readonly", "testing/test_assertrewrite.py::TestRewriteOnImport::test_remember_rewritten_modules", "testing/test_assertrewrite.py::TestRewriteOnImport::test_rewrite_module_imported_from_conftest", "testing/test_assertrewrite.py::TestRewriteOnImport::test_rewrite_warning", "testing/test_assertrewrite.py::TestRewriteOnImport::test_rewrite_warning_using_pytest_plugins", "testing/test_assertrewrite.py::TestRewriteOnImport::test_rewrite_warning_using_pytest_plugins_env_var", "testing/test_assertrewrite.py::TestRewriteOnImport::test_translate_newlines", "testing/test_assertrewrite.py::TestRewriteOnImport::test_zipfile", "testing/test_assertrewrite.py::test_get_assertion_exprs[assert", "testing/test_assertrewrite.py::test_get_assertion_exprs[assertion", "testing/test_assertrewrite.py::test_get_assertion_exprs[backslash", "testing/test_assertrewrite.py::test_get_assertion_exprs[escaped", "testing/test_assertrewrite.py::test_get_assertion_exprs[latin1", "testing/test_assertrewrite.py::test_get_assertion_exprs[multi", "testing/test_assertrewrite.py::test_get_assertion_exprs[multi-line", "testing/test_assertrewrite.py::test_get_assertion_exprs[multiple", "testing/test_assertrewrite.py::test_get_assertion_exprs[no", "testing/test_assertrewrite.py::test_get_assertion_exprs[trivial]", "testing/test_assertrewrite.py::test_get_assertion_exprs[utf-8", "testing/test_assertrewrite.py::test_issue731", "testing/test_assertrewrite.py::test_rewrite_infinite_recursion", "testing/test_assertrewrite.py::test_source_mtime_long_long[-1]", "testing/test_assertrewrite.py::test_source_mtime_long_long[1]", "testing/test_assertrewrite.py::test_try_makedirs"], "environment_setup_commit": "10056865d2a4784934ce043908a0e78d0578f677"}, {"repo": "scikit-learn/scikit-learn", "instance_id": "scikit-learn__scikit-learn-13584", "base_commit": "0e3c1879b06d839171b7d0a607d71bbb19a966a9", "patch": "diff --git a/sklearn/utils/_pprint.py b/sklearn/utils/_pprint.py\n--- a/sklearn/utils/_pprint.py\n+++ b/sklearn/utils/_pprint.py\n@@ -95,7 +95,7 @@ def _changed_params(estimator):\n init_params = signature(init_func).parameters\n init_params = {name: param.default for name, param in init_params.items()}\n for k, v in params.items():\n- if (v != init_params[k] and\n+ if (repr(v) != repr(init_params[k]) and\n not (is_scalar_nan(init_params[k]) and is_scalar_nan(v))):\n filtered_params[k] = v\n return filtered_params\n", "test_patch": "diff --git a/sklearn/utils/tests/test_pprint.py b/sklearn/utils/tests/test_pprint.py\n--- a/sklearn/utils/tests/test_pprint.py\n+++ b/sklearn/utils/tests/test_pprint.py\n@@ -4,6 +4,7 @@\n import numpy as np\n \n from sklearn.utils._pprint import _EstimatorPrettyPrinter\n+from sklearn.linear_model import LogisticRegressionCV\n from sklearn.pipeline import make_pipeline\n from sklearn.base import BaseEstimator, TransformerMixin\n from sklearn.feature_selection import SelectKBest, chi2\n@@ -212,6 +213,9 @@ def test_changed_only():\n expected = \"\"\"SimpleImputer()\"\"\"\n assert imputer.__repr__() == expected\n \n+ # make sure array parameters don't throw error (see #13583)\n+ repr(LogisticRegressionCV(Cs=np.array([0.1, 1])))\n+\n set_config(print_changed_only=False)\n \n \n", "problem_statement": "bug in print_changed_only in new repr: vector values\n```python\r\nimport sklearn\r\nimport numpy as np\r\nfrom sklearn.linear_model import LogisticRegressionCV\r\nsklearn.set_config(print_changed_only=True)\r\nprint(LogisticRegressionCV(Cs=np.array([0.1, 1])))\r\n```\r\n> ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()\r\n\r\nping @NicolasHug \r\n\n", "hints_text": "", "created_at": "2019-04-05T23:09:48Z", "version": "0.21", "FAIL_TO_PASS": ["sklearn/utils/tests/test_pprint.py::test_changed_only", "sklearn/utils/tests/test_pprint.py::test_deeply_nested", "sklearn/utils/tests/test_pprint.py::test_gridsearch", "sklearn/utils/tests/test_pprint.py::test_gridsearch_pipeline", "sklearn/utils/tests/test_pprint.py::test_n_max_elements_to_show", "sklearn/utils/tests/test_pprint.py::test_pipeline"], "PASS_TO_PASS": ["sklearn/utils/tests/test_pprint.py::test_basic", "sklearn/utils/tests/test_pprint.py::test_builtin_prettyprinter", "sklearn/utils/tests/test_pprint.py::test_length_constraint"], "environment_setup_commit": "7813f7efb5b2012412888b69e73d76f2df2b50b6"}, {"repo": "django/django", "instance_id": "django__django-15781", "base_commit": "8d160f154f0240a423e83ffe0690e472f837373c", "patch": "diff --git a/django/core/management/base.py b/django/core/management/base.py\n--- a/django/core/management/base.py\n+++ b/django/core/management/base.py\n@@ -286,10 +286,10 @@ def create_parser(self, prog_name, subcommand, **kwargs):\n Create and return the ``ArgumentParser`` which will be used to\n parse the arguments to this command.\n \"\"\"\n+ kwargs.setdefault(\"formatter_class\", DjangoHelpFormatter)\n parser = CommandParser(\n prog=\"%s %s\" % (os.path.basename(prog_name), subcommand),\n description=self.help or None,\n- formatter_class=DjangoHelpFormatter,\n missing_args_message=getattr(self, \"missing_args_message\", None),\n called_from_command_line=getattr(self, \"_called_from_command_line\", None),\n **kwargs,\n", "test_patch": "diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py\n--- a/tests/user_commands/tests.py\n+++ b/tests/user_commands/tests.py\n@@ -1,4 +1,5 @@\n import os\n+from argparse import ArgumentDefaultsHelpFormatter\n from io import StringIO\n from unittest import mock\n \n@@ -408,8 +409,14 @@ def test_subparser_invalid_option(self):\n def test_create_parser_kwargs(self):\n \"\"\"BaseCommand.create_parser() passes kwargs to CommandParser.\"\"\"\n epilog = \"some epilog text\"\n- parser = BaseCommand().create_parser(\"prog_name\", \"subcommand\", epilog=epilog)\n+ parser = BaseCommand().create_parser(\n+ \"prog_name\",\n+ \"subcommand\",\n+ epilog=epilog,\n+ formatter_class=ArgumentDefaultsHelpFormatter,\n+ )\n self.assertEqual(parser.epilog, epilog)\n+ self.assertEqual(parser.formatter_class, ArgumentDefaultsHelpFormatter)\n \n def test_outputwrapper_flush(self):\n out = StringIO()\n", "problem_statement": "Customizable management command formatters.\nDescription\n\t\nWith code like:\nclass Command(BaseCommand):\n\thelp = '''\n\tImport a contract from tzkt.\n\tExample usage:\n\t\t./manage.py tzkt_import 'Tezos Mainnet' KT1HTDtMBRCKoNHjfWEEvXneGQpCfPAt6BRe\n\t'''\nHelp output is:\n$ ./manage.py help tzkt_import\nusage: manage.py tzkt_import [-h] [--api API] [--version] [-v {0,1,2,3}] [--settings SETTINGS]\n\t\t\t\t\t\t\t [--pythonpath PYTHONPATH] [--traceback] [--no-color] [--force-color]\n\t\t\t\t\t\t\t [--skip-checks]\n\t\t\t\t\t\t\t blockchain target\nImport a contract from tzkt Example usage: ./manage.py tzkt_import 'Tezos Mainnet'\nKT1HTDtMBRCKoNHjfWEEvXneGQpCfPAt6BRe\npositional arguments:\n blockchain\t\t\tName of the blockchain to import into\n target\t\t\t\tId of the contract to import\nWhen that was expected:\n$ ./manage.py help tzkt_import\nusage: manage.py tzkt_import [-h] [--api API] [--version] [-v {0,1,2,3}] [--settings SETTINGS]\n\t\t\t\t\t\t\t [--pythonpath PYTHONPATH] [--traceback] [--no-color] [--force-color]\n\t\t\t\t\t\t\t [--skip-checks]\n\t\t\t\t\t\t\t blockchain target\nImport a contract from tzkt \nExample usage: \n\t./manage.py tzkt_import 'Tezos Mainnet' KT1HTDtMBRCKoNHjfWEEvXneGQpCfPAt6BRe\npositional arguments:\n blockchain\t\t\tName of the blockchain to import into\n target\t\t\t\tId of the contract to import\n", "hints_text": "This seems no fault of Django but is rather \u200bthe default behavior of ArgumentParser (\"By default, ArgumentParser objects line-wrap the description and epilog texts in command-line help messages\"). This can be changed by using a custom \u200bformatter_class, though Django already specifies a custom one (\u200bDjangoHelpFormatter).\nIt seems reasonable, to make it customizable by passing via kwargs to the \u200bBaseCommand.create_parser() (as documented): django/core/management/base.py diff --git a/django/core/management/base.py b/django/core/management/base.py index f0e711ac76..52407807d8 100644 a b class BaseCommand: 286286 Create and return the ``ArgumentParser`` which will be used to 287287 parse the arguments to this command. 288288 \"\"\" 289 kwargs.setdefault(\"formatter_class\", DjangoHelpFormatter) 289290 parser = CommandParser( 290291 prog=\"%s %s\" % (os.path.basename(prog_name), subcommand), 291292 description=self.help or None, 292 formatter_class=DjangoHelpFormatter, 293293 missing_args_message=getattr(self, \"missing_args_message\", None), 294294 called_from_command_line=getattr(self, \"_called_from_command_line\", None), 295295 **kwargs, What do you think?\nLooks good but I don't see a reason for keeping a default that swallows newlines because PEP257 forbids having a multiline sentence on the first line anyway: Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. As such, the default formater which purpose is to unwrap the first sentence encourages breaking PEP 257. And users who are naturally complying with PEP257 will have to override the formatter, it should be the other way around.\nAlso, the not-unwraping formater will also look fine with existing docstrings, it will work for both use cases, while the current one only works for one use case and breaks the other. The default formater should work for both\nReplying to James Pic: Also, the not-unwraping formater will also look fine with existing docstrings, it will work for both use cases, while the current one only works for one use case and breaks the other. The default formater should work for both It seems you think that Python's (not Django's) default behavior should be changed according to PEP 257. I'd recommend to start a discussion in Python's bugtracker. As far as I'm aware the proposed solution will allow users to freely change a formatter, which should be enough from the Django point of view.\nNo, I think that Django's default behavior should match Python's PEP 257, and at the same time, have a default that works in all use cases. I think my report and comments are pretty clear, I fail to understand how you could get my comment completely backward, so, unless you have any specific question about this statement, I'm going to give up on this.\nSo as part of this issue, do we make changes to allow a user to override the formatter through kwargs and also keep DjangoHelpFormatter as the default?\nReplying to Subhankar Hotta: So as part of this issue, do we make changes to allow a user to override the formatter through kwargs and also keep DjangoHelpFormatter as the default? Yes, see comment.", "created_at": "2022-06-18T19:39:34Z", "version": "4.2", "FAIL_TO_PASS": ["BaseCommand.create_parser() passes kwargs to CommandParser."], "PASS_TO_PASS": ["An unknown command raises CommandError", "By default, call_command should not trigger the check framework, unless", "Exception raised in a command should raise CommandError with", "It should be possible to pass non-string arguments to call_command.", "Management commands can also be loaded from Python eggs.", "To avoid conflicts with custom options, commands don't allow", "When passing the long option name to call_command, the available option", "When the Command handle method is decorated with @no_translations,", "find_command should still work when the PATH environment variable", "test_call_command_unrecognized_option (user_commands.tests.CommandTests)", "test_call_command_with_required_parameters_in_mixed_options (user_commands.tests.CommandTests)", "test_call_command_with_required_parameters_in_options (user_commands.tests.CommandTests)", "test_calling_a_command_with_no_app_labels_and_parameters_raise_command_error (user_commands.tests.CommandTests)", "test_calling_a_command_with_only_empty_parameter_should_ends_gracefully (user_commands.tests.CommandTests)", "test_calling_command_with_app_labels_and_parameters_should_be_ok (user_commands.tests.CommandTests)", "test_calling_command_with_parameters_and_app_labels_at_the_end_should_be_ok (user_commands.tests.CommandTests)", "test_check_migrations (user_commands.tests.CommandTests)", "test_command (user_commands.tests.CommandTests)", "test_command_add_arguments_after_common_arguments (user_commands.tests.CommandTests)", "test_command_style (user_commands.tests.CommandTests)", "test_get_random_secret_key (user_commands.tests.UtilsTests)", "test_is_ignored_path_false (user_commands.tests.UtilsTests)", "test_is_ignored_path_true (user_commands.tests.UtilsTests)", "test_language_preserved (user_commands.tests.CommandTests)", "test_mutually_exclusive_group_required_const_options (user_commands.tests.CommandTests)", "test_mutually_exclusive_group_required_options (user_commands.tests.CommandTests)", "test_mutually_exclusive_group_required_with_same_dest_args (user_commands.tests.CommandTests)", "test_mutually_exclusive_group_required_with_same_dest_options (user_commands.tests.CommandTests)", "test_no_existent_external_program (user_commands.tests.UtilsTests)", "test_normalize_path_patterns_truncates_wildcard_base (user_commands.tests.UtilsTests)", "test_output_transaction (user_commands.tests.CommandTests)", "test_outputwrapper_flush (user_commands.tests.CommandTests)", "test_required_const_options (user_commands.tests.CommandTests)", "test_required_list_option (user_commands.tests.CommandTests)", "test_requires_system_checks_empty (user_commands.tests.CommandTests)", "test_requires_system_checks_invalid (user_commands.tests.CommandTests)", "test_requires_system_checks_specific (user_commands.tests.CommandTests)", "test_script_prefix_set_in_commands (user_commands.tests.CommandRunTests)", "test_skip_checks (user_commands.tests.CommandRunTests)", "test_subparser (user_commands.tests.CommandTests)", "test_subparser_dest_args (user_commands.tests.CommandTests)", "test_subparser_dest_required_args (user_commands.tests.CommandTests)", "test_subparser_invalid_option (user_commands.tests.CommandTests)"], "environment_setup_commit": "0fbdb9784da915fce5dcc1fe82bac9b4785749e5"}]
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
{
|
|
2
|
+
"environment": "main",
|
|
3
|
+
"trajectory": [
|
|
4
|
+
{
|
|
5
|
+
"action": "find_file missing_colon.py",
|
|
6
|
+
"observation": "Found 1 matches for \"missing_colon.py\" in /SWE-agent__test-repo:\r\n/SWE-agent__test-repo/tests/missing_colon.py",
|
|
7
|
+
"response": "To start addressing this issue, I will first search for the `missing_colon.py` file and open it since that is where the problem is occurring. I will then examine the file to see exactly what the syntax error might be and correct it. \n\nLet's begin by finding the `missing_colon.py` file in the repository.",
|
|
8
|
+
"thought": "To start addressing this issue, I will first search for the `missing_colon.py` file and open it since that is where the problem is occurring. I will then examine the file to see exactly what the syntax error might be and correct it. \n\nLet's begin by finding the `missing_colon.py` file in the repository.",
|
|
9
|
+
"execution_time": 0.2814128329991945,
|
|
10
|
+
"state": {
|
|
11
|
+
"open_file": "n/a",
|
|
12
|
+
"working_dir": "/SWE-agent__test-repo"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"action": "open \"/SWE-agent__test-repo/tests/missing_colon.py\"",
|
|
17
|
+
"observation": "[File: /SWE-agent__test-repo/tests/missing_colon.py (10 lines total)]\r\n1:#!/usr/bin/env python3\r\n2:\r\n3:\r\n4:def division(a: float, b: float) -> float\r\n5: return a/b\r\n6:\r\n7:\r\n8:if __name__ == \"__main__\":\r\n9: print(division(123, 15))\r\n10:",
|
|
18
|
+
"response": "The file `missing_colon.py` is located in the `tests` directory. I will now open this file to check the source of the syntax error in order to fix it.",
|
|
19
|
+
"thought": "The file `missing_colon.py` is located in the `tests` directory. I will now open this file to check the source of the syntax error in order to fix it.",
|
|
20
|
+
"execution_time": 0.29675291599960474,
|
|
21
|
+
"state": {
|
|
22
|
+
"open_file": "/SWE-agent__test-repo/tests/missing_colon.py",
|
|
23
|
+
"working_dir": "/SWE-agent__test-repo"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"action": "edit 'def division(a: float, b: float) -> float' 'def division(a: float, b: float) -> float:' False",
|
|
28
|
+
"observation": "Replaced 1 occurrences. Please review the changes and make sure they are correct\r\n(correct indentation, no duplicate lines, etc). Edit the file again if necessary.\r\n[File: /SWE-agent__test-repo/tests/missing_colon.py (10 lines total)]\r\n1:#!/usr/bin/env python3\r\n2:\r\n3:\r\n4:def division(a: float, b: float) -> float:\r\n5: return a/b\r\n6:\r\n7:\r\n8:if __name__ == \"__main__\":\r\n9: print(division(123, 15))\r\n10:",
|
|
29
|
+
"response": "The syntax error in the `missing_colon.py` file is due to the missing colon (`:`) at the end of the function definition on line 4. I will add the missing colon to fix this syntax error.",
|
|
30
|
+
"thought": "The syntax error in the `missing_colon.py` file is due to the missing colon (`:`) at the end of the function definition on line 4. I will add the missing colon to fix this syntax error.",
|
|
31
|
+
"execution_time": 0.4935787079994043,
|
|
32
|
+
"state": {
|
|
33
|
+
"open_file": "/SWE-agent__test-repo/tests/missing_colon.py",
|
|
34
|
+
"working_dir": "/SWE-agent__test-repo"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"action": "python3 /SWE-agent__test-repo/tests/missing_colon.py",
|
|
39
|
+
"observation": "8.2",
|
|
40
|
+
"response": "The missing colon has been added to the function definition on line 4. This should fix the syntax error. Next, I will run this Python script to verify that the error is resolved and ensure that it executes correctly.",
|
|
41
|
+
"thought": "The missing colon has been added to the function definition on line 4. This should fix the syntax error. Next, I will run this Python script to verify that the error is resolved and ensure that it executes correctly.",
|
|
42
|
+
"execution_time": 0.2925790000008419,
|
|
43
|
+
"state": {
|
|
44
|
+
"open_file": "/SWE-agent__test-repo/tests/missing_colon.py",
|
|
45
|
+
"working_dir": "/SWE-agent__test-repo"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"action": "submit",
|
|
50
|
+
"observation": "\r\ndiff --git a/tests/missing_colon.py b/tests/missing_colon.py\r\nindex 20edef5..5857437 100755\r\n--- a/tests/missing_colon.py\r\n+++ b/tests/missing_colon.py\r\n@@ -1,7 +1,7 @@\r\n #!/usr/bin/env python3\r\n \r\n \r\n-def division(a: float, b: float) -> float\r\n+def division(a: float, b: float) -> float:\r\n return a/b\r\n \r\n \r\n",
|
|
51
|
+
"response": "The script `missing_colon.py` ran successfully and the output was `8.2`, indicating that the syntax error has been fixed. The function `division` is now working correctly. \n\nI will now submit the changes to finalize the fix.",
|
|
52
|
+
"thought": "The script `missing_colon.py` ran successfully and the output was `8.2`, indicating that the syntax error has been fixed. The function `division` is now working correctly. \n\nI will now submit the changes to finalize the fix.",
|
|
53
|
+
"execution_time": 0.2691650420001679,
|
|
54
|
+
"state": {
|
|
55
|
+
"open_file": "/SWE-agent__test-repo/tests/missing_colon.py",
|
|
56
|
+
"working_dir": "/SWE-agent__test-repo"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"history": [
|
|
61
|
+
{
|
|
62
|
+
"role": "system",
|
|
63
|
+
"content": "SETTING: You are an autonomous programmer, and you're working directly in the command line with a special interface.\n\nThe special interface consists of a file editor that shows you 100 lines of a file at a time.\nIn addition to typical bash commands, you can also use the following commands to help you navigate and edit files.\n\nPlease note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.\nIf you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.\n\nRESPONSE FORMAT:\nYour shell prompt is formatted as follows:\n(Open file: <path>) <cwd> $\n\nFirst, you should _always_ include a general thought about what you're going to do next.\nThen, for every response, you must include exactly _ONE_ command to execute.\nAll of the tools you need to use are listed for your reference.\n\nRemember, you should only include a _SINGLE_ command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.\nIf you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.\nYou're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.\nHowever, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.",
|
|
64
|
+
"agent": "main",
|
|
65
|
+
"message_type": "system_prompt"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"role": "user",
|
|
69
|
+
"content": "We're currently solving the following issue within our repository. Here's the issue text:\nISSUE:\nSyntaxError: invalid syntax\nI'm running `missing_colon.py` as follows:\r\n\r\n```python\r\ndivision(23, 0)\r\n```\r\n\r\nbut I get the following error:\r\n\r\n```\r\n File \"/Users/fuchur/Documents/24/git_sync/swe-agent-test-repo/tests/./missing_colon.py\", line 4\r\n def division(a: float, b: float) -> float\r\n ^\r\nSyntaxError: invalid syntax\r\n```\n\n\nINSTRUCTIONS:\nNow, you're going to solve this issue on your own. Your terminal session has started and you're in the repository's root directory. You can use any bash commands or the special interface to help you. Edit all the files you need to and run any checks or tests that you want.\nRemember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.\nWhen you're satisfied with all of the changes you've made, you can submit your changes to the code base by simply running the submit command.\nNote however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.\n\nNOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!\n\nIMPORTANT TIPS:\n1. Always start by trying to replicate the bug that the issues discusses.\n If the issue includes code for reproducing the bug, we recommend that you re-implement that in your environment, and run it to make sure you can reproduce the bug.\n Then start trying to fix it.\n When you think you've fixed the bug, re-run the bug reproduction script to make sure that the bug has indeed been fixed.\n\n If the bug reproduction script does not print anything when it successfully runs, we recommend adding a print(\"Script completed successfully, no errors.\") command at the end of the file,\n so that you can be sure that the script indeed ran fine all the way through.\n\n2. If you run a command and it doesn't work, try running a different command. A command that did not work once will not work the second time unless you modify it!\n\n3. If you open a file and need to get to an area around a specific line that is not in the first 100 lines, say line 583, don't just use the scroll_down command multiple times. Instead, use the goto 583 command. It's much quicker.\n\n4. If the bug reproduction script requires inputting/reading a specific file, such as buggy-input.png, and you'd like to understand how to input that file, conduct a search in the existing repo code, to see whether someone else has already done that. Do this by running the command: find_file \"buggy-input.png\" If that doesn't work, use the linux 'find' command.\n\n5. Always make sure to look at the currently open file and the current working directory (which appears right after the currently open file). The currently open file might be in a different directory than the working directory! Note that some commands, such as 'create', open files, so they might change the current open file.\n\n6. When editing files, it is easy to accidentally specify a wrong line number or to write code with incorrect indentation. Always check the code after you issue an edit to make sure that it reflects what you wanted to accomplish. If it didn't, issue another command to fix it.\n\n\n(Open file: n/a)\n(Current directory: /SWE-agent__test-repo)\nbash-$",
|
|
70
|
+
"agent": "main",
|
|
71
|
+
"message_type": "observation"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"role": "assistant",
|
|
75
|
+
"content": "To start addressing this issue, I will first search for the `missing_colon.py` file and open it since that is where the problem is occurring. I will then examine the file to see exactly what the syntax error might be and correct it. \n\nLet's begin by finding the `missing_colon.py` file in the repository.",
|
|
76
|
+
"thought": "To start addressing this issue, I will first search for the `missing_colon.py` file and open it since that is where the problem is occurring. I will then examine the file to see exactly what the syntax error might be and correct it. \n\nLet's begin by finding the `missing_colon.py` file in the repository.",
|
|
77
|
+
"action": "find_file missing_colon.py",
|
|
78
|
+
"agent": "main",
|
|
79
|
+
"tool_calls": [
|
|
80
|
+
{
|
|
81
|
+
"function": {
|
|
82
|
+
"arguments": "{\"file_name\":\"missing_colon.py\"}",
|
|
83
|
+
"name": "find_file"
|
|
84
|
+
},
|
|
85
|
+
"id": "call_fJuazlMUN5fQDQ73G6XSpYpx",
|
|
86
|
+
"type": "function"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"message_type": "action"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"role": "tool",
|
|
93
|
+
"content": "Found 1 matches for \"missing_colon.py\" in /SWE-agent__test-repo:\r\n/SWE-agent__test-repo/tests/missing_colon.py\n(Open file: n/a)\n(Current directory: /SWE-agent__test-repo)\nbash-$",
|
|
94
|
+
"agent": "main",
|
|
95
|
+
"tool_call_ids": [
|
|
96
|
+
"call_fJuazlMUN5fQDQ73G6XSpYpx"
|
|
97
|
+
],
|
|
98
|
+
"message_type": "observation"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"role": "assistant",
|
|
102
|
+
"content": "The file `missing_colon.py` is located in the `tests` directory. I will now open this file to check the source of the syntax error in order to fix it.",
|
|
103
|
+
"thought": "The file `missing_colon.py` is located in the `tests` directory. I will now open this file to check the source of the syntax error in order to fix it.",
|
|
104
|
+
"action": "open \"/SWE-agent__test-repo/tests/missing_colon.py\"",
|
|
105
|
+
"agent": "main",
|
|
106
|
+
"tool_calls": [
|
|
107
|
+
{
|
|
108
|
+
"function": {
|
|
109
|
+
"arguments": "{\"path\":\"/SWE-agent__test-repo/tests/missing_colon.py\"}",
|
|
110
|
+
"name": "open"
|
|
111
|
+
},
|
|
112
|
+
"id": "call_OhmPHGZp0XJ6JRnNkQaYcBMs",
|
|
113
|
+
"type": "function"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"message_type": "action"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"role": "tool",
|
|
120
|
+
"content": "[File: /SWE-agent__test-repo/tests/missing_colon.py (10 lines total)]\r\n1:#!/usr/bin/env python3\r\n2:\r\n3:\r\n4:def division(a: float, b: float) -> float\r\n5: return a/b\r\n6:\r\n7:\r\n8:if __name__ == \"__main__\":\r\n9: print(division(123, 15))\r\n10:\n(Open file: /SWE-agent__test-repo/tests/missing_colon.py)\n(Current directory: /SWE-agent__test-repo)\nbash-$",
|
|
121
|
+
"agent": "main",
|
|
122
|
+
"tool_call_ids": [
|
|
123
|
+
"call_OhmPHGZp0XJ6JRnNkQaYcBMs"
|
|
124
|
+
],
|
|
125
|
+
"message_type": "observation"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"role": "assistant",
|
|
129
|
+
"content": "The syntax error in the `missing_colon.py` file is due to the missing colon (`:`) at the end of the function definition on line 4. I will add the missing colon to fix this syntax error.",
|
|
130
|
+
"thought": "The syntax error in the `missing_colon.py` file is due to the missing colon (`:`) at the end of the function definition on line 4. I will add the missing colon to fix this syntax error.",
|
|
131
|
+
"action": "edit 'def division(a: float, b: float) -> float' 'def division(a: float, b: float) -> float:' False",
|
|
132
|
+
"agent": "main",
|
|
133
|
+
"tool_calls": [
|
|
134
|
+
{
|
|
135
|
+
"function": {
|
|
136
|
+
"arguments": "{\"search\":\"def division(a: float, b: float) -> float\",\"replace\":\"def division(a: float, b: float) -> float:\",\"replace-all\":false}",
|
|
137
|
+
"name": "edit"
|
|
138
|
+
},
|
|
139
|
+
"id": "call_DVnbJcFrvwPsrPt3KfIMf7OH",
|
|
140
|
+
"type": "function"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"message_type": "action"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"role": "tool",
|
|
147
|
+
"content": "Replaced 1 occurrences. Please review the changes and make sure they are correct\r\n(correct indentation, no duplicate lines, etc). Edit the file again if necessary.\r\n[File: /SWE-agent__test-repo/tests/missing_colon.py (10 lines total)]\r\n1:#!/usr/bin/env python3\r\n2:\r\n3:\r\n4:def division(a: float, b: float) -> float:\r\n5: return a/b\r\n6:\r\n7:\r\n8:if __name__ == \"__main__\":\r\n9: print(division(123, 15))\r\n10:\n(Open file: /SWE-agent__test-repo/tests/missing_colon.py)\n(Current directory: /SWE-agent__test-repo)\nbash-$",
|
|
148
|
+
"agent": "main",
|
|
149
|
+
"tool_call_ids": [
|
|
150
|
+
"call_DVnbJcFrvwPsrPt3KfIMf7OH"
|
|
151
|
+
],
|
|
152
|
+
"message_type": "observation"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"role": "assistant",
|
|
156
|
+
"content": "The missing colon has been added to the function definition on line 4. This should fix the syntax error. Next, I will run this Python script to verify that the error is resolved and ensure that it executes correctly.",
|
|
157
|
+
"thought": "The missing colon has been added to the function definition on line 4. This should fix the syntax error. Next, I will run this Python script to verify that the error is resolved and ensure that it executes correctly.",
|
|
158
|
+
"action": "python3 /SWE-agent__test-repo/tests/missing_colon.py",
|
|
159
|
+
"agent": "main",
|
|
160
|
+
"tool_calls": [
|
|
161
|
+
{
|
|
162
|
+
"function": {
|
|
163
|
+
"arguments": "{\"command\":\"python3 /SWE-agent__test-repo/tests/missing_colon.py\"}",
|
|
164
|
+
"name": "bash"
|
|
165
|
+
},
|
|
166
|
+
"id": "call_dcF76aXH6e1pzqRwGxOwpuxb",
|
|
167
|
+
"type": "function"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"message_type": "action"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"role": "tool",
|
|
174
|
+
"content": "8.2\n(Open file: /SWE-agent__test-repo/tests/missing_colon.py)\n(Current directory: /SWE-agent__test-repo)\nbash-$",
|
|
175
|
+
"agent": "main",
|
|
176
|
+
"tool_call_ids": [
|
|
177
|
+
"call_dcF76aXH6e1pzqRwGxOwpuxb"
|
|
178
|
+
],
|
|
179
|
+
"message_type": "observation"
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"info": {
|
|
183
|
+
"submission": "\r\ndiff --git a/tests/missing_colon.py b/tests/missing_colon.py\r\nindex 20edef5..5857437 100755\r\n--- a/tests/missing_colon.py\r\n+++ b/tests/missing_colon.py\r\n@@ -1,7 +1,7 @@\r\n #!/usr/bin/env python3\r\n \r\n \r\n-def division(a: float, b: float) -> float\r\n+def division(a: float, b: float) -> float:\r\n return a/b\r\n \r\n \r\n",
|
|
184
|
+
"exit_status": "submitted",
|
|
185
|
+
"edited_files30": "[File: tests/missing_colon.py\r]\n 1: #!/usr/bin/env python3\n 2: \n 3: \n 4: def division(a: float, b: float) -> float:\n 5: return a/b\n 6: \n 7: \n 8: if __name__ == \"__main__\":\n 9: print(division(123, 15))",
|
|
186
|
+
"edited_files50": "[File: tests/missing_colon.py\r]\n 1: #!/usr/bin/env python3\n 2: \n 3: \n 4: def division(a: float, b: float) -> float:\n 5: return a/b\n 6: \n 7: \n 8: if __name__ == \"__main__\":\n 9: print(division(123, 15))",
|
|
187
|
+
"edited_files70": "[File: tests/missing_colon.py\r]\n 1: #!/usr/bin/env python3\n 2: \n 3: \n 4: def division(a: float, b: float) -> float:\n 5: return a/b\n 6: \n 7: \n 8: if __name__ == \"__main__\":\n 9: print(division(123, 15))",
|
|
188
|
+
"model_stats": {
|
|
189
|
+
"instance_cost": 0.019520000000000006,
|
|
190
|
+
"tokens_sent": 7141,
|
|
191
|
+
"tokens_received": 243,
|
|
192
|
+
"api_calls": 5
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"replay_config": {
|
|
196
|
+
"env": {
|
|
197
|
+
"deployment": {
|
|
198
|
+
"image": "tiny",
|
|
199
|
+
"port": null,
|
|
200
|
+
"docker_args": [],
|
|
201
|
+
"startup_timeout": 180.0,
|
|
202
|
+
"pull": "missing",
|
|
203
|
+
"remove_images": false,
|
|
204
|
+
"type": "docker"
|
|
205
|
+
},
|
|
206
|
+
"repo": {
|
|
207
|
+
"github_url": "https://github.com/SWE-agent/test-repo/",
|
|
208
|
+
"base_commit": "HEAD",
|
|
209
|
+
"clone_timeout": 500.0,
|
|
210
|
+
"type": "github"
|
|
211
|
+
},
|
|
212
|
+
"post_startup_commands": [],
|
|
213
|
+
"name": "main"
|
|
214
|
+
},
|
|
215
|
+
"agent": {
|
|
216
|
+
"name": "main",
|
|
217
|
+
"templates": {
|
|
218
|
+
"system_template": "SETTING: You are an autonomous programmer, and you're working directly in the command line with a special interface.\n\nThe special interface consists of a file editor that shows you {WINDOW} lines of a file at a time.\nIn addition to typical bash commands, you can also use the following commands to help you navigate and edit files.\n\nPlease note that THE EDIT COMMAND REQUIRES PROPER INDENTATION.\nIf you'd like to add the line ' print(x)' you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run.\n\nRESPONSE FORMAT:\nYour shell prompt is formatted as follows:\n(Open file: <path>) <cwd> $\n\nFirst, you should _always_ include a general thought about what you're going to do next.\nThen, for every response, you must include exactly _ONE_ command to execute.\nAll of the tools you need to use are listed for your reference.\n\nRemember, you should only include a _SINGLE_ command in the command section and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference.\nIf you'd like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first command, and then after receiving a response you'll be able to issue the second command.\nYou're free to use any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition to the special commands listed above.\nHowever, the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them.",
|
|
219
|
+
"instance_template": "We're currently solving the following issue within our repository. Here's the issue text:\nISSUE:\n{problem_statement}\n\nINSTRUCTIONS:\nNow, you're going to solve this issue on your own. Your terminal session has started and you're in the repository's root directory. You can use any bash commands or the special interface to help you. Edit all the files you need to and run any checks or tests that you want.\nRemember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME. You should always wait for feedback after every command.\nWhen you're satisfied with all of the changes you've made, you can submit your changes to the code base by simply running the submit command.\nNote however that you cannot use any interactive session commands (e.g. python, vim) in this environment, but you can write scripts and run them. E.g. you can write a python script and then run it with `python <script_name>.py`.\n\nNOTE ABOUT THE EDIT COMMAND: Indentation really matters! When editing a file, make sure to insert appropriate indentation before each line!\n\nIMPORTANT TIPS:\n1. Always start by trying to replicate the bug that the issues discusses.\n If the issue includes code for reproducing the bug, we recommend that you re-implement that in your environment, and run it to make sure you can reproduce the bug.\n Then start trying to fix it.\n When you think you've fixed the bug, re-run the bug reproduction script to make sure that the bug has indeed been fixed.\n\n If the bug reproduction script does not print anything when it successfully runs, we recommend adding a print(\"Script completed successfully, no errors.\") command at the end of the file,\n so that you can be sure that the script indeed ran fine all the way through.\n\n2. If you run a command and it doesn't work, try running a different command. A command that did not work once will not work the second time unless you modify it!\n\n3. If you open a file and need to get to an area around a specific line that is not in the first 100 lines, say line 583, don't just use the scroll_down command multiple times. Instead, use the goto 583 command. It's much quicker.\n\n4. If the bug reproduction script requires inputting/reading a specific file, such as buggy-input.png, and you'd like to understand how to input that file, conduct a search in the existing repo code, to see whether someone else has already done that. Do this by running the command: find_file \"buggy-input.png\" If that doesn't work, use the linux 'find' command.\n\n5. Always make sure to look at the currently open file and the current working directory (which appears right after the currently open file). The currently open file might be in a different directory than the working directory! Note that some commands, such as 'create', open files, so they might change the current open file.\n\n6. When editing files, it is easy to accidentally specify a wrong line number or to write code with incorrect indentation. Always check the code after you issue an edit to make sure that it reflects what you wanted to accomplish. If it didn't, issue another command to fix it.\n\n\n(Open file: {open_file})\n(Current directory: {working_dir})\nbash-$",
|
|
220
|
+
"next_step_template": "{observation}\n(Open file: {open_file})\n(Current directory: {working_dir})\nbash-$",
|
|
221
|
+
"next_step_no_output_template": "Your command ran successfully and did not produce any output.\n(Open file: {open_file})\n(Current directory: {working_dir})\nbash-$",
|
|
222
|
+
"strategy_template": null,
|
|
223
|
+
"demonstration_template": null,
|
|
224
|
+
"demonstrations": [],
|
|
225
|
+
"put_demos_in_history": false,
|
|
226
|
+
"shell_check_error_template": "Your bash command contained syntax errors and was NOT executed. Please fix the syntax errors and try again. This can be the result of not adhering to the syntax for multi-line commands. Here is the output of `bash -n`:\n{bash_stdout}\n{bash_stderr}",
|
|
227
|
+
"command_cancelled_timeout_template": "The command {command!r} was cancelled because it took more than {timeout} seconds. Please try a different command that completes more quickly."
|
|
228
|
+
},
|
|
229
|
+
"tools": {
|
|
230
|
+
"filter": {
|
|
231
|
+
"blocklist_error_template": "Interactive operation '{action}' is not supported by this environment.",
|
|
232
|
+
"blocklist": [
|
|
233
|
+
"vim",
|
|
234
|
+
"vi",
|
|
235
|
+
"emacs",
|
|
236
|
+
"nano",
|
|
237
|
+
"nohup",
|
|
238
|
+
"git",
|
|
239
|
+
"gdb",
|
|
240
|
+
"less"
|
|
241
|
+
],
|
|
242
|
+
"blocklist_standalone": [
|
|
243
|
+
"python",
|
|
244
|
+
"python3",
|
|
245
|
+
"ipython",
|
|
246
|
+
"bash",
|
|
247
|
+
"sh",
|
|
248
|
+
"/bin/bash",
|
|
249
|
+
"/bin/sh",
|
|
250
|
+
"nohup",
|
|
251
|
+
"vi",
|
|
252
|
+
"vim",
|
|
253
|
+
"emacs",
|
|
254
|
+
"nano",
|
|
255
|
+
"su"
|
|
256
|
+
],
|
|
257
|
+
"block_unless_regex": {
|
|
258
|
+
"radare2": "\\b(?:radare2)\\b.*\\s+-c\\s+.*",
|
|
259
|
+
"r2": "\\b(?:radare2)\\b.*\\s+-c\\s+.*"
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"bundles": [
|
|
263
|
+
{
|
|
264
|
+
"path": "tools/registry",
|
|
265
|
+
"hidden_tools": []
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"path": "tools/windowed",
|
|
269
|
+
"hidden_tools": []
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"path": "tools/search",
|
|
273
|
+
"hidden_tools": []
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"path": "tools/windowed_edit_replace",
|
|
277
|
+
"hidden_tools": []
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"path": "tools/submit",
|
|
281
|
+
"hidden_tools": []
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
"env_variables": {
|
|
285
|
+
"WINDOW": 100,
|
|
286
|
+
"OVERLAP": 2
|
|
287
|
+
},
|
|
288
|
+
"submit_command": "submit",
|
|
289
|
+
"parse_function": {
|
|
290
|
+
"error_message": " Your output could not be parsed as a tool call.\n Please make sure your output includes a thought and exactly _ONE_ tool call.\n\n Make sure your tool call doesn't include any extra arguments that are not in the allowed arguments, and only use the allowed commands.\n\n You must invoke the tool directly using the function call format.\n ",
|
|
291
|
+
"type": "function_calling"
|
|
292
|
+
},
|
|
293
|
+
"enable_bash_tool": true,
|
|
294
|
+
"format_error_template": "Your output could not be parsed as a tool call.\nPlease make sure your output includes a thought and exactly _ONE_ tool call.\n\nMake sure your tool call doesn't include any extra arguments that are not in the allowed arguments, and only use the allowed commands.\n\nYou must invoke the tool directly using the function call format.\n",
|
|
295
|
+
"command_docs": "bash:\n docstring: runs the given command directly in bash\n signature: <command>\n arguments:\n - command (string) [required]: a command to run directly in the current shell\n\ngoto:\n docstring: moves the window to show <line_number>\n signature: goto <line_number>\n arguments:\n - line_number (integer) [required]: the line number to move the window to\n\nopen:\n docstring: opens the file at the given path in the editor. If line_number is provided, the window will be move to include that line\n signature: open \"<path>\" [<line_number>]\n arguments:\n - path (string) [required]: the path to the file to open\n - line_number (integer) [optional]: the line number to move the window to (if not provided, the window will start at the top of the file)\n\ncreate:\n docstring: creates and opens a new file with the given name\n signature: create <filename>\n arguments:\n - filename (string) [required]: the name of the file to create\n\nscroll_up:\n docstring: moves the window down 100 lines\n signature: scroll_up\n\nscroll_down:\n docstring: moves the window down 100 lines\n signature: scroll_down\n\nfind_file:\n docstring: finds all files with the given name in dir. If dir is not provided, searches in the current directory\n signature: find_file <file_name> [<dir>]\n arguments:\n - file_name (string) [required]: the name of the file to search for\n - dir (string) [optional]: the directory to search in (if not provided, searches in the current directory)\n\nsearch_dir:\n docstring: searches for search_term in all files in dir. If dir is not provided, searches in the current directory\n signature: search_dir <search_term> [<dir>]\n arguments:\n - search_term (string) [required]: the term to search for\n - dir (string) [optional]: the directory to search in (if not provided, searches in the current directory)\n\nsearch_file:\n docstring: searches for search_term in file. If file is not provided, searches in the current open file\n signature: search_file <search_term> [<file>]\n arguments:\n - search_term (string) [required]: the term to search for\n - file (string) [optional]: the file to search in (if not provided, searches in the current open file)\n\nedit:\n docstring: Replace first occurrence of <search> with <replace> in the currently displayed lines. If --replace-all is specified, replace all occurrences of <search> with <replace>.\n\n signature: edit <search> <replace> [<replace-all>]\n\n arguments:\n - search (string) [required]: the text to search for\n - replace (string) [required]: the text to replace the search with\n - replace-all (boolean) [optional]: replace all occurrences rather than the first occurrence within the displayed lines\n\ninsert:\n docstring: Insert <text> at the end of the currently opened file or after <line> if specified.\n\n signature: insert <text> [--line <line>]\n\n arguments:\n - text (string) [required]: the text to insert\n - line (integer) [optional]: the line number to insert the text as new lines after\n\nsubmit:\n docstring: submits the current file\n signature: submit\n\n",
|
|
296
|
+
"multi_line_command_endings": {},
|
|
297
|
+
"submit_command_end_name": null,
|
|
298
|
+
"reset_commands": [],
|
|
299
|
+
"execution_timeout": 30,
|
|
300
|
+
"install_timeout": 300
|
|
301
|
+
},
|
|
302
|
+
"history_processors": [
|
|
303
|
+
{
|
|
304
|
+
"n": 5,
|
|
305
|
+
"type": "last_n_observations"
|
|
306
|
+
}
|
|
307
|
+
],
|
|
308
|
+
"model": {
|
|
309
|
+
"name": "gpt-4o",
|
|
310
|
+
"per_instance_cost_limit": 3.0,
|
|
311
|
+
"total_cost_limit": 0.0,
|
|
312
|
+
"temperature": 1.0,
|
|
313
|
+
"top_p": 1.0,
|
|
314
|
+
"api_base": null,
|
|
315
|
+
"api_version": null,
|
|
316
|
+
"api_key": null,
|
|
317
|
+
"stop": [],
|
|
318
|
+
"completion_kwargs": {},
|
|
319
|
+
"convert_system_to_user": false,
|
|
320
|
+
"retry": {
|
|
321
|
+
"retries": 5,
|
|
322
|
+
"min_wait": 1.0,
|
|
323
|
+
"max_wait": 15.0
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"max_requeries": 3
|
|
327
|
+
},
|
|
328
|
+
"problem_statement": {
|
|
329
|
+
"github_url": "https://github.com/SWE-agent/test-repo/issues/1",
|
|
330
|
+
"type": "github",
|
|
331
|
+
"id": "SWE-agent__test-repo-i1"
|
|
332
|
+
},
|
|
333
|
+
"actions": {
|
|
334
|
+
"open_pr": false,
|
|
335
|
+
"pr_config": {
|
|
336
|
+
"skip_if_commits_reference_issue": true
|
|
337
|
+
},
|
|
338
|
+
"apply_patch_locally": false
|
|
339
|
+
},
|
|
340
|
+
"env_var_path": null
|
|
341
|
+
}
|
|
342
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def division(a: float, b: float) -> float:
|
|
5
|
+
if b == 0:
|
|
6
|
+
raise ValueError("Cannot divide by zero")
|
|
7
|
+
return a / b
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
if __name__ == "__main__":
|
|
11
|
+
try:
|
|
12
|
+
print(division(23, 0))
|
|
13
|
+
except ValueError as e:
|
|
14
|
+
print(e)
|
|
15
|
+
|