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

Issue:
Day 362
Good morning! Here's your coding interview problem for today.

This problem was asked by Twitter.

A strobogrammatic number is a positive number that appears the same after being rotated 180 degrees. For example, `16891` is strobogrammatic.

Create a program that finds all strobogrammatic numbers with `N` digits.

Pull request:
Day362
Resolves #714.

Patch:
diff --git a/README.md b/README.md
index 478ce59..953af36 100644
--- a/README.md
+++ b/README.md
@@ -343,3 +343,4 @@ problems from
 * [Day 359](https://github.com/vaskoz/dailycodingproblem-go/issues/708)
 * [Day 360](https://github.com/vaskoz/dailycodingproblem-go/issues/709)
 * [Day 361](https://github.com/vaskoz/dailycodingproblem-go/issues/712)
+* [Day 362](https://github.com/vaskoz/dailycodingproblem-go/issues/714)
diff --git a/day362/problem.go b/day362/problem.go
new file mode 100644
index 0000000..579ed5f
--- /dev/null
+++ b/day362/problem.go
@@ -0,0 +1,37 @@
+package day362
+
+import (
+	"fmt"
+	"sort"
+)
+
+// StrobogrammaticNumber returns all the strobogrammatic numbers
+// with the given number of digits.
+func StrobogrammaticNumber(digits int) []string {
+	result := strobogrammaticNumber(digits, digits)
+	sort.Strings(result) // for deterministic ordering of results
+	return result
+}
+
+func strobogrammaticNumber(digits, length int) []string {
+	if digits == 0 {
+		return nil
+	} else if digits == 1 {
+		return []string{"0", "1", "8"}
+	}
+	mid := strobogrammaticNumber(digits-2, length)
+	if mid == nil {
+		mid = []string{""}
+	}
+	result := make([]string, 0, len(mid)*5)
+	for _, m := range mid {
+		if digits != length {
+			result = append(result, fmt.Sprintf("0%s0", m))
+		}
+		result = append(result, fmt.Sprintf("1%s1", m))
+		result = append(result, fmt.Sprintf("6%s9", m))
+		result = append(result, fmt.Sprintf("8%s8", m))
+		result = append(result, fmt.Sprintf("9%s6", m))
+	}
+	return result
+}


Test patch:
diff --git a/day362/problem_test.go b/day362/problem_test.go
new file mode 100644
index 0000000..4d3c59e
--- /dev/null
+++ b/day362/problem_test.go
@@ -0,0 +1,36 @@
+package day362
+
+import (
+	"reflect"
+	"testing"
+)
+
+// nolint
+var testcases = []struct {
+	digits   int
+	expected []string
+}{
+	{0, nil},
+	{1, []string{"0", "1", "8"}},
+	{2, []string{"11", "69", "88", "96"}},
+	{3, []string{"101", "111", "181", "609", "619", "689", "808", "818", "888", "906", "916", "986"}},
+	{4, []string{"1001", "1111", "1691", "1881", "1961", "6009", "6119", "6699", "6889", "6969", "8008",
+		"8118", "8698", "8888", "8968", "9006", "9116", "9696", "9886", "9966"}},
+}
+
+func TestStrobogrammaticNumber(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := StrobogrammaticNumber(tc.digits); !reflect.DeepEqual(result, tc.expected) {
+			t.Errorf("Expected %v, got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkStrobogrammaticNumber(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			StrobogrammaticNumber(tc.digits)
+		}
+	}
+}
Repository: JuliaGPU/KernelAbstractions.jl (julia)

Issue:
Add Feature to Select Devices to Execute Kernels On
It would be great in a multi-device system, the device id that will run a KA kernel could be set through a function call.
cc: @vchuravy

Pull request:
Fixes #458

Minimal API proposal. Should we have a query for if the backends implement this?

Patch:
diff --git a/src/KernelAbstractions.jl b/src/KernelAbstractions.jl
index a9dc1ef2..086bdbef 100644
--- a/src/KernelAbstractions.jl
+++ b/src/KernelAbstractions.jl
@@ -586,6 +586,34 @@ function priority!(::Backend, prio::Symbol)
     return nothing
 end
 
+"""
+    device(::Backend)::Int
+
+Returns the ordinal number of the currently active device starting at one.
+"""
+function device(::Backend)
+    return 1
+end
+
+"""
+    ndevices(::Backend)::Int
+
+Returns the number of devices the backend supports.
+"""
+function ndevices(::Backend)
+    return 1
+end
+
+"""
+    device!(::Backend, id::Int)
+"""
+function device!(backend::Backend, id::Int)
+    if !(0 < id <= ndevices(backend))
+        throw(ArgumentError("Device id $id out of bounds."))
+    end
+    return nothing
+end
+
 """
     functional(::Backend)
 


Test patch:
diff --git a/test/devices.jl b/test/devices.jl
new file mode 100644
index 00000000..2dde4bb8
--- /dev/null
+++ b/test/devices.jl
@@ -0,0 +1,14 @@
+function devices_testsuite(Backend)
+    backend = Backend()
+
+    current_device = KernelAbstractions.device(backend)
+    for i in KernelAbstractions.ndevices(backend)
+        KernelAbstractions.device!(backend, i)
+        @test KernelAbstractions.device(backend) == i
+    end
+
+    @test_throws ArgumentError KernelAbstractions.device!(backend, 0)
+    @test_throws ArgumentError KernelAbstractions.device!(backend, KernelAbstractions.ndevices(backend) + 1)
+    KernelAbstractions.device!(backend, current_device)
+    return nothing
+end
diff --git a/test/testsuite.jl b/test/testsuite.jl
index a92cf73a..3828e4ef 100644
--- a/test/testsuite.jl
+++ b/test/testsuite.jl
@@ -31,6 +31,7 @@ include("private.jl")
 include("unroll.jl")
 include("nditeration.jl")
 include("copyto.jl")
+include("devices.jl")
 include("print_test.jl")
 include("compiler.jl")
 include("reflection.jl")
@@ -67,6 +68,10 @@ function testsuite(backend, backend_str, backend_mod, AT, DAT; skip_tests = Set{
         copyto_testsuite(backend, AT)
     end
 
+    @conditional_testset "Devices" skip_tests begin
+        devices_testsuite(backend)
+    end
+
     @conditional_testset "Printing" skip_tests begin
         printing_testsuite(backend)
     end
Repository: vuejs/composition-api (ts)

Issue:
beta22, the useCssModule did'nt adapt the change of getCurrentInstance.
vue version: 2.6.12
@vuejs/composition-api version: 1.0.0-beta.22

beta22, the `useCssModule` did'nt adapt the change of `getCurrentInstance`.
https://github.com/vuejs/composition-api/blob/4b2f1ab9405462da163089616829046b72d86dcb/src/apis/useCssModule.ts#L8-L23

```TypeScript
export const useCSSModule = (name = '$style'): Record<string, string> => {
  const instance = getCurrentInstance()
  if (!instance) {
    __DEV__ && warn(`useCSSModule must be called inside setup()`)
    return EMPTY_OBJ
  }

  const mod = (instance as any)[name]   //Here
  if (!mod) {
    __DEV__ &&
      warn(`Current instance does not have CSS module named "${name}".`)
    return EMPTY_OBJ
  }

  return mod as Record<string, string>
}
```
![image](https://user-images.githubusercontent.com/35187547/103393216-8e375f00-4b5c-11eb-923b-3f4b1c2b50b1.png)



Pull request:
fix: useCSSModule to adapt the change of getCurrentInstance, close #620
Fix useCSSModule to adapt the change of getCurrentInstance and add test for useCSSModule. #620 

Patch:
diff --git a/src/apis/useCssModule.ts b/src/apis/useCssModule.ts
index 368abd7..335c3d2 100644
--- a/src/apis/useCssModule.ts
+++ b/src/apis/useCssModule.ts
@@ -12,7 +12,7 @@ export const useCSSModule = (name = '$style'): Record<string, string> => {
     return EMPTY_OBJ
   }
 
-  const mod = (instance as any)[name]
+  const mod = (instance.proxy as any)?.[name]
   if (!mod) {
     __DEV__ &&
       warn(`Current instance does not have CSS module named "${name}".`)


Test patch:
diff --git a/test/apis/useCssModule.spec.js b/test/apis/useCssModule.spec.js
new file mode 100644
index 0000000..63c40a8
--- /dev/null
+++ b/test/apis/useCssModule.spec.js
@@ -0,0 +1,31 @@
+const Vue = require('vue/dist/vue.common.js')
+const { useCSSModule } = require('../../src')
+
+const style = { whateverStyle: 'whateverStyle' }
+
+function injectStyles() {
+  Object.defineProperty(this, '$style', {
+    configurable: true,
+    get: function () {
+      return style
+    },
+  })
+}
+
+describe('api/useCssModule', () => {
+  it('should get the same object', (done) => {
+    const vm = new Vue({
+      beforeCreate() {
+        injectStyles.call(this)
+      },
+      template: '<div>{{style}}</div>',
+      setup() {
+        const style = useCSSModule()
+        return { style }
+      },
+    })
+    vm.$mount()
+    expect(vm.style).toBe(style)
+    done()
+  })
+})
Repository: geoffrich/svelte-adapter-azure-swa (js)

Issue:
Dynamically determine node version
https://github.com/geoffrich/svelte-adapter-azure-swa/pull/47 updated the adapter to target Node 16 instead of 12. This is good, but it would be better if we could allow the user to specify which node version to use. Otherwise, they'll be tied to the adapter Node version.

Here's how adapter-vercel does it:

https://github.com/sveltejs/kit/blob/3dae8e702641b5ee762b1892b7b7aa90e1c19a7c/packages/adapter-vercel/index.js#L388-L399

Pull request:
feat: allow overriding `platform.apiRuntime`
Closes #48 

Instead of introducing a separate config option to set a custom node version, this PR allows setting `platform.apiRuntime` via `customStaticWebAppConfig`

e.g.

```js
// svelte.config.js
import adapter from 'svelte-adapter-azure-swa';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	kit: {
		adapter: adapter({
			customStaticWebAppConfig: {
				platform: {
					apiRuntime: 'node:18'
				}
			}
		})
	}
};

export default config;
```

Patch:
diff --git a/README.md b/README.md
index 306acdc..728aac6 100644
--- a/README.md
+++ b/README.md
@@ -165,6 +165,9 @@ export default {
 						'redirect': '/login',
 						'statusCode': 302
 					}
+				},
+				platform: {
+					apiRuntime: 'node:18'
 				}
 			}
 		})
diff --git a/index.js b/index.js
index 45c6969..c0ad9c0 100644
--- a/index.js
+++ b/index.js
@@ -210,7 +210,8 @@ export function generateConfig(customStaticWebAppConfig, appDir) {
 			rewrite: ssrFunctionRoute
 		},
 		platform: {
-			apiRuntime: 'node:16'
+			apiRuntime: 'node:16',
+			...customStaticWebAppConfig.platform
 		}
 	};
 


Test patch:
diff --git a/test/index.test.js b/test/index.test.js
index 8009c74..9711b1a 100644
--- a/test/index.test.js
+++ b/test/index.test.js
@@ -53,9 +53,13 @@ describe('generateConfig', () => {
 
 	test('accepts custom config', () => {
 		const result = generateConfig({
+			platform: {
+				apiRuntime: 'node:18'
+			},
 			globalHeaders: { 'X-Foo': 'bar' }
 		});
 		expect(result.globalHeaders).toStrictEqual({ 'X-Foo': 'bar' });
+		expect(result.platform.apiRuntime).toBe('node:18');
 	});
 });