Dataset Viewer
Auto-converted to Parquet Duplicate
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 arb...
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 mult...
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...
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...
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-...
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 outpu...
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...
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 ...
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-87...
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 p...
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) ...
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....
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...
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 dep...
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 Djang...
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...
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. ...
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 ...
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 $ __flake...
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 fl...
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...
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...
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....
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", "is...
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_t...
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...
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...
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#...
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...
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 @...
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 respons...
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 sup...
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/4f47dfb64dff920c237...
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....
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/9df39ab1801369cb494...
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...
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 freqtrade...
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: Categorical...
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...
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**Describ...
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...
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...
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_ra...
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...
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
11