dyyyyyyyy/swe-rebench-filtered-1150 huggingface dataset:
task: metadata: install: pip install -e .[dev]
patch: diff --git a/narwhals/_pandas_like/expr.py b/narwhals/_pandas_like/expr.py
index f9020824..1dc4f306 100644
--- a/narwhals/_pandas_like/expr.py
+++ b/narwhals/_pandas_like/expr.py
@@ -184,8 +184,12 @@ class PandasExpr:
     def is_in(self, other: Any) -> Self:
         return register_expression_call(self, "is_in", other)
 
-    def filter(self, other: Any) -> Self:
-        return register_expression_call(self, "filter", other)
+    def filter(self, *predicates: Any) -> Self:
+        from narwhals._pandas_like.namespace import PandasNamespace
+
+        plx = PandasNamespace(self._implementation)
+        expr = plx.all_horizontal(*predicates)
+        return register_expression_call(self, "filter", expr)
 
     def drop_nulls(self) -> Self:
         return register_expression_call(self, "drop_nulls")
diff --git a/narwhals/expression.py b/narwhals/expression.py
index fbddc1e3..674b5981 100644
--- a/narwhals/expression.py
+++ b/narwhals/expression.py
@@ -851,9 +851,11 @@ class Expr:
                 "Narwhals `is_in` doesn't accept expressions as an argument, as opposed to Polars. You should provide an iterable instead."
             )
 
-    def filter(self, other: Any) -> Expr:
+    def filter(self, *predicates: Any) -> Expr:
         return self.__class__(
-            lambda plx: self._call(plx).filter(extract_native(plx, other))
+            lambda plx: self._call(plx).filter(
+                *[extract_native(plx, pred) for pred in flatten(predicates)]
+            )
         )
 
     def is_null(self) -> Expr:

problem_statement: wrong argument in Expr.filter and Series.filter - "other" instead of "*predicates"
I'm working on the docstring for Expr.filter() but I noticed that the name of the argument suggests it accepts "other" df/series.
It's also the case for Series.filter()
Dataframe.filter() has *predicates as an argument and so does Expr.filter() in polars.
Should it be that way or should it be corrected? 


repo: narwhals-dev/narwhals
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/expr/filter_test.py b/tests/expr/filter_test.py
new file mode 100644
index 00000000..ea15a94f
--- /dev/null
+++ b/tests/expr/filter_test.py
@@ -0,0 +1,27 @@
+from typing import Any
+
+import pandas as pd
+import polars as pl
+import pytest
+
+import narwhals as nw
+from tests.utils import compare_dicts
+
+data = {
+    "i": [0, 1, 2, 3, 4],
+    "a": [0, 1, 2, 3, 4],
+    "b": [1, 2, 3, 5, 3],
+    "c": [5, 4, 3, 2, 1],
+}
+
+
+@pytest.mark.parametrize("constructor", [pd.DataFrame, pl.DataFrame])
+def test_filter(constructor: Any) -> None:
+    df = nw.from_native(constructor(data), eager_only=True)
+    result = df.select(nw.col("a").filter(nw.col("i") < 2, nw.col("c") == 5))
+    expected = {
+        "a": [0],
+    }
+    compare_dicts(result, expected)
+    result = df.select(df["a"].filter((df["i"] < 2) & (df["c"] == 5)))
+    compare_dicts(result, expected)
task: metadata: install: pip install -e .
patch: diff --git a/networkx/generators/degree_seq.py b/networkx/generators/degree_seq.py
index 6d57bcf05..c42faebc7 100644
--- a/networkx/generators/degree_seq.py
+++ b/networkx/generators/degree_seq.py
@@ -426,7 +426,7 @@ def expected_degree_graph(w, seed=None, selfloops=True):
     # weights dictates the order of the (integer) node labels, so we
     # need to remember the permutation applied in the sorting.
     order = sorted(enumerate(w), key=itemgetter(1), reverse=True)
-    mapping = {c: v for c, (u, v) in enumerate(order)}
+    mapping = {c: u for c, (u, v) in enumerate(order)}
     seq = [v for u, v in order]
     last = n
     if not selfloops:

problem_statement: node-mapping bug expected_degree_graph
Hi I used the NX1 expected_degree_graph generator. It has the same interface as the NX2.

https://networkx.github.io/documentation/stable/reference/generated/networkx.generators.degree_seq.expected_degree_graph.html#networkx.generators.degree_seq.expected_degree_graph

But NX2 will not generate the graph correctly. The total number of edge is always 1. No further error message provided. 
Same script works well for NX1. (I downgrade to older version.

```python
D = 10
N = 1000
degree_l = [D for i in range(N)]
G = nx.expected_degree_graph(degree_l, seed=datetime.now(), selfloops=False)
```
repo: networkx/networkx
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/networkx/generators/tests/test_degree_seq.py b/networkx/generators/tests/test_degree_seq.py
index c1aca1791..bde2c7954 100644
--- a/networkx/generators/tests/test_degree_seq.py
+++ b/networkx/generators/tests/test_degree_seq.py
@@ -92,6 +92,8 @@ def test_expected_degree_graph():
     # test that fixed seed delivers the same graph
     deg_seq = [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]
     G1 = nx.expected_degree_graph(deg_seq, seed=1000)
+    assert_equal(len(G1), 12)
+
     G2 = nx.expected_degree_graph(deg_seq, seed=1000)
     assert_true(nx.is_isomorphic(G1, G2))
 
@@ -105,6 +107,7 @@ def test_expected_degree_graph_selfloops():
     G1 = nx.expected_degree_graph(deg_seq, seed=1000, selfloops=False)
     G2 = nx.expected_degree_graph(deg_seq, seed=1000, selfloops=False)
     assert_true(nx.is_isomorphic(G1, G2))
+    assert_equal(len(G1), 12)
 
 
 def test_expected_degree_graph_skew():
@@ -112,6 +115,7 @@ def test_expected_degree_graph_skew():
     G1 = nx.expected_degree_graph(deg_seq, seed=1000)
     G2 = nx.expected_degree_graph(deg_seq, seed=1000)
     assert_true(nx.is_isomorphic(G1, G2))
+    assert_equal(len(G1), 5)
 
 
 def test_havel_hakimi_construction():
task: metadata: install: pip install -e .[dev]
patch: diff --git a/networkx/readwrite/edgelist.py b/networkx/readwrite/edgelist.py
index 72afe1a7c..5183071d1 100644
--- a/networkx/readwrite/edgelist.py
+++ b/networkx/readwrite/edgelist.py
@@ -270,7 +270,11 @@ def parse_edgelist(
         elif data is True:
             # no edge types specified
             try:  # try to evaluate as dictionary
-                edgedata = dict(literal_eval(" ".join(d)))
+                if delimiter == ",":
+                    edgedata_str = ",".join(d)
+                else:
+                    edgedata_str = " ".join(d)
+                edgedata = dict(literal_eval(edgedata_str.strip()))
             except BaseException as e:
                 raise TypeError(
                     f"Failed to convert edge data ({d}) " f"to dictionary."

problem_statement: Parse edgelist bug
When calling `parse_edgelist()` using comma delimiters, it will fail to parse correctly fro edges with multiple attributes.

Ex. of bad edge:
`1,2,{'test':1, 'test_other':2}`

`parse_edgelist()` will recognize the comma in the braces as delimiter and try to split them up.
repo: networkx/networkx
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/networkx/readwrite/tests/test_edgelist.py b/networkx/readwrite/tests/test_edgelist.py
index 2e1a2424f..31f214566 100644
--- a/networkx/readwrite/tests/test_edgelist.py
+++ b/networkx/readwrite/tests/test_edgelist.py
@@ -100,6 +100,48 @@ class TestEdgelist:
             G.edges(data=True), [(1, 2, {"weight": 2.0}), (2, 3, {"weight": 3.0})]
         )
 
+    def test_read_edgelist_5(self):
+        s = b"""\
+# comment line
+1 2 {'weight':2.0, 'color':'green'}
+# comment line
+2 3 {'weight':3.0, 'color':'red'}
+"""
+        bytesIO = io.BytesIO(s)
+        G = nx.read_edgelist(bytesIO, nodetype=int, data=False)
+        assert_edges_equal(G.edges(), [(1, 2), (2, 3)])
+
+        bytesIO = io.BytesIO(s)
+        G = nx.read_edgelist(bytesIO, nodetype=int, data=True)
+        assert_edges_equal(
+            G.edges(data=True),
+            [
+                (1, 2, {"weight": 2.0, "color": "green"}),
+                (2, 3, {"weight": 3.0, "color": "red"}),
+            ],
+        )
+
+    def test_read_edgelist_6(self):
+        s = b"""\
+# comment line
+1, 2, {'weight':2.0, 'color':'green'}
+# comment line
+2, 3, {'weight':3.0, 'color':'red'}
+"""
+        bytesIO = io.BytesIO(s)
+        G = nx.read_edgelist(bytesIO, nodetype=int, data=False, delimiter=",")
+        assert_edges_equal(G.edges(), [(1, 2), (2, 3)])
+
+        bytesIO = io.BytesIO(s)
+        G = nx.read_edgelist(bytesIO, nodetype=int, data=True, delimiter=",")
+        assert_edges_equal(
+            G.edges(data=True),
+            [
+                (1, 2, {"weight": 2.0, "color": "green"}),
+                (2, 3, {"weight": 3.0, "color": "red"}),
+            ],
+        )
+
     def test_write_edgelist_1(self):
         fh = io.BytesIO()
         G = nx.OrderedGraph()
task: metadata: install: pip install -e .[dev]
patch: diff --git a/humps/main.py b/humps/main.py
index 9c58ac8..5ea96e7 100644
--- a/humps/main.py
+++ b/humps/main.py
@@ -21,8 +21,8 @@ if is_py3:  # pragma: no cover
 
 ACRONYM_RE = re.compile(r"([A-Z]+)$|([A-Z]+)(?=[A-Z0-9])")
 PASCAL_RE = re.compile(r"([^\-_\s]+)")
-SPLIT_RE = re.compile(r"([\-_\s]*[A-Z]+[^A-Z\-_\s]+[\-_\s]*)")
-UNDERSCORE_RE = re.compile(r"(?<=[^\-_\s])[\-_\s]+([^\-_\s])")
+SPLIT_RE = re.compile(r"([\-_\s]*[A-Z]+[^A-Z\-_\s]*[\-_\s]*)")
+UNDERSCORE_RE = re.compile(r"([^\-_\s])[\-_\s]+([^\-_\s])")
 
 
 def pascalize(str_or_iter):

problem_statement: sizeX decamelized as sizex
**Describe the bug**
String 'sizeX' is correctly identified as camelCase but is converted to snake_case as 'sizex'.

**To Reproduce**
```python
>>> humps.is_camelcase("sizeX")
True
>>> humps.decamelize("sizeX")
'sizex'
>>> humps.decamelize("camelCaseTest")
'camel_case_test'
```

**Expected behavior**
```python
>>> humps.decamelize("sizeX")
'size_x'
```

**Desktop (please complete the following information):**
 - OS: Ubuntu 18.04, Python 3.8
 - Version 1.6.1
repo: nficano/humps
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/test_decamelize.py b/tests/test_decamelize.py
index 2d0e128..7d2092a 100644
--- a/tests/test_decamelize.py
+++ b/tests/test_decamelize.py
@@ -27,6 +27,10 @@ import humps
         ("_itemID", "_item_id"),
         # Fixed issue #4. 2021-05-01
         ("memMB", "mem_mb"),
+        # Fixed issue #127. 2021-09-13
+        ("sizeX", "size_x"),
+        # Fixed issue #168. 2021-09-13
+        ("aB", "a_b"),
     ],
 )
 def test_decamelize(input_str, expected_output):
diff --git a/tests/test_separate_words.py b/tests/test_separate_words.py
index e8a8ec0..ca9aa16 100644
--- a/tests/test_separate_words.py
+++ b/tests/test_separate_words.py
@@ -30,6 +30,10 @@ from humps.main import separate_words
         # Fixes issue #128
         ("whatever_hi", "whatever_hi"),
         ("whatever_10", "whatever_10"),
+        # Fixes issue #127
+        ("sizeX", "size_X"),
+        # Fixes issue #168
+        ("aB", "a_B"),
     ],
 )
 def test_separate_words(input_str, expected_output):
task: metadata: install: pip install -e .[dev]
patch: diff --git a/humps/main.py b/humps/main.py
index 5d95b9a..9c58ac8 100644
--- a/humps/main.py
+++ b/humps/main.py
@@ -22,7 +22,7 @@ if is_py3:  # pragma: no cover
 ACRONYM_RE = re.compile(r"([A-Z]+)$|([A-Z]+)(?=[A-Z0-9])")
 PASCAL_RE = re.compile(r"([^\-_\s]+)")
 SPLIT_RE = re.compile(r"([\-_\s]*[A-Z]+[^A-Z\-_\s]+[\-_\s]*)")
-UNDERSCORE_RE = re.compile(r"([^\-_\s])[\-_\s]+([^\-_\s])")
+UNDERSCORE_RE = re.compile(r"(?<=[^\-_\s])[\-_\s]+([^\-_\s])")
 
 
 def pascalize(str_or_iter):
@@ -85,7 +85,7 @@ def camelize(str_or_iter):
             the regex capture group for "o_w".
         :rtype: str
         """
-        return match.group(1) + match.group(2).upper()
+        return match.group(1).upper()
 
     str_items.extend(
         [

problem_statement: 1.3.1 gets confused with digits and dashes
Version 1.2.0:
```
>>> humps.camelize("test-1-2-3-4-5-6")
'test123456'
```

Version 1.3.1:
```
>>> humps.camelize("test-1-2-3-4-5-6")
'test12-34-56'
```
repo: nficano/humps
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/test_camelize.py b/tests/test_camelize.py
index 5b16f13..67d8ff8 100644
--- a/tests/test_camelize.py
+++ b/tests/test_camelize.py
@@ -23,6 +23,12 @@ import humps
         ("__APIResponse__", "__APIResponse__"),
         # Fixed issue #128
         ("whatever_10", "whatever10"),
+        # Fixed issue # 18
+        ("test-1-2-3-4-5-6", "test123456"),
+        # Fixed issue # 61
+        ("test_n_test", "testNTest"),
+        # Fixed issue # 148
+        ("field_value_2_type", "fieldValue2Type"),
     ],
 )
 def test_camelize(input_str, expected_output):
task: metadata: install: pip install -e .
patch: diff --git a/crossplane/formatter.py b/crossplane/formatter.py
index fef2749..80c3b21 100644
--- a/crossplane/formatter.py
+++ b/crossplane/formatter.py
@@ -5,7 +5,13 @@ from .parser import parse
 
 
 def format(filename, indent=4, tabs=False):
-    payload = parse(filename, single=True, check_ctx=False, check_args=False)
+    payload = parse(
+        filename,
+        comments=True,
+        single=True,
+        check_ctx=False,
+        check_args=False
+    )
 
     if payload['status'] != 'ok':
         e = payload['errors'][0]

problem_statement: feat: keep certain newlines and comments
Keeping comments is great as it allows users to understand complex changes quickly, while newlines in key positions help with readability.
repo: nginxinc/crossplane
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/test_format.py b/tests/test_format.py
index 3c32bda..d116572 100644
--- a/tests/test_format.py
+++ b/tests/test_format.py
@@ -11,10 +11,12 @@ def test_format_messy_config():
     output = crossplane.format(config)
     assert output == '\n'.join([
         'user nobody;',
+        r'# hello\n\\n\\\n worlddd  \#\\#\\\# dfsf\n \\n \\\n ',
         'events {',
         '    worker_connections 2048;',
         '}',
-        'http {',
+        'http { #forteen',
+        '    # this is a comment',
         '    access_log off;',
         '    default_type text/plain;',
         '    error_log off;',
@@ -33,7 +35,7 @@ def test_format_messy_config():
         '        location /bar {',
         '        }',
         '        location /\{\;\}\ #\ ab {',
-        '        }',
+        '        } # hello',
         '        if ($request_method = P\{O\)\###\;ST) {',
         '        }',
         '        location /status.html {',
@@ -75,3 +77,25 @@ def test_format_args_not_analyzed():
         'http {',
         '}'
     ])
+
+
+def test_format_with_comments():
+    dirname = os.path.join(here, 'configs', 'with-comments')
+    config = os.path.join(dirname, 'nginx.conf')
+    output = crossplane.format(config)
+    assert output == '\n'.join([
+        'events {',
+        '    worker_connections 1024;',
+        '}',
+        '#comment',
+        'http {',
+        '    server {',
+        '        listen 127.0.0.1:8080; #listen',
+        '        server_name default_server;',
+        '        location / { ## this is brace',
+        '            # location /',
+        "            return 200 'foo bar baz';",
+        '        }',
+        '    }',
+        '}'
+    ])
task: metadata: install: pip install -e .[export]
patch: diff --git a/doc/using_procfiles.rst b/doc/using_procfiles.rst
index 02cd95b..d11dc91 100644
--- a/doc/using_procfiles.rst
+++ b/doc/using_procfiles.rst
@@ -18,10 +18,10 @@ source tree that contains zero or more lines of the form::
 
     <process type>: <command>
 
-The ``process type`` is a string which may contain alphanumerics and underscores
-(``[A-Za-z0-9_]+``), and uniquely identifies one type of process which can be
-run to form your application. For example: ``web``, ``worker``, or
-``my_process_123``.
+The ``process type`` is a string which may contain alphanumerics as well as
+underscores and dashes (``[A-Za-z0-9_-]+``), and uniquely identifies one type
+of process which can be run to form your application. For example: ``web``,
+``worker``, or ``my_process_123``.
 
 ``command`` is a shell commandline which will be executed to spawn a process of
 the specified type.
diff --git a/honcho/environ.py b/honcho/environ.py
index 646d950..09448f3 100644
--- a/honcho/environ.py
+++ b/honcho/environ.py
@@ -13,7 +13,7 @@ if compat.ON_WINDOWS:
     import ctypes
 
 
-PROCFILE_LINE = re.compile(r'^([A-Za-z0-9_]+):\s*(.+)$')
+PROCFILE_LINE = re.compile(r'^([A-Za-z0-9_-]+):\s*(.+)$')
 
 
 class Env(object):

problem_statement: Dashes in process types
I believe that process types, according to this [Heroku page](https://devcenter.heroku.com/articles/procfile), must be alphanumeric.

If I create a Procfile with the following content

```
process-type-with-dashes: python -c 'print("hello")'
```

and then run `honcho start`, honcho fails silently.

Also, when I run `honcho check`, it says it is a valid Procfile.

Perhaps it would be helpful if:
- `honcho start` would complain if there is an invalid Procfile
- `honcho check` complains if the process types have dashes

I am using honcho v1.0.1 with python 3.7.0 on macOS.

Thank you for all of your work, I wish I had time to create a PR for this, but I figured creating an issue was better than nothing.
repo: nickstenning/honcho
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/test_environ.py b/tests/test_environ.py
index c7260a4..a9720d7 100644
--- a/tests/test_environ.py
+++ b/tests/test_environ.py
@@ -155,10 +155,17 @@ def test_environ_parse(content, commands):
     [
         # Invalid characters
         """
-        -foo: command
+        +foo: command
         """,
         {}
     ],
+    [
+        # Valid -/_ characters
+        """
+        -foo_bar: command
+        """,
+        {'-foo_bar': 'command'}
+    ],
     [
         # Shell metacharacters
         """
task: metadata: install: pip install -e .[dev]
patch: diff --git a/nion/data/Core.py b/nion/data/Core.py
index ca5f2c4..43e17b0 100755
--- a/nion/data/Core.py
+++ b/nion/data/Core.py
@@ -386,7 +386,7 @@ def function_register_template(image_xdata: DataAndMetadata.DataAndMetadata, tem
     ccorr_xdata = function_match_template(image_xdata, template_xdata)
     error, ccoeff, max_pos = TemplateMatching.find_ccorr_max(ccorr_xdata.data)
     if not error:
-        return ccoeff, max_pos
+        return ccoeff, tuple(max_pos[i] - image_xdata.data_shape[i] * 0.5 for i in range(len(image_xdata.data_shape)))
 
 
 def function_shift(src: DataAndMetadata.DataAndMetadata, shift: typing.Tuple[float, ...], *, order: int = 1) -> DataAndMetadata.DataAndMetadata:

problem_statement: Should register_template return offset relative to center pixel?
```
quality, offset = xd.register_template(img, tmpl_img)
offset = Geometry.FloatPoint(y=img.data_shape[0] * 0.5 - offset[0], x=img.data_shape[1] * 0.5 - offset[1])
```

repo: nion-software/niondata
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/nion/data/test/Core_test.py b/nion/data/test/Core_test.py
index 54ef2a1..054d822 100755
--- a/nion/data/test/Core_test.py
+++ b/nion/data/test/Core_test.py
@@ -932,7 +932,7 @@ class TestCore(unittest.TestCase):
         template_xdata = DataAndMetadata.new_data_and_metadata(data[40:60])
         ccoeff, max_pos = Core.function_register_template(image_xdata, template_xdata)
         self.assertEqual(len(max_pos), 1)
-        self.assertAlmostEqual(max_pos[0], 50, places=1)
+        self.assertAlmostEqual(max_pos[0], 0, places=1)
         self.assertAlmostEqual(ccoeff, 1.0, places=1)
 
     def test_register_template_for_2d_data(self):
@@ -941,7 +941,7 @@ class TestCore(unittest.TestCase):
         template_xdata = DataAndMetadata.new_data_and_metadata(data[40:60, 15:20])
         ccoeff, max_pos = Core.function_register_template(image_xdata, template_xdata)
         self.assertEqual(len(max_pos), 2)
-        self.assertTrue(numpy.allclose(max_pos, (50, 17), atol=0.1))
+        self.assertTrue(numpy.allclose(max_pos, (0, -33), atol=0.1))
         self.assertAlmostEqual(ccoeff, 1.0, places=1)
 
     def test_sequence_join(self):
task: metadata: install: pip install -e .
patch: diff --git a/nion/utils/Converter.py b/nion/utils/Converter.py
index 8bfacb2..178a127 100644
--- a/nion/utils/Converter.py
+++ b/nion/utils/Converter.py
@@ -43,7 +43,7 @@ class IntegerToStringConverter(ConverterLike[int, str]):
 
     def convert_back(self, formatted_value: typing.Optional[str]) -> typing.Optional[int]:
         """ Convert string to value using standard int conversion """
-        formatted_value = re.sub("[^0-9]", "", formatted_value) if self.__fuzzy and formatted_value else None
+        formatted_value = re.sub("[+-](?!\d)|(?<=\.)\w*|[^-+0-9]", "", formatted_value) if self.__fuzzy and formatted_value else None
         if formatted_value:
             return int(formatted_value)
         else:

problem_statement: Regex in IntegerToStringConverter not handling negative numbers
https://github.com/nion-software/nionutils/blob/c4b09457ab9433dde6f224279fe8f35265c6c041/nion/utils/Converter.py#L46

This regex is not sufficient to properly handle negative numbers. It will also fail to convert floating point numbers. See the following examples:

```
from nion.utils import Converter
conv = Converter.IntegerToStringConverter()
conv.convert_back("-1")
>>> 1
conv.convert_back("1.243")
>>> 1243

repo: nion-software/nionutils
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/nion/utils/test/Converter_test.py b/nion/utils/test/Converter_test.py
index 2fcbf1b..65b8717 100644
--- a/nion/utils/test/Converter_test.py
+++ b/nion/utils/test/Converter_test.py
@@ -23,6 +23,12 @@ class TestConverter(unittest.TestCase):
         self.assertAlmostEqual(converter.convert_back(converter.convert(-100)) or 0.0, -100)
         self.assertAlmostEqual(converter.convert_back(converter.convert(100)) or 0.0, 100)
 
+    def test_integer_to_string_converter(self) -> None:
+        converter = Converter.IntegerToStringConverter()
+        self.assertEqual(converter.convert_back("-1"), -1)
+        self.assertEqual(converter.convert_back("2.45653"), 2)
+        self.assertEqual(converter.convert_back("-adcv-2.15sa56aas"), -2)
+        self.assertEqual(converter.convert_back("xx4."), 4)
 
 
 if __name__ == '__main__':
task: metadata: install: pip install -e .[dev]
patch: diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py
index fc3617036..6bb9a943f 100644
--- a/nipype/interfaces/io.py
+++ b/nipype/interfaces/io.py
@@ -1555,16 +1555,12 @@ class DataFinder(IOBase):
 
 
 class FSSourceInputSpec(BaseInterfaceInputSpec):
-    subjects_dir = Directory(
-        mandatory=True, desc='Freesurfer subjects directory.')
-    subject_id = Str(
-        mandatory=True, desc='Subject name for whom to retrieve data')
-    hemi = traits.Enum(
-        'both',
-        'lh',
-        'rh',
-        usedefault=True,
-        desc='Selects hemisphere specific outputs')
+    subjects_dir = Directory(exists=True, mandatory=True,
+                             desc='Freesurfer subjects directory.')
+    subject_id = Str(mandatory=True,
+                     desc='Subject name for whom to retrieve data')
+    hemi = traits.Enum('both', 'lh', 'rh', usedefault=True,
+                       desc='Selects hemisphere specific outputs')
 
 
 class FSSourceOutputSpec(TraitedSpec):

problem_statement: FreeSurferSource doesn't check subjects_dir
### Summary
`FreeSurferSource` doesn't check `subjects_dir` is an existing path.

### How to replicate the behavior

```
from nipype.interfaces.io import FreeSurferSource
fs = FreeSurferSource()
fs.inputs.subjects_dir = 'path/to/no/existing/directory'
fs.inputs.subject_id = 'sub-01'
res = fs.run()
```

### Actual behavior
Doesn't give an error.

### Expected behavior
Should check if directory exists (and possibly if there are files for `subject_id` ?).


repo: nipy/nipype
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/nipype/interfaces/tests/test_io.py b/nipype/interfaces/tests/test_io.py
index a2103eadf..76fc9e257 100644
--- a/nipype/interfaces/tests/test_io.py
+++ b/nipype/interfaces/tests/test_io.py
@@ -16,7 +16,7 @@ from collections import namedtuple
 import pytest
 import nipype
 import nipype.interfaces.io as nio
-from nipype.interfaces.base import Undefined
+from nipype.interfaces.base import Undefined, TraitError
 
 # Check for boto
 noboto = False
@@ -498,6 +498,12 @@ def test_freesurfersource():
     assert fss.inputs.subjects_dir == Undefined
 
 
+def test_freesurfersource_incorrectdir():
+    fss = nio.FreeSurferSource()
+    with pytest.raises(TraitError) as err:
+        fss.inputs.subjects_dir = 'path/to/no/existing/directory'
+
+
 def test_jsonsink_input():
 
     ds = nio.JSONFileSink()
task: metadata: install: pip install -e .[dev]
patch: diff --git a/stix2/v21/sdo.py b/stix2/v21/sdo.py
index 1d97261..5c87515 100644
--- a/stix2/v21/sdo.py
+++ b/stix2/v21/sdo.py
@@ -460,7 +460,7 @@ class Malware(STIXDomainObject):
         ('kill_chain_phases', ListProperty(KillChainPhase)),
         ('first_seen', TimestampProperty()),
         ('last_seen', TimestampProperty()),
-        ('os_execution_envs', ListProperty(StringProperty)),
+        ('operating_system_refs', ListProperty(ReferenceProperty(valid_types='software', spec_version='2.1'))),
         ('architecture_execution_envs', ListProperty(StringProperty)),
         ('implementation_languages', ListProperty(StringProperty)),
         ('capabilities', ListProperty(StringProperty)),

problem_statement: Malware os_execution_envs changes
This property was renamed to operating_system_refs, is now list of Software SCO identifiers instead of strings, and no longer SHOULD be a CPE entry.
repo: oasis-open/cti-python-stix2
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/stix2/test/v21/test_malware.py b/stix2/test/v21/test_malware.py
index 53838c9..412d740 100644
--- a/stix2/test/v21/test_malware.py
+++ b/stix2/test/v21/test_malware.py
@@ -197,3 +197,22 @@ def test_malware_non_family_no_name():
         "is_family": False,
         "malware_types": ["something"],
     })
+
+
+def test_malware_with_os_refs():
+    software = stix2.parse({
+        "type": "software",
+        "name": "SuperOS",
+        "spec_version": "2.1",
+    })
+
+    malware = stix2.parse({
+        "type": "malware",
+        "id": MALWARE_ID,
+        "spec_version": "2.1",
+        "is_family": False,
+        "malware_types": ["something"],
+        "operating_system_refs": [software],
+    })
+
+    assert malware["operating_system_refs"][0] == software["id"]
task: metadata: install: pip install -e .[test]
patch: diff --git a/taxii2client/__init__.py b/taxii2client/__init__.py
index 548f279..edd90b5 100644
--- a/taxii2client/__init__.py
+++ b/taxii2client/__init__.py
@@ -159,7 +159,12 @@ class _TAXIIEndpoint(object):
         else:
             self._conn = _HTTPConnection(user, password, verify)
 
-        self.url = url
+        # Add trailing slash to TAXII endpoint if missing
+        # https://github.com/oasis-open/cti-taxii-client/issues/50
+        if url[-1] == "/":
+            self.url = url
+        else:
+            self.url = url + "/"
 
     def close(self):
         self._conn.close()

problem_statement: Check for trailing slash in URLs
```
>>> collection = Collection('http://localhost:5000/trustgroup1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116', user='user1', password='Password1')
>>> collection.get_object('indicator--252c7c11-daf2-42bd-843b-be65edca9f61')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/lu/Projects/cti-taxii-client/taxii2client/__init__.py", line 483, in get_object
    params=query_params)
  File "/home/lu/Projects/cti-taxii-client/taxii2client/__init__.py", line 876, in get
    resp.raise_for_status()
  File "/home/lu/.virtualenvs/cti-taxii-client/lib/python3.6/site-packages/requests/models.py", line 939, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: NOT FOUND for url: http://localhost:5000/trustgroup1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116objects/indicator--252c7c11-daf2-42bd-843b-be65edca9f61/
```

If I set up the collection with a `/` at the end of the url, it works fine because it's not trying to find a collection called `91a7b528-80eb-42ed-a74d-c6fbd5a26116objects`.

repo: oasis-open/cti-taxii-client
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/taxii2client/test/test_client.py b/taxii2client/test/test_client.py
index e363d27..db2ff84 100644
--- a/taxii2client/test/test_client.py
+++ b/taxii2client/test/test_client.py
@@ -960,3 +960,15 @@ def test_server_with_custom_properties(server):
     server.refresh()
     assert len(server.custom_properties) == 1
     assert server.custom_properties["x_example_com"] == "some value"
+
+
+@responses.activate
+def test_collection_missing_trailing_slash():
+    set_collection_response()
+    collection = Collection(COLLECTION_URL[:-1])
+    responses.add(responses.GET, GET_OBJECT_URL, GET_OBJECT_RESPONSE,
+                  status=200, content_type="%s; charset=utf-8" % MEDIA_TYPE_STIX_V20)
+
+    response = collection.get_object("indicator--252c7c11-daf2-42bd-843b-be65edca9f61")
+    indicator = response["objects"][0]
+    assert indicator["id"] == "indicator--252c7c11-daf2-42bd-843b-be65edca9f61"
task: metadata: install: pip install -e .[dev]
patch: diff --git a/src/oemof/solph/components/_link.py b/src/oemof/solph/components/_link.py
index 594b7d2d..68df9248 100644
--- a/src/oemof/solph/components/_link.py
+++ b/src/oemof/solph/components/_link.py
@@ -25,6 +25,7 @@ from pyomo.core.base.block import ScalarBlock
 from pyomo.environ import BuildAction
 from pyomo.environ import Constraint
 
+from oemof.solph._helpers import warn_if_missing_attribute
 from oemof.solph._plumbing import sequence
 
 
@@ -79,16 +80,19 @@ class Link(on.Transformer):
 
     def __init__(
         self,
-        label,
-        inputs,
-        outputs,
-        conversion_factors,
+        label=None,
+        inputs=None,
+        outputs=None,
+        conversion_factors=None,
     ):
         if inputs is None:
+            warn_if_missing_attribute(self, "inputs")
             inputs = {}
         if outputs is None:
+            warn_if_missing_attribute(self, "outputs")
             outputs = {}
         if conversion_factors is None:
+            warn_if_missing_attribute(self, "conversion_factors")
             conversion_factors = {}
         super().__init__(
             label=label,

problem_statement: Set `None` as default values for explicit arguments in Link component
Due to the process of building `oemof.tabular.facades`, it's necessary that the Link component uses its default values during its instantiation, as no values are passed. These default values are updated afterward. 

Therefore, I will add `None` as default values for the explicit arguments and add a warning for this case.
repo: oemof/oemof-solph
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/test_warnings.py b/tests/test_warnings.py
index ae144538..d0fd1a20 100644
--- a/tests/test_warnings.py
+++ b/tests/test_warnings.py
@@ -171,11 +171,11 @@ def test_link_to_warn_about_not_matching_number_of_flows(warning_fixture):
     with warnings.catch_warnings(record=True) as w:
         solph.components.Link(
             label="empty_link",
-            inputs=None,
-            outputs=None,
-            conversion_factors=None,
         )
-        assert len(w) == 1
+        assert len(w) == 4
+        # Check  number of raised warnings:
+        # 1. empty inputs, 2. empty outputs 3. empty conversion_factors
+        # 4. unmatched number of flows
         # Check warning for unmatched number of flows
         assert msg in str(w[-1].message)
task: metadata: install: pip install -e .
patch: diff --git a/mixpanel_jql/query.py b/mixpanel_jql/query.py
index 919894f..768da83 100644
--- a/mixpanel_jql/query.py
+++ b/mixpanel_jql/query.py
@@ -394,19 +394,19 @@ class JQL(object):
         return jql
 
     def group_by(self, keys, accumulator):
-        if not isinstance(keys, (tuple, set, list)):
-            keys = [keys]
-        jql = self._clone()
-        jql.operations += ("groupBy([%s], %s)"
-                           % (", ".join(_f(k) for k in keys), _f(accumulator)),)
-        return jql
+        return self._group_by(False, keys, accumulator)
 
     def group_by_user(self, keys, accumulator):
+        return self._group_by(True, keys, accumulator)
+
+    def _group_by(self, user, keys, accumulator):
         if not isinstance(keys, (tuple, set, list)):
             keys = [keys]
+        if not isinstance(accumulator, Reducer):
+            accumulator = _f(accumulator)
         jql = self._clone()
-        jql.operations += ("groupByUser([%s], %s)"
-                           % (", ".join(_f(k) for k in keys), _f(accumulator)),)
+        op = "groupByUser" if user else "groupBy"
+        jql.operations += ("%s([%s], %s)" % (op, ", ".join(_f(k) for k in keys), accumulator),)
         return jql
 
     def query_plan(self):

problem_statement: mixpanel_jql.exceptions.InvalidJavaScriptText
Hi, first of all thanks for this project!

I'm trying to run the first example and I'm getting:
`mixpanel_jql.exceptions.InvalidJavaScriptText: Must be a text type (str, unicode) or wrapped as raw(str||unicode)`

I'm runnning Python 3.6.5 on Ubuntu 18.04
repo: ownaginatious/mixpanel-jql
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/test_transformations.py b/tests/test_transformations.py
index f66c218..e7f3dfc 100644
--- a/tests/test_transformations.py
+++ b/tests/test_transformations.py
@@ -63,6 +63,12 @@ class TestGroupTransformations(unittest.TestCase):
             'function main() { return Events({}).'
             '%s([e.a, e.b, e.c], e.properties.some_accessor); }' % expected_function)
 
+        self.assertEqual(
+            str(grouper([
+                raw('e.a'), raw('e.b'), raw('e.c')], Reducer.count())),
+            'function main() { return Events({}).'
+            '%s([e.a, e.b, e.c], mixpanel.reducer.count()); }' % expected_function)
+
         # Non iterable key.
         self.assertEqual(
             str(grouper(raw('e.a'), raw('e.properties.some_accessor'))),
task: metadata: install: pip install -e .[dev]
patch: diff --git a/peppy/_version.py b/peppy/_version.py
index d6d6823..6e2b9ea 100644
--- a/peppy/_version.py
+++ b/peppy/_version.py
@@ -1,1 +1,1 @@
-__version__ = "0.40.5"
+__version__ = "0.40.6"
diff --git a/peppy/project.py b/peppy/project.py
index 9f46ccc..b7b58e0 100644
--- a/peppy/project.py
+++ b/peppy/project.py
@@ -345,8 +345,10 @@ class Project(MutableMapping):
                 SUBSAMPLE_RAW_LIST_KEY: sub_df,
             }
         else:
-            p_dict = self.config.copy()
-            p_dict["_samples"] = [s.to_dict() for s in self.samples]
+            p_dict = {
+                "project": self.config.copy(),
+                "samples": [s.to_dict() for s in self.samples],
+            }
 
         return p_dict
 

problem_statement: Make PEP representations consistent
We currently have 3 ways of representing PEPs:

1. Schema representations -> see: https://schema.databio.org/?namespace=pep&schema=2.1.0
2. peppy.Project object -> this is a mutable mapping containing `_config` and `samples` attributes.
3. dict via peppy.Project.to_dict() -> this contains all attributes under the original `_config` key (but not the _config key!) and the `samples`.

We would like to ensure that number 3 resembles number 2, so that the data structures have both `config` and `samples` attributes. 

Finally, in this same process we have decided to rename the `config` key to `project`.

In summary:
- [ ] ensure `to_dict()`'s representation matches the peppy.Project representation
- [ ] change `config` key to `project`
- [ ] refactor `_samples` to `samples`



repo: pepkit/peppy
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/test_Project.py b/tests/test_Project.py
index 7f7a9bb..6d573f2 100644
--- a/tests/test_Project.py
+++ b/tests/test_Project.py
@@ -375,7 +375,7 @@ class TestProjectConstructor:
         p1 = Project(
             cfg=example_pep_nextflow_csv_path, sample_table_index="sample"
         ).to_dict()
-        for sample in p1.get("_samples"):
+        for sample in p1.get("samples"):
             for attribute, value in sample.items():
                 assert value not in wrong_values
task: metadata: install: pip install -e .[dev]
patch: diff --git a/hashin.py b/hashin.py
index a43390e..427079f 100755
--- a/hashin.py
+++ b/hashin.py
@@ -773,6 +773,23 @@ def main():
     parser = get_parser()
     args = parser.parse_args()
 
+    if (
+        args.update_all
+        and args.packages
+        and len(args.packages) == 1
+        and os.path.isfile(args.packages[0])
+        and args.packages[0].endswith(".txt")
+    ):
+        # It's totally common to make the mistake of using the `--update-all` flag
+        # and specifying the requirements file as the first argument. E.g.
+        #
+        #     $ hashin --update-all --interactive myproject/reqs.txt
+        #
+        # The user intention is clear any non-keyed flags get interpreted as a
+        # list of "packages". Let's fix that for the user.
+        args.requirements_file = args.packages[0]
+        args.packages = []
+
     if args.update_all:
         if args.packages:
             print(

problem_statement: Be kinder if the package is a requirements file
So many times I've typed something like this:

```bash
▶ hashin --dry-run -u requirements/default.txt
Can not combine the --update-all option with a list of packages.
```
when I meant to type `hashin --dry-run -u -r requirements/default.txt`

It reminds me of how `pip` deals with `pip install requirements.txt` and thinks `requirements.txt` is a package name on PyPI.
repo: peterbe/hashin
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/test_cli.py b/tests/test_cli.py
index e494a33..8c60ba0 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -182,6 +182,36 @@ def test_packages_and_update_all(capsys, mock_get_parser):
     )
 
 
+def test_packages_and_update_all_with_requirements_file(
+    capsys, mock_get_parser, tmpfile
+):
+    with tmpfile() as filename:
+        with open(filename, "w") as f:
+            f.write("")
+
+        def mock_parse_args(*a, **k):
+            return argparse.Namespace(
+                packages=[filename],  # Note!
+                algorithm="sha256",
+                python_version="3.8",
+                verbose=False,
+                include_prereleases=False,
+                dry_run=False,
+                update_all=True,
+                interactive=False,
+                synchronous=False,
+                index_url="anything",
+            )
+
+        mock_get_parser().parse_args.side_effect = mock_parse_args
+
+        error = hashin.main()
+        assert error == 0
+        # Because the requirements file is empty, the update-all command
+        # won't find anything to query the internet about so we don't
+        # need to mock murlopen in this test.
+
+
 def test_no_packages_and_not_update_all(capsys, mock_get_parser):
     def mock_parse_args(*a, **k):
         return argparse.Namespace(
task: metadata: install: pip install -e .[dev]
patch: diff --git a/planet/clients/subscriptions.py b/planet/clients/subscriptions.py
index dd884a1..ac9ea69 100644
--- a/planet/clients/subscriptions.py
+++ b/planet/clients/subscriptions.py
@@ -221,7 +221,6 @@ class SubscriptionsClient:
 
         class _ResultsPager(Paged):
             """Navigates pages of messages about subscription results."""
-            NEXT_KEY = '_next'
             ITEMS_KEY = 'results'
 
         params = {'status': [val for val in status or {}]}

problem_statement: `planet subscriptions results` not returning more than 20 results
**Expected behavior**
`planet subscriptions results <sub-id>` to return 100 results as specified as the default in the documentation. Or to return 
the proper number of results if `--limit` is greater than 20 (it works properly if the limit is less than 20)

**Actual behavior (describe the problem)**

Only 20 results are returned, even if the `--limit` is set to be greater than 20. 

It seems like the cli client is not actually paging through results - it just does the first 20 and stops. I verified that the http endpoint has more results. It has 20 on the first page, but it has a 'next' link that has 20 per page.

**Workaround**
Going to the http end point directly and following the 'next' links?

**Minimum, Complete, Viable Code Sample**

```console
> planet subscriptions results <sub-id> --limit 21
```

Should result in 21 calls returned, only 20 are.

**Environment Information**
* Operation System Information: macOS-12.2.1-arm64-arm-64bit
* Python version 3.9.15: (main, Oct 11 2022, 21:39:54)  [Clang 14.0.0 (clang-1400.0.29.102)]
* Planet package version: planet, version 2.0a7dev

**Installation Method**
* pip

repo: planetlabs/planet-client-python
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/integration/test_subscriptions_api.py b/tests/integration/test_subscriptions_api.py
index 4658660..44daf66 100644
--- a/tests/integration/test_subscriptions_api.py
+++ b/tests/integration/test_subscriptions_api.py
@@ -122,7 +122,7 @@ def result_pages(status=None, size=40):
         pm = datetime.now().isoformat()
         if len(results) == size:
             url = f'https://api.planet.com/subscriptions/v1/42/results?pm={pm}'
-            page['_links']['_next'] = url
+            page['_links']['next'] = url
         pages.append(page)
     return pages
task: metadata: install: pip install -e .[dev]
patch: diff --git a/pre_commit/color.py b/pre_commit/color.py
index c785e2c..2ede410 100644
--- a/pre_commit/color.py
+++ b/pre_commit/color.py
@@ -48,6 +48,9 @@ def use_color(setting):
     if setting not in COLOR_CHOICES:
         raise InvalidColorSetting(setting)
 
+    if os.environ.get('NO_COLOR'):
+        return False
+
     return (
         setting == 'always' or
         (setting == 'auto' and sys.stdout.isatty() and terminal_supports_color)

problem_statement: Globally disable color?
I cannot find the way to globally disable color in the pre-commit output. Setting only the background color to green and not changing the foreground color does not work for my terminal with the following settings in the Xt resources (as set in the `${HOME}/.Xresources` file):

````properties
Rxvt.background: black
Rxvt.foreground: deepSkyBlue
````

Is there a way? It would be great to respect https://no-color.org/ environment variable. And, while we are here, maybe understand the following git config setting:

````ini
[color]
        ui = never
````

repo: pre-commit/pre-commit
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/color_test.py b/tests/color_test.py
index 6e11765..4ba3f32 100644
--- a/tests/color_test.py
+++ b/tests/color_test.py
@@ -1,5 +1,6 @@
 from __future__ import unicode_literals
 
+import os
 import sys
 
 import mock
@@ -50,3 +51,18 @@ def test_use_color_tty_without_color_support():
 def test_use_color_raises_if_given_shenanigans():
     with pytest.raises(InvalidColorSetting):
         use_color('herpaderp')
+
+
+def test_no_color_env_unset():
+    with mock.patch.dict(os.environ, clear=True):
+        assert use_color('always') is True
+
+
+def test_no_color_env_empty():
+    with mock.patch.dict(os.environ, NO_COLOR=''):
+        assert use_color('always') is True
+
+
+def test_no_color_env_non_empty():
+    with mock.patch.dict(os.environ, NO_COLOR=' '):
+        assert use_color('always') is False
task: metadata: install: pip install -e .[dev]
patch: diff --git a/pre_commit/commands/install_uninstall.py b/pre_commit/commands/install_uninstall.py
index 9372176..b2ccc5c 100644
--- a/pre_commit/commands/install_uninstall.py
+++ b/pre_commit/commands/install_uninstall.py
@@ -123,7 +123,7 @@ def install(
         skip_on_missing_config: bool = False,
         git_dir: Optional[str] = None,
 ) -> int:
-    if git.has_core_hookpaths_set():
+    if git_dir is None and git.has_core_hookpaths_set():
         logger.error(
             'Cowardly refusing to install hooks with `core.hooksPath` set.\n'
             'hint: `git config --unset-all core.hooksPath`',

problem_statement: core.hooksPath being set makes it not possible to install
I have a laptop which has some mandaotry global settings for git, and I have not been able to enable pre-commit.  I also tried doing
```
git config --global init.templateDir ~/.git-template
pre-commit init-templatedir ~/.git-template
```
But still get the message
```
[ERROR] Cowardly refusing to install hooks with `core.hooksPath` set.
hint: `git config --unset-all core.hooksPath`
```

Is there any work arounds for this?
repo: pre-commit/pre-commit
test_cmd: pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
test_patch: diff --git a/tests/commands/init_templatedir_test.py b/tests/commands/init_templatedir_test.py
index 4e32e75..d14a171 100644
--- a/tests/commands/init_templatedir_test.py
+++ b/tests/commands/init_templatedir_test.py
@@ -79,3 +79,14 @@ def test_init_templatedir_expanduser(tmpdir, tempdir_factory, store, cap_out):
     lines = cap_out.get().splitlines()
     assert len(lines) == 1
     assert lines[0].startswith('pre-commit installed at')
+
+
+def test_init_templatedir_hookspath_set(tmpdir, tempdir_factory, store):
+    target = tmpdir.join('tmpl')
+    tmp_git_dir = git_dir(tempdir_factory)
+    with cwd(tmp_git_dir):
+        cmd_output('git', 'config', '--local', 'core.hooksPath', 'hooks')
+        init_templatedir(
+            C.CONFIG_FILE, store, target, hook_types=['pre-commit'],
+        )
+    assert target.join('hooks/pre-commit').exists()