PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 334
Good morning! Here's your coding interview problem for today.

This problem was asked by Twitter.

The 24 game is played as follows. You are given a list of four integers, each between 1 and 9, in a fixed order. By placing the operators `+, -, *, and /` between the numbers, and grouping them with parentheses, determine whether it is possible to reach the value 24.

For example, given the input `[5, 2, 7, 8]`, you should return `True`, since `(5 * 2 - 7) * 8 = 24`.

Write a function that plays the 24 game.

Pull request:
Day334
Resolves #670.

Patch:
diff --git a/README.md b/README.md
index 96d4618..6d1d008 100644
--- a/README.md
+++ b/README.md
@@ -336,6 +336,7 @@ problems from
 * [Day 331](https://github.com/vaskoz/dailycodingproblem-go/issues/666)
 * [Day 332](https://github.com/vaskoz/dailycodingproblem-go/issues/669)
 * [Day 333](https://github.com/vaskoz/dailycodingproblem-go/issues/668)
+* [Day 334](https://github.com/vaskoz/dailycodingproblem-go/issues/670)
 * [Day 337](https://github.com/vaskoz/dailycodingproblem-go/issues/674)
 * [Day 338](https://github.com/vaskoz/dailycodingproblem-go/issues/675)
 * [Day 339](https://github.com/vaskoz/dailycodingproblem-go/issues/676)
diff --git a/day334/problem.go b/day334/problem.go
new file mode 100644
index 0000000..ac6d0b8
--- /dev/null
+++ b/day334/problem.go
@@ -0,0 +1,42 @@
+package day334
+
+const goal = 24
+
+// TwentyFourGame returns true if the game of 24
+// is possible given this input.
+// Operators used are: +, -, *, and /
+func TwentyFourGame(digits []int) bool {
+	if len(digits) == 1 {
+		return digits[0] == goal
+	}
+
+	for i := 0; i < len(digits)-1; i++ {
+		for _, op := range []rune{'+', '-', '*', '/'} {
+			var next []int
+			next = append(next, digits[:i]...)
+
+			switch op {
+			case '+':
+				next = append(next, digits[i]+digits[i+1])
+			case '-':
+				next = append(next, digits[i]-digits[i+1])
+			case '*':
+				next = append(next, digits[i]*digits[i+1])
+			case '/':
+				if digits[i+1] == 0 {
+					continue
+				}
+
+				next = append(next, digits[i]/digits[i+1])
+			}
+
+			next = append(next, digits[i+2:]...)
+
+			if TwentyFourGame(next) {
+				return true
+			}
+		}
+	}
+
+	return false
+}


Test patch:
diff --git a/day334/problem_test.go b/day334/problem_test.go
new file mode 100644
index 0000000..0d7d8ee
--- /dev/null
+++ b/day334/problem_test.go
@@ -0,0 +1,32 @@
+package day334
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	digits   []int
+	expected bool
+}{
+	{[]int{5, 2, 7, 8}, true},
+	{[]int{100, 100, 100, 100, 100}, false},
+	{[]int{2, 2, 2, 2, 2, 2, 2, 2, 2}, true},
+	{[]int{5760000, 10, 30, 40, 20}, true},
+}
+
+func TestTwentyFourGame(t *testing.T) {
+	t.Parallel()
+
+	for _, tc := range testcases {
+		if result := TwentyFourGame(tc.digits); result != tc.expected {
+			t.Errorf("Given %v, expected %v, got %v", tc.digits, tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkTwentyFourGame(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			TwentyFourGame(tc.digits)
+		}
+	}
+}
Repository: sindresorhus/normalize-url (js)

Issue:
Throwing error on given `view-source:` url string
```js
const normalize = require('normalize-url');
const n = normalize('view-source:https://github.com/sindresorhus/normalize-url/blob/master/index.js')
```
throws the error:
```
Thrown:
TypeError [ERR_INVALID_URL]: Invalid URL: http:view-source:https://github.com/sindresorhus/normalize-url/blob/master/index.js
    at onParseError (internal/url.js:243:9)
    at new URL (internal/url.js:319:5)
    at normalizeUrl
    [....]
 {
  input: 'http:view-source:https://github.com/sindresorhus/normalize-url/blob/master/index.js',
  code: 'ERR_INVALID_URL'
}
```
Is this intentionally an error? Seems unintentional to me because it first prepends `http` to the input, turning it into `'http:view-source:https://...` and then leaving it to the `URL` function to handle it, if I'm correct.

It would be awesome if we could have `view-source` urls handled by this module itself. Either define a normalisation result for `view-source` like how it's done for data urls, or return a clear error message.

Pull request:
Throw a friendly error on `view-source:` input
Fixes #118 

Patch:
diff --git a/index.js b/index.js
index e370d25..a746086 100644
--- a/index.js
+++ b/index.js
@@ -83,6 +83,10 @@ const normalizeUrl = (urlString, options) => {
 		return normalizeDataURL(urlString, options);
 	}
 
+	if (/^view-source:/i.test(urlString)) {
+		throw new Error('`view-source:` is not supported as it is a non-standard protocol');
+	}
+
 	const hasRelativeProtocol = urlString.startsWith('//');
 	const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString);
 


Test patch:
diff --git a/test.js b/test.js
index df1b392..5f2e54b 100644
--- a/test.js
+++ b/test.js
@@ -314,3 +314,9 @@ test('prevents homograph attack', t => {
 	// The input string uses Unicode to make it look like a valid `ebay.com` URL.
 	t.is(normalizeUrl('https://ebаy.com'), 'https://xn--eby-7cd.com');
 });
+
+test('view-source URL', t => {
+	t.throws(() => {
+		normalizeUrl('view-source:https://www.sindresorhus.com');
+	}, '`view-source:` is not supported as it is a non-standard protocol');
+});
Repository: microsoft/kiota (csharp)

Issue:
Make the model classes partial in C#
### Is your feature request related to a problem? Please describe the problem.

In other code generators (_did anyone say NSwag?_) , the generated model classes are partial. This can be very handy to add some computed properties as part of the API, without forcing users to define wrapper classes.
It may not be applicable to other languages not having the partial class concept, but it surely would help those who use C#.

### Client library/SDK language

Csharp

### Describe the solution you'd like

generate `public partial class` instead of `public class` when generating model code.

### Additional context

_No response_

Pull request:
fixes #4894
related #4242

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5876f44c57..a579967daa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+### Changed
+- Implemented partial class model declarations. [4894](https://github.com/microsoft/kiota/issues/4894)
+
 ### Added
 
 ### Changed
diff --git a/src/Kiota.Builder/Writers/CSharp/CodeClassDeclarationWriter.cs b/src/Kiota.Builder/Writers/CSharp/CodeClassDeclarationWriter.cs
index c6aa150712..040381a0fb 100644
--- a/src/Kiota.Builder/Writers/CSharp/CodeClassDeclarationWriter.cs
+++ b/src/Kiota.Builder/Writers/CSharp/CodeClassDeclarationWriter.cs
@@ -38,7 +38,7 @@ public override void WriteCodeElement(ClassDeclaration codeElement, LanguageWrit
         bool hasDescription = conventions.WriteLongDescription(parentClass, writer);
         conventions.WriteDeprecationAttribute(parentClass, writer);
         if (!hasDescription) writer.WriteLine("#pragma warning disable CS1591");
-        writer.WriteLine($"public class {codeElement.Name.ToFirstCharacterUpperCase()} {derivation}");
+        writer.WriteLine($"public partial class {codeElement.Name.ToFirstCharacterUpperCase()} {derivation}");
         if (!hasDescription) writer.WriteLine("#pragma warning restore CS1591");
         writer.StartBlock();
     }


Test patch:
diff --git a/tests/Kiota.Builder.Tests/Writers/CSharp/CodeClassDeclarationWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/CSharp/CodeClassDeclarationWriterTests.cs
index 80bbe163f9..d9100b9886 100644
--- a/tests/Kiota.Builder.Tests/Writers/CSharp/CodeClassDeclarationWriterTests.cs
+++ b/tests/Kiota.Builder.Tests/Writers/CSharp/CodeClassDeclarationWriterTests.cs
@@ -51,7 +51,7 @@ public void WritesSimpleDeclaration()
     {
         codeElementWriter.WriteCodeElement(parentClass.StartBlock, writer);
         var result = tw.ToString();
-        Assert.Contains("public class", result);
+        Assert.Contains("public partial class", result);
     }
 
     [Fact]
Repository: brazilian-utils/brutils-python (python)

Issue:
Add `isValidCNPJ ` method
In order to make it with the same API as [js brutils](https://brazilian-utils.com.br/#/utilities?id=isvalidcnpj)

Pull request:
feat: is_valid_cnpj
Closes #35 

Patch:
diff --git a/README.md b/README.md
index ff1d267..e2afed4 100644
--- a/README.md
+++ b/README.md
@@ -30,11 +30,11 @@ pip install brutils
 ```
 # numbers only, formatted as strings
 
->>> from brutils import cnpj
 >>> from brutils.cpf import is_valid_cpf
 >>> is_valid_cpf('00011122233')
 False
->>> cnpj.validate('00111222000133')
+>>> from brutils.cnpj import is_valid_cnpj
+>>> is_valid_cnpj('00111222000133')
 False
 ```
 
diff --git a/README_PT_BR.md b/README_PT_BR.md
index 8a7d394..dd77209 100644
--- a/README_PT_BR.md
+++ b/README_PT_BR.md
@@ -32,11 +32,11 @@ pip install brutils
 ```
 # somente numeros, em formato string
 
->>> from brutils import cnpj
 >>> from brutils.cpf import is_valid_cpf
 >>> is_valid_cpf('00011122233')
 False
->>> cnpj.validate('00111222000133')
+>>> from brutils.cnpj import is_valid_cnpj
+>>> is_valid_cnpj('00111222000133')
 False
 ```
 
diff --git a/brutils/cnpj.py b/brutils/cnpj.py
index b106bff..69f80df 100644
--- a/brutils/cnpj.py
+++ b/brutils/cnpj.py
@@ -72,6 +72,17 @@ def validate(cnpj):  # type: (str) -> bool
     )
 
 
+def is_valid_cnpj(cnpj):  # type: (str) -> bool
+    """
+    Returns whether or not the verifying checksum digits of the
+    given `cnpj` match it's base number. Input should be a digit
+    string of proper length.
+    Using this method name to match with the js library  api.
+    Using the same method to ensure backwards compatibility.
+    """
+    return validate(cnpj)
+
+
 def generate(branch=1):  # type: (int) -> str
     """
     Generates a random valid CNPJ digit string. An optional branch


Test patch:
diff --git a/tests/test_cnpj.py b/tests/test_cnpj.py
index 1f2ad92..d6874fc 100644
--- a/tests/test_cnpj.py
+++ b/tests/test_cnpj.py
@@ -8,7 +8,15 @@ range = range if version_info.major >= 3 else xrange
 path.insert(
     1, abspath(join(dirname(abspath(getsourcefile(lambda: 0))), pardir))
 )
-from brutils.cnpj import sieve, display, hashdigit, checksum, validate, generate
+from brutils.cnpj import (
+    sieve,
+    display,
+    hashdigit,
+    checksum,
+    validate,
+    generate,
+    is_valid_cnpj,
+)
 from unittest import TestCase, main
 
 
@@ -42,6 +50,11 @@ class CNPJ(TestCase):
         assert not validate("52599927000100")
         assert not validate("00000000000")
 
+    def test_is_valid_cnpj(self):
+        assert is_valid_cnpj("34665388000161")
+        assert not is_valid_cnpj("52599927000100")
+        assert not is_valid_cnpj("00000000000")
+
     def test_generate(self):
         for i in range(1000):
             assert validate(generate())