internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: mne-tools/mne-python

Issue:
BUG: EpochsTFR bug popping up in MNE-BIDS-Pipeline
@drammock see https://app.circleci.com/pipelines/github/mne-tools/mne-bids-pipeline/4395/workflows/4c871947-2971-4fca-8d92-b7a2892c91db/jobs/62041

To reproduce you can `pip install -e .` mne-bids-pipeline and do (it will download some GB of data to `~/mne_data`):
```
pytest --download mne_bids_pipeline/ -k 247 --pdb
```


Discussion:
I think I found the issue. will open a PR shortly.

Resolving patch:
diff --git a/mne/time_frequency/tfr.py b/mne/time_frequency/tfr.py
--- a/mne/time_frequency/tfr.py
+++ b/mne/time_frequency/tfr.py
@@ -4222,8 +4222,12 @@ def read_tfrs(fname, condition=None, *, verbose=None):
     hdf5_dict = read_hdf5(fname, title="mnepython", slash="replace")
     # single TFR from TFR.save()
     if "inst_type_str" in hdf5_dict:
-        inst_type_str = hdf5_dict["inst_type_str"]
-        Klass = dict(Epochs=EpochsTFR, Raw=RawTFR, Evoked=AverageTFR)[inst_type_str]
+        if hdf5_dict["data"].ndim == 4:
+            Klass = EpochsTFR
+        elif "nave" in hdf5_dict:
+            Klass = AverageTFR
+        else:
+            Klass = RawTFR
         out = Klass(inst=hdf5_dict)
         if getattr(out, "metadata", None) is not None:
             out.metadata = _prepare_read_metadata(out.metadata)


Test patch:
diff --git a/mne/time_frequency/tests/test_tfr.py b/mne/time_frequency/tests/test_tfr.py
--- a/mne/time_frequency/tests/test_tfr.py
+++ b/mne/time_frequency/tests/test_tfr.py
@@ -659,6 +659,18 @@ def test_tfr_io(inst, average_tfr, request, tmp_path):
         tfr.save(fname, overwrite=False)
 
 
+def test_roundtrip_from_legacy_func(epochs, tmp_path):
+    """Test save/load with TFRs generated by legacy method (gh-12512)."""
+    pytest.importorskip("h5io")
+
+    fname = tmp_path / "temp_tfr.hdf5"
+    tfr = tfr_morlet(
+        epochs, freqs=freqs_linspace, n_cycles=7, average=True, return_itc=False
+    )
+    tfr.save(fname, overwrite=True)
+    assert read_tfrs(fname) == tfr
+
+
 def test_raw_tfr_init(raw):
     """Test the RawTFR and RawTFRArray constructors."""
     one = RawTFR(inst=raw, method="morlet", freqs=freqs_linspace)
Repository: mne-tools/mne-python

Issue:
Evoked topomap amplitudes don't appear to match traces in Report
### Description of the problem

I'm not sure what exactly is going on here and it might not be a bug after all, but in a Report generated through MNE-BIDS-Pipeline I see things like the following for Evoked objects:

<img width="1070" alt="Screenshot 2023-10-25 at 23 00 52" src="https://github.com/mne-tools/mne-python/assets/2046265/d2a156ba-9998-4008-bd41-8ce364475b9e">

The topo color scale is somehow much bigger than the amplitude of the signal shown in the traces, hence all colors in the topomap are really faint

### Steps to reproduce

I don't have a MWE yet


### Link to data

_No response_

### Expected results

Topomap value range should correspond to signal amplitudes in the traces plot

### Actual results

Topomap value range is much larger

### Additional information

–


Discussion:
Top plot looks correct. Bottom plot looks like the vlim isn't set properly for some reason. Perhaps it's calculated on a longer segment (e.g. 3 or 10s) where the drift *does* go up to +/- 45 uV but the slider only gets created for the interval 0-1.5s or something? In that case I guess Report should be smarter about calculating the min/max vlim using only the time span of interest
I agree, the plot shows the correct values, but the limits are somehow too wide
@hoechenberger can you share the Evoked file privately with me?

If not, one possibility is that in one case the vlim is being computed *before* an average ref proj is added and applied for example. Another is that it's being computed before baselining is done. Another is that there is some time cropping being done somewhere (as alluded to above). If you can see which of these is likely the culprit by loading the Evoked and looking at `np.abs(evoked.data).max()` right on load, after `.apply_proj()`, after `.apply_baseline((None, 0))`, etc. you might be able to isolate it. And once you know which one it is, creating a MWE without sharing the data might not be too difficult for you or me.
@larsoner I'm busy today, I'll see what I can do
Thanks for your help!

Resolving patch:
diff --git a/mne/report/report.py b/mne/report/report.py
--- a/mne/report/report.py
+++ b/mne/report/report.py
@@ -3549,7 +3549,9 @@ def _add_evoked_topomap_slider(
                 continue
 
             vmax[ch_type] = (
-                np.abs(evoked.copy().pick(ch_type, verbose=False).data).max()
+                np.abs(
+                    evoked.copy().pick(ch_type, exclude="bads", verbose=False).data
+                ).max()
             ) * scalings[ch_type]
             if ch_type == "grad":
                 vmin[ch_type] = 0


Test patch:
Repository: lk-geimfari/mimesis

Issue:
Replace requirements.txt with Pipfile
Pipenv (which works with Pipfile) is officially recommended Python packaging tool from Python.org. We should use it instead `requirements.txt `.
  


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -85,12 +85,6 @@
 
 here = abspath(dirname(__file__))
 
-try:
-    with open('dev_requirements.txt') as f:
-        tests_requirements = f.read().splitlines()
-except FileNotFoundError:
-    tests_requirements = []
-
 about = {}
 # Get meta-data from __version__.py
 with open(join(here, 'mimesis', '__version__.py')) as f:
@@ -125,26 +119,6 @@ def run(self):
         sys.exit()
 
 
-class PyTest(TestCommand):
-    """Custom command for running test using setup.py test"""
-
-    user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
-
-    def initialize_options(self):
-        TestCommand.initialize_options(self)
-        self.pytest_args = []
-
-    def finalize_options(self):
-        TestCommand.finalize_options(self)
-        self.test_args = []
-        self.test_suite = True
-
-    def run_tests(self):
-        import pytest
-        errno = pytest.main(self.pytest_args)
-        exit(errno)
-
-
 class Minimizer(BaseCommand):
     """Minify content of all json file for all locales.
     """
@@ -346,9 +320,7 @@ def run(self):
         'Topic :: Software Development',
         'Topic :: Software Development :: Testing',
     ],
-    tests_require=tests_requirements,
     cmdclass={
-        'test': PyTest,
         'version': Version,
         'minify': Minimizer,
         'upload': Upload,


Test patch:
diff --git a/tests/test_utils.py b/tests/test_utils.py
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -15,9 +15,8 @@ def is_connected():
         host = socket.gethostbyname('https://github.com/')
         socket.create_connection((host, 80), 2)
         return True
-    except:
-        pass
-    return False
+    except Exception:
+        return False
 
 
 def test_luhn_checksum():
Repository: lk-geimfari/mimesis

Issue:
Change current development workflow
I have not seen the project in a while and have not contributed to it. I was confused about different tools and workflow this project uses:

1. `setup.py` commands
2. `Makefile`
3. `tox`
4. custom commands in CI

What do I suggest:
1. Stick to one thing only. It might be whatever we choose, but this tool should be the only possible way to do things
2. Update `Contributing.md`, since it does not contain any helpful information. What should be there? A step by step instruction how to do things. How to install dependencies? How to test your code? How to upload it to `pypi`?


Discussion:
@sobolevn I think that `tox` is overhead because we already use `Travis CI` which doing same things and even more.

About the second point: I'll updated file asap.
@lk-geimfari But `tox` can run tests on several environments. It's very useful for a developer to final testing before push changes.
@duckyou I agree with you. But if we are creating the new branch for every new feature then `push` is not a problem I think. The code which works on Python 3.5 likely will work on Python 3.6.

We can vote what will be better if you want. 

My opinion:
**Pros**: Yes, it useful on some machines where does not installed both versions of Python.
**Cons**: It's duplicate functionality of Travis CI.
  
@sobolevn Your few words, please.
@lk-geimfari Okay, you're right. It's unnecessary tool with travis and appveyor.
+1 for removing `tox`. It serves well when we need to test both `py2` and `py3`, but it is not so important when dealing with only two very similar versions of `python3`.
  

Resolving patch:
diff --git a/mimesis/data/int/personal.py b/mimesis/data/int/personal.py
--- a/mimesis/data/int/personal.py
+++ b/mimesis/data/int/personal.py
@@ -3812,7 +3812,6 @@
     'vertebras',
     'vibrio',
     'viceless',
-    'vicuña',
     'videotape',
     'viking',
     'vilification',


Test patch:
Repository: lk-geimfari/mimesis

Issue:
I can't compile my project by pyinstaller
I have a script with code:
```
from mimesis import Personal
person = Personal('en')
person.full_name()
```
and it works well, but after compiling this code to .exe via pyinstaller I have an error **FileNotFoundError: [Errno 2] No such file or directory: 'B:\\_MEI131682\\mimesis\\data/es\\personal.json'
[20624] Failed to execute script myproject**
So, I think that problem in path (`data/es\\personal`). What ways of solving this problem can you recommend?


Discussion:
@h0n3yc4k3 Seems like we have [hardcoded path](https://github.com/lk-geimfari/mimesis/blob/master/mimesis/utils.py#L99). It's a bug.

Resolving patch:
diff --git a/mimesis/utils.py b/mimesis/utils.py
--- a/mimesis/utils.py
+++ b/mimesis/utils.py
@@ -96,7 +96,7 @@ def get_data(locale_name: str) -> JSON:
         :param locale_name: Locale name.
         :return: Content of JSON file as dict.
         """
-        file_path = path.join(DATA_DIR + '/' + locale_name, file)
+        file_path = path.join(DATA_DIR, locale_name, file)
         # Needs explicit encoding for Windows
         with open(file_path, 'r', encoding='utf8') as f:
             return json.load(f)


Test patch:
Repository: lk-geimfari/mimesis

Issue:
Fix mypy issues
There are several things to consider:

1. Fixing bugs like this one: https://travis-ci.org/lk-geimfari/mimesis/jobs/361128185#L600
2. Adding new options to `mypy` to make it stricter: https://github.com/wemake-services/wemake-django-template/blob/master/%7B%7Bcookiecutter.project_name%7D%7D/setup.cfg#L67
3. Add `tests` folder to be checked by `mypy` (not only `mimesis/` folder is checked)

I can do it, if @lk-geimfari does not have anything to add/comment.


Discussion:
@sobolevn Sure!

Resolving patch:
diff --git a/mimesis/providers/payment.py b/mimesis/providers/payment.py
--- a/mimesis/providers/payment.py
+++ b/mimesis/providers/payment.py
@@ -119,7 +119,9 @@ def credit_card_number(self, card_type: Optional[CardType] = None) -> str:
         while len(str_num) < length - 1:
             str_num += self.random.choice(string.digits)
 
-        groups = regex.search(str_num + luhn_checksum(str_num)).groups()
+        groups = regex.search(  # type: ignore
+            str_num + luhn_checksum(str_num),
+        ).groups()
         card = ' '.join(groups)
         return card
 


Test patch:
diff --git a/tests/test_builtins/ru/test_russia_spec.py b/tests/test_builtins/ru/test_russia_spec.py
--- a/tests/test_builtins/ru/test_russia_spec.py
+++ b/tests/test_builtins/ru/test_russia_spec.py
@@ -11,15 +11,15 @@ def russia():
 
 
 def test_passport_series(russia):
-    result = russia.passport_series()
-    assert result is not None
-    result = result.split(' ')
-    assert isinstance(result, list)
+    series = russia.passport_series()
+    assert isinstance(series.split(' '), list)
+
 
-    result = russia.passport_series(year=10)
-    region, year = result.split(' ')
+def test_passport_series_parametrized(russia):
+    series = russia.passport_series(year=10)
+    region, year = series.split(' ')
     assert int(year) == 10
-    assert region is not None
+    assert 0 < int(region) < 100
 
 
 def test_passport_number(russia):
diff --git a/tests/test_providers/test_path.py b/tests/test_providers/test_path.py
--- a/tests/test_providers/test_path.py
+++ b/tests/test_providers/test_path.py
@@ -28,10 +28,12 @@ def test_user(self, path):
             'win32': '(C)(:)(\\\\)(Users)(\\\\).*[^(\\\\)]',
             'linux': '(/)(home)(/).*',
         }
+
         if path.platform == 'win32':
-            pattern = pattern_dictionary.get('win32')
+            pattern = pattern_dictionary['win32']
         else:
-            pattern = pattern_dictionary.get('linux')
+            pattern = pattern_dictionary['linux']
+
         result = re.search(pattern, user)
         assert isinstance(result, type(re.search('', ''))) is True
 
diff --git a/tests/test_schema.py b/tests/test_schema.py
--- a/tests/test_schema.py
+++ b/tests/test_schema.py
@@ -73,7 +73,7 @@ def test_fill(_, valid_schema):
     assert isinstance(result[0], dict)
 
     with pytest.raises(UndefinedSchema):
-        Schema(schema=None).create()
+        Schema(schema=None).create()  # type: ignore
 
 
 def test_field_with_key(_):
Repository: lk-geimfari/mimesis

Issue:
romanized decorator mutates ROMANIZATION_DICT
After `@romanized` is used, ROMANIZATION_DICT gets updated and every module importing it will get this mutated ROMANIZATION_DICT.
Snippet below should reproduce problem.
```
from mimesis import decorators, data


if __name__ == '__main__':
    print('ROMANIZATION_DICT: before')
    print(data.ROMANIZATION_DICT)

    @decorators.romanized('ru')
    def russian_name(): return 'Петр Петрович'
    # next line is where ROMANIZATION_DICT mutates
    russian_name()

    print('ROMANIZATION_DICT: after')
    print(data.ROMANIZATION_DICT)
```
Problem is here:
https://github.com/lk-geimfari/mimesis/blob/master/mimesis/decorators.py#L29



Discussion:

Resolving patch:
diff --git a/mimesis/decorators.py b/mimesis/decorators.py
--- a/mimesis/decorators.py
+++ b/mimesis/decorators.py
@@ -24,13 +24,13 @@ def romanized_deco(func):
         @functools.wraps(func)
         def wrapper(*args, **kwargs):
             try:
-                alphabet = data.ROMANIZATION_DICT[locale]
-                # Add common cyrillic common letters
-                alphabet.update(data.COMMON_LETTERS)
                 # String can contain ascii symbols, digits and
                 # punctuation symbols.
-                alphabet.update({s: s for s in
-                                 letters + digits + punctuation})
+                alphabet = {s: s for s in
+                            letters + digits + punctuation}
+                alphabet.update(data.ROMANIZATION_DICT[locale])
+                # Add common cyrillic letters
+                alphabet.update(data.COMMON_LETTERS)
             except KeyError:
                 raise UnsupportedLocale(locale)
             result = func(*args, **kwargs)


Test patch:
diff --git a/tests/test_decorators.py b/tests/test_decorators.py
--- a/tests/test_decorators.py
+++ b/tests/test_decorators.py
@@ -3,6 +3,20 @@
 import mimesis.decorators
 
 
+def test_romanization_dict_is_unchanged():
+    from copy import deepcopy
+    from mimesis.data import ROMANIZATION_DICT
+
+    old_data = deepcopy(ROMANIZATION_DICT)
+
+    @mimesis.decorators.romanized('ru')
+    def some_name():
+        return 'Абырвалг Аристархович'
+
+    some_name()
+    assert ROMANIZATION_DICT == old_data
+
+
 @pytest.fixture
 @mimesis.decorators.romanized('ru')
 def russian_name():
Repository: lk-geimfari/mimesis

Issue:
Country generation does not respect chosen locale
It appears that `Address('en').country()` does not respect the locale. Countries outside locale are still generated. 

Looking at the code it appears there is no implementation for locale specific country, if so, please change issue to a feature request.


Discussion:
Can you explain, please, what do you exactly expect? `.country()` returns name of the country for the current locale.

For example:

```
address = Address('ru')

address.country()
'Китай'

address.country()
'Россия'
```

Do you expect something like this?
```
address = Address('en')

address.country()
'United States of America'

address.country()
'United States of America'
```
Yes my understanding was that it would return a country who belongs to the locale. Now I can see that it is not the case and it is intended to be that way. Thanks.

Nevertheless locale/region specific data would be a great feature (like cities, countries, etc)
@andkii We will fix it ASAP. By default, it must return the name of the current country.

We can just add a parameter `allow_random` which will allow random values for it.

@ceccoemi If my memory doesn't let me down, you've already done something like this, haven't you?
Yes, we did the same thing in #664

I will work on it!
Great! Thanks!

Resolving patch:
diff --git a/mimesis/providers/address.py b/mimesis/providers/address.py
--- a/mimesis/providers/address.py
+++ b/mimesis/providers/address.py
@@ -186,13 +186,16 @@ def country_code(self, fmt: Optional[CountryCode] = CountryCode.A2) -> str:
         key = self._validate_enum(fmt, CountryCode)
         return self.random.choice(COUNTRY_CODES[key])
 
-    def country(self) -> str:
-        """Get a random country.
+    def country(self, allow_random: bool = False) -> str:
+        """Get the country of the current locale.
 
+        :allow_random: Return a random country name.
         :return: The Country.
         """
-        return self.random.choice(
-            self._data['country']['name'])
+        if allow_random:
+            return self.random.choice(self._data['country']['name'])
+        else:
+            return self._data['country']['current_locale']
 
     def city(self) -> str:
         """Get a random city.


Test patch:
diff --git a/tests/test_providers/test_address.py b/tests/test_providers/test_address.py
--- a/tests/test_providers/test_address.py
+++ b/tests/test_providers/test_address.py
@@ -129,7 +129,12 @@ def test_zip_code(self, address):
         assert address.zip_code()
 
     def test_country(self, address):
-        result = address.country()
+        result_1 = address.country()
+        result_2 = address.country()
+        expected = address._data['country']['current_locale']
+        assert result_1 == result_2 == expected
+
+        result = address.country(allow_random=True)
         assert result in address._data['country']['name']
 
     @pytest.mark.parametrize(
Repository: lk-geimfari/mimesis

Issue:
Migrate to poetry for dependency management.
Pipenv just sucks. We should use poetry.

Files to update:
- [x] Update `CONTRIBUTING.rst`
- [x] Update `.travis.yml`



Discussion:

Resolving patch:
diff --git a/mimesis/providers/internet.py b/mimesis/providers/internet.py
--- a/mimesis/providers/internet.py
+++ b/mimesis/providers/internet.py
@@ -185,14 +185,12 @@ def stock_image(width: Union[int, str] = 1920,
                     height: Union[int, str] = 1080,
                     keywords: Optional[List[str]] = None,
                     writable: bool = False) -> Union[str, bytes]:
-        """Generate random stock image (JPEG) hosted on
-        Unsplash (link to the image of writable sequence ob bytes).
+        """Generate random stock image (JPEG) hosted on Unsplash.
 
         See «Random search term» on https://source.unsplash.com/
         for more details.
 
         .. note:: This method required an active HTTP connection.
-        .. note:: This method might be slow because of HTTP requests.
 
         :param width: Width of the image.
         :param height: Height of the image.
diff --git a/mimesis/providers/numbers.py b/mimesis/providers/numbers.py
--- a/mimesis/providers/numbers.py
+++ b/mimesis/providers/numbers.py
@@ -135,7 +135,7 @@ def decimal_number(self, start: float = -1000.0,
 
     def decimals(self, start: float = 0.0,
                  end: float = 1000.0, n: int = 10) -> List[Decimal]:
-        """Generate decimal number as Decimal objects
+        """Generate decimal number as Decimal objects.
 
         :param start: Start range.
         :param end: End range.
diff --git a/mimesis/providers/person.py b/mimesis/providers/person.py
--- a/mimesis/providers/person.py
+++ b/mimesis/providers/person.py
@@ -305,7 +305,7 @@ def gender(self, iso5218: bool = False,
         return self.random.choice(self._data['gender'])
 
     def sex(self, *args, **kwargs):
-        """An alias for method self.gender()
+        """An alias for method self.gender().
 
         See docstrings of method self.gender() for details.
 
@@ -316,7 +316,7 @@ def sex(self, *args, **kwargs):
         return self.gender(*args, **kwargs)
 
     def height(self, minimum: float = 1.5, maximum: float = 2.0) -> str:
-        """Generate a random height in M (Meter).
+        """Generate a random height in meters.
 
         :param minimum: Minimum value.
         :param float maximum: Maximum value.


Test patch:
diff --git a/tests/test_builtins/en/test_usa_spec.py b/tests/test_builtins/en/test_usa_spec.py
--- a/tests/test_builtins/en/test_usa_spec.py
+++ b/tests/test_builtins/en/test_usa_spec.py
@@ -47,6 +47,6 @@ def test_ssn(usa):
 
 
 def test_cpf_with_666_prefix(mocker, usa):
-    with mocker.patch.object(usa.random, 'randint', return_value=666):
-        result = usa.ssn()
-        assert '665' == result[:3]
+    mocker.patch.object(usa.random, 'randint', return_value=666)
+    result = usa.ssn()
+    assert '665' == result[:3]