PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: invenia/NamedDims.jl (julia)

Issue:
`deleteat!` not defined for NamedDimsVector
```julia
julia> deleteat!(NamedDimsArray{(:a, )}([1, 2, 3.]), 1)
ERROR: MethodError: no method matching deleteat!(::NamedDimsArray{(:a,), Float64, 1, Vector{Float64}}, ::Int64)
Closest candidates are:
  deleteat!(::Vector, ::Integer) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/base/array.jl:1421
  deleteat!(::Vector, ::Any) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/base/array.jl:1468
  deleteat!(::BitVector, ::Integer) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/base/bitarray.jl:949
  ...
Stacktrace:
 [1] top-level scope
   @ REPL[8]:1
```
related to https://github.com/mcabbott/AxisKeys.jl/issues/101

Pull request:
Closes #193

Patch:
diff --git a/Project.toml b/Project.toml
index c386166..c9fd942 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,7 +1,7 @@
 name = "NamedDims"
 uuid = "356022a1-0364-5f58-8944-0da4b18d706f"
 authors = ["Invenia Technical Computing Corporation"]
-version = "0.2.45"
+version = "0.2.46"
 
 [deps]
 AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
diff --git a/src/functions.jl b/src/functions.jl
index 8b618fd..33e5c1d 100644
--- a/src/functions.jl
+++ b/src/functions.jl
@@ -212,3 +212,11 @@ function collect_product(x)
     all_names = tuple_cat(dimnames.(x.iter.iterators)...)
     return NamedDimsArray(data, all_names)
 end
+
+##############################################
+# NamedDimsVector only
+
+function Base.deleteat!(v::NamedDimsVector, inds)
+    deleteat!(parent(v), inds)
+    return v
+end


Test patch:
diff --git a/test/functions.jl b/test/functions.jl
index 5ce8d68..3a3996d 100644
--- a/test/functions.jl
+++ b/test/functions.jl
@@ -296,6 +296,12 @@ using Statistics
         @test isapprox(nda, nda4; atol=2π)
     end
 
+    @testset "deleteat!" begin
+        ndv = NamedDimsArray{(:a,)}([1, 2, 3, 4, 5, 6.0])
+        @test ndv == deleteat!(ndv, 1) == NamedDimsArray{(:a,)}([2, 3, 4, 5, 6.0])
+        @test ndv == deleteat!(ndv, 1:2) == NamedDimsArray{(:a,)}([4, 5, 6.0])
+        @test ndv == deleteat!(ndv, (1, 3)) == NamedDimsArray{(:a,)}([5.0])
+    end
 end  # Base
 
 @testset "Statistics" begin
Repository: Rich-Harris/buble (js)

Issue:
Destructured catch parameters are not transpiled
[Spec](https://tc39.github.io/ecma262/#prod-CatchParameter). Example:
```js
try {} catch ({message}) {}
```

Pull request:
Add support for destrcturing catch clause params
Fixes #76. With this, all cases in Babel's [babel-plugin-transform-destructuring](https://github.com/babel/babel/blob/f5ef928586f592aa2d8bb60120ae58833d17e0db/packages/babel-plugin-transform-destructuring/src/index.js) are covered.

Changes the check from regex `/Function/` to an explicit list of types to transpile parameters of.

CatchClause uses `param = obj` instead of `params = [obj]`, so the `transpileParameters` function now supports both.

Patch:
diff --git a/src/program/BlockStatement.js b/src/program/BlockStatement.js
index 7c5e734..364f365 100644
--- a/src/program/BlockStatement.js
+++ b/src/program/BlockStatement.js
@@ -155,6 +155,15 @@ export default class BlockStatement extends Node {
 
 		if (/Function/.test(this.parent.type)) {
 			this.transpileParameters(
+				this.parent.params,
+				code,
+				transforms,
+				indentation,
+				introStatementGenerators
+			);
+		} else if ('CatchClause' === this.parent.type) {
+			this.transpileParameters(
+				[this.parent.param],
 				code,
 				transforms,
 				indentation,
@@ -212,9 +221,7 @@ export default class BlockStatement extends Node {
 		});
 	}
 
-	transpileParameters(code, transforms, indentation, introStatementGenerators) {
-		const params = this.parent.params;
-
+	transpileParameters(params, code, transforms, indentation, introStatementGenerators) {
 		params.forEach(param => {
 			if (
 				param.type === 'AssignmentPattern' &&


Test patch:
diff --git a/test/samples/destructuring.js b/test/samples/destructuring.js
index d55ac22..2ad05f6 100644
--- a/test/samples/destructuring.js
+++ b/test/samples/destructuring.js
@@ -844,5 +844,19 @@ module.exports = [
 				((assign = { x: 3 }, x$1 = assign.x));
 				(assign$1 = [ 3 ], x$1 = assign$1[0]);
 			}`
+	},
+
+	{
+		description: 'destructures try catch parameters',
+
+		input: `
+			try {} catch ({message}) {
+			}`,
+
+		output: `
+			try {} catch (ref) {
+				var message = ref.message;
+
+			}`
 	}
 ];
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 321
Good morning! Here's your coding interview problem for today.

This problem was asked by PagerDuty.

Given a positive integer `N`, find the smallest number of steps it will take to reach `1`.

There are two kinds of permitted steps:

* You may decrement `N` to `N - 1`.
* If `a * b = N`, you may decrement `N` to the larger of `a` and `b`.
For example, given `100`, you can reach `1` in five steps with the following route: `100 -> 10 -> 9 -> 3 -> 2 -> 1`.

Pull request:
Day321
Resolves #651.

Patch:
diff --git a/README.md b/README.md
index 939059e..3693706 100644
--- a/README.md
+++ b/README.md
@@ -323,3 +323,4 @@ problems from
 * [Day 314](https://github.com/vaskoz/dailycodingproblem-go/issues/640)
 * [Day 315](https://github.com/vaskoz/dailycodingproblem-go/issues/642)
 * [Day 317](https://github.com/vaskoz/dailycodingproblem-go/issues/645)
+* [Day 321](https://github.com/vaskoz/dailycodingproblem-go/issues/651)
diff --git a/day321/problem.go b/day321/problem.go
new file mode 100644
index 0000000..e4843e5
--- /dev/null
+++ b/day321/problem.go
@@ -0,0 +1,40 @@
+package day321
+
+import "math"
+
+// SmallestStepsToOne returns the smallest possible
+// number of steps to reach run using two rules.
+// First, n-1
+// Second, a*b=N goto the larger of a and b.
+// This is effectively BFS.
+func SmallestStepsToOne(n int) int {
+	if n < 1 {
+		panic("n must be greater than 0")
+	}
+	seen := make(map[int]struct{})
+	q := []int{n}
+	var steps int
+	for len(q) != 0 {
+		nextQ := make([]int, 0, 2*len(q))
+		for _, v := range q {
+			if v == 1 {
+				nextQ = nil
+				break
+			} else if _, found := seen[v]; !found {
+				seen[v] = struct{}{}
+				nextQ = append(nextQ, v-1)
+				a := v
+				for b := int(math.Sqrt(float64(v))); b > 0; b-- {
+					if v%b == 0 {
+						a = v / b
+						break
+					}
+				}
+				nextQ = append(nextQ, a)
+			}
+		}
+		q = nextQ
+		steps++
+	}
+	return steps - 1
+}


Test patch:
diff --git a/day321/problem_test.go b/day321/problem_test.go
new file mode 100644
index 0000000..3636e44
--- /dev/null
+++ b/day321/problem_test.go
@@ -0,0 +1,43 @@
+package day321
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	n, expected int
+}{
+	{100, 5},
+	{1, 0}, // 1
+	{2, 1}, // 2 -> 1
+	{3, 2}, // 3 -> 2 -> 1
+	{4, 2}, // 4 -> 2 -> 1
+	{5, 3}, // 5 -> 4 -> 2 -> 1
+	{6, 3}, // 6 -> 3 -> 2 -> 1
+}
+
+func TestSmallestStepsToOne(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := SmallestStepsToOne(tc.n); result != tc.expected {
+			t.Errorf("Expected %v, got %v", tc.expected, result)
+		}
+	}
+}
+
+func TestSmallestStepsToOneBadInput(t *testing.T) {
+	t.Parallel()
+	defer func() {
+		if err := recover(); err == nil {
+			t.Errorf("Expected an error, but got nil")
+		}
+	}()
+	SmallestStepsToOne(0)
+}
+
+func BenchmarkSmallestStepsToOne(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			SmallestStepsToOne(tc.n)
+		}
+	}
+}
Repository: tomarrell/lbadd (go)

Issue:
parser: scanner doesn't recognize underscore
**Describe the bug**
Scanner doesnt recognise `_` when in a token.

**To Reproduce**
Steps to reproduce the behavior:
Any token like `alpha_beta` will raise an error in the scanner/not be recognised.

**Additional context**
#146 has more details.

Pull request:
Add underscore and dash to literal
Added underscore (`_`) and dash (`-`) to literal.
Literals can now contain these characters.

Closes #147

## Definition of done
- [ ] Code correctness
- [ ] Documentation
- [ ] Test cases


Patch:
diff --git a/internal/parser/scanner/ruleset/ruleset_default.go b/internal/parser/scanner/ruleset/ruleset_default.go
index b1bbcf6..71e64bb 100644
--- a/internal/parser/scanner/ruleset/ruleset_default.go
+++ b/internal/parser/scanner/ruleset/ruleset_default.go
@@ -33,6 +33,7 @@ var (
 		matcher.New("upper", unicode.Upper),
 		matcher.New("lower", unicode.Lower),
 		matcher.New("title", unicode.Title),
+		matcher.String("-_"),
 		defaultNumber,
 	)
 	defaultNumericLiteral = matcher.Merge(


Test patch:
diff --git a/internal/parser/scanner/rule_based_scanner_test.go b/internal/parser/scanner/rule_based_scanner_test.go
index 168dfcc..aa5b0dc 100644
--- a/internal/parser/scanner/rule_based_scanner_test.go
+++ b/internal/parser/scanner/rule_based_scanner_test.go
@@ -249,6 +249,42 @@ func TestRuleBasedScanner(t *testing.T) {
 				token.New(1, 13, 12, 0, token.EOF, ""),
 			},
 		},
+		{
+			"underscore in single unquoted token",
+			"alpha_beta",
+			ruleset.Default,
+			[]token.Token{
+				token.New(1, 1, 0, 10, token.Literal, "alpha_beta"),
+				token.New(1, 11, 10, 0, token.EOF, ""),
+			},
+		},
+		{
+			"underscore in single quoted token",
+			"\"alpha_beta\"",
+			ruleset.Default,
+			[]token.Token{
+				token.New(1, 1, 0, 12, token.Literal, "\"alpha_beta\""),
+				token.New(1, 13, 12, 0, token.EOF, ""),
+			},
+		},
+		{
+			"dash in single unquoted token",
+			"alpha-beta",
+			ruleset.Default,
+			[]token.Token{
+				token.New(1, 1, 0, 10, token.Literal, "alpha-beta"),
+				token.New(1, 11, 10, 0, token.EOF, ""),
+			},
+		},
+		{
+			"dash in single quoted token",
+			"\"alpha-beta\"",
+			ruleset.Default,
+			[]token.Token{
+				token.New(1, 1, 0, 12, token.Literal, "\"alpha-beta\""),
+				token.New(1, 13, 12, 0, token.EOF, ""),
+			},
+		},
 	}
 	for _, input := range inputs {
 		t.Run("ruleset=default/"+input.name, _TestRuleBasedScannerWithRuleset(input.query, input.ruleset, input.want))