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

Issue:
"extends" should also trigger for files without extension that end in "rc"
It's a common convention for a configuration file to end with the suffix `rc`., e.g., `.nycrc`; it seems like a good extension to the `extends` functionality would be to also support filenames of the form `.*rc`.

Currently `extends` only supports the `.json` extension. fixes https://github.com/istanbuljs/nyc/issues/732

CC: @genepaul

Pull request:
extend *.rc files in addition to json
fixes #1035 

This simply updates the regex to include *.*rc files. It does not handle the situation with rc files that are formatted in INI format. That seems to be a separate discussion.

Patch:
diff --git a/lib/apply-extends.js b/lib/apply-extends.js
index 530b022..1436b65 100644
--- a/lib/apply-extends.js
+++ b/lib/apply-extends.js
@@ -21,7 +21,7 @@ function applyExtends (config, cwd) {
 
   if (config.hasOwnProperty('extends')) {
     if (typeof config.extends !== 'string') return defaultConfig
-    const isPath = /\.json$/.test(config.extends)
+    const isPath = /\.json|\..*rc$/.test(config.extends)
     let pathToDefault = null
     if (!isPath) {
       try {


Test patch:
diff --git a/test/fixtures/extends/.myotherrc b/test/fixtures/extends/.myotherrc
new file mode 100644
index 0000000..8c686ca
--- /dev/null
+++ b/test/fixtures/extends/.myotherrc
@@ -0,0 +1,4 @@
+{
+    "extends": "./config_1.json",
+    "c": 201
+}
\ No newline at end of file
diff --git a/test/fixtures/extends/.myrc b/test/fixtures/extends/.myrc
new file mode 100644
index 0000000..0d45cf9
--- /dev/null
+++ b/test/fixtures/extends/.myrc
@@ -0,0 +1,4 @@
+{
+    "extends": "./.myotherrc",
+    "a": 5
+}
\ No newline at end of file
diff --git a/test/yargs.js b/test/yargs.js
index 94f4018..6511250 100644
--- a/test/yargs.js
+++ b/test/yargs.js
@@ -1284,6 +1284,20 @@ describe('yargs dsl tests', () => {
         argv.a.should.equal(2)
         argv.extends.should.equal('batman')
       })
+
+      it('allows files with .*rc extension to be extended', () => {
+        const argv = yargs()
+          .config({
+            extends: './test/fixtures/extends/.myrc',
+            a: 3
+          })
+          .argv
+
+        argv.a.should.equal(3)
+        argv.b.should.equal(22)
+        argv.c.should.equal(201)
+        argv.z.should.equal(15)
+      })
     })
   })
Repository: JuliaML/TableTransforms.jl (julia)

Issue:
Add `DropConstant` transform to drop constant columns
Constant columns can be dropped in many statistical procedures (e.g. PCA).

Pull request:
closes #251

Patch:
diff --git a/docs/src/transforms.md b/docs/src/transforms.md
index 912a055f..0c1499b8 100644
--- a/docs/src/transforms.md
+++ b/docs/src/transforms.md
@@ -92,6 +92,12 @@ DropExtrema
 DropUnits
 ```
 
+## DropConstant
+
+```@docs
+DropConstant
+```
+
 ## AbsoluteUnits
 
 ```@docs
diff --git a/src/TableTransforms.jl b/src/TableTransforms.jl
index a2dabbc7..7b557ffa 100644
--- a/src/TableTransforms.jl
+++ b/src/TableTransforms.jl
@@ -54,6 +54,7 @@ export
   Satisfies,
   Only,
   Except,
+  DropConstant,
   Rename,
   StdNames,
   StdFeats,
diff --git a/src/transforms/satisfies.jl b/src/transforms/satisfies.jl
index ba7b8791..27aeefac 100644
--- a/src/transforms/satisfies.jl
+++ b/src/transforms/satisfies.jl
@@ -66,3 +66,10 @@ Except(DST.Categorical)
 ```
 """
 Except(S::Type{<:SciType}) = Satisfies(x -> !(elscitype(x) <: S))
+
+"""
+    DropConstant()
+
+Drops the constant columns using the `allequal` function.
+"""
+DropConstant() = Satisfies(!allequal)


Test patch:
diff --git a/test/transforms/satisfies.jl b/test/transforms/satisfies.jl
index ef077634..4af20004 100644
--- a/test/transforms/satisfies.jl
+++ b/test/transforms/satisfies.jl
@@ -71,3 +71,19 @@ end
   tₒ = revert(T, n, c)
   @test t == tₒ
 end
+
+@testset "DropConstant" begin
+  a = [4, 6, 7, 8, 1, 2]
+  b = fill(5, 6)
+  c = [1.9, 7.4, 8.6, 8.9, 2.4, 7.7]
+  d = fill(5.5, 6)
+  t = Table(; a, b, c, d)
+
+  T = DropConstant()
+  n, c = apply(T, t)
+  @test Tables.schema(n).names == (:a, :c)
+  @test Tables.getcolumn(n, :a) == t.a
+  @test Tables.getcolumn(n, :c) == t.c
+  tₒ = revert(T, n, c)
+  @test t == tₒ
+end
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 251
Good morning! Here's your coding interview problem for today.

This problem was asked by Amazon.

Given an array of a million integers between zero and a billion, out of order, how can you efficiently sort it? Assume that you cannot store an array of a billion elements in memory.

Pull request:
Day251
Resolves #517 .

Patch:
diff --git a/README.md b/README.md
index 12d5343..dd4989b 100644
--- a/README.md
+++ b/README.md
@@ -261,3 +261,4 @@ problems from
 * [Day 247](https://github.com/vaskoz/dailycodingproblem-go/issues/510)
 * [Day 248](https://github.com/vaskoz/dailycodingproblem-go/issues/512)
 * [Day 249](https://github.com/vaskoz/dailycodingproblem-go/issues/514)
+* [Day 251](https://github.com/vaskoz/dailycodingproblem-go/issues/517)
diff --git a/day251/problem.go b/day251/problem.go
new file mode 100644
index 0000000..1595d39
--- /dev/null
+++ b/day251/problem.go
@@ -0,0 +1,32 @@
+package day251
+
+// RadixSortInt32 sorts int32's using radix sort.
+// Runs in linear time. O(w*n)
+func RadixSortInt32(nums []int32) {
+	var max int32
+	for _, v := range nums {
+		if v > max {
+			max = v
+		}
+	}
+	exp := int32(1)
+	for max/exp > 0 {
+		CountingSort(nums, exp)
+		exp *= 10
+	}
+}
+
+// CountingSort is a counting sort for int32's.
+func CountingSort(nums []int32, exp int32) {
+	counts := make([][]int32, 10)
+	for _, v := range nums {
+		pos := (v / exp) % 10
+		counts[pos] = append(counts[pos], v)
+	}
+	start := 0
+	for _, c := range counts {
+		end := start + len(c)
+		copy(nums[start:end], c)
+		start = end
+	}
+}


Test patch:
diff --git a/day251/problem_test.go b/day251/problem_test.go
new file mode 100644
index 0000000..e8c6f20
--- /dev/null
+++ b/day251/problem_test.go
@@ -0,0 +1,48 @@
+package day251
+
+import (
+	"reflect"
+	"sort"
+	"testing"
+)
+
+// nolint
+var testcases = []struct {
+	input, sorted []int32
+}{
+	{[]int32{170, 45, 75, 90, 802, 24, 2, 66}, []int32{2, 24, 45, 66, 75, 90, 170, 802}},
+}
+
+func TestRadixSortInt32(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		copied := make([]int32, len(tc.input))
+		copy(copied, tc.input)
+		RadixSortInt32(copied)
+		if !reflect.DeepEqual(copied, tc.sorted) {
+			t.Errorf("Expected %v, got %v", tc.sorted, copied)
+		}
+	}
+}
+
+func BenchmarkRadixSortInt32(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			copied := make([]int32, len(tc.input))
+			copy(copied, tc.input)
+			RadixSortInt32(copied)
+		}
+	}
+}
+
+func BenchmarkStdLibSort(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			copied := make([]int32, len(tc.input))
+			copy(copied, tc.input)
+			sort.Slice(copied, func(i, j int) bool {
+				return copied[i] < copied[j]
+			})
+		}
+	}
+}
Repository: immutable-js/immutable-js (ts)

Issue:
Singleton `emptyList` is problematic
I just ran down a nasty bug related to this code below:

https://github.com/immutable-js/immutable-js/blob/493afba6ec17d9c999dc5a15ac80c71c6bdba1c3/src/List.js#L413

I did not realize that every time I was creating a new list with `List()`, I was getting the same _instance_ of `List`. This seems counterintuitive in a library based on the idea of immutability. 

Some code in the project was mutating an instance of an empty list which caused all subsequent newly minted lists to be non-empty. Obviously the code in my project was incorrect, but I came here to suggest _not_ using a singleton pattern here regardless.  

Pull request:
Try to fix issue with empty list that is a singleton

Fixes #2003

The EMPTY_LIST singleton is a really old code. It may have been there to avoid calling "makeList", but I don't think that there is a really huge performance impact.

Patch:
diff --git a/src/List.js b/src/List.js
index e512bb90d..be698316d 100644
--- a/src/List.js
+++ b/src/List.js
@@ -408,9 +408,8 @@ function makeList(origin, capacity, level, root, tail, ownerID, hash) {
   return list;
 }
 
-let EMPTY_LIST;
 export function emptyList() {
-  return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
+  return makeList(0, 0, SHIFT);
 }
 
 function updateList(list, index, value) {


Test patch:
diff --git a/__tests__/List.ts b/__tests__/List.ts
index 2cb28ee6a..1fa808b80 100644
--- a/__tests__/List.ts
+++ b/__tests__/List.ts
@@ -829,7 +829,7 @@ describe('List', () => {
   it('chained mutations does not result in new empty list instance', () => {
     const v1 = List(['x']);
     const v2 = v1.withMutations(v => v.push('y').pop().pop());
-    expect(v2).toBe(List());
+    expect(v2).toEqual(List());
   });
 
   it('calling `clear` and `setSize` should set all items to undefined', () => {
@@ -927,6 +927,37 @@ describe('List', () => {
     expect(isNaNValue(list.get(0))).toBe(true);
   });
 
+  it('return a new emptyList if the emptyList has been mutated #2003', () => {
+    const emptyList = List();
+
+    const nonEmptyList = emptyList.withMutations(l => {
+      l.setSize(1);
+      l.set(0, 'a');
+    });
+
+    expect(nonEmptyList.size).toBe(1);
+    expect(nonEmptyList).toEqual(List.of('a'));
+    expect(emptyList.size).toBe(0);
+
+    const mutableList = emptyList.asMutable();
+
+    mutableList.setSize(1);
+    mutableList.set(0, 'b');
+
+    expect(mutableList.size).toBe(1);
+    expect(mutableList).toEqual(List.of('b'));
+
+    expect(emptyList.size).toBe(0);
+    expect(List().size).toBe(0);
+  });
+
+  it('Mutating empty list with a JS API should not mutate new instances', () => {
+    Object.assign(List(), List([1, 2]));
+
+    expect(List().size).toBe(0);
+    expect(List().toArray()).toEqual([]);
+  });
+
   // Note: NaN is the only value not equal to itself. The isNaN() built-in
   // function returns true for any non-numeric value, not just the NaN value.
   function isNaNValue(value) {
Repository: pinojs/pino (js)

Issue:
msg property is not logged when first arg is undefined
In node.js (tested in 14 and 16), logs do not contain the `msg` property when the first parameter is `undefined`.

The following code
```
const logger = require("pino")();

logger.info("hello world");
logger.info({ a: 1 }, "hello world");
logger.info(null, "hello world");
logger.info(undefined, "hello world");

const child = logger.child({ a: "im a child" });
child.info({ a: 1 }, "hello daddy");
child.info(null, "hello daddy");
child.info(undefined, "hello daddy");
```

logs the following content (hostname has been changed 😉 ):

```
{"level":30,"time":1663063554791,"pid":43360,"hostname":"...","msg":"hello world"}
{"level":30,"time":1663063554791,"pid":43360,"hostname":"...","a":1,"msg":"hello world"}
{"level":30,"time":1663063554791,"pid":43360,"hostname":"...","msg":"hello world"}
{"level":30,"time":1663063554791,"pid":43360,"hostname":"..."}
{"level":30,"time":1663063554791,"pid":43360,"hostname":"...","a":"im a child","a":1,"msg":"hello daddy"}
{"level":30,"time":1663063554791,"pid":43360,"hostname":"...","a":"im a child","msg":"hello daddy"}
{"level":30,"time":1663063554791,"pid":43360,"hostname":"...","a":"im a child"}
```

We can see the 4th log of both main logger and child logger does not have a `msg` property whereas it is ok when the first parameter is `null`.

However, it seems to be ok in the browser.
Tested here : https://codesandbox.io/s/js-playground-forked-qsnm99?file=/src/index.js

Pull request:
fix(tools): log[level] compatible with when first argument is undefined (fix #1555)
fix #1555

**unit test added**

Patch:
diff --git a/lib/tools.js b/lib/tools.js
index 674198b..b44a961 100644
--- a/lib/tools.js
+++ b/lib/tools.js
@@ -53,7 +53,7 @@ function genLog (level, hook) {
       }
       this[writeSym](o, format(msg, formatParams, this[formatOptsSym]), level)
     } else {
-      this[writeSym](null, format(o, n, this[formatOptsSym]), level)
+      this[writeSym](null, format(o === undefined ? n.shift() : o, n, this[formatOptsSym]), level)
     }
   }
 }


Test patch:
diff --git a/test/basic.test.js b/test/basic.test.js
index ca4ca1e..e8310d6 100644
--- a/test/basic.test.js
+++ b/test/basic.test.js
@@ -109,6 +109,22 @@ function levelTest (name, level) {
     same(Object.keys(obj), ['hello'])
   })
 
+  test(`passing a undefined and a string at level ${name}`, async ({ equal, same }) => {
+    const stream = sink()
+    const instance = pino(stream)
+    instance.level = name
+    instance[name](undefined, 'a string')
+    const result = await once(stream, 'data')
+    equal(new Date(result.time) <= new Date(), true, 'time is greater than Date.now()')
+    delete result.time
+    same(result, {
+      pid,
+      hostname,
+      level,
+      msg: 'a string'
+    })
+  })
+
   test(`overriding object key by string at level ${name}`, async ({ equal, same }) => {
     const stream = sink()
     const instance = pino(stream)