nebius/SWE-bench-extra huggingface dataset:
Repository: smok-serwis/coolamqp

Issue:
Support passing qos as int
it should be understood as None, int then.

Comments:

Patch:
diff --git a/coolamqp/attaches/consumer.py b/coolamqp/attaches/consumer.py
index 98da3c0..32085bd 100644
--- a/coolamqp/attaches/consumer.py
+++ b/coolamqp/attaches/consumer.py
@@ -87,8 +87,10 @@ class Consumer(Channeler):
         :param on_message: callable that will process incoming messages
         :type on_message: callable(ReceivedMessage instance)
         :param no_ack: Will this consumer require acknowledges from messages?
-        :param qos: a tuple of (prefetch size, prefetch window) for this consumer
-        :type qos: tuple(int, int) or tuple(None, int)
+        :param qos: a tuple of (prefetch size, prefetch window) for this consumer, or an int (prefetch window only)
+            If an int is passed, prefetch size will be set to 0 (which means undefined), and this int
+            will be used for prefetch window
+        :type qos: tuple(int, int) or tuple(None, int) or int
         :param cancel_on_failure: Consumer will cancel itself when link goes down
         :type cancel_on_failure: bool
         :param future_to_notify: Future to succeed when this consumer goes online for the first time.
@@ -119,7 +121,9 @@ class Consumer(Channeler):
         # if this is not None, then it has an attribute
         # on_cancel_customer(Consumer instance)
         if qos is not None:
-            if qos[0] is None:
+            if isinstance(qos, int):
+                qos = 0, qos
+            elif qos[0] is None:
                 qos = 0, qos[1]  # prefetch_size=0=undefined
         self.qos = qos
         self.qos_update_sent = False  # QoS was not sent to server


Test patch:
diff --git a/tests/test_attaches/__init__.py b/tests/test_attaches/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/test_attaches/test_consumer.py b/tests/test_attaches/test_consumer.py
new file mode 100644
index 0000000..3ddf662
--- /dev/null
+++ b/tests/test_attaches/test_consumer.py
@@ -0,0 +1,13 @@
+# coding=UTF-8
+from __future__ import print_function, absolute_import, division
+import six
+import unittest
+from coolamqp.attaches import Consumer
+from coolamqp.objects import Queue
+
+
+class TestConsumer(unittest.TestCase):
+    def test_issue_26(self):
+        """Support for passing qos as int"""
+        cons = Consumer(Queue('wtf'), lambda msg: None, qos=25)
+        self.assertEquals(cons.qos, (0, 25))
Repository: snakemake/snakemake

Issue:
Support pathlib in expand()
**Is your feature request related to a problem? Please describe.**
Pathlib works most places in snakemake, which is great. However, in calls to expand(), pathlib paths must be converted to `str`, otherwise the following error occurs:

```sh
TypeError in line 29 of /Users/.../Snakefile:
'PosixPath' object is not iterable
  File "/Users/.../Snakefile", line 29, in <module>
```

**Describe the solution you'd like**
Update the `expand()` function to check whether the first argument is a `Path` object, and convert it to a string if so.



Comments:

Patch:
diff --git a/snakemake/io.py b/snakemake/io.py
index 1d5bf24b..d3fa5d6a 100755
--- a/snakemake/io.py
+++ b/snakemake/io.py
@@ -955,7 +955,7 @@ def expand(*args, **wildcards):
         combinator = product
     elif len(args) == 2:
         combinator = args[1]
-    if isinstance(filepatterns, str):
+    if isinstance(filepatterns, str) or isinstance(filepatterns, Path):
         filepatterns = [filepatterns]
 
     def path_to_str(f):
diff --git a/snakemake/workflow.py b/snakemake/workflow.py
index 5dc4f148..ccf603d3 100644
--- a/snakemake/workflow.py
+++ b/snakemake/workflow.py
@@ -952,7 +952,7 @@ class Workflow:
 
         success = scheduler.schedule()
 
-        if not immediate_submit:
+        if not immediate_submit and not dryrun:
             dag.cleanup_workdir()
 
         if success:


Test patch:
diff --git a/tests/test_io.py b/tests/test_io.py
index bbad3b13..a53bad2f 100644
--- a/tests/test_io.py
+++ b/tests/test_io.py
@@ -1,3 +1,5 @@
+from pathlib import PosixPath
+
 from snakemake.io import _wildcard_regex, expand
 from snakemake.exceptions import WildcardError
 
@@ -100,3 +102,6 @@ def test_expand():
     assert sorted(
         expand(["a: {a} + b: {b}", "c: {c}"], a="aa", b=["b", "bb"], c=["c", "cc"])
     ) == sorted(["a: aa + b: b", "a: aa + b: bb", "c: c", "c: cc"])
+
+    # expand on pathlib.Path objects
+    assert expand(PosixPath() / "{x}" / "{y}", x="Hello", y="world",) == ["Hello/world"]