PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: phpbench/phpbench (php)

Issue:
BUG: Mixed up labels in HTML output: bar_chart_time / benchmark
Got following HTML output (pay Attention to the small labels like `bench_parser_old_big_ast`):

![image](https://user-images.githubusercontent.com/85400359/139585261-8c6d0161-75d7-4be4-a506-d449a46fe231.png)

Expected labels in the following order or as shown in the console:

bench_parser_old_big_ast
bench_parser_new_big_ast
bench_parser_old_medium_ast
bench_parser_new_medium_ast
bench_parser_old_small_ast
bench_parser_new_small_ast

![image](https://user-images.githubusercontent.com/85400359/139585290-2b624b81-1f11-4e29-a14e-4616e424e505.png)

The order of the test results is right but the labels seem to be mixed up in the HTML view.

Pull request:
Do not sort the XAxes
Fixes #931 

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e757f4ad..433ef86a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ Bug fixes:
 
 - Fix property (`.`) access precedence, it is now the same as `[` array
   access #928
+- Fix bug with misassigned labels in bar chart #931
 - Safely removed non-functioning config option `report.html_output_dir` #930
 
 1.1.2 (2021-09-25)
diff --git a/lib/Report/Model/BarChart.php b/lib/Report/Model/BarChart.php
index 7bebf9ab..37e67977 100644
--- a/lib/Report/Model/BarChart.php
+++ b/lib/Report/Model/BarChart.php
@@ -67,12 +67,12 @@ class BarChart implements ComponentInterface
             return [];
         }
 
+        // use all unique discreet points as the X axes values
         $xAxes = array_unique(array_merge(...array_map(function (BarChartDataSet $dataSet) {
             return $dataSet->xSeries();
         }, $this->dataSets)));
-        sort($xAxes);
 
-        return $xAxes;
+        return array_values($xAxes);
     }
 
     public function isEmpty(): bool


Test patch:
diff --git a/tests/Unit/Report/Model/BarChartTest.php b/tests/Unit/Report/Model/BarChartTest.php
index a71761df..f91186ce 100644
--- a/tests/Unit/Report/Model/BarChartTest.php
+++ b/tests/Unit/Report/Model/BarChartTest.php
@@ -31,7 +31,7 @@ class BarChartTest extends TestCase
             new BarChartDataSet('one', [12, 26, 31, 46], [1, 1, 1, 1], [1, 1, 1, 1]),
         ], 'Bar Chart One', 'foo');
 
-        self::assertEquals([12, 26, 31, 46], $chart->xAxes());
+        self::assertEquals([12, 31, 46, 26], $chart->xAxes());
     }
 
     public function testKnowsIfItsEmpty(): void
@@ -59,4 +59,20 @@ class BarChartTest extends TestCase
 
         self::assertEquals(['one', 2, 3], $chart->xLabels());
     }
+
+    public function testXLabelReplacementWithLabels(): void
+    {
+        $chart = new BarChart(
+            [
+                new BarChartDataSet('one', ['bench_one', 'bench_two', 'bench_three'], [1,2,3], [1,2,3]),
+            ],
+            'Bar Chart One',
+            'foo',
+            [
+                1 => 'five',
+            ]
+        );
+
+        self::assertEquals(['bench_one', 'five', 'bench_three'], $chart->xLabels());
+    }
 }
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 115
Good morning! Here's your coding interview problem for today.

This problem was asked by Google.

Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of this node's descendants. The tree s could also be considered as a subtree of itself.

Pull request:
Day115
Resolves #238.

Patch:
diff --git a/README.md b/README.md
index 44e5348..ba424c0 100644
--- a/README.md
+++ b/README.md
@@ -124,4 +124,5 @@ problems from
 * [Day 112](https://github.com/vaskoz/dailycodingproblem-go/issues/235)
 * [Day 113](https://github.com/vaskoz/dailycodingproblem-go/issues/236)
 * [Day 114](https://github.com/vaskoz/dailycodingproblem-go/issues/237)
+* [Day 115](https://github.com/vaskoz/dailycodingproblem-go/issues/238)
 * [Day 116](https://github.com/vaskoz/dailycodingproblem-go/issues/242)
diff --git a/day115/problem.go b/day115/problem.go
new file mode 100644
index 0000000..8f707b4
--- /dev/null
+++ b/day115/problem.go
@@ -0,0 +1,24 @@
+package day115
+
+// IntBinaryTree is a binary tree of integers.
+type IntBinaryTree struct {
+	Value       int
+	Left, Right *IntBinaryTree
+}
+
+// SameTreeSubstructure returns true if 't' exists somewhere inside of 's'.
+func SameTreeSubstructure(t, s *IntBinaryTree) bool {
+	if s == nil {
+		return false
+	}
+	return equalTrees(t, s) || SameTreeSubstructure(t, s.Left) || SameTreeSubstructure(t, s.Right)
+}
+
+func equalTrees(one, two *IntBinaryTree) bool {
+	if one == nil && two == nil {
+		return true
+	} else if (one == nil && two != nil) || (one != nil && two == nil) || (one.Value != two.Value) {
+		return false
+	}
+	return equalTrees(one.Left, two.Left) || equalTrees(one.Right, two.Right)
+}


Test patch:
diff --git a/day115/problem_test.go b/day115/problem_test.go
new file mode 100644
index 0000000..03c9c12
--- /dev/null
+++ b/day115/problem_test.go
@@ -0,0 +1,47 @@
+package day115
+
+import "testing"
+
+var testcases = []struct {
+	t, s     *IntBinaryTree
+	expected bool
+}{
+	{&IntBinaryTree{
+		10,
+		&IntBinaryTree{15, nil, nil},
+		&IntBinaryTree{20, nil, nil}},
+		&IntBinaryTree{15,
+			&IntBinaryTree{10,
+				&IntBinaryTree{15, nil, nil},
+				&IntBinaryTree{20, nil, nil}},
+			&IntBinaryTree{20, nil, nil}},
+		true},
+	{&IntBinaryTree{
+		10, nil, nil},
+		&IntBinaryTree{15,
+			&IntBinaryTree{25,
+				&IntBinaryTree{15, nil, nil},
+				&IntBinaryTree{20, nil, nil}},
+			&IntBinaryTree{20, nil, nil}},
+		false},
+	{&IntBinaryTree{10, nil, nil},
+		&IntBinaryTree{15, nil, nil},
+		false},
+}
+
+func TestSameTreeSubstructure(t *testing.T) {
+	t.Parallel()
+	for tcid, tc := range testcases {
+		if result := SameTreeSubstructure(tc.t, tc.s); result != tc.expected {
+			t.Errorf("TCID%d expected %v got %v", tcid, tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkSameTreeSubstructure(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			SameTreeSubstructure(tc.t, tc.s)
+		}
+	}
+}
Repository: vigetlabs/microcosm (js)

Issue:
Ability to set history length externally
For the dev tools, I want to allow a user to not have to worry about adding `maxHistory: Infinity` when in development mode. It would be great if there was a way to adjust the settings of the history object externally, like:

```
repo.history.setLimit(Infinity)
```

Pull request:
Add a setLimit method to the history object.
Resolves #353. Also wrote some super basic tests just to be safe.

**What kind of change does this PR introduce?**
- Refactor

**Does this PR introduce a breaking change?**
- No

**Does this PR fulfill these requirements:**
<!-- (Update "[ ]" to "[x]" to check a box) -->

- [x] All tests are passing
- [x] `yarn pretty` has been run
- [x] Commits reference open issues


Patch:
diff --git a/src/history.js b/src/history.js
index 82c3463b..e2d813f7 100644
--- a/src/history.js
+++ b/src/history.js
@@ -40,7 +40,7 @@ class History extends Emitter {
     let options = merge(DEFAULTS, config)
 
     this.size = 0
-    this.limit = Math.max(0, options.maxHistory)
+    this.setLimit(options.maxHistory)
 
     this.updater = options.updater(options)
 
@@ -337,6 +337,13 @@ class History extends Emitter {
     this.size = size
   }
 
+  /**
+   * Set the limit of the history object.
+   */
+  setLimit(limit: number) {
+    this.limit = Math.max(0, limit)
+  }
+
   /**
    * Determine if provided action is within active history branch
    */


Test patch:
diff --git a/test/unit/history/setLimit.test.js b/test/unit/history/setLimit.test.js
new file mode 100644
index 00000000..125a7614
--- /dev/null
+++ b/test/unit/history/setLimit.test.js
@@ -0,0 +1,24 @@
+import History from '../../../src/history'
+
+describe('History::setLimit', function() {
+  it('sets the correct size given Infinity', function() {
+    const history = new History()
+    history.setLimit(Infinity)
+
+    expect(history.limit).toEqual(Infinity)
+  })
+
+  it('sets the correct size given an integer', function() {
+    const history = new History()
+    history.setLimit(10)
+
+    expect(history.limit).toEqual(10)
+  })
+
+  it('sets the limit to 0 given a negative integer', function() {
+    const history = new History()
+    history.setLimit(-10)
+
+    expect(history.limit).toEqual(0)
+  })
+})