PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 395
Good morning! Here's your coding interview problem for today.

This problem was asked by Robinhood.

Given an array of strings, group anagrams together.

For example, given the following array:

`['eat', 'ate', 'apt', 'pat', 'tea', 'now']`
Return:
```
[['eat', 'ate', 'tea'],
 ['apt', 'pat'],
 ['now']]
```

Pull request:
Day395
Resolves #793.

Patch:
diff --git a/README.md b/README.md
index 43dc9ed..5b3d870 100644
--- a/README.md
+++ b/README.md
@@ -387,4 +387,5 @@ problems from
 * [Day 392](https://github.com/vaskoz/dailycodingproblem-go/issues/787)
 * [Day 393](https://github.com/vaskoz/dailycodingproblem-go/issues/789)
 * [Day 394](https://github.com/vaskoz/dailycodingproblem-go/issues/791)
+* [Day 395](https://github.com/vaskoz/dailycodingproblem-go/issues/793)
 
diff --git a/day395/problem.go b/day395/problem.go
new file mode 100644
index 0000000..f24a15c
--- /dev/null
+++ b/day395/problem.go
@@ -0,0 +1,35 @@
+package day395
+
+import "sort"
+
+// GroupByAnagram returns a slice of slices of strings
+// grouped by their anagrams.
+func GroupByAnagram(words []string) [][]string {
+	m := make(map[string][]string)
+	pos := make(map[string]int)
+	posI := 0
+
+	for _, word := range words {
+		ana := []rune(word)
+		sort.Slice(ana, func(i, j int) bool {
+			return ana[i] < ana[j]
+		})
+
+		anaKey := string(ana)
+
+		if _, seen := pos[anaKey]; !seen {
+			pos[anaKey] = posI
+			posI++
+		}
+
+		m[anaKey] = append(m[anaKey], word)
+	}
+
+	res := make([][]string, len(m))
+
+	for k, v := range m {
+		res[pos[k]] = v
+	}
+
+	return res
+}


Test patch:
diff --git a/day395/problem_test.go b/day395/problem_test.go
new file mode 100644
index 0000000..69dcf3a
--- /dev/null
+++ b/day395/problem_test.go
@@ -0,0 +1,39 @@
+package day395
+
+import (
+	"reflect"
+	"testing"
+)
+
+// nolint
+var testcases = []struct {
+	words    []string
+	expected [][]string
+}{
+	{
+		[]string{"eat", "ate", "apt", "pat", "tea", "now"},
+		[][]string{
+			{"eat", "ate", "tea"},
+			{"apt", "pat"},
+			{"now"},
+		},
+	},
+}
+
+func TestGroupByAnagram(t *testing.T) {
+	t.Parallel()
+
+	for _, tc := range testcases {
+		if res := GroupByAnagram(tc.words); !reflect.DeepEqual(res, tc.expected) {
+			t.Errorf("Expected %v, got %v", tc.expected, res)
+		}
+	}
+}
+
+func BenchmarkGroupByAnagram(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			GroupByAnagram(tc.words)
+		}
+	}
+}
Repository: hyperjumptech/monika (ts)

Issue:
Monika exits when connected to Symon with an empty probe
**Bug Description**
Monika exits when connected to Symon with an empty probe.

**To Reproduce**
Steps to reproduce the behavior:
1. Run Symon with an empty probe
2. Connect Monika to Symon

**Expected behavior**
Monika should run and wait until it receives new configuration.

**Screenshots**
![image](https://github.com/hyperjumptech/monika/assets/15191978/0751aca0-5ce4-4570-b811-657ba86015fc)

**Desktop Details:**
 - OS: Pop!_OS
 - Version: 22.04


Pull request:
Fix: Monika exits when connected to Symon with an empty probe
# Monika Pull Request (PR)

## What feature/issue does this PR add
Monika exits when connected to Symon with an empty probe. It will fix #1121.

## How did you implement / how did you fix it
Don't throw error when config is empty in Symon mode.

## How to test
1. Run Symon.
2. Run Monika in Symon mode.
3. Connect Monika through operator dashboard.
4. Assign to some probe.

## Video

https://github.com/hyperjumptech/monika/assets/15191978/666714a2-0c7a-4fb8-85a4-0fe61aa1f228



Patch:
diff --git a/src/components/config/index.ts b/src/components/config/index.ts
index 32a7dbc2..e22d376a 100644
--- a/src/components/config/index.ts
+++ b/src/components/config/index.ts
@@ -67,9 +67,17 @@ const defaultConfigs: Partial<Config>[] = []
 let nonDefaultConfig: Partial<Config>
 
 export const getConfig = (): Config => {
-  const { config } = getContext()
+  const { config, flags } = getContext()
 
-  if (!config) throw new Error('Configuration setup has not been run yet')
+  if (!config) {
+    if (!isSymonModeFrom(flags)) {
+      throw new Error('Configuration setup has not been run yet')
+    }
+
+    return {
+      probes: [],
+    }
+  }
 
   return config
 }


Test patch:
diff --git a/src/components/config/index.test.ts b/src/components/config/index.test.ts
index 1253227b..0ee026c7 100644
--- a/src/components/config/index.test.ts
+++ b/src/components/config/index.test.ts
@@ -29,6 +29,7 @@ import type { Config } from '../../interfaces/config'
 import events from '../../events'
 import { md5Hash } from '../../utils/hash'
 import { getEventEmitter } from '../../utils/events'
+import type { MonikaFlags } from '../../context/monika-flags'
 
 describe('getConfig', () => {
   afterEach(() => {
@@ -41,6 +42,19 @@ describe('getConfig', () => {
     )
   })
 
+  it('should return empty array when config is empty in Symon mode', () => {
+    // arrange
+    setContext({
+      flags: {
+        symonKey: 'bDF8j',
+        symonUrl: 'https://example.com',
+      } as MonikaFlags,
+    })
+
+    // act and assert
+    expect(getConfig()).deep.eq({ probes: [] })
+  })
+
   it('should return config', () => {
     // arrange
     const config = {
Repository: cypress-io/eslint-plugin-cypress (js)

Issue:
cy.focused().type("text") shows cypress/unsafe-to-chain-command error
After an update to 2.14.0, the  cypress/unsafe-to-chain-command rule is triggered by code as
`cy.focused().type("text")`.
This should be no problem however, as the cypress docu states `cy.focused() is a query, and it is safe to chain further commands` (https://docs.cypress.io/api/commands/focused)

Pull request:
fix: issue with unsafe to chain command that is not an action
On version v2.14.0 it seems there is a change in the **unsafe-to-chain-command** rule that causes the following issue:

https://github.com/cypress-io/eslint-plugin-cypress/issues/140

This is probably a quick fix on this without changing the Regex used by additional methods. The test covers the case where there is a command that is not considered an action for Cypress.

- closes #140

Patch:
diff --git a/lib/rules/unsafe-to-chain-command.js b/lib/rules/unsafe-to-chain-command.js
index 9fce903..712bef6 100644
--- a/lib/rules/unsafe-to-chain-command.js
+++ b/lib/rules/unsafe-to-chain-command.js
@@ -19,7 +19,7 @@ const unsafeToChainActions = [
   'check',
   'dblclick',
   'each',
-  'focus$',
+  'focus',
   'rightclick',
   'screenshot',
   'scrollIntoView',
@@ -130,7 +130,7 @@ const isRootCypress = (node) => {
  */
 const isActionUnsafeToChain = (node, additionalMethods = []) => {
   const unsafeActionsRegex = new RegExp([
-    ...unsafeToChainActions,
+    ...unsafeToChainActions.map((action) => `^${action}$`),
     ...additionalMethods.map((method) => method instanceof RegExp ? method.source : method),
   ].join('|'))
 


Test patch:
diff --git a/tests/lib/rules/unsafe-to-chain-command.js b/tests/lib/rules/unsafe-to-chain-command.js
index c79b8e6..470bebd 100644
--- a/tests/lib/rules/unsafe-to-chain-command.js
+++ b/tests/lib/rules/unsafe-to-chain-command.js
@@ -18,6 +18,10 @@ ruleTester.run('action-ends-chain', rule, {
       code: 'cy.focused().should("be.visible");',
       parserOptions,
     },
+    {
+      code: 'cy.submitBtn().click();',
+      parserOptions,
+    },
   ],
 
   invalid: [