PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: getkin/kin-openapi (go)

Issue:
Missing deprecated field in openapi v2
https://github.com/getkin/kin-openapi/blob/648d6b9a170b6162c79927aeba39bda2fe37386a/openapi2/openapi2.go#L147

For some reason the `deprecated` field is missing for the v2 operation struct.
Is it intentional?

Pull request:
fix: add deprecated field to openapi2.Operation
fixes #558 

Patch:
diff --git a/openapi2/openapi2.go b/openapi2/openapi2.go
index c504288..dcc5ddb 100644
--- a/openapi2/openapi2.go
+++ b/openapi2/openapi2.go
@@ -148,6 +148,7 @@ type Operation struct {
 	openapi3.ExtensionProps
 	Summary      string                 `json:"summary,omitempty" yaml:"summary,omitempty"`
 	Description  string                 `json:"description,omitempty" yaml:"description,omitempty"`
+	Deprecated   bool                   `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
 	ExternalDocs *openapi3.ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
 	Tags         []string               `json:"tags,omitempty" yaml:"tags,omitempty"`
 	OperationID  string                 `json:"operationId,omitempty" yaml:"operationId,omitempty"`
diff --git a/openapi2conv/openapi2_conv.go b/openapi2conv/openapi2_conv.go
index 387a05a..d34dd31 100644
--- a/openapi2conv/openapi2_conv.go
+++ b/openapi2conv/openapi2_conv.go
@@ -155,6 +155,7 @@ func ToV3Operation(doc2 *openapi2.T, components *openapi3.Components, pathItem *
 		OperationID:    operation.OperationID,
 		Summary:        operation.Summary,
 		Description:    operation.Description,
+		Deprecated:     operation.Deprecated,
 		Tags:           operation.Tags,
 		ExtensionProps: operation.ExtensionProps,
 	}
@@ -922,6 +923,7 @@ func FromV3Operation(doc3 *openapi3.T, operation *openapi3.Operation) (*openapi2
 		OperationID:    operation.OperationID,
 		Summary:        operation.Summary,
 		Description:    operation.Description,
+		Deprecated:     operation.Deprecated,
 		Tags:           operation.Tags,
 		ExtensionProps: operation.ExtensionProps,
 	}


Test patch:
diff --git a/openapi2conv/issue558_test.go b/openapi2conv/issue558_test.go
new file mode 100644
index 0000000..78661bf
--- /dev/null
+++ b/openapi2conv/issue558_test.go
@@ -0,0 +1,37 @@
+package openapi2conv
+
+import (
+	"testing"
+
+	"github.com/invopop/yaml"
+	"github.com/stretchr/testify/require"
+)
+
+func TestPR558(t *testing.T) {
+	spec := `
+swagger: '2.0'
+info:
+  version: 1.0.0
+  title: title
+paths:
+  /test:
+    get:
+      deprecated: true
+      parameters:
+      - in: body
+        schema:
+          type: object
+      responses:
+        '200':
+          description: description
+`
+	doc3, err := v2v3YAML([]byte(spec))
+	require.NoError(t, err)
+	require.NotEmpty(t, doc3.Paths["/test"].Get.Deprecated)
+	_, err = yaml.Marshal(doc3)
+	require.NoError(t, err)
+
+	doc2, err := FromV3(doc3)
+	require.NoError(t, err)
+	require.NotEmpty(t, doc2.Paths["/test"].Get.Deprecated)
+}
Repository: showdownjs/showdown (js)

Issue:
Strip more international punctuation characters from header ids in `ghCompatibleHeaderId` mode
GitHub currently strips the following extended punctuation characters when creating headers in markdown files, but Showdown does not.

- Inverted exclamation and question marks (`¡` and `¿`) - [used in Spanish](https://en.wikipedia.org/wiki/Inverted_question_and_exclamation_marks)
- Various full width punctuation marks (e.g. `？`, `：`...etc) - [used a lot in Japanese](https://en.wikipedia.org/wiki/Japanese_punctuation)

Evidence in this gist: https://gist.github.com/tunetheweb/ecbfed99663425a668748770568bdafb#some-header-with--chars

Seems an easy enough fix to add these so will submit a PR.



Pull request:
fix(subParsers): strip international punctuation from github headers
Fixes #949 

Patch:
diff --git a/src/subParsers/makehtml/heading.js b/src/subParsers/makehtml/heading.js
index 9ca040e..a4910b3 100644
--- a/src/subParsers/makehtml/heading.js
+++ b/src/subParsers/makehtml/heading.js
@@ -140,7 +140,7 @@ showdown.subParser('makehtml.heading.id', function (m, options, globals) {
       .replace(/¨D/g, '')
       // replace rest of the chars (&~$ are repeated as they might have been escaped)
       // borrowed from github's redcarpet (so they should produce similar results)
-      .replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, '')
+      .replace(/[&+$,\/:;=?@"#{}|^¨¿？：~\[\]`、゠＝…‥『』〝〟「」゠＝…‥\\*()｛｝（）［］【】%.。，¡!！'<>]/g, '')
       .toLowerCase();
   } else if (options.rawHeaderId) {
     title = title


Test patch:
diff --git a/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.html b/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.html
index ed34b7b..a63809a 100644
--- a/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.html
+++ b/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.html
@@ -1,3 +1,3 @@
 <h1 id="some-header">some header</h1>
-<h1 id="some-header-with--chars">some header with &amp;+$,/:;=?@\"#{}|^~[]`\*()%.!' chars</h1>
+<h1 id="some-header-with--chars">some header with &amp;+$,/:;=?@\"#{}|^¨¿？：~[]`゠＝…‥『』〝〟「」\*()｛｝（）［］【】%.。，¡!！' chars</h1>
 <h1 id="another-header--with--chars">another header &gt; with &lt; chars</h1>
diff --git a/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.md b/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.md
index d547f42..773a5d6 100644
--- a/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.md
+++ b/test/functional/makehtml/cases/features/#320.github-compatible-generated-header-id.md
@@ -1,5 +1,5 @@
 # some header
 
-# some header with &+$,/:;=?@\"#{}|^~[]`\\*()%.!' chars
+# some header with &+$,/:;=?@\"#{}|^¨¿？：~[]`゠＝…‥『』〝〟「」\\*()｛｝（）［］【】%.。，¡!！' chars
 
 # another header > with < chars
Repository: jsonata-js/jsonata (js)

Issue:
$boolean(arg) when arg is no-match
Just a query. I wanted something that returns "true" if a arg path evaluates to truthy, and "false" if falsey or not found (no match).

data:
```
{
  "_formValues": {
    "test": true
  }
}
```

Jsonata expressiosn:

`$not(_formValues.test)` returns `false`
`$not(_formValues.test2)` returns `true`

But: 

`$boolean(_formValues.test)` returns `true`
`$boolean(_formValues.test2)` returns `*no match*`

I found it a bit inconsistent that a `$boolean(arg)` can return `*no match*`. Should it be returning `false` instead when hit against a *no match*? Or perhaps someone can explain why this is perfectly good and logical :)

Using: Jsonata 1.8.2 (as in the exerciser)

Pull request:
$not on empty sequence should return empty sequence
resolves #433 

Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>

Patch:
diff --git a/src/functions.js b/src/functions.js
index 9ba8d43..00a6b87 100644
--- a/src/functions.js
+++ b/src/functions.js
@@ -1433,6 +1433,11 @@ const functions = (() => {
      * @returns {boolean} - NOT arg
      */
     function not(arg) {
+        // undefined inputs always return undefined
+        if (typeof arg === 'undefined') {
+            return undefined;
+        }
+
         return !boolean(arg);
     }
 


Test patch:
diff --git a/test/test-suite/groups/boolean-expresssions/case027.json b/test/test-suite/groups/boolean-expresssions/case027.json
new file mode 100644
index 0000000..95f8404
--- /dev/null
+++ b/test/test-suite/groups/boolean-expresssions/case027.json
@@ -0,0 +1,6 @@
+{
+    "expr": "$not(nothing)",
+    "data": {},
+    "bindings": {},
+    "undefinedResult": true
+}
diff --git a/test/test-suite/groups/function-signatures/case001.json b/test/test-suite/groups/function-signatures/case001.json
index 6ffc064..a614397 100644
--- a/test/test-suite/groups/function-signatures/case001.json
+++ b/test/test-suite/groups/function-signatures/case001.json
@@ -2,5 +2,5 @@
     "expr": "λ($arg)<b:b>{$not($arg)}(foo)",
     "dataset": null,
     "bindings": {},
-    "result": true
-}
\ No newline at end of file
+    "undefinedResult": true
+}
Repository: goccy/go-json (go)

Issue:
`Unmarshal` fails when decoding `null` as string
`Unmarshal` fails when decoding `null` as string.
Referring to `encoding/json`, the expected result is an empty string.

## Reproduction code

https://play.golang.org/p/-mRPc-XSadc

```go
package main

import (
	"fmt"

	"github.com/goccy/go-json"
)

type Message struct {
	Field string `json:"field"`
}

func main() {
	ok := `{"field": "value"}`
	ng := `{"field": null}`
	
	for _, s := range []string{ok, ng} {
		var msg Message
		err := json.Unmarshal([]byte(s), &msg)
		if err != nil {
			panic(err) // panics for `ng`
		}
		fmt.Println(msg)
	}
}
```

Pull request:
Fix null in string type
fix #5 

Patch:
diff --git a/decode_string.go b/decode_string.go
index 2c08153..2512271 100644
--- a/decode_string.go
+++ b/decode_string.go
@@ -135,7 +135,7 @@ func (d *stringDecoder) decodeByte(buf []byte, cursor int64) ([]byte, int64, err
 			if buf[cursor+3] != 'l' {
 				return nil, 0, errInvalidCharacter(buf[cursor+3], "null", cursor)
 			}
-			cursor += 5
+			cursor += 4
 			return []byte{}, cursor, nil
 		default:
 			goto ERROR


Test patch:
diff --git a/decode_test.go b/decode_test.go
index f4f7bfb..562f00c 100644
--- a/decode_test.go
+++ b/decode_test.go
@@ -135,6 +135,13 @@ func Test_Decoder(t *testing.T) {
 		assertEq(t, "struct.D.AA", 2, v.D.AA)
 		assertEq(t, "struct.D.BB", "world", v.D.BB)
 		assertEq(t, "struct.D.CC", true, v.D.CC)
+		t.Run("struct.null", func(t *testing.T) {
+			var v struct {
+				A string
+			}
+			assertErr(t, json.Unmarshal([]byte(`{"a":null}`), &v))
+			assertEq(t, "string is null", v.A, "")
+		})
 	})
 	t.Run("interface", func(t *testing.T) {
 		t.Run("number", func(t *testing.T) {
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 324
Good morning! Here's your coding interview problem for today.

This problem was asked by Amazon.

Consider the following scenario: there are `N` mice and `N` holes placed at integer points along a line. Given this, find a method that maps mice to holes such that the largest number of steps any mouse takes is minimized.

Each move consists of moving one mouse one unit to the left or right, and only one mouse can fit inside each hole.

For example, suppose the mice are positioned at `[1, 4, 9, 15]`, and the holes are located at `[10, -5, 0, 16]`. In this case, the best pairing would require us to send the mouse at `1` to the hole at `-5`, so our function should return `6`.

Pull request:
Day324
Resolves #658.

Patch:
diff --git a/README.md b/README.md
index f6b7e26..2970460 100644
--- a/README.md
+++ b/README.md
@@ -327,3 +327,4 @@ problems from
 * [Day 321](https://github.com/vaskoz/dailycodingproblem-go/issues/651)
 * [Day 322](https://github.com/vaskoz/dailycodingproblem-go/issues/654)
 * [Day 323](https://github.com/vaskoz/dailycodingproblem-go/issues/656)
+* [Day 324](https://github.com/vaskoz/dailycodingproblem-go/issues/658)
diff --git a/day324/problem.go b/day324/problem.go
new file mode 100644
index 0000000..d066114
--- /dev/null
+++ b/day324/problem.go
@@ -0,0 +1,27 @@
+package day324
+
+import "sort"
+
+// MostMouseSteps returns the most steps taken by the
+// mouse that needs to move the farthest.
+// Expects len(mice) == len(holes), otherwise panic.
+// Runs in O(N log N) time due to sorting both inputs.
+func MostMouseSteps(mice, holes []int) int {
+	if len(mice) != len(holes) {
+		panic("mice and holes lengths do not match")
+	}
+	sort.Ints(mice)
+	sort.Ints(holes)
+	n := len(mice)
+	var max int
+	for i := 0; i < n; i++ {
+		move := mice[i] - holes[i]
+		if move < 0 {
+			move = -move
+		}
+		if move > max {
+			max = move
+		}
+	}
+	return max
+}


Test patch:
diff --git a/day324/problem_test.go b/day324/problem_test.go
new file mode 100644
index 0000000..6cc8848
--- /dev/null
+++ b/day324/problem_test.go
@@ -0,0 +1,38 @@
+package day324
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	mice, holes []int
+	expected    int
+}{
+	{[]int{1, 4, 9, 15}, []int{10, -5, 0, 16}, 6},
+}
+
+func TestMostMouseSteps(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := MostMouseSteps(tc.mice, tc.holes); result != tc.expected {
+			t.Errorf("Expected %v, got %v", tc.expected, result)
+		}
+	}
+}
+
+func TestMostMouseStepsUnmatched(t *testing.T) {
+	t.Parallel()
+	defer func() {
+		if err := recover(); err == nil {
+			t.Errorf("Expected a panic from unmatched inputs")
+		}
+	}()
+	MostMouseSteps([]int{10}, []int{10, 20})
+}
+
+func BenchmarkMostMouseSteps(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			MostMouseSteps(tc.mice, tc.holes)
+		}
+	}
+}
Repository: alecthomas/kong (go)

Issue:
Support parsing integer literals
When typing a long integer number, using underscore characters between successive digits can improve readability. For instance, for the number `1000000000`, it becomes `1_000_000_000` with underscore characters. This is easy to read. This is also the format defined in the Go spec https://go.dev/ref/spec#Integer_literals

> For readability, an underscore character _ may appear after a base prefix or between successive digits; such underscores do not change the literal's value. 

Kong cannot parse an int string like `1_000`. It would return an error

```
expected a valid 64 bit int but got "10_000_000"
```

Pull request:
Support parsing integer literals
Resolve #528

Patch:
diff --git a/mapper.go b/mapper.go
index db3f24e..7e97836 100644
--- a/mapper.go
+++ b/mapper.go
@@ -387,7 +387,7 @@ func intDecoder(bits int) MapperFunc { //nolint: dupl
 		default:
 			return fmt.Errorf("expected an int but got %q (%T)", t, t.Value)
 		}
-		n, err := strconv.ParseInt(sv, 10, bits)
+		n, err := strconv.ParseInt(sv, 0, bits)
 		if err != nil {
 			return fmt.Errorf("expected a valid %d bit int but got %q", bits, sv)
 		}
@@ -416,7 +416,7 @@ func uintDecoder(bits int) MapperFunc { //nolint: dupl
 		default:
 			return fmt.Errorf("expected an int but got %q (%T)", t, t.Value)
 		}
-		n, err := strconv.ParseUint(sv, 10, bits)
+		n, err := strconv.ParseUint(sv, 0, bits)
 		if err != nil {
 			return fmt.Errorf("expected a valid %d bit uint but got %q", bits, sv)
 		}


Test patch:
diff --git a/mapper_test.go b/mapper_test.go
index 947f836..dd04119 100644
--- a/mapper_test.go
+++ b/mapper_test.go
@@ -395,6 +395,31 @@ func TestNumbers(t *testing.T) {
 			I64: math.MinInt64,
 		}, cli)
 	})
+	t.Run("Integer literals", func(t *testing.T) {
+		integerLiterals := "10_0"
+
+		_, err := p.Parse([]string{
+			fmt.Sprintf("--i-8=%s", integerLiterals),
+			fmt.Sprintf("--i-16=%s", integerLiterals),
+			fmt.Sprintf("--i-32=%s", integerLiterals),
+			fmt.Sprintf("--i-64=%s", integerLiterals),
+			fmt.Sprintf("--u-8=%s", integerLiterals),
+			fmt.Sprintf("--u-16=%s", integerLiterals),
+			fmt.Sprintf("--u-32=%s", integerLiterals),
+			fmt.Sprintf("--u-64=%s", integerLiterals),
+		})
+		assert.NoError(t, err)
+		assert.Equal(t, CLI{
+			I8:  int8(100),
+			I16: int16(100),
+			I32: int32(100),
+			I64: int64(100),
+			U8:  uint8(100),
+			U16: uint16(100),
+			U32: uint32(100),
+			U64: uint64(100),
+		}, cli)
+	})
 }
 
 func TestJSONLargeNumber(t *testing.T) {