nebius/SWE-bench-extra huggingface dataset:
Repository: joke2k/faker

Issue:
too long iban generated for pl-PL locale
* Faker version: 9.8.2
* OS: MacOs 12.0.1

IBANs generated for pl_PL locales are 30 characters long. This is too many. Valid PL IBAN should have 28 characters (including country code).

### Steps to reproduce
Generate a Polish IBAN with:
```
from faker import Faker
  fake=Faker('pl-PL')
  print(fake.iban())
```
Copy paste generated string into IBAN Validator at https://www.ibancalculator.com/
### Expected behavior

IBAN should have the correct length and checksum

### Actual behavior

There is an error message that IBAN have too many characters:
"This IBAN cannot be correct because of its length. A Polish IBAN always contains exactly 28 digits and letters ("PL", a 2-digit checksum, and the 24-digit national account number, whose first 8 digits determine the bank and branch). The IBAN you entered is 30 characters long."


Comments:

Patch:
diff --git a/faker/providers/bank/pl_PL/__init__.py b/faker/providers/bank/pl_PL/__init__.py
index 9d9b8f64..9cf6624d 100644
--- a/faker/providers/bank/pl_PL/__init__.py
+++ b/faker/providers/bank/pl_PL/__init__.py
@@ -4,5 +4,5 @@ from .. import Provider as BankProvider
 class Provider(BankProvider):
     """Implement bank provider for ``pl_PL`` locale."""
 
-    bban_format = "#" * 26
+    bban_format = "#" * 24
     country_code = "PL"


Test patch:
diff --git a/tests/providers/test_bank.py b/tests/providers/test_bank.py
index b71666d8..76d05ee0 100644
--- a/tests/providers/test_bank.py
+++ b/tests/providers/test_bank.py
@@ -73,14 +73,14 @@ class TestPlPl:
 
     def test_bban(self, faker, num_samples):
         for _ in range(num_samples):
-            assert re.fullmatch(r"\d{26}", faker.bban())
+            assert re.fullmatch(r"\d{24}", faker.bban())
 
     def test_iban(self, faker, num_samples):
         for _ in range(num_samples):
             iban = faker.iban()
             assert is_valid_iban(iban)
             assert iban[:2] == PlPlBankProvider.country_code
-            assert re.fullmatch(r"\d{2}\d{26}", iban[2:])
+            assert re.fullmatch(r"\d{2}\d{24}", iban[2:])
 
 
 class TestEnGb:
Repository: joke2k/faker

Issue:
fr_FR address provider generates less than 5 digits postcode
* Faker version: master (18.9.0), bug introduced by https://github.com/joke2k/faker/pull/1852

The new provider method can generate 4 or less digits values. But french postcodes must be 5 digits long (cf https://en.wikipedia.org/wiki/Postal_codes_in_France).

Line to fix: https://github.com/joke2k/faker/blob/fa79c6b0c510274b08b46ad0f007fd1b517a9ab2/faker/providers/address/fr_FR/__init__.py#LL478C27-L478C27

### Steps to reproduce

1. generate a few postcodes with `fr_FR` address provider

### Expected behavior

5 digits values

### Actual behavior

From 3 to 5 digits values


Comments:

Patch:
diff --git a/faker/providers/address/fr_FR/__init__.py b/faker/providers/address/fr_FR/__init__.py
index 1125716e..2ee23305 100644
--- a/faker/providers/address/fr_FR/__init__.py
+++ b/faker/providers/address/fr_FR/__init__.py
@@ -469,10 +469,10 @@ class Provider(AddressProvider):
 
     def postcode(self) -> str:
         """
-        Randomly returns a postcode generated from existing french depertment number.
+        Randomly returns a postcode generated from existing french department number.
         exemple: '33260'
         """
         department = self.department_number()
         if department in ["2A", "2B"]:
             department = "20"
-        return f"{department}{self.random_number(digits=5 - len(department))}"
+        return f"{department}{self.random_number(digits=5 - len(department), fix_len=True)}"


Test patch:
diff --git a/tests/providers/test_address.py b/tests/providers/test_address.py
index 0e5c47ef..0ecef674 100644
--- a/tests/providers/test_address.py
+++ b/tests/providers/test_address.py
@@ -870,6 +870,7 @@ class TestFrFr:
         for _ in range(num_samples):
             postcode = faker.postcode()
             assert isinstance(postcode, str)
+            assert len(postcode) == 5
             assert (
                 postcode[:3] in department_numbers  # for 3 digits deparments number
                 or postcode[:2] == "20"  # for Corsica : "2A" or "2B"
Repository: joke2k/faker

Issue:
pyfloat producing values above max_value
* Faker version: 2.0.1
* OS: Windows 10

Calling `pyfloat` with the `max_value` set can produce values above `max_value` leading to issues.

### Steps to reproduce

Run my example code below.

### Expected behavior

Given my following example, I would expect to _only_ see numbers in the range `1 <= x <= 2`.

```
for _ in range(25):
    print(faker.pyfloat(min_value=1, max_value=2))
```

### Actual behavior

However, my example will produce values in the range `1 <= x < 3`.  This behavior is very confusing and unexpected.  Output I got from running my above example:

```
1.200055
2.709
2.319785
2.773763416717
1.521
1.9
2.52454
2.91
1.87016
2.35457
1.92215
1.7
2.461453
1.922252943
1.416632
1.448
2.0
1.5
2.31
2.5114
2.18
1.8
2.12503540581
2.0
```


Comments:

Patch:
diff --git a/faker/providers/python/__init__.py b/faker/providers/python/__init__.py
index 7b1bd6f8..eb8a70a6 100644
--- a/faker/providers/python/__init__.py
+++ b/faker/providers/python/__init__.py
@@ -60,7 +60,7 @@ class Provider(BaseProvider):
             if max_value is None:
                 max_value = min_value + self.random_int()
 
-            left_number = self.random_int(min_value, max_value)
+            left_number = self.random_int(min_value, max_value - 1)
         else:
             sign = '+' if positive else self.random_element(('+', '-'))
             left_number = self.random_number(left_digits)


Test patch:
diff --git a/tests/test_factory.py b/tests/test_factory.py
index ddc8f3b0..110728cb 100644
--- a/tests/test_factory.py
+++ b/tests/test_factory.py
@@ -466,6 +466,16 @@ class FactoryTestCase(unittest.TestCase):
         with pytest.raises(ValueError):
             provider.pyfloat(left_digits=0, right_digits=0)
 
+    def test_pyfloat_in_range(self):
+        # tests for https://github.com/joke2k/faker/issues/994
+        factory = Faker()
+
+        factory.seed_instance(5)
+        result = factory.pyfloat(min_value=0, max_value=1)
+
+        assert result >= 0.0
+        assert result <= 1.0
+
     def test_negative_pyfloat(self):
         # tests for https://github.com/joke2k/faker/issues/813
         factory = Faker()
Repository: joscha0/daily-wiki

Issue:
fix email invalid
if one email is invalid throws error

`Traceback (most recent call last):
  File "sendmail.py", line 50, in <module>
    send_email(img, text, email)
  File "sendmail.py", line 21, in send_email
    s.sendmail(msg['From'], msg['To'], msg.as_string())
  File "/app/.heroku/python/lib/python3.6/smtplib.py", line 881, in sendmail
    raise SMTPRecipientsRefused(senderrs)
smtplib.SMTPRecipientsRefused: {'test@test.test': (450, b'4.1.2 <test@test.test>: Recipient address rejected: Domain not found')}
`

Comments:

Patch:
diff --git a/getwiki.py b/getwiki.py
index 395aac1..0c1db59 100644
--- a/getwiki.py
+++ b/getwiki.py
@@ -33,4 +33,4 @@ def get_wiki(language):
     img = imgs[0]
     img['src'] = 'http:'+img['src']
 
-    return img, text
+    return str(img), str(text)
diff --git a/sendmail.py b/sendmail.py
index 41288e4..1538d0e 100644
--- a/sendmail.py
+++ b/sendmail.py
@@ -10,7 +10,7 @@ from getwiki import get_wiki
 def send_email(img, text, email):
     unsubscribe_tag = f'<a href="https://daily-wiki-newsletter.herokuapp.com/unsubscribe/{email}">unsubscribe</a>'
 
-    msg = MIMEText(str(img) + 3*'<br>' + text + 3 *
+    msg = MIMEText(img + 3*'<br>' + text + 3 *
                    '<br>' + unsubscribe_tag, 'html')
     msg['Subject'] = 'today wiki'
     msg['From'] = 'daily-wiki@960.eu'
@@ -42,9 +42,16 @@ if __name__ == "__main__":
     languages = ["en", "de", "fr", "sv", "ja", "zh"]
     wikis = {}
     for language in languages:
-        img, text = get_wiki(language)
+        try:
+            img, text = get_wiki(language)
+        except:
+            print(f"Error getting article for {language}")
         wikis[language] = (img, text)
     data = firestore.getusers()
     for email in data:
         img, text = wikis[data[email]["language"]]
-        send_email(img, text, email)
+        try:
+            send_email(img, text, email)
+            print(f"Sent email to {email}")
+        except:
+            print(f"Email failed to send to {email}")


Test patch:
diff --git a/tests/test_getwiki.py b/tests/test_getwiki.py
new file mode 100644
index 0000000..ac45dae
--- /dev/null
+++ b/tests/test_getwiki.py
@@ -0,0 +1,28 @@
+import unittest
+from getwiki import get_wiki
+
+
+class TestFirestore(unittest.TestCase):
+
+    def test_get_wiki(self):
+        languages = ["en", "de", "fr", "sv", "ja", "zh"]
+        wikis = {}
+        for language in languages:
+            img, text = get_wiki(language)
+            wikis[language] = (img, text)
+        output = True
+        for key, value in wikis.items():
+            if output == False:
+                break
+            if not value[0].startswith('<img'):
+                print('\n\nNot an Image:'+value[0])
+            if len(value[1]) < 10:
+                print('\n\nShort Text:'+value[0])
+            self.assertIn(key, languages)
+            self.assertIsInstance(value, tuple)
+            self.assertIsInstance(value[0], str)
+            self.assertIsInstance(value[1], str)
+            self.assertTrue(len(value) == 2)
+
+    if __name__ == "__main__":
+        unittest.main()
Repository: jubatus/jubatus-python-client

Issue:
no type validation for constructor arguments
Currently argument types are validated, but constructor arguments are not.
For example, the following code:

```
c = jubatus.Classifier("localhost", 9199, 0)  # it should be ("localhost", 9199, "") to work
c.get_status()
```

raises "TypeMismatch (error 2)" on RPC call, which is difficult to understand.

Comments:

Patch:
diff --git a/jubatus/common/client.py b/jubatus/common/client.py
index d599319..9cd91a8 100644
--- a/jubatus/common/client.py
+++ b/jubatus/common/client.py
@@ -54,6 +54,10 @@ class ClientBase(object):
       (`unpack_encoding=None`)
     """
     def __init__(self, host, port, name, timeout=10):
+        check_types(host, string_types)
+        check_types(port, int_types)
+        check_types(name, string_types)
+        check_types(timeout, int_types)
         address = msgpackrpc.Address(host, port)
         self.client = msgpackrpc.Client(address, timeout=timeout, pack_encoding='utf-8', unpack_encoding=None)
         self.jubatus_client = Client(self.client, name)
@@ -65,6 +69,7 @@ class ClientBase(object):
         return self.jubatus_client.name
 
     def set_name(self, name):
+        check_types(name, string_types)
         self.jubatus_client.name = name
 
     def save(self, id):


Test patch:
diff --git a/test/jubatus_test/common/test_client.py b/test/jubatus_test/common/test_client.py
index 0e929f8..065b538 100644
--- a/test/jubatus_test/common/test_client.py
+++ b/test/jubatus_test/common/test_client.py
@@ -67,5 +67,22 @@ class ClientTest(unittest.TestCase):
         self.assertEqual("test", c.call("test", [], AnyType(), []))
         self.assertRaises(TypeError, c.call, "test", [1], AnyType(), [])
 
+class ClientBaseTest(unittest.TestCase):
+    def test_constructor(self):
+        self.assertIsInstance(jubatus.common.ClientBase("127.0.0.1", 9199, "cluster", 10), jubatus.common.ClientBase)
+
+        # invalid host
+        self.assertRaises(TypeError, jubatus.common.ClientBase, 127001, 9199, "cluster", 10)
+
+        # invalid port
+        self.assertRaises(TypeError, jubatus.common.ClientBase, "127.0.0.1", "9199", "cluster", 10)
+
+        # invalid name
+        self.assertRaises(TypeError, jubatus.common.ClientBase, "127.0.0.1", 9199, 10, 10)
+
+        # invalid timeout
+        self.assertRaises(TypeError, jubatus.common.ClientBase, "127.0.0.1", 9199, "cluster", "test")
+        self.assertRaises(TypeError, jubatus.common.ClientBase, "127.0.0.1", 9199, "cluster", 1.5)
+
 if __name__ == '__main__':
     unittest.main()