nebius/SWE-bench-extra huggingface dataset:
Repository: albertyw/git-reviewers

Issue:
Make git-reviewers work with commits that only add new files
Read reviewers from entire repository history

Comments:

Patch:
diff --git a/git_reviewers/reviewers.py b/git_reviewers/reviewers.py
index e4eee15..77ec78e 100755
--- a/git_reviewers/reviewers.py
+++ b/git_reviewers/reviewers.py
@@ -101,6 +101,18 @@ class FindLogReviewers(FindFileLogReviewers):
         """ Find the changed files between current status and master """
         git_diff_files_command = ['git', 'diff', 'master', '--name-only']
         git_diff_files = self.run_command(git_diff_files_command)
+        if not git_diff_files:
+            return FindHistoricalReviewers().get_changed_files()
+        return git_diff_files
+
+
+class FindHistoricalReviewers(FindFileLogReviewers):
+    def get_changed_files(self) -> List[str]:
+        """Find all git files """
+        git_diff_files_command = [
+            'git', 'ls-tree', '-r', 'master', '--name-only'
+        ]
+        git_diff_files = self.run_command(git_diff_files_command)
         return git_diff_files
 
 


Test patch:
diff --git a/git_reviewers/tests/test.py b/git_reviewers/tests/test.py
index 87e2df4..933ebd6 100644
--- a/git_reviewers/tests/test.py
+++ b/git_reviewers/tests/test.py
@@ -110,6 +110,27 @@ class TestLogReviewers(unittest.TestCase):
         files = self.finder.get_changed_files()
         self.assertEqual(files, ['README.rst', 'setup.py'])
 
+    @patch('git_reviewers.reviewers.FindHistoricalReviewers')
+    @patch('subprocess.run')
+    def test_no_diffs(self, mock_run, mock_historical):
+        process = MagicMock()
+        process.stdout = b''
+        mock_run.return_value = process
+        mock_historical().get_changed_files.return_value = ['asdf']
+        files = self.finder.get_changed_files()
+        self.assertEqual(files, ['asdf'])
+
+
+class TestHistoricalReviewers(unittest.TestCase):
+    def setUp(self):
+        self.finder = reviewers.FindHistoricalReviewers()
+
+    def test_get_changed_files(self):
+        changed_files = ['README.rst', 'setup.py']
+        self.finder.run_command = MagicMock(return_value=changed_files)
+        files = self.finder.get_changed_files()
+        self.assertEqual(files, ['README.rst', 'setup.py'])
+
 
 class TestFindArcCommitReviewers(unittest.TestCase):
     def setUp(self):
Repository: albumentations-team/albumentations

Issue:
No disable_shapes_check method of Compose class
## 🐛 Bug

The error message says "You can disable shapes check by calling disable_shapes_check method of Compose class.":

https://github.com/albumentations-team/albumentations/blob/57988c2091b72e67f37de0332b75d1772d28c651/albumentations/core/composition.py#L285-L290

But there's no ```disable_shapes_check``` method of Compose class.

Comments:

Patch:
diff --git a/albumentations/core/composition.py b/albumentations/core/composition.py
index 54f596c..dfc5e86 100644
--- a/albumentations/core/composition.py
+++ b/albumentations/core/composition.py
@@ -285,7 +285,7 @@ class Compose(BaseCompose):
         if self.is_check_shapes and shapes and shapes.count(shapes[0]) != len(shapes):
             raise ValueError(
                 "Height and Width of image, mask or masks should be equal. You can disable shapes check "
-                "by calling disable_shapes_check method of Compose class (do it only if you are sure "
+                "by setting a parameter is_check_shapes=False of Compose class (do it only if you are sure "
                 "about your data consistency)."
             )
 


Test patch:
diff --git a/tests/test_core.py b/tests/test_core.py
index 7fbcff6..5297304 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -429,7 +429,7 @@ def test_compose_image_mask_equal_size(targets):
 
     assert str(exc_info.value).startswith(
         "Height and Width of image, mask or masks should be equal. "
-        "You can disable shapes check by calling disable_shapes_check method "
+        "You can disable shapes check by setting a parameter is_check_shapes=False "
         "of Compose class (do it only if you are sure about your data consistency)."
     )
     # test after disabling shapes check
Repository: alephdata/followthemoney

Issue:
Better error handling regarding invalid domains in e-mail cleanup
I believe https://github.com/alephdata/ingest-file/issues/253 should be fixed here in `followthemoney`, because https://github.com/alephdata/followthemoney/blob/4b102568a3b3d13a8c4b34de4b7dc0f856a08b9c/followthemoney/types/email.py#L71 might [raise a UnicodeError](https://docs.python.org/3/library/stdtypes.html?highlight=encode#str.encode).

The suggested change: return `None` if a `UnicodeError` is raised.

Comments:

Patch:
diff --git a/followthemoney/types/email.py b/followthemoney/types/email.py
index 51052f28..275980a1 100644
--- a/followthemoney/types/email.py
+++ b/followthemoney/types/email.py
@@ -68,7 +68,10 @@ class EmailType(PropertyType):
         domain = domain.lower()
         domain = domain.rstrip(".")
         # handle unicode
-        domain = domain.encode("idna").decode("ascii")
+        try:
+            domain = domain.encode("idna").decode("ascii")
+        except UnicodeError:
+            return None
         if domain is not None and mailbox is not None:
             return "@".join((mailbox, domain))
         return None


Test patch:
diff --git a/tests/types/test_emails.py b/tests/types/test_emails.py
index 0c233e81..57d798b0 100644
--- a/tests/types/test_emails.py
+++ b/tests/types/test_emails.py
@@ -16,6 +16,18 @@ class EmailsTest(unittest.TestCase):
         self.assertEqual(emails.clean(5), None)
         self.assertEqual(emails.clean("foo@PUDO.org"), "foo@pudo.org")
         self.assertEqual(emails.clean("FOO@PUDO.org"), "FOO@pudo.org")
+        self.assertEqual(
+            emails.clean(
+                "foo@0123456789012345678901234567890123456789012345678901234567890.example.com"
+            ),
+            "foo@0123456789012345678901234567890123456789012345678901234567890.example.com",
+        )
+        self.assertEqual(
+            emails.clean(
+                "foo@0123456789012345678901234567890123456789012345678901234567890123.example.com"
+            ),
+            None,
+        )
 
     def test_domain_validity(self):
         self.assertTrue(emails.validate("foo@pudo.org"))
Repository: alexander-akhmetov/python-telegram

Issue:
[FeatureRequest] Add getUserFullInfo() support
In the TDLIB update event, there is only the 'sender_user_id' field and no other user identification. Currently, there is no way to get first and last names using python-telegram.
As far as I know, to get that information the client should use getUserFullInfo() method. Please, add it.

Comments:

Patch:
diff --git a/telegram/client.py b/telegram/client.py
index 9744d32..5a1ea27 100644
--- a/telegram/client.py
+++ b/telegram/client.py
@@ -227,6 +227,15 @@ class Telegram:
 
         return self.call_method('getUser', params={'user_id': user_id})
 
+    def get_user_full_info(self, user_id: int) -> AsyncResult:
+        """
+        Requests the full information about a user with id = user_id.
+
+        https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1get_user_full_info.html
+        """
+
+        return self.call_method('getUserFullInfo', params={'user_id': user_id})
+
     def get_chats(self, offset_order: int = 0, offset_chat_id: int = 0, limit: int = 100) -> AsyncResult:
         """
         Returns a list of chats:


Test patch:
diff --git a/tests/test_telegram_methods.py b/tests/test_telegram_methods.py
index 80e7954..e5d7229 100644
--- a/tests/test_telegram_methods.py
+++ b/tests/test_telegram_methods.py
@@ -201,6 +201,32 @@ class TestTelegram:
 
         telegram._tdjson.send.assert_called_once_with(exp_data)
 
+    def test_get_user(self, telegram):
+        user_id = 1
+
+        async_result = telegram.get_user(user_id=user_id)
+
+        exp_data = {
+            '@type': 'getUser',
+            'user_id': user_id,
+            '@extra': {'request_id': async_result.id},
+        }
+
+        telegram._tdjson.send.assert_called_once_with(exp_data)
+
+    def test_get_user_full_info(self, telegram):
+        user_id = 1
+
+        async_result = telegram.get_user_full_info(user_id=user_id)
+
+        exp_data = {
+            '@type': 'getUserFullInfo',
+            'user_id': user_id,
+            '@extra': {'request_id': async_result.id},
+        }
+
+        telegram._tdjson.send.assert_called_once_with(exp_data)
+
     def test_get_chat(self, telegram):
         chat_id = 1
Repository: alexander-akhmetov/python-telegram

Issue:
[Feature Request] Function to remove handler
Shouldn't be that complicated but would be nice to have.

Comments:

Patch:
diff --git a/telegram/client.py b/telegram/client.py
index 75b538d..a32387e 100644
--- a/telegram/client.py
+++ b/telegram/client.py
@@ -345,6 +345,16 @@ class Telegram:
         for handler in self._update_handlers[update_type]:
             self._workers_queue.put((handler, update), timeout=self._queue_put_timeout)
 
+    def remove_update_handler(self, handler_type: str, func: Callable) -> None:
+        """
+        Remove a handler with the specified type
+        """
+        try:
+            self._update_handlers[handler_type].remove(func)
+        except (ValueError, KeyError):
+            # not in the list
+            pass
+
     def add_message_handler(self, func: Callable) -> None:
         self.add_update_handler(MESSAGE_HANDLER_TYPE, func)
 


Test patch:
diff --git a/tests/test_telegram_methods.py b/tests/test_telegram_methods.py
index add7068..b019003 100644
--- a/tests/test_telegram_methods.py
+++ b/tests/test_telegram_methods.py
@@ -99,6 +99,29 @@ class TestTelegram:
 
         assert telegram._update_handlers[MESSAGE_HANDLER_TYPE] == [my_handler]
 
+    def test_remove_update_handler(self, telegram):
+        # check remove_update_handler
+        assert telegram._update_handlers[MESSAGE_HANDLER_TYPE] == []
+
+        def my_handler():
+            pass
+
+        telegram.add_message_handler(my_handler)
+
+        telegram.remove_update_handler(MESSAGE_HANDLER_TYPE, my_handler)
+
+        assert telegram._update_handlers[MESSAGE_HANDLER_TYPE] == []
+
+    def test_remove_update_handler_empty_handlers_list(self, telegram):
+        telegram._update_handlers = {}
+
+        def my_handler():
+            pass
+
+        telegram.remove_update_handler(MESSAGE_HANDLER_TYPE, my_handler)
+
+        assert telegram._update_handlers == {}
+
     def test_add_update_handler(self, telegram):
         # check that add_update_handler function
         # appends passsed func to _update_handlers[type] list