PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: wheresrhys/fetch-mock (js)

Issue:
new `contains:` string matcher
For super concise serving of fixtures without having to include lots of generic bits of the url or having to resort to regex

`match:` might be a better choice of keyword, simply because it contains 3 fewer characters

Pull request:
Rhys/contains
Fixes #544 

Patch:
diff --git a/docs/docs/API/route/matcher.md b/docs/docs/API/route/matcher.md
index f640fb7..6165678 100644
--- a/docs/docs/API/route/matcher.md
+++ b/docs/docs/API/route/matcher.md
@@ -50,6 +50,12 @@ Match a url beginning with a string, e.g. `"begin:http://www.site.com"`
 
 Match a url ending with a string, e.g. `"end:.jpg"`
 
+### include:...
+
+`{String}`
+
+Match a url including a string, e.g. `"include:site.com/api"`
+
 ### path:...
 
 `{String}`
diff --git a/packages/fetch-mock/src/Matchers.ts b/packages/fetch-mock/src/Matchers.ts
index 0f9ced1..d71d8e0 100644
--- a/packages/fetch-mock/src/Matchers.ts
+++ b/packages/fetch-mock/src/Matchers.ts
@@ -9,6 +9,7 @@ import { normalizeHeaders, getPath, normalizeUrl } from './RequestUtils.js';
 export type URLMatcherObject = {
 	begin?: string;
 	end?: string;
+	include?: string;
 	glob?: string;
 	express?: string;
 	path?: string;
@@ -41,11 +42,15 @@ const stringMatchers: { [key: string]: UrlMatcherGenerator } = {
 	begin:
 		(targetString) =>
 		({ url }) =>
-			url.indexOf(targetString) === 0,
+			url.startsWith(targetString),
 	end:
 		(targetString) =>
 		({ url }) =>
-			url.substr(-targetString.length) === targetString,
+			url.endsWith(targetString),
+	include:
+		(targetString) =>
+		({ url }) =>
+			url.includes(targetString),
 
 	glob: (targetString) => {
 		const urlRX = glob(targetString);


Test patch:
diff --git a/packages/fetch-mock/src/__tests__/Matchers/url.test.js b/packages/fetch-mock/src/__tests__/Matchers/url.test.js
index cd814e5..9088613 100644
--- a/packages/fetch-mock/src/__tests__/Matchers/url.test.js
+++ b/packages/fetch-mock/src/__tests__/Matchers/url.test.js
@@ -47,6 +47,19 @@ describe('url matching', () => {
 		expect(route.matcher({ url: 'http://b.com/path' })).toBe(true);
 	});
 
+	it('match include: keyword', () => {
+		const route = new Route({
+			url: 'include:m/p',
+			response: 200,
+		});
+
+		expect(route.matcher({ url: 'http://a.com/path' })).toBe(true);
+		expect(route.matcher({ url: 'http://a.com/ram/path' })).toBe(true);
+		expect(route.matcher({ url: 'http://a.com/p' })).toBe(true);
+		expect(route.matcher({ url: 'http://a.com/P' })).toBe(false);
+		expect(route.matcher({ url: 'http://a.com/ramp' })).toBe(false);
+	});
+
 	it('match glob: keyword', () => {
 		const route = new Route({ url: 'glob:/its/*/*', response: 200 });
 		expect(route.matcher({ url: '/its/alive' })).toBe(false);
Repository: apostrophecms/sanitize-html (js)

Issue:
Nullish HTML input should return an empty string.
## The problem to solve

Discussed in #102. Undefined or null input returns 'undefined' and 'null' strings.

## Proposed solution

We return an empty string if the input is nullish

## Alternatives

We could also throw an error in that case, making it the responsibility of the application using sanitize-html to ensure input isn't nullish. I'm not sure there's enough downside to the proposed solution to pass the buck, though.

Pull request:
Fix #486: Return an empty string when input is a nullish HTML
Note that nullish values also include 0, but according to [this comment](https://github.com/apostrophecms/sanitize-html/pull/102#issuecomment-872242667) of a repo member: 
> In any case it is up to the caller to pass a string.

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9426675..538cd7d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
 # Changelog
 
+## 2.5.2:
+- Nullish HTML input now returns an empty string. Nullish value may be explicit `null`, `undefined` or implicit `undefined` when value is not provided.
+
 ## 2.5.1 (2021-09-14):
 - The `allowedScriptHostnames` and `allowedScriptDomains` options now implicitly purge the inline content of all script tags, not just those with `src` attributes. This behavior was already strongly implied by the fact that they purged it in the case where a `src` attribute was actually present, and is necessary for the feature to provide any real security. Thanks to Grigorii Duca for pointing out the issue.
 
diff --git a/index.js b/index.js
index fa3cf6f..e8ace0c 100644
--- a/index.js
+++ b/index.js
@@ -81,6 +81,10 @@ const VALID_HTML_ATTRIBUTE_NAME = /^[^\0\t\n\f\r /<=>]+$/;
 // https://github.com/fb55/htmlparser2/issues/105
 
 function sanitizeHtml(html, options, _recursing) {
+  if (html == null) {
+    return '';
+  }
+
   let result = '';
   // Used for hot swapping the result variable with an empty string in order to "capture" the text written to it.
   let tempResult = '';


Test patch:
diff --git a/test/test.js b/test/test.js
index 833fe5e..94b254c 100644
--- a/test/test.js
+++ b/test/test.js
@@ -43,6 +43,18 @@ describe('sanitizeHtml', function() {
   it('should respect text nodes at top level', function() {
     assert.equal(sanitizeHtml('Blah blah blah<p>Whee!</p>'), 'Blah blah blah<p>Whee!</p>');
   });
+  it('should return an empty string when input is explicit "undefined"', function() {
+    assert.equal(sanitizeHtml(undefined), '');
+  });
+  it('should return an empty string when input is explicit "null"', function() {
+    assert.equal(sanitizeHtml(null), '');
+  });
+  it('should return an empty string when input is not provided', function() {
+    assert.equal(sanitizeHtml(), '');
+  });
+  it('should return an empty string when input is an empty string', function() {
+    assert.equal(sanitizeHtml(''), '');
+  });
   it('should reject markup not allowlisted without destroying its text', function() {
     assert.equal(sanitizeHtml('<div><wiggly>Hello</wiggly></div>'), '<div>Hello</div>');
   });
Repository: gokcehan/lf (go)

Issue:
directories no longer bolded
```
~ $ lf -version 
34.r5.g7797ad6 
```

after updating today the only directories that are bolded are the ones with 777 permissions, where as previously all were bolded. presumably this is caused by one of the commits from feb 9?

Pull request:
Handle leading zeros in SGR escape sequences
- Fixes #1911

Patch:
diff --git a/colors.go b/colors.go
index 69c5bb1..54e5b21 100644
--- a/colors.go
+++ b/colors.go
@@ -103,8 +103,8 @@ func applyAnsiCodes(s string, st tcell.Style) tcell.Style {
 	//    Probably because this is used for previewers too
 	tokslen := len(toks)
 	for i := 0; i < tokslen; i++ {
-		switch toks[i] {
-		case "", "0":
+		switch strings.TrimLeft(toks[i], "0") {
+		case "":
 			st = tcell.StyleDefault
 		case "1":
 			st = st.Bold(true)


Test patch:
diff --git a/colors_test.go b/colors_test.go
index e7e62e1..8085ce1 100644
--- a/colors_test.go
+++ b/colors_test.go
@@ -53,6 +53,9 @@ func TestApplyAnsiCodes(t *testing.T) {
 		{"1;31", none, none.Foreground(tcell.ColorMaroon).Bold(true)},
 		{"1;31", none.Foreground(tcell.ColorGreen), none.Foreground(tcell.ColorMaroon).Bold(true)},
 
+		{"01;31", none, none.Foreground(tcell.ColorMaroon).Bold(true)},
+		{"01;31", none.Foreground(tcell.ColorGreen), none.Foreground(tcell.ColorMaroon).Bold(true)},
+
 		{"38;5;0", none, none.Foreground(tcell.ColorBlack)},
 		{"38;5;1", none, none.Foreground(tcell.ColorMaroon)},
 		{"38;5;8", none, none.Foreground(tcell.ColorGray)},
Repository: sjbarag/brs (js)

Issue:
RoRegex matchAll doesn't capture groups
`RoRegex#matchAll` currently doesn't capture any groups. [Link to the Brightscript docs](https://developer.roku.com/docs/references/brightscript/interfaces/ifregex.md#matchallstr-as-string-as-object) for expected behavior.

Pull request:
fix(stdlib): RoRegex captures groups
# Change Summary

Closes #562 

Patch:
diff --git a/src/brsTypes/components/RoRegex.ts b/src/brsTypes/components/RoRegex.ts
index e5da42f..31abba0 100644
--- a/src/brsTypes/components/RoRegex.ts
+++ b/src/brsTypes/components/RoRegex.ts
@@ -162,11 +162,16 @@ export class RoRegex extends BrsComponent implements BrsValue {
             }
             this.jsRegex = new RegExp(source, flags);
             let arr = [];
-            let matches: string[] | null;
+            let matches: RegExpExecArray | null;
 
             while ((matches = this.jsRegex.exec(str.value)) !== null) {
-                let item = new BrsString(matches[0] || "");
-                arr.push(new RoArray([item]));
+                arr.push(
+                    new RoArray(
+                        matches
+                            .filter((match) => match !== undefined)
+                            .map((match) => new BrsString(match))
+                    )
+                );
             }
             return new RoArray(arr);
         },


Test patch:
diff --git a/test/e2e/BrsComponents.test.js b/test/e2e/BrsComponents.test.js
index 3445453..1fd9257 100644
--- a/test/e2e/BrsComponents.test.js
+++ b/test/e2e/BrsComponents.test.js
@@ -288,6 +288,18 @@ describe("end to end brightscript functions", () => {
             "789",
             " ]",
             " ]",
+            "Matches with groups: [ ",
+            "[ ",
+            "abx",
+            ", ",
+            "bx",
+            " ]",
+            "[ ",
+            "aby",
+            ", ",
+            "by",
+            " ]",
+            " ]",
         ]);
     });
 
diff --git a/test/e2e/resources/components/roRegex.brs b/test/e2e/resources/components/roRegex.brs
index 1f1e703..6dbdea7 100644
--- a/test/e2e/resources/components/roRegex.brs
+++ b/test/e2e/resources/components/roRegex.brs
@@ -27,4 +27,11 @@ sub main()
 
     ' make sure we can call matchall multiple times without error.
     regex.matchall("123 456 789")
+
+    regex = createObject("roRegex", "a(b.)", "i")
+    matches = regex.matchall("abx abyz")
+    print "Matches with groups: [ "
+    print "[ " matches[0][0] ", " matches[0][1] " ]"
+    print "[ " matches[1][0] ", " matches[1][1] " ]"
+    print " ]"
 end sub
Repository: jpsim/Yams (swift)

Issue:
dump failed if there is a nil value
![image](https://user-images.githubusercontent.com/1251192/69246663-10c4bf80-0be4-11ea-9d55-842be8348590.png)
I am using Swift 5.1 and Xcode 11.2.1.

I try to debug the Yams, and it throw a error:
```swift
private func represent(_ value: Any) throws -> Node {
    if let string = value as? String {
        return Node(string)
    } else if let representable = value as? NodeRepresentable {
        return try representable.represented()
    }
    throw YamlError.representer(problem: "Failed to represent \(value)")  // -> print "Failed to represent nil"
}

extension Optional: NodeRepresentable {
    public func represented() throws -> Node {
        switch self {
        case let .some(wrapped):
            return try represent(wrapped)  // <-- The ALIAS's value hit this case, but it is nil. As it is a .some<nil>
        case .none:
            return Node("null", Tag(.null))
        }
    }
}
```

Is it a bug?

Pull request:
Fixes https://github.com/jpsim/Yams/issues/232

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a22d6a38..87d293ca 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -30,6 +30,10 @@
 
 ##### Bug Fixes
 
+* Fix `Yams.dump` when object contains a keyed null value.  
+  [JP Simard](https://github.com/jpsim)
+  [#232](https://github.com/jpsim/Yams/issues/232)
+
 * Fix a bug where `YAMLEncoder` would delay `Date`s by 1 second when encoding
   values with a `nanosecond` component greater than 999499997.  
   [Norio Nomura](https://github.com/norio-nomura)
diff --git a/Sources/Yams/Representer.swift b/Sources/Yams/Representer.swift
index 0beec59b..37f96f44 100644
--- a/Sources/Yams/Representer.swift
+++ b/Sources/Yams/Representer.swift
@@ -73,6 +73,13 @@ extension ScalarRepresentable {
     }
 }
 
+extension NSNull: ScalarRepresentable {
+    /// This value's `Node.scalar` representation.
+    public func represented() -> Node.Scalar {
+        return .init("null", Tag(.null))
+    }
+}
+
 extension Bool: ScalarRepresentable {
     /// This value's `Node.scalar` representation.
     public func represented() -> Node.Scalar {


Test patch:
diff --git a/Tests/YamsTests/RepresenterTests.swift b/Tests/YamsTests/RepresenterTests.swift
index 47e553ba..4829b479 100644
--- a/Tests/YamsTests/RepresenterTests.swift
+++ b/Tests/YamsTests/RepresenterTests.swift
@@ -106,7 +106,20 @@ class RepresenterTests: XCTestCase {
     }
 
     func testOptional() throws {
+        // Optional.none
         XCTAssertEqual(try Node(Int?.none), "null")
+
+        // Optional.some(.none)
+        XCTAssertEqual(try Node(Int??.some(nil)), "null")
+
+        // Keyed null - https://github.com/jpsim/Yams/issues/232
+        let keyedNullString = """
+            A: null
+
+            """
+        let keyedNullObject = try Yams.load(yaml: keyedNullString)
+        let keyedNullDump = try Yams.dump(object: keyedNullObject)
+        XCTAssertEqual(keyedNullDump, keyedNullString)
     }
 
     func testArray() throws {