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

Issue:
Parse error for upper case #ELSE IF and #END IF
![image](https://user-images.githubusercontent.com/2544493/80802532-937f7c80-8b7d-11ea-9746-974e6da8d76d.png)

![image](https://user-images.githubusercontent.com/2544493/80802540-967a6d00-8b7d-11ea-989e-bd2b441f4d4c.png)


Pull request:
Fix lex issue with `#ELSE IF` and `#END IF`
Fixes #403 

Patch:
diff --git a/src/lexer/Lexer.ts b/src/lexer/Lexer.ts
index c302a35..88b0de2 100644
--- a/src/lexer/Lexer.ts
+++ b/src/lexer/Lexer.ts
@@ -692,7 +692,7 @@ export class Lexer {
                     advance();
                 } // read the next word
 
-                let twoWords = source.slice(start, current);
+                let twoWords = source.slice(start, current).toLowerCase();
                 switch (twoWords.replace(/ {2,}/g, " ")) {
                     case "#else if":
                         addToken(Lexeme.HashElseIf);


Test patch:
diff --git a/test/lexer/Lexer.test.js b/test/lexer/Lexer.test.js
index b4d290c..cb9fcd2 100644
--- a/test/lexer/Lexer.test.js
+++ b/test/lexer/Lexer.test.js
@@ -341,8 +341,16 @@ describe("lexer", () => {
         });
 
         it("reads conditional directives", () => {
-            let { tokens } = Lexer.scan("#if #else if #elseif #else #end if #endif");
+            let { tokens } = Lexer.scan(
+                "#if #else if #elseif #else #end if #endif #IF #ELSE IF #ELSEIF #ELSE #END IF #ENDIF"
+            );
             expect(tokens.map(t => t.kind)).toEqual([
+                Lexeme.HashIf,
+                Lexeme.HashElseIf,
+                Lexeme.HashElseIf,
+                Lexeme.HashElse,
+                Lexeme.HashEndIf,
+                Lexeme.HashEndIf,
                 Lexeme.HashIf,
                 Lexeme.HashElseIf,
                 Lexeme.HashElseIf,
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 196
Good morning! Here's your coding interview problem for today.

This problem was asked by Apple.

Given the root of a binary tree, find the most frequent subtree sum. The subtree sum of a node is the sum of all values under a node, including the node itself.

For example, given the following tree:
```
  5
 / \
2  -5
```
Return `2` as it occurs twice: once as the left leaf, and once as the sum of `2 + 5 - 5`.

Pull request:
Day196
Resolves #404.

Patch:
diff --git a/README.md b/README.md
index bc1a636..5ceabd7 100644
--- a/README.md
+++ b/README.md
@@ -205,4 +205,5 @@ problems from
 * [Day 192](https://github.com/vaskoz/dailycodingproblem-go/issues/397)
 * [Day 194](https://github.com/vaskoz/dailycodingproblem-go/issues/400)
 * [Day 195](https://github.com/vaskoz/dailycodingproblem-go/issues/401)
+* [Day 196](https://github.com/vaskoz/dailycodingproblem-go/issues/404)
 * [Day 197](https://github.com/vaskoz/dailycodingproblem-go/issues/405)
diff --git a/day196/problem.go b/day196/problem.go
new file mode 100644
index 0000000..a133884
--- /dev/null
+++ b/day196/problem.go
@@ -0,0 +1,33 @@
+package day196
+
+// BinaryTree is a binary tree of integers.
+type BinaryTree struct {
+	Value       int
+	Left, Right *BinaryTree
+}
+
+// MostFrequentSubtreeSum returns the most frequent subtree sum.
+// Runs in linear time.
+func MostFrequentSubtreeSum(head *BinaryTree) int {
+	freq := make(map[int]int)
+	subtreeFreqCount(head, freq)
+	var result, mostFreq int
+	for sum, count := range freq {
+		if count > mostFreq {
+			mostFreq = count
+			result = sum
+		}
+	}
+	return result
+}
+
+func subtreeFreqCount(head *BinaryTree, freq map[int]int) int {
+	if head == nil {
+		return 0
+	}
+	left := subtreeFreqCount(head.Left, freq)
+	right := subtreeFreqCount(head.Right, freq)
+	sum := left + right + head.Value
+	freq[sum]++
+	return sum
+}


Test patch:
diff --git a/day196/problem_test.go b/day196/problem_test.go
new file mode 100644
index 0000000..0a172c8
--- /dev/null
+++ b/day196/problem_test.go
@@ -0,0 +1,31 @@
+package day196
+
+import "testing"
+
+var testcases = []struct {
+	head     *BinaryTree
+	expected int
+}{
+	{&BinaryTree{
+		5,
+		&BinaryTree{2, nil, nil},
+		&BinaryTree{-5, nil, nil},
+	}, 2},
+}
+
+func TestMostFrequentSubtreeSum(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := MostFrequentSubtreeSum(tc.head); result != tc.expected {
+			t.Errorf("Expected %v, got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkMostFrequentSubtreeSum(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			MostFrequentSubtreeSum(tc.head)
+		}
+	}
+}
Repository: jazzband/tablib (python)

Issue:
Question / feature request: Excel - format as date 
I can feed a tablib cell a datetime, and formatting that cell as date in Excel works - the number shown initially gets converted to a valid date.

Can i tell tablib to format the cell as datetime right away, so the Excel file shows date formatting right after being opened?

(Looks like XlsxWriter and xlwt can do that, but i'm reluctant to switch.)


Pull request:
feat: xls: add styling for date/time types
fixes #210
Following suggestion by https://github.com/jazzband/tablib/issues/210#issuecomment-487998186

Patch:
diff --git a/src/tablib/formats/_xls.py b/src/tablib/formats/_xls.py
index 2c6c527..947625d 100644
--- a/src/tablib/formats/_xls.py
+++ b/src/tablib/formats/_xls.py
@@ -1,6 +1,6 @@
 """ Tablib - XLS Support.
 """
-
+import datetime
 from io import BytesIO
 
 import xlrd
@@ -12,6 +12,9 @@ import tablib
 # special styles
 wrap = xlwt.easyxf("alignment: wrap on")
 bold = xlwt.easyxf("font: bold on")
+datetime_style = xlwt.easyxf(num_format_str='M/D/YY h:mm')
+date_style = xlwt.easyxf(num_format_str='M/D/YY')
+time_style = xlwt.easyxf(num_format_str='h:mm:ss')
 
 
 class XLSFormat:
@@ -138,6 +141,13 @@ class XLSFormat:
                 elif len(row) < dataset.width:
                     ws.write(i, j, col, bold)
 
+                # format date types
+                elif isinstance(col, datetime.datetime):
+                    ws.write(i, j, col, datetime_style)
+                elif isinstance(col, datetime.date):
+                    ws.write(i, j, col, date_style)
+                elif isinstance(col, datetime.time):
+                    ws.write(i, j, col, time_style)
                 # wrap the rest
                 else:
                     try:


Test patch:
diff --git a/tests/test_tablib.py b/tests/test_tablib.py
index fbb26f9..d557d25 100755
--- a/tests/test_tablib.py
+++ b/tests/test_tablib.py
@@ -12,6 +12,7 @@ from io import BytesIO, StringIO
 from pathlib import Path
 from uuid import uuid4
 
+import xlrd
 from openpyxl.reader.excel import load_workbook
 
 import tablib
@@ -1254,6 +1255,23 @@ class XLSTests(BaseTestCase):
         book = tablib.Databook().load(in_stream, 'xls')
         self.assertEqual(book.sheets()[0].title, 'Founders')
 
+    def test_xls_export_with_dates(self):
+        date = dt.date(2019, 10, 4)
+        time = dt.time(14, 30)
+        date_time = dt.datetime(2019, 10, 4, 12, 30, 8)
+        data.append((date, time, date_time))
+        data.headers = ('date', 'time', 'date/time')
+        _xls = data.xls
+        xls_book = xlrd.open_workbook(file_contents=_xls, formatting_info=True)
+        row = xls_book.sheet_by_index(0).row(1)
+
+        def get_format_str(cell):
+            return xls_book.format_map[xls_book.xf_list[cell.xf_index].format_key].format_str
+
+        self.assertEqual('m/d/yy', get_format_str(row[0]))
+        self.assertEqual('h:mm:ss', get_format_str(row[1]))
+        self.assertEqual('m/d/yy h:mm', get_format_str(row[2]))
+
 
 class XLSXTests(BaseTestCase):
     def test_xlsx_format_detect(self):