PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: KaTeX/KaTeX (js)

Issue:
Error when rendering empty matrix
**Describe the bug:**
KaTeX errors when asked to render an empty matrix.

**To Reproduce:**
Attempt to render
```
\begin{bmatrix}
\end{bmatrix}
```
We get the error
```
o.body[0] is undefined
```

**Environment (please complete the following information):**
 - KaTeX Version: 0.13.10
 - Device: Desktop
 - OS: Linux
 - Browser: Firefox
 - Version: 88.0.1

**Additional context:**
Demo link:

https://katex.org/?data=%7B%22displayMode%22%3Atrue%2C%22leqno%22%3Afalse%2C%22fleqn%22%3Afalse%2C%22throwOnError%22%3Atrue%2C%22errorColor%22%3A%22%23cc0000%22%2C%22strict%22%3A%22warn%22%2C%22output%22%3A%22htmlAndMathml%22%2C%22trust%22%3Afalse%2C%22macros%22%3A%7B%22%5C%5Cf%22%3A%22%231f(%232)%22%7D%2C%22code%22%3A%22%5C%5Cbegin%7Bbmatrix%7D%5Cn%5C%5Cend%7Bbmatrix%7D%22%7D


Pull request:
fix: matrix environment with zero or inconsistent columns
Previously, the matrix family of environments assumed that the number of columns was given by the number of columns in the first row.
* This didn't work when there were zero rows (#3017)
* This didn't handle the case where future rows have more columns than the first (which is visible
when using an alignment other than `c`, such as `\begin{matrix*}[r]`).

This PR fixes both issues, and thereby fixes #3017.

Patch:
diff --git a/src/environments/array.js b/src/environments/array.js
index 6474b0b4..3feb589e 100644
--- a/src/environments/array.js
+++ b/src/environments/array.js
@@ -820,7 +820,8 @@ defineEnvironment({
         const res: ParseNode<"array"> =
             parseArray(context.parser, payload, dCellStyle(context.envName));
         // Populate cols with the correct number of column alignment specs.
-        res.cols = new Array(res.body[0].length).fill(
+        const numCols = Math.max(0, ...res.body.map((row) => row.length));
+        res.cols = new Array(numCols).fill(
             {type: "align", align: colAlign}
         );
         return delimiters ? {


Test patch:
diff --git a/test/katex-spec.js b/test/katex-spec.js
index 79127164..c926229b 100644
--- a/test/katex-spec.js
+++ b/test/katex-spec.js
@@ -1244,6 +1244,7 @@ describe("A begin/end parser", function() {
 
     it("should parse and build an empty environment", function() {
         expect`\begin{aligned}\end{aligned}`.toBuild();
+        expect`\begin{matrix}\end{matrix}`.toBuild();
     });
 
     it("should parse an environment with hlines", function() {
@@ -1310,6 +1311,13 @@ describe("A begin/end parser", function() {
         expect("\\begin{matrix*} a & -1 \\\\ -1 & d \\end{matrix*}").toBuild();
         expect("\\begin{matrix*}[] a & -1 \\\\ -1 & d \\end{matrix*}").not.toParse();
     });
+
+    it("should allow blank columns", () => {
+        const parsed = getParsed`\begin{matrix*}[r] a \\ -1 & d \end{matrix*}`;
+        expect(parsed[0].cols).toEqual(
+            [{type: 'align', align: 'r'},
+             {type: 'align', align: 'r'}]);
+    });
 });
 
 describe("A sqrt parser", function() {
Repository: frictionlessdata/tabulator-py (python)

Issue:
Format not recognised - Google spreadsheet exported as csv 
Tabulator is not able to work out the format for this url:
https://docs.google.com/spreadsheets/d/1shdLtpTEDuYFQHidGSQjSBw2sM0EQ34xD1lm7zyBUi4/export?format=csv&gid=0&single=true

However, it does recognise:
https://docs.google.com/spreadsheets/d/1kPO1CmPvc42j9TouovP5tyiSdegRk1wISLpxMWDlfaQ/pub?gid=0&single=true&output=csv

It seems it can parse pub?... but not export?... form of Google spreadsheet url.


Pull request:
Fixed gsheet export format detecting
- fixes #189 

Patch:
diff --git a/tabulator/helpers.py b/tabulator/helpers.py
index c17a025..5f1d2c2 100644
--- a/tabulator/helpers.py
+++ b/tabulator/helpers.py
@@ -35,8 +35,10 @@ def detect_scheme_and_format(source):
 
     # Format: gsheet
     if 'docs.google.com/spreadsheets' in source:
-        if 'export' not in source:
+        if 'export' not in source and 'pub' not in source:
             return (None, 'gsheet')
+        elif 'csv' in source:
+            return ('https', 'csv')
 
     # Format: sql
     for sql_scheme in config.SQL_SCHEMES:


Test patch:
diff --git a/tests/test_helpers.py b/tests/test_helpers.py
index ad18ec7..1c32175 100644
--- a/tests/test_helpers.py
+++ b/tests/test_helpers.py
@@ -30,6 +30,9 @@ from tabulator import helpers, config
     ('path', 'file', None),
     ('path.CsV', 'file', 'csv'),
     ('http://someplace.com/foo/path.csv?foo=bar#baz', 'http', 'csv'),
+    ('https://docs.google.com/spreadsheets/d/X/edit?usp=sharing', None, 'gsheet'),
+    ('https://docs.google.com/spreadsheets/d/X/export?format=csv&gid=0&single=true', 'https', 'csv'),
+    ('https://docs.google.com/spreadsheets/d/X/pub?gid=0&single=true&output=csv', 'https', 'csv'),
 ])
 def test_detect_scheme_and_format(source, scheme, format):
     assert helpers.detect_scheme_and_format(source) == (scheme, format)
Repository: JoshuaKGoldberg/tslint-to-eslint-config (ts)

Issue:
Explicit error message asking for an updated tslint version
### 🚀 Feature Request

Following #106: if a project has explicitly set their `tslint` dependency too low, they might still get the `unknown option '--print-config'` complaint.

#### Existing Behavior

Output from `npx tslint-to-eslint-config`:

```
❌ Could not start tslint-to-eslint: ❌
Command failed: tslint --print-config "./tslint.json"
error: unknown option `--print-config'
```

#### Change Proposal

If the error from TSLint is this very specific one, change it to:

```
❌ Could not start tslint-to-eslint: ❌
TSLint v5.18 required. Please update your version.
```

Pull request:
Added an explicit error message for TSLint versions too low
## PR Checklist

-   [x] Addresses an existing issue: fixes #120
-   [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/tslint-to-eslint-config/labels/status%3A%20accepting%20prs)

## Overview

If the TSLint error message contains a complaint that `--print-config` is outdated, this gives a better error message.

Patch:
diff --git a/src/input/findTSLintConfiguration.ts b/src/input/findTSLintConfiguration.ts
index 129be08..97962ff 100644
--- a/src/input/findTSLintConfiguration.ts
+++ b/src/input/findTSLintConfiguration.ts
@@ -29,10 +29,16 @@ export const findTSLintConfiguration = async (
         config || "./tslint.json",
     );
 
-    return rawConfiguration instanceof Error
-        ? rawConfiguration
-        : {
-              ...defaultTSLintConfiguration,
-              ...rawConfiguration,
-          };
+    if (rawConfiguration instanceof Error) {
+        if (rawConfiguration.message.includes("unknown option `--print-config")) {
+            return new Error("TSLint v5.18 required. Please update your version.");
+        }
+
+        return rawConfiguration;
+    }
+
+    return {
+        ...defaultTSLintConfiguration,
+        ...rawConfiguration,
+    };
 };


Test patch:
diff --git a/src/input/findTslintConfiguration.test.ts b/src/input/findTslintConfiguration.test.ts
index 3acbff3..a429a8f 100644
--- a/src/input/findTslintConfiguration.test.ts
+++ b/src/input/findTslintConfiguration.test.ts
@@ -18,6 +18,22 @@ describe("findTSLintConfiguration", () => {
         );
     });
 
+    it("replaces an error with a v5.18 request when the --print-config option is unsupported", async () => {
+        // Arrange
+        const stderr = "unknown option `--print-config";
+        const dependencies = { exec: createStubThrowingExec({ stderr }) };
+
+        // Act
+        const result = await findTSLintConfiguration(dependencies, undefined);
+
+        // Assert
+        expect(result).toEqual(
+            expect.objectContaining({
+                message: "TSLint v5.18 required. Please update your version.",
+            }),
+        );
+    });
+
     it("defaults the configuration file when one isn't provided", async () => {
         // Arrange
         const dependencies = { exec: createStubExec() };
Repository: liveshowy/webauthn_components (elixir)

Issue:
[BUG] - `disabled` assign not respected in `RegistrationComponent` 

Pull request:
Ensure `disabled` attr actually disables the button
Resolves #70 



Patch:
diff --git a/lib/webauthn_components/base_components.ex b/lib/webauthn_components/base_components.ex
index 4d311a0..bbfee54 100644
--- a/lib/webauthn_components/base_components.ex
+++ b/lib/webauthn_components/base_components.ex
@@ -13,7 +13,7 @@ defmodule WebauthnComponents.BaseComponents do
   @doc false
   def button(assigns) do
     ~H"""
-    <button id={@id} type={@type} {@rest}>
+    <button id={@id} type={@type} disabled={@disabled} {@rest}>
       <%= render_slot(@inner_block) %>
     </button>
     """
diff --git a/templates/live_views/authentication_live.html.heex b/templates/live_views/authentication_live.html.heex
index 57931da..72bab18 100644
--- a/templates/live_views/authentication_live.html.heex
+++ b/templates/live_views/authentication_live.html.heex
@@ -39,7 +39,7 @@
       <p>Sign into an existing account:</p>
 
       <.live_component
-        disabled={@form.source.valid? == false}
+        disabled={false}
         module={AuthenticationComponent}
         id="authentication-component"
         class={[


Test patch:
diff --git a/test/webauthn_components/registration_component_test.exs b/test/webauthn_components/registration_component_test.exs
index 5440bb4..fb21a45 100644
--- a/test/webauthn_components/registration_component_test.exs
+++ b/test/webauthn_components/registration_component_test.exs
@@ -11,7 +11,7 @@ defmodule WebauthnComponents.RegistrationComponentTest do
     {:ok, view, _html} = live_isolated_component(RegistrationComponent, assigns)
     live_assign(view, app: assigns.app, id: assigns.id)
     element = element(view, "##{assigns.id}")
-    %{view: view, element: element}
+    %{view: view, element: element, default_assigns: assigns}
   end
 
   describe "render/1" do
@@ -20,6 +20,22 @@ defmodule WebauthnComponents.RegistrationComponentTest do
     end
   end
 
+  describe "update/2" do
+    test "updates `disabled` assign", setup_attrs do
+      %{default_assigns: default_assigns} = setup_attrs
+      assigns = Map.merge(default_assigns, %{disabled: true})
+      {:ok, view, _html} = live_isolated_component(RegistrationComponent, assigns)
+      assert has_element?(view, "##{assigns.id}[disabled]")
+    end
+
+    test "is not `disabled` by default", setup_attrs do
+      %{default_assigns: assigns} = setup_attrs
+      {:ok, view, _html} = live_isolated_component(RegistrationComponent, assigns)
+      assert has_element?(view, "##{assigns.id}")
+      refute has_element?(view, "##{assigns.id}[disabled]")
+    end
+  end
+
   describe "handle_event/3 - register" do
     test "sends registration challenge to client", %{element: element, view: view} do
       webauthn_user = %WebauthnUser{