PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: seachicken/gh-poi (go)

Issue:
fails when directory has unreadable files
```
$ gh poi --dry-run
== DRY RUN ==
✕ Fetching pull requests...
failed to run external command: git, args: [status --short]
warning: could not open directory '_many_modules/': Permission denied
```

Where `_many_modules` is a directory I had removed permissions to, i.e. `chmod a-rwx _many_modules`

`git status` returns with exit code `0` in this case, but it does print that `warning` to stderr.

**Your Environment**
- **OS:** Ubuntu 21.10
- **gh:** 2.10.1
- **gh-poi:** v0.5.2


Pull request:
Does not fail even when `git status` returns an error
Fixes #57 

Patch:
diff --git a/poi.go b/poi.go
index 51cf972..27ff883 100644
--- a/poi.go
+++ b/poi.go
@@ -133,12 +133,7 @@ func GetBranches(conn Connection, dryRun bool) ([]Branch, error) {
 	}
 
 	branches = applyPullRequest(branches, prs, conn)
-
-	uncommittedChanges, err := conn.GetUncommittedChanges()
-	if err != nil {
-		return nil, err
-	}
-
+	uncommittedChanges, _ := conn.GetUncommittedChanges()
 	branches = checkDeletion(branches, uncommittedChanges)
 
 	needsCheckout := false


Test patch:
diff --git a/poi_test.go b/poi_test.go
index 370c718..8f69071 100644
--- a/poi_test.go
+++ b/poi_test.go
@@ -964,7 +964,8 @@ func Test_ReturnsAnErrorWhenGetPullRequestsFails(t *testing.T) {
 	assert.NotNil(t, err)
 }
 
-func Test_ReturnsAnErrorWhenGetUncommittedChangesFails(t *testing.T) {
+// https://github.com/seachicken/gh-poi/issues/57
+func Test_DoesNotReturnsAnErrorWhenGetUncommittedChangesFails(t *testing.T) {
 	ctrl := gomock.NewController(t)
 	defer ctrl.Finish()
 
@@ -991,7 +992,7 @@ func Test_ReturnsAnErrorWhenGetUncommittedChangesFails(t *testing.T) {
 
 	_, err := GetBranches(s.Conn, false)
 
-	assert.NotNil(t, err)
+	assert.Nil(t, err)
 }
 
 func Test_ReturnsAnErrorWhenCheckoutBranchFails(t *testing.T) {
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 232
Good morning! Here's your coding interview problem for today.

This problem was asked by Google.

Implement a PrefixMapSum class with the following methods:

`insert(key: str, value: int)`: Set a given key's value in the map. If the key already exists, overwrite the value.
`sum(prefix: str)`: Return the sum of all values of keys that begin with a given prefix.
For example, you should be able to run the following code:
```
mapsum.insert("columnar", 3)
assert mapsum.sum("col") == 3

mapsum.insert("column", 2)
assert mapsum.sum("col") == 5
```

Pull request:
Day232
Resolves #477.

Patch:
diff --git a/README.md b/README.md
index ac0ab80..05a4d52 100644
--- a/README.md
+++ b/README.md
@@ -240,3 +240,4 @@ problems from
 * [Day 228](https://github.com/vaskoz/dailycodingproblem-go/issues/470)
 * [Day 230](https://github.com/vaskoz/dailycodingproblem-go/issues/473)
 * [Day 231](https://github.com/vaskoz/dailycodingproblem-go/issues/475)
+* [Day 232](https://github.com/vaskoz/dailycodingproblem-go/issues/477)
diff --git a/day232/problem.go b/day232/problem.go
new file mode 100644
index 0000000..4f26d42
--- /dev/null
+++ b/day232/problem.go
@@ -0,0 +1,46 @@
+package day232
+
+// PrefixMapSum represents a prefix tree collection of sums.
+type PrefixMapSum interface {
+	Insert(key string, value int)
+	Sum(prefix string) int
+}
+
+type prefixMapSumTrie struct {
+	sum  int
+	next map[rune]*prefixMapSumTrie
+}
+
+// NewPrefixMapSum returns a new instance.
+func NewPrefixMapSum() PrefixMapSum {
+	return &prefixMapSumTrie{}
+}
+
+func (pms *prefixMapSumTrie) Insert(key string, value int) {
+	curr := pms
+	for _, r := range key {
+		if curr.next == nil {
+			curr.next = make(map[rune]*prefixMapSumTrie)
+		}
+		if _, found := curr.next[r]; !found {
+			curr.next[r] = &prefixMapSumTrie{}
+		}
+		curr.next[r].sum += value
+		curr = curr.next[r]
+	}
+}
+
+func (pms *prefixMapSumTrie) Sum(prefix string) int {
+	curr := pms
+	for _, r := range prefix {
+		if curr.next == nil || curr.next[r] == nil {
+			curr = nil
+			break
+		}
+		curr = curr.next[r]
+	}
+	if curr != nil {
+		return curr.sum
+	}
+	return 0
+}


Test patch:
diff --git a/day232/problem_test.go b/day232/problem_test.go
new file mode 100644
index 0000000..17f4ff6
--- /dev/null
+++ b/day232/problem_test.go
@@ -0,0 +1,33 @@
+package day232
+
+import "testing"
+
+func TestPrefixMapSum(t *testing.T) {
+	t.Parallel()
+	pms := NewPrefixMapSum()
+	pms.Insert("columnar", 3)
+	if sum := pms.Sum("col"); sum != 3 {
+		t.Errorf("Sum should be 3 here got %d", sum)
+	}
+	pms.Insert("column", 2)
+	if sum := pms.Sum("col"); sum != 5 {
+		t.Errorf("Sum should be 5 here got %d", sum)
+	}
+	if sum := pms.Sum("columns"); sum != 0 {
+		t.Errorf("Sum should be 0 here got %d", sum)
+	}
+	if sum := pms.Sum("hi there"); sum != 0 {
+		t.Errorf("Sum should be 0 here got %d", sum)
+	}
+}
+
+func BenchmarkPrefixMapSum(b *testing.B) {
+	pms := NewPrefixMapSum()
+	for i := 0; i < b.N; i++ {
+		pms.Insert("columnar", 3)
+		pms.Insert("column", 2)
+		pms.Sum("col")
+		pms.Sum("columns")
+		pms.Sum("hi there")
+	}
+}
Repository: goccy/go-yaml (go)

Issue:
go-yaml v1.13.7 and go-yaml v1.13.8 parse error
**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**

Please provide a minimum yaml content that can be reproduced.
We are more than happy to use [Go Playground](https://go.dev/play/p/cG_sFccgqTk )

```
package main

import (
	"fmt"

	"github.com/goccy/go-yaml"
)

func main() {
	yamlC := `helmfiles:
  - path: subhelmfile.yaml.gotmpl
    selectorsInherited: true
    values:
    - specificValues:
        
        myContainers:
        - command:
          - /bin/sh
          - -c
          - env
          image: registry.k8s.io/busybox
          name: test-container
        
`
	target := make(map[string]any)

	err := yaml.Unmarshal([]byte(yamlC), &target)
	if err != nil {
		fmt.Printf("%v", err)
	} else {
		fmt.Print("ok")
	}
}

```

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Version Variables**
 - Go version: 1.23
 - go-yaml's Version: 1.13.8

**Additional context**
Add any other context about the problem here.


Pull request:
Fix removeFromRightSpace process at scanner
fix #528 

Patch:
diff --git a/scanner/context.go b/scanner/context.go
index f6c06e1..7c5517d 100644
--- a/scanner/context.go
+++ b/scanner/context.go
@@ -198,7 +198,7 @@ func (c *Context) addOriginBuf(r rune) {
 	}
 }
 
-func (c *Context) removeRightSpaceFromBuf() int {
+func (c *Context) removeRightSpaceFromBuf() {
 	trimmedBuf := c.obuf[:c.notSpaceOrgCharPos]
 	buflen := len(trimmedBuf)
 	diff := len(c.obuf) - buflen
@@ -206,7 +206,6 @@ func (c *Context) removeRightSpaceFromBuf() int {
 		c.obuf = c.obuf[:buflen]
 		c.buf = c.bufferedSrc()
 	}
-	return diff
 }
 
 func (c *Context) isDocument() bool {
diff --git a/scanner/scanner.go b/scanner/scanner.go
index 50e24b1..f1d2774 100644
--- a/scanner/scanner.go
+++ b/scanner/scanner.go
@@ -623,14 +623,7 @@ func (s *Scanner) scanNewLine(ctx *Context, c rune) {
 	// ---
 	// a:[space][space]
 	//   b: c
-	removedNum := ctx.removeRightSpaceFromBuf()
-	if removedNum > 0 {
-		s.column -= removedNum
-		s.offset -= removedNum
-		if s.savedPos != nil {
-			s.savedPos.Column -= removedNum
-		}
-	}
+	ctx.removeRightSpaceFromBuf()
 
 	// There is no problem that we ignore CR which followed by LF and normalize it to LF, because of following YAML1.2 spec.
 	// > Line breaks inside scalar content must be normalized by the YAML processor. Each such line break must be parsed into a single line feed character.


Test patch:
diff --git a/parser/parser_test.go b/parser/parser_test.go
index f9218b7..6bb8568 100644
--- a/parser/parser_test.go
+++ b/parser/parser_test.go
@@ -128,6 +128,11 @@ a: !tag
 a: !tag
   b: c
   d: e
+`,
+		`
+a:
+  b: c
+     
 `,
 	}
 	for _, src := range sources {
Repository: palantir/python-language-server (python)

Issue:
It would be better to keep output from the flake8 linter to be consistent with that of pycodestyle.
Currently, the return message the flake8 linter [here](https://github.com/palantir/python-language-server/blob/develop/pyls/plugins/flake8_lint.py) does not contain the error code, while that of pycodestyle also include the error code.

It would be better to include the error code as well, something like the following:

> E303 too many blank lines (2)

It is a fairly simple fix.  Should I open a pull request for this?


Pull request:
Add code in front of the diagnostic message for flake8
For the issue discussed in https://github.com/palantir/python-language-server/issues/884, it would be better to also add the code in front the actual diagnostic message, to make the message style the same as pycodestyle.

Fixes #884.

Patch:
diff --git a/pyls/plugins/flake8_lint.py b/pyls/plugins/flake8_lint.py
index 1a65851..4f2e054 100644
--- a/pyls/plugins/flake8_lint.py
+++ b/pyls/plugins/flake8_lint.py
@@ -144,6 +144,8 @@ def parse_stdout(document, stdout):
         _, line, character, code, msg = parsed_line
         line = int(line) - 1
         character = int(character) - 1
+        # show also the code in message
+        msg = code + ' ' + msg
         diagnostics.append(
             {
                 'source': 'flake8',


Test patch:
diff --git a/test/plugins/test_flake8_lint.py b/test/plugins/test_flake8_lint.py
index acc770b..75adf4e 100644
--- a/test/plugins/test_flake8_lint.py
+++ b/test/plugins/test_flake8_lint.py
@@ -31,7 +31,7 @@ def temp_document(doc_text, workspace):
 def test_flake8_unsaved(workspace):
     doc = Document('', workspace, DOC)
     diags = flake8_lint.pyls_lint(workspace, doc)
-    msg = 'local variable \'a\' is assigned to but never used'
+    msg = 'F841 local variable \'a\' is assigned to but never used'
     unused_var = [d for d in diags if d['message'] == msg][0]
 
     assert unused_var['source'] == 'flake8'
@@ -45,7 +45,7 @@ def test_flake8_lint(workspace):
     try:
         name, doc = temp_document(DOC, workspace)
         diags = flake8_lint.pyls_lint(workspace, doc)
-        msg = 'local variable \'a\' is assigned to but never used'
+        msg = 'F841 local variable \'a\' is assigned to but never used'
         unused_var = [d for d in diags if d['message'] == msg][0]
 
         assert unused_var['source'] == 'flake8'
Repository: JuliaML/TableTransforms.jl (julia)

Issue:
Add support for `missing`  values in `StdFeats` transform
The transform currently fails with `missing` values.

Pull request:
Fix https://github.com/JuliaEarth/GeoStats.jl/issues/555

Patch:
diff --git a/src/transforms/stdfeats.jl b/src/transforms/stdfeats.jl
index 319adca6..31397494 100644
--- a/src/transforms/stdfeats.jl
+++ b/src/transforms/stdfeats.jl
@@ -18,8 +18,8 @@ isrevertible(::Type{StdFeats}) = true
 _stdfun(x) = _stdfun(elscitype(x), x)
 _stdfun(::Type, x) = identity, identity
 function _stdfun(::Type{Continuous}, x)
-  μ = mean(x)
-  σ = std(x, mean=μ)
+  μ = mean(skipmissing(x))
+  σ = std(skipmissing(x), mean=μ)
   stdfun = x -> zscore(x, μ, σ)
   revfun = y -> revzscore(y, μ, σ)
   stdfun, revfun


Test patch:
diff --git a/test/transforms/stdfeats.jl b/test/transforms/stdfeats.jl
index e60df22b..feb23d7f 100644
--- a/test/transforms/stdfeats.jl
+++ b/test/transforms/stdfeats.jl
@@ -23,4 +23,14 @@
   @test tₒ.c == t.c
   @test tₒ.d ≈ t.d
   @test tₒ.e == t.e
+
+  # missing values
+  a = [rand(1:10, 99); missing]
+  b = [rand(Normal(7, 10), 99); missing]
+  t = Table(; a, b)
+  T = StdFeats()
+  n, c = apply(T, t)
+  @test isequal(n.a, t.a)
+  @test isapprox(mean(skipmissing(n.b)), 0; atol=1e-6)
+  @test isapprox(std(skipmissing(n.b)), 1; atol=1e-6)
 end