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

Issue:
fontawesome icons not displaying correctly

https://mne.tools/dev/install/installers.html

<img width="669" alt="Screenshot 2022-11-12 at 16 01 25" src="https://user-images.githubusercontent.com/2046265/201480264-47d32a2a-2f70-4da3-b7de-91c29bec6340.png">



Discussion:
Argh, it's broken on dev and stable. Maybe some pydata-sphinx-theme bug -- @drammock can you look?

Resolving patch:
diff --git a/doc/conf.py b/doc/conf.py
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -1012,35 +1012,27 @@ def reset_warnings(gallery_conf, fname):
 brand_icons = ('apple', 'linux', 'windows', 'discourse', 'python')
 fixed_width_icons = (
     # homepage:
-    'book', 'code-branch', 'newspaper', 'question-circle', 'quote-left',
+    'book', 'code-branch', 'newspaper', 'circle-question', 'quote-left',
     # contrib guide:
-    'bug', 'comment', 'hand-sparkles', 'magic', 'pencil-alt', 'remove-format',
-    'universal-access', 'discourse', 'python',
+    'bug-slash', 'comment', 'computer-mouse', 'hand-sparkles', 'pencil',
+    'text-slash', 'universal-access', 'wand-magic-sparkles',
+    'discourse', 'python',
 )
 other_icons = (
     'hand-paper', 'question', 'rocket', 'server', 'code', 'desktop',
-    'terminal', 'cloud-download-alt', 'wrench', 'hourglass'
+    'terminal', 'cloud-arrow-down', 'wrench', 'hourglass-half'
 )
-icons = dict()
+icon_class = dict()
 for icon in brand_icons + fixed_width_icons + other_icons:
-    font_class = ('fa-brands' if icon in brand_icons else 'fa-solid',)
-    icons[icon] = font_class + ('fa-fw',) if icon in fixed_width_icons else ()
+    icon_class[icon] = ('fa-brands',) if icon in brand_icons else ('fa-solid',)
+    icon_class[icon] += ('fa-fw',) if icon in fixed_width_icons else ()
 
 prolog = ''
-for icon, classes in icons.items():
+for icon, classes in icon_class.items():
     prolog += f'''
 .. |{icon}| raw:: html
 
-    <i class="{' '.join(classes)} fa-{icon}"></i>
-'''
-
-prolog += '''
-.. |fix-bug| raw:: html
-
-    <span class="fa-stack small-stack">
-        <i class="fas fa-bug fa-stack-1x"></i>
-        <i class="fas fa-ban fa-stack-2x"></i>
-    </span>
+    <i class="{' '.join(classes + (f'fa-{icon}',))}"></i>
 '''
 
 prolog += '''


Test patch:
Repository: mne-tools/mne-python

Issue:
Spectrum's to_data_frame() wrong name for appended column
### Proposed documentation enhancement

The method's docstring refers to the appended column as "frequencies", but the returned dataframe has "freq".


Discussion:

Resolving patch:
diff --git a/mne/time_frequency/spectrum.py b/mne/time_frequency/spectrum.py
--- a/mne/time_frequency/spectrum.py
+++ b/mne/time_frequency/spectrum.py
@@ -730,7 +730,7 @@ def to_data_frame(self, picks=None, index=None, copy=True,
         """Export data in tabular structure as a pandas DataFrame.
 
         Channels are converted to columns in the DataFrame. By default,
-        an additional column "frequency" is added, unless ``index='freq'``
+        an additional column "freq" is added, unless ``index='freq'``
         (in which case frequency values form the DataFrame's index).
 
         Parameters


Test patch:
Repository: mne-tools/mne-python

Issue:
MAINT: Switch to setuptools_scm
See for example

https://github.com/LABSN/tdtpy/pull/20

It basically does the `.dev` and versions for us automatically based on tags.

I think we *do* want to write `_version.py` in order to avoid people needing `setuptools_scm` (and new-ish setuptools or whatever) for our released versions. This is how `tdtpy` does it above. But I haven't totally thought it through...

We could maybe also transition to a `pyproject.toml` while we're at it.


Discussion:

Resolving patch:
diff --git a/mne/__init__.py b/mne/__init__.py
--- a/mne/__init__.py
+++ b/mne/__init__.py
@@ -16,7 +16,14 @@
 # Dev branch marker is: 'X.Y.devN' where N is an integer.
 #
 
-from ._version import __version__
+try:
+    from importlib.metadata import version
+    __version__ = version("mne")
+except Exception:
+    try:
+        from ._version import __version__
+    except ImportError:
+        __version__ = '0.0.0'
 
 # have to import verbose first since it's needed by many things
 from .utils import (set_log_level, set_log_file, verbose, set_config,
diff --git a/mne/_version.py b/mne/_version.py
deleted file mode 100644
--- a/mne/_version.py
+++ /dev/null
@@ -1,6 +0,0 @@
-"""The version number."""
-# Authors: Eric Larson <larson.eric.d@gmail.com>
-#
-# License: BSD-3-Clause
-
-__version__ = '1.4.dev0'
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -22,17 +22,6 @@ def parse_requirements_file(fname):
     return requirements
 
 
-# get the version (don't import mne here, so dependencies are not needed)
-version = None
-with open(op.join('mne', '_version.py'), 'r') as fid:
-    for line in (line.strip() for line in fid):
-        if line.startswith('__version__'):
-            version = line.split('=')[1].strip().strip('\'')
-            break
-if version is None:
-    raise RuntimeError('Could not determine version')
-
-
 DISTNAME = 'mne'
 DESCRIPTION = 'MNE-Python project for MEG and EEG data analysis.'
 MAINTAINER = 'Alexandre Gramfort'
@@ -40,7 +29,6 @@ def parse_requirements_file(fname):
 URL = 'https://mne.tools/dev/'
 LICENSE = 'BSD-3-Clause'
 DOWNLOAD_URL = 'http://github.com/mne-tools/mne-python'
-VERSION = version
 
 
 def package_tree(pkgroot):
@@ -74,7 +62,6 @@ def package_tree(pkgroot):
           description=DESCRIPTION,
           license=LICENSE,
           url=URL,
-          version=VERSION,
           download_url=DOWNLOAD_URL,
           long_description=long_description,
           long_description_content_type='text/x-rst',
@@ -100,6 +87,11 @@ def package_tree(pkgroot):
           platforms='any',
           python_requires='>=3.7',
           install_requires=install_requires,
+          setup_requires=["setuptools>=45", "setuptools_scm>=6.2"],
+          use_scm_version={
+              "write_to": "mne/_version.py",
+              "version_scheme": "release-branch-semver",
+          },
           extras_require={
               'data': data_requires,
               'hdf5': hdf5_requires,


Test patch:
Repository: mne-tools/mne-python

Issue:
Support `~` in config
It seems like we currently do not support `~` in our config, e.g.

```python
import mne

mne.set_config("MNE_DATA", "~/Data")
mne.datasets.sample.data_path()
```

raises a `FileNotFoundError: Download location ~/Data as specified by MNE_DATA does not exist. Either create this directory manually and try again, or set MNE_DATA to an existing directory.` (the directory exists).

Is there a reason why we would not want to expand the tilde? This would be useful to store MNE data in the same location within a user's home directory across operating systems.


Discussion:
that's a bug. We should expand the ~

can you open a PR? thx

> Message ID: ***@***.***>
>


Resolving patch:
diff --git a/mne/datasets/utils.py b/mne/datasets/utils.py
--- a/mne/datasets/utils.py
+++ b/mne/datasets/utils.py
@@ -98,12 +98,13 @@ def _get_path(path, key, name):
     # 3. get_config('MNE_DATA')
     path = get_config(key or 'MNE_DATA', get_config('MNE_DATA'))
     if path is not None:
-        if not op.exists(path):
+        path = Path(path).expanduser()
+        if not path.exists():
             msg = (f"Download location {path} as specified by MNE_DATA does "
                    f"not exist. Either create this directory manually and try "
                    f"again, or set MNE_DATA to an existing directory.")
             raise FileNotFoundError(msg)
-        return Path(path)
+        return path
     # 4. ~/mne_data (but use a fake home during testing so we don't
     #    unnecessarily create ~/mne_data)
     logger.info('Using default location ~/mne_data for %s...' % name)


Test patch:
Repository: mne-tools/mne-python

Issue:
Rename "Discourse" link in top navigation to "Forum" or "User Forum"
### Proposed documentation enhancement

When hovering over the Discourse icon in our navigation, the alt / link text that pops up is "Discourse". Now, if one doesn't know that this is meant to be a forum, one will only find out after clicking on it (if one dares to click). I'd like to propose renaming the link to "Forum" or "User Forum" for clarity.


Discussion:
👍 for "Forum".
I'm fine with "Forum" or "User Forum". Slight preference for "Forum" because we also want Discourse to be a place for *contributors* to ask questions.

Resolving patch:
diff --git a/doc/conf.py b/doc/conf.py
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -617,7 +617,7 @@ def append_attr_meth_examples(app, what, name, obj, options, lines):
         dict(name='Twitter',
              url='https://twitter.com/mne_python',
              icon='fa-brands fa-square-twitter'),
-        dict(name='Discourse',
+        dict(name='Forum',
              url='https://mne.discourse.group/',
              icon='fa-brands fa-discourse'),
         dict(name='Discord',


Test patch:
Repository: mne-tools/mne-python

Issue:
bad dark mode CSS for HTML tables
every other line is almost unreadable. This is from 
https://mne.tools/dev/auto_tutorials/preprocessing/10_preprocessing_overview.html

![Screenshot 2023-03-17 at 17-30-06 Overview of artifact detection — MNE 1 4 0 dev74 g6384a8901 documentation](https://user-images.githubusercontent.com/1810515/226063967-ac43fdf0-c4fe-48b9-b49a-c23664216fa6.png)



Discussion:
I have noticed something similar on the output:

![image](https://user-images.githubusercontent.com/20129119/227893076-2bf05997-1a34-48b7-b4a8-ef6e8c09a04b.png)

from https://mne.tools/mne-connectivity/stable/auto_examples/cwt_sensor_connectivity.html

Resolving patch:
diff --git a/tutorials/preprocessing/10_preprocessing_overview.py b/tutorials/preprocessing/10_preprocessing_overview.py
--- a/tutorials/preprocessing/10_preprocessing_overview.py
+++ b/tutorials/preprocessing/10_preprocessing_overview.py
@@ -130,7 +130,6 @@
 # around 20 seconds, so in this case a cutoff of 0.1 Hz would probably suppress
 # most of the drift).
 #
-#
 # Power line noise
 # ~~~~~~~~~~~~~~~~
 #


Test patch:
Repository: mne-tools/mne-python

Issue:
pick_events include does not validate the type of its input
I used `mne.pick_events` and tried to pass a dictionary with a mapping `label: event_id` in  `include`.
The code fails with a `RuntimeError: No events found`, which is hard to debug IMO.

I think verifying in the following line that we have an integer if `include` is not a list and raising an error otherwise would give better feedback.

https://github.com/mne-tools/mne-python/blob/817b56298fd164f3b02f5c159044c93e19fd9335/mne/event.py#LL62C8-L62C8


Discussion:

Resolving patch:
diff --git a/mne/event.py b/mne/event.py
--- a/mne/event.py
+++ b/mne/event.py
@@ -24,6 +24,7 @@
     _check_fname,
     _on_missing,
     _check_on_missing,
+    _check_integer_or_list,
 )
 from .io.constants import FIFF
 from .io.tree import dir_tree_find
@@ -59,8 +60,7 @@ def pick_events(events, include=None, exclude=None, step=False):
         The list of events.
     """
     if include is not None:
-        if not isinstance(include, list):
-            include = [include]
+        include = _check_integer_or_list(include, "include")
         mask = np.zeros(len(events), dtype=bool)
         for e in include:
             mask = np.logical_or(mask, events[:, 2] == e)
@@ -68,8 +68,7 @@ def pick_events(events, include=None, exclude=None, step=False):
                 mask = np.logical_or(mask, events[:, 1] == e)
         events = events[mask]
     elif exclude is not None:
-        if not isinstance(exclude, list):
-            exclude = [exclude]
+        exclude = _check_integer_or_list(exclude, "exclude")
         mask = np.ones(len(events), dtype=bool)
         for e in exclude:
             mask = np.logical_and(mask, events[:, 2] != e)
diff --git a/mne/utils/__init__.py b/mne/utils/__init__.py
--- a/mne/utils/__init__.py
+++ b/mne/utils/__init__.py
@@ -28,6 +28,7 @@
     _check_if_nan,
     _is_numeric,
     _ensure_int,
+    _check_integer_or_list,
     _check_preload,
     _validate_type,
     _check_range,
diff --git a/mne/utils/check.py b/mne/utils/check.py
--- a/mne/utils/check.py
+++ b/mne/utils/check.py
@@ -35,6 +35,16 @@ def _ensure_int(x, name="unknown", must_be="an int", *, extra=""):
     return x
 
 
+def _check_integer_or_list(arg, name):
+    """Validate arguments that should be an integer or a list.
+
+    Always returns a list.
+    """
+    if not isinstance(arg, list):
+        arg = [_ensure_int(arg, name=name, must_be="an integer or a list")]
+    return arg
+
+
 def check_fname(fname, filetype, endings, endings_err=()):
     """Enforce MNE filename conventions.
 


Test patch:
diff --git a/mne/tests/test_event.py b/mne/tests/test_event.py
--- a/mne/tests/test_event.py
+++ b/mne/tests/test_event.py
@@ -424,6 +424,12 @@ def test_pick_events():
         [[1, 0, 1], [2, 1, 0], [4, 4, 2], [5, 2, 0]],
     )
 
+    with pytest.raises(TypeError, match="must be an integer or a list"):
+        pick_events(events, include=1.2)
+
+    with pytest.raises(TypeError, match="must be an integer or a list"):
+        pick_events(events, include={"a": 1})
+
 
 def test_make_fixed_length_events():
     """Test making events of a fixed length."""
Repository: mne-tools/mne-python

Issue:
Standard Montage: easycap-M43
Fixes:  #11737

What does this implement/fix?

- Creates a standard montage layout for easycap-M43 system.


Discussion:
@dasdiptyajit the CI checks come back with a failure. In particular, this line need to be updated to say 28, instead of 27.

https://github.com/dasdiptyajit/mne-python/blob/d13ed40e6a77d46ba2419961532340e6a75d4261/mne/channels/tests/test_montage.py#L1918

Having that said, I haven't been a very good example by just pushing a commit and letting the CI run before checking locally that it would pass.

I would ask you kindly to read our [contributor guide](https://mne.tools/dev/install/contributing.html), in particular the parts about setting up you local development environment, so that you can run the full test suite *locally*. Ideally, you would (in the future) always:

1. make several commits locally (as many as needed)
2. test them locally
3. push them to the remote

That way we can minimize the time that our (paid) CI services run.

Thanks again for your contribution, and I believe that this is the last check that needs to be fixed before a merge.
@sappelhoff No problem. I will follow your advice and try to resolve the issue soon. This is also my first time contributing to MNE, so I am getting familiar with the setup :)  
 
I am fixing this. My commits sign were apparently unverified. My bad. 

Resolving patch:
diff --git a/mne/channels/_standard_montage_utils.py b/mne/channels/_standard_montage_utils.py
--- a/mne/channels/_standard_montage_utils.py
+++ b/mne/channels/_standard_montage_utils.py
@@ -124,6 +124,7 @@ def _mgh_or_standard(basename, head_size, coord_frame="unknown"):
     "EGI_256": _egi_256,
     "easycap-M1": partial(_easycap, basename="easycap-M1.txt"),
     "easycap-M10": partial(_easycap, basename="easycap-M10.txt"),
+    "easycap-M43": partial(_easycap, basename="easycap-M43.txt"),
     "GSN-HydroCel-128": partial(_hydrocel, basename="GSN-HydroCel-128.sfp"),
     "GSN-HydroCel-129": partial(_hydrocel, basename="GSN-HydroCel-129.sfp"),
     "GSN-HydroCel-256": partial(_hydrocel, basename="GSN-HydroCel-256.sfp"),
diff --git a/mne/channels/montage.py b/mne/channels/montage.py
--- a/mne/channels/montage.py
+++ b/mne/channels/montage.py
@@ -139,6 +139,10 @@ class _BuiltinStandardMontage:
         name="easycap-M10",
         description="EasyCap with numbered electrodes (61 locations)",
     ),
+    _BuiltinStandardMontage(
+        name="easycap-M43",
+        description="EasyCap with numbered electrodes (64 locations)",
+    ),
     _BuiltinStandardMontage(
         name="EGI_256",
         description="Geodesic Sensor Net (256 locations)",


Test patch:
diff --git a/mne/channels/tests/test_montage.py b/mne/channels/tests/test_montage.py
--- a/mne/channels/tests/test_montage.py
+++ b/mne/channels/tests/test_montage.py
@@ -1915,7 +1915,7 @@ def test_read_dig_hpts():
 
 def test_get_builtin_montages():
     """Test help function to obtain builtin montages."""
-    EXPECTED_COUNT = 27
+    EXPECTED_COUNT = 28
 
     montages = get_builtin_montages()
     assert len(montages) == EXPECTED_COUNT
Repository: mne-tools/mne-python

Issue:
Keeping event names when combining channel on epochs objects
### New feature or enhancement

When we create a new `mne.Epochs` instance through `mne.channels.combine_channels`, the newly created instance should have the same event id and event names than the input instance. However, the new instance contains only the events array (coming from `mne.Epochs.events`) but not the dictionary mapping the id to their corresponding names (coming from `mne.Epochs.event_id`). 
Therefore the implementation would be to add in `mne.channels.combine_channels` a way to take account the event mapping from the input instance.

### Proposed implementation

I will just add `event_id = inst.event_id` when calling `mne.EpochsArray` in `mne.channels.combine_channels`

### Possible alternatives

None

### Additional context

_No response_


Discussion:
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴


Resolving patch:
diff --git a/mne/channels/channels.py b/mne/channels/channels.py
--- a/mne/channels/channels.py
+++ b/mne/channels/channels.py
@@ -2300,6 +2300,7 @@ def combine_channels(
             new_data,
             info,
             events=inst.events,
+            event_id=inst.event_id,
             tmin=inst.times[0],
             baseline=inst.baseline,
         )


Test patch:
Repository: mne-tools/mne-python

Issue:
mne.io.read_raw() should add mapping to read_raw_curry()
### Describe the new feature or enhancement

I wanted to read a Curry (.cdt) file via `read_raw()` instead of `read_raw_curry()`. However, it appears this is currently not supported.

### Describe your proposed implementation

`read_raw()` should add a mapping to `read_raw_curry()` for the respective Curry filename extensions.

### Describe possible alternatives

–

### Additional context

Currently, I receive:

```python
ValueError: Unsupported file type (.cdt). Consider using a dedicated reader function for more options.
```


Discussion:
Do you have time to add it? It's basically only two additional lines [here](https://github.com/mne-tools/mne-python/blob/main/mne/io/_read_raw.py) Are there any other readers that should be integrated while we're at it?

If you don't have time I can do it.

Resolving patch:
diff --git a/mne/io/_read_raw.py b/mne/io/_read_raw.py
--- a/mne/io/_read_raw.py
+++ b/mne/io/_read_raw.py
@@ -28,6 +28,8 @@
     read_raw_snirf,
     read_raw_fil,
     read_raw_nihon,
+    read_raw_curry,
+    read_raw_nedf,
 )
 from ..utils import fill_doc
 
@@ -68,6 +70,16 @@ def _read_unsupported(fname, **kwargs):
     ".con": dict(KIT=read_raw_kit),
     ".ds": dict(CTF=read_raw_ctf),
     ".txt": dict(BOXY=read_raw_boxy),
+    # Curry
+    ".dat": dict(CURRY=read_raw_curry),
+    ".dap": dict(CURRY=read_raw_curry),
+    ".rs3": dict(CURRY=read_raw_curry),
+    ".cdt": dict(CURRY=read_raw_curry),
+    ".cdt.dpa": dict(CURRY=read_raw_curry),
+    ".cdt.cef": dict(CURRY=read_raw_curry),
+    ".cef": dict(CURRY=read_raw_curry),
+    # NEDF
+    ".nedf": dict(NEDF=read_raw_nedf),
 }
 
 # known but unsupported file formats
@@ -108,7 +120,8 @@ def read_raw(fname, *, preload=False, verbose=None, **kwargs):
     `~mne.io.read_raw_eximia`, `~mne.io.read_raw_fieldtrip`,
     `~mne.io.read_raw_fif`,  `~mne.io.read_raw_gdf`, `~mne.io.read_raw_kit`,
     `~mne.io.read_raw_fil`,
-    `~mne.io.read_raw_nicolet`, and `~mne.io.read_raw_nirx`.
+    `~mne.io.read_raw_nicolet`, `~mne.io.read_raw_nirx`,
+    `~mne.io.read_raw_curry`, and `~mne.io.read_raw_nedf`.
 
     Parameters
     ----------


Test patch:
Repository: mne-tools/mne-python

Issue:
convert_flash_mrism: crush when flash30 and no flash5_reg.mgz file
Fixes #11842.
convert_flash_mris function in bem.py file
crush when flash30==True and no flash5_reg.mgz file generated
add dd missing_ok=True as it is done in line 2074



Discussion:

Resolving patch:
diff --git a/mne/bem.py b/mne/bem.py
--- a/mne/bem.py
+++ b/mne/bem.py
@@ -2060,7 +2060,7 @@ def convert_flash_mris(
                 (pm_dir / "flash5.mgz"),
             ]
             run_subprocess_env(cmd)
-            (pm_dir / "flash5_reg.mgz").unlink()
+            (pm_dir / "flash5_reg.mgz").unlink(missing_ok=True)
         else:
             logger.info("Synthesized flash 5 volume is already there")
     else:


Test patch:
Repository: mne-tools/mne-python

Issue:
ENH: Split whats_new
https://mne.tools/dev/whats_new.html is super long. It would probably be nicer to just show the changes from the previous version, but have links to the others in one of the sidebars if possible.

@drammock is this sort of thing possible with a hidden toctree or something?


Discussion:
For MNE-BIDS we basically have only the latest version's changes visible, and then there is a link to that huge list of all previous changes. Seems to work quite nicely. 


https://mne.tools/mne-bids/stable/whats_new.html
That would be fine, too!
just saying: I like the super-long changelog that has everything in it. It makes searching quite easy while the sidebar with its links still makes the length manageable. 

Resolving patch:
diff --git a/doc/conf.py b/doc/conf.py
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -1396,6 +1396,11 @@ def reset_warnings(gallery_conf, fname):
 
 rst_prolog += """
 .. |ensp| unicode:: U+2002 .. EN SPACE
+
+.. include:: /links.inc
+.. include:: /changes/names.inc
+
+.. currentmodule:: mne
 """
 
 # -- Dependency info ----------------------------------------------------------
diff --git a/tutorials/clinical/30_ecog.py b/tutorials/clinical/30_ecog.py
--- a/tutorials/clinical/30_ecog.py
+++ b/tutorials/clinical/30_ecog.py
@@ -52,8 +52,7 @@
 # Load in data and perform basic preprocessing
 # --------------------------------------------
 #
-# Let's load some ECoG electrode data with `mne-bids
-# <https://mne.tools/mne-bids/>`_.
+# Let's load some ECoG electrode data with `MNE-BIDS`_.
 #
 # .. note::
 #     Downsampling is just to save execution time in this example, you should
diff --git a/tutorials/preprocessing/40_artifact_correction_ica.py b/tutorials/preprocessing/40_artifact_correction_ica.py
--- a/tutorials/preprocessing/40_artifact_correction_ica.py
+++ b/tutorials/preprocessing/40_artifact_correction_ica.py
@@ -625,7 +625,6 @@
 #    https://en.wikipedia.org/wiki/Signal_separation
 # .. _`statistically independent`:
 #    https://en.wikipedia.org/wiki/Independence_(probability_theory)
-# .. _`scikit-learn`: https://scikit-learn.org
 # .. _`random seed`: https://en.wikipedia.org/wiki/Random_seed
 # .. _`regular expression`: https://www.regular-expressions.info/
 # .. _`qrs`: https://en.wikipedia.org/wiki/QRS_complex


Test patch: