PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: projectfluent/fluent-rs (rust)
Issue: [DX Enhancement] Make fluent_args works with trailing comma
Currently, this code won't compile:
```rust
fluent_args! {
  "name" => "World",
}
```
Because fluent_args! doesn't handle trailing commas. The fix would be trivial, so I could do a PR if this is appreciated.
Pull request description: Make fluent_args macro work with trailing comma
Fixes #266 

Patch:
diff --git a/fluent/src/lib.rs b/fluent/src/lib.rs
index caa28db..1cbefc0 100644
--- a/fluent/src/lib.rs
+++ b/fluent/src/lib.rs
@@ -86,13 +86,13 @@ pub use fluent_bundle::*;
 ///
 /// let mut args = fluent_args![
 ///     "name" => "John",
-///     "emailCount" => 5
+///     "emailCount" => 5,
 /// ];
 ///
 /// ```
 #[macro_export]
 macro_rules! fluent_args {
-    ( $($key:expr => $value:expr),* ) => {
+    ( $($key:expr => $value:expr),* $(,)? ) => {
         {
             let mut args: $crate::FluentArgs = $crate::FluentArgs::new();
             $(


Test patch:
diff --git a/fluent/tests/macro.rs b/fluent/tests/macro.rs
index d362bc8..bff6d6a 100644
--- a/fluent/tests/macro.rs
+++ b/fluent/tests/macro.rs
@@ -7,7 +7,7 @@ fn test_fluent_args() {
     let args = fluent_args![
         "name" => "John",
         "emailCount" => 5,
-        "customValue" => FluentValue::from("My Value")
+        "customValue" => FluentValue::from("My Value"),
     ];
     assert_eq!(
         args.get("name"),
Repository: rigetticomputing/pyquil (python)
Issue: `ADD-KRAUS` does not pass the gate name to `Pragma` constructor
As is `ADD-KRAUS` is broken, but the fix is easy.
Pull request description: Ensure that gate name is added to ADD-KRAUS args
This fixes #176, a bug in the generation of `ADD-KRAUS` pragmas and also removes some unused code.

Patch:
diff --git a/pyquil/kraus.py b/pyquil/kraus.py
index f849fbf..e558ad4 100644
--- a/pyquil/kraus.py
+++ b/pyquil/kraus.py
@@ -50,9 +50,8 @@ def _create_kraus_pragmas(name, qubit_indices, kraus_ops):
     :rtype: str
     """
 
-    prefix = "PRAGMA ADD-KRAUS {} {}".format(name, " ".join(map(str, qubit_indices)))
     pragmas = [Pragma("ADD-KRAUS",
-                      qubit_indices,
+                      [name] + list(qubit_indices),
                       "({})".format(" ".join(map(format_parameter, np.ravel(k)))))
                for k in kraus_ops]
     return pragmas


Test patch:
diff --git a/pyquil/tests/test_quil.py b/pyquil/tests/test_quil.py
index 5d9db22..3673940 100644
--- a/pyquil/tests/test_quil.py
+++ b/pyquil/tests/test_quil.py
@@ -520,11 +520,11 @@ def test_kraus():
 
     ret = pq.out()
     assert ret == """X 0
-PRAGMA ADD-KRAUS 0 "(0.0+0.0i 1.0+0.0i 1.0+0.0i 0.0+0.0i)"
-PRAGMA ADD-KRAUS 0 "(0.0+0.0i 0.0+0.0i 0.0+0.0i 0.0+0.0i)"
+PRAGMA ADD-KRAUS X 0 "(0.0+0.0i 1.0+0.0i 1.0+0.0i 0.0+0.0i)"
+PRAGMA ADD-KRAUS X 0 "(0.0+0.0i 0.0+0.0i 0.0+0.0i 0.0+0.0i)"
 X 1
-PRAGMA ADD-KRAUS 1 "(0.0+0.0i 1.0+0.0i 1.0+0.0i 0.0+0.0i)"
-PRAGMA ADD-KRAUS 1 "(0.0+0.0i 0.0+0.0i 0.0+0.0i 0.0+0.0i)"
+PRAGMA ADD-KRAUS X 1 "(0.0+0.0i 1.0+0.0i 1.0+0.0i 0.0+0.0i)"
+PRAGMA ADD-KRAUS X 1 "(0.0+0.0i 0.0+0.0i 0.0+0.0i 0.0+0.0i)"
 """
     # test error due to bad normalization
     with pytest.raises(ValueError):