PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: axios/axios (js)

Issue:
Wrongly typed config parameter in constructor
### Describe the bug

In the typing information for the `config` constructor parameter for the `Axios` object, `config` is optional (that is, it is `config?`), but the constructor does require (at least) an empty object.

![Image](https://github.com/user-attachments/assets/9163fca6-be59-45dc-8cc0-ced59b36384f)

### To Reproduce

_No response_

### Code snippet

```js
import * as axios from 'axios';
// Typechecks correctly, fails at runtime
const instance = new axios.Axios();
```

### Expected behavior

_No response_

### Axios Version

1.8.4

### Adapter Version

_No response_

### Browser

_No response_

### Browser Version

_No response_

### Node.js Version

_No response_

### OS

_No response_

### Additional Library Versions

```bash

```

### Additional context/Screenshots

```bash

```

Pull request:
fix(core): fix the Axios constructor implementation to treat the config argument as optional;
Fixes #6879 

Patch:
diff --git a/lib/core/Axios.js b/lib/core/Axios.js
index 386dc01..cff383e 100644
--- a/lib/core/Axios.js
+++ b/lib/core/Axios.js
@@ -20,7 +20,7 @@ const validators = validator.validators;
  */
 class Axios {
   constructor(instanceConfig) {
-    this.defaults = instanceConfig;
+    this.defaults = instanceConfig || {};
     this.interceptors = {
       request: new InterceptorManager(),
       response: new InterceptorManager()


Test patch:
diff --git a/test/unit/core/Axios.js b/test/unit/core/Axios.js
index 8958ad1..a4d62ac 100644
--- a/test/unit/core/Axios.js
+++ b/test/unit/core/Axios.js
@@ -43,5 +43,11 @@ describe('Axios', function () {
         }
       })
     });
-  })
+  });
+
+  it('should not throw if the config argument is omitted', () => {
+    const axios = new Axios();
+
+    assert.deepStrictEqual(axios.defaults, {});
+  });
 });
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 322
Good morning! Here's your coding interview problem for today.

This problem was asked by Flipkart.

Starting from `0` on a number line, you would like to make a series of jumps that lead to the integer `N`.

On the `i-th` jump, you may move exactly `i` places to the left or right.

Find a path with the fewest number of jumps required to get from `0` to `N`.

Pull request:
Day322
Resolves #654.

Patch:
diff --git a/README.md b/README.md
index ff0bd53..b955c47 100644
--- a/README.md
+++ b/README.md
@@ -325,3 +325,4 @@ problems from
 * [Day 317](https://github.com/vaskoz/dailycodingproblem-go/issues/645)
 * [Day 320](https://github.com/vaskoz/dailycodingproblem-go/issues/650)
 * [Day 321](https://github.com/vaskoz/dailycodingproblem-go/issues/651)
+* [Day 322](https://github.com/vaskoz/dailycodingproblem-go/issues/654)
diff --git a/day322/problem.go b/day322/problem.go
new file mode 100644
index 0000000..ffb32d1
--- /dev/null
+++ b/day322/problem.go
@@ -0,0 +1,22 @@
+package day322
+
+// NumberOfJumps returns the number of jumps to reach
+// N from 0.
+// Each jump length is of length "i".
+// Runs in O(answer) time and O(1) space.
+func NumberOfJumps(n int) int {
+	if n < 0 {
+		n = -n
+	}
+	var result int
+	for arithmeticSum(result) < n || (arithmeticSum(result)-n)%2 == 1 {
+		result++
+	}
+	return result
+}
+
+// arithmeticSum is:
+// https://en.wikipedia.org/wiki/Arithmetic_progression#Sum
+func arithmeticSum(n int) int {
+	return (n * (n + 1)) / 2
+}


Test patch:
diff --git a/day322/problem_test.go b/day322/problem_test.go
new file mode 100644
index 0000000..5c6238e
--- /dev/null
+++ b/day322/problem_test.go
@@ -0,0 +1,35 @@
+package day322
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	n, jumps int
+}{
+	{9, 5},
+	{1, 1},
+	{0, 0},
+	{2, 3},
+	{3, 2},
+	{-3, 2},
+	{-2, 3},
+	{-1, 1},
+	{-9, 5},
+}
+
+func TestNumberOfJumps(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if jumps := NumberOfJumps(tc.n); jumps != tc.jumps {
+			t.Errorf("Given %v, expected %v, got %v", tc.n, tc.jumps, jumps)
+		}
+	}
+}
+
+func BenchmarkNumberOfJumps(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			NumberOfJumps(tc.n)
+		}
+	}
+}
Repository: editorconfig-checker/editorconfig-checker (go)

Issue:
Could not decode the IBM420_rtl encoded file
Type `printf 'inc\nsub\n' > abc` to create a file `abc`.
There is no `.ecrc` and type `editorconfig-checker`. It shows error. Why?

<img width="503" alt="CleanShot 2023-02-07 at 15 22 27@2x" src="https://user-images.githubusercontent.com/1998490/217175826-4ae07360-28e9-4dd7-8ea6-c27d8933b9e8.png">


Pull request:
Ignore unrecognized charsets (Fixes #252)
All tests pass.

Patch:
diff --git a/pkg/encoding/encoding.go b/pkg/encoding/encoding.go
index b7d10af..a1cb6e7 100644
--- a/pkg/encoding/encoding.go
+++ b/pkg/encoding/encoding.go
@@ -126,6 +126,10 @@ func detectText(contentBytes []byte) (string, error) {
 	confidence := -1
 	keys := make([]string, 0, len(results))
 	for _, result := range results {
+		_, ok := getEncoding(result.Charset)
+		if !ok {
+			continue
+		}
 		if result.Confidence < confidence {
 			break
 		}
@@ -137,18 +141,14 @@ func detectText(contentBytes []byte) (string, error) {
 }
 
 func decodeText(contentBytes []byte, charset string) (string, error) {
-	r := strings.NewReplacer("-", "", "_", "")
-	key := strings.ToLower(r.Replace(charset))
-	enc, ok := encodings[key]
+	enc, ok := getEncoding(charset)
 	if !ok {
 		return "", fmt.Errorf("unrecognized charset %s", charset)
 	}
-	if enc != nil {
-		var err error
-		contentBytes, err = enc.NewDecoder().Bytes(contentBytes)
-		if err != nil {
-			return "", err
-		}
+	var err error
+	contentBytes, err = enc.NewDecoder().Bytes(contentBytes)
+	if err != nil {
+		return "", err
 	}
 	if !utf8.Valid(contentBytes) {
 		return "", fmt.Errorf("the file is not a valid UTF-8 encoded file")
@@ -156,6 +156,13 @@ func decodeText(contentBytes []byte, charset string) (string, error) {
 	return string(contentBytes), nil
 }
 
+func getEncoding(charset string) (encoding.Encoding, bool) {
+	r := strings.NewReplacer("-", "", "_", "")
+	key := strings.ToLower(r.Replace(charset))
+	enc, ok := encodings[key]
+	return enc, ok
+}
+
 var binaryChars = [256]bool{}
 
 func init() {


Test patch:
diff --git a/pkg/encoding/encoding_test.go b/pkg/encoding/encoding_test.go
index fc69f0b..c49e846 100644
--- a/pkg/encoding/encoding_test.go
+++ b/pkg/encoding/encoding_test.go
@@ -16,6 +16,7 @@ type decodeTest struct {
 }
 
 var decodeTextTests = []decodeTest{
+	// Encodings
 	{"8859_1_da.html", "ISO-8859-1", false, false},
 	{"8859_1_de.html", "ISO-8859-1", false, false},
 	{"8859_1_en.html", "ISO-8859-1", false, false},
@@ -68,6 +69,8 @@ var decodeTextTests = []decodeTest{
 	{"utf8-sdl.txt", "windows-1252", false, false}, // should be UTF-8
 	{"utf8.txt", "UTF-8", false, false},
 	{"utf8.txt-encoding-test-files.txt", "UTF-8", false, false},
+	// Issues
+	{"issue252.txt", "UTF-8", false, false},
 }
 
 func TestDecodeBytesText(t *testing.T) {
diff --git a/pkg/encoding/testdata/issue252.txt b/pkg/encoding/testdata/issue252.txt
new file mode 100644
index 0000000..8d384c3
--- /dev/null
+++ b/pkg/encoding/testdata/issue252.txt
@@ -0,0 +1,2 @@
+inc
+sub
Repository: lingui/js-lingui (ts)

Issue:
Support comments inside JSX macros by ignoring empty jsx expressions
**Describe the bug**
When using a `<Trans>` element with a nested element like `{/* This is a comment */}`, it complains of @lingui/macro: Property value of ObjectProperty expected node to be of a type ["Expression","PatternLike"] but instead got "JSXEmptyExpression" Learn more: https://www.npmjs.com/package/@lingui/macro

**To Reproduce**
Steps to reproduce the behavior, possibly with minimal code sample, e.g:

```
import { Trans } from "@lingui/macro"

export default function App() {
   return (<Trans>
    {/* TODO: Come up with a better translation than this */}
    This should be translated!
  </Trans>)
}
```

**Expected behavior**
The comment should be ignored completely, leaving just the "This should be translated!" text.

**Additional context**
Add any other context about the problem here.

- jsLingui version ``2.9.1``
- Babel version ``babel-core@7.0.0-bridge.0``
- Your Babel config (e.g. `.babelrc`) or framework you use (Create React App, Meteor, etc.): Create React App


Pull request:
fix: Support comments inside JSX macros by ignoring empty jsx expressions
- this adds explicit handling of JSXEmptyExpression within
  packages/macro/src/icu.ts, where the token is skipped over entirely
- Fixes #684

Patch:
diff --git a/packages/macro/src/icu.ts b/packages/macro/src/icu.ts
index cd39161a..04f478d3 100644
--- a/packages/macro/src/icu.ts
+++ b/packages/macro/src/icu.ts
@@ -7,6 +7,7 @@ export default function ICUMessageFormat() {}
 ICUMessageFormat.prototype.fromTokens = function (tokens) {
   return (Array.isArray(tokens) ? tokens : [tokens])
     .map((token) => this.processToken(token))
+    .filter(Boolean)
     .reduce(
       (props, message) => ({
         ...message,
@@ -30,6 +31,9 @@ ICUMessageFormat.prototype.processToken = function (token) {
       message: token.value,
     }
   } else if (token.type === "arg") {
+    if (token.value !== undefined && token.value.type === 'JSXEmptyExpression') {
+      return null;
+    }
     const values =
       token.value !== undefined
         ? {


Test patch:
diff --git a/packages/macro/test/jsx-trans.ts b/packages/macro/test/jsx-trans.ts
index ed96062c..78a82576 100644
--- a/packages/macro/test/jsx-trans.ts
+++ b/packages/macro/test/jsx-trans.ts
@@ -311,4 +311,15 @@ export default [
         }>About</a>;
       `,
   },
+  {
+    name: "Ignore JSXEmptyExpression",
+    input: `
+        import { Trans } from '@lingui/macro';
+        <Trans>Hello {/* and I cannot stress this enough */} World</Trans>;
+      `,
+    expected: `
+        import { Trans } from "@lingui/react";
+        <Trans id="Hello  World" />;
+      `,
+  },
 ]