Northy1717/SWE-bench-Live huggingface dataset:
Repository: joke2k/faker

Issue:
es_ES doi() inconsistent with definition
When creating an instance of faker with locale="es_ES", the `doi()` method returns a random Spanish CIF or NIE or NIF, which has nothing to do with the DOI. 

Example:

``` python
>>> from faker import Faker
>>> faker_instance = Faker(locale="es_ES")
>>> faker_instance.doi()
'Y7569754P'
```

Using version 35.0.0




Discussion:
Thank you for the report!

Do you have time to prepare a Pull Request?



Patch:
diff --git a/faker/providers/doi/__init__.py b/faker/providers/doi/__init__.py
new file mode 100644
index 0000000000..99e13ee926
--- /dev/null
+++ b/faker/providers/doi/__init__.py
@@ -0,0 +1,20 @@
+from faker.providers import BaseProvider
+
+
+class Provider(BaseProvider):
+    """
+    Provider for Digital Object Identifier (DOI)
+    Source of info: https://en.wikipedia.org/wiki/Digital_object_identifier (English)
+    """
+
+    def doi(self) -> str:
+        """
+        Generate a valid Digital Object Identifier (DOI).
+        Format: 10.{4-9 digits}/{alphanumeric string}
+        Eg: 10.1000/xyz123
+        """
+        prefix = "10"
+        registrant = str(self.generator.random.randint(1000, 99999999))
+        suffix = self.generator.bothify("?#?#?##").lower()
+
+        return f"{prefix}.{registrant}/{suffix}"


Test patch:
diff --git a/tests/providers/test_doi.py b/tests/providers/test_doi.py
new file mode 100644
index 0000000000..8063a0126c
--- /dev/null
+++ b/tests/providers/test_doi.py
@@ -0,0 +1,26 @@
+import re
+
+from faker import Faker
+
+
+def test_doi():
+    fake = Faker()
+
+    # Test standard DOI
+    doi = fake.doi()
+    assert doi.startswith("10.")
+    # DOI format: 10.{registrant}/{suffix}
+    assert re.match(r"^10\.\d{4,9}/[a-z0-9]+$", doi)
+
+
+def test_doi_es_ES():
+    # Test Spanish locale no longer returns Spanish IDs
+    fake = Faker("es_ES")
+    doi = fake.doi()
+
+    # Should follow DOI format, not Spanish ID format
+    assert doi.startswith("10.")
+    assert re.match(r"^10\.\d{4,9}/[a-z0-9]+$", doi)
+    # Make sure it's not returning Spanish IDs
+    assert not re.match(r"^[XYZ]\d{7}[A-Z]$", doi)  # NIE format
+    assert not re.match(r"^\d{8}[A-Z]$", doi)  # NIF format
Repository: joke2k/faker

Issue:
Belgium IBAN incorrect checksum
Hi 👋 

First of all, thanks for this great library 🚀 

I just bumped faker to `35.2.0` (from 33.0) and got some errors about IBAN `nl_BE` being invalid (e.g. `BE02134082897882`, `BE98124280189433`). When cross checking IBAN on website like [this one](https://www.ibancalculator.com/iban_validieren.html)
it is also marked as invalid.
This can easily be reproduced on the latest docker python image:
```
>>> from faker import Faker
>>> fake = Faker(locale="nl_BE")
>>> fake.iban()
'BE88308580548828'
```
Looks like a regression from #2142 ? From what I see the fix has been merged and released in [v33.3.1](https://github.com/joke2k/faker/blob/refs/tags/v33.3.1/CHANGELOG.md) 


Discussion:

Patch:
diff --git a/faker/providers/bank/nl_BE/__init__.py b/faker/providers/bank/nl_BE/__init__.py
index 5433486612..c3c10074d4 100644
--- a/faker/providers/bank/nl_BE/__init__.py
+++ b/faker/providers/bank/nl_BE/__init__.py
@@ -85,12 +85,12 @@ def _generate_account_number(self) -> str:
 
     def _calculate_mod97(self, account_number: str) -> str:
         """Calculate the mod 97 check digits for a given account number."""
-        check_digits = 97 - (int(account_number) % 97)
-        return str(check_digits).zfill(2)
+        remainder = int(account_number) % 97
+        return str(remainder).zfill(2) if remainder != 0 else 97
 
     def _calculate_iban_check_digits(self, bban: str) -> str:
         """Calculate the IBAN check digits using mod 97 algorithm."""
-        raw_iban = f"{self.country_code}00{bban}"
+        raw_iban = f"{bban}{self.country_code}00"
         numeric_iban = "".join(str(ord(char) - 55) if char.isalpha() else char for char in raw_iban)
         check_digits = 98 - (int(numeric_iban) % 97)
         return str(check_digits).zfill(2)


Test patch:
diff --git a/tests/providers/test_bank.py b/tests/providers/test_bank.py
index a0692e681a..12ccff56cf 100644
--- a/tests/providers/test_bank.py
+++ b/tests/providers/test_bank.py
@@ -467,17 +467,16 @@ def test_bban(self, faker, num_samples):
             assert re.fullmatch(r"\d{12}", bban)
             account_number = bban[:-2]
             check_digits = int(bban[-2:])
-            assert (97 - (int(account_number) % 97)) == check_digits or check_digits == 97
+            assert (int(account_number) % 97) == check_digits or check_digits == 97
 
     def test_iban(self, faker, num_samples):
         for _ in range(num_samples):
             iban = faker.iban()
             assert iban[:2] == NlBeBankProvider.country_code
             assert re.fullmatch(r"\d{2}\d{12}", iban[2:])
-            bban = iban[4:]
-            account_number = bban[:-2]
-            check_digits = int(bban[-2:])
-            assert (97 - (int(account_number) % 97)) == check_digits or check_digits == 97
+            rearranged_iban = iban[4:] + iban[:4]
+            numeric_iban = "".join(str(ord(char) - 55) if char.isalpha() else char for char in rearranged_iban)
+            assert int(numeric_iban) % 97 == 1
 
     def test_swift8_use_dataset(self, faker, num_samples):
         for _ in range(num_samples):
Repository: python-attrs/attrs

Issue:
unhelpful message "ValueError: Type annotation and type argument cannot both be present"
Getting this message because I both have the type annotation and type defined on a custom attribute class which is reasonable considering the ambiguity.

However I think the message itself could be more helpful by displaying the name of the attribute to eliminate the variable hunt.

My suggested change is:

https://github.com/python-attrs/attrs/blob/2afd663bf40e4a8209986accdfb1e2d53afc15e2/src/attr/_make.py#L2354
```python
    @classmethod
    def from_counting_attr(cls, name, ca, type=None):
        # type holds the annotated value. deal with conflicts:
        if type is None:
            type = ca.type
        elif ca.type is not None:
            raise ValueError(
                f"Type annotation and type argument for {name} cannot both be present"
            )
        inst_dict = {
            k: getattr(ca, k)
            for k
            in Attribute.__slots__
            if k not in (
                "name", "validator", "default", "type", "convert",
            )  # exclude methods and deprecated alias
        }
        return cls(
            name=name, validator=ca._validator, default=ca._default, type=type,
            **inst_dict
        )
 ```


Discussion:

Patch:
diff --git a/changelog.d/1410.change.md b/changelog.d/1410.change.md
new file mode 100644
index 000000000..0536da8f5
--- /dev/null
+++ b/changelog.d/1410.change.md
@@ -0,0 +1,1 @@
+The error message if an attribute has both an annotation and a type argument will now disclose _what_ attribute seems to be the problem.
diff --git a/src/attr/_make.py b/src/attr/_make.py
index 0c5aa0bd6..7439dc2ad 100644
--- a/src/attr/_make.py
+++ b/src/attr/_make.py
@@ -2491,7 +2491,7 @@ def from_counting_attr(cls, name: str, ca: _CountingAttr, type=None):
         if type is None:
             type = ca.type
         elif ca.type is not None:
-            msg = "Type annotation and type argument cannot both be present"
+            msg = f"Type annotation and type argument cannot both be present for '{name}'."
             raise ValueError(msg)
         return cls(
             name,


Test patch:
diff --git a/tests/test_annotations.py b/tests/test_annotations.py
index f37a1c0b0..5c6296634 100644
--- a/tests/test_annotations.py
+++ b/tests/test_annotations.py
@@ -62,7 +62,7 @@ class C:
                 x: int = attr.ib(type=int)
 
         assert (
-            "Type annotation and type argument cannot both be present",
+            "Type annotation and type argument cannot both be present for 'x'.",
         ) == e.value.args
 
     def test_typing_annotations(self):
Repository: instructlab/instructlab

Issue:
bug: Logger can't format exception string when SDG training fails
**Describe the bug**
When an error occurs during the synthetic data generation stage in our E2E jobs, the logger statement can't always format the caught exception message correctly due to how the exception object is passed into the `logger.error()` function. Therefore, the E2E job fails before the true error message can be printed, which makes it difficult to uncover the underlying error. (Screenshot provided below.)

**To Reproduce**
Steps to reproduce the behavior:
1. Create a pull request
2. Have a maintainer trigger an E2E job

**Expected behavior**
The actual error message should be printed

**Screenshots**
![Screenshot 2025-02-10 at 10 31 06 AM](https://github.com/user-attachments/assets/1db02081-5edf-4a31-be88-b425edf336d4)

[Job logs for the above screenshot.](https://github.com/instructlab/instructlab/actions/runs/13239407579/job/36951385756)

**Device Info (please complete the following information):**
 - Hardware Specs: N/A
 - OS Version: N/A
 - Python Version: N/A
 - InstructLab Version: `main` branch

**Additional context**
N/A



Discussion:

Patch:
diff --git a/src/instructlab/model/accelerated_train.py b/src/instructlab/model/accelerated_train.py
index 26afef2be5..c6b234b20c 100644
--- a/src/instructlab/model/accelerated_train.py
+++ b/src/instructlab/model/accelerated_train.py
@@ -233,7 +233,7 @@ def accelerated_train(
             run_training(train_args=train_args, torch_args=torch_args)
         except (RuntimeError, KeyboardInterrupt, Exception) as e:
             if not isinstance(e, KeyboardInterrupt):
-                logger.error("Failed during training loop: ", e)
+                logger.error("Failed during training loop: %s", e, exc_info=True)
             raise click.exceptions.Exit(1) from e
 
 
@@ -273,7 +273,7 @@ def _run_phase(
     # pylint: disable=broad-except # training library emits a general Exception in lieu of a more specific one.
     except (RuntimeError, KeyboardInterrupt, Exception) as e:
         if not isinstance(e, KeyboardInterrupt):
-            logger.error("Failed during training loop: ", e)
+            logger.error("Failed during training loop: %s", e, exc_info=True)
         exception = e
     else:
         # progress onto the next phase on success


Test patch:
diff --git a/tests/test_lab_train.py b/tests/test_lab_train.py
index 81a0922b28..85152a058c 100644
--- a/tests/test_lab_train.py
+++ b/tests/test_lab_train.py
@@ -652,7 +652,9 @@ def test_phased_train_failures(
         run_training_patch.start()
         result = run_default_phased_train(cli_runner)
         run_training_patch.stop()
-        assert TRAINING_FAILURE_MESSAGE in result.output
+        assert (
+            f"Failed during training loop: {TRAINING_FAILURE_MESSAGE}" in result.output
+        )
         assert "Training Phase 1/2..." in result.output
         assert result.exit_code == 1
Repository: dynaconf/dynaconf

Issue:
[bug] using `@merge` with comma separated values, does not infer type

```py
settings = Dynaconf(
    data=[1,2,3]
)
```

```bash
APP_DATA="@merge 4,5,6" dynaconf list -k DATA
```

Result

```
DATA<list>: [1, 2, 3, "4", "5", "6"]
```

Expected

```
DATA<list>: [1, 2, 3, 4, 5, 6]
```


Discussion:

Patch:
diff --git a/dynaconf/utils/parse_conf.py b/dynaconf/utils/parse_conf.py
index 1958764f1..79ad551df 100644
--- a/dynaconf/utils/parse_conf.py
+++ b/dynaconf/utils/parse_conf.py
@@ -133,7 +133,12 @@ def __init__(self, value, box_settings, unique=False):
                     }
                 elif "," in self.value:
                     # @merge foo,bar
-                    self.value = self.value.split(",")
+                    self.value = [
+                        parse_conf_data(
+                            v, tomlfy=True, box_settings=box_settings
+                        )
+                        for v in self.value.split(",")
+                    ]
                 else:
                     # @merge foo
                     self.value = [self.value]


Test patch:
diff --git a/tests/test_base.py b/tests/test_base.py
index e7c704475..7fa263be6 100644
--- a/tests/test_base.py
+++ b/tests/test_base.py
@@ -469,6 +469,42 @@ def test_set_explicit_merge_token(tmpdir):
     settings.set("b_list", "@merge zaz")
     assert settings.B_LIST == [1, 2, 3, 4, 5, 6.6, False, "foo", "bar", "zaz"]
 
+    settings.set("b_list", "@merge 7, 8, 9")
+    assert settings.B_LIST == [
+        1,
+        2,
+        3,
+        4,
+        5,
+        6.6,
+        False,
+        "foo",
+        "bar",
+        "zaz",
+        7,
+        8,
+        9,
+    ]
+    settings.set("b_list", "@merge '10','11','12'")
+    assert settings.B_LIST == [
+        1,
+        2,
+        3,
+        4,
+        5,
+        6.6,
+        False,
+        "foo",
+        "bar",
+        "zaz",
+        7,
+        8,
+        9,
+        "10",
+        "11",
+        "12",
+    ]
+
     settings.set("a_dict", "@merge {city='Guarulhos'}")
     assert settings.A_DICT.name == "Bruno"
     assert settings.A_DICT.city == "Guarulhos"