Dataset Viewer
Auto-converted to Parquet Duplicate
in_source_id
string
before_files
list
after_files
list
pr_diff
string
issue
string
golden_diff
string
verification_info
string
prompt
string
conda-forge__conda-smithy-864
[ { "content": "", "path": "conda_smithy/vendored/__init__.py" } ]
[ { "content": "\n", "path": "conda_smithy/vendored/__init__.py" } ]
diff --git a/.gitignore b/.gitignore index 4f4b3b35c..5761ca997 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,9 @@ dist/ # Rever rever/ + +# Notepad++ files +nppBackup/ + +# Pytest dirs/files +.pytest_cache/ diff --git a/conda_smithy/templates/README.md.tmpl b/conda_smithy/templates/README.md.tmpl index 662...
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...
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"}
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...
microsoft__AzureTRE-1754
[ { "content": "__version__ = \"0.2.28\"\n", "path": "api_app/_version.py" } ]
[ { "content": "__version__ = \"0.3.0\"\n", "path": "api_app/_version.py" } ]
diff --git a/api_app/_version.py b/api_app/_version.py index 968391a2db..493f7415d7 100644 --- a/api_app/_version.py +++ b/api_app/_version.py @@ -1 +1 @@ -__version__ = "0.2.28" +__version__ = "0.3.0" diff --git a/resource_processor/version.txt b/resource_processor/version.txt index 6852ddf8f7..493f7415d7 100644 --- a...
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 cr...
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"}
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...
OpenEnergyPlatform__oeplatform-1475
[ { "content": "__version__ = \"0.16.1\"\n", "path": "oeplatform/__init__.py" } ]
[ { "content": "__version__ = \"0.16.2\"\n", "path": "oeplatform/__init__.py" } ]
"diff --git a/.bumpversion.cfg b/.bumpversion.cfg\nindex d51e9eadd..46cdebef9 100644\n--- a/.bumpver(...TRUNCATED)
"Scenario bundles: Output datasets render weirdly\n## Description of the issue\r\n\r\nI added an out(...TRUNCATED)
"diff --git a/oeplatform/__init__.py b/oeplatform/__init__.py\n--- a/oeplatform/__init__.py\n+++ b/o(...TRUNCATED)
"{\"golden_diff\": \"diff --git a/oeplatform/__init__.py b/oeplatform/__init__.py\\n--- a/oeplatform(...TRUNCATED)
"We are currently solving the following issue within our repository. Here is the issue text:\n--- BE(...TRUNCATED)
OCHA-DAP__hdx-ckan-1655
[ { "content": "hdx_version = 'v0.4.5'\n", "path": "ckanext-hdx_theme/ckanext/hdx_theme/version.py" } ]
[ { "content": "hdx_version = 'v0.4.6'\n", "path": "ckanext-hdx_theme/ckanext/hdx_theme/version.py" } ]
"diff --git a/ckanext-hdx_search/ckanext/hdx_search/tests/test_search.py b/ckanext-hdx_search/ckanex(...TRUNCATED)
"Main Nav changes to accomodate \"Feedback\" button\nUpdating the action based on discussions:\n1. R(...TRUNCATED)
"diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/version.py b/ckanext-hdx_theme/ckanext/hdx_theme/v(...TRUNCATED)
"{\"golden_diff\": \"diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/version.py b/ckanext-hdx_theme(...TRUNCATED)
"We are currently solving the following issue within our repository. Here is the issue text:\n--- BE(...TRUNCATED)
OCHA-DAP__hdx-ckan-2076
[ { "content": "hdx_version = 'v0.5.13'\n", "path": "ckanext-hdx_theme/ckanext/hdx_theme/version.py" } ]
[ { "content": "hdx_version = 'v0.5.15'\n", "path": "ckanext-hdx_theme/ckanext/hdx_theme/version.py" } ]
"diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/css/login.css b/ckanext-hdx_theme/ckanex(...TRUNCATED)
"Login page: change spacing on left panel \nThe spacing in the left panel is odd. Change to somethi(...TRUNCATED)
"diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/version.py b/ckanext-hdx_theme/ckanext/hdx_theme/v(...TRUNCATED)
"{\"golden_diff\": \"diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/version.py b/ckanext-hdx_theme(...TRUNCATED)
"We are currently solving the following issue within our repository. Here is the issue text:\n--- BE(...TRUNCATED)
sql-machine-learning__elasticdl-1463
[ { "content": "", "path": "elasticdl/python/elasticdl/__init__.py" } ]
[{"content":"from elasticdl.python.elasticdl import layers # noqa: F401\n","path":"elasticdl/python(...TRUNCATED)
"diff --git a/elasticdl/python/elasticdl/__init__.py b/elasticdl/python/elasticdl/__init__.py\nindex(...TRUNCATED)
"No module named 'elasticdl.python.elasticdl.layers' on master\n```\r\nTraceback (most recent call l(...TRUNCATED)
"diff --git a/elasticdl/python/elasticdl/__init__.py b/elasticdl/python/elasticdl/__init__.py\n--- a(...TRUNCATED)
"{\"golden_diff\": \"diff --git a/elasticdl/python/elasticdl/__init__.py b/elasticdl/python/elasticd(...TRUNCATED)
"We are currently solving the following issue within our repository. Here is the issue text:\n--- BE(...TRUNCATED)
codespell-project__codespell-2626
[{"content":"#! /usr/bin/env python\n\nfrom setuptools import setup\n\nif __name__ == \"__main__\":\(...TRUNCATED)
[ { "content": null, "path": "setup.py" } ]
"diff --git a/.github/workflows/codespell-private.yml b/.github/workflows/codespell-private.yml\nind(...TRUNCATED)
"`python setup.py check` → `twine check`\nBecause `setup.py ...` is deprecated, we need an alterna(...TRUNCATED)
"diff --git a/setup.py b/setup.py\ndeleted file mode 100755\n--- a/setup.py\n+++ /dev/null\n@@ -1,6 (...TRUNCATED)
"{\"golden_diff\": \"diff --git a/setup.py b/setup.py\\ndeleted file mode 100755\\n--- a/setup.py\\n(...TRUNCATED)
"We are currently solving the following issue within our repository. Here is the issue text:\n--- BE(...TRUNCATED)
django__channels-1860
[{"content":"__version__ = \"3.0.4\"\n\ntry:\n import django\n\n if django.VERSION < (3, 2):\n(...TRUNCATED)
[{"content":"__version__ = \"3.0.5\"\n\ntry:\n import django\n\n if django.VERSION < (3, 2):\n(...TRUNCATED)
"diff --git a/CHANGELOG.txt b/CHANGELOG.txt\nindex b013f0f0a..a81f6254c 100644\n--- a/CHANGELOG.txt\(...TRUNCATED)
"Current version on Pypi is incompatible with Django 4.0+\nThe current version available on Pypi, ch(...TRUNCATED)
"diff --git a/channels/__init__.py b/channels/__init__.py\n--- a/channels/__init__.py\n+++ b/channel(...TRUNCATED)
"{\"golden_diff\": \"diff --git a/channels/__init__.py b/channels/__init__.py\\n--- a/channels/__ini(...TRUNCATED)
"We are currently solving the following issue within our repository. Here is the issue text:\n--- BE(...TRUNCATED)
MongoEngine__mongoengine-2224
[{"content":"# Import submodules so that we can expose their __all__\nfrom mongoengine import connec(...TRUNCATED)
[{"content":"# Import submodules so that we can expose their __all__\nfrom mongoengine import connec(...TRUNCATED)
"diff --git a/docs/changelog.rst b/docs/changelog.rst\nindex b308c5fba..06eb8d0ce 100644\n--- a/docs(...TRUNCATED)
"New release\nHi,\r\n\r\nWhen is coming new release, because I can't update to mongodb 4.2 because o(...TRUNCATED)
"diff --git a/mongoengine/__init__.py b/mongoengine/__init__.py\n--- a/mongoengine/__init__.py\n+++ (...TRUNCATED)
"{\"golden_diff\": \"diff --git a/mongoengine/__init__.py b/mongoengine/__init__.py\\n--- a/mongoeng(...TRUNCATED)
"We are currently solving the following issue within our repository. Here is the issue text:\n--- BE(...TRUNCATED)
scikit-image__scikit-image-6307
[{"content":"__all__ = ['python_to_notebook', 'Notebook']\n\nimport json\nimport copy\nimport warnin(...TRUNCATED)
[{"content":"__all__ = ['Notebook']\n\nimport json\nimport copy\nimport warnings\n\n\n# Skeleton not(...TRUNCATED)
"diff --git a/doc/ext/notebook_doc.py b/doc/ext/notebook_doc.py\nindex 432f1374c91..628ddd04727 1006(...TRUNCATED)
"Undefined names in Python code found with flake8\n## Description\r\n\r\n\r\n## Way to reproduce\r\n(...TRUNCATED)
"diff --git a/doc/ext/notebook_doc.py b/doc/ext/notebook_doc.py\n--- a/doc/ext/notebook_doc.py\n+++ (...TRUNCATED)
"{\"golden_diff\": \"diff --git a/doc/ext/notebook_doc.py b/doc/ext/notebook_doc.py\\n--- a/doc/ext/(...TRUNCATED)
"We are currently solving the following issue within our repository. Here is the issue text:\n--- BE(...TRUNCATED)
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:
    lines = file_content.split('\n')
    lines = [f"{i+1} {line}" for i, line in enumerate(lines)]
    return '\n'.join(lines)

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 = json.dumps({"golden_diff": golden_diff})
    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(create_golden_diff, num_proc=10)
# example = ds_gen[-1]
# create_prompt(example)
ds_up = ds_gen.map(create_prompt, num_proc=10)
ds_up.push_to_hub("rasdani/github-patches-debug")
Downloads last month
7