PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: uutils/procps (rust)

Issue:
`watch`: implement `--interval`
```
      -n, --interval seconds
              Specify update interval.  The command will not allow quicker than 0.1 second inter-
              val,  in  which the smaller values are converted. Both '.' and ',' work for any lo-
              cales. The WATCH_INTERVAL environment can be used to persistently set a non-default
              interval (following the same rules and formatting).
```

Pull request:
watch: handle WATCH_INTERVAL
Resolves #25.

Handle `WATCH_INTERVAL`, as override for the `-n, --interval` option in `watch`.

Patch:
diff --git a/src/uu/watch/src/watch.rs b/src/uu/watch/src/watch.rs
index 6343c79..b1e7d6b 100644
--- a/src/uu/watch/src/watch.rs
+++ b/src/uu/watch/src/watch.rs
@@ -118,6 +118,7 @@ pub fn uu_app() -> Command {
                 .long("interval")
                 .help("Seconds to wait between updates")
                 .default_value("2")
+                .env("WATCH_INTERVAL")
                 .value_name("SECONDS"),
         )
         .arg(


Test patch:
diff --git a/tests/by-util/test_watch.rs b/tests/by-util/test_watch.rs
index 9555c6f..4492625 100644
--- a/tests/by-util/test_watch.rs
+++ b/tests/by-util/test_watch.rs
@@ -14,6 +14,12 @@ const TRUE_CMD: &str = "%SYSTEMROOT%\\System32\\rundll32.exe";
 #[cfg(not(windows))]
 const TRUE_CMD: &str = "true";
 
+#[cfg(windows)]
+const ECHO_HELLO_CMD: &str = "echo | set /p dummyName=hello";
+
+#[cfg(not(windows))]
+const ECHO_HELLO_CMD: &str = "printf hello";
+
 #[test]
 fn test_invalid_arg() {
     new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
@@ -62,3 +68,20 @@ fn test_valid_interval_comma() {
         .no_stderr()
         .no_stdout();
 }
+
+#[test]
+fn test_interval_environment_variable() {
+    let mut p = new_ucmd!()
+        .arg(ECHO_HELLO_CMD)
+        .env("WATCH_INTERVAL", "0.3")
+        .run_no_wait();
+    // With 0.5 seconds runtime, the watched command is called twice if
+    // `WATCH_INTERVAL` (0.3 seconds) is taken into account, but only once if the default
+    // interval (2 seconds) is used.
+    p.make_assertion_with_delay(500).is_alive();
+    p.kill()
+        .make_assertion()
+        .with_all_output()
+        .no_stderr()
+        .stdout_is_bytes(b"hellohello");
+}
Repository: atlassian/changesets (ts)

Issue:
Expand on range types changesets supports
Currently changesets supports `1.0.0`, `~1.0.0`, and `^1.0.0`, which is a subset of valid semver definitions.

@mitchellhamilton found the range types that yarn supports, and suggested we should do that.

So we need to: refind that info (I have lost the link he gave me soz)
Align our range type function with it.

Pull request:
Add support for other range types
Closes #99

Patch:
diff --git a/.changeset/selfish-papayas-mix.md b/.changeset/selfish-papayas-mix.md
new file mode 100644
index 0000000..0189d45
--- /dev/null
+++ b/.changeset/selfish-papayas-mix.md
@@ -0,0 +1,5 @@
+---
+"@changesets/get-version-range-type": minor
+---
+
+Add support for other range types
diff --git a/packages/get-version-range-type/src/index.ts b/packages/get-version-range-type/src/index.ts
index 4e96188..49fd0aa 100644
--- a/packages/get-version-range-type/src/index.ts
+++ b/packages/get-version-range-type/src/index.ts
@@ -1,8 +1,10 @@
 export default function getVersionRangeType(
   versionRange: string
-): "^" | "~" | ">=" | "" {
+): "^" | "~" | ">=" | "<=" | ">" | "" {
   if (versionRange.charAt(0) === "^") return "^";
   if (versionRange.charAt(0) === "~") return "~";
   if (versionRange.startsWith(">=")) return ">=";
+  if (versionRange.startsWith("<=")) return "<=";
+  if (versionRange.charAt(0) === ">") return ">";
   return "";
 }


Test patch:
diff --git a/packages/get-version-range-type/src/index.test.ts b/packages/get-version-range-type/src/index.test.ts
new file mode 100644
index 0000000..60e7310
--- /dev/null
+++ b/packages/get-version-range-type/src/index.test.ts
@@ -0,0 +1,12 @@
+import getVersionRangeType from "./";
+
+test.each([
+  ["^1.0.0", "^"],
+  ["~1.0.0", "~"],
+  [">=1.0.0", ">="],
+  ["<=1.0.0", "<="],
+  [">1.0.0", ">"],
+  ["1.0.0", ""]
+])('getVersionRangeType should return "%s" if passed "%s"', (input, output) => {
+  expect(getVersionRangeType(input)).toEqual(output);
+});
Repository: solid/community-server (ts)

Issue:
Clarify that users need to log in through an app
We currently have 2 inbound links to the login page, but that page can only be used as part of an OIDC flow.

I would suggest to keep the login links (people will be looking for them), but then provide an explanation on the rendered login page.

@joachimvh Can we detect that we're not part of an OIDC flow in that handler?

Pull request:
fix: Explain why logging in will not work
Closes #880 

Now that the IDP handles content-negotiation for errors the login error can have a more detailed explanation.

Patch:
diff --git a/src/identity/IdentityProviderHttpHandler.ts b/src/identity/IdentityProviderHttpHandler.ts
index efec23b7b..fe38a2c13 100644
--- a/src/identity/IdentityProviderHttpHandler.ts
+++ b/src/identity/IdentityProviderHttpHandler.ts
@@ -227,10 +227,9 @@ export class IdentityProviderHttpHandler extends HttpHandler {
 
     if (result.type === 'complete') {
       if (!oidcInteraction) {
-        // Once https://github.com/solid/community-server/pull/898 is merged
-        // we want to assign an error code here to have a more thorough explanation
         throw new BadRequestHttpError(
-          'This action can only be executed as part of an authentication flow. It should not be used directly.',
+          'This action can only be performed as part of an OIDC authentication flow.',
+          { errorCode: 'E0002' },
         );
       }
       // Create a redirect URL with the OIDC library
diff --git a/templates/error/descriptions/E0002.md.hbs b/templates/error/descriptions/E0002.md.hbs
new file mode 100644
index 000000000..7cf273704
--- /dev/null
+++ b/templates/error/descriptions/E0002.md.hbs
@@ -0,0 +1,6 @@
+# Please log in through an app
+Logging in to a Solid Pod needs to happen via a Solid app.
+<br>
+It is not possible to use the login page directly.
+If you are developing an app,
+you can use a library such as [`solid-client-authn-js`](https://github.com/inrupt/solid-client-authn-js) to initiate an OIDC authentication flow.


Test patch:
diff --git a/test/unit/identity/IdentityProviderHttpHandler.test.ts b/test/unit/identity/IdentityProviderHttpHandler.test.ts
index fbf056b4c..f4b1e3595 100644
--- a/test/unit/identity/IdentityProviderHttpHandler.test.ts
+++ b/test/unit/identity/IdentityProviderHttpHandler.test.ts
@@ -160,9 +160,10 @@ describe('An IdentityProviderHttpHandler', (): void => {
     expect(routes.complete.handler.handleSafe).toHaveBeenLastCalledWith({ operation });
     expect(interactionCompleter.handleSafe).toHaveBeenCalledTimes(0);
 
-    const error = new BadRequestHttpError(
-      'This action can only be executed as part of an authentication flow. It should not be used directly.',
-    );
+    const error = expect.objectContaining({
+      message: 'This action can only be performed as part of an OIDC authentication flow.',
+      errorCode: 'E0002',
+    });
     expect(errorHandler.handleSafe).toHaveBeenCalledTimes(1);
     expect(errorHandler.handleSafe).toHaveBeenLastCalledWith({ error, preferences: { type: { 'text/html': 1 }}});
     expect(responseWriter.handleSafe).toHaveBeenCalledTimes(1);
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Binary Tree: Count Nodes and Find Deepest
Given the root to a binary tree, count the total number of nodes there are.

Given the root to a binary tree, return the deepest node.



Pull request:
day 12 extra: count nodes and deepest node
Resolves #27 

Patch:
diff --git a/README.md b/README.md
index 3ee6ba8..f6e2e37 100644
--- a/README.md
+++ b/README.md
@@ -22,3 +22,4 @@ problems from
 * [Day 10](https://github.com/vaskoz/dailycodingproblem-go/issues/21)
 * [Day 11](https://github.com/vaskoz/dailycodingproblem-go/issues/23)
 * [Day 12](https://github.com/vaskoz/dailycodingproblem-go/issues/25)
+* [Day 12 Count and Deepest](https://github.com/vaskoz/dailycodingproblem-go/issues/27)
diff --git a/deepestBinaryTree/problem.go b/deepestBinaryTree/problem.go
new file mode 100644
index 0000000..b571d24
--- /dev/null
+++ b/deepestBinaryTree/problem.go
@@ -0,0 +1,35 @@
+package deepest
+
+// BinaryTree represents a tree with a left and right subtree.
+type BinaryTree struct {
+	// val         int // value doesn't matter here.
+	left, right *BinaryTree
+}
+
+// CountNodes tallies the total number of nodes in the binary tree.
+func CountNodes(root *BinaryTree) int {
+	if root == nil {
+		return 0
+	}
+	return CountNodes(root.left) + CountNodes(root.right) + 1
+}
+
+// Deepest returns the deepest node in the binary tree.
+func Deepest(root *BinaryTree) (*BinaryTree, int) {
+	if root != nil && root.left == nil && root.right == nil {
+		return root, 1
+	}
+	if root.left == nil {
+		n, count := Deepest(root.right)
+		return n, count + 1
+	} else if root.right == nil {
+		n, count := Deepest(root.left)
+		return n, count + 1
+	}
+	ln, lcount := Deepest(root.left)
+	rn, rcount := Deepest(root.right)
+	if lcount > rcount {
+		return ln, lcount + 1
+	}
+	return rn, rcount + 1
+}


Test patch:
diff --git a/deepestBinaryTree/problem_test.go b/deepestBinaryTree/problem_test.go
new file mode 100644
index 0000000..da65eba
--- /dev/null
+++ b/deepestBinaryTree/problem_test.go
@@ -0,0 +1,42 @@
+package deepest
+
+import "testing"
+
+// nodes = 5 depth = 3
+func buildTestTree() *BinaryTree {
+	return &BinaryTree{&BinaryTree{&BinaryTree{nil, nil},
+		&BinaryTree{&BinaryTree{nil, nil}, nil}},
+		&BinaryTree{nil, &BinaryTree{nil, nil}}}
+}
+
+func TestCountNodes(t *testing.T) {
+	t.Parallel()
+	root := buildTestTree()
+	if count := CountNodes(root); count != 7 {
+		t.Errorf("Expected 7 but got %v", count)
+	}
+}
+
+func BenchmarkCountNodes(b *testing.B) {
+	root := buildTestTree()
+	b.ResetTimer()
+	for i := 0; i < b.N; i++ {
+		CountNodes(root)
+	}
+}
+
+func TestDeepest(t *testing.T) {
+	t.Parallel()
+	root := buildTestTree()
+	if _, count := Deepest(root); count != 4 {
+		t.Errorf("Expected 4 but got %v", count)
+	}
+}
+
+func BenchmarkDeepest(b *testing.B) {
+	root := buildTestTree()
+	b.ResetTimer()
+	for i := 0; i < b.N; i++ {
+		Deepest(root)
+	}
+}
Repository: bem/bh (js)

Issue:
Bug with ctx.js()
```js
// ({block: 'block'})

bh.match('block', function(ctx) {
    ctx.js(false);
    ctx.js(true);
});

// <div class="block i-bem" data-bem='{"block":{}}'></div>
```

After the second call to `ctx.js(true)` the value of `js` is true. Should be `false`.

`js()` implementation in BH: https://github.com/bem/bh/blob/master/lib/bh.js#L437-L445
It seems that after the first call `json.js` stays `undefined`.
On the second call this happens: `this.extend(undefined, true)`
And then returns this: https://github.com/bem/bh/blob/master/lib/bh.js#L92


Pull request:
Fix bug with `ctx.js()`
fix #160

Patch:
diff --git a/lib/bh.js b/lib/bh.js
index cc85b81..0fb968f 100644
--- a/lib/bh.js
+++ b/lib/bh.js
@@ -435,12 +435,10 @@ function BH() {
          * @returns {Boolean|Object|Ctx}
          */
         js: function(js, force) {
-            if (js === undefined) {
-                return this.ctx.js;
-            }
-            this.ctx.js = force ?
-                (js === true ? {} : js) :
-                js ? this.extend(this.ctx.js, js) : this.ctx.js;
+            var ctx = this.ctx;
+            if (js === undefined) return ctx.js;
+            if (force || ctx.js === undefined) ctx.js = js;
+            else if (ctx.js !== false) this.extend(ctx.js, js);
             return this;
         },
         /**


Test patch:
diff --git a/test/test.js.js b/test/test.js.js
index 3bcf2b3..422033a 100644
--- a/test/test.js.js
+++ b/test/test.js.js
@@ -28,6 +28,13 @@ describe('ctx.js()', function() {
         bh.apply({ block: 'button' }).should.equal('<div class="button"></div>');
     });
 
+    it('should not override user declarations', function() {
+        bh.match('button', function(ctx) {
+            ctx.js(true);
+        });
+        bh.apply({ block: 'button', js: false }).should.equal('<div class="button"></div>');
+    });
+
     it('should extend user js', function() {
         bh.match('button', function(ctx) {
             ctx.js({ a: 2 });
@@ -36,7 +43,7 @@ describe('ctx.js()', function() {
             .should.equal('<div class="button i-bem" onclick=\'return {"button":{"x":1,"a":2}}\'></div>');
     });
 
-    it('should not override later declarations', function() {
+    it('should not override later declarations #1', function() {
         bh.match('button', function(ctx) {
             ctx.js(false);
         });
@@ -46,6 +53,16 @@ describe('ctx.js()', function() {
         bh.apply({ block: 'button' }).should.equal('<div class="button i-bem" onclick=\'return {"button":{}}\'></div>');
     });
 
+    it('should not override later declarations #2', function() {
+        bh.match('button', function(ctx) {
+            ctx.js(true);
+        });
+        bh.match('button', function(ctx) {
+            ctx.js(false);
+        });
+        bh.apply({ block: 'button' }).should.equal('<div class="button"></div>');
+    });
+
     it('should override later declarations with force flag', function() {
         bh.match('button', function(ctx) {
             ctx.js(true, true);