PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: preslavmihaylov/todocheck (go)
Issue: auth tokens cache overrides auth token specified via env variable
Whenever you specify an auth token for e.g. domain `hello.myjira.net` with auth token via env variable:
```
$ TODOCHECK_AUTH_TOKEN=<auth-token> ./todocheck
```

if there is an auth token already present for that domain in `~/.todocheck/authtokens.yaml`, todocheck will use the auth token from that file vs. using the one specified via the env variable.

This shouldn't happen. The env variable should override the auth tokens cache.
Pull request description: Env var overrides cached token
Fixes #175 

Patch:
diff --git a/authmanager/authmanager.go b/authmanager/authmanager.go
index 32d5f27..50a9cea 100644
--- a/authmanager/authmanager.go
+++ b/authmanager/authmanager.go
@@ -45,12 +45,12 @@ func acquireToken(authCfg *config.Auth, tokenKey string, instructions string) er
 		return fmt.Errorf("couldn't read auth tokens config: %w", err)
 	}
 
-	if store.Tokens[tokenKey] != "" {
-		authCfg.Token = store.Tokens[tokenKey]
-		return nil
-	} else if envToken := os.Getenv(authTokenEnvVariable); envToken != "" {
+	if envToken := os.Getenv(authTokenEnvVariable); envToken != "" {
 		authCfg.Token = envToken
 		return nil
+	} else if store.Tokens[tokenKey] != "" {
+		authCfg.Token = store.Tokens[tokenKey]
+		return nil
 	}
 
 	fmt.Printf("%s\nToken: ", instructions)


Test patch:
diff --git a/testing/scenarios/auth_tokens_cache/authtokens.yaml b/testing/scenarios/auth_tokens_cache/authtokens.yaml
index a93fd16..26bc315 100644
--- a/testing/scenarios/auth_tokens_cache/authtokens.yaml
+++ b/testing/scenarios/auth_tokens_cache/authtokens.yaml
@@ -1,2 +1,2 @@
 tokens:
-  http://localhost:8080/offline: 123456
+  http://localhost:8080/offline: 123456
\ No newline at end of file
diff --git a/testing/todocheck_test.go b/testing/todocheck_test.go
index 2a4b91a..f6b8cc7 100644
--- a/testing/todocheck_test.go
+++ b/testing/todocheck_test.go
@@ -320,6 +320,21 @@ func TestAuthTokensCache(t *testing.T) {
 	}
 }
 
+func TestAuthTokenEnvOverride(t *testing.T) {
+	err := scenariobuilder.NewScenario().
+		WithBinary("../todocheck").
+		WithBasepath("./scenarios/auth_tokens_cache").
+		WithConfig("./test_configs/auth_tokens.yaml").
+		WithIssueTracker(issuetracker.Jira).
+		WithEnvVariable("TODOCHECK_AUTH_TOKEN", "654321").
+		RequireAuthToken("654321").
+		WithIssue("J123", issuetracker.StatusOpen).
+		Run()
+	if err != nil {
+		t.Errorf("%s", err)
+	}
+}
+
 func TestOfflineToken(t *testing.T) {
 	err := scenariobuilder.NewScenario().
 		WithBinary("../todocheck").
Repository: preactjs/preact-render-to-string (js)
Issue: Rendering shallow makes a Fragment into a <p>
Shallow rendering this:
`<><ComponentX /></>`
Creates this:
`<p><ComponentX /></p>`

Is that intended behaviour? Why not just `<ComponentX />`
Pull request description: fix: shallow render with fragment at top lvl
Fixes #262 

Patch:
diff --git a/.changeset/fast-rockets-admire.md b/.changeset/fast-rockets-admire.md
new file mode 100644
index 0000000..ebec71e
--- /dev/null
+++ b/.changeset/fast-rockets-admire.md
@@ -0,0 +1,5 @@
+---
+'preact-render-to-string': patch
+---
+
+Fix for shallow rendering incorrectly transforming Fragments into other nodes
diff --git a/src/pretty.js b/src/pretty.js
index 70e9e5a..59df0e4 100644
--- a/src/pretty.js
+++ b/src/pretty.js
@@ -103,7 +103,11 @@ function _renderToStringPretty(
 	// components
 	if (typeof nodeName === 'function') {
 		isComponent = true;
-		if (opts.shallow && (inner || opts.renderRootComponent === false)) {
+		if (
+			opts.shallow &&
+			(inner || opts.renderRootComponent === false) &&
+			nodeName !== Fragment
+		) {
 			nodeName = getComponentName(nodeName);
 		} else if (nodeName === Fragment) {
 			const children = [];


Test patch:
diff --git a/test/shallowRender.test.jsx b/test/shallowRender.test.jsx
index 8b981f3..ca33244 100644
--- a/test/shallowRender.test.jsx
+++ b/test/shallowRender.test.jsx
@@ -52,12 +52,26 @@ describe('shallowRender()', () => {
 		expect(Test).to.have.been.calledOnce;
 	});
 
-	it('should ignore Fragments', () => {
-		let rendered = shallowRender(
-			<Fragment>
-				<div>foo</div>
-			</Fragment>
-		);
-		expect(rendered).to.equal(`<div>foo</div>`);
+	describe('should ignore Fragments', () => {
+		it('passed directly', () => {
+			let rendered = shallowRender(
+				<Fragment>
+					<div>foo</div>
+				</Fragment>
+			);
+			expect(rendered).to.equal(`<div>foo</div>`);
+		});
+
+		it('passed from FC', () => {
+			const Test = () => (
+				<Fragment>
+					<div>foo</div>
+				</Fragment>
+			);
+
+			let rendered = shallowRender(<Test />);
+
+			expect(rendered).to.equal(`<div>foo</div>`);
+		});
 	});
 });
Repository: KaTeX/KaTeX (js)
Issue: Closing substack immediately causes crash
Opening and closing a substack without any content inside causes the program to crash with a "cannot read property 'length' of undefined" error.
Here are the exact steps to reproduce (you can't see the closing curly brace appear, as the program crashes as soon as i type it):

![katex_issue](https://user-images.githubusercontent.com/40633983/85164994-6d18bc00-b265-11ea-8184-512003ea541f.gif)


The last few items on the call stack are as follows:

![image](https://user-images.githubusercontent.com/40633983/85164319-7d7c6700-b264-11ea-8fc7-29227c7e216a.png)

I have set `throwOnError: false` so i would expect faulty input to cause red text, but not a crash.
This is in chromium, on Ubuntu 18.04, using your npm-package in a react-app.

Pull request description: Enable an empty \substack
Fixes #2276.

Patch:
diff --git a/src/environments/array.js b/src/environments/array.js
index e2ad39d3..01108eaf 100644
--- a/src/environments/array.js
+++ b/src/environments/array.js
@@ -737,7 +737,7 @@ defineEnvironment({
             arraystretch: 0.5,
         };
         res = parseArray(context.parser, res, "script");
-        if (res.body[0].length > 1) {
+        if (res.body.length > 0 &&  res.body[0].length > 1) {
             throw new ParseError("{subarray} can contain only one column");
         }
         return res;


Test patch:
diff --git a/test/katex-spec.js b/test/katex-spec.js
index 07564a87..95d909ed 100644
--- a/test/katex-spec.js
+++ b/test/katex-spec.js
@@ -2660,6 +2660,9 @@ describe("A substack function", function() {
     it("should accommodate macros in the argument", function() {
         expect`\sum_{\substack{ 0<i<\varPi \\ 0<j<\pi }}  P(i,j)`.toBuild();
     });
+    it("should accommodate an empty argument", function() {
+        expect`\sum_{\substack{}}  P(i,j)`.toBuild();
+    });
 
 });