PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: yargs/yargs (js)
Issue: The updateStrings() could not work on 'Options:' 
```
   .updateStrings({
        command: chalk.cyan('command'),
        'Examples:': cyanUnderline('Examples:'),
        'Commands:': cyanUnderline('Commands:'),
        'Options:': cyanUnderline('Options:'),
        'Invalid values:': `${chalk.bgBlack.red('ERR! ')}${chalk.bold('Invalid values:')}`,
      })
```
the `Options:` location update can't work correctly.  cause of 
```
  // below line is always execute before  updateStrings();
  const defaultGroup = __('Options:')
  self.help = function help () {
```
while we show help like `cmd -h` the defaultGroup has been initialized earlier that updateLocale().

it's bug?     `BTW  yargs v15.1.0  works fine.`
Pull request description: fix(usage): translate 'options' group only when displaying help
To allow modifying its translation with `updateLocale`/`updateStrings`.

Fixes #1598

Patch:
diff --git a/lib/usage.js b/lib/usage.js
index a1df774..308bc82 100644
--- a/lib/usage.js
+++ b/lib/usage.js
@@ -146,7 +146,6 @@ module.exports = function usage (yargs, y18n) {
   const deferY18nLookupPrefix = '__yargsString__:'
   self.deferY18nLookup = str => deferY18nLookupPrefix + str
 
-  const defaultGroup = __('Options:')
   self.help = function help () {
     if (cachedHelpMessage) return cachedHelpMessage
     normalizeAliases()
@@ -245,8 +244,9 @@ module.exports = function usage (yargs, y18n) {
 
     // populate 'Options:' group with any keys that have not
     // explicitly had a group set.
+    const defaultGroup = __('Options:')
     if (!groups[defaultGroup]) groups[defaultGroup] = []
-    addUngroupedKeys(keys, options.alias, groups)
+    addUngroupedKeys(keys, options.alias, groups, defaultGroup)
 
     // display 'Options:' table along with any custom tables:
     Object.keys(groups).forEach((groupName) => {
@@ -433,7 +433,7 @@ module.exports = function usage (yargs, y18n) {
 
   // given a set of keys, place any keys that are
   // ungrouped under the 'Options:' grouping.
-  function addUngroupedKeys (keys, aliases, groups) {
+  function addUngroupedKeys (keys, aliases, groups, defaultGroup) {
     let groupedKeys = []
     let toCheck = null
     Object.keys(groups).forEach((group) => {


Test patch:
diff --git a/test/yargs.js b/test/yargs.js
index 76f206a..3114657 100644
--- a/test/yargs.js
+++ b/test/yargs.js
@@ -776,6 +776,20 @@ describe('yargs dsl tests', () => {
         r.logs.join(' ').should.match(/COMMANDS!/)
       })
 
+      it('also works on default option group', () => {
+        const r = checkOutput(() => {
+          yargs(['-h'])
+            .help('h')
+            .wrap(null)
+            .updateLocale({
+              'Options:': 'OPTIONS!'
+            })
+            .parse()
+        })
+
+        r.logs.join(' ').should.match(/OPTIONS!/)
+      })
+
       it('allows you to use updateStrings() as an alias for updateLocale()', () => {
         const r = checkOutput(() => {
           yargs(['snuh', '-h'])
Repository: spatie/laravel-permission (php)
Issue: Can no longer delete permissions returned by "findByName"
### Description

Before when doing:
$permission = Permission::findByName($name, $guardName);

And then calling:
$permission->delete()

The permission would be correct deleted.

Now this no longer happens because the "$exists" property on the permission model being false instead of true.

This behavior has changed since version 6.10.0, worked fine in 6.9.0.

### Steps To Reproduce

1. $permission = Permission::findByName($name, $guardName);
2. $permission->delete()
3. Notice the permission is not deleted.



### Example Application

_No response_

### Version of spatie/laravel-permission package:

6.10.0

### Version of laravel/framework package:

11.30.0

### PHP version:

8.3

### Database engine and version:

singlestore

### OS: Windows/Mac/Linux version:

Ubuntu
Pull request description: Fix: #2749 bug "Can no longer delete permissions"
[Illuminate/Database/Eloquent/Model.php#L615-L619](https://github.com/laravel/framework/blob/37f96f1d6b515f55ea7dfef144fd41519cca38b6/src/Illuminate/Database/Eloquent/Model.php#L615-L619)
```php
public function newInstance($attributes = [], $exists = false)
{
// This method just provides a convenient way for us to generate fresh model
// instances of this current model. It is particularly useful during the
// hydration of new objects via the Eloquent query builder instances.
```

- `newInstance` was removed on #2749
- Closes #2758

Patch:
diff --git a/src/PermissionRegistrar.php b/src/PermissionRegistrar.php
index 643ed92..cc2e1ca 100644
--- a/src/PermissionRegistrar.php
+++ b/src/PermissionRegistrar.php
@@ -349,7 +349,7 @@ class PermissionRegistrar
 
     private function getHydratedPermissionCollection(): Collection
     {
-        $permissionInstance = new ($this->getPermissionClass())();
+        $permissionInstance = (new ($this->getPermissionClass())())->newInstance([], true);
 
         return Collection::make(array_map(
             fn ($item) => (clone $permissionInstance)
@@ -368,7 +368,7 @@ class PermissionRegistrar
 
     private function hydrateRolesCache(): void
     {
-        $roleInstance = new ($this->getRoleClass())();
+        $roleInstance = (new ($this->getRoleClass())())->newInstance([], true);
 
         array_map(function ($item) use ($roleInstance) {
             $role = (clone $roleInstance)


Test patch:
diff --git a/tests/PermissionTest.php b/tests/PermissionTest.php
index b230945..d436457 100644
--- a/tests/PermissionTest.php
+++ b/tests/PermissionTest.php
@@ -67,4 +67,15 @@ class PermissionTest extends TestCase
 
         $this->assertEquals($this->testUserPermission->id, $permission_by_id->id);
     }
+
+    /** @test */
+    public function it_can_delete_hydrated_permissions()
+    {
+        $this->reloadPermissions();
+
+        $permission = app(Permission::class)->findByName($this->testUserPermission->name);
+        $permission->delete();
+
+        $this->assertCount(0, app(Permission::class)->where($this->testUserPermission->getKeyName(), $this->testUserPermission->getKey())->get());
+    }
 }