Dataset Viewer
Auto-converted to Parquet
problem_id
stringlengths
18
21
source
stringclasses
1 value
task_type
stringclasses
1 value
in_source_id
stringlengths
13
54
prompt
stringlengths
1.28k
64.2k
golden_diff
stringlengths
166
811
verification_info
stringlengths
604
118k
gh_patches_debug_0
rasdani/github-patches
git_diff
conda-forge__conda-smithy-864
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Autogenerated README.md missing final newline ## The Problem As I've confirmed is the case on multiple repos here, including our own ``spyder-feedstock`` and ``spyder-kernels-feedstock`` as well as two arbitrary conda-forge repos I checked conda-forge, the last line in README.md lacks a terminating newline (LF/``x0D``), and is thus ill-formed. I'd be happy to submit a PR to fix it since I imagine it is probably pretty trivial, if someone more knowlegable than me can let me know how to approach it. ## Proposed Solutions A naive hack would seem to be just writing an additional ``\n`` [here](https://github.com/conda-forge/conda-smithy/blob/855f23bb96efb1cbdbdc5e60dfb9bbdd3e142d31/conda_smithy/configure_feedstock.py#L718), but editing the [template ](https://github.com/conda-forge/conda-smithy/blob/master/conda_smithy/templates/README.md.tmpl) would seem to make far more sense. However, the template *has* a trailing newline and hasn't been edited in a while, so not sure what's going on—is it not writing the last one; is it getting stripped, or what? Thanks! --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `conda_smithy/vendored/__init__.py` Content: ``` ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/conda_smithy/vendored/__init__.py b/conda_smithy/vendored/__init__.py --- a/conda_smithy/vendored/__init__.py +++ b/conda_smithy/vendored/__init__.py @@ -0,0 +1 @@ +
{"golden_diff": "diff --git a/conda_smithy/vendored/__init__.py b/conda_smithy/vendored/__init__.py\n--- a/conda_smithy/vendored/__init__.py\n+++ b/conda_smithy/vendored/__init__.py\n@@ -0,0 +1 @@\n+\n", "issue": "Autogenerated README.md missing final newline\n## The Problem\r\n\r\nAs I've confirmed is the case on multiple repos here, including our own ``spyder-feedstock`` and ``spyder-kernels-feedstock`` as well as two arbitrary conda-forge repos I checked conda-forge, the last line in README.md lacks a terminating newline (LF/``x0D``), and is thus ill-formed. I'd be happy to submit a PR to fix it since I imagine it is probably pretty trivial, if someone more knowlegable than me can let me know how to approach it. \r\n\r\n## Proposed Solutions\r\n\r\nA naive hack would seem to be just writing an additional ``\\n`` [here](https://github.com/conda-forge/conda-smithy/blob/855f23bb96efb1cbdbdc5e60dfb9bbdd3e142d31/conda_smithy/configure_feedstock.py#L718), but editing the [template ](https://github.com/conda-forge/conda-smithy/blob/master/conda_smithy/templates/README.md.tmpl) would seem to make far more sense. However, the template *has* a trailing newline and hasn't been edited in a while, so not sure what's going on\u2014is it not writing the last one; is it getting stripped, or what?\r\n\r\nThanks!\n", "before_files": [{"content": "", "path": "conda_smithy/vendored/__init__.py"}], "after_files": [{"content": "\n", "path": "conda_smithy/vendored/__init__.py"}]}
gh_patches_debug_1
rasdani/github-patches
git_diff
microsoft__AzureTRE-1754
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Release version 0.3 ## Description As a TRE developer I want to release current code base as version 0.3 So that people can use a more stable version going forward ## Acceptance criteria - [ ] All core apps are bumped to 0.3 - [ ] All bundles are bumped to 0.3 - [ ] A tag is created - [ ] A release is created --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `api_app/_version.py` Content: ``` 1 __version__ = "0.2.28" 2 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/api_app/_version.py b/api_app/_version.py --- a/api_app/_version.py +++ b/api_app/_version.py @@ -1 +1 @@ -__version__ = "0.2.28" +__version__ = "0.3.0"
{"golden_diff": "diff --git a/api_app/_version.py b/api_app/_version.py\n--- a/api_app/_version.py\n+++ b/api_app/_version.py\n@@ -1 +1 @@\n-__version__ = \"0.2.28\"\n+__version__ = \"0.3.0\"\n", "issue": "Release version 0.3\n## Description\r\n\r\nAs a TRE developer \r\nI want to release current code base as version 0.3\r\nSo that people can use a more stable version going forward\r\n\r\n## Acceptance criteria\r\n\r\n- [ ] All core apps are bumped to 0.3\r\n- [ ] All bundles are bumped to 0.3\r\n- [ ] A tag is created\r\n- [ ] A release is created\r\n\n", "before_files": [{"content": "__version__ = \"0.2.28\"\n", "path": "api_app/_version.py"}], "after_files": [{"content": "__version__ = \"0.3.0\"\n", "path": "api_app/_version.py"}]}
gh_patches_debug_2
rasdani/github-patches
git_diff
OpenEnergyPlatform__oeplatform-1475
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Scenario bundles: Output datasets render weirdly ## Description of the issue I added an output dataset for the WAM scenario for this factsheet: https://openenergy-platform.org/scenario-bundles/id/95a65aca-6915-b64a-cac7-3831c12885b4 ![grafik](https://github.com/OpenEnergyPlatform/oeplatform/assets/36844029/fa43133d-3cd7-4a22-80a0-384cbf6514e3) It reads wrongly and shows more than only the title of the dataset, i.e. it should only be rendered as: Rahmendaten für den Projektionsbericht 2023 (Datentabelle) - as it does for the WEM scenario (this was already existing before the new release). ## Steps to Reproduce 1. Add a dataset to a scenario 2. 3. ## Ideas of solution Describe possible ideas for solution and evaluate advantages and disadvantages. ## Context and Environment * Version used: * Operating system: * Environment setup and (python) version: ## Workflow checklist - [ ] I am aware of the workflow in [CONTRIBUTING.md](https://github.com/OpenEnergyPlatform/oeplatform/blob/develop/CONTRIBUTING.md) --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `oeplatform/__init__.py` Content: ``` 1 __version__ = "0.16.1" 2 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/oeplatform/__init__.py b/oeplatform/__init__.py --- a/oeplatform/__init__.py +++ b/oeplatform/__init__.py @@ -1 +1 @@ -__version__ = "0.16.1" +__version__ = "0.16.2"
{"golden_diff": "diff --git a/oeplatform/__init__.py b/oeplatform/__init__.py\n--- a/oeplatform/__init__.py\n+++ b/oeplatform/__init__.py\n@@ -1 +1 @@\n-__version__ = \"0.16.1\"\n+__version__ = \"0.16.2\"\n", "issue": "Scenario bundles: Output datasets render weirdly\n## Description of the issue\r\n\r\nI added an output dataset for the WAM scenario for this factsheet: https://openenergy-platform.org/scenario-bundles/id/95a65aca-6915-b64a-cac7-3831c12885b4\r\n\r\n![grafik](https://github.com/OpenEnergyPlatform/oeplatform/assets/36844029/fa43133d-3cd7-4a22-80a0-384cbf6514e3)\r\n\r\nIt reads wrongly and shows more than only the title of the dataset, i.e. it should only be rendered as: Rahmendaten f\u00fcr den Projektionsbericht 2023 (Datentabelle) - as it does for the WEM scenario (this was already existing before the new release). \r\n\r\n\r\n## Steps to Reproduce\r\n1. Add a dataset to a scenario\r\n2.\r\n3.\r\n\r\n## Ideas of solution\r\n\r\nDescribe possible ideas for solution and evaluate advantages and disadvantages.\r\n\r\n## Context and Environment\r\n* Version used: \r\n* Operating system: \r\n* Environment setup and (python) version: \r\n\r\n## Workflow checklist\r\n- [ ] I am aware of the workflow in [CONTRIBUTING.md](https://github.com/OpenEnergyPlatform/oeplatform/blob/develop/CONTRIBUTING.md)\r\n\n", "before_files": [{"content": "__version__ = \"0.16.1\"\n", "path": "oeplatform/__init__.py"}], "after_files": [{"content": "__version__ = \"0.16.2\"\n", "path": "oeplatform/__init__.py"}]}
gh_patches_debug_3
rasdani/github-patches
git_diff
OCHA-DAP__hdx-ckan-1655
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Main Nav changes to accomodate "Feedback" button Updating the action based on discussions: 1. Remove `Contact` from main nav. 2. Between `About` and `Submit Data`, add a button `Feedback`. 3. While you are there, change `Submit Data` to `Share Data` (there's a later issue for that which this will close) Button style should be the same as the "Follow Us" button here, except gray, not blue: http://docs.hdx.rwlabs.org/get-involved/ Note that the megaphone icon shown below will not be used. No icon on the button. --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `ckanext-hdx_theme/ckanext/hdx_theme/version.py` Content: ``` 1 hdx_version = 'v0.4.5' 2 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/version.py b/ckanext-hdx_theme/ckanext/hdx_theme/version.py --- a/ckanext-hdx_theme/ckanext/hdx_theme/version.py +++ b/ckanext-hdx_theme/ckanext/hdx_theme/version.py @@ -1 +1 @@ -hdx_version = 'v0.4.5' +hdx_version = 'v0.4.6'
{"golden_diff": "diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/version.py b/ckanext-hdx_theme/ckanext/hdx_theme/version.py\n--- a/ckanext-hdx_theme/ckanext/hdx_theme/version.py\n+++ b/ckanext-hdx_theme/ckanext/hdx_theme/version.py\n@@ -1 +1 @@\n-hdx_version = 'v0.4.5'\n+hdx_version = 'v0.4.6'\n", "issue": "Main Nav changes to accomodate \"Feedback\" button\nUpdating the action based on discussions:\n1. Remove `Contact` from main nav. \n2. Between `About` and `Submit Data`, add a button `Feedback`. \n3. While you are there, change `Submit Data` to `Share Data` (there's a later issue for that which this will close)\n\nButton style should be the same as the \"Follow Us\" button here, except gray, not blue: http://docs.hdx.rwlabs.org/get-involved/\n\nNote that the megaphone icon shown below will not be used. No icon on the button.\n\n", "before_files": [{"content": "hdx_version = 'v0.4.5'\n", "path": "ckanext-hdx_theme/ckanext/hdx_theme/version.py"}], "after_files": [{"content": "hdx_version = 'v0.4.6'\n", "path": "ckanext-hdx_theme/ckanext/hdx_theme/version.py"}]}
gh_patches_debug_4
rasdani/github-patches
git_diff
OCHA-DAP__hdx-ckan-2076
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Login page: change spacing on left panel The spacing in the left panel is odd. Change to something like the below: ![image](https://cloud.githubusercontent.com/assets/1654485/5451121/6d3fa152-850d-11e4-87dd-4485c2f767da.png) Note, this will stay in backlog for now as we may want to revise this page to align with the Frog design. --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `ckanext-hdx_theme/ckanext/hdx_theme/version.py` Content: ``` 1 hdx_version = 'v0.5.13' 2 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/version.py b/ckanext-hdx_theme/ckanext/hdx_theme/version.py --- a/ckanext-hdx_theme/ckanext/hdx_theme/version.py +++ b/ckanext-hdx_theme/ckanext/hdx_theme/version.py @@ -1 +1 @@ -hdx_version = 'v0.5.13' +hdx_version = 'v0.5.15'
{"golden_diff": "diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/version.py b/ckanext-hdx_theme/ckanext/hdx_theme/version.py\n--- a/ckanext-hdx_theme/ckanext/hdx_theme/version.py\n+++ b/ckanext-hdx_theme/ckanext/hdx_theme/version.py\n@@ -1 +1 @@\n-hdx_version = 'v0.5.13'\n+hdx_version = 'v0.5.15'\n", "issue": "Login page: change spacing on left panel \nThe spacing in the left panel is odd. Change to something like the below: \n\n![image](https://cloud.githubusercontent.com/assets/1654485/5451121/6d3fa152-850d-11e4-87dd-4485c2f767da.png)\n\nNote, this will stay in backlog for now as we may want to revise this page to align with the Frog design.\n\n", "before_files": [{"content": "hdx_version = 'v0.5.13'\n", "path": "ckanext-hdx_theme/ckanext/hdx_theme/version.py"}], "after_files": [{"content": "hdx_version = 'v0.5.15'\n", "path": "ckanext-hdx_theme/ckanext/hdx_theme/version.py"}]}
gh_patches_debug_5
rasdani/github-patches
git_diff
sql-machine-learning__elasticdl-1463
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- No module named 'elasticdl.python.elasticdl.layers' on master ``` Traceback (most recent call last): File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/elasticdl/python/master/main.py", line 28, in <module> from elasticdl.python.elasticdl.layers.embedding import Embedding ModuleNotFoundError: No module named 'elasticdl.python.elasticdl.layers' ``` Seems `layers` directory is not installed to `/usr/local/lib/python3.7/site-packages/elasticdl-develop-py3.7.egg/elasticdl/python/elasticdl` after running `python setup.py install` Steps to reproduce: 1. In a Python Docker container, clone ElasticDL and run `python setup.py install` 1. remove the cloned source 1. execute a demo job by: `elasticdl train ...` --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `elasticdl/python/elasticdl/__init__.py` Content: ``` ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/elasticdl/python/elasticdl/__init__.py b/elasticdl/python/elasticdl/__init__.py --- a/elasticdl/python/elasticdl/__init__.py +++ b/elasticdl/python/elasticdl/__init__.py @@ -0,0 +1 @@ +from elasticdl.python.elasticdl import layers # noqa: F401
{"golden_diff": "diff --git a/elasticdl/python/elasticdl/__init__.py b/elasticdl/python/elasticdl/__init__.py\n--- a/elasticdl/python/elasticdl/__init__.py\n+++ b/elasticdl/python/elasticdl/__init__.py\n@@ -0,0 +1 @@\n+from elasticdl.python.elasticdl import layers # noqa: F401\n", "issue": "No module named 'elasticdl.python.elasticdl.layers' on master\n```\r\nTraceback (most recent call last):\r\n File \"/usr/local/lib/python3.7/runpy.py\", line 193, in _run_module_as_main\r\n \"__main__\", mod_spec)\r\n File \"/usr/local/lib/python3.7/runpy.py\", line 85, in _run_code\r\n exec(code, run_globals)\r\n File \"/elasticdl/python/master/main.py\", line 28, in <module>\r\n from elasticdl.python.elasticdl.layers.embedding import Embedding\r\nModuleNotFoundError: No module named 'elasticdl.python.elasticdl.layers'\r\n```\r\n\r\nSeems `layers` directory is not installed to `/usr/local/lib/python3.7/site-packages/elasticdl-develop-py3.7.egg/elasticdl/python/elasticdl` after running `python setup.py install`\r\n\r\nSteps to reproduce:\r\n\r\n1. In a Python Docker container, clone ElasticDL and run `python setup.py install`\r\n1. remove the cloned source\r\n1. execute a demo job by: `elasticdl train ...`\n", "before_files": [{"content": "", "path": "elasticdl/python/elasticdl/__init__.py"}], "after_files": [{"content": "from elasticdl.python.elasticdl import layers # noqa: F401\n", "path": "elasticdl/python/elasticdl/__init__.py"}]}
gh_patches_debug_6
rasdani/github-patches
git_diff
codespell-project__codespell-2626
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- `python setup.py check` → `twine check` Because `setup.py ...` is deprecated, we need an alternative to `setup.py check` such as `twine`. --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `setup.py` Content: ``` 1 #! /usr/bin/env python 2 3 from setuptools import setup 4 5 if __name__ == "__main__": 6 setup() 7 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/setup.py b/setup.py deleted file mode 100755 --- a/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -#! /usr/bin/env python - -from setuptools import setup - -if __name__ == "__main__": - setup()
{"golden_diff": "diff --git a/setup.py b/setup.py\ndeleted file mode 100755\n--- a/setup.py\n+++ /dev/null\n@@ -1,6 +0,0 @@\n-#! /usr/bin/env python\n-\n-from setuptools import setup\n-\n-if __name__ == \"__main__\":\n- setup()\n", "issue": "`python setup.py check` \u2192 `twine check`\nBecause `setup.py ...` is deprecated, we need an alternative to `setup.py check` such as `twine`.\n", "before_files": [{"content": "#! /usr/bin/env python\n\nfrom setuptools import setup\n\nif __name__ == \"__main__\":\n setup()\n", "path": "setup.py"}], "after_files": [{"content": null, "path": "setup.py"}]}
gh_patches_debug_7
rasdani/github-patches
git_diff
django__channels-1860
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Current version on Pypi is incompatible with Django 4.0+ The current version available on Pypi, channels-3.0.4 still use the providing_args keyword for signals. Since this keyword has been removed from Django 4.0+ (December 2021), you cannot use channels with an up-to-date Django. Is a version 3.0.5 planned for Pypi? --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `channels/__init__.py` Content: ``` 1 __version__ = "3.0.4" 2 3 try: 4 import django 5 6 if django.VERSION < (3, 2): 7 default_app_config = "channels.apps.ChannelsConfig" 8 except ModuleNotFoundError: 9 pass 10 11 DEFAULT_CHANNEL_LAYER = "default" 12 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/channels/__init__.py b/channels/__init__.py --- a/channels/__init__.py +++ b/channels/__init__.py @@ -1,4 +1,4 @@ -__version__ = "3.0.4" +__version__ = "3.0.5" try: import django
{"golden_diff": "diff --git a/channels/__init__.py b/channels/__init__.py\n--- a/channels/__init__.py\n+++ b/channels/__init__.py\n@@ -1,4 +1,4 @@\n-__version__ = \"3.0.4\"\n+__version__ = \"3.0.5\"\n \n try:\n import django\n", "issue": "Current version on Pypi is incompatible with Django 4.0+\nThe current version available on Pypi, channels-3.0.4 still use the providing_args keyword for signals.\r\nSince this keyword has been removed from Django 4.0+ (December 2021), you cannot use channels with an up-to-date Django.\r\n\r\nIs a version 3.0.5 planned for Pypi? \n", "before_files": [{"content": "__version__ = \"3.0.4\"\n\ntry:\n import django\n\n if django.VERSION < (3, 2):\n default_app_config = \"channels.apps.ChannelsConfig\"\nexcept ModuleNotFoundError:\n pass\n\nDEFAULT_CHANNEL_LAYER = \"default\"\n", "path": "channels/__init__.py"}], "after_files": [{"content": "__version__ = \"3.0.5\"\n\ntry:\n import django\n\n if django.VERSION < (3, 2):\n default_app_config = \"channels.apps.ChannelsConfig\"\nexcept ModuleNotFoundError:\n pass\n\nDEFAULT_CHANNEL_LAYER = \"default\"\n", "path": "channels/__init__.py"}]}
gh_patches_debug_8
rasdani/github-patches
git_diff
MongoEngine__mongoengine-2224
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- New release Hi, When is coming new release, because I can't update to mongodb 4.2 because of this: https://github.com/MongoEngine/mongoengine/pull/2160/commits/47f8a126ca167cb8fe020e3cc5604b155dfcdebc. Thanks --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `mongoengine/__init__.py` Content: ``` 1 # Import submodules so that we can expose their __all__ 2 from mongoengine import connection 3 from mongoengine import document 4 from mongoengine import errors 5 from mongoengine import fields 6 from mongoengine import queryset 7 from mongoengine import signals 8 9 # Import everything from each submodule so that it can be accessed via 10 # mongoengine, e.g. instead of `from mongoengine.connection import connect`, 11 # users can simply use `from mongoengine import connect`, or even 12 # `from mongoengine import *` and then `connect('testdb')`. 13 from mongoengine.connection import * 14 from mongoengine.document import * 15 from mongoengine.errors import * 16 from mongoengine.fields import * 17 from mongoengine.queryset import * 18 from mongoengine.signals import * 19 20 21 __all__ = ( 22 list(document.__all__) 23 + list(fields.__all__) 24 + list(connection.__all__) 25 + list(queryset.__all__) 26 + list(signals.__all__) 27 + list(errors.__all__) 28 ) 29 30 31 VERSION = (0, 18, 2) 32 33 34 def get_version(): 35 """Return the VERSION as a string. 36 37 For example, if `VERSION == (0, 10, 7)`, return '0.10.7'. 38 """ 39 return ".".join(map(str, VERSION)) 40 41 42 __version__ = get_version() 43 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/mongoengine/__init__.py b/mongoengine/__init__.py --- a/mongoengine/__init__.py +++ b/mongoengine/__init__.py @@ -28,7 +28,7 @@ ) -VERSION = (0, 18, 2) +VERSION = (0, 19, 0) def get_version():
{"golden_diff": "diff --git a/mongoengine/__init__.py b/mongoengine/__init__.py\n--- a/mongoengine/__init__.py\n+++ b/mongoengine/__init__.py\n@@ -28,7 +28,7 @@\n )\n \n \n-VERSION = (0, 18, 2)\n+VERSION = (0, 19, 0)\n \n \n def get_version():\n", "issue": "New release\nHi,\r\n\r\nWhen is coming new release, because I can't update to mongodb 4.2 because of this: https://github.com/MongoEngine/mongoengine/pull/2160/commits/47f8a126ca167cb8fe020e3cc5604b155dfcdebc.\r\n\r\nThanks\n", "before_files": [{"content": "# Import submodules so that we can expose their __all__\nfrom mongoengine import connection\nfrom mongoengine import document\nfrom mongoengine import errors\nfrom mongoengine import fields\nfrom mongoengine import queryset\nfrom mongoengine import signals\n\n# Import everything from each submodule so that it can be accessed via\n# mongoengine, e.g. instead of `from mongoengine.connection import connect`,\n# users can simply use `from mongoengine import connect`, or even\n# `from mongoengine import *` and then `connect('testdb')`.\nfrom mongoengine.connection import *\nfrom mongoengine.document import *\nfrom mongoengine.errors import *\nfrom mongoengine.fields import *\nfrom mongoengine.queryset import *\nfrom mongoengine.signals import *\n\n\n__all__ = (\n list(document.__all__)\n + list(fields.__all__)\n + list(connection.__all__)\n + list(queryset.__all__)\n + list(signals.__all__)\n + list(errors.__all__)\n)\n\n\nVERSION = (0, 18, 2)\n\n\ndef get_version():\n \"\"\"Return the VERSION as a string.\n\n For example, if `VERSION == (0, 10, 7)`, return '0.10.7'.\n \"\"\"\n return \".\".join(map(str, VERSION))\n\n\n__version__ = get_version()\n", "path": "mongoengine/__init__.py"}], "after_files": [{"content": "# Import submodules so that we can expose their __all__\nfrom mongoengine import connection\nfrom mongoengine import document\nfrom mongoengine import errors\nfrom mongoengine import fields\nfrom mongoengine import queryset\nfrom mongoengine import signals\n\n# Import everything from each submodule so that it can be accessed via\n# mongoengine, e.g. instead of `from mongoengine.connection import connect`,\n# users can simply use `from mongoengine import connect`, or even\n# `from mongoengine import *` and then `connect('testdb')`.\nfrom mongoengine.connection import *\nfrom mongoengine.document import *\nfrom mongoengine.errors import *\nfrom mongoengine.fields import *\nfrom mongoengine.queryset import *\nfrom mongoengine.signals import *\n\n\n__all__ = (\n list(document.__all__)\n + list(fields.__all__)\n + list(connection.__all__)\n + list(queryset.__all__)\n + list(signals.__all__)\n + list(errors.__all__)\n)\n\n\nVERSION = (0, 19, 0)\n\n\ndef get_version():\n \"\"\"Return the VERSION as a string.\n\n For example, if `VERSION == (0, 10, 7)`, return '0.10.7'.\n \"\"\"\n return \".\".join(map(str, VERSION))\n\n\n__version__ = get_version()\n", "path": "mongoengine/__init__.py"}]}
gh_patches_debug_9
rasdani/github-patches
git_diff
scikit-image__scikit-image-6307
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Undefined names in Python code found with flake8 ## Description ## Way to reproduce [flake8](http://flake8.pycqa.org) testing of https://github.com/scikit-image/scikit-image on Python 3.7.1 $ __flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics__ ``` ./skimage/measure/mc_meta/createluts.py:139:18: F821 undefined name 'luts' for a in dir(luts): ^ ./doc/ext/notebook_doc.py:1:1: F822 undefined name 'python_to_notebook' in __all__ __all__ = ['python_to_notebook', 'Notebook'] ^ 1 F821 undefined name 'luts' 1 F822 undefined name 'python_to_notebook' in __all__ 2 ``` __E901,E999,F821,F822,F823__ are the "_showstopper_" [flake8](http://flake8.pycqa.org) issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety. * F821: undefined name `name` * F822: undefined name `name` in `__all__` * F823: local variable name referenced before assignment * E901: SyntaxError or IndentationError * E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `doc/ext/notebook_doc.py` Content: ``` 1 __all__ = ['python_to_notebook', 'Notebook'] 2 3 import json 4 import copy 5 import warnings 6 7 8 # Skeleton notebook in JSON format 9 skeleton_nb = """{ 10 "metadata": { 11 "name":"" 12 }, 13 "nbformat": 3, 14 "nbformat_minor": 0, 15 "worksheets": [ 16 { 17 "cells": [ 18 { 19 "cell_type": "code", 20 "collapsed": false, 21 "input": [ 22 "%matplotlib inline" 23 ], 24 "language": "python", 25 "metadata": {}, 26 "outputs": [] 27 } 28 ], 29 "metadata": {} 30 } 31 ] 32 }""" 33 34 35 class Notebook(object): 36 """ 37 Notebook object for building an IPython notebook cell-by-cell. 38 """ 39 40 def __init__(self): 41 # cell type code 42 self.cell_code = { 43 'cell_type': 'code', 44 'collapsed': False, 45 'input': [ 46 '# Code Goes Here' 47 ], 48 'language': 'python', 49 'metadata': {}, 50 'outputs': [] 51 } 52 53 # cell type markdown 54 self.cell_md = { 55 'cell_type': 'markdown', 56 'metadata': {}, 57 'source': [ 58 'Markdown Goes Here' 59 ] 60 } 61 62 self.template = json.loads(skeleton_nb) 63 self.cell_type = {'input': self.cell_code, 'source': self.cell_md} 64 self.valuetype_to_celltype = {'code': 'input', 'markdown': 'source'} 65 66 def add_cell(self, value, cell_type='code'): 67 """Add a notebook cell. 68 69 Parameters 70 ---------- 71 value : str 72 Cell content. 73 cell_type : {'code', 'markdown'} 74 Type of content (default is 'code'). 75 76 """ 77 if cell_type in ['markdown', 'code']: 78 key = self.valuetype_to_celltype[cell_type] 79 cells = self.template['worksheets'][0]['cells'] 80 cells.append(copy.deepcopy(self.cell_type[key])) 81 # assign value to the last cell 82 cells[-1][key] = value 83 else: 84 warnings.warn('Ignoring unsupported cell type (%s)' % cell_type) 85 86 def json(self): 87 """Return a JSON representation of the notebook. 88 89 Returns 90 ------- 91 str 92 JSON notebook. 93 94 """ 95 return json.dumps(self.template, indent=2) 96 97 98 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/doc/ext/notebook_doc.py b/doc/ext/notebook_doc.py --- a/doc/ext/notebook_doc.py +++ b/doc/ext/notebook_doc.py @@ -1,4 +1,4 @@ -__all__ = ['python_to_notebook', 'Notebook'] +__all__ = ['Notebook'] import json import copy
{"golden_diff": "diff --git a/doc/ext/notebook_doc.py b/doc/ext/notebook_doc.py\n--- a/doc/ext/notebook_doc.py\n+++ b/doc/ext/notebook_doc.py\n@@ -1,4 +1,4 @@\n-__all__ = ['python_to_notebook', 'Notebook']\n+__all__ = ['Notebook']\n \n import json\n import copy\n", "issue": "Undefined names in Python code found with flake8\n## Description\r\n\r\n\r\n## Way to reproduce\r\n[flake8](http://flake8.pycqa.org) testing of https://github.com/scikit-image/scikit-image on Python 3.7.1\r\n\r\n$ __flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics__\r\n```\r\n./skimage/measure/mc_meta/createluts.py:139:18: F821 undefined name 'luts'\r\n for a in dir(luts):\r\n ^\r\n./doc/ext/notebook_doc.py:1:1: F822 undefined name 'python_to_notebook' in __all__\r\n__all__ = ['python_to_notebook', 'Notebook']\r\n^\r\n1 F821 undefined name 'luts'\r\n1 F822 undefined name 'python_to_notebook' in __all__\r\n2\r\n```\r\n__E901,E999,F821,F822,F823__ are the \"_showstopper_\" [flake8](http://flake8.pycqa.org) issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely \"style violations\" -- useful for readability but they do not effect runtime safety.\r\n* F821: undefined name `name`\r\n* F822: undefined name `name` in `__all__`\r\n* F823: local variable name referenced before assignment\r\n* E901: SyntaxError or IndentationError\r\n* E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree\r\n\n", "before_files": [{"content": "__all__ = ['python_to_notebook', 'Notebook']\n\nimport json\nimport copy\nimport warnings\n\n\n# Skeleton notebook in JSON format\nskeleton_nb = \"\"\"{\n \"metadata\": {\n \"name\":\"\"\n },\n \"nbformat\": 3,\n \"nbformat_minor\": 0,\n \"worksheets\": [\n {\n \"cells\": [\n {\n \"cell_type\": \"code\",\n \"collapsed\": false,\n \"input\": [\n \"%matplotlib inline\"\n ],\n \"language\": \"python\",\n \"metadata\": {},\n \"outputs\": []\n }\n ],\n \"metadata\": {}\n }\n ]\n}\"\"\"\n\n\nclass Notebook(object):\n \"\"\"\n Notebook object for building an IPython notebook cell-by-cell.\n \"\"\"\n\n def __init__(self):\n # cell type code\n self.cell_code = {\n 'cell_type': 'code',\n 'collapsed': False,\n 'input': [\n '# Code Goes Here'\n ],\n 'language': 'python',\n 'metadata': {},\n 'outputs': []\n }\n\n # cell type markdown\n self.cell_md = {\n 'cell_type': 'markdown',\n 'metadata': {},\n 'source': [\n 'Markdown Goes Here'\n ]\n }\n\n self.template = json.loads(skeleton_nb)\n self.cell_type = {'input': self.cell_code, 'source': self.cell_md}\n self.valuetype_to_celltype = {'code': 'input', 'markdown': 'source'}\n\n def add_cell(self, value, cell_type='code'):\n \"\"\"Add a notebook cell.\n\n Parameters\n ----------\n value : str\n Cell content.\n cell_type : {'code', 'markdown'}\n Type of content (default is 'code').\n\n \"\"\"\n if cell_type in ['markdown', 'code']:\n key = self.valuetype_to_celltype[cell_type]\n cells = self.template['worksheets'][0]['cells']\n cells.append(copy.deepcopy(self.cell_type[key]))\n # assign value to the last cell\n cells[-1][key] = value\n else:\n warnings.warn('Ignoring unsupported cell type (%s)' % cell_type)\n\n def json(self):\n \"\"\"Return a JSON representation of the notebook.\n\n Returns\n -------\n str\n JSON notebook.\n\n \"\"\"\n return json.dumps(self.template, indent=2)\n\n\n", "path": "doc/ext/notebook_doc.py"}], "after_files": [{"content": "__all__ = ['Notebook']\n\nimport json\nimport copy\nimport warnings\n\n\n# Skeleton notebook in JSON format\nskeleton_nb = \"\"\"{\n \"metadata\": {\n \"name\":\"\"\n },\n \"nbformat\": 3,\n \"nbformat_minor\": 0,\n \"worksheets\": [\n {\n \"cells\": [\n {\n \"cell_type\": \"code\",\n \"collapsed\": false,\n \"input\": [\n \"%matplotlib inline\"\n ],\n \"language\": \"python\",\n \"metadata\": {},\n \"outputs\": []\n }\n ],\n \"metadata\": {}\n }\n ]\n}\"\"\"\n\n\nclass Notebook(object):\n \"\"\"\n Notebook object for building an IPython notebook cell-by-cell.\n \"\"\"\n\n def __init__(self):\n # cell type code\n self.cell_code = {\n 'cell_type': 'code',\n 'collapsed': False,\n 'input': [\n '# Code Goes Here'\n ],\n 'language': 'python',\n 'metadata': {},\n 'outputs': []\n }\n\n # cell type markdown\n self.cell_md = {\n 'cell_type': 'markdown',\n 'metadata': {},\n 'source': [\n 'Markdown Goes Here'\n ]\n }\n\n self.template = json.loads(skeleton_nb)\n self.cell_type = {'input': self.cell_code, 'source': self.cell_md}\n self.valuetype_to_celltype = {'code': 'input', 'markdown': 'source'}\n\n def add_cell(self, value, cell_type='code'):\n \"\"\"Add a notebook cell.\n\n Parameters\n ----------\n value : str\n Cell content.\n cell_type : {'code', 'markdown'}\n Type of content (default is 'code').\n\n \"\"\"\n if cell_type in ['markdown', 'code']:\n key = self.valuetype_to_celltype[cell_type]\n cells = self.template['worksheets'][0]['cells']\n cells.append(copy.deepcopy(self.cell_type[key]))\n # assign value to the last cell\n cells[-1][key] = value\n else:\n warnings.warn('Ignoring unsupported cell type (%s)' % cell_type)\n\n def json(self):\n \"\"\"Return a JSON representation of the notebook.\n\n Returns\n -------\n str\n JSON notebook.\n\n \"\"\"\n return json.dumps(self.template, indent=2)\n\n\n", "path": "doc/ext/notebook_doc.py"}]}
gh_patches_debug_10
rasdani/github-patches
git_diff
RedHatInsights__insights-core-1452
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Run Flake8 lint on RHEL6 Currently, flake8 is run only on RHEL7 and 8 and not on RHEL6. According to [the documentation](http://flake8.pycqa.org/en/latest/#installation) it is necessary to run flake8 with the exact Python version that is used. Thus to be sure that the syntax is ok even for the older Python version, we have to run in to RHEL6 too. Tackled in #1251. --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `setup.py` Content: ``` 1 import os 2 from setuptools import setup, find_packages 3 4 __here__ = os.path.dirname(os.path.abspath(__file__)) 5 6 package_info = dict.fromkeys(["RELEASE", "COMMIT", "VERSION", "NAME"]) 7 8 for name in package_info: 9 with open(os.path.join(__here__, "insights", name)) as f: 10 package_info[name] = f.read().strip() 11 12 entry_points = { 13 'console_scripts': [ 14 'insights-run = insights:main', 15 'insights-info = insights.tools.query:main', 16 'gen_api = insights.tools.generate_api_config:main', 17 'insights-perf = insights.tools.perf:main', 18 'client = insights.client:run', 19 'mangle = insights.util.mangle:main' 20 ] 21 } 22 23 runtime = set([ 24 'pyyaml>=3.10,<=3.13', 25 'six', 26 ]) 27 28 29 def maybe_require(pkg): 30 try: 31 __import__(pkg) 32 except ImportError: 33 runtime.add(pkg) 34 35 36 maybe_require("importlib") 37 maybe_require("argparse") 38 39 40 client = set([ 41 'requests', 42 'pyOpenSSL', 43 ]) 44 45 develop = set([ 46 'futures==3.0.5', 47 'requests==2.13.0', 48 'wheel', 49 ]) 50 51 docs = set([ 52 'Sphinx==1.7.9', 53 'nbsphinx==0.3.1', 54 'sphinx_rtd_theme', 55 'ipython<6', 56 'colorama', 57 ]) 58 59 testing = set([ 60 'coverage==4.3.4', 61 'pytest==3.0.6', 62 'pytest-cov==2.4.0', 63 'mock==2.0.0', 64 ]) 65 66 linting = set([ 67 'flake8==3.3.0', 68 ]) 69 70 optional = set([ 71 'jinja2', 72 'python-cjson', 73 'python-logstash', 74 'python-statsd', 75 'watchdog', 76 ]) 77 78 if __name__ == "__main__": 79 # allows for runtime modification of rpm name 80 name = os.environ.get("INSIGHTS_CORE_NAME", package_info["NAME"]) 81 82 setup( 83 name=name, 84 version=package_info["VERSION"], 85 description="Insights Core is a data collection and analysis framework", 86 long_description=open("README.rst").read(), 87 url="https://github.com/redhatinsights/insights-core", 88 author="Red Hat, Inc.", 89 author_email="[email protected]", 90 packages=find_packages(), 91 install_requires=list(runtime), 92 package_data={'': ['LICENSE']}, 93 license='Apache 2.0', 94 extras_require={ 95 'develop': list(runtime | develop | client | docs | linting | testing), 96 'client': list(runtime | client), 97 'optional': list(optional), 98 'docs': list(docs), 99 'linting': list(linting | client), 100 'testing': list(testing | client) 101 }, 102 classifiers=[ 103 'Development Status :: 5 - Production/Stable', 104 'Intended Audience :: Developers', 105 'Natural Language :: English', 106 'License :: OSI Approved :: Apache Software License', 107 'Programming Language :: Python', 108 'Programming Language :: Python :: 2.6', 109 'Programming Language :: Python :: 2.7', 110 'Programming Language :: Python :: 3.3', 111 'Programming Language :: Python :: 3.4', 112 'Programming Language :: Python :: 3.5', 113 'Programming Language :: Python :: 3.6' 114 ], 115 entry_points=entry_points, 116 include_package_data=True 117 ) 118 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -64,7 +64,7 @@ ]) linting = set([ - 'flake8==3.3.0', + 'flake8==2.6.2', ]) optional = set([
{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -64,7 +64,7 @@\n ])\n \n linting = set([\n- 'flake8==3.3.0',\n+ 'flake8==2.6.2',\n ])\n \n optional = set([\n", "issue": "Run Flake8 lint on RHEL6\nCurrently, flake8 is run only on RHEL7 and 8 and not on RHEL6. According to [the documentation](http://flake8.pycqa.org/en/latest/#installation) it is necessary to run flake8 with the exact Python version that is used. Thus to be sure that the syntax is ok even for the older Python version, we have to run in to RHEL6 too.\r\n\r\nTackled in #1251.\n", "before_files": [{"content": "import os\nfrom setuptools import setup, find_packages\n\n__here__ = os.path.dirname(os.path.abspath(__file__))\n\npackage_info = dict.fromkeys([\"RELEASE\", \"COMMIT\", \"VERSION\", \"NAME\"])\n\nfor name in package_info:\n with open(os.path.join(__here__, \"insights\", name)) as f:\n package_info[name] = f.read().strip()\n\nentry_points = {\n 'console_scripts': [\n 'insights-run = insights:main',\n 'insights-info = insights.tools.query:main',\n 'gen_api = insights.tools.generate_api_config:main',\n 'insights-perf = insights.tools.perf:main',\n 'client = insights.client:run',\n 'mangle = insights.util.mangle:main'\n ]\n}\n\nruntime = set([\n 'pyyaml>=3.10,<=3.13',\n 'six',\n])\n\n\ndef maybe_require(pkg):\n try:\n __import__(pkg)\n except ImportError:\n runtime.add(pkg)\n\n\nmaybe_require(\"importlib\")\nmaybe_require(\"argparse\")\n\n\nclient = set([\n 'requests',\n 'pyOpenSSL',\n])\n\ndevelop = set([\n 'futures==3.0.5',\n 'requests==2.13.0',\n 'wheel',\n])\n\ndocs = set([\n 'Sphinx==1.7.9',\n 'nbsphinx==0.3.1',\n 'sphinx_rtd_theme',\n 'ipython<6',\n 'colorama',\n])\n\ntesting = set([\n 'coverage==4.3.4',\n 'pytest==3.0.6',\n 'pytest-cov==2.4.0',\n 'mock==2.0.0',\n])\n\nlinting = set([\n 'flake8==3.3.0',\n])\n\noptional = set([\n 'jinja2',\n 'python-cjson',\n 'python-logstash',\n 'python-statsd',\n 'watchdog',\n])\n\nif __name__ == \"__main__\":\n # allows for runtime modification of rpm name\n name = os.environ.get(\"INSIGHTS_CORE_NAME\", package_info[\"NAME\"])\n\n setup(\n name=name,\n version=package_info[\"VERSION\"],\n description=\"Insights Core is a data collection and analysis framework\",\n long_description=open(\"README.rst\").read(),\n url=\"https://github.com/redhatinsights/insights-core\",\n author=\"Red Hat, Inc.\",\n author_email=\"[email protected]\",\n packages=find_packages(),\n install_requires=list(runtime),\n package_data={'': ['LICENSE']},\n license='Apache 2.0',\n extras_require={\n 'develop': list(runtime | develop | client | docs | linting | testing),\n 'client': list(runtime | client),\n 'optional': list(optional),\n 'docs': list(docs),\n 'linting': list(linting | client),\n 'testing': list(testing | client)\n },\n classifiers=[\n 'Development Status :: 5 - Production/Stable',\n 'Intended Audience :: Developers',\n 'Natural Language :: English',\n 'License :: OSI Approved :: Apache Software License',\n 'Programming Language :: Python',\n 'Programming Language :: Python :: 2.6',\n 'Programming Language :: Python :: 2.7',\n 'Programming Language :: Python :: 3.3',\n 'Programming Language :: Python :: 3.4',\n 'Programming Language :: Python :: 3.5',\n 'Programming Language :: Python :: 3.6'\n ],\n entry_points=entry_points,\n include_package_data=True\n )\n", "path": "setup.py"}], "after_files": [{"content": "import os\nfrom setuptools import setup, find_packages\n\n__here__ = os.path.dirname(os.path.abspath(__file__))\n\npackage_info = dict.fromkeys([\"RELEASE\", \"COMMIT\", \"VERSION\", \"NAME\"])\n\nfor name in package_info:\n with open(os.path.join(__here__, \"insights\", name)) as f:\n package_info[name] = f.read().strip()\n\nentry_points = {\n 'console_scripts': [\n 'insights-run = insights:main',\n 'insights-info = insights.tools.query:main',\n 'gen_api = insights.tools.generate_api_config:main',\n 'insights-perf = insights.tools.perf:main',\n 'client = insights.client:run',\n 'mangle = insights.util.mangle:main'\n ]\n}\n\nruntime = set([\n 'pyyaml>=3.10,<=3.13',\n 'six',\n])\n\n\ndef maybe_require(pkg):\n try:\n __import__(pkg)\n except ImportError:\n runtime.add(pkg)\n\n\nmaybe_require(\"importlib\")\nmaybe_require(\"argparse\")\n\n\nclient = set([\n 'requests',\n 'pyOpenSSL',\n])\n\ndevelop = set([\n 'futures==3.0.5',\n 'requests==2.13.0',\n 'wheel',\n])\n\ndocs = set([\n 'Sphinx==1.7.9',\n 'nbsphinx==0.3.1',\n 'sphinx_rtd_theme',\n 'ipython<6',\n 'colorama',\n])\n\ntesting = set([\n 'coverage==4.3.4',\n 'pytest==3.0.6',\n 'pytest-cov==2.4.0',\n 'mock==2.0.0',\n])\n\nlinting = set([\n 'flake8==2.6.2',\n])\n\noptional = set([\n 'jinja2',\n 'python-cjson',\n 'python-logstash',\n 'python-statsd',\n 'watchdog',\n])\n\nif __name__ == \"__main__\":\n # allows for runtime modification of rpm name\n name = os.environ.get(\"INSIGHTS_CORE_NAME\", package_info[\"NAME\"])\n\n setup(\n name=name,\n version=package_info[\"VERSION\"],\n description=\"Insights Core is a data collection and analysis framework\",\n long_description=open(\"README.rst\").read(),\n url=\"https://github.com/redhatinsights/insights-core\",\n author=\"Red Hat, Inc.\",\n author_email=\"[email protected]\",\n packages=find_packages(),\n install_requires=list(runtime),\n package_data={'': ['LICENSE']},\n license='Apache 2.0',\n extras_require={\n 'develop': list(runtime | develop | client | docs | linting | testing),\n 'client': list(runtime | client),\n 'optional': list(optional),\n 'docs': list(docs),\n 'linting': list(linting | client),\n 'testing': list(testing | client)\n },\n classifiers=[\n 'Development Status :: 5 - Production/Stable',\n 'Intended Audience :: Developers',\n 'Natural Language :: English',\n 'License :: OSI Approved :: Apache Software License',\n 'Programming Language :: Python',\n 'Programming Language :: Python :: 2.6',\n 'Programming Language :: Python :: 2.7',\n 'Programming Language :: Python :: 3.3',\n 'Programming Language :: Python :: 3.4',\n 'Programming Language :: Python :: 3.5',\n 'Programming Language :: Python :: 3.6'\n ],\n entry_points=entry_points,\n include_package_data=True\n )\n", "path": "setup.py"}]}
gh_patches_debug_11
rasdani/github-patches
git_diff
openstates__openstates-scrapers-2289
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- InsecureRequestWarning log spam Scrape logs for https sites are spammed with this INFO-level message on every HTTPS request: ``` /opt/openstates/venv-pupa/lib/python3.5/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings ``` I'm looking for advice about what should be done. My inclination is to quell the warnings altogether, because I _suspect_ that stale state certs are frequent enough to not want to bother with verification. I believe (but have not tested) that this can be done in openstates with ```py import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) ``` If we want to verify certs, it probably requires changes somewhere up the stack. --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `openstates/__init__.py` Content: ``` ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/openstates/__init__.py b/openstates/__init__.py --- a/openstates/__init__.py +++ b/openstates/__init__.py @@ -0,0 +1,4 @@ +import urllib3 + +# Quell InsecureRequestWarning: Unverified HTTPS request warnings +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
{"golden_diff": "diff --git a/openstates/__init__.py b/openstates/__init__.py\n--- a/openstates/__init__.py\n+++ b/openstates/__init__.py\n@@ -0,0 +1,4 @@\n+import urllib3\n+\n+# Quell InsecureRequestWarning: Unverified HTTPS request warnings\n+urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n", "issue": "InsecureRequestWarning log spam\nScrape logs for https sites are spammed with this INFO-level message on every HTTPS request:\r\n```\r\n/opt/openstates/venv-pupa/lib/python3.5/site-packages/urllib3/connectionpool.py:858: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings\r\n```\r\n\r\nI'm looking for advice about what should be done. My inclination is to quell the warnings altogether, because I _suspect_ that stale state certs are frequent enough to not want to bother with verification. I believe (but have not tested) that this can be done in openstates with\r\n\r\n```py\r\nimport urllib3\r\nurllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\r\n```\r\n\r\nIf we want to verify certs, it probably requires changes somewhere up the stack.\r\n\n", "before_files": [{"content": "", "path": "openstates/__init__.py"}], "after_files": [{"content": "import urllib3\n\n# Quell InsecureRequestWarning: Unverified HTTPS request warnings\nurllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n", "path": "openstates/__init__.py"}]}
gh_patches_debug_12
rasdani/github-patches
git_diff
jazzband__django-oauth-toolkit-1126
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- fix(tasks): fix error caused by relative import ## Description of the Change Running `oauth2_provider.tasks.clear_tokens` results in an error e.g.: ```python >>> from oauth2_provider.tasks import clear_tokens >>> clear_tokens() Traceback (most recent call last): File "[python3.9]/code.py", line 90, in runcode exec(code, self.locals) File "<console>", line 1, in <module> File "[site-packages]/celery/local.py", line 188, in __call__ return self._get_current_object()(*a, **kw) File "[site-packages]/celery/app/task.py", line 392, in __call__ return self.run(*args, **kwargs) File "[site-packages]/oauth2_provider/tasks.py", line 6, in clear_tokens from ...models import clear_expired # noqa ImportError: attempted relative import beyond top-level package ``` This update fixes the import path. ## Checklist <!-- Replace '[ ]' with '[x]' to indicate that the checklist item is completed. --> <!-- You can check the boxes now or later by just clicking on them. --> - [x] PR only contains one change (considered splitting up PR) - [ ] unit-test added - [ ] documentation updated - [ ] `CHANGELOG.md` updated (only for user relevant changes) - [ ] author name in `AUTHORS` --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `oauth2_provider/tasks.py` Content: ``` 1 from celery import shared_task 2 3 4 @shared_task 5 def clear_tokens(): 6 from ...models import clear_expired # noqa 7 8 clear_expired() 9 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/oauth2_provider/tasks.py b/oauth2_provider/tasks.py deleted file mode 100644 --- a/oauth2_provider/tasks.py +++ /dev/null @@ -1,8 +0,0 @@ -from celery import shared_task - - -@shared_task -def clear_tokens(): - from ...models import clear_expired # noqa - - clear_expired()
{"golden_diff": "diff --git a/oauth2_provider/tasks.py b/oauth2_provider/tasks.py\ndeleted file mode 100644\n--- a/oauth2_provider/tasks.py\n+++ /dev/null\n@@ -1,8 +0,0 @@\n-from celery import shared_task\n-\n-\n-@shared_task\n-def clear_tokens():\n- from ...models import clear_expired # noqa\n-\n- clear_expired()\n", "issue": "fix(tasks): fix error caused by relative import\n## Description of the Change\r\n\r\nRunning `oauth2_provider.tasks.clear_tokens` results in an error e.g.:\r\n```python\r\n>>> from oauth2_provider.tasks import clear_tokens\r\n>>> clear_tokens()\r\nTraceback (most recent call last):\r\n File \"[python3.9]/code.py\", line 90, in runcode\r\n exec(code, self.locals)\r\n File \"<console>\", line 1, in <module>\r\n File \"[site-packages]/celery/local.py\", line 188, in __call__\r\n return self._get_current_object()(*a, **kw)\r\n File \"[site-packages]/celery/app/task.py\", line 392, in __call__\r\n return self.run(*args, **kwargs)\r\n File \"[site-packages]/oauth2_provider/tasks.py\", line 6, in clear_tokens\r\n from ...models import clear_expired # noqa\r\nImportError: attempted relative import beyond top-level package\r\n```\r\n\r\nThis update fixes the import path.\r\n\r\n## Checklist\r\n\r\n<!-- Replace '[ ]' with '[x]' to indicate that the checklist item is completed. -->\r\n<!-- You can check the boxes now or later by just clicking on them. -->\r\n\r\n- [x] PR only contains one change (considered splitting up PR)\r\n- [ ] unit-test added\r\n- [ ] documentation updated\r\n- [ ] `CHANGELOG.md` updated (only for user relevant changes)\r\n- [ ] author name in `AUTHORS`\r\n\n", "before_files": [{"content": "from celery import shared_task\n\n\n@shared_task\ndef clear_tokens():\n from ...models import clear_expired # noqa\n\n clear_expired()\n", "path": "oauth2_provider/tasks.py"}], "after_files": [{"content": null, "path": "oauth2_provider/tasks.py"}]}
gh_patches_debug_13
rasdani/github-patches
git_diff
mathesar-foundation__mathesar-3190
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Release 0.1.3 ## 2023-08-16 ```[tasklist] ### Tasks - [x] Cut 0.1.3 release branch, freeze code - [x] Update version number in all places in the new branch - [x] Make an image from the branch with tag `0.1.3`, push to Dockerhub - [x] Test installation with the new image - [x] Test upgrade - [x] Smoke testing application - [x] Stability of the newly released items ``` --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `mathesar/__init__.py` Content: ``` 1 default_app_config = 'mathesar.apps.MathesarConfig' 2 3 __version__ = "0.1.2" 4 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/mathesar/__init__.py b/mathesar/__init__.py --- a/mathesar/__init__.py +++ b/mathesar/__init__.py @@ -1,3 +1,3 @@ default_app_config = 'mathesar.apps.MathesarConfig' -__version__ = "0.1.2" +__version__ = "0.1.3"
{"golden_diff": "diff --git a/mathesar/__init__.py b/mathesar/__init__.py\n--- a/mathesar/__init__.py\n+++ b/mathesar/__init__.py\n@@ -1,3 +1,3 @@\n default_app_config = 'mathesar.apps.MathesarConfig'\n \n-__version__ = \"0.1.2\"\n+__version__ = \"0.1.3\"\n", "issue": "Release 0.1.3\n## 2023-08-16\r\n```[tasklist]\r\n### Tasks\r\n- [x] Cut 0.1.3 release branch, freeze code\r\n- [x] Update version number in all places in the new branch\r\n- [x] Make an image from the branch with tag `0.1.3`, push to Dockerhub\r\n- [x] Test installation with the new image\r\n- [x] Test upgrade\r\n- [x] Smoke testing application\r\n- [x] Stability of the newly released items\r\n```\r\n\n", "before_files": [{"content": "default_app_config = 'mathesar.apps.MathesarConfig'\n\n__version__ = \"0.1.2\"\n", "path": "mathesar/__init__.py"}], "after_files": [{"content": "default_app_config = 'mathesar.apps.MathesarConfig'\n\n__version__ = \"0.1.3\"\n", "path": "mathesar/__init__.py"}]}
gh_patches_debug_14
rasdani/github-patches
git_diff
magenta__magenta-1079
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Error in running Onsets and Frames Colab Notebook Hi @cghawthorne I am using your [Colab notebook](https://colab.research.google.com/notebook#fileId=/v2/external/notebooks/magenta/onsets_frames_transcription/onsets_frames_transcription.ipynb) to test your model but it stopped working a week ago. Error on the inference section: UnknownError: exceptions.AttributeError: 'module' object has no attribute 'logamplitude' [[Node: wav_to_spec = PyFunc[Tin=[DT_STRING], Tout=[DT_FLOAT], token="pyfunc_1"](transform_wav_data_op)]] [[Node: IteratorGetNext = IteratorGetNext[output_shapes=[[?], [?,?,88], [?,?,88], [?], [?], [?,?,88], [?,?,229,1]], output_types=[DT_STRING, DT_FLOAT, DT_FLOAT, DT_INT32, DT_STRING, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](Iterator)]] Thanks, Bardia --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `magenta/version.py` Content: ``` 1 # Copyright 2016 Google Inc. All Rights Reserved. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 r"""Separate file for storing the current version of Magenta. 15 16 Stored in a separate file so that setup.py can reference the version without 17 pulling in all the dependencies in __init__.py. 18 """ 19 20 __version__ = '0.3.5' 21 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/magenta/version.py b/magenta/version.py --- a/magenta/version.py +++ b/magenta/version.py @@ -17,4 +17,4 @@ pulling in all the dependencies in __init__.py. """ -__version__ = '0.3.5' +__version__ = '0.3.6'
{"golden_diff": "diff --git a/magenta/version.py b/magenta/version.py\n--- a/magenta/version.py\n+++ b/magenta/version.py\n@@ -17,4 +17,4 @@\n pulling in all the dependencies in __init__.py.\n \"\"\"\n \n-__version__ = '0.3.5'\n+__version__ = '0.3.6'\n", "issue": "Error in running Onsets and Frames Colab Notebook\nHi @cghawthorne\r\nI am using your [Colab notebook](https://colab.research.google.com/notebook#fileId=/v2/external/notebooks/magenta/onsets_frames_transcription/onsets_frames_transcription.ipynb) to test your model but it stopped working a week ago.\r\n\r\nError on the inference section:\r\nUnknownError: exceptions.AttributeError: 'module' object has no attribute 'logamplitude'\r\n\t [[Node: wav_to_spec = PyFunc[Tin=[DT_STRING], Tout=[DT_FLOAT], token=\"pyfunc_1\"](transform_wav_data_op)]]\r\n\t [[Node: IteratorGetNext = IteratorGetNext[output_shapes=[[?], [?,?,88], [?,?,88], [?], [?], [?,?,88], [?,?,229,1]], output_types=[DT_STRING, DT_FLOAT, DT_FLOAT, DT_INT32, DT_STRING, DT_FLOAT, DT_FLOAT], _device=\"/job:localhost/replica:0/task:0/device:CPU:0\"](Iterator)]]\r\n\r\nThanks,\r\nBardia\r\n\r\n\n", "before_files": [{"content": "# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nr\"\"\"Separate file for storing the current version of Magenta.\n\nStored in a separate file so that setup.py can reference the version without\npulling in all the dependencies in __init__.py.\n\"\"\"\n\n__version__ = '0.3.5'\n", "path": "magenta/version.py"}], "after_files": [{"content": "# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nr\"\"\"Separate file for storing the current version of Magenta.\n\nStored in a separate file so that setup.py can reference the version without\npulling in all the dependencies in __init__.py.\n\"\"\"\n\n__version__ = '0.3.6'\n", "path": "magenta/version.py"}]}
gh_patches_debug_15
rasdani/github-patches
git_diff
Anselmoo__spectrafit-715
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- [Feature]: Add python 3.11 support ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Missing Feature Add python 3.11 support ### Possible Solution _No response_ ### Anything else? _No response_ ### Code of Conduct - [X] I agree to follow this project's Code of Conduct --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `spectrafit/__init__.py` Content: ``` 1 """SpectraFit, fast command line tool for fitting data.""" 2 __version__ = "0.16.6" 3 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/spectrafit/__init__.py b/spectrafit/__init__.py --- a/spectrafit/__init__.py +++ b/spectrafit/__init__.py @@ -1,2 +1,2 @@ """SpectraFit, fast command line tool for fitting data.""" -__version__ = "0.16.6" +__version__ = "0.16.7"
{"golden_diff": "diff --git a/spectrafit/__init__.py b/spectrafit/__init__.py\n--- a/spectrafit/__init__.py\n+++ b/spectrafit/__init__.py\n@@ -1,2 +1,2 @@\n \"\"\"SpectraFit, fast command line tool for fitting data.\"\"\"\n-__version__ = \"0.16.6\"\n+__version__ = \"0.16.7\"\n", "issue": "[Feature]: Add python 3.11 support\n### Is there an existing issue for this?\n\n- [X] I have searched the existing issues\n\n### Current Missing Feature\n\nAdd python 3.11 support\n\n### Possible Solution\n\n_No response_\n\n### Anything else?\n\n_No response_\n\n### Code of Conduct\n\n- [X] I agree to follow this project's Code of Conduct\n", "before_files": [{"content": "\"\"\"SpectraFit, fast command line tool for fitting data.\"\"\"\n__version__ = \"0.16.6\"\n", "path": "spectrafit/__init__.py"}], "after_files": [{"content": "\"\"\"SpectraFit, fast command line tool for fitting data.\"\"\"\n__version__ = \"0.16.7\"\n", "path": "spectrafit/__init__.py"}]}
gh_patches_debug_16
rasdani/github-patches
git_diff
typeddjango__django-stubs-1429
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Bump mypy from 1.1.1 to 1.2.0 Bumps [mypy](https://github.com/python/mypy) from 1.1.1 to 1.2.0. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/python/mypy/commit/4f47dfb64dff920c237e7c8c58f8efba57cf57cf"><code>4f47dfb</code></a> Promote version to 1.2.0 and drop +dev from the version</li> <li><a href="https://github.com/python/mypy/commit/06aa182b4973ea122c9f536855a31234d75b93b9"><code>06aa182</code></a> [dataclass_transform] support implicit default for &quot;init&quot; parameter in field ...</li> <li><a href="https://github.com/python/mypy/commit/7beaec2e4a1c7891b044b45e538a472dbe86f240"><code>7beaec2</code></a> Support descriptors in dataclass transform (<a href="https://redirect.github.com/python/mypy/issues/15006">#15006</a>)</li> <li><a href="https://github.com/python/mypy/commit/a7a995a0409b623b941a1e2f882792abed45fddf"><code>a7a995a</code></a> Multiple inheritance considers callable objects as subtypes of functions (<a href="https://redirect.github.com/python/mypy/issues/14">#14</a>...</li> <li><a href="https://github.com/python/mypy/commit/7f2a5b5bf7dca35402390f2ff30c35c23b4085d4"><code>7f2a5b5</code></a> [dataclass_transform] fix deserialization for frozen_default</li> <li><a href="https://github.com/python/mypy/commit/bfa9eacedb0554e1a6fe9245dbd5ccdbbc555fae"><code>bfa9eac</code></a> [mypyc] Be stricter about function prototypes (<a href="https://redirect.github.com/python/mypy/issues/14942">#14942</a>)</li> <li><a href="https://github.com/python/mypy/commit/4e6d68322774d5f7c15d5067613fc851b4640d3e"><code>4e6d683</code></a> [mypyc] Document native floats and integers (<a href="https://redirect.github.com/python/mypy/issues/14927">#14927</a>)</li> <li><a href="https://github.com/python/mypy/commit/aa2679b6b0bbbffcb454081a81346c0a82804e52"><code>aa2679b</code></a> [mypyc] Fixes to float to int conversion (<a href="https://redirect.github.com/python/mypy/issues/14936">#14936</a>)</li> <li><a href="https://github.com/python/mypy/commit/9944d5fc6ae29a862bfab980a42a9bfae89ee5c0"><code>9944d5f</code></a> [mypyc] Support iterating over a TypedDict (<a href="https://redirect.github.com/python/mypy/issues/14747">#14747</a>)</li> <li><a href="https://github.com/python/mypy/commit/1a8ea6187474fcc5896cf4b7f47074673e07ad42"><code>1a8ea61</code></a> [mypyc] Avoid boxing/unboxing when coercing between tuple types (<a href="https://redirect.github.com/python/mypy/issues/14899">#14899</a>)</li> <li>Additional commits viewable in <a href="https://github.com/python/mypy/compare/v1.1.1...v1.2.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mypy&package-manager=pip&previous-version=1.1.1&new-version=1.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `setup.py` Content: ``` 1 import os 2 from typing import List 3 4 from setuptools import find_packages, setup 5 6 7 def find_stub_files(name: str) -> List[str]: 8 result = [] 9 for root, _dirs, files in os.walk(name): 10 for file in files: 11 if file.endswith(".pyi"): 12 if os.path.sep in root: 13 sub_root = root.split(os.path.sep, 1)[-1] 14 file = os.path.join(sub_root, file) 15 result.append(file) 16 return result 17 18 19 with open("README.md") as f: 20 readme = f.read() 21 22 dependencies = [ 23 "mypy>=0.980", 24 "django", 25 "django-stubs-ext>=0.8.0", 26 "tomli; python_version < '3.11'", 27 # Types: 28 "typing-extensions", 29 "types-pytz", 30 "types-PyYAML", 31 ] 32 33 extras_require = { 34 "compatible-mypy": ["mypy>=1.1.1,<1.2"], 35 } 36 37 setup( 38 name="django-stubs", 39 version="1.16.0", 40 description="Mypy stubs for Django", 41 long_description=readme, 42 long_description_content_type="text/markdown", 43 license="MIT", 44 url="https://github.com/typeddjango/django-stubs", 45 author="Maksim Kurnikov", 46 author_email="[email protected]", 47 maintainer="Marti Raudsepp", 48 maintainer_email="[email protected]", 49 py_modules=[], 50 python_requires=">=3.7", 51 install_requires=dependencies, 52 extras_require=extras_require, 53 packages=["django-stubs", *find_packages(exclude=["scripts"])], 54 package_data={ 55 "django-stubs": find_stub_files("django-stubs"), 56 "mypy_django_plugin": ["py.typed"], 57 }, 58 classifiers=[ 59 "License :: OSI Approved :: MIT License", 60 "Operating System :: OS Independent", 61 "Programming Language :: Python :: 3.7", 62 "Programming Language :: Python :: 3.8", 63 "Programming Language :: Python :: 3.9", 64 "Programming Language :: Python :: 3.10", 65 "Programming Language :: Python :: 3.11", 66 "Typing :: Typed", 67 "Framework :: Django", 68 "Framework :: Django :: 2.2", 69 "Framework :: Django :: 3.0", 70 "Framework :: Django :: 3.1", 71 "Framework :: Django :: 3.2", 72 "Framework :: Django :: 4.0", 73 "Framework :: Django :: 4.1", 74 ], 75 project_urls={ 76 "Release notes": "https://github.com/typeddjango/django-stubs/releases", 77 }, 78 ) 79 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ ] extras_require = { - "compatible-mypy": ["mypy>=1.1.1,<1.2"], + "compatible-mypy": ["mypy>=1.2.0,<1.3"], } setup(
{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -31,7 +31,7 @@\n ]\n \n extras_require = {\n- \"compatible-mypy\": [\"mypy>=1.1.1,<1.2\"],\n+ \"compatible-mypy\": [\"mypy>=1.2.0,<1.3\"],\n }\n \n setup(\n", "issue": "Bump mypy from 1.1.1 to 1.2.0\nBumps [mypy](https://github.com/python/mypy) from 1.1.1 to 1.2.0.\n<details>\n<summary>Commits</summary>\n<ul>\n<li><a href=\"https://github.com/python/mypy/commit/4f47dfb64dff920c237e7c8c58f8efba57cf57cf\"><code>4f47dfb</code></a> Promote version to 1.2.0 and drop +dev from the version</li>\n<li><a href=\"https://github.com/python/mypy/commit/06aa182b4973ea122c9f536855a31234d75b93b9\"><code>06aa182</code></a> [dataclass_transform] support implicit default for &quot;init&quot; parameter in field ...</li>\n<li><a href=\"https://github.com/python/mypy/commit/7beaec2e4a1c7891b044b45e538a472dbe86f240\"><code>7beaec2</code></a> Support descriptors in dataclass transform (<a href=\"https://redirect.github.com/python/mypy/issues/15006\">#15006</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/a7a995a0409b623b941a1e2f882792abed45fddf\"><code>a7a995a</code></a> Multiple inheritance considers callable objects as subtypes of functions (<a href=\"https://redirect.github.com/python/mypy/issues/14\">#14</a>...</li>\n<li><a href=\"https://github.com/python/mypy/commit/7f2a5b5bf7dca35402390f2ff30c35c23b4085d4\"><code>7f2a5b5</code></a> [dataclass_transform] fix deserialization for frozen_default</li>\n<li><a href=\"https://github.com/python/mypy/commit/bfa9eacedb0554e1a6fe9245dbd5ccdbbc555fae\"><code>bfa9eac</code></a> [mypyc] Be stricter about function prototypes (<a href=\"https://redirect.github.com/python/mypy/issues/14942\">#14942</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/4e6d68322774d5f7c15d5067613fc851b4640d3e\"><code>4e6d683</code></a> [mypyc] Document native floats and integers (<a href=\"https://redirect.github.com/python/mypy/issues/14927\">#14927</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/aa2679b6b0bbbffcb454081a81346c0a82804e52\"><code>aa2679b</code></a> [mypyc] Fixes to float to int conversion (<a href=\"https://redirect.github.com/python/mypy/issues/14936\">#14936</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/9944d5fc6ae29a862bfab980a42a9bfae89ee5c0\"><code>9944d5f</code></a> [mypyc] Support iterating over a TypedDict (<a href=\"https://redirect.github.com/python/mypy/issues/14747\">#14747</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/1a8ea6187474fcc5896cf4b7f47074673e07ad42\"><code>1a8ea61</code></a> [mypyc] Avoid boxing/unboxing when coercing between tuple types (<a href=\"https://redirect.github.com/python/mypy/issues/14899\">#14899</a>)</li>\n<li>Additional commits viewable in <a href=\"https://github.com/python/mypy/compare/v1.1.1...v1.2.0\">compare view</a></li>\n</ul>\n</details>\n<br />\n\n\n[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mypy&package-manager=pip&previous-version=1.1.1&new-version=1.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)\n\nDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.\n\n[//]: # (dependabot-automerge-start)\n[//]: # (dependabot-automerge-end)\n\n---\n\n<details>\n<summary>Dependabot commands and options</summary>\n<br />\n\nYou can trigger Dependabot actions by commenting on this PR:\n- `@dependabot rebase` will rebase this PR\n- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it\n- `@dependabot merge` will merge this PR after your CI passes on it\n- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it\n- `@dependabot cancel merge` will cancel a previously requested merge and block automerging\n- `@dependabot reopen` will reopen this PR if it is closed\n- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually\n- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)\n- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)\n- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)\n\n\n</details>\n", "before_files": [{"content": "import os\nfrom typing import List\n\nfrom setuptools import find_packages, setup\n\n\ndef find_stub_files(name: str) -> List[str]:\n result = []\n for root, _dirs, files in os.walk(name):\n for file in files:\n if file.endswith(\".pyi\"):\n if os.path.sep in root:\n sub_root = root.split(os.path.sep, 1)[-1]\n file = os.path.join(sub_root, file)\n result.append(file)\n return result\n\n\nwith open(\"README.md\") as f:\n readme = f.read()\n\ndependencies = [\n \"mypy>=0.980\",\n \"django\",\n \"django-stubs-ext>=0.8.0\",\n \"tomli; python_version < '3.11'\",\n # Types:\n \"typing-extensions\",\n \"types-pytz\",\n \"types-PyYAML\",\n]\n\nextras_require = {\n \"compatible-mypy\": [\"mypy>=1.1.1,<1.2\"],\n}\n\nsetup(\n name=\"django-stubs\",\n version=\"1.16.0\",\n description=\"Mypy stubs for Django\",\n long_description=readme,\n long_description_content_type=\"text/markdown\",\n license=\"MIT\",\n url=\"https://github.com/typeddjango/django-stubs\",\n author=\"Maksim Kurnikov\",\n author_email=\"[email protected]\",\n maintainer=\"Marti Raudsepp\",\n maintainer_email=\"[email protected]\",\n py_modules=[],\n python_requires=\">=3.7\",\n install_requires=dependencies,\n extras_require=extras_require,\n packages=[\"django-stubs\", *find_packages(exclude=[\"scripts\"])],\n package_data={\n \"django-stubs\": find_stub_files(\"django-stubs\"),\n \"mypy_django_plugin\": [\"py.typed\"],\n },\n classifiers=[\n \"License :: OSI Approved :: MIT License\",\n \"Operating System :: OS Independent\",\n \"Programming Language :: Python :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n \"Programming Language :: Python :: 3.11\",\n \"Typing :: Typed\",\n \"Framework :: Django\",\n \"Framework :: Django :: 2.2\",\n \"Framework :: Django :: 3.0\",\n \"Framework :: Django :: 3.1\",\n \"Framework :: Django :: 3.2\",\n \"Framework :: Django :: 4.0\",\n \"Framework :: Django :: 4.1\",\n ],\n project_urls={\n \"Release notes\": \"https://github.com/typeddjango/django-stubs/releases\",\n },\n)\n", "path": "setup.py"}], "after_files": [{"content": "import os\nfrom typing import List\n\nfrom setuptools import find_packages, setup\n\n\ndef find_stub_files(name: str) -> List[str]:\n result = []\n for root, _dirs, files in os.walk(name):\n for file in files:\n if file.endswith(\".pyi\"):\n if os.path.sep in root:\n sub_root = root.split(os.path.sep, 1)[-1]\n file = os.path.join(sub_root, file)\n result.append(file)\n return result\n\n\nwith open(\"README.md\") as f:\n readme = f.read()\n\ndependencies = [\n \"mypy>=0.980\",\n \"django\",\n \"django-stubs-ext>=0.8.0\",\n \"tomli; python_version < '3.11'\",\n # Types:\n \"typing-extensions\",\n \"types-pytz\",\n \"types-PyYAML\",\n]\n\nextras_require = {\n \"compatible-mypy\": [\"mypy>=1.2.0,<1.3\"],\n}\n\nsetup(\n name=\"django-stubs\",\n version=\"1.16.0\",\n description=\"Mypy stubs for Django\",\n long_description=readme,\n long_description_content_type=\"text/markdown\",\n license=\"MIT\",\n url=\"https://github.com/typeddjango/django-stubs\",\n author=\"Maksim Kurnikov\",\n author_email=\"[email protected]\",\n maintainer=\"Marti Raudsepp\",\n maintainer_email=\"[email protected]\",\n py_modules=[],\n python_requires=\">=3.7\",\n install_requires=dependencies,\n extras_require=extras_require,\n packages=[\"django-stubs\", *find_packages(exclude=[\"scripts\"])],\n package_data={\n \"django-stubs\": find_stub_files(\"django-stubs\"),\n \"mypy_django_plugin\": [\"py.typed\"],\n },\n classifiers=[\n \"License :: OSI Approved :: MIT License\",\n \"Operating System :: OS Independent\",\n \"Programming Language :: Python :: 3.7\",\n \"Programming Language :: Python :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n \"Programming Language :: Python :: 3.11\",\n \"Typing :: Typed\",\n \"Framework :: Django\",\n \"Framework :: Django :: 2.2\",\n \"Framework :: Django :: 3.0\",\n \"Framework :: Django :: 3.1\",\n \"Framework :: Django :: 3.2\",\n \"Framework :: Django :: 4.0\",\n \"Framework :: Django :: 4.1\",\n ],\n project_urls={\n \"Release notes\": \"https://github.com/typeddjango/django-stubs/releases\",\n },\n)\n", "path": "setup.py"}]}
gh_patches_debug_17
rasdani/github-patches
git_diff
typeddjango__django-stubs-1496
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Bump mypy from 1.2.0 to 1.3.0 Bumps [mypy](https://github.com/python/mypy) from 1.2.0 to 1.3.0. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/python/mypy/commit/9df39ab1801369cb49467fa52080df9c42377384"><code>9df39ab</code></a> set version to 1.3.0</li> <li><a href="https://github.com/python/mypy/commit/c1464a9ea61fe9c350b61c1989d98bbc33d74982"><code>c1464a9</code></a> Revert &quot;Fix disappearing errors when re-running dmypy check (<a href="https://redirect.github.com/python/mypy/issues/14835">#14835</a>)&quot; (<a href="https://redirect.github.com/python/mypy/issues/15179">#15179</a>)</li> <li><a href="https://github.com/python/mypy/commit/d887e9c0d090694b66b5fa20ac249b3d749a8518"><code>d887e9c</code></a> Fix performance in union subtyping (<a href="https://redirect.github.com/python/mypy/issues/15104">#15104</a>)</li> <li><a href="https://github.com/python/mypy/commit/320b883ada83375f1e6929b4703b741d3c4813ce"><code>320b883</code></a> Typeshed cherry-pick: stdlib/xml: fix return types for toxml/toprettyxml meth...</li> <li><a href="https://github.com/python/mypy/commit/6a68049e903dba7bbcff5a530b63731535f8d5f7"><code>6a68049</code></a> Fix sys.platform when cross-compiling with emscripten (<a href="https://redirect.github.com/python/mypy/issues/14888">#14888</a>)</li> <li><a href="https://github.com/python/mypy/commit/3d9661c91d5dfaf3ae0d3ca5624867cdf449da77"><code>3d9661c</code></a> Fix bounded self types in override incompatibility checking (<a href="https://redirect.github.com/python/mypy/issues/15045">#15045</a>)</li> <li><a href="https://github.com/python/mypy/commit/0799a8ab0dc8deed8d2e0ec34b1aab2fe39ebd96"><code>0799a8a</code></a> [mypyc] Fix unions of bools and ints (<a href="https://redirect.github.com/python/mypy/issues/15066">#15066</a>)</li> <li><a href="https://github.com/python/mypy/commit/4276308be01ea498d946a79554b4a10b1cf13ccb"><code>4276308</code></a> (🎁) update black to 23.3.0 (<a href="https://redirect.github.com/python/mypy/issues/15059">#15059</a>)</li> <li><a href="https://github.com/python/mypy/commit/14493660eadf35553a3cecb746704b58a401c68d"><code>1449366</code></a> Allow objects matching <code>SupportsKeysAndGetItem</code> to be unpacked (<a href="https://redirect.github.com/python/mypy/issues/14990">#14990</a>)</li> <li><a href="https://github.com/python/mypy/commit/69c774e6d6fa92aea8f32cd0e045e8a34a0f7215"><code>69c774e</code></a> Sync typeshed (<a href="https://redirect.github.com/python/mypy/issues/15055">#15055</a>)</li> <li>Additional commits viewable in <a href="https://github.com/python/mypy/compare/v1.2.0...v1.3.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mypy&package-manager=pip&previous-version=1.2.0&new-version=1.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `setup.py` Content: ``` 1 #!/usr/bin/env python 2 import os 3 from typing import List 4 5 from setuptools import find_packages, setup 6 7 8 def find_stub_files(name: str) -> List[str]: 9 result = [] 10 for root, _dirs, files in os.walk(name): 11 for file in files: 12 if file.endswith(".pyi"): 13 if os.path.sep in root: 14 sub_root = root.split(os.path.sep, 1)[-1] 15 file = os.path.join(sub_root, file) 16 result.append(file) 17 return result 18 19 20 with open("README.md") as f: 21 readme = f.read() 22 23 dependencies = [ 24 "mypy>=1.0.0", 25 "django", 26 "django-stubs-ext>=4.2.0", 27 "tomli; python_version < '3.11'", 28 # Types: 29 "typing-extensions", 30 "types-pytz", 31 "types-PyYAML", 32 ] 33 34 extras_require = { 35 "compatible-mypy": ["mypy>=1.2.0,<1.3"], 36 } 37 38 setup( 39 name="django-stubs", 40 version="4.2.0", 41 description="Mypy stubs for Django", 42 long_description=readme, 43 long_description_content_type="text/markdown", 44 license="MIT", 45 license_files=["LICENSE.md"], 46 url="https://github.com/typeddjango/django-stubs", 47 author="Maksim Kurnikov", 48 author_email="[email protected]", 49 maintainer="Marti Raudsepp", 50 maintainer_email="[email protected]", 51 py_modules=[], 52 python_requires=">=3.8", 53 install_requires=dependencies, 54 extras_require=extras_require, 55 packages=["django-stubs", *find_packages(exclude=["scripts"])], 56 package_data={ 57 "django-stubs": find_stub_files("django-stubs"), 58 "mypy_django_plugin": ["py.typed"], 59 }, 60 classifiers=[ 61 "License :: OSI Approved :: MIT License", 62 "Operating System :: OS Independent", 63 "Programming Language :: Python :: 3.8", 64 "Programming Language :: Python :: 3.9", 65 "Programming Language :: Python :: 3.10", 66 "Programming Language :: Python :: 3.11", 67 "Typing :: Typed", 68 "Framework :: Django", 69 "Framework :: Django :: 2.2", 70 "Framework :: Django :: 3.0", 71 "Framework :: Django :: 3.1", 72 "Framework :: Django :: 3.2", 73 "Framework :: Django :: 4.1", 74 "Framework :: Django :: 4.2", 75 ], 76 project_urls={ 77 "Release notes": "https://github.com/typeddjango/django-stubs/releases", 78 }, 79 ) 80 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/setup.py b/setup.py old mode 100755 new mode 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ ] extras_require = { - "compatible-mypy": ["mypy>=1.2.0,<1.3"], + "compatible-mypy": ["mypy>=1.3.0,<1.4"], } setup(
{"golden_diff": "diff --git a/setup.py b/setup.py\nold mode 100755\nnew mode 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -32,7 +32,7 @@\n ]\n \n extras_require = {\n- \"compatible-mypy\": [\"mypy>=1.2.0,<1.3\"],\n+ \"compatible-mypy\": [\"mypy>=1.3.0,<1.4\"],\n }\n \n setup(\n", "issue": "Bump mypy from 1.2.0 to 1.3.0\nBumps [mypy](https://github.com/python/mypy) from 1.2.0 to 1.3.0.\n<details>\n<summary>Commits</summary>\n<ul>\n<li><a href=\"https://github.com/python/mypy/commit/9df39ab1801369cb49467fa52080df9c42377384\"><code>9df39ab</code></a> set version to 1.3.0</li>\n<li><a href=\"https://github.com/python/mypy/commit/c1464a9ea61fe9c350b61c1989d98bbc33d74982\"><code>c1464a9</code></a> Revert &quot;Fix disappearing errors when re-running dmypy check (<a href=\"https://redirect.github.com/python/mypy/issues/14835\">#14835</a>)&quot; (<a href=\"https://redirect.github.com/python/mypy/issues/15179\">#15179</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/d887e9c0d090694b66b5fa20ac249b3d749a8518\"><code>d887e9c</code></a> Fix performance in union subtyping (<a href=\"https://redirect.github.com/python/mypy/issues/15104\">#15104</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/320b883ada83375f1e6929b4703b741d3c4813ce\"><code>320b883</code></a> Typeshed cherry-pick: stdlib/xml: fix return types for toxml/toprettyxml meth...</li>\n<li><a href=\"https://github.com/python/mypy/commit/6a68049e903dba7bbcff5a530b63731535f8d5f7\"><code>6a68049</code></a> Fix sys.platform when cross-compiling with emscripten (<a href=\"https://redirect.github.com/python/mypy/issues/14888\">#14888</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/3d9661c91d5dfaf3ae0d3ca5624867cdf449da77\"><code>3d9661c</code></a> Fix bounded self types in override incompatibility checking (<a href=\"https://redirect.github.com/python/mypy/issues/15045\">#15045</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/0799a8ab0dc8deed8d2e0ec34b1aab2fe39ebd96\"><code>0799a8a</code></a> [mypyc] Fix unions of bools and ints (<a href=\"https://redirect.github.com/python/mypy/issues/15066\">#15066</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/4276308be01ea498d946a79554b4a10b1cf13ccb\"><code>4276308</code></a> (\ud83c\udf81) update black to 23.3.0 (<a href=\"https://redirect.github.com/python/mypy/issues/15059\">#15059</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/14493660eadf35553a3cecb746704b58a401c68d\"><code>1449366</code></a> Allow objects matching <code>SupportsKeysAndGetItem</code> to be unpacked (<a href=\"https://redirect.github.com/python/mypy/issues/14990\">#14990</a>)</li>\n<li><a href=\"https://github.com/python/mypy/commit/69c774e6d6fa92aea8f32cd0e045e8a34a0f7215\"><code>69c774e</code></a> Sync typeshed (<a href=\"https://redirect.github.com/python/mypy/issues/15055\">#15055</a>)</li>\n<li>Additional commits viewable in <a href=\"https://github.com/python/mypy/compare/v1.2.0...v1.3.0\">compare view</a></li>\n</ul>\n</details>\n<br />\n\n\n[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mypy&package-manager=pip&previous-version=1.2.0&new-version=1.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)\n\nDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.\n\n[//]: # (dependabot-automerge-start)\n[//]: # (dependabot-automerge-end)\n\n---\n\n<details>\n<summary>Dependabot commands and options</summary>\n<br />\n\nYou can trigger Dependabot actions by commenting on this PR:\n- `@dependabot rebase` will rebase this PR\n- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it\n- `@dependabot merge` will merge this PR after your CI passes on it\n- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it\n- `@dependabot cancel merge` will cancel a previously requested merge and block automerging\n- `@dependabot reopen` will reopen this PR if it is closed\n- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually\n- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)\n- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)\n- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)\n\n\n</details>\n", "before_files": [{"content": "#!/usr/bin/env python\nimport os\nfrom typing import List\n\nfrom setuptools import find_packages, setup\n\n\ndef find_stub_files(name: str) -> List[str]:\n result = []\n for root, _dirs, files in os.walk(name):\n for file in files:\n if file.endswith(\".pyi\"):\n if os.path.sep in root:\n sub_root = root.split(os.path.sep, 1)[-1]\n file = os.path.join(sub_root, file)\n result.append(file)\n return result\n\n\nwith open(\"README.md\") as f:\n readme = f.read()\n\ndependencies = [\n \"mypy>=1.0.0\",\n \"django\",\n \"django-stubs-ext>=4.2.0\",\n \"tomli; python_version < '3.11'\",\n # Types:\n \"typing-extensions\",\n \"types-pytz\",\n \"types-PyYAML\",\n]\n\nextras_require = {\n \"compatible-mypy\": [\"mypy>=1.2.0,<1.3\"],\n}\n\nsetup(\n name=\"django-stubs\",\n version=\"4.2.0\",\n description=\"Mypy stubs for Django\",\n long_description=readme,\n long_description_content_type=\"text/markdown\",\n license=\"MIT\",\n license_files=[\"LICENSE.md\"],\n url=\"https://github.com/typeddjango/django-stubs\",\n author=\"Maksim Kurnikov\",\n author_email=\"[email protected]\",\n maintainer=\"Marti Raudsepp\",\n maintainer_email=\"[email protected]\",\n py_modules=[],\n python_requires=\">=3.8\",\n install_requires=dependencies,\n extras_require=extras_require,\n packages=[\"django-stubs\", *find_packages(exclude=[\"scripts\"])],\n package_data={\n \"django-stubs\": find_stub_files(\"django-stubs\"),\n \"mypy_django_plugin\": [\"py.typed\"],\n },\n classifiers=[\n \"License :: OSI Approved :: MIT License\",\n \"Operating System :: OS Independent\",\n \"Programming Language :: Python :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n \"Programming Language :: Python :: 3.11\",\n \"Typing :: Typed\",\n \"Framework :: Django\",\n \"Framework :: Django :: 2.2\",\n \"Framework :: Django :: 3.0\",\n \"Framework :: Django :: 3.1\",\n \"Framework :: Django :: 3.2\",\n \"Framework :: Django :: 4.1\",\n \"Framework :: Django :: 4.2\",\n ],\n project_urls={\n \"Release notes\": \"https://github.com/typeddjango/django-stubs/releases\",\n },\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\nimport os\nfrom typing import List\n\nfrom setuptools import find_packages, setup\n\n\ndef find_stub_files(name: str) -> List[str]:\n result = []\n for root, _dirs, files in os.walk(name):\n for file in files:\n if file.endswith(\".pyi\"):\n if os.path.sep in root:\n sub_root = root.split(os.path.sep, 1)[-1]\n file = os.path.join(sub_root, file)\n result.append(file)\n return result\n\n\nwith open(\"README.md\") as f:\n readme = f.read()\n\ndependencies = [\n \"mypy>=1.0.0\",\n \"django\",\n \"django-stubs-ext>=4.2.0\",\n \"tomli; python_version < '3.11'\",\n # Types:\n \"typing-extensions\",\n \"types-pytz\",\n \"types-PyYAML\",\n]\n\nextras_require = {\n \"compatible-mypy\": [\"mypy>=1.3.0,<1.4\"],\n}\n\nsetup(\n name=\"django-stubs\",\n version=\"4.2.0\",\n description=\"Mypy stubs for Django\",\n long_description=readme,\n long_description_content_type=\"text/markdown\",\n license=\"MIT\",\n license_files=[\"LICENSE.md\"],\n url=\"https://github.com/typeddjango/django-stubs\",\n author=\"Maksim Kurnikov\",\n author_email=\"[email protected]\",\n maintainer=\"Marti Raudsepp\",\n maintainer_email=\"[email protected]\",\n py_modules=[],\n python_requires=\">=3.8\",\n install_requires=dependencies,\n extras_require=extras_require,\n packages=[\"django-stubs\", *find_packages(exclude=[\"scripts\"])],\n package_data={\n \"django-stubs\": find_stub_files(\"django-stubs\"),\n \"mypy_django_plugin\": [\"py.typed\"],\n },\n classifiers=[\n \"License :: OSI Approved :: MIT License\",\n \"Operating System :: OS Independent\",\n \"Programming Language :: Python :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n \"Programming Language :: Python :: 3.11\",\n \"Typing :: Typed\",\n \"Framework :: Django\",\n \"Framework :: Django :: 2.2\",\n \"Framework :: Django :: 3.0\",\n \"Framework :: Django :: 3.1\",\n \"Framework :: Django :: 3.2\",\n \"Framework :: Django :: 4.1\",\n \"Framework :: Django :: 4.2\",\n ],\n project_urls={\n \"Release notes\": \"https://github.com/typeddjango/django-stubs/releases\",\n },\n)\n", "path": "setup.py"}]}
gh_patches_debug_18
rasdani/github-patches
git_diff
freqtrade__freqtrade-5487
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Hyperoptable parameter type: CategoricalParameter is not returning correctly. ## Describe your environment * Operating system: MacOS 11.2.3 (20D91) * Python Version: using the version shiped freqtradeorg/freqtrade:stable (Image ID 73a48178c043) * CCXT version: using the version shiped freqtradeorg/freqtrade:stable (Image ID 73a48178c043) * Freqtrade Version: freqtrade 2021.4 Note: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out. ## Describe the problem: Hi! It appears the Hyperoptable parameter type: `CategoricalParameter` is not returning correctly. If I run the example as per the Freqtrade Docs [here](https://www.freqtrade.io/en/stable/hyperopt/#hyperoptable-parameters), namely setting a `CategoricalParameter` like so: ``` buy_rsi_enabled = CategoricalParameter([True, False]), ``` ...then when running the Hyperopt tool there is an error in the `populate_buy_trend` as below: ``` if self.buy_adx_enabled.value: AttributeError: 'tuple' object has no attribute 'value' ``` It would appear that the `CategoricalParameter` is not actually returning one of the categories (even a default) but instead returning a Python Tuple. ### Steps to reproduce: 1. Follow the example in the [Docs](https://www.freqtrade.io/en/stable/hyperopt/#hyperoptable-parameters) ### Observed Results: * What happened? There was an AttributeError: 'tuple' object has no attribute 'value'. * What did you expect to happen? The 'value' property to exist and be set to either True or False ### Relevant code exceptions or logs Note: Please copy/paste text of the messages, no screenshots of logs please. ``` 2021-05-02 09:48:02,421 - freqtrade - ERROR - Fatal exception! joblib.externals.loky.process_executor._RemoteTraceback: """ Traceback (most recent call last): File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py", line 431, in _process_worker r = call_item() File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py", line 285, in __call__ return self.fn(*self.args, **self.kwargs) File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/_parallel_backends.py", line 595, in __call__ return self.func(*args, **kwargs) File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/parallel.py", line 262, in __call__ return [func(*args, **kwargs) File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/parallel.py", line 262, in <listcomp> return [func(*args, **kwargs) File "/home/ftuser/.local/lib/python3.9/site-packages/joblib/externals/loky/cloudpickle_wrapper.py", line 38, in __call__ return self._obj(*args, **kwargs) File "/freqtrade/freqtrade/optimize/hyperopt.py", line 288, in generate_optimizer backtesting_results = self.backtesting.backtest( File "/freqtrade/freqtrade/optimize/backtesting.py", line 352, in backtest data: Dict = self._get_ohlcv_as_lists(processed) File "/freqtrade/freqtrade/optimize/backtesting.py", line 196, in _get_ohlcv_as_lists self.strategy.advise_buy(pair_data, {'pair': pair}), {'pair': pair})[headers].copy() File "/freqtrade/freqtrade/optimize/hyperopt_auto.py", line 31, in populate_buy_trend return self.strategy.populate_buy_trend(dataframe, metadata) File "/freqtrade/user_data/strategies/Strategy004.py", line 149, in populate_buy_trend if self.buy_adx_enabled.value: AttributeError: 'tuple' object has no attribute 'value' ``` --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `freqtrade/__init__.py` Content: ``` 1 """ Freqtrade bot """ 2 __version__ = 'develop' 3 4 if __version__ == 'develop': 5 6 try: 7 import subprocess 8 9 __version__ = 'develop-' + subprocess.check_output( 10 ['git', 'log', '--format="%h"', '-n 1'], 11 stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"') 12 13 # from datetime import datetime 14 # last_release = subprocess.check_output( 15 # ['git', 'tag'] 16 # ).decode('utf-8').split()[-1].split(".") 17 # # Releases are in the format "2020.1" - we increment the latest version for dev. 18 # prefix = f"{last_release[0]}.{int(last_release[1]) + 1}" 19 # dev_version = int(datetime.now().timestamp() // 1000) 20 # __version__ = f"{prefix}.dev{dev_version}" 21 22 # subprocess.check_output( 23 # ['git', 'log', '--format="%h"', '-n 1'], 24 # stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"') 25 except Exception: 26 # git not available, ignore 27 try: 28 # Try Fallback to freqtrade_commit file (created by CI while building docker image) 29 from pathlib import Path 30 versionfile = Path('./freqtrade_commit') 31 if versionfile.is_file(): 32 __version__ = f"docker-{versionfile.read_text()[:8]}" 33 except Exception: 34 pass 35 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/freqtrade/__init__.py b/freqtrade/__init__.py --- a/freqtrade/__init__.py +++ b/freqtrade/__init__.py @@ -1,5 +1,5 @@ """ Freqtrade bot """ -__version__ = 'develop' +__version__ = '2021.8' if __version__ == 'develop':
{"golden_diff": "diff --git a/freqtrade/__init__.py b/freqtrade/__init__.py\n--- a/freqtrade/__init__.py\n+++ b/freqtrade/__init__.py\n@@ -1,5 +1,5 @@\n \"\"\" Freqtrade bot \"\"\"\n-__version__ = 'develop'\n+__version__ = '2021.8'\n \n if __version__ == 'develop':\n", "issue": "Hyperoptable parameter type: CategoricalParameter is not returning correctly.\n## Describe your environment\r\n\r\n * Operating system: MacOS 11.2.3 (20D91)\r\n * Python Version: using the version shiped freqtradeorg/freqtrade:stable (Image ID 73a48178c043)\r\n * CCXT version: using the version shiped freqtradeorg/freqtrade:stable (Image ID 73a48178c043)\r\n * Freqtrade Version: freqtrade 2021.4\r\n \r\nNote: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out.\r\n\r\n## Describe the problem:\r\n\r\nHi! It appears the Hyperoptable parameter type: `CategoricalParameter` is not returning correctly.\r\n\r\nIf I run the example as per the Freqtrade Docs [here](https://www.freqtrade.io/en/stable/hyperopt/#hyperoptable-parameters), namely setting a `CategoricalParameter` like so:\r\n\r\n```\r\nbuy_rsi_enabled = CategoricalParameter([True, False]),\r\n```\r\n\r\n...then when running the Hyperopt tool there is an error in the `populate_buy_trend` as below:\r\n\r\n```\r\nif self.buy_adx_enabled.value:\r\nAttributeError: 'tuple' object has no attribute 'value'\r\n```\r\n\r\nIt would appear that the `CategoricalParameter` is not actually returning one of the categories (even a default) but instead returning a Python Tuple.\r\n\r\n### Steps to reproduce:\r\n\r\n 1. Follow the example in the [Docs](https://www.freqtrade.io/en/stable/hyperopt/#hyperoptable-parameters)\r\n \r\n### Observed Results:\r\n\r\n * What happened? There was an AttributeError: 'tuple' object has no attribute 'value'. \r\n * What did you expect to happen? The 'value' property to exist and be set to either True or False\r\n\r\n### Relevant code exceptions or logs\r\n\r\nNote: Please copy/paste text of the messages, no screenshots of logs please.\r\n\r\n ```\r\n2021-05-02 09:48:02,421 - freqtrade - ERROR - Fatal exception!\r\njoblib.externals.loky.process_executor._RemoteTraceback:\r\n\"\"\"\r\nTraceback (most recent call last):\r\n File \"/home/ftuser/.local/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py\", line 431, in _process_worker\r\n r = call_item()\r\n File \"/home/ftuser/.local/lib/python3.9/site-packages/joblib/externals/loky/process_executor.py\", line 285, in __call__\r\n return self.fn(*self.args, **self.kwargs)\r\n File \"/home/ftuser/.local/lib/python3.9/site-packages/joblib/_parallel_backends.py\", line 595, in __call__\r\n return self.func(*args, **kwargs)\r\n File \"/home/ftuser/.local/lib/python3.9/site-packages/joblib/parallel.py\", line 262, in __call__\r\n return [func(*args, **kwargs)\r\n File \"/home/ftuser/.local/lib/python3.9/site-packages/joblib/parallel.py\", line 262, in <listcomp>\r\n return [func(*args, **kwargs)\r\n File \"/home/ftuser/.local/lib/python3.9/site-packages/joblib/externals/loky/cloudpickle_wrapper.py\", line 38, in __call__\r\n return self._obj(*args, **kwargs)\r\n File \"/freqtrade/freqtrade/optimize/hyperopt.py\", line 288, in generate_optimizer\r\n backtesting_results = self.backtesting.backtest(\r\n File \"/freqtrade/freqtrade/optimize/backtesting.py\", line 352, in backtest\r\n data: Dict = self._get_ohlcv_as_lists(processed)\r\n File \"/freqtrade/freqtrade/optimize/backtesting.py\", line 196, in _get_ohlcv_as_lists\r\n self.strategy.advise_buy(pair_data, {'pair': pair}), {'pair': pair})[headers].copy()\r\n File \"/freqtrade/freqtrade/optimize/hyperopt_auto.py\", line 31, in populate_buy_trend\r\n return self.strategy.populate_buy_trend(dataframe, metadata)\r\n File \"/freqtrade/user_data/strategies/Strategy004.py\", line 149, in populate_buy_trend\r\n if self.buy_adx_enabled.value:\r\nAttributeError: 'tuple' object has no attribute 'value'\r\n ```\r\n\n", "before_files": [{"content": "\"\"\" Freqtrade bot \"\"\"\n__version__ = 'develop'\n\nif __version__ == 'develop':\n\n try:\n import subprocess\n\n __version__ = 'develop-' + subprocess.check_output(\n ['git', 'log', '--format=\"%h\"', '-n 1'],\n stderr=subprocess.DEVNULL).decode(\"utf-8\").rstrip().strip('\"')\n\n # from datetime import datetime\n # last_release = subprocess.check_output(\n # ['git', 'tag']\n # ).decode('utf-8').split()[-1].split(\".\")\n # # Releases are in the format \"2020.1\" - we increment the latest version for dev.\n # prefix = f\"{last_release[0]}.{int(last_release[1]) + 1}\"\n # dev_version = int(datetime.now().timestamp() // 1000)\n # __version__ = f\"{prefix}.dev{dev_version}\"\n\n # subprocess.check_output(\n # ['git', 'log', '--format=\"%h\"', '-n 1'],\n # stderr=subprocess.DEVNULL).decode(\"utf-8\").rstrip().strip('\"')\n except Exception:\n # git not available, ignore\n try:\n # Try Fallback to freqtrade_commit file (created by CI while building docker image)\n from pathlib import Path\n versionfile = Path('./freqtrade_commit')\n if versionfile.is_file():\n __version__ = f\"docker-{versionfile.read_text()[:8]}\"\n except Exception:\n pass\n", "path": "freqtrade/__init__.py"}], "after_files": [{"content": "\"\"\" Freqtrade bot \"\"\"\n__version__ = '2021.8'\n\nif __version__ == 'develop':\n\n try:\n import subprocess\n\n __version__ = 'develop-' + subprocess.check_output(\n ['git', 'log', '--format=\"%h\"', '-n 1'],\n stderr=subprocess.DEVNULL).decode(\"utf-8\").rstrip().strip('\"')\n\n # from datetime import datetime\n # last_release = subprocess.check_output(\n # ['git', 'tag']\n # ).decode('utf-8').split()[-1].split(\".\")\n # # Releases are in the format \"2020.1\" - we increment the latest version for dev.\n # prefix = f\"{last_release[0]}.{int(last_release[1]) + 1}\"\n # dev_version = int(datetime.now().timestamp() // 1000)\n # __version__ = f\"{prefix}.dev{dev_version}\"\n\n # subprocess.check_output(\n # ['git', 'log', '--format=\"%h\"', '-n 1'],\n # stderr=subprocess.DEVNULL).decode(\"utf-8\").rstrip().strip('\"')\n except Exception:\n # git not available, ignore\n try:\n # Try Fallback to freqtrade_commit file (created by CI while building docker image)\n from pathlib import Path\n versionfile = Path('./freqtrade_commit')\n if versionfile.is_file():\n __version__ = f\"docker-{versionfile.read_text()[:8]}\"\n except Exception:\n pass\n", "path": "freqtrade/__init__.py"}]}
gh_patches_debug_19
rasdani/github-patches
git_diff
dynaconf__dynaconf-1010
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- [bug] TypeError for older versions of HVAC in read_secret_version method **Describe the bug** A combination of newer versions of Dynaconf with older versions of HVAC result in an incompatible mix of expected vs available arguments. Specifically you can get the following traceback. ```python 109 try: 110 if obj.VAULT_KV_VERSION_FOR_DYNACONF == 2: --> 111 data = client.secrets.kv.v2.read_secret_version( 112 path, 113 mount_point=obj.VAULT_MOUNT_POINT_FOR_DYNACONF, 114 raise_on_deleted_version=True, # keep default behavior 115 ) 116 else: 117 data = client.secrets.kv.read_secret( 118 "data/" + path, 119 mount_point=obj.VAULT_MOUNT_POINT_FOR_DYNACONF, 120 ) TypeError: KvV2.read_secret_version() got an unexpected keyword argument 'raise_on_deleted_version' ``` The PR introducing this feature was included in HVAC 1.1.0: https://github.com/hvac/hvac/pull/907 **To Reproduce** Steps to reproduce the behavior: 1. Have a version of HVAC older than 1.1.0 2. Trigger a vault version read --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `setup.py` Content: ``` 1 from __future__ import annotations 2 3 import os 4 5 from setuptools import find_packages 6 from setuptools import setup 7 8 9 def read(*names, **kwargs): 10 """Read a file.""" 11 content = "" 12 with open( 13 os.path.join(os.path.dirname(__file__), *names), 14 encoding=kwargs.get("encoding", "utf8"), 15 ) as open_file: 16 content = open_file.read().strip() 17 return content 18 19 20 test_requirements = [ 21 "pytest", 22 "pytest-cov", 23 "pytest-xdist", 24 "pytest-mock", 25 "flake8", 26 "pep8-naming", 27 "flake8-debugger", 28 "flake8-print", 29 "flake8-todo", 30 "radon", 31 "flask>=0.12", 32 "django", 33 "python-dotenv", 34 "toml", 35 "redis", 36 "hvac", 37 "configobj", 38 ] 39 40 41 setup( 42 name="dynaconf", 43 version=read("dynaconf", "VERSION"), 44 url="https://github.com/dynaconf/dynaconf", 45 license="MIT", 46 license_files=["LICENSE", "vendor_licenses/*"], 47 author="Bruno Rocha", 48 author_email="[email protected]", 49 description="The dynamic configurator for your Python Project", 50 long_description=read("README.md"), 51 long_description_content_type="text/markdown", 52 packages=find_packages( 53 exclude=[ 54 "tests", 55 "tests.*", 56 "tests_functional", 57 "tests_functional.*", 58 "docs", 59 "legacy_docs", 60 "legacy_docs.*", 61 "docs.*", 62 "build", 63 "build.*", 64 "dynaconf.vendor_src", 65 "dynaconf/vendor_src", 66 "dynaconf.vendor_src.*", 67 "dynaconf/vendor_src/*", 68 ] 69 ), 70 include_package_data=True, 71 zip_safe=False, 72 platforms="any", 73 tests_require=test_requirements, 74 extras_require={ 75 "redis": ["redis"], 76 "vault": ["hvac"], 77 "yaml": ["ruamel.yaml"], 78 "toml": ["toml"], 79 "ini": ["configobj"], 80 "configobj": ["configobj"], 81 "all": ["redis", "ruamel.yaml", "configobj", "hvac"], 82 "test": test_requirements, 83 }, 84 python_requires=">=3.8", 85 entry_points={"console_scripts": ["dynaconf=dynaconf.cli:main"]}, 86 setup_requires=["setuptools>=38.6.0"], 87 classifiers=[ 88 "Development Status :: 5 - Production/Stable", 89 "Framework :: Django", 90 "Framework :: Flask", 91 "Intended Audience :: Developers", 92 "License :: OSI Approved :: MIT License", 93 "Natural Language :: English", 94 "Operating System :: OS Independent", 95 "Programming Language :: Python", 96 "Programming Language :: Python :: 3", 97 "Programming Language :: Python :: 3 :: Only", 98 "Programming Language :: Python :: 3.8", 99 "Programming Language :: Python :: 3.9", 100 "Programming Language :: Python :: 3.10", 101 "Programming Language :: Python :: 3.11", 102 "Topic :: Utilities", 103 "Topic :: Software Development :: Libraries", 104 "Topic :: Software Development :: Libraries :: Python Modules", 105 ], 106 ) 107 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ "python-dotenv", "toml", "redis", - "hvac", + "hvac>=1.1.0", "configobj", ]
{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -33,7 +33,7 @@\n \"python-dotenv\",\n \"toml\",\n \"redis\",\n- \"hvac\",\n+ \"hvac>=1.1.0\",\n \"configobj\",\n ]\n", "issue": "[bug] TypeError for older versions of HVAC in read_secret_version method\n**Describe the bug**\r\nA combination of newer versions of Dynaconf with older versions of HVAC result in an incompatible mix of expected vs available arguments. Specifically you can get the following traceback.\r\n\r\n```python\r\n 109 try:\r\n 110 if obj.VAULT_KV_VERSION_FOR_DYNACONF == 2:\r\n--> 111 data = client.secrets.kv.v2.read_secret_version(\r\n 112 path,\r\n 113 mount_point=obj.VAULT_MOUNT_POINT_FOR_DYNACONF,\r\n 114 raise_on_deleted_version=True, # keep default behavior\r\n 115 )\r\n 116 else:\r\n 117 data = client.secrets.kv.read_secret(\r\n 118 \"data/\" + path,\r\n 119 mount_point=obj.VAULT_MOUNT_POINT_FOR_DYNACONF,\r\n 120 )\r\n\r\nTypeError: KvV2.read_secret_version() got an unexpected keyword argument 'raise_on_deleted_version'\r\n```\r\n\r\nThe PR introducing this feature was included in HVAC 1.1.0: https://github.com/hvac/hvac/pull/907 \r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n\r\n1. Have a version of HVAC older than 1.1.0\r\n2. Trigger a vault version read\r\n\r\n\r\n\n", "before_files": [{"content": "from __future__ import annotations\n\nimport os\n\nfrom setuptools import find_packages\nfrom setuptools import setup\n\n\ndef read(*names, **kwargs):\n \"\"\"Read a file.\"\"\"\n content = \"\"\n with open(\n os.path.join(os.path.dirname(__file__), *names),\n encoding=kwargs.get(\"encoding\", \"utf8\"),\n ) as open_file:\n content = open_file.read().strip()\n return content\n\n\ntest_requirements = [\n \"pytest\",\n \"pytest-cov\",\n \"pytest-xdist\",\n \"pytest-mock\",\n \"flake8\",\n \"pep8-naming\",\n \"flake8-debugger\",\n \"flake8-print\",\n \"flake8-todo\",\n \"radon\",\n \"flask>=0.12\",\n \"django\",\n \"python-dotenv\",\n \"toml\",\n \"redis\",\n \"hvac\",\n \"configobj\",\n]\n\n\nsetup(\n name=\"dynaconf\",\n version=read(\"dynaconf\", \"VERSION\"),\n url=\"https://github.com/dynaconf/dynaconf\",\n license=\"MIT\",\n license_files=[\"LICENSE\", \"vendor_licenses/*\"],\n author=\"Bruno Rocha\",\n author_email=\"[email protected]\",\n description=\"The dynamic configurator for your Python Project\",\n long_description=read(\"README.md\"),\n long_description_content_type=\"text/markdown\",\n packages=find_packages(\n exclude=[\n \"tests\",\n \"tests.*\",\n \"tests_functional\",\n \"tests_functional.*\",\n \"docs\",\n \"legacy_docs\",\n \"legacy_docs.*\",\n \"docs.*\",\n \"build\",\n \"build.*\",\n \"dynaconf.vendor_src\",\n \"dynaconf/vendor_src\",\n \"dynaconf.vendor_src.*\",\n \"dynaconf/vendor_src/*\",\n ]\n ),\n include_package_data=True,\n zip_safe=False,\n platforms=\"any\",\n tests_require=test_requirements,\n extras_require={\n \"redis\": [\"redis\"],\n \"vault\": [\"hvac\"],\n \"yaml\": [\"ruamel.yaml\"],\n \"toml\": [\"toml\"],\n \"ini\": [\"configobj\"],\n \"configobj\": [\"configobj\"],\n \"all\": [\"redis\", \"ruamel.yaml\", \"configobj\", \"hvac\"],\n \"test\": test_requirements,\n },\n python_requires=\">=3.8\",\n entry_points={\"console_scripts\": [\"dynaconf=dynaconf.cli:main\"]},\n setup_requires=[\"setuptools>=38.6.0\"],\n classifiers=[\n \"Development Status :: 5 - Production/Stable\",\n \"Framework :: Django\",\n \"Framework :: Flask\",\n \"Intended Audience :: Developers\",\n \"License :: OSI Approved :: MIT License\",\n \"Natural Language :: English\",\n \"Operating System :: OS Independent\",\n \"Programming Language :: Python\",\n \"Programming Language :: Python :: 3\",\n \"Programming Language :: Python :: 3 :: Only\",\n \"Programming Language :: Python :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n \"Programming Language :: Python :: 3.11\",\n \"Topic :: Utilities\",\n \"Topic :: Software Development :: Libraries\",\n \"Topic :: Software Development :: Libraries :: Python Modules\",\n ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "from __future__ import annotations\n\nimport os\n\nfrom setuptools import find_packages\nfrom setuptools import setup\n\n\ndef read(*names, **kwargs):\n \"\"\"Read a file.\"\"\"\n content = \"\"\n with open(\n os.path.join(os.path.dirname(__file__), *names),\n encoding=kwargs.get(\"encoding\", \"utf8\"),\n ) as open_file:\n content = open_file.read().strip()\n return content\n\n\ntest_requirements = [\n \"pytest\",\n \"pytest-cov\",\n \"pytest-xdist\",\n \"pytest-mock\",\n \"flake8\",\n \"pep8-naming\",\n \"flake8-debugger\",\n \"flake8-print\",\n \"flake8-todo\",\n \"radon\",\n \"flask>=0.12\",\n \"django\",\n \"python-dotenv\",\n \"toml\",\n \"redis\",\n \"hvac>=1.1.0\",\n \"configobj\",\n]\n\n\nsetup(\n name=\"dynaconf\",\n version=read(\"dynaconf\", \"VERSION\"),\n url=\"https://github.com/dynaconf/dynaconf\",\n license=\"MIT\",\n license_files=[\"LICENSE\", \"vendor_licenses/*\"],\n author=\"Bruno Rocha\",\n author_email=\"[email protected]\",\n description=\"The dynamic configurator for your Python Project\",\n long_description=read(\"README.md\"),\n long_description_content_type=\"text/markdown\",\n packages=find_packages(\n exclude=[\n \"tests\",\n \"tests.*\",\n \"tests_functional\",\n \"tests_functional.*\",\n \"docs\",\n \"legacy_docs\",\n \"legacy_docs.*\",\n \"docs.*\",\n \"build\",\n \"build.*\",\n \"dynaconf.vendor_src\",\n \"dynaconf/vendor_src\",\n \"dynaconf.vendor_src.*\",\n \"dynaconf/vendor_src/*\",\n ]\n ),\n include_package_data=True,\n zip_safe=False,\n platforms=\"any\",\n tests_require=test_requirements,\n extras_require={\n \"redis\": [\"redis\"],\n \"vault\": [\"hvac\"],\n \"yaml\": [\"ruamel.yaml\"],\n \"toml\": [\"toml\"],\n \"ini\": [\"configobj\"],\n \"configobj\": [\"configobj\"],\n \"all\": [\"redis\", \"ruamel.yaml\", \"configobj\", \"hvac\"],\n \"test\": test_requirements,\n },\n python_requires=\">=3.8\",\n entry_points={\"console_scripts\": [\"dynaconf=dynaconf.cli:main\"]},\n setup_requires=[\"setuptools>=38.6.0\"],\n classifiers=[\n \"Development Status :: 5 - Production/Stable\",\n \"Framework :: Django\",\n \"Framework :: Flask\",\n \"Intended Audience :: Developers\",\n \"License :: OSI Approved :: MIT License\",\n \"Natural Language :: English\",\n \"Operating System :: OS Independent\",\n \"Programming Language :: Python\",\n \"Programming Language :: Python :: 3\",\n \"Programming Language :: Python :: 3 :: Only\",\n \"Programming Language :: Python :: 3.8\",\n \"Programming Language :: Python :: 3.9\",\n \"Programming Language :: Python :: 3.10\",\n \"Programming Language :: Python :: 3.11\",\n \"Topic :: Utilities\",\n \"Topic :: Software Development :: Libraries\",\n \"Topic :: Software Development :: Libraries :: Python Modules\",\n ],\n)\n", "path": "setup.py"}]}
gh_patches_debug_20
rasdani/github-patches
git_diff
kedro-org__kedro-2345
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Release Kedro `0.18.5` ### Description Release Kedro `0.18.5` which will contain lots of new features for configuration. The release depends on the following tickets to be finished: - [x] BLOCKER: https://github.com/kedro-org/kedro/issues/2255 - [x] #1909 (Docs) - [x] #2148 - [x] #2170 - [x] #2225 Initially we wanted to include the below issues as well, but the implementation turned out to be trickier than expected, so we'll take more time to investigate a solution and won't let it block the release. - [x] #2146 - [x] #2212 --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `kedro/__init__.py` Content: ``` 1 """Kedro is a framework that makes it easy to build robust and scalable 2 data pipelines by providing uniform project templates, data abstraction, 3 configuration and pipeline assembly. 4 """ 5 6 __version__ = "0.18.4" 7 8 9 import logging 10 11 logging.getLogger(__name__).addHandler(logging.NullHandler()) 12 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/kedro/__init__.py b/kedro/__init__.py --- a/kedro/__init__.py +++ b/kedro/__init__.py @@ -3,7 +3,7 @@ configuration and pipeline assembly. """ -__version__ = "0.18.4" +__version__ = "0.18.5" import logging
{"golden_diff": "diff --git a/kedro/__init__.py b/kedro/__init__.py\n--- a/kedro/__init__.py\n+++ b/kedro/__init__.py\n@@ -3,7 +3,7 @@\n configuration and pipeline assembly.\n \"\"\"\n \n-__version__ = \"0.18.4\"\n+__version__ = \"0.18.5\"\n \n \n import logging\n", "issue": "Release Kedro `0.18.5`\n### Description\r\n\r\nRelease Kedro `0.18.5` which will contain lots of new features for configuration. The release depends on the following tickets to be finished:\r\n\r\n- [x] BLOCKER: https://github.com/kedro-org/kedro/issues/2255\r\n- [x] #1909 (Docs)\r\n- [x] #2148 \r\n- [x] #2170\r\n- [x] #2225 \r\n\r\nInitially we wanted to include the below issues as well, but the implementation turned out to be trickier than expected, so we'll take more time to investigate a solution and won't let it block the release.\r\n- [x] #2146 \r\n- [x] #2212 \r\n\n", "before_files": [{"content": "\"\"\"Kedro is a framework that makes it easy to build robust and scalable\ndata pipelines by providing uniform project templates, data abstraction,\nconfiguration and pipeline assembly.\n\"\"\"\n\n__version__ = \"0.18.4\"\n\n\nimport logging\n\nlogging.getLogger(__name__).addHandler(logging.NullHandler())\n", "path": "kedro/__init__.py"}], "after_files": [{"content": "\"\"\"Kedro is a framework that makes it easy to build robust and scalable\ndata pipelines by providing uniform project templates, data abstraction,\nconfiguration and pipeline assembly.\n\"\"\"\n\n__version__ = \"0.18.5\"\n\n\nimport logging\n\nlogging.getLogger(__name__).addHandler(logging.NullHandler())\n", "path": "kedro/__init__.py"}]}
gh_patches_debug_21
rasdani/github-patches
git_diff
wright-group__WrightTools-168
We are currently solving the following issue within our repository. Here is the issue text: --- BEGIN ISSUE --- Contours in mpl_2D seem to have shape problem. I'm running the following script ``` import WrightTools as wt p = '000.data' d = wt.data.from_PyCMDS(p) d.signal_ratio.clip(zmin=-4, zmax=4) d.signal_ratio.znull = 0 d.signal_ratio.signed = True d.signal_ratio._update() art = wt.artists.mpl_2D(d) art.plot(channel='signal_ratio', contours=9) ``` using the dataset found in `'Google Drive/MX2/CMDS/2017-08-07/p-CMDS-p/0ps 51 [w2, w1]'`. I get the following error. ``` Traceback (most recent call last): File "<ipython-input-98-92c093c4abb1>", line 1, in <module> runfile('/Users/darienmorrow/Google Drive/MX2/CMDS/2017-08-07/p-CMDS-p/0ps 51 [w2, w1]/workup.py', wdir='/Users/darienmorrow/Google Drive/MX2/CMDS/2017-08-07/p-CMDS-p/0ps 51 [w2, w1]') File "/Users/darienmorrow/anaconda/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 866, in runfile execfile(filename, namespace) File "/Users/darienmorrow/anaconda/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "/Users/darienmorrow/Google Drive/MX2/CMDS/2017-08-07/p-CMDS-p/0ps 51 [w2, w1]/workup.py", line 15, in <module> art.plot(channel='signal_ratio', contours=9, contours_local=False) File "/Users/darienmorrow/source/WrightTools/WrightTools/artists.py", line 1858, in plot subplot_main.contour(X, Y, zi, contours_levels, colors='k') File "/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/__init__.py", line 1892, in inner return func(ax, *args, **kwargs) File "/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/axes/_axes.py", line 5819, in contour contours = mcontour.QuadContourSet(self, *args, **kwargs) File "/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/contour.py", line 864, in __init__ self._process_args(*args, **kwargs) File "/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/contour.py", line 1429, in _process_args x, y, z = self._contour_args(args, kwargs) File "/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/contour.py", line 1508, in _contour_args x, y, z = self._check_xyz(args[:3], kwargs) File "/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/contour.py", line 1566, in _check_xyz "{0} instead of {1}.".format(x.shape, z.shape)) TypeError: Shape of x does not match that of z: found (52, 52) instead of (51, 51). ``` --- END ISSUE --- Below are some code segments, each from a relevant file. One or more of these files may contain bugs. --- BEGIN FILES --- Path: `examples/rRaman.py` Content: ``` 1 # -*- coding: utf-8 -*- 2 """ 3 Resonance Raman 4 ========== 5 6 A Resonance Raman plot. 7 """ 8 9 import WrightTools as wt 10 from WrightTools import datasets 11 12 p = datasets.BrunoldrRaman.LDS821_514nm_80mW 13 data = wt.data.from_BrunoldrRaman(p) 14 trash_pixels = 56 15 data = data.split(0, 843.0)[1] 16 17 data.convert('wn', verbose=False) 18 19 artist = wt.artists.mpl_1D(data) 20 d = artist.plot() 21 ``` --- END FILES --- Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks. Here is an example: ```diff diff --git a/examples/server_async.py b/examples/server_async.py --- a/examples/server_async.py +++ b/examples/server_async.py @@ -313,4 +313,4 @@ if __name__ == "__main__": - asyncio.run(run_async_server("."), debug=True) + asyncio.run(run_async_server(), debug=True) diff --git a/examples/server_sync.py b/examples/server_sync.py --- a/examples/server_sync.py +++ b/examples/server_sync.py @@ -313,5 +313,5 @@ if __name__ == "__main__": - server = run_sync_server(".") + server = run_sync_server() server.shutdown() ```
diff --git a/examples/rRaman.py b/examples/rRaman.py --- a/examples/rRaman.py +++ b/examples/rRaman.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ Resonance Raman -========== +=============== A Resonance Raman plot. """
{"golden_diff": "diff --git a/examples/rRaman.py b/examples/rRaman.py\n--- a/examples/rRaman.py\n+++ b/examples/rRaman.py\n@@ -1,7 +1,7 @@\n # -*- coding: utf-8 -*-\n \"\"\"\n Resonance Raman\n-==========\n+===============\n \n A Resonance Raman plot.\n \"\"\"\n", "issue": "Contours in mpl_2D seem to have shape problem. \nI'm running the following script\r\n```\r\nimport WrightTools as wt\r\n\r\np = '000.data'\r\nd = wt.data.from_PyCMDS(p)\r\nd.signal_ratio.clip(zmin=-4, zmax=4)\r\nd.signal_ratio.znull = 0\r\nd.signal_ratio.signed = True\r\nd.signal_ratio._update()\r\n\r\nart = wt.artists.mpl_2D(d)\r\nart.plot(channel='signal_ratio', contours=9)\r\n```\r\nusing the dataset found in `'Google Drive/MX2/CMDS/2017-08-07/p-CMDS-p/0ps 51 [w2, w1]'`. I get the following error.\r\n```\r\nTraceback (most recent call last):\r\n\r\n File \"<ipython-input-98-92c093c4abb1>\", line 1, in <module>\r\n runfile('/Users/darienmorrow/Google Drive/MX2/CMDS/2017-08-07/p-CMDS-p/0ps 51 [w2, w1]/workup.py', wdir='/Users/darienmorrow/Google Drive/MX2/CMDS/2017-08-07/p-CMDS-p/0ps 51 [w2, w1]')\r\n\r\n File \"/Users/darienmorrow/anaconda/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py\", line 866, in runfile\r\n execfile(filename, namespace)\r\n\r\n File \"/Users/darienmorrow/anaconda/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py\", line 102, in execfile\r\n exec(compile(f.read(), filename, 'exec'), namespace)\r\n\r\n File \"/Users/darienmorrow/Google Drive/MX2/CMDS/2017-08-07/p-CMDS-p/0ps 51 [w2, w1]/workup.py\", line 15, in <module>\r\n art.plot(channel='signal_ratio', contours=9, contours_local=False)\r\n\r\n File \"/Users/darienmorrow/source/WrightTools/WrightTools/artists.py\", line 1858, in plot\r\n subplot_main.contour(X, Y, zi, contours_levels, colors='k')\r\n\r\n File \"/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/__init__.py\", line 1892, in inner\r\n return func(ax, *args, **kwargs)\r\n\r\n File \"/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/axes/_axes.py\", line 5819, in contour\r\n contours = mcontour.QuadContourSet(self, *args, **kwargs)\r\n\r\n File \"/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/contour.py\", line 864, in __init__\r\n self._process_args(*args, **kwargs)\r\n\r\n File \"/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/contour.py\", line 1429, in _process_args\r\n x, y, z = self._contour_args(args, kwargs)\r\n\r\n File \"/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/contour.py\", line 1508, in _contour_args\r\n x, y, z = self._check_xyz(args[:3], kwargs)\r\n\r\n File \"/Users/darienmorrow/anaconda/lib/python3.6/site-packages/matplotlib/contour.py\", line 1566, in _check_xyz\r\n \"{0} instead of {1}.\".format(x.shape, z.shape))\r\n\r\nTypeError: Shape of x does not match that of z: found (52, 52) instead of (51, 51).\r\n```\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nResonance Raman\n==========\n\nA Resonance Raman plot.\n\"\"\"\n\nimport WrightTools as wt\nfrom WrightTools import datasets\n\np = datasets.BrunoldrRaman.LDS821_514nm_80mW\ndata = wt.data.from_BrunoldrRaman(p)\ntrash_pixels = 56\ndata = data.split(0, 843.0)[1]\n\ndata.convert('wn', verbose=False)\n\nartist = wt.artists.mpl_1D(data)\nd = artist.plot()\n", "path": "examples/rRaman.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nResonance Raman\n===============\n\nA Resonance Raman plot.\n\"\"\"\n\nimport WrightTools as wt\nfrom WrightTools import datasets\n\np = datasets.BrunoldrRaman.LDS821_514nm_80mW\ndata = wt.data.from_BrunoldrRaman(p)\ntrash_pixels = 56\ndata = data.split(0, 843.0)[1]\n\ndata.convert('wn', verbose=False)\n\nartist = wt.artists.mpl_1D(data)\nd = artist.plot()\n", "path": "examples/rRaman.py"}]}
End of preview. Expand in Data Studio
import re
import json
from datasets import load_dataset

PROMPT_TEMPLATE = """\
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
{issue}
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
{file_context}
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

\```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

\```
"""

ds = load_dataset("rasdani/github-patches-10k-sample-sorted", split="train")


def prepend_line_numbers(file_content: str) -> str:
    if not file_content:
        return ""
    lines = file_content.split('\n')
    lines = [f"{i+1} {line}" for i, line in enumerate(lines)]
    ret = '\n'.join(lines)
    ret = ret.strip() + "\n"
    return ret

def normalize_diff(diff_text: str) -> str:
    diff_text = re.sub(r'(?m)^index [^\n]*\n', '', diff_text)
    diff_text = re.sub(r'(?m)^(@@[^@]*@@).*', r'\1', diff_text)
    diff_text = diff_text.strip() + "\n"
    return diff_text

def filter_diff_by_files(diff: str, touched_files: set) -> str:
    """Filter a git diff to only include changes for specific files."""
    if not touched_files:
        return diff
    
    lines = diff.split('\n')
    filtered_lines = []
    include_section = False
    
    for line in lines:
        if line.startswith('diff --git'):
            # Check if this file should be included
            # Extract the file path from "diff --git a/path b/path"
            match = re.match(r'diff --git a/(.*?) b/', line)
            if match:
                file_path = match.group(1)
                include_section = file_path in touched_files
            else:
                include_section = False
        
        if include_section:
            filtered_lines.append(line)
    
    return '\n'.join(filtered_lines)

def create_golden_diff(example):
    before_paths = [b["path"] for b in example["before_files"]]
    after_paths = [a["path"] for a in example["after_files"]]
    touched_files = set(before_paths) | set(after_paths)
    filtered_diff = filter_diff_by_files(example["pr_diff"], touched_files)
    golden_diff = normalize_diff(filtered_diff)
    for path in touched_files:
        assert path in golden_diff, f"Path {path} not found in golden diff {golden_diff}"
    verification_info_dict = {
        "golden_diff": golden_diff,
        "issue": example["issue"],
        "before_files": example["before_files"],
        "after_files": example["after_files"],
    }
    verification_info = json.dumps(verification_info_dict)
    return {"golden_diff": golden_diff, "verification_info": verification_info}

def create_prompt(example):
    golden_diff = example["golden_diff"]
    issue = example["issue"]
    before_files = example["before_files"]
    file_context = [f"Path: `{x['path']}`\nContent:\n```\n{prepend_line_numbers(x['content'])}```" for x in before_files]
    file_context = "\n\n".join(file_context)
    prompt = PROMPT_TEMPLATE.format(issue=issue, file_context=file_context, golden_diff=golden_diff)
    print(prompt)
    print("="*100)
    return {"prompt": prompt}

    

ds_up = ds.map(lambda x, idx: {"problem_id": f"gh_patches_debug_{idx}"}, with_indices=True)
ds_up = ds_up.map(lambda x: {"source": "rasdani/github-patches", "task_type": "git_diff"})

ds_up = ds_up.map(create_golden_diff, num_proc=10)
# example = ds_up[0]
# create_prompt(example)
ds_up = ds_up.map(create_prompt, num_proc=10)

ds_up = ds_up.select_columns(["problem_id", "source", "task_type", "in_source_id", "prompt", "golden_diff", "verification_info"])

# ds_up.push_to_hub("rasdani/github-patches-debug")
ds_up.push_to_hub("rasdani/github-patches-debug-genesys")
Downloads last month
118