PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: python-attrs/attrs (python)

Issue:
Couldn't use numpy arrays as defaults on attrs 19.2
The following code stops working when upgrading from attrs 19.1 to 19.2:

```
@attr.s(auto_attribs=True)
class NumParams:
    N = 3
    alpha = np.zeros((N, Ng))
```

Seems that change #556 requires that default attributes should implement `__eq__`, which is not the case for numpy arrays.

Taceback is:
```
    @attr.s(auto_attribs=True)
../../../../miniconda/envs/attests/lib/python3.6/site-packages/attr/_make.py:1010: in wrap
    return builder.build_class()
../../../../miniconda/envs/attests/lib/python3.6/site-packages/attr/_make.py:498: in build_class
    return self._patch_original_class()
../../../../miniconda/envs/attests/lib/python3.6/site-packages/attr/_make.py:512: in _patch_original_class
    and getattr(cls, name, _sentinel) != _sentinel
E   ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
```

Pull request:
Fix default values that are not comparable with '=='
Fix #585



Patch:
diff --git a/changelog.d/585.change.rst b/changelog.d/585.change.rst
new file mode 100644
index 0000000..1b31403
--- /dev/null
+++ b/changelog.d/585.change.rst
@@ -0,0 +1,1 @@
+Fixed ``auto_attribs`` usage when default values cannot be compared directly with ``==``, such as ``numpy`` arrays.
diff --git a/src/attr/_make.py b/src/attr/_make.py
index 0ddca6a..46f9c54 100644
--- a/src/attr/_make.py
+++ b/src/attr/_make.py
@@ -509,7 +509,7 @@ class _ClassBuilder(object):
             for name in self._attr_names:
                 if (
                     name not in base_names
-                    and getattr(cls, name, _sentinel) != _sentinel
+                    and getattr(cls, name, _sentinel) is not _sentinel
                 ):
                     try:
                         delattr(cls, name)


Test patch:
diff --git a/tests/test_annotations.py b/tests/test_annotations.py
index 1f23f1d..43b4d0f 100644
--- a/tests/test_annotations.py
+++ b/tests/test_annotations.py
@@ -282,3 +282,18 @@ class TestAnnotations:
 
         with pytest.raises(AttributeError):
             C.y
+
+    def test_non_comparable_defaults(self):
+        """
+        Regression test for #585: objects that are not directly comparable
+        (for example numpy arrays) would cause a crash when used as
+        default values of an attrs auto-attrib class.
+        """
+
+        class NonComparable:
+            def __eq__(self, other):
+                raise ValueError
+
+        @attr.s(auto_attribs=True)
+        class C:
+            x: typing.Any = NonComparable()
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 91
Good morning! Here's your coding interview problem for today.

This problem was asked by Dropbox.

What does the below code snippet print out? How can we fix the anonymous functions to behave as we'd expect?
```
functions = []
for i in range(10):
    functions.append(lambda : i)

for f in functions:
    print(f())
```

Pull request:
Day91
Resolves #192.

Patch:
diff --git a/README.md b/README.md
index 4b4cd17..dbbf95a 100644
--- a/README.md
+++ b/README.md
@@ -100,3 +100,4 @@ problems from
 * [Day 88](https://github.com/vaskoz/dailycodingproblem-go/issues/185)
 * [Day 89](https://github.com/vaskoz/dailycodingproblem-go/issues/187)
 * [Day 90](https://github.com/vaskoz/dailycodingproblem-go/issues/189)
+* [Day 91](https://github.com/vaskoz/dailycodingproblem-go/issues/192)
diff --git a/day91/problem.go b/day91/problem.go
new file mode 100644
index 0000000..aed4d2e
--- /dev/null
+++ b/day91/problem.go
@@ -0,0 +1,31 @@
+package day91
+
+// BadSnippet is given in the problem.
+func BadSnippet() []int {
+	funcs := make([]func() int, 9)
+	for i := 0; i < 9; i++ {
+		funcs[i] = func() int {
+			return i
+		}
+	}
+	result := make([]int, 9)
+	for i, f := range funcs {
+		result[i] = f()
+	}
+	return result
+}
+
+// FixedSnippet is how it should be written.
+func FixedSnippet() []int {
+	funcs := make([]func(int) int, 9)
+	for i := 0; i < 9; i++ {
+		funcs[i] = func(i int) int {
+			return i
+		}
+	}
+	result := make([]int, 9)
+	for i, f := range funcs {
+		result[i] = f(i)
+	}
+	return result
+}


Test patch:
diff --git a/day91/problem_test.go b/day91/problem_test.go
new file mode 100644
index 0000000..5c5f139
--- /dev/null
+++ b/day91/problem_test.go
@@ -0,0 +1,36 @@
+package day91
+
+import (
+	"reflect"
+	"testing"
+)
+
+func TestBadSnippet(t *testing.T) {
+	t.Parallel()
+	expected := []int{9, 9, 9, 9, 9, 9, 9, 9, 9}
+	result := BadSnippet()
+	if !reflect.DeepEqual(expected, result) {
+		t.Errorf("Expected %v got %v", expected, result)
+	}
+}
+
+func BenchmarkBadSnippet(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		BadSnippet()
+	}
+}
+
+func TestFixedSnippet(t *testing.T) {
+	t.Parallel()
+	expected := []int{0, 1, 2, 3, 4, 5, 6, 7, 8}
+	result := FixedSnippet()
+	if !reflect.DeepEqual(expected, result) {
+		t.Errorf("Expected %v got %v", expected, result)
+	}
+}
+
+func BenchmarkFixedSnippet(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		FixedSnippet()
+	}
+}
Repository: nanomsg/nng (c)

Issue:
nng_msg_clear also clears the header
[`nng_msg_clear` docs](https://nng.nanomsg.org/man/v1.3.0/nng_msg_clear.3.html) state that it only clears the message body, but in 1.3.0 it clears both the body and header.  This was not the case in earlier releases.

## NNG & Platform details.

1.3.0

## Expected Behavior

`nng_msg_clear` only clears the message body and leaves the header untouched.

## Actual Behavior

`nni_msg_clear` now also clears the now inlined header from this CL (https://github.com/nanomsg/nng/commit/abab1392c11395d387e3072c4f5788d284846093#diff-f719e7b45a41a7b3f01eea3660f52434).



Pull request:
fix #1252
- nng_msg_clear should only clear the message body and not the head.  Add test to verify

fixes #1252 

Patch:
diff --git a/src/core/message.c b/src/core/message.c
index 9241ac65..79031400 100644
--- a/src/core/message.c
+++ b/src/core/message.c
@@ -578,7 +578,6 @@ nni_msg_header_append_u32(nni_msg *m, uint32_t val)
 void
 nni_msg_clear(nni_msg *m)
 {
-	m->m_header_len = 0;
 	nni_chunk_clear(&m->m_body);
 }
 


Test patch:
diff --git a/tests/message.c b/tests/message.c
index 22dd2852..1eda09b1 100644
--- a/tests/message.c
+++ b/tests/message.c
@@ -91,10 +91,13 @@ TestMain("Message Tests", {
 		});
 
 		Convey("Clearing the body works", {
+			nng_msg_header_append(msg, "bogus", 6);
 			So(nng_msg_append(msg, "bogus", 6) == 0);
 			So(nng_msg_len(msg) == 6);
 			nng_msg_clear(msg);
 			So(nng_msg_len(msg) == 0);
+			// It shouldn't clear the header
+			So(nng_msg_header_len(msg) == 6);
 		});
 
 		Convey("We cannot delete more header than exists", {
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 136
Good morning! Here's your coding interview problem for today.

This question was asked by Google.

Given an N by M matrix consisting only of 1's and 0's, find the largest rectangle containing only 1's and return its area.

For example, given the following matrix:
```
[[1, 0, 0, 0],
 [1, 0, 1, 1],
 [1, 0, 1, 1],
 [0, 1, 0, 0]]
```
Return 4.

Pull request:
Day136
Resolves #282.

Patch:
diff --git a/README.md b/README.md
index 451ceb1..80f0697 100644
--- a/README.md
+++ b/README.md
@@ -144,3 +144,4 @@ problems from
 * [Day 133](https://github.com/vaskoz/dailycodingproblem-go/issues/275)
 * [Day 134](https://github.com/vaskoz/dailycodingproblem-go/issues/278)
 * [Day 135](https://github.com/vaskoz/dailycodingproblem-go/issues/280)
+* [Day 136](https://github.com/vaskoz/dailycodingproblem-go/issues/282)
diff --git a/day136/problem.go b/day136/problem.go
new file mode 100644
index 0000000..abe65a3
--- /dev/null
+++ b/day136/problem.go
@@ -0,0 +1,46 @@
+package day136
+
+// MaxRectangleOfOnesAreaBrute returns the area of the largest rectangle
+// that contains only 1's.
+// The input is a 2-D matrix of 0's and 1's.
+// Runtime is O(Row*Col*MaxArea) because it checks every possible rectangle of 1's.
+func MaxRectangleOfOnesAreaBrute(matrix [][]int) int {
+	var maxArea int
+	for row := range matrix {
+		for col := 0; col < len(matrix[row]); col++ {
+			if matrix[row][col] == 1 {
+				area := areaOfOnes(matrix, row, col)
+				maxArea = max(area, maxArea)
+			}
+		}
+	}
+	return maxArea
+}
+
+func max(a, b int) int {
+	if a > b {
+		return a
+	}
+	return b
+}
+
+func min(a, b int) int {
+	if a < b {
+		return a
+	}
+	return b
+}
+
+func areaOfOnes(m [][]int, r, c int) int {
+	minWidth := len(m)
+	var colWidth int
+	for i := c; i < len(m[r]) && m[r][i] == 1; i++ {
+		colWidth++
+		var width int
+		for j := r; j < len(m) && m[j][i] == 1; j++ {
+			width++
+		}
+		minWidth = min(width, minWidth)
+	}
+	return colWidth * minWidth
+}


Test patch:
diff --git a/day136/problem_test.go b/day136/problem_test.go
new file mode 100644
index 0000000..c8f1d1f
--- /dev/null
+++ b/day136/problem_test.go
@@ -0,0 +1,50 @@
+package day136
+
+import "testing"
+
+var testcases = []struct {
+	matrix  [][]int
+	maxArea int
+}{
+	{[][]int{
+		{1, 0, 0, 0},
+		{1, 0, 1, 1},
+		{1, 0, 1, 1},
+		{0, 1, 0, 0},
+	}, 4},
+	{[][]int{
+		{1, 1, 1, 1},
+		{0, 0, 0, 0},
+		{0, 0, 0, 0},
+		{0, 0, 0, 0},
+	}, 4},
+	{[][]int{
+		{1, 1, 1, 0},
+		{1, 0, 0, 0},
+		{1, 0, 0, 0},
+		{0, 0, 0, 0},
+	}, 3},
+	{[][]int{
+		{1, 1, 1, 0},
+		{0, 0, 0, 0},
+		{1, 1, 1, 1},
+		{1, 1, 1, 1},
+	}, 8},
+}
+
+func TestMaxRectangleOfOnesAreaBrute(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := MaxRectangleOfOnesAreaBrute(tc.matrix); result != tc.maxArea {
+			t.Errorf("Expected %v got %v", tc.maxArea, result)
+		}
+	}
+}
+
+func BenchmarkMaxRectangleOfOnesAreaBrute(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			MaxRectangleOfOnesAreaBrute(tc.matrix)
+		}
+	}
+}
Repository: 100phlecs/tailwind_formatter (elixir)

Issue:
Formatter breaks special class attribute: `[scrollbar-gutter: stable]`
The space before the `stable` keyword is mandatory
```
[...]layouts/root.html.heex

  1   1  |<!DOCTYPE html>
  2     -|<html lang="en" class="[scrollbar-gutter: stable]">
      2 +|<html lang="en" class="stable] :[scrollbar-gutter">
  3   3  |  <head>
  4   4  |    <meta charset="utf-8" />
         |
```

Pull request:
handle arbitrary properties
Closes #63 

Patch:
diff --git a/lib/tailwind_formatter.ex b/lib/tailwind_formatter.ex
index e3d37a9..9ac3829 100644
--- a/lib/tailwind_formatter.ex
+++ b/lib/tailwind_formatter.ex
@@ -94,7 +94,7 @@ defmodule TailwindFormatter do
 
   defp sort_variant_chains(classes) do
     classes
-    |> String.split()
+    |> String.split(~r/\s+(?![^\[]*\])/i, trim: true)
     |> Enum.map(fn class ->
       class
       |> String.split(":")
@@ -125,7 +125,7 @@ defmodule TailwindFormatter do
   end
 
   defp placeholder?(class), do: String.contains?(class, @placeholder)
-  defp variant?(class), do: String.contains?(class, ":")
+  defp variant?(class), do: String.contains?(class, ":") and not String.starts_with?(class, "[")
   defp prose?(class), do: String.contains?(class, "prose")
 
   defp class_position(class),


Test patch:
diff --git a/test/tailwind_formatter_test.exs b/test/tailwind_formatter_test.exs
index b462736..4c4c1e1 100644
--- a/test/tailwind_formatter_test.exs
+++ b/test/tailwind_formatter_test.exs
@@ -523,4 +523,41 @@ defmodule TailwindFormatterTest do
 
     assert_formatter_output(input, expected)
   end
+
+  # https://tailwindcss.com/docs/adding-custom-styles#arbitrary-properties
+  test "handles arbitrary properties" do
+    input = """
+      <html lang="en" class="sm:[scrollbar-gutter: stable] potato">
+    """
+
+    expected = """
+      <html lang="en" class="potato sm:[scrollbar-gutter: stable]">
+    """
+
+    assert_formatter_output(input, expected)
+  end
+
+  test "issue #63" do
+    input = """
+      <html lang="en" class="[scrollbar-gutter: stable]">
+    """
+
+    expected = """
+      <html lang="en" class="[scrollbar-gutter: stable]">
+    """
+
+    assert_formatter_output(input, expected)
+  end
+
+  test "splits variants with arbitrary values" do
+    input = """
+    <div class="sm:lowercase sm:px-[1px] potato text-sm uppercase"></div>
+    """
+
+    expected = """
+    <div class="potato text-sm uppercase sm:px-[1px] sm:lowercase"></div>
+    """
+
+    assert_formatter_output(input, expected)
+  end
 end
Repository: domluna/JuliaFormatter.jl (julia)

Issue:
Incorrect handling of `..` in `using` statements
Formatting the following text
```julia
using Measurements: (..)
```

Outputs the error
```
┌ Warning: Failed to format file /Users/jonnie.diegelman/github/FlightSystems/blah.jl due to a parsing error, skipping file
│   error =
│    ParseError:
│    # Warning @ line 1:21
│    using Measurements: (..)
│    #                   └──┘ ── parentheses are not required here
└ @ JuliaFormatter ~/.julia/packages/JuliaFormatter/D3w1R/src/JuliaFormatter.jl:448
```

This is incorrect. The parentheses are required, otherwise the code is not able to be parsed.

JuliaFormatter version: `v2.1.2`
Output of `versioninfo()`:
```
Julia Version 1.11.4
Commit 8561cc3d68d (2025-03-10 11:36 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 8 × Apple M1
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m1)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)
```

Pull request:
Fixes https://github.com/domluna/JuliaFormatter.jl/issues/917.

Patch:
diff --git a/src/JuliaFormatter.jl b/src/JuliaFormatter.jl
index 8a76dd6cc..74721bfcc 100644
--- a/src/JuliaFormatter.jl
+++ b/src/JuliaFormatter.jl
@@ -207,7 +207,7 @@ function format_text(text::AbstractString, style::AbstractStyle, opts::Options)
     if opts.always_for_in == true
         @assert valid_for_in_op(opts.for_in_replacement) "`for_in_replacement` is set to an invalid operator \"$(opts.for_in_replacement)\", valid operators are $(VALID_FOR_IN_OPERATORS). Change it to one of the valid operators and then reformat."
     end
-    t = JuliaSyntax.parseall(JuliaSyntax.GreenNode, text)
+    t = JuliaSyntax.parseall(JuliaSyntax.GreenNode, text; ignore_warnings = true)
     state = State(Document(text), opts)
     text = format_text(t, style, state)
     return text
@@ -277,7 +277,7 @@ function format_text(node::JuliaSyntax.GreenNode, style::AbstractStyle, s::State
     text = normalize_line_ending(text, replacer)
 
     try
-        _ = JuliaSyntax.parseall(JuliaSyntax.GreenNode, text)
+        _ = JuliaSyntax.parseall(JuliaSyntax.GreenNode, text; ignore_warnings = true)
     catch err
         @warn "Formatted text is not parsable ... no change made."
         rethrow(err)


Test patch:
diff --git a/test/issues.jl b/test/issues.jl
index 14ea67d9c..a9976c518 100644
--- a/test/issues.jl
+++ b/test/issues.jl
@@ -1947,4 +1947,10 @@
         """
         @test fmt(str_, 4, 100) == s
     end
+
+    @testset "917" begin
+        s = "using Foo: ( .. )"
+        sf = "using Foo: (..)"
+        @test fmt(s, 4, 100) == sf
+    end
 end
Repository: baianat/vee-validate (js)

Issue:
validator.reset() doesn't respect vmId when clearing errors
**Versions**

- vee-validate: 2.1.2
- vue: 2.5.17

**Describe the bug**
validator.reset() correctly filters fields by vmId (or specified matcher) when resetting field flags, but does not when clearing errors. See https://github.com/baianat/vee-validate/blob/master/src/core/validator.js#L224. I believe the solution would be as simple as filtering `this.errors` by the matcher as is done on L221 for `this.fields`; I'd be happy to submit a PR for this.

**To reproduce**
Steps to reproduce the behavior:
1. Define a component with some validation rules
2. Include the component multiple times
3. Trigger a validation error on one component
4. Call `this.$validator.reset()` on the other component (doesn't matter whether `{ vmId: this.$validator.id }` is passed as the matcher since this is the default behavior)
5. The validation errors on the first component are cleared

**Expected behavior**
The validation errors on other components should not be cleared when reset() is called


Pull request:
Fix validator.reset not respecting vmId when clearing errors (#1714)
🔎 __Overview__

Explain the premise for adding this PR and why is it important.

> This PR fixes the bug #1714.

✔ __Issues affected__

list of issues formatted like this:

> fixes #1714


Patch:
diff --git a/src/core/validator.js b/src/core/validator.js
index 2ec857ce..6496d190 100644
--- a/src/core/validator.js
+++ b/src/core/validator.js
@@ -221,7 +221,7 @@ export default class Validator {
       this.fields.filter(matcher).forEach(field => {
         field.waitFor(null);
         field.reset(); // reset field flags.
-        this.errors.remove(field.name, field.scope);
+        this.errors.remove(field.name, field.scope, matcher && matcher.vmId);
       });
     });
   }


Test patch:
diff --git a/tests/unit/validator.js b/tests/unit/validator.js
index 4865752f..0ba49256 100644
--- a/tests/unit/validator.js
+++ b/tests/unit/validator.js
@@ -741,6 +741,18 @@ test('resets fields matching the matcher options', async () => {
   expect(v.errors.count()).toBe(0);
 });
 
+test('resets errors scoped by vmId', async () => {
+  const v = new Validator();
+  v.attach({ name: 'field', vmId: 123 });
+  v.attach({ name: 'field', vmId: 456 });
+
+  v.errors.add({ field: 'field', msg: 'oops', vmId: 123 });
+  v.errors.add({ field: 'field', msg: 'oops', vmId: 456 });
+
+  await v.reset({ name: 'field', vmId: 123 });
+  expect(v.errors.count()).toBe(1);
+});
+
 test('resets all fields', async () => {
   const v = new Validator();
   v.attach({ name: 'field' });