PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: analysis-dev/diktat (kotlin)

Issue:
Diktat should avoid fixing/raising a warning an issue for overriden contructor arguments
We should not suggest a `@param` Kdoc for the following code:

```
public class Ktoml(
    override val serializersModule: SerializersModule = EmptySerializersModule
)
```

Pull request:
### What's done:
* added check for override constructor arguments
Closes #833

Patch:
diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt
index 5623e08bf8..e3da872ddb 100644
--- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt
+++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt
@@ -161,7 +161,7 @@ class KdocComments(configRules: List<RulesConfig>) : DiktatRule(
 
     @Suppress("UnsafeCallOnNullableType")
     private fun createKdocBasicKdoc(node: ASTNode) {
-        if (node.getFirstChildWithType(MODIFIER_LIST).isAccessibleOutside()) {
+        if (node.getFirstChildWithType(MODIFIER_LIST).isAccessibleOutside() && !node.isOverridden()) {
             KDOC_NO_CONSTRUCTOR_PROPERTY.warnAndFix(configRules, emitWarn, isFixMode,
                 "add <${node.findChildByType(IDENTIFIER)!!.text}> to KDoc", node.startOffset, node) {
                 val newKdoc = KotlinParser().createNode("/**\n * @property ${node.findChildByType(IDENTIFIER)!!.text}\n */")


Test patch:
diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter2/KdocCommentsWarnTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter2/KdocCommentsWarnTest.kt
index a44a76201f..af0880fb88 100644
--- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter2/KdocCommentsWarnTest.kt
+++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter2/KdocCommentsWarnTest.kt
@@ -268,6 +268,19 @@ class KdocCommentsWarnTest : LintTestBase(::KdocComments) {
         )
     }
 
+    @Test
+    @Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY)
+    fun `shouldn't trigger on override parameter`() {
+        lintMethod(
+            """
+                    |@Suppress("MISSING_KDOC_TOP_LEVEL")
+                    |public class Example (
+                    |   override val serializersModule: SerializersModule = EmptySerializersModule
+                    |)
+                """.trimMargin()
+        )
+    }
+
     @Test
     @Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY)
     fun `shouldn't trigger because not primary constructor`() {
Repository: Roave/BetterReflection (php)

Issue:
Adapter ReflectionClass::getReflectionConstant returns null but should return false
See PoC fix: https://github.com/ondrejmirtes/BetterReflection/commit/07af30d92461a6a4e34194d21ab188b32e9cfcaa

Pull request:
Fixed ReflectionClass::getReflectionConstant() in adapter for non-existent constant
Fixes #625 

Patch:
diff --git a/src/Reflection/Adapter/ReflectionClass.php b/src/Reflection/Adapter/ReflectionClass.php
index 619ec433..87fb71f5 100644
--- a/src/Reflection/Adapter/ReflectionClass.php
+++ b/src/Reflection/Adapter/ReflectionClass.php
@@ -249,9 +249,12 @@ class ReflectionClass extends CoreReflectionClass
      */
     public function getReflectionConstant($name)
     {
-        return new ReflectionClassConstant(
-            $this->betterReflectionClass->getReflectionConstant($name),
-        );
+        $betterReflectionConstant = $this->betterReflectionClass->getReflectionConstant($name);
+        if ($betterReflectionConstant === null) {
+            return false;
+        }
+
+        return new ReflectionClassConstant($betterReflectionConstant);
     }
 
     /**


Test patch:
diff --git a/test/unit/Reflection/Adapter/ReflectionClassTest.php b/test/unit/Reflection/Adapter/ReflectionClassTest.php
index 6966eaba..59be357f 100644
--- a/test/unit/Reflection/Adapter/ReflectionClassTest.php
+++ b/test/unit/Reflection/Adapter/ReflectionClassTest.php
@@ -498,4 +498,17 @@ class ReflectionClassTest extends TestCase
 
         self::assertNull($reflectionClassAdapter->isInstance('string'));
     }
+
+    public function testGetReflectionConstantReturnsFalseWhenConstantDoesNotExist() : void
+    {
+        $betterReflectionClass = $this->createMock(BetterReflectionClass::class);
+        $betterReflectionClass
+            ->method('getReflectionConstant')
+            ->with('FOO')
+            ->willReturn(null);
+
+        $reflectionClassAdapter = new ReflectionClassAdapter($betterReflectionClass);
+
+        self::assertFalse($reflectionClassAdapter->getReflectionConstant('FOO'));
+    }
 }
Repository: JuliaAI/MLJBase.jl (julia)

Issue:
Remove initialisation of remote channels.
In MLJBase the `__init__` function initialises a remote channel called MACHINE_CHANNEL, which is only used for (important) testing purposes. However, this is an obstacle for certain kinds of scaling; see [this discourse thread](https://discourse.julialang.org/t/mlj-and-clustermanagers/51540).

Pull request:
Resolves #496

Patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cdd39517..85c43219 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,6 +9,8 @@ on:
       - master
       - dev
     tags: '*'
+env:
+  TEST_MLJBASE: "true"
 jobs:
   test:
     name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
@@ -41,6 +43,8 @@ jobs:
             ${{ runner.os }}-
       - uses: julia-actions/julia-buildpkg@v1
       - uses: julia-actions/julia-runtest@v1
+        env:
+          JULIA_NUM_THREADS: 2
       - uses: julia-actions/julia-processcoverage@v1
       - uses: codecov/codecov-action@v1
         with:
diff --git a/src/init.jl b/src/init.jl
index 9078a927..e1ae287c 100644
--- a/src/init.jl
+++ b/src/init.jl
@@ -1,9 +1,12 @@
 function __init__()
     global DEFAULT_RESOURCE = Ref{AbstractResource}(CPU1())
 
-    # for testing asynchronous training of learing networks:
-    global MACHINE_CHANNEL =
-        RemoteChannel(() -> Channel(100), myid())
+    # for testing asynchronous training of learning networks:
+    global TESTING = parse(Bool, get(ENV, "TEST_MLJBASE", "false"))
+    if TESTING
+        global MACHINE_CHANNEL =
+            RemoteChannel(() -> Channel(100), myid())
+    end
 
     TRAIT_FUNCTION_GIVEN_NAME[:measure]      = is_measure
     TRAIT_FUNCTION_GIVEN_NAME[:measure_type] = is_measure_type


Test patch:
diff --git a/test/runtests.jl b/test/runtests.jl
index 4e0e57f7..ad3aa3a2 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -1,6 +1,13 @@
 using Distributed
 addprocs()
 
+using MLJBase
+if !MLJBase.TESTING
+    error("To test MLJBase, the environment variable "*
+          "`TEST_MLJBASE` must be set to `\"true\"`\n"*
+          "You can do this in the REPL with `ENV[TEST_MLJBASE]=\"true\"")
+end
+
 @info "nprocs() = $(nprocs())"
 @static if VERSION >= v"1.3.0-DEV.573"
     import .Threads
Repository: goccy/go-yaml (go)

Issue:
Parsing JSON is whitespace-dependent
When a YAML contains a JSON object that's formatted without whitespace, for example `{"name":"John"}`, the parser gives the following error:
```
[1:2] failed to parse flow mapping value node
    >  1 | {"name":"John"}
```

This does not happen when fields are separated by a space, i.e. `{"name": "John"}`

Playground: https://goplay.space/#5xOT86HOV2L

Pull request:
Fix processing of mapping value delimiter in flow style
fix #142 

Patch:
diff --git a/scanner/scanner.go b/scanner/scanner.go
index 3a6fbe0..5a379a5 100644
--- a/scanner/scanner.go
+++ b/scanner/scanner.go
@@ -625,7 +625,7 @@ func (s *Scanner) scan(ctx *Context) (pos int) {
 			}
 		case ':':
 			nc := ctx.nextChar()
-			if nc == ' ' || s.isNewLineChar(nc) || ctx.isNextEOS() {
+			if s.startedFlowMapNum > 0 || nc == ' ' || s.isNewLineChar(nc) || ctx.isNextEOS() {
 				// mapping value
 				tk := s.bufferedToken(ctx)
 				if tk != nil {


Test patch:
diff --git a/parser/parser_test.go b/parser/parser_test.go
index c0451f1..dbd2cc6 100644
--- a/parser/parser_test.go
+++ b/parser/parser_test.go
@@ -9,7 +9,6 @@ import (
 	"github.com/goccy/go-yaml/ast"
 	"github.com/goccy/go-yaml/lexer"
 	"github.com/goccy/go-yaml/parser"
-	"github.com/goccy/go-yaml/printer"
 )
 
 func TestParser(t *testing.T) {
@@ -69,17 +68,12 @@ func TestParser(t *testing.T) {
 		"v: |-\n  0\n",
 		"v: |-\n  0\nx: 0",
 		`"a\n1\nb"`,
+		`{"a":"b"}`,
 	}
 	for _, src := range sources {
-		fmt.Printf(src)
-		tokens := lexer.Tokenize(src)
-		var printer printer.Printer
-		fmt.Println(printer.PrintTokens(tokens))
-		ast, err := parser.Parse(tokens, 0)
-		if err != nil {
-			t.Fatalf("%+v", err)
+		if _, err := parser.Parse(lexer.Tokenize(src), 0); err != nil {
+			t.Fatalf("parse error: source [%s]: %+v", src, err)
 		}
-		fmt.Printf("%+v\n", ast)
 	}
 }
 
@@ -547,7 +541,6 @@ b: c
 	}
 	for _, test := range tests {
 		tokens := lexer.Tokenize(test.source)
-		tokens.Dump()
 		f, err := parser.Parse(tokens, 0)
 		if err != nil {
 			t.Fatalf("%+v", err)
@@ -558,6 +551,7 @@ b: c
 		}
 		expect := fmt.Sprintf("\n%+v\n", f)
 		if test.expect != expect {
+			tokens.Dump()
 			t.Fatalf("unexpected output: [%s] != [%s]", test.expect, expect)
 		}
 	}
@@ -592,7 +586,18 @@ func TestSyntaxError(t *testing.T) {
 		if err == nil {
 			t.Fatal("cannot catch syntax error")
 		}
-		fmt.Printf("%v\n", err)
+		expected := `
+[2:3] unexpected key name
+   1 | a:
+>  2 | - b
+   3 |   c: d
+         ^
+   4 |   e: f
+   5 |   g: h`
+		actual := "\n" + err.Error()
+		if expected != actual {
+			t.Fatalf("expected: [%s] but got [%s]", expected, actual)
+		}
 	}
 }
Repository: tursodatabase/limbo (rust)

Issue:
Transaction commit in program halt is not re-entrant
If the `Program::halt()` function returns I/O status code, we attempt to commit a transaction that has already been committed as we retry the instruction. Part of the problem is that we perform checkpointing for every transaction, which is not what we want.

Pull request:
Fix AutoCommit for IO halting
IDK if I'm being naive here but it was the easiest way that I found to handle it.

closes #1004 

Patch:
diff --git a/core/vdbe/mod.rs b/core/vdbe/mod.rs
index 7621146d..af3349a5 100644
--- a/core/vdbe/mod.rs
+++ b/core/vdbe/mod.rs
@@ -1275,6 +1275,10 @@ impl Program {
                     rollback,
                 } => {
                     let conn = self.connection.upgrade().unwrap();
+                    if matches!(state.halt_state, Some(HaltState::Checkpointing)) {
+                        return self.halt(pager, state, mv_store);
+                    }
+
                     if *auto_commit != *conn.auto_commit.borrow() {
                         if *rollback {
                             todo!("Rollback is not implemented");


Test patch:
diff --git a/testing/all.test b/testing/all.test
index 42aadd03..5119b8eb 100755
--- a/testing/all.test
+++ b/testing/all.test
@@ -25,5 +25,4 @@ source $testdir/changes.test
 source $testdir/total-changes.test
 source $testdir/offset.test
 source $testdir/scalar-functions-printf.test
-# Disabled until https://github.com/tursodatabase/limbo/issues/1004 is fixed
-# source $testdir/transactions.test
+source $testdir/transactions.test
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 302
Good morning! Here's your coding interview problem for today.

This problem was asked by Uber.

You are given a 2-d matrix where each cell consists of either `/`, `\`, or an empty space. Write an algorithm that determines into how many regions the slashes divide the space.

For example, suppose the input for a three-by-six grid is the following:
```
\    /
 \  /
  \/
```
Considering the edges of the matrix as boundaries, this divides the grid into three triangles, so you should return `3`.

Pull request:
Day302
Resolves #615.

Patch:
diff --git a/README.md b/README.md
index ddbc35c..49da401 100644
--- a/README.md
+++ b/README.md
@@ -308,3 +308,4 @@ problems from
 * [Day 298](https://github.com/vaskoz/dailycodingproblem-go/issues/609)
 * [Day 299](https://github.com/vaskoz/dailycodingproblem-go/issues/611)
 * [Day 300](https://github.com/vaskoz/dailycodingproblem-go/issues/612)
+* [Day 302](https://github.com/vaskoz/dailycodingproblem-go/issues/615)
diff --git a/day302/problem.go b/day302/problem.go
new file mode 100644
index 0000000..e23e49e
--- /dev/null
+++ b/day302/problem.go
@@ -0,0 +1,37 @@
+package day302
+
+// DistinctRegions returns the number of separate regions divided
+// by the lines.
+// Uses Depth First Search to visit everything.
+func DistinctRegions(grid []string) int {
+	visited := make([][]bool, len(grid))
+	for i := range visited {
+		visited[i] = make([]bool, len(grid[i]))
+		for j := range visited[i] {
+			if grid[i][j] != ' ' {
+				visited[i][j] = true
+			}
+		}
+	}
+	var regions int
+	for i := range visited {
+		for j := range visited[i] {
+			if !visited[i][j] {
+				markRegion(visited, i, j)
+				regions++
+			}
+		}
+	}
+	return regions
+}
+
+func markRegion(visited [][]bool, r, c int) {
+	if r < 0 || r >= len(visited) || c < 0 || c >= len(visited[r]) || visited[r][c] {
+		return
+	}
+	visited[r][c] = true
+	markRegion(visited, r-1, c) // up
+	markRegion(visited, r+1, c) // down
+	markRegion(visited, r, c-1) // left
+	markRegion(visited, r, c+1) // right
+}


Test patch:
diff --git a/day302/problem_test.go b/day302/problem_test.go
new file mode 100644
index 0000000..ea90629
--- /dev/null
+++ b/day302/problem_test.go
@@ -0,0 +1,35 @@
+package day302
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	grid    []string
+	regions int
+}{
+	{
+		[]string{
+			`\    /`,
+			` \  / `,
+			`  \/  `,
+		},
+		3,
+	},
+}
+
+func TestDistinctRegions(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if regions := DistinctRegions(tc.grid); regions != tc.regions {
+			t.Errorf("Expected %v, got %v", tc.regions, regions)
+		}
+	}
+}
+
+func BenchmarkDistinctRegions(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			DistinctRegions(tc.grid)
+		}
+	}
+}