PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: maragudk/gomponents (go)

Issue:
Add "checked" bool attribute
For https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/checkbox

Pull request:
Add "checked" bool attribute
Fixes #127.

Patch:
diff --git a/html/attributes.go b/html/attributes.go
index 3c69f94..b38dd95 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -16,6 +16,10 @@ func AutoPlay() g.Node {
 	return g.Attr("autoplay")
 }
 
+func Checked() g.Node {
+	return g.Attr("checked")
+}
+
 func Controls() g.Node {
 	return g.Attr("controls")
 }


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index 5e2c179..bcb6daf 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -14,6 +14,7 @@ func TestBooleanAttributes(t *testing.T) {
 		"async":       Async,
 		"autofocus":   AutoFocus,
 		"autoplay":    AutoPlay,
+		"checked":     Checked,
 		"controls":    Controls,
 		"defer":       Defer,
 		"disabled":    Disabled,
Repository: bustlelabs/shep (js)

Issue:
Dont deploy when webpack fails
If webpack has an error we should log it and stop what we're doing, this goes for builds and deploys.

Pull request:
Ensure webpack failures are detected
We'll fail with output if webpack fails

![screen shot 2016-11-14 at 5 16 08 pm](https://cloud.githubusercontent.com/assets/25966/20285093/148296d4-aa8e-11e6-92ae-319000da3965.png)

Closes #112 

I wish I knew how to test this in the CI. Happy to add any kind of tests with some guidance.

Patch:
diff --git a/src/util/build-functions.js b/src/util/build-functions.js
index f1d8e01..7aeb533 100644
--- a/src/util/build-functions.js
+++ b/src/util/build-functions.js
@@ -1,5 +1,5 @@
 import exec from './modules/exec'
 
 export default function (PATTERN, NODE_ENV) {
-  return exec('webpack', [], { env: { PATTERN, NODE_ENV } })
+  return exec('webpack', ['--bail'], { env: { PATTERN, NODE_ENV } })
 }


Test patch:
diff --git a/test/build/index.js b/test/build/index.js
index ae97167..66405f1 100644
--- a/test/build/index.js
+++ b/test/build/index.js
@@ -6,4 +6,4 @@ test.before(() => {
   return shep.build({ quiet: true })
 })
 
-test(didExec, 'webpack')
+test(didExec, 'webpack', ['--bail'])
diff --git a/test/helpers/exec.js b/test/helpers/exec.js
index 06b9778..70c9da9 100644
--- a/test/helpers/exec.js
+++ b/test/helpers/exec.js
@@ -3,8 +3,7 @@ import td from 'testdouble'
 const exec = td.replace('../../src/util/modules/exec')
 
 function didExec (t, cmd, args, options = {}) {
-  const secondArg = args ? td.matchers.contains(args) : []
-  td.verify(exec(td.matchers.contains(cmd), secondArg, td.matchers.contains(options)))
+  td.verify(exec(cmd, args, td.matchers.contains(options)))
 }
 
 didExec.title = (providedTitle, cmd, subcmd) => `Executed ${cmd} ${subcmd || ''}`
diff --git a/test/new/index.js b/test/new/index.js
index e3c8a75..03d92a4 100644
--- a/test/new/index.js
+++ b/test/new/index.js
@@ -27,5 +27,5 @@ test(wroteFile, `${path}/.gitignore`)
 test(wroteFile, `${path}/README.md`)
 test(wroteFile, `${path}/webpack.config.js`)
 
-test(didExec, 'npm', 'install')
+test(didExec, 'npm', ['install'])
Repository: tannerlinsley/react-query (ts)

Issue:
Error state if query is reset while loading
**Describe the bug**
Upon pressing 'reset' on a query while it is already loading, the error state is shown.

**To Reproduce**
Steps to reproduce the behavior:
1. Open react-query dev tools.
2. Click on a query in the list.
3. In the panel that opens, under 'Actions', click 'Reset'.
4. Ordinary loading behaviour should be seen.
5. Now press 'Reset' twice in quick succession.
6. An error state should be seen.

**Expected behavior**
The component should have stayed in the loading state the whole time.

**Screenshots**
Here's a sandbox: [codesandbox.io/s/i8443](https://codesandbox.io/s/i8443). 

Here's a screenshot:
> ![Jan-07-2021 15-37-05](https://user-images.githubusercontent.com/6892123/103911857-7765af00-50fe-11eb-92ac-55dafb3fc9e9.gif)


**Desktop (please complete the following information):**
 - OS: macos
 - Browser: chrome
 - Version: 87.0.4280.88

Let me know if I can help at all!

Pull request:
fix: stop returning cancelledError on reset during fetch
Fixes #1594.

Tested manually by resetting a query using dev tools while it's refetching. 

Added a test to cover this behaviour.

(My first PR here – happy to make further changes if I've missed anything!)

Patch:
diff --git a/src/core/query.ts b/src/core/query.ts
index 0dd52ed47..6f8610c20 100644
--- a/src/core/query.ts
+++ b/src/core/query.ts
@@ -227,7 +227,7 @@ export class Query<
 
   destroy(): void {
     this.clearGcTimeout()
-    this.cancel()
+    this.cancel({ silent: true })
   }
 
   reset(): void {


Test patch:
diff --git a/src/core/tests/query.test.tsx b/src/core/tests/query.test.tsx
index ab69872a6..baa91aa6c 100644
--- a/src/core/tests/query.test.tsx
+++ b/src/core/tests/query.test.tsx
@@ -282,6 +282,36 @@ describe('query', () => {
     expect(isCancelledError(error)).toBe(true)
   })
 
+  test('should not error if reset while loading', async () => {
+    const key = queryKey()
+
+    const queryFn = jest.fn()
+
+    queryFn.mockImplementation(async () => {
+      await sleep(10)
+      throw new Error()
+    })
+
+    queryClient.fetchQuery(key, queryFn, {
+      retry: 3,
+      retryDelay: 10,
+    })
+
+    // Ensure the query is loading
+    const query = queryCache.find(key)!
+    expect(query.state.status).toBe('loading')
+
+    // Reset the query while it is loading
+    query.reset()
+
+    await sleep(100)
+
+    // The query should
+    expect(queryFn).toHaveBeenCalledTimes(1) // have been called,
+    expect(query.state.error).toBe(null) // not have an error, and
+    expect(query.state.status).toBe('idle') // not be loading any longer
+  })
+
   test('should be able to refetch a cancelled query', async () => {
     const key = queryKey()
Repository: semantic-release/github (js)

Issue:
Improvement of prerelease check
As of https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md?plain=1#L91 the property prerelease can be used to configure a prerelease. If you set this property to false the prerelease is still created if the other conditions are met. With this PR you can set prerelease to false and no prerelease is created.

Fix: https://github.com/semantic-release/github/pull/863

Pull request:
feat: use branch prerelease property for detection
For the description have a look into the issue: https://github.com/semantic-release/github/issues/864

For a showcase have a look at the video provided by @babblebey in the comment: https://github.com/semantic-release/github/pull/863#issuecomment-2192578725 

Fixes #864 

Patch:
diff --git a/lib/is-prerelease.js b/lib/is-prerelease.js
index 6eb91c1..c04a7ba 100644
--- a/lib/is-prerelease.js
+++ b/lib/is-prerelease.js
@@ -1,3 +1,11 @@
-export default function isPrerelease({ type, main }) {
-  return type === "prerelease" || (type === "release" && !main);
+export default function isPrerelease({ type, main, prerelease }) {
+  if (prerelease === false) {
+    return false;
+  }
+  return (
+    type === "prerelease" ||
+    (type === "release" && !main) ||
+    typeof prerelease == "string" ||
+    prerelease === true
+  );
 }


Test patch:
diff --git a/test/is-prerelease.test.js b/test/is-prerelease.test.js
new file mode 100644
index 0000000..8c2c60f
--- /dev/null
+++ b/test/is-prerelease.test.js
@@ -0,0 +1,52 @@
+import test from "ava";
+import isPrerelease from "../lib/is-prerelease.js";
+
+test("Test for empty object", (t) => {
+  const branch = {};
+  t.is(isPrerelease(branch), false);
+});
+
+test("Test if prerelease true property as boolean is used correctly", (t) => {
+  const branch = {
+    prerelease: true,
+  };
+  t.is(isPrerelease(branch), true);
+});
+
+test("Test if prerelease false property as boolean is used correctly", (t) => {
+  const branch = {
+    prerelease: false,
+  };
+  t.is(isPrerelease(branch), false);
+});
+
+test("Test if prerelease property as string is used correctly", (t) => {
+  const branch = {
+    prerelease: "rc",
+  };
+  t.is(isPrerelease(branch), true);
+});
+
+test("Test if prerelease type is used correctly", (t) => {
+  const branch = {
+    type: "prerelease",
+  };
+  t.is(isPrerelease(branch), true);
+});
+
+test("Test if prerelease type and main is used correctly", (t) => {
+  const branch = {
+    type: "release",
+    main: false,
+  };
+  t.is(isPrerelease(branch), true);
+});
+
+test("Test if prerelease type and main in addition to prerelease is used correctly", (t) => {
+  const branch = {
+    type: "release",
+    main: false,
+    prerelease: false,
+  };
+  t.is(isPrerelease(branch), false);
+});
Repository: preactjs/preact-render-to-string (js)

Issue:
xlink:href becomes xlink::href
#310 fixes `xlinkHref` attributes but breaks `xlink:href` by adding another colon:

```js
> require('preact-render-to-string').renderToString({constructor: undefined, type: 'use', props: {'xlink:href': 'hi'}})
'<use xlink::href="hi"></use>'
```

Perhaps `NAMESPACE_REPLACE_REGEX` should just be `/^(xlink|xmlns|xml)([A-Z])/`?

Pull request:
avoid adding double colon
fixes #314 

Patch:
diff --git a/.changeset/beige-starfishes-worry.md b/.changeset/beige-starfishes-worry.md
new file mode 100644
index 0000000..4feae9e
--- /dev/null
+++ b/.changeset/beige-starfishes-worry.md
@@ -0,0 +1,5 @@
+---
+"preact-render-to-string": patch
+---
+
+avoid adding double colon for namespaced attributes
diff --git a/src/util.js b/src/util.js
index bc80ea4..397d01a 100644
--- a/src/util.js
+++ b/src/util.js
@@ -1,6 +1,6 @@
 export const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;
 export const UNSAFE_NAME = /[\s\n\\/='"\0<>]/;
-export const NAMESPACE_REPLACE_REGEX = /^(xlink|xmlns|xml)(:|[A-Z])/;
+export const NAMESPACE_REPLACE_REGEX = /^(xlink|xmlns|xml)([A-Z])/;
 export const HTML_LOWER_CASE = /^accessK|^auto[A-Z]|^ch|^col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|readO|rowS|spellC|src[A-Z]|tabI|item[A-Z]/;
 export const SVG_CAMEL_CASE = /^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/;
 


Test patch:
diff --git a/test/render.test.js b/test/render.test.js
index e6b6fe1..f8060d8 100644
--- a/test/render.test.js
+++ b/test/render.test.js
@@ -337,6 +337,12 @@ describe('render', () => {
 				`<svg><image xlink:href="#"></image><foreignObject><div xlink:href="#"></div></foreignObject><g><image xlink:href="#"></image></g></svg>`
 			);
 		});
+
+		it('should not add extra colon on SVG elements', () => {
+			let rendered = render(<svg>{h('image', { 'xlink:href': '#' })}</svg>);
+
+			expect(rendered).to.equal(`<svg><image xlink:href="#"></image></svg>`);
+		});
 	});
 
 	describe('Functional Components', () => {
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 273
Good morning! Here's your coding interview problem for today.

This problem was asked by Apple.

A fixed point in an array is an element whose value is equal to its index. Given a sorted array of distinct elements, return a fixed point, if one exists. Otherwise, return False.

For example, given `[-6, 0, 2, 40]`, you should return `2`. Given `[1, 5, 7, 8]`, you should return `False`.

Pull request:
Day273
Resolves #556.

Patch:
diff --git a/README.md b/README.md
index 6e819b2..2b80f07 100644
--- a/README.md
+++ b/README.md
@@ -279,3 +279,4 @@ problems from
 * [Day 270](https://github.com/vaskoz/dailycodingproblem-go/issues/548)
 * [Day 271](https://github.com/vaskoz/dailycodingproblem-go/issues/553)
 * [Day 272](https://github.com/vaskoz/dailycodingproblem-go/issues/555)
+* [Day 273](https://github.com/vaskoz/dailycodingproblem-go/issues/556)
diff --git a/day273/problem.go b/day273/problem.go
new file mode 100644
index 0000000..777c553
--- /dev/null
+++ b/day273/problem.go
@@ -0,0 +1,28 @@
+package day273
+
+import "errors"
+
+var errNoFixedPoint = errors.New("no fixed point found")
+
+// ErrNoFixedPoint returns the error associated with no fixed point in the input.
+func ErrNoFixedPoint() error {
+	return errNoFixedPoint
+}
+
+// FindFixedPoint returns the fixed point number/index if it exists.
+// Otherwise, it returns an error if it doesn't exist.
+// Runs in O(log N) time and O(1) space.
+func FindFixedPoint(sorted []int) (int, error) {
+	left, right := 0, len(sorted)
+	for left < right {
+		switch mid := (left + right) / 2; {
+		case mid == sorted[mid]:
+			return mid, nil
+		case mid < sorted[mid]:
+			right = mid
+		default:
+			left = mid
+		}
+	}
+	return 0, errNoFixedPoint
+}


Test patch:
diff --git a/day273/problem_test.go b/day273/problem_test.go
new file mode 100644
index 0000000..a9413b4
--- /dev/null
+++ b/day273/problem_test.go
@@ -0,0 +1,31 @@
+package day273
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	sorted      []int
+	expected    int
+	expectedErr error
+}{
+	{[]int{-6, 0, 2, 40}, 2, nil},
+	{[]int{1, 5, 7, 8}, 0, ErrNoFixedPoint()},
+	{[]int{-10, -1, 0, 3, 10, 11, 30, 50, 100}, 3, nil},
+}
+
+func TestFindFixedPoint(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result, err := FindFixedPoint(tc.sorted); result != tc.expected || err != tc.expectedErr {
+			t.Errorf("Expected (%v,%v), got (%v,%v)", tc.expected, tc.expectedErr, result, err)
+		}
+	}
+}
+
+func BenchmarkFindFixedPoint(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			FindFixedPoint(tc.sorted)
+		}
+	}
+}