PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: cinar/indicatorts (ts)

Issue:
MoneyFlowIndex values well above 100
High | Low | Close | Vol | MFI
-- | -- | -- | -- | --
2390.9 | 2373.15 | 2373.39 | 1621 | 100
2386.3 | 2370 | 2382.47 | 1387 | 53.884998
2395.33 | 2380.77 | 2394.4 | 1444 | 68.888204
2399 | 2384.28 | 2387.51 | 1298 | 53.300054
2402.46 | 2387.46 | 2395.64 | 1629 | 63.645476
2401.15 | 2385.02 | 2389.47 | 1598 | 52.296425
2421.98 | 2383.18 | 2410.24 | 2311 | 62.119198
2430.31 | 2408.39 | 2425.37 | 2934 | 70.011701
2426.33 | 2410.59 | 2422.33 | 2128 | 60.826077
2434.93 | 2420.89 | 2430.29 | 1823 | 54.659774
2470.83 | 2428.92 | 2465.76 | 5078 | 64.728457
2483.36 | 2456.77 | 2466.27 | 6693 | 72.749002
2467.19 | 2437.65 | 2440.07 | 3960 | 64.185176
2450.72 | 2440.87 | 2445.85 | 1927 | 60.710993

Already fixed in [Indicator Go](https://github.com/cinar/indicator), can be implemented from [code change](https://github.com/cinar/indicator/pull/42).

Pull request:
MoneyFlowIndex values well above 100
Fixed #31


Patch:
diff --git a/src/indicator/volume/moneyFlowIndex.ts b/src/indicator/volume/moneyFlowIndex.ts
index f9400b9..1afed4f 100644
--- a/src/indicator/volume/moneyFlowIndex.ts
+++ b/src/indicator/volume/moneyFlowIndex.ts
@@ -46,7 +46,7 @@ export function moneyFlowIndex(
 
   const moneyRatio = divide(
     msum(period, positiveMoneyFlow),
-    msum(period, negativeMoneyFlow)
+    msum(period, multiplyBy(-1, negativeMoneyFlow))
   );
 
   const moneyFlowIndex = addBy(


Test patch:
diff --git a/src/indicator/volume/moneyFlowIndex.test.ts b/src/indicator/volume/moneyFlowIndex.test.ts
index e1b7d93..b2ab598 100644
--- a/src/indicator/volume/moneyFlowIndex.test.ts
+++ b/src/indicator/volume/moneyFlowIndex.test.ts
@@ -10,7 +10,7 @@ describe('Money Flow Index (MFI)', () => {
     const lows = [6, 7, 9, 12, 10];
     const closings = [9, 11, 7, 10, 8];
     const volumes = [100, 110, 80, 120, 90];
-    const expected = [100, 100, 406.85, 207.69, 266.67];
+    const expected = [100, 100, 57.01, 65.85, 61.54];
     const period = 2;
 
     const actual = moneyFlowIndex(period, highs, lows, closings, volumes);
Repository: bluekeyes/go-gitdiff (go)

Issue:
Support empty patches
Hi!

We are using this lib over at https://pr.pico.sh and so far haven't had any issues.  So thank you for your hard work!

We are trying to support cover letters in our patch request workflow, but it looks like since the patch itself is empty, `go-gitdiff` skips over it and returns empty header data.  Ideally this lib would still process the empty patch even if there aren't any diffs in it.

I'm curious what you think about adding support for empty patches?

Pull request:
Return preamble when a patch has no files
While empty patches with only a header were parsable, the parser discarded the preamble content. This meant callers had to handle this case specially. Now, if we reach the end of the input without finding a file, `Parse()` returns the full content of the patch as the preamble.

Fixes #45.

Patch:
diff --git a/gitdiff/file_header.go b/gitdiff/file_header.go
index 77ceb5d..7ae4bc9 100644
--- a/gitdiff/file_header.go
+++ b/gitdiff/file_header.go
@@ -57,7 +57,7 @@ func (p *parser) ParseNextFileHeader() (*File, string, error) {
 			return nil, "", err
 		}
 	}
-	return nil, "", nil
+	return nil, preamble.String(), nil
 }
 
 func (p *parser) ParseGitFileHeader() (*File, error) {
diff --git a/gitdiff/parser.go b/gitdiff/parser.go
index d2b29cb..e8f8430 100644
--- a/gitdiff/parser.go
+++ b/gitdiff/parser.go
@@ -33,6 +33,9 @@ func Parse(r io.Reader) ([]*File, string, error) {
 		if err != nil {
 			return files, preamble, err
 		}
+		if len(files) == 0 {
+			preamble = pre
+		}
 		if file == nil {
 			break
 		}
@@ -50,9 +53,6 @@ func Parse(r io.Reader) ([]*File, string, error) {
 			}
 		}
 
-		if len(files) == 0 {
-			preamble = pre
-		}
 		files = append(files, file)
 	}
 


Test patch:
diff --git a/gitdiff/parser_test.go b/gitdiff/parser_test.go
index 30f59f4..15a5d67 100644
--- a/gitdiff/parser_test.go
+++ b/gitdiff/parser_test.go
@@ -281,8 +281,13 @@ this is another line
 --- could this be a header?
 nope, it's just some dashes
 `,
-			Output:   nil,
-			Preamble: "",
+			Output: nil,
+			Preamble: `
+this is a line
+this is another line
+--- could this be a header?
+nope, it's just some dashes
+`,
 		},
 		"detatchedFragmentLike": {
 			Input: `
@@ -290,6 +295,10 @@ a wild fragment appears?
 @@ -1,3 +1,4 ~1,5 @@
 `,
 			Output: nil,
+			Preamble: `
+a wild fragment appears?
+@@ -1,3 +1,4 ~1,5 @@
+`,
 		},
 		"detatchedFragment": {
 			Input: `
@@ -426,6 +435,11 @@ Date:   Tue Apr 2 22:55:40 2019 -0700
 			},
 			Preamble: textPreamble,
 		},
+		"noFiles": {
+			InputFile: "testdata/no_files.patch",
+			Output:    nil,
+			Preamble:  textPreamble,
+		},
 		"newBinaryFile": {
 			InputFile: "testdata/new_binary_file.patch",
 			Output: []*File{
diff --git a/gitdiff/testdata/no_files.patch b/gitdiff/testdata/no_files.patch
new file mode 100644
index 0000000..9eea12d
--- /dev/null
+++ b/gitdiff/testdata/no_files.patch
@@ -0,0 +1,8 @@
+commit 5d9790fec7d95aa223f3d20936340bf55ff3dcbe
+Author: Morton Haypenny <mhaypenny@example.com>
+Date:   Tue Apr 2 22:55:40 2019 -0700
+
+    A file with multiple fragments.
+
+    The content is arbitrary.
+