internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: cookiecutter/cookiecutter

Issue:
Add log message to get_user_config function
there should be debug message for cases when default config overwrites user_config. 
Currently, it is done silently.


Discussion:

Resolving patch:
diff --git a/cookiecutter/config.py b/cookiecutter/config.py
--- a/cookiecutter/config.py
+++ b/cookiecutter/config.py
@@ -103,10 +103,12 @@ def get_user_config(config_file=None, default_config=False):
     """
     # Do NOT load a config. Return defaults instead.
     if default_config:
+        logger.debug("Force ignoring user config with default_config switch.")
         return copy.copy(DEFAULT_CONFIG)
 
     # Load the given config file
     if config_file and config_file is not USER_CONFIG_PATH:
+        logger.debug("Loading custom config from %s.", config_file)
         return get_config(config_file)
 
     try:
@@ -116,10 +118,13 @@ def get_user_config(config_file=None, default_config=False):
         # Load an optional user config if it exists
         # otherwise return the defaults
         if os.path.exists(USER_CONFIG_PATH):
+            logger.debug("Loading config from %s.", USER_CONFIG_PATH)
             return get_config(USER_CONFIG_PATH)
         else:
+            logger.debug("User config not found. Loading default config.")
             return copy.copy(DEFAULT_CONFIG)
     else:
         # There is a config environment variable. Try to load it.
         # Do not check for existence, so invalid file paths raise an error.
+        logger.debug("User config not found or not specified. Loading default config.")
         return get_config(env_config_file)


Test patch:
Repository: cookiecutter/cookiecutter

Issue:
private rendered dict is still prompted
* Cookiecutter version: 2.0.0 from commit 52dd18513bbab7f0fbfcb2938c9644d9092247cf
* Python version: py3.8.7
* Operating System: Win

### Description:
For the `cookiecutter.json` below the private, rendered dict `__module_names` is still prompted in the output (last line).

For private variables c.f. https://github.com/cookiecutter/cookiecutter/issues/1115#issuecomment-442522474

### What I've run:

**cookiecutter.json:**
```
{
    "project_name": "Project Name",
    "project_slug": "{{ cookiecutter.project_name|lower|replace(' ', '-') }}",
    "__package_name": "{{ cookiecutter.project_name|lower|replace(' ', '_') }}",

    "__module_names": {
        "within": "{{ cookiecutter.project_slug }}",
        "outside": "{{ cookiecutter.__package_name }}"
    }
}
```
**verbose output:**
```
$ cookiecutter .\cookiecutter-context-test\ -f -v

DEBUG cookiecutter.config: User config not found. Loading default config.
DEBUG cookiecutter.main: context_file is .\cookiecutter-context-test\cookiecutter.json
DEBUG cookiecutter.generate: Context generated is OrderedDict([('cookiecutter', OrderedDict([('project_name', 'Project Name'), ('project_slug', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('__package_name', "{{ cookiecutter.project_name|lower|replace(' ', '_') }}"), ('__module_names', OrderedDict([('within', '{{ cookiecutter.project_slug }}'), ('outside', '{{ cookiecutter.__package_name }}')]))]))])
project_name [Project Name]: 
project_slug [project-name]: 
__module_names [default]:
```




Discussion:

Resolving patch:
diff --git a/cookiecutter/prompt.py b/cookiecutter/prompt.py
--- a/cookiecutter/prompt.py
+++ b/cookiecutter/prompt.py
@@ -209,7 +209,7 @@ def prompt_for_config(context, no_input=False):
 
     # Second pass; handle the dictionaries.
     for key, raw in context['cookiecutter'].items():
-        # Skip private type dicts
+        # Skip private type dicts not ot be rendered.
         if key.startswith('_') and not key.startswith('__'):
             continue
 
@@ -218,7 +218,7 @@ def prompt_for_config(context, no_input=False):
                 # We are dealing with a dict variable
                 val = render_variable(env, raw, cookiecutter_dict)
 
-                if not no_input:
+                if not no_input and not key.startswith('__'):
                     val = read_user_dict(key, val)
 
                 cookiecutter_dict[key] = val


Test patch:
Repository: cookiecutter/cookiecutter

Issue:
`cookiecutter --version` prints out the wrong Python version on 3.10
``` console
$ cookiecutter --version
Cookiecutter 1.7.3 from /usr/lib/python3.10/site-packages (Python 3.1)
```

It should end with `(Python 3.10)` not `(Python 3.1)`. This seems to be the problematic code:

https://github.com/cookiecutter/cookiecutter/blob/f821895a0cb536a907ac2937471d7d4ac36fec75/cookiecutter/cli.py#L26-L31


Discussion:
I would like to work on this issue.

Resolving patch:
diff --git a/cookiecutter/cli.py b/cookiecutter/cli.py
--- a/cookiecutter/cli.py
+++ b/cookiecutter/cli.py
@@ -25,7 +25,7 @@
 
 def version_msg():
     """Return the Cookiecutter version, location and Python powering it."""
-    python_version = sys.version[:3]
+    python_version = sys.version
     location = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
     message = 'Cookiecutter %(version)s from {} (Python {})'
     return message.format(location, python_version)


Test patch:
diff --git a/tests/test_cli.py b/tests/test_cli.py
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -4,6 +4,7 @@
 import os
 import re
 
+
 import pytest
 from click.testing import CliRunner
 
@@ -48,7 +49,7 @@ def version_cli_flag(request):
 
 
 def test_cli_version(cli_runner, version_cli_flag):
-    """Verify correct version output by `cookiecutter` on cli invocation."""
+    """Verify Cookiecutter version output by `cookiecutter` on cli invocation."""
     result = cli_runner(version_cli_flag)
     assert result.exit_code == 0
     assert result.output.startswith('Cookiecutter')
Repository: cookiecutter/cookiecutter

Issue:
Documentation 2.0: All tutorials should be combined to one menu
All tutorials should be combined to one menu


Discussion:
Can I take this one ?
Also all the tutorials need to be under a new `tutorials` folder right?
@Bhupesh-V Yes it is free task and we will be glad if you make some work with PR on it. 
About how to combine it is up to you on final format. There are 3-4 parts of documentation that can be considered as tutorials. 
> @Bhupesh-V Yes it is free task and we will be glad if you make some work with PR on it.
> About how to combine it is up to you on final format. There are 3-4 parts of documentation that can be considered as tutorials.

Ok thanks, I will come up with a Draft PR soon

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -95,7 +95,7 @@ def __getattr__(cls, name):
 
 # General information about the project.
 project = 'cookiecutter'
-copyright = '2013-2019, Audrey Roy and Cookiecutter community'
+copyright = '2013-2022, Audrey Roy and Cookiecutter community'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -324,7 +324,7 @@ def __getattr__(cls, name):
 epub_title = 'cookiecutter'
 epub_author = 'Audrey Roy'
 epub_publisher = 'Audrey Roy and Cookiecutter community'
-epub_copyright = '2013-2019, Audrey Roy and Cookiecutter community'
+epub_copyright = '2013-2022, Audrey Roy and Cookiecutter community'
 
 # The language of the text. It defaults to the language option
 # or en if the language is not set.
@@ -377,4 +377,4 @@ def __getattr__(cls, name):
 
 
 # Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'http://docs.python.org/': None}
+intersphinx_mapping = {'https://docs.python.org/3': None}
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
 """cookiecutter distutils configuration."""
 from setuptools import setup
 
-version = "2.0.0"
+version = "2.0.3.dev0"
 
 with open('README.md', encoding='utf-8') as readme_file:
     readme = readme_file.read()
@@ -34,7 +34,7 @@
     package_dir={'cookiecutter': 'cookiecutter'},
     entry_points={'console_scripts': ['cookiecutter = cookiecutter.__main__:main']},
     include_package_data=True,
-    python_requires='>=3.6',
+    python_requires='>=3.7',
     install_requires=requirements,
     license='BSD',
     zip_safe=False,
@@ -46,10 +46,10 @@
         "License :: OSI Approved :: BSD License",
         "Programming Language :: Python :: 3 :: Only",
         "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
         "Programming Language :: Python :: Implementation :: CPython",
         "Programming Language :: Python :: Implementation :: PyPy",
         "Programming Language :: Python",


Test patch:
Repository: cookiecutter/cookiecutter

Issue:
Replace recommonmark with myst, as recommonmark is deprecated
In docs


Discussion:

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -28,31 +28,6 @@
 
 # flake8: noqa D107,D105
 
-
-class Mock(object):
-    def __init__(self, *args, **kwargs):
-        pass
-
-    def __call__(self, *args, **kwargs):
-        return Mock()
-
-    @classmethod
-    def __getattr__(cls, name):
-        if name in ('__file__', '__path__'):
-            return '/dev/null'
-        elif name[0] == name[0].upper():
-            mockType = type(name, (), {})
-            mockType.__module__ = __name__
-            return mockType
-        else:
-            return Mock()
-
-
-MOCK_MODULES = ['yaml']
-for mod_name in MOCK_MODULES:
-    sys.modules[mod_name] = Mock()
-
-
 # Add parent dir to path
 cwd = os.getcwd()
 parent = os.path.dirname(cwd)
@@ -78,7 +53,7 @@ def __getattr__(cls, name):
     'sphinx.ext.ifconfig',
     'sphinx.ext.viewcode',
     'sphinx_click.ext',
-    'recommonmark',
+    'myst_parser',
 ]
 
 # Add any paths that contain templates here, relative to this directory.
@@ -378,3 +353,9 @@ def __getattr__(cls, name):
 
 # Example configuration for intersphinx: refer to the Python standard library.
 intersphinx_mapping = {'https://docs.python.org/3': None}
+myst_enable_extensions = [
+    "tasklist",
+    "strikethrough",
+    "fieldlist",
+]
+myst_heading_anchors = 3


Test patch:
Repository: cookiecutter/cookiecutter

Issue:
CI/CD: Verify .pre-commit-config.yaml use latest hooks versions



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 """cookiecutter distutils configuration."""
 from setuptools import setup
 


Test patch:
diff --git a/tests/hooks-abort-render/hooks/post_gen_project.py b/tests/hooks-abort-render/hooks/post_gen_project.py
--- a/tests/hooks-abort-render/hooks/post_gen_project.py
+++ b/tests/hooks-abort-render/hooks/post_gen_project.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # flake8: noqa
 
 """Simple post-gen hook for testing the handling of different exit codes."""
diff --git a/tests/hooks-abort-render/hooks/pre_gen_project.py b/tests/hooks-abort-render/hooks/pre_gen_project.py
--- a/tests/hooks-abort-render/hooks/pre_gen_project.py
+++ b/tests/hooks-abort-render/hooks/pre_gen_project.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # flake8: noqa
 
 """Simple pre-gen hook for testing the handling of different exit codes."""
diff --git a/tests/test-pyhooks/hooks/post_gen_project.py b/tests/test-pyhooks/hooks/post_gen_project.py
--- a/tests/test-pyhooks/hooks/post_gen_project.py
+++ b/tests/test-pyhooks/hooks/post_gen_project.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 """Simple post-gen hook for testing project folder and custom file creation."""
 
 print('pre generation hook')
diff --git a/tests/test-pyhooks/hooks/pre_gen_project.py b/tests/test-pyhooks/hooks/pre_gen_project.py
--- a/tests/test-pyhooks/hooks/pre_gen_project.py
+++ b/tests/test-pyhooks/hooks/pre_gen_project.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 """Simple pre-gen hook for testing project folder and custom file creation."""
 
 print('pre generation hook')
diff --git a/tests/test-pyshellhooks/hooks/post_gen_project.py b/tests/test-pyshellhooks/hooks/post_gen_project.py
--- a/tests/test-pyshellhooks/hooks/post_gen_project.py
+++ b/tests/test-pyshellhooks/hooks/post_gen_project.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 """Simple post-gen hook for testing project folder and custom file creation."""
 
 print('pre generation hook')
diff --git a/tests/test-pyshellhooks/hooks/pre_gen_project.py b/tests/test-pyshellhooks/hooks/pre_gen_project.py
--- a/tests/test-pyshellhooks/hooks/pre_gen_project.py
+++ b/tests/test-pyshellhooks/hooks/pre_gen_project.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 """Simple pre-gen hook for testing project folder and custom file creation."""
Repository: cookiecutter/cookiecutter

Issue:
CI/CD: Docs watchmedo -> sphinx-autobuild
sphinx-autobuild is sphinx component, that able to watch codebase changes, so we need to use it, instead of watchmedo


Discussion:

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -54,6 +54,7 @@
     'sphinx.ext.viewcode',
     'sphinx_click.ext',
     'myst_parser',
+    'sphinxcontrib.apidoc',
 ]
 
 # Add any paths that contain templates here, relative to this directory.
@@ -359,3 +360,8 @@
     "fieldlist",
 ]
 myst_heading_anchors = 3
+# Apidoc extension config
+apidoc_module_dir = "../cookiecutter"
+apidoc_output_dir = "."
+apidoc_toc_file = False
+apidoc_extra_args = ["-t", "_templates"]
diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -2,6 +2,9 @@
 
 Nox is Tox tool replacement.
 """
+import shutil
+from pathlib import Path
+
 import nox
 
 nox.options.keywords = "not docs"
@@ -17,7 +20,7 @@ def base_install(session):
 @nox.session(python="3.10")
 def lint(session):
     """Run linting check locally."""
-    session = base_install(session)
+    session.install("pre-commit")
     session.run("pre-commit", "run", "-a")
 
 
@@ -50,7 +53,7 @@ def documentation_tests(session):
 @nox.session(python="3.10")
 def docs(session, batch_run: bool = False):
     """Build the documentation or serve documentation interactively."""
-    session.run("rm", "-rf", "docs/_build", external=True)
+    shutil.rmtree(Path("docs").joinpath("_build"), ignore_errors=True)
     session.install("-r", "docs/requirements.txt")
     session.install(".")
     session.cd("docs")
@@ -66,7 +69,7 @@ def docs(session, batch_run: bool = False):
                 "--port",
                 "9812",
                 "--watch",
-                "../cookiecutter",
+                "../",
             ]
         )
 


Test patch:
Repository: cookiecutter/cookiecutter

Issue:
Update CONTRIBUTING, README and package metadata
### Description:

- [x] Update `CONTRIBUTING.md` to mention the usage of `nox` instead of `tox`
- [x] Reorganize `README.md`
- [x] Update `setup.py` to add links to the project
CI/CD: Tox -> Nox
We are python project, and working with python files should be easier for any python developer, over working with text configuration in tox.


Discussion:

From a technical POV I am +/-0 on this change. Technical we gain exact nothing.

Since we are a conservative project I propose to move back to tox: it is well known and wide spread in the communities around cookiecutter and beyond, while nox is a niche. 
Tox is btw a Python project too.

As a developer I am able to work with several languages and config files in different notations, so this should apply for any  developer.

Resolving patch:
diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -28,12 +28,14 @@ def lint(session):
 def tests(session):
     """Run test suite with pytest."""
     session = base_install(session)
+    posargs = session.posargs or ""
     session.run(
         "pytest",
         "--cov-report=html",
         "--cov-report=xml",
         "--cov-branch",
         "--cov-fail-under=100",
+        *posargs,
     )
 
 
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -29,6 +29,11 @@
     author='Audrey Feldroy',
     author_email='audreyr@gmail.com',
     url='https://github.com/cookiecutter/cookiecutter',
+    project_urls={
+        "Documentation": "https://cookiecutter.readthedocs.io",
+        "Issues": "https://github.com/cookiecutter/cookiecutter/issues",
+        "Discord": "https://discord.gg/9BrxzPKuEW",
+    },
     packages=['cookiecutter'],
     package_dir={'cookiecutter': 'cookiecutter'},
     entry_points={'console_scripts': ['cookiecutter = cookiecutter.__main__:main']},


Test patch:
Repository: cookiecutter/cookiecutter

Issue:
Add checkout details to context
* Cookiecutter version: 2.1.1
* Template project url: N/A
* Python version: 3.9.13
* Operating System: macOS

### Description:

I would like the context output available in `{{cookiecutter | pprint }}` to include the `--checkout` argument passed to the CLI, under a '_checkout' field. This will allow me to perform different actions in my post generation hooks if a non-default branch, tag, or commit was passed.

### What I've run:

```
from collections import OrderedDict
cookiecutter_context = {{cookiecutter | pprint }}
print(cookiecutter_context)
```

Related to https://github.com/cookiecutter/cookiecutter/issues/1422


Discussion:

Resolving patch:
diff --git a/cookiecutter/main.py b/cookiecutter/main.py
--- a/cookiecutter/main.py
+++ b/cookiecutter/main.py
@@ -154,16 +154,20 @@ def cookiecutter(
                 keep_project_on_failure=keep_project_on_failure,
             )
 
-    logger.debug('contex is %s', context)
+    logger.debug('context is %s', context)
 
     # include template dir or url in the context dict
     context['cookiecutter']['_template'] = template
 
     # include output+dir in the context dict
     context['cookiecutter']['_output_dir'] = os.path.abspath(output_dir)
+
     # include repo dir or url in the context dict
     context['cookiecutter']['_repo_dir'] = repo_dir
 
+    # include checkout details in the context dict
+    context['cookiecutter']['_checkout'] = checkout
+
     dump(config_dict['replay_dir'], template_name, context)
 
     # Create project from local context and project template.


Test patch:
diff --git a/tests/test_cli.py b/tests/test_cli.py
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -6,7 +6,6 @@
 
 import pytest
 from click.testing import CliRunner
-
 from cookiecutter import utils
 from cookiecutter.__main__ import main
 from cookiecutter.environment import StrictEnvironment
@@ -432,6 +431,7 @@ def test_echo_undefined_variable_error(output_dir, cli_runner):
             '_template': template_path,
             '_repo_dir': template_path,
             '_output_dir': output_dir,
+            '_checkout': None,
         },
     }
     context_str = json.dumps(context, indent=4, sort_keys=True)
Repository: cookiecutter/cookiecutter

Issue:
Prompt count should ignore 'hidden' items
* Cookiecutter version: 2.3.0
* Template project URL: https://github.com/collective/cookiecutter-plone-starter
* Python version: 3.11
* Operating System: macos

### Description:

The new rich prompts display the total number of questions, even those hidden.

```
  [9/24] Plone Version (6.0.7):
  [10/24] Volto Version (17.0.0-alpha.27):
  [11/24] Volto Generator Version (7.0.0-alpha.9):
  [12/24] Language
    1 - English
    2 - Deutsch
    3 - Español
    4 - Português (Brasil)
    5 - Nederlands
    6 - Suomi
    Choose from [1/2/3/4/5/6] (1): 1
```

The counter should consider only the visible questions



Discussion:

Resolving patch:
diff --git a/cookiecutter/prompt.py b/cookiecutter/prompt.py
--- a/cookiecutter/prompt.py
+++ b/cookiecutter/prompt.py
@@ -243,8 +243,10 @@ def prompt_for_config(context, no_input=False):
     # values might refer to them.
 
     count = 0
-    size = len(context['cookiecutter'].items())
-    for key, raw in context['cookiecutter'].items():
+    all_prompts = context['cookiecutter'].items()
+    visible_prompts = [k for k, _ in all_prompts if not k.startswith("_")]
+    size = len(visible_prompts)
+    for key, raw in all_prompts:
         if key.startswith('_') and not key.startswith('__'):
             cookiecutter_dict[key] = raw
             continue


Test patch:
Repository: cookiecutter/cookiecutter

Issue:
Add Python 3.12 support
* Cookiecutter version: 2.5.0
* Python version: 3.12
* Operating System: All



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -68,6 +68,7 @@ def _get_version() -> str:
         "Programming Language :: Python :: 3.9",
         "Programming Language :: Python :: 3.10",
         "Programming Language :: Python :: 3.11",
+        "Programming Language :: Python :: 3.12",
         "Programming Language :: Python :: Implementation :: CPython",
         "Programming Language :: Python :: Implementation :: PyPy",
         "Programming Language :: Python",


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -45,6 +45,7 @@ jobs:
           - "3.9"
           - "3.10"
           - "3.11"
+          - "3.12"
     steps:
       - uses: actions/checkout@v4
       - name: Set up Python ${{ matrix.python }}
diff --git a/test_requirements.txt b/test_requirements.txt
--- a/test_requirements.txt
+++ b/test_requirements.txt
@@ -4,3 +4,4 @@ pytest-mock
 freezegun
 safety
 pre-commit
+tox
Repository: pymodbus-dev/pymodbus

Issue:
example code bug in remote_server_context.py
In file: 
https://github.com/riptideio/pymodbus/blob/master/examples/contrib/remote_server_context.py#L160

`RemoteServerContext` not have `self.__slaves`

more in:
https://github.com/riptideio/pymodbus/commit/fec7ac37f37e3d29196f6775c24a833bf9881539


Discussion:

Resolving patch:
diff --git a/examples/contrib/remote_server_context.py b/examples/contrib/remote_server_context.py
--- a/examples/contrib/remote_server_context.py
+++ b/examples/contrib/remote_server_context.py
@@ -141,6 +141,7 @@ def __init__(self, client):
             'h': lambda a, v, s: client.write_registers(a, v, s),
             'i': lambda a, v, s: client.write_registers(a, v, s),
         }
+        self._client = client
         self.slaves = {} # simply a cache
 
     def __str__(self):
@@ -157,7 +158,7 @@ def __iter__(self):
         :returns: An iterator over the slave contexts
         '''
         # note, this may not include all slaves
-        return self.__slaves.iteritems()
+        return iter(self.slaves.items())
 
     def __contains__(self, slave):
         ''' Check if the given slave is in this list


Test patch: