PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: Yoctol/bottender (ts)
Issue: context.state should not reference to the initialState when create state 
Should deeply clone the `initialState` and assign it to `context.state`.
Pull request description: Fix initialState reference
should fix #163 

Patch:
diff --git a/src/context/Context.js b/src/context/Context.js
index 27ac5a34..ca1f1e94 100644
--- a/src/context/Context.js
+++ b/src/context/Context.js
@@ -1,6 +1,7 @@
 /* @flow */
 
 import warning from 'warning';
+import cloneDeep from 'lodash/cloneDeep';
 
 type Options = {|
   client: any,
@@ -32,7 +33,8 @@ export default class Context {
     this._initialState = initialState || {};
 
     if (this._session && !this._session._state) {
-      this._session._state = this._initialState;
+      const sess = this._session;
+      sess._state = cloneDeep(this._initialState);
     }
 
     this.response = {
@@ -109,7 +111,8 @@ export default class Context {
    */
   resetState(): void {
     if (this._session) {
-      this._session._state = this._initialState;
+      const sess = this._session;
+      sess._state = cloneDeep(this._initialState);
     } else {
       warning(
         false,


Test patch:
diff --git a/src/context/__tests__/Context.spec.js b/src/context/__tests__/Context.spec.js
index 070090c9..58105c23 100644
--- a/src/context/__tests__/Context.spec.js
+++ b/src/context/__tests__/Context.spec.js
@@ -43,6 +43,15 @@ describe('state', () => {
       expect(context.state).toEqual(initialState);
     });
 
+    it('should not reference to the initialState', () => {
+      const initialState = { a: 1 };
+
+      const { context } = setup({ initialState });
+
+      expect(context.state).toEqual(initialState);
+      expect(context.state).not.toBe(initialState);
+    });
+
     it('should not do initialize when state exists', () => {
       const state = { a: 1 };
 
@@ -101,6 +110,18 @@ describe('state', () => {
       expect(context.state).toEqual(initialState);
     });
 
+    it('should not reference to initialState', () => {
+      const state = { a: 2 };
+      const initialState = { a: 1 };
+
+      const { context } = setup({ session: { _state: state }, initialState });
+
+      context.resetState();
+
+      expect(context.state).toEqual(initialState);
+      expect(context.state).not.toBe(initialState);
+    });
+
     it('should call warning if dont have session', async () => {
       const { context } = setup({ session: false });
Repository: peak/s5cmd (go)
Issue: s5cmd ls --recursive ... prints error text to stdout
I am converting a workflow from s3cmd to s5cmd, and didn't notice that s5cmd doesn't support recursive.  I had redirected the `ls` to a file(for later processing with shell tools), and the script was failing(via set -e).  I would have expected an error to be printed to stderr, like any other tool, so I was initially confused.

If s5cmd detects an error with cmdline arguments, it should print the help text to stderr, not stdout.
Pull request description: write usage errors to stderr
Fixes #399. 

```
❯ ./s5cmd --recursive ls
Incorrect Usage: flag provided but not defined: -recursive
See 's5cmd --help' for usage
```

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4232db1..973f35d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
 #### Breaking changes
 - Dropped inline comment feature for `run` command. Previously s5cmd supported a command with an inline comment like `ls s3://bucket/object.gz  # inline comment`. ([#309](https://github.com/peak/s5cmd/issues/309))
 - Changed homebrew installation command on macOS. Users can install s5cmd via `brew install peak/tap/s5cmd`. ([#356](https://github.com/peak/s5cmd/issues/356))
+- Print usage errors to stderr instead of stdout and do not show help text on usage error. ([#399](https://github.com/peak/s5cmd/issues/399))
 
 #### Features
 - Added `sync` command to synchronize two given buckets, prefixes, or objects. ([#3](https://github.com/peak/s5cmd/issues/3))
diff --git a/command/app.go b/command/app.go
index 74ea2a1..f10a759 100644
--- a/command/app.go
+++ b/command/app.go
@@ -3,6 +3,7 @@ package command
 import (
 	"context"
 	"fmt"
+	"os"
 
 	cmpinstall "github.com/posener/complete/cmd/install"
 	"github.com/urfave/cli/v2"
@@ -111,6 +112,15 @@ var app = &cli.App{
 		parallel.Close()
 		log.Close()
 	},
+	OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error {
+		if err != nil {
+			_, _ = fmt.Fprintf(os.Stderr, "%s %s\n", "Incorrect Usage:", err.Error())
+			_, _ = fmt.Fprintf(os.Stderr, "See 's5cmd --help' for usage\n")
+			return err
+		}
+
+		return nil
+	},
 	Action: func(c *cli.Context) error {
 		if c.Bool("install-completion") {
 			if cmpinstall.IsInstalled(appName) {


Test patch:
diff --git a/e2e/app_test.go b/e2e/app_test.go
index c68d7ce..2b45a0c 100644
--- a/e2e/app_test.go
+++ b/e2e/app_test.go
@@ -101,3 +101,21 @@ func TestAppUnknownCommand(t *testing.T) {
 		0: equals(`ERROR "unknown-command": command not found`),
 	})
 }
+
+func TestUsageError(t *testing.T) {
+	t.Parallel()
+
+	_, s5cmd, cleanup := setup(t)
+	defer cleanup()
+
+	cmd := s5cmd("--recursive", "ls")
+	result := icmd.RunCmd(cmd)
+
+	result.Assert(t, icmd.Expected{ExitCode: 1})
+
+	assertLines(t, result.Stdout(), map[int]compareFunc{})
+	assertLines(t, result.Stderr(), map[int]compareFunc{
+		0: equals("Incorrect Usage: flag provided but not defined: -recursive"),
+		1: equals("See 's5cmd --help' for usage"),
+	})
+}
Repository: baianat/vee-validate (js)
Issue: Arabic numerals aren't considered numerals
#### Versions:
- VueJs: #.#.#
- Vee-Validate:

### Description:
when typing arabic numerals '٠١٢٣٤٥٦٧٨٩' in a field that has numerical validation it's not accepted.

I would appreciate it if someone knows a way around this.

Pull request description: feat: added arabic numerics to the numeric rule
This adds basic Arabic numeric support to the `numeric` rule

closes #695


Patch:
diff --git a/src/rules/numeric.js b/src/rules/numeric.js
index 323267db..6c22e4e6 100644
--- a/src/rules/numeric.js
+++ b/src/rules/numeric.js
@@ -1,9 +1,19 @@
+
+const ar = /^[٠١٢٣٤٥٦٧٨٩]+$/;
+const en = /^[0-9]+$/;
+
 const validate = (value) => {
+  const testValue = val => {
+    const strValue = String(val);
+
+    return en.test(strValue) || ar.test(strValue);
+  };
+
   if (Array.isArray(value)) {
-    return value.every(val => /^[0-9]+$/.test(String(val)));
+    return value.every(testValue);
   }
 
-  return /^[0-9]+$/.test(String(value));
+  return testValue(value);
 };
 
 export {


Test patch:
diff --git a/tests/unit/rules/numeric.js b/tests/unit/rules/numeric.js
index aab4de17..b8f1abbf 100644
--- a/tests/unit/rules/numeric.js
+++ b/tests/unit/rules/numeric.js
@@ -2,7 +2,9 @@ import { validate } from '@/rules/numeric';
 
 const valid = [
   '1234567890',
-  123
+  123,
+  '٠١٢٣٤',
+  '٠١٢٣٤٥٦٧٨٩'
 ];
 
 const invalid = [
@@ -18,7 +20,6 @@ const invalid = [
 ];
 
 test('validates that the string only contains numeric characters', () => {
-  expect.assertions(13);
   // valid.
   valid.forEach(value => expect(validate(value)).toBe(true));
   expect(validate(valid)).toBe(true);
Repository: pinojs/pino (js)
Issue: Invalid time value with prettyPrint and timestamp:false
> node app.js | pino

```
/myp/node_modules/pino/pretty.js:130
    return new Date(time).toISOString()

RangeError: Invalid time value
```

This happens when you set `prettyPrint` true (or pipe the output to pino without timestamps)
Pull request description: Make pretty() do not crash if there is no timestamp
Fixes #243

Patch:
diff --git a/pretty.js b/pretty.js
index 1cc6a54..87e6de2 100755
--- a/pretty.js
+++ b/pretty.js
@@ -105,8 +105,8 @@ function pretty (opts) {
     }
 
     line = (levelFirst)
-        ? asColoredLevel(value) + ' [' + asISODate(value.time) + ']'
-        : '[' + asISODate(value.time) + '] ' + asColoredLevel(value)
+        ? asColoredLevel(value) + ' ' + formatTime(value)
+        : formatTime(value, ' ') + asColoredLevel(value)
 
     line += ' ('
     if (value.name) {
@@ -130,6 +130,19 @@ function pretty (opts) {
     return new Date(time).toISOString()
   }
 
+  function formatTime (value, after) {
+    after = after || ''
+    try {
+      if (!value || !value.time) {
+        return ''
+      } else {
+        return '[' + asISODate(value.time) + ']' + after
+      }
+    } catch (_) {
+      return ''
+    }
+  }
+
   function asColoredLevel (value) {
     if (levelColors.hasOwnProperty(value.level)) {
       return levelColors[value.level](levels[value.level])


Test patch:
diff --git a/test/pretty.test.js b/test/pretty.test.js
index daa7274..fbb40d5 100644
--- a/test/pretty.test.js
+++ b/test/pretty.test.js
@@ -231,3 +231,21 @@ test('can be enabled via constructor with pretty configuration', function (t) {
     t.notEqual(actual.match(/^INFO.*h/), null)
   })
 })
+
+test('works without time', function (t) {
+  t.plan(4)
+  var prettier = pretty()
+  prettier.pipe(split(function (line) {
+    t.ok(line.match(/.*hello world$/), 'end of line matches')
+    t.ok(line.match(/^INFO.*/), 'includes level')
+    t.ok(line.indexOf('' + process.pid) > 0, 'includes pid')
+    t.ok(line.indexOf('' + hostname) > 0, 'includes hostname')
+    return line
+  }))
+
+  var instance = pino({
+    timestamp: null
+  }, prettier)
+
+  instance.info('hello world')
+})