PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: python-attrs/attrs (python)
Issue: @attr.define fails to auto-detect __eq__
`@attr.define` is failing to auto-detect `__eq__`. My understanding from the docs is that this _should_ work, but `ValueError` is not being raised unless I use `@attr.define(eq=False)`.

```python
import attr

@attr.define
class Treatment:
    treatment: str

    def __eq__(self, other):
        raise ValueError


assert Treatment("foo") == "foo"
```

```console
$ pytest t.py
================================ test session starts ================================
platform darwin -- Python 3.8.5, pytest-6.0.1, py-1.8.2, pluggy-0.13.1
rootdir: /Users/andy/tmp
plugins: Faker-4.1.1
collected 0 items / 1 error                                                         

====================================== ERRORS =======================================
_______________________________ ERROR collecting t.py _______________________________
t.py:11: in <module>
    assert Treatment("foo") == "foo"
E   AssertionError: assert Treatment(treatment='foo') == 'foo'
E    +  where Treatment(treatment='foo') = <class 't.Treatment'>('foo')
============================== short test summary info ==============================
ERROR t.py - AssertionError: assert Treatment(treatment='foo') == 'foo'
!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!
```
Pull request description: Fix auto-detection of eq/ne in NG APIs
By setting eq to True by default, it forces `__eq__`/`__ne__` to be written. Setting to None fixes it.

fixes #670

Patch:
diff --git a/src/attr/_next_gen.py b/src/attr/_next_gen.py
index b0aefe3..57e8635 100644
--- a/src/attr/_next_gen.py
+++ b/src/attr/_next_gen.py
@@ -28,7 +28,7 @@ def define(
     kw_only=False,
     cache_hash=False,
     auto_exc=True,
-    eq=True,
+    eq=None,
     order=False,
     auto_detect=True,
     getstate_setstate=None,


Test patch:
diff --git a/tests/test_next_gen.py b/tests/test_next_gen.py
index e350498..a4460b1 100644
--- a/tests/test_next_gen.py
+++ b/tests/test_next_gen.py
@@ -133,3 +133,18 @@ class TestNextGen:
 
         with pytest.raises(attr.exceptions.FrozenInstanceError):
             f.x = 2
+
+    def test_auto_detect_eq(self):
+        """
+        auto_detect=True works for eq.
+
+        Regression test for #670.
+        """
+
+        @attr.define
+        class C:
+            def __eq__(self, o):
+                raise ValueError()
+
+        with pytest.raises(ValueError):
+            C() == C()
Repository: timothycrosley/isort (python)
Issue: Might create blank line at start of file with comments
Running `isort --diff` with the following will add a blank line at the start:
```python
# comment
import os
# comment2
import sys
```

```diff
@@ -1,4 +1,5 @@
+
+import os
 # comment
-import os
 # comment2
 import sys
```

The result then looks like this:
```python

import os
# comment
# comment2
import sys
```
Pull request description: Fix issue #889: Isort should not add blank lines to beginning of file
Closes #889 

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c5826060..93d09a4a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,8 @@ Changelog
 ### 4.3.13 - March 6, 2019 - hot fix release
 - Fixed the inability to accurately determine import section when a mix of conda and virtual environments are used.
 - Fixed some output being printed even when --quiet mode is enabled.
-- Fixed issue #890 interoperability with PyCharm by allowing case sensitive non type grouped sorting
+- Fixed issue #890 interoperability with PyCharm by allowing case sensitive non type grouped sorting.
+- Fixed issue #889 under some circumstances isort will incorrectly add a new line at the beginning of a file.
 
 ### 4.3.12 - March 6, 2019 - hot fix release
 - Fix error caused when virtual environment not detected
diff --git a/isort/isort.py b/isort/isort.py
index 22e5d019..fa55dcca 100644
--- a/isort/isort.py
+++ b/isort/isort.py
@@ -993,7 +993,7 @@ class SortImports(object):
                                    'isort:imports-' not in last):
                                 self.comments['above']['straight'].setdefault(module, []).insert(0,
                                                                                                  self.out_lines.pop(-1))
-                                if len(self.out_lines) > 0:
+                                if len(self.out_lines) > 0 and len(self.out_lines) != self._first_comment_index_end:
                                     last = self.out_lines[-1].rstrip()
                                 else:
                                     last = ""


Test patch:
diff --git a/test_isort.py b/test_isort.py
index c4b3c241..998f32c5 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -2866,3 +2866,11 @@ def test_ensure_support_for_non_typed_but_cased_alphabetic_sort_issue_890():
                        'from pkg import recorder\n')
     assert SortImports(file_contents=test_input, case_sensitive=True, order_by_type=False,
                        force_single_line=True).output == expected_output
+
+
+def test_to_ensure_empty_line_not_added_to_file_start_issue_889():
+    test_input = ('# comment\n'
+                  'import os\n'
+                  '# comment2\n'
+                  'import sys\n')
+    assert SortImports(file_contents=test_input).output == test_input
Repository: BenSampo/laravel-enum (php)
Issue: getDescription() throws error if value does not exist in v5
In v4, calling `getDescription()` with an incorrect value returns an empty string, but in v5 it throws an Error.

```
class MyEnum extends Enum {
   const MyValue = 'MyValue';
}
var_dump(MyEnum::getDescription('no'));
```

```
PHP Fatal error:  Uncaught Error: Call to a member function getAttributes() on bool in /project/vendor/bensampo/laravel-enum/src/Enum.php:406
Stack trace:
#0 /project/vendor/bensampo/laravel-enum/src/Enum.php(369): BenSampo\Enum\Enum::getAttributeDescription('no')
#1 /project/foo.php(12): BenSampo\Enum\Enum::getDescription('no')
#2 {main}
  thrown in /project/vendor/bensampo/laravel-enum/src/Enum.php on line 406
```
Pull request description: Fix getAttributeDescription() error
- [x] Added or updated tests
- [ ] Added or updated the [README.md](../README.md)
- [ ] Detailed changes in the [CHANGELOG.md](../CHANGELOG.md) unreleased section

**Related Issue/Intent**
Resolves #263

**Changes**
Calling `MyEnum::getDescription($value)` with an invalid value now returns an empty string, rather than throwing an error. This is in line with the behaviour in v4.

**Breaking changes**
N/A


Patch:
diff --git a/src/Enum.php b/src/Enum.php
index eefff9a..0e0244d 100644
--- a/src/Enum.php
+++ b/src/Enum.php
@@ -403,6 +403,9 @@ abstract class Enum implements EnumContract, Castable, Arrayable, JsonSerializab
         $reflection = self::getReflection();
         $constantName = static::getKey($value);
         $constReflection = $reflection->getReflectionConstant($constantName);
+        if ($constReflection === false) {
+            return null;
+        }
         $descriptionAttributes = $constReflection->getAttributes(Description::class);
 
         if (count($descriptionAttributes) === 1) {


Test patch:
diff --git a/tests/EnumAttributeDescriptionTest.php b/tests/EnumAttributeDescriptionTest.php
index fd3bc38..1784ef1 100644
--- a/tests/EnumAttributeDescriptionTest.php
+++ b/tests/EnumAttributeDescriptionTest.php
@@ -25,4 +25,9 @@ class EnumAttributeDescriptionTest extends TestCase
 
         DescriptionFromAttribute::InvalidCaseWithMultipleDescriptions()->description;
     }
+
+    public function test_an_exception_is_not_thrown_when_accessing_a_description_for_an_invalid_value()
+    {
+        $this->assertSame('', DescriptionFromAttribute::getDescription('invalid'));
+    }
 }