PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: JuliaGPU/KernelAbstractions.jl (julia)

Issue:
Default CPU workgroupsize can be inadequat for higher-dimensionsal kernels
As observed in https://github.com/WaterLily-jl/WaterLily.jl/pull/133#issuecomment-2263500896

When we have a grid like `(64, 64, 64)` using a WG size of (1024, 1, 1) is inefficient. Instead WL uses `(64,1,1)` and maybe KA should "spread" the `1024` to `(64, 64,1)`.

Pull request:
Fixes #499

cc: @b-fg @weymouth

Patch:
diff --git a/src/cpu.jl b/src/cpu.jl
index 151b31f2..539a1e33 100644
--- a/src/cpu.jl
+++ b/src/cpu.jl
@@ -46,6 +46,29 @@ function (obj::Kernel{CPU})(args...; ndrange=nothing, workgroupsize=nothing, )
     __run(obj, ndrange, iterspace, args, dynamic, obj.backend.static)
 end
 
+const CPU_GRAINSIZE = 1024 # Vectorization, 4x unrolling, minimal grain size
+function default_cpu_workgroupsize(ndrange)
+    # if the total kernel is small, don't launch multiple tasks
+    if prod(ndrange) <= CPU_GRAINSIZE
+        return ndrange
+    else
+        available = Ref(CPU_GRAINSIZE)
+        return ntuple(length(ndrange)) do i
+            dim = ndrange[i]
+            remaining = available[]
+            if remaining == 0
+                return 1
+            elseif remaining <= dim
+                available[] = 0
+                return remaining
+            else
+                available[] = remaining ÷ dim
+                return dim
+            end
+        end
+    end
+end
+
 @inline function launch_config(kernel::Kernel{CPU}, ndrange, workgroupsize)
     if ndrange isa Integer
         ndrange = (ndrange,)
@@ -55,7 +78,7 @@ end
     end
 
     if KernelAbstractions.workgroupsize(kernel) <: DynamicSize && workgroupsize === nothing
-        workgroupsize = (1024,) # Vectorization, 4x unrolling, minimal grain size
+        workgroupsize = default_cpu_workgroupsize(ndrange)
     end
     iterspace, dynamic = partition(kernel, ndrange, workgroupsize)
     # partition checked that the ndrange's agreed


Test patch:
diff --git a/test/test.jl b/test/test.jl
index 2eda66e0..9bf6f849 100644
--- a/test/test.jl
+++ b/test/test.jl
@@ -282,4 +282,14 @@ end
     @test KernelAbstractions.functional(Backend()) isa Union{Missing, Bool}
 end
 
+@testset "CPU default workgroupsize" begin
+    @test KernelAbstractions.default_cpu_workgroupsize((64,)) == (64,)
+    @test KernelAbstractions.default_cpu_workgroupsize((1024,)) == (1024,)
+    @test KernelAbstractions.default_cpu_workgroupsize((2056,)) == (1024,)
+    @test KernelAbstractions.default_cpu_workgroupsize((64, 64,)) == (64,16)
+    @test KernelAbstractions.default_cpu_workgroupsize((64, 64, 64,4)) == (64,16,1,1)
+    @test KernelAbstractions.default_cpu_workgroupsize((64,15)) == (64,15)
+    @test KernelAbstractions.default_cpu_workgroupsize((5,7,13,17)) == (5,7,13,2)
+end
+
 end
Repository: Wikunia/Javis.jl (julia)

Issue:
Auto-Export of Luxor Functions
Based on conversation with @Wikunia , the manual importing of `Luxor` is somewhat of a pain for each file written using Javis. @thofma suggested a great idea based on [Hecke.jl](https://github.com/thofma/Hecke.jl/blob/da91ba6cd304e4399a272931b022d5d94cb407b2/src/Hecke.jl#L82) to auto-export each function in Luxor automatically within Javis. Let's get this implemented for documentation and for #44 .

Pull request:
Implements #70 -- let me know if there is anything else you want to tweak from this!

Patch:
diff --git a/src/Javis.jl b/src/Javis.jl
index 88b79eb91..30831e996 100644
--- a/src/Javis.jl
+++ b/src/Javis.jl
@@ -742,6 +742,15 @@ function perform_action(action, video, frame, origin_matrix)
     end
 end
 
+const LUXOR_DONT_EXPORT = [:boundingbox, :Boxmaptile, :Sequence]
+
+# Export each function from Luxor
+for func in names(Luxor; imported=true)
+    if !(func in LUXOR_DONT_EXPORT)
+        eval(Meta.parse("import Luxor." * string(func)))
+        eval(Expr(:export, func))
+    end
+end
 
 export javis, latex
 export Video, Action, BackgroundAction, Rel


Test patch:
diff --git a/test/runtests.jl b/test/runtests.jl
index 3b79babbd..dfca64e30 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -1,7 +1,6 @@
 using Images
 using Javis
 using LaTeXStrings
-using Luxor
 using ReferenceTests
 using Test
Repository: gpbl/react-day-picker (ts)

Issue:
DayPickerInput numberOfMonths prop is not working
Example: https://codesandbox.io/s/5kw50q43r4

![image](https://user-images.githubusercontent.com/5362416/31578972-92802164-b15e-11e7-98ab-af8d5fb8b548.png)

(I see that it's handled by the `DayPickerInput` component and ignored in the `dayPickerProps`, but added to both anyway just in case :) )

Pull request:
Do not override numberOfMonths
Close #511 

Patch:
diff --git a/src/DayPickerInput.js b/src/DayPickerInput.js
index 95773dddc..374239f49 100644
--- a/src/DayPickerInput.js
+++ b/src/DayPickerInput.js
@@ -298,7 +298,6 @@ export default class DayPickerInput extends React.Component {
             month={this.state.month}
             selectedDays={selectedDay}
             onDayClick={this.handleDayClick}
-            numberOfMonths={1}
           />
         </div>
       </div>


Test patch:
diff --git a/test/daypickerinput/rendering.js b/test/daypickerinput/rendering.js
index f0271aacb..3f9a6e772 100644
--- a/test/daypickerinput/rendering.js
+++ b/test/daypickerinput/rendering.js
@@ -107,8 +107,7 @@ describe('DayPickerInput', () => {
       instance.showDayPicker();
       expect(instance.daypicker.props.fixedWeeks).toBe(false);
       expect(instance.daypicker.props.enableOutsideDays).toBe(true);
-      // number of months should be overridden by implementation
-      expect(instance.daypicker.props.numberOfMonths).toBe(1);
+      expect(instance.daypicker.props.numberOfMonths).toBe(12);
     });
     it('should open the daypicker to the month of the selected day', () => {
       const wrapper = mount(<DayPickerInput value="12/15/2017" />);
Repository: reata/sqllineage (python)

Issue:
Parenthesis around column arithmetic operation
when i parsed the sql like 
`	insert into target1 (code,p,lsh)
       select code,(payment_standard - fee_tot) ,lsh
       from source1
`
i got the result 
(Column: <default>.source1.code, Column: <default>.target1.code)



but i expect the result like 

(Column: <default>.source1.code, Column: <default>.target1.code)
(Column: <default>.source1.payment_standard , Column: <default>.target1.p)
(Column: <default>.source1.fee_tot , Column: <default>.target1.p)
(Column: <default>.source1.lsh, Column: <default>.target1.lsh)



Pull request:
fix: parenthesis around arithmetic operation
Closes #355 

Patch:
diff --git a/sqllineage/core/parser/sqlparse/handlers/source.py b/sqllineage/core/parser/sqlparse/handlers/source.py
index 761402e..cdec7cd 100644
--- a/sqllineage/core/parser/sqlparse/handlers/source.py
+++ b/sqllineage/core/parser/sqlparse/handlers/source.py
@@ -96,7 +96,7 @@ class SourceHandler(SourceHandlerMixin, NextTokenBaseHandler):
             )
 
     def _handle_column(self, token: Token) -> None:
-        column_token_types = (Identifier, Function, Operation, Case)
+        column_token_types = (Identifier, Function, Operation, Case, Parenthesis)
         if isinstance(token, column_token_types) or token.ttype is Wildcard:
             column_tokens = [token]
         elif isinstance(token, IdentifierList):


Test patch:
diff --git a/tests/test_columns.py b/tests/test_columns.py
index 1b085c0..fcf0a59 100644
--- a/tests/test_columns.py
+++ b/tests/test_columns.py
@@ -223,6 +223,22 @@ FROM tab2"""
 
 def test_select_column_using_expression_in_parenthesis():
     sql = """INSERT INTO tab1
+SELECT (col1 + col2)
+FROM tab2"""
+    assert_column_lineage_equal(
+        sql,
+        [
+            (
+                ColumnQualifierTuple("col1", "tab2"),
+                ColumnQualifierTuple("(col1 + col2)", "tab1"),
+            ),
+            (
+                ColumnQualifierTuple("col2", "tab2"),
+                ColumnQualifierTuple("(col1 + col2)", "tab1"),
+            ),
+        ],
+    )
+    sql = """INSERT INTO tab1
 SELECT (col1 + col2) AS col3
 FROM tab2"""
     assert_column_lineage_equal(
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 298
Good morning! Here's your coding interview problem for today.

This problem was asked by Google.

A girl is walking along an apple orchard with a bag in each hand. She likes to pick apples from each tree as she goes along, but is meticulous about not putting different kinds of apples in the same bag.

Given an input describing the types of apples she will pass on her path, in order, determine the length of the longest portion of her path that consists of just two types of apple trees.

For example, given the input `[2, 1, 2, 3, 3, 1, 3, 5]`, the longest portion will involve types `1` and `3`, with a length of **four**.

Pull request:
Day298
Resolves #609.

Patch:
diff --git a/README.md b/README.md
index bb4b972..d56bb3d 100644
--- a/README.md
+++ b/README.md
@@ -305,3 +305,4 @@ problems from
 * [Day 295](https://github.com/vaskoz/dailycodingproblem-go/issues/601)
 * [Day 296](https://github.com/vaskoz/dailycodingproblem-go/issues/605)
 * [Day 297](https://github.com/vaskoz/dailycodingproblem-go/issues/607)
+* [Day 298](https://github.com/vaskoz/dailycodingproblem-go/issues/609)
diff --git a/day298/problem.go b/day298/problem.go
new file mode 100644
index 0000000..a4c8f76
--- /dev/null
+++ b/day298/problem.go
@@ -0,0 +1,31 @@
+package day298
+
+// LongestAppleRun returns the length of the longest run of two types of apples.
+// Runs in O(N) time.
+func LongestAppleRun(apples []int) int {
+	lastIndex := make(map[int]int, 2)
+	var answer int
+	start := 0
+	for index, appleType := range apples {
+		lastIndex[appleType] = index
+		if len(lastIndex) > 2 {
+			if answer < index-start {
+				answer = index - start
+			}
+			var earliest int
+			min := int(^uint(0) >> 1)
+			for t, i := range lastIndex {
+				if i < min {
+					min = i
+					earliest = t
+				}
+			}
+			delete(lastIndex, earliest)
+			start = min + 1
+		}
+	}
+	if answer < len(apples)-start {
+		answer = len(apples) - start
+	}
+	return answer
+}


Test patch:
diff --git a/day298/problem_test.go b/day298/problem_test.go
new file mode 100644
index 0000000..39205c8
--- /dev/null
+++ b/day298/problem_test.go
@@ -0,0 +1,30 @@
+package day298
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	apples   []int
+	expected int
+}{
+	{[]int{2, 1, 2, 3, 3, 1, 3, 5}, 4},
+	{[]int{2, 1, 2, 2, 2, 1, 2, 1}, 8},
+	{[]int{4, 3, 2, 1}, 2},
+}
+
+func TestLongestAppleRun(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := LongestAppleRun(tc.apples); result != tc.expected {
+			t.Errorf("Expected %v, got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkLongestAppleRun(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			LongestAppleRun(tc.apples)
+		}
+	}
+}
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 253
Good morning! Here's your coding interview problem for today.

This problem was asked by PayPal.

Given a string and a number of lines k, print the string in zigzag form. In zigzag, characters are printed out diagonally from top left to bottom right until reaching the kth line, then back up to top right, and so on.

For example, given the sentence `"thisisazigzag"` and `k = 4`, you should print:
```
t     a     g
 h   s z   a
  i i   i z
   s     g
```

Pull request:
Day253
Resolves #521.

Patch:
diff --git a/README.md b/README.md
index ade3bcf..62b0659 100644
--- a/README.md
+++ b/README.md
@@ -263,3 +263,4 @@ problems from
 * [Day 249](https://github.com/vaskoz/dailycodingproblem-go/issues/514)
 * [Day 251](https://github.com/vaskoz/dailycodingproblem-go/issues/517)
 * [Day 252](https://github.com/vaskoz/dailycodingproblem-go/issues/519)
+* [Day 253](https://github.com/vaskoz/dailycodingproblem-go/issues/521)
diff --git a/day253/problem.go b/day253/problem.go
new file mode 100644
index 0000000..5a49cc2
--- /dev/null
+++ b/day253/problem.go
@@ -0,0 +1,47 @@
+package day253
+
+import (
+	"fmt"
+	"io"
+	"os"
+	"strings"
+)
+
+var (
+	// nolint
+	out io.Writer = os.Stdout
+)
+
+// PrintZigZag prints k lines of a zig-zag pattern for
+// the letters given.
+func PrintZigZag(letters string, k int) {
+	lines := make([]strings.Builder, k)
+	pos := 0
+	goingUp := false
+	for _, r := range letters {
+		switch {
+		case pos == k:
+			goingUp = true
+			pos -= 2
+		case pos == -1:
+			goingUp = false
+			pos += 2
+		}
+		for i := range lines {
+			if i == pos {
+				lines[i].WriteRune(r)
+			} else {
+				lines[i].WriteRune(' ')
+			}
+		}
+		switch {
+		case goingUp:
+			pos--
+		case !goingUp:
+			pos++
+		}
+	}
+	for _, line := range lines {
+		fmt.Fprintln(out, line.String())
+	}
+}


Test patch:
diff --git a/day253/problem_test.go b/day253/problem_test.go
new file mode 100644
index 0000000..9c077b7
--- /dev/null
+++ b/day253/problem_test.go
@@ -0,0 +1,38 @@
+package day253
+
+import (
+	"bytes"
+	"testing"
+)
+
+// nolint
+var testcases = []struct {
+	letters  string
+	k        int
+	expected string
+}{
+	{"thisisazigzag", 4, "t     a     g\n h   s z   a \n  i i   i z  \n   s     g   \n"},
+}
+
+func TestPrintZigZag(t *testing.T) {
+	// don't run in parallel due to global var
+	for _, tc := range testcases {
+		buff := new(bytes.Buffer)
+		out = buff
+		PrintZigZag(tc.letters, tc.k)
+		if result := buff.String(); result != tc.expected {
+			t.Errorf("Expected \n%s, got \n%s", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkPrintZigZag(b *testing.B) {
+	// don't run in parallel due to global var
+	buff := new(bytes.Buffer)
+	out = buff
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			PrintZigZag(tc.letters, tc.k)
+		}
+	}
+}
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 168
Good morning! Here's your coding interview problem for today.

This problem was asked by Facebook.

Given an N by N matrix, rotate it by 90 degrees clockwise.

For example, given the following matrix:
```
[[1, 2, 3],
 [4, 5, 6],
 [7, 8, 9]]
```
you should return:
```
[[7, 4, 1],
 [8, 5, 2],
 [9, 6, 3]]
```
Follow-up: What if you couldn't use any extra space?

Pull request:
Day168
Resolves #348.

Patch:
diff --git a/README.md b/README.md
index 027014b..b862e6e 100644
--- a/README.md
+++ b/README.md
@@ -179,3 +179,4 @@ problems from
 * [Day 165](https://github.com/vaskoz/dailycodingproblem-go/issues/343)
 * [Day 166](https://github.com/vaskoz/dailycodingproblem-go/issues/346)
 * [Day 167](https://github.com/vaskoz/dailycodingproblem-go/issues/347)
+* [Day 168](https://github.com/vaskoz/dailycodingproblem-go/issues/348)
diff --git a/day168/problem.go b/day168/problem.go
new file mode 100644
index 0000000..a3111d0
--- /dev/null
+++ b/day168/problem.go
@@ -0,0 +1,19 @@
+package day168
+
+// Matrix is a 2D array of integers of NxN dimension.
+type Matrix [][]int
+
+// RotateMatrixRightClockwise90 does what it says.
+// It creates a new Matrix for the result.
+func RotateMatrixRightClockwise90(m Matrix) Matrix {
+	result := make(Matrix, len(m))
+	for i := range result {
+		result[i] = make([]int, len(m))
+	}
+	for i := range m {
+		for j := range m[i] {
+			result[j][len(m)-1-i] = m[i][j]
+		}
+	}
+	return result
+}


Test patch:
diff --git a/day168/problem_test.go b/day168/problem_test.go
new file mode 100644
index 0000000..4e6c9a3
--- /dev/null
+++ b/day168/problem_test.go
@@ -0,0 +1,29 @@
+package day168
+
+import (
+	"reflect"
+	"testing"
+)
+
+var testcases = []struct {
+	matrix, rotated Matrix
+}{
+	{Matrix{
+		{1, 2, 3},
+		{4, 5, 6},
+		{7, 8, 9},
+	}, Matrix{
+		{7, 4, 1},
+		{8, 5, 2},
+		{9, 6, 3},
+	}},
+}
+
+func TestRotateMatrixRightClockwise90(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := RotateMatrixRightClockwise90(tc.matrix); !reflect.DeepEqual(result, tc.rotated) {
+			t.Errorf("Expected %v got %v", tc.rotated, result)
+		}
+	}
+}
Repository: sveltejs/prettier-plugin-svelte (ts)

Issue:
HTML comment is duplicated on format
This looks to be a very similar issue to #205.

The following works as a minimum repro in Svelte for VS Code v107.10.0

```
<div>
  <!-- this is duplicated on format -->
  <style></style>
</div>
```

But both of the following work as expected

```
<div>
  <!-- this is *not* duplicated on format -->
  <p>Hi</p>
</div>
```

```
<!-- this is *not* duplicated on format -->
<style></style>
```

So it appears to be the combination of the `<style>` tag and nested structure that triggers the bug. 

Pull request:
fix: don't duplicate comments of nested script/style tags
fixes #400

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f432b30..ef0f13d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
 ## 3.2.0 (Unreleased)
 
 -   (feat) format JSON script tags
+-   (fix) don't duplicate comments of nested script/style tags
 
 ## 3.1.2
 
diff --git a/src/embed.ts b/src/embed.ts
index a647bac..e3aab56 100644
--- a/src/embed.ts
+++ b/src/embed.ts
@@ -366,7 +366,8 @@ async function embedTag(
         // the new position.
         return [...comments, result, hardline];
     } else {
-        return comments.length ? [...comments, result] : result;
+        // Only comments at the top level get the special "move comment" treatment.
+        return isTopLevel && comments.length ? [...comments, result] : result;
     }
 }
 
diff --git a/src/print/index.ts b/src/print/index.ts
index 394acc5..f525b39 100644
--- a/src/print/index.ts
+++ b/src/print/index.ts
@@ -46,7 +46,6 @@ import {
 import {
     ASTNode,
     AttributeNode,
-    CommentInfo,
     CommentNode,
     IfBlockNode,
     Node,


Test patch:
diff --git a/test/printer/samples/script-style-inside-element-comment.html b/test/printer/samples/script-style-inside-element-comment.html
new file mode 100644
index 0000000..2fd3e3c
--- /dev/null
+++ b/test/printer/samples/script-style-inside-element-comment.html
@@ -0,0 +1,10 @@
+<div>
+    <!-- hello -->
+    <style></style>
+</div>
+<svelte:head>
+    <!-- world -->
+    <script>
+        let x;
+    </script>
+</svelte:head>