internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: joke2k/faker

Issue:
German address postcode + city missing
Missing address with postalcode in german languages

### Steps to reproduce

fake.street_name()
 'Justina-Birnbaum-Allee'
fake.building_number()
 '75'
fake.city()
 'Halberstadt'
fake.postcode()
 '25842'

### Existing combinations: 
fake.address()
 'Justina-Birnbaum-Allee 75\n25842 Halberstadt'

fake.street_address()
 'Justina-Birnbaum-Allee 75'

### Missing:

fake.missing_method_for_city_with_postalcode()
 '25842 Halberstadt'


Discussion:
I don't think we have any address provider with a method for city + postal code, so this would apply to all address providers. Some will return zip + city, while other would return city + zip, depending on the locale. German languages may have different different formats (I'm thinking Germany vs Austria vs Switzerland)

Feel free to submit a PR for the `de_DE` and/or all other locales you know :)

Resolving patch:
diff --git a/faker/providers/address/de_DE/__init__.py b/faker/providers/address/de_DE/__init__.py
--- a/faker/providers/address/de_DE/__init__.py
+++ b/faker/providers/address/de_DE/__init__.py
@@ -8,6 +8,8 @@ class Provider(AddressProvider):
 
     city_formats = ('{{city_name}}', )
 
+    city_with_postcode_formats = ('{{city_name}} {{postcode}}', )
+
     street_name_formats = (
         '{{first_name}}-{{last_name}}-{{street_suffix_long}}',
         '{{last_name}}{{street_suffix_short}}',
@@ -188,3 +190,9 @@ def state(self):
 
     def country(self):
         return self.random_element(self.countries)
+
+    def postcode(self):
+        return self.bothify(self.random_element(self.postcode_formats))
+
+    def city_with_postcode(self):
+        return self.postcode() + " " + self.random_element(self.cities)


Test patch:
diff --git a/tests/providers/test_address.py b/tests/providers/test_address.py
--- a/tests/providers/test_address.py
+++ b/tests/providers/test_address.py
@@ -149,6 +149,10 @@ def test_country(self):
         assert isinstance(country, string_types)
         assert country in DeProvider.countries
 
+    def test_city_with_postcode(self):
+        city_with_postcode = self.factory.city_with_postcode()
+        assert isinstance(city_with_postcode, string_types)
+
 
 class TestFiFI(unittest.TestCase):
     """ Tests in addresses in the fi_FI locale """
Repository: joke2k/faker

Issue:
Generate fake hostnames
Occasionally I find the need to generate fake hostnames for testing.
I'd like faker to be able to generate valid hostname stings.


Discussion:
Would `.domain_name()` or `domain_work()` work for your case?
They might, but they are not the only valid hostnames available.
I'd expect `.hostname()` to generate strings like `db01.<domain_name>` or `worker01-mycluster`.
These kind of strings are what you'd expect from hostnames.

Resolving patch:
diff --git a/faker/providers/internet/__init__.py b/faker/providers/internet/__init__.py
--- a/faker/providers/internet/__init__.py
+++ b/faker/providers/internet/__init__.py
@@ -75,7 +75,7 @@ class Provider(BaseProvider):
     tlds = (
         'com', 'com', 'com', 'com', 'com', 'com', 'biz', 'info', 'net', 'org',
     )
-
+    hostname_prefixes = ('db', 'srv', 'desktop', 'laptop', 'lt', 'email', 'web')
     uri_pages = (
         'index', 'home', 'search', 'main', 'post', 'homepage', 'category',
         'register', 'login', 'faq', 'about', 'terms', 'privacy', 'author',
@@ -190,6 +190,22 @@ def user_name(self):
         )
         return username
 
+    @lowercase
+    def hostname(self, levels=1):
+        """
+        Produce a hostname with specified number of subdomain levels.
+
+        >>> hostname()
+        db-01.nichols-phillips.com
+        >>> hostname(0)
+        laptop-56
+        >>> hostname(2)
+        web-12.williamson-hopkins.jackson.com
+        """
+        if levels < 1:
+            return self.random_element(self.hostname_prefixes) + '-' + self.numerify('##')
+        return self.random_element(self.hostname_prefixes) + '-' + self.numerify('##') + '.' + self.domain_name(levels)
+
     @lowercase
     def domain_name(self, levels=1):
         """


Test patch:
diff --git a/tests/providers/test_internet.py b/tests/providers/test_internet.py
--- a/tests/providers/test_internet.py
+++ b/tests/providers/test_internet.py
@@ -39,6 +39,17 @@ def test_image_url(self):
         url = self.factory.image_url()
         assert 'https://dummyimage.com/' in url
 
+    def test_hostname(self):
+        hostname_1_level = self.factory.hostname(levels=1)
+        hostname_parts = hostname_1_level.split(".")
+        assert hostname_1_level
+        self.assertIsInstance(hostname_1_level, six.string_types)
+        assert len(hostname_parts) == 3
+
+        hostname_0_level = self.factory.hostname(levels=0)
+        assert hostname_0_level
+        self.assertIsInstance(hostname_0_level, six.string_types)
+
 
 class TestInternetProviderUrl(unittest.TestCase):
     """ Test internet url generation """
Repository: joke2k/faker

Issue:
Brazilian RG (identity card)
Add Generator to Brazilian RG (identity card)

### Steps to reproduce
fake = Faker('pt_Br')
fake.rg()

### Expected behavior
return like this rules:
https://www.ngmatematica.com/2014/02/como-determinar-o-digito-verificador-do.html
8 digits + 1 checksum digit
### Actual behavior
New feature



Discussion:

Resolving patch:
diff --git a/faker/providers/ssn/pt_BR/__init__.py b/faker/providers/ssn/pt_BR/__init__.py
--- a/faker/providers/ssn/pt_BR/__init__.py
+++ b/faker/providers/ssn/pt_BR/__init__.py
@@ -1,6 +1,7 @@
 # coding=utf-8
 
 from __future__ import unicode_literals
+
 from .. import Provider as SsnProvider
 
 
@@ -44,3 +45,22 @@ def ssn(self):
     def cpf(self):
         c = self.ssn()
         return c[:3] + '.' + c[3:6] + '.' + c[6:9] + '-' + c[9:]
+
+    def rg(self):
+        """
+        Brazilian RG, return plain numbers.
+        Check:  https://www.ngmatematica.com/2014/02/como-determinar-o-digito-verificador-do.html
+        """
+
+        digits = self.generator.random.sample(range(0, 9), 8)
+        checksum = sum(i * digits[i - 2] for i in range(2, 10))
+        last_digit = 11 - (checksum % 11)
+
+        if last_digit == 10:
+            digits.append('X')
+        elif last_digit == 11:
+            digits.append(0)
+        else:
+            digits.append(last_digit)
+
+        return ''.join(map(str, digits))


Test patch:
diff --git a/tests/providers/test_ssn.py b/tests/providers/test_ssn.py
--- a/tests/providers/test_ssn.py
+++ b/tests/providers/test_ssn.py
@@ -423,6 +423,14 @@ def test_pt_BR_cpf(self):
         for _ in range(100):
             assert re.search(r'\d{3}\.\d{3}\.\d{3}-\d{2}', self.factory.cpf())
 
+    def test_pt_BR_rg(self):
+        for _ in range(100):
+            to_test = self.factory.rg()
+            if 'X' in to_test:
+                assert re.search(r'^\d{8}X', to_test)
+            else:
+                assert re.search(r'^\d{9}$', to_test)
+
 
 class TestNlNL(unittest.TestCase):
     def setUp(self):
Repository: joke2k/faker

Issue:
pyfloat, pydecimal cannot be negative when left_digits=0
I am trying to fake random floats in the range `(-1, 1)`.  Currently, `pyfloat` and `pydecimal` will never be negative as long as `left_digits=0`, even if `positive=False`.

This seems to be because [the `sign` (-1, 1) is multiplied by only the left digits](https://github.com/joke2k/faker/blob/6e32e07/faker/providers/python/__init__.py#L62) (which in this case is 0, canceling out the `sign`), rather than by the entire numeric value.

### Steps to reproduce

```python
>>> import faker
>>> fake = faker.Faker()
>>> any(fake.pyfloat(left_digits=0, positive=False) < 0 for _ in range(10000))
False
```

### Expected behavior

I'd expect approximately half of the floats to be negative, when `positive` is not `True`



Discussion:
Thank you for the report!

I'm not sure when I'll have time to look into it. Feel free to submit a PR!

Resolving patch:
diff --git a/faker/providers/python/__init__.py b/faker/providers/python/__init__.py
--- a/faker/providers/python/__init__.py
+++ b/faker/providers/python/__init__.py
@@ -53,8 +53,7 @@ def pyfloat(self, left_digits=None, right_digits=None, positive=False,
             self.random_int(1, sys.float_info.dig))
         right_digits = right_digits if right_digits is not None else (
             self.random_int(0, sys.float_info.dig - left_digits))
-        sign = 1 if positive else self.random_element((-1, 1))
-
+        sign = ''
         if (min_value is not None) or (max_value is not None):
             if min_value is None:
                 min_value = max_value - self.random_int()
@@ -63,9 +62,11 @@ def pyfloat(self, left_digits=None, right_digits=None, positive=False,
 
             left_number = self.random_int(min_value, max_value)
         else:
-            left_number = sign * self.random_number(left_digits)
+            sign = '+' if positive else self.random_element(('+', '-'))
+            left_number = self.random_number(left_digits)
 
-        return float("{0}.{1}".format(
+        return float("{0}{1}.{2}".format(
+            sign,
             left_number,
             self.random_number(right_digits),
         ))


Test patch:
diff --git a/tests/test_factory.py b/tests/test_factory.py
--- a/tests/test_factory.py
+++ b/tests/test_factory.py
@@ -460,6 +460,13 @@ def test_random_pyfloat(self):
         with pytest.raises(ValueError):
             provider.pyfloat(left_digits=0, right_digits=0)
 
+    def test_negative_pyfloat(self):
+        # tests for https://github.com/joke2k/faker/issues/813
+        factory = Faker()
+        factory.seed_instance(32167)
+        assert any(factory.pyfloat(left_digits=0, positive=False) < 0 for _ in range(100))
+        assert any(factory.pydecimal(left_digits=0, positive=False) < 0 for _ in range(100))
+
     def test_us_ssn_valid(self):
         from faker.providers.ssn.en_US import Provider
Repository: joke2k/faker

Issue:
suggestion: pytimezone
In addition to the currently available [timezone](), it would be very useful* to have a similar python object faker, something like:
```python
import pytz

class TheExistingPythonProvider:

    def pytimezone(self, **kwargs):
        return pytz.timezone(self.generator.timezone(**kwargs))
```

For an example use-case, see:

\* FactoryBoy/factory_boy#643


Discussion:
I'm +1 on add a timezone provider. I just wonder if it should go into the `date_time` provider than the `python` one.

Either way, feel free to submit a PR and I'll review it :)

Oh, true, since date_time provider does already have  python `datetime` objects. 👍 

Will do.

Resolving patch:
diff --git a/faker/providers/date_time/__init__.py b/faker/providers/date_time/__init__.py
--- a/faker/providers/date_time/__init__.py
+++ b/faker/providers/date_time/__init__.py
@@ -4,7 +4,7 @@
 from datetime import MAXYEAR, timedelta
 
 from dateutil import relativedelta
-from dateutil.tz import tzlocal, tzutc
+from dateutil.tz import gettz, tzlocal, tzutc
 
 from faker.utils.datetime_safe import date, datetime, real_date, real_datetime
 
@@ -1962,6 +1962,17 @@ def timezone(self):
         return self.generator.random.choice(
             self.random_element(self.countries)['timezones'])
 
+    def pytimezone(self, *args, **kwargs):
+        """
+        Generate a random timezone (see `faker.timezone` for any args)
+        and return as a python object usable as a `tzinfo` to `datetime`
+        or other fakers.
+
+        :example faker.pytimezone()
+        :return dateutil.tz.tz.tzfile
+        """
+        return gettz(self.timezone(*args, **kwargs))
+
     def date_of_birth(self, tzinfo=None, minimum_age=0, maximum_age=115):
         """
         Generate a random date of birth represented as a Date object,


Test patch:
diff --git a/tests/providers/test_date_time.py b/tests/providers/test_date_time.py
--- a/tests/providers/test_date_time.py
+++ b/tests/providers/test_date_time.py
@@ -138,6 +138,16 @@ def test_timezone_conversion(self):
         today_back = datetime.fromtimestamp(timestamp, utc).date()
         assert today == today_back
 
+    def test_pytimezone(self):
+        import dateutil
+        pytz = self.fake.pytimezone()
+        assert isinstance(pytz, dateutil.tz.tz.tzfile)
+
+    def test_pytimezone_usable(self):
+        pytz = self.fake.pytimezone()
+        date = datetime(2000, 1, 1, tzinfo=pytz)
+        assert date.tzinfo == pytz
+
     def test_datetime_safe(self):
         from faker.utils import datetime_safe
         # test using example provided in module
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
```



Discussion:

Resolving patch:
diff --git a/faker/providers/python/__init__.py b/faker/providers/python/__init__.py
--- a/faker/providers/python/__init__.py
+++ b/faker/providers/python/__init__.py
@@ -60,7 +60,7 @@ def pyfloat(self, left_digits=None, right_digits=None, positive=False,
             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
--- a/tests/test_factory.py
+++ b/tests/test_factory.py
@@ -466,6 +466,16 @@ def test_random_pyfloat(self):
         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: joke2k/faker

Issue:
"Edit on Github" link broken in ReadTheDocs
http://fake-factory.readthedocs.org/en/latest/locales.html

Clicking "Edit on Github" results in a 404 error.

EDIT: 
http://fake-factory.readthedocs.org/en/latest/ has a github link to `https://github.com/joke2k/faker/blob/docs/docs/index.rst` when the correct link is
`https://github.com/joke2k/faker/blob/master/docs/index.rst`
(Note the doubled up `docs/docs` instead of `master/docs`)



Discussion:
The link results on 404 because the .rst document is autmatically generated on RTD on build. I'll look if there's a way to disable the button.


Resolving patch:
diff --git a/faker/build_docs.py b/faker/build_docs.py
--- a/faker/build_docs.py
+++ b/faker/build_docs.py
@@ -61,9 +61,11 @@ def write_docs(*args, **kwargs):
         provider_name = doc.get_provider_name(provider)
         fname = os.path.join(DOCS_ROOT, 'providers', '%s.rst' % provider_name)
         with open(fname, 'wb') as fh:
+            write(fh, ':github_url: hide\n\n')
             write_provider(fh, doc, provider, fakers)
 
     with open(os.path.join(DOCS_ROOT, 'providers.rst'), 'wb') as fh:
+        write(fh, ':github_url: hide\n\n')
         write(fh, 'Providers\n')
         write(fh, '=========\n')
         write(fh, '.. toctree::\n')
@@ -75,7 +77,7 @@ def write_docs(*args, **kwargs):
     for lang in AVAILABLE_LOCALES:
         fname = os.path.join(DOCS_ROOT, 'locales', '%s.rst' % lang)
         with open(fname, 'wb') as fh:
-            write(fh, '\n')
+            write(fh, ':github_url: hide\n\n')
             title = 'Language {0}\n'.format(lang)
             write(fh, title)
             write(fh, '=' * len(title))
@@ -89,6 +91,7 @@ def write_docs(*args, **kwargs):
                 write_provider(fh, d, p, fs)
 
     with open(os.path.join(DOCS_ROOT, 'locales.rst'), 'wb') as fh:
+        write(fh, ':github_url: hide\n\n')
         write(fh, 'Locales\n')
         write(fh, '=======\n')
         write(fh, '.. toctree::\n')


Test patch:
Repository: joke2k/faker

Issue:
BBAN for en_GB too short
* Faker version: v2.0.3
* OS: linux

Numeric part of the en_GB BBAN needs to be 14 digits long, it currently only returns 13, failing further validation.

### Steps to reproduce

Invoke `fake.iban()` or `fake.bban()` with the en_GB locale, an IBAN or BBAN with 1 digit missing is returned.

### Expected behavior

GB ibans should be 22 chars long: https://www.xe.com/ibancalculator/sample/?ibancountry=united kingdom




Discussion:
Thank you for the report @Necrathex !

Feel free to submit a PR. Let me know if you have any question or need any help :)

Resolving patch:
diff --git a/faker/providers/bank/en_GB/__init__.py b/faker/providers/bank/en_GB/__init__.py
--- a/faker/providers/bank/en_GB/__init__.py
+++ b/faker/providers/bank/en_GB/__init__.py
@@ -2,5 +2,5 @@
 
 
 class Provider(BankProvider):
-    bban_format = '????#############'
+    bban_format = '????##############'
     country_code = 'GB'


Test patch:
diff --git a/tests/providers/test_bank.py b/tests/providers/test_bank.py
--- a/tests/providers/test_bank.py
+++ b/tests/providers/test_bank.py
@@ -45,3 +45,18 @@ def test_bban(self):
     def test_iban(self):
         iban = self.factory.iban()
         assert re.match(r"PL\d{26}", iban)
+
+
+class TestEnGB(unittest.TestCase):
+    """Tests the bank provider for en_GB locale"""
+
+    def setUp(self):
+        self.factory = Faker('en_GB')
+
+    def test_bban(self):
+        bban = self.factory.bban()
+        assert re.match(r"[A-Z]{4}\d{14}", bban)
+
+    def test_iban(self):
+        iban = self.factory.iban()
+        assert re.match(r"GB\d{2}[A-Z]{4}\d{14}", iban)
Repository: joke2k/faker

Issue:
Implementation of person id number for cs_CZ - Czech (rodné číslo)
Can you implement randomizer which will generate a proper person ID number (rodné číslo) for Czech local?


Discussion:
Can you give more details about what you are trying to achieve and what you tried?
Having some names in Czech locale seems available, like in:

```
from faker import Faker
fake = Faker('cs-CZ')
for _ in range(10):
    print(fake.name())
```

Are you looking for something different?

Resolving patch:
diff --git a/faker/providers/ssn/cs_CZ/__init__.py b/faker/providers/ssn/cs_CZ/__init__.py
--- a/faker/providers/ssn/cs_CZ/__init__.py
+++ b/faker/providers/ssn/cs_CZ/__init__.py
@@ -1,3 +1,5 @@
+from math import ceil
+
 from .. import Provider as BaseProvider
 
 
@@ -8,6 +10,8 @@ class Provider(BaseProvider):
         'CZ##########',
     )
 
+    national_id_months = ['%.2d' % i for i in range(1, 13)] + ['%.2d' % i for i in range(51, 63)]
+
     def vat_id(self):
         """
         http://ec.europa.eu/taxation_customs/vies/faq.html#item_11
@@ -15,3 +19,24 @@ def vat_id(self):
         """
 
         return self.bothify(self.random_element(self.vat_id_formats))
+
+    def birth_number(self):
+        """
+        Birth Number (Czech/Slovak: rodné číslo (RČ))
+        https://en.wikipedia.org/wiki/National_identification_number#Czech_Republic_and_Slovakia
+        """
+        birthdate = self.generator.date_of_birth()
+        year = '%.2d' % (birthdate.year % 100)
+        month = self.random_element(self.national_id_months)
+        day = '%.2d' % birthdate.day
+        if birthdate.year > 1953:
+            sn = self.random_number(4, True)
+        else:
+            sn = self.random_number(3, True)
+        number = int('{}{}{}{}'.format(year, month, day, sn))
+        birth_number = str(ceil(number / 11) * 11)
+        if year == '00':
+            birth_number = '00' + birth_number
+        elif year[0] == '0':
+            birth_number = '0' + birth_number
+        return '{}/{}'.format(birth_number[:6], birth_number[6::])


Test patch:
diff --git a/tests/providers/test_ssn.py b/tests/providers/test_ssn.py
--- a/tests/providers/test_ssn.py
+++ b/tests/providers/test_ssn.py
@@ -153,6 +153,13 @@ def test_vat_id(self):
         for _ in range(100):
             assert re.search(r'^CZ\d{8,10}$', self.fake.vat_id())
 
+    def test_birth_number(self):
+        for _ in range(100):
+            birth_number = self.fake.birth_number()
+            assert len(birth_number) in [10, 11]
+            assert birth_number[6] == "/"
+            assert int(birth_number.replace("/", "")) % 11 == 0
+
 
 class TestDeAT(unittest.TestCase):
     def setUp(self):
Repository: joke2k/faker

Issue:
Faker missing french licence plate
I noticed that Faker was missing the implementation of French licence plates. 
I would interested in adding this new feature :)


Discussion:

Resolving patch:
diff --git a/faker/providers/automotive/fr_FR/__init__.py b/faker/providers/automotive/fr_FR/__init__.py
new file mode 100644
--- /dev/null
+++ b/faker/providers/automotive/fr_FR/__init__.py
@@ -0,0 +1,11 @@
+from .. import Provider as AutomotiveProvider
+
+
+class Provider(AutomotiveProvider):
+    # Source (english): https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_France
+    license_formats = (
+        # New format
+        '??-###-??',
+        # Old format for plates < 2009
+        '###-???-##',
+    )


Test patch:
diff --git a/tests/providers/test_automotive.py b/tests/providers/test_automotive.py
--- a/tests/providers/test_automotive.py
+++ b/tests/providers/test_automotive.py
@@ -133,3 +133,16 @@ def test_ru_RU_plate_format(self):
     def test_vehicle_category(self):
         category = self.fake.vehicle_category()
         assert isinstance(category, str)
+
+
+class TestFrFR(unittest.TestCase):
+
+    def setUp(self):
+        self.fake = Faker('fr_FR')
+        Faker.seed(0)
+        self.pattern = re.compile(r'^\d{3}-[A-Z]{3}-\d{2}$|^[A-Z]{2}-\d{3}-[A-Z]{2}')
+
+    def test_fr_FR_plate_format(self):
+        plate = self.fake.license_plate()
+        assert isinstance(plate, str)
+        assert self.pattern.match(plate)