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

Issue:
dkim "bind/named" format is invalid
# Impacted versions

* Modoboa: 1.10.3
* installer used: Yes
* Webserver: Nginx

# Steps to reproduce

Create a dkim key that is 2048 bits or larger in size.  Use the UI to copy out the DKIM record.  Paste it into a zone file.  It will not work because of length.

# Current behavior

It is invalid because no single segment may be longer than 255 characters.  It should be formatted in a similar way to what `amavisd-new showkeys` outputs:

```
; key#1 2048 bits, i=modoboa, d=flame.org, /srv/modoboa/dkim/flame.org.pem
modoboa._domainkey.flame.org.	3600 TXT (
  "v=DKIM1; p="
  "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4dm43kZt9PYLBArDIhYx"
  "wBhVLi7jE3LjGIE+OebPBnm4tRiv3V6lR4yzSx1vkALek22z3aYMAIhTJtEJSD5w"
  "vU83quCEWjUoKFaKXImsCaro4nMEvILWNaoqZcUyrX8RL+HYNPA5eN1f1dXotaoQ"
  "04EG0E0nJP++lXigIE1YHBdYJz9Pr/3ZmA4wKakDEb9slizxaDSIuQcSLMPoV8Mj"
  "BW3sa/TqcW+dOpfFmEN5PXr8cCwhYHVywJ9SuYScq0fIi4IQQQi/0daryYMpgWtr"
  "tIlDpEF7jHKurrQ0QIRsey8jvgjsaLiJxr4KfVo8maeKqJvlTA8VqMidF3JVpPQp"
  "2wIDAQAB")
```

This format is not strictly required, but it should take the now long string and break them up.  The nice thing about the format given by `amavisd-new` is that it includes a comment, so one can refer back to where this came from, the lines are individually short enough to easily display on a standard-sized terminal window, and the FQDN is present, so the current `$ORIGIN` value in the zone file doesn't affect this record.

# Expected behavior

See above.  Expected that I should be able to paste the output into a zone file, and have it work.



Discussion:

Resolving patch:
diff --git a/modoboa/admin/models/domain.py b/modoboa/admin/models/domain.py
--- a/modoboa/admin/models/domain.py
+++ b/modoboa/admin/models/domain.py
@@ -206,8 +206,21 @@ def used_quota_in_percent(self):
     @property
     def bind_format_dkim_public_key(self):
         """Return DKIM public key using Bind format."""
-        return "{}._domainkey.{}. 10800 IN TXT \"v=DKIM1; k=rsa; p={}\"".format(
-            self.dkim_key_selector, self.name, self.dkim_public_key)
+        record = "v=DKIM1;k=rsa;p=%s" % self.dkim_public_key
+        # TXT records longer than 255 characters need split into chunks
+        # split record into 74 character chunks (+2 for indent, +2 for quotes(")
+        # == 78 characters) to make more readable in text editors.
+        split_record = []
+        while record:
+            if len(record) > 74:
+                split_record.append("  \"%s\"" % record[:74])
+                record = record[74:]
+            else:
+                split_record.append("  \"%s\"" % record)
+                break
+        record = "\n".join(split_record)
+        return "{}._domainkey.{}. 10800 IN TXT (\n{})".format(
+            self.dkim_key_selector, self.name, record)
 
     def add_admin(self, account):
         """Add a new administrator to this domain.


Test patch:
Repository: modoboa/modoboa

Issue:
pip 10 (due April) breakages
pip 10 is due in April and they've chosen to refactor all of pip's code to `pip._internal` to make it clear they don't want people using pip directly.

Modoboa depends on pip in 2 places:
https://github.com/modoboa/modoboa/blob/95ccae54ca72ac446c342257bdd22b312bb228f0/setup.py#L24
This can be fixed by using the [packaging](https://pypi.python.org/pypi/packaging) package.

https://github.com/modoboa/modoboa/blob/95ccae54ca72ac446c342257bdd22b312bb228f0/modoboa/core/commands/deploy.py#L231
This can be replaced by calling pip the same way we call any other external program.


Discussion:

Resolving patch:
diff --git a/modoboa/core/commands/deploy.py b/modoboa/core/commands/deploy.py
--- a/modoboa/core/commands/deploy.py
+++ b/modoboa/core/commands/deploy.py
@@ -22,13 +22,7 @@
 
 from modoboa.core.commands import Command
 from modoboa.lib.api_client import ModoAPIClient
-
-try:
-    import pip
-except ImportError:
-    sys.stderr.write("Error: pip is required to install extensions.\n")
-    sys.exit(2)
-
+from modoboa.lib.sysutils import exec_cmd
 
 DBCONN_TPL = """
     '{{ conn_name }}': {
@@ -226,9 +220,12 @@ def handle(self, parsed_args):
             extensions = [(extension, extension.replace("-", "_"))
                           for extension in extensions]
             if not parsed_args.dont_install_extensions:
-                pip_args = (
-                    ["install"] + [extension[0] for extension in extensions])
-                pip.main(pip_args)
+                cmd = (
+                    sys.executable +
+                    " -m pip install " +
+                    " ".join([extension[0] for extension in extensions])
+                )
+                exec_cmd(cmd, capture_output=False)
             extra_settings = self.find_extra_settings(extensions)
             extensions = [extension[1] for extension in extensions]
 
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -13,21 +13,21 @@
 import io
 from os import path
 
-from pip.req import parse_requirements
+from packaging.requirements import Requirement
 from setuptools import find_packages, setup
 
 
 def get_requirements(requirements_file):
-    """Use pip to parse requirements file."""
+    """Parse requirements file."""
     requirements = []
     if path.isfile(requirements_file):
-        for req in parse_requirements(requirements_file, session="hack"):
-            # check markers, such as
-            #
-            #     rope_py3k    ; python_version >= '3.0'
-            #
-            if req.match_markers():
-                requirements.append(str(req.req))
+        with io.open(requirements_file, encoding="utf-8") as fp:
+            for line in fp:
+                if line.startswith("#") or line.strip() == "":
+                    continue
+                req = Requirement(line)
+                if req.marker is None or req.marker.evaluate():
+                    requirements.append('%s%s' % (req.name, req.specifier))
     return requirements
 
 


Test patch:
Repository: modoboa/modoboa

Issue:
Robots.txt is missing from urls.py
# Impacted versions

* Modoboa: 1.12.2 and older
* installer used: Yes, but some modifications made
* Webserver: Nginx

# Steps to reproduce
Install modoboa and enable webinterface.

# Current behavior
No robots.txt is defined. Search engines do not now how to index the website. When search engines try to find robots.txt an 404 is raised and the error is mailed to ADMINS (if configured)

# Expected behavior
Robots.txt in urls.py defined, to deny all traffic, as webmail should not be publicly indexed by search engines. Possible fix, add:
`path('robots.txt', lambda r: HttpResponse("User-agent: *\nDisAllow: /", content_type="text/plain"), name='robots')`

# Video/Screenshot link (optional)




Discussion:

Resolving patch:
diff --git a/modoboa/core/urls.py b/modoboa/core/urls.py
--- a/modoboa/core/urls.py
+++ b/modoboa/core/urls.py
@@ -1,6 +1,7 @@
 """Core urls."""
 
 from django.urls import path
+from django.views.generic.base import TemplateView
 
 from . import views
 
@@ -31,4 +32,5 @@
     path('user/profile/', views.profile, name="user_profile"),
     path('user/api/', views.api_access, name="user_api_access"),
     path('user/security/', views.security, name="user_security"),
+    path('robots.txt', TemplateView.as_view(template_name="core/robots.txt", content_type="text/plain")),
 ]


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

Issue:
IPython shows decorator docstring instead of function docstring
We recently implemented the `verbose` option using a decorator. I just noticed that IPython now shows the decorator docstring instead of the function docstring, e.g, `mne.minimum_norm.apply_inverse??` shows the docstring of `verbose()`.

This seems to be a problem with IPython but it would be good if we can find a way to fix it before the release.



Discussion:
The problem only happens when `??` is used (show the code), just `?` works fine.

did you try to google it?

Yes, using `functools.wraps` handles the docstring but IPython gets the wrong source when `??` is used, see ipython/ipython#1555


Resolving patch:
diff --git a/mne/utils.py b/mne/utils.py
--- a/mne/utils.py
+++ b/mne/utils.py
@@ -416,6 +416,10 @@ def dec(*args, **kwargs):
             return ret
         else:
             return function(*args, **kwargs)
+
+    # set __wrapped__ attribute so ?? in IPython gets the right source
+    dec.__wrapped__ = function
+
     return dec
 
 


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

Issue:
FIX: regression with bti reading.
I'm still trying out what's going wrong. Mass database export attempts reveal: On some particular measurement files struct unpack errors occur. Grr.



Discussion:

Resolving patch:
diff --git a/mne/fiff/bti/raw.py b/mne/fiff/bti/raw.py
--- a/mne/fiff/bti/raw.py
+++ b/mne/fiff/bti/raw.py
@@ -768,7 +768,10 @@ def _read_bti_header(pdf_fname, config_fname):
     if ((start + BTI.FILE_CURPOS - check_value) <= BTI.FILE_MASK):
         header_position = check_value
 
-    _correct_offset(fid)
+    # Check header position for alignment issues
+    if ((header_position % 8) != 0):
+        header_position += (8 - (header_position % 8))
+
     fid.seek(header_position, 0)
 
     # actual header starts here


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

Issue:
FIX: _morph_buffer tries to subtract 1 from smooth also if it defaults to 1
I'm not sure but saying:

``` Python
if smooth is not None:
    smooth -= 1
```

seems to do it, unless this changes the iteration procedure.



Discussion:

Resolving patch:
diff --git a/mne/source_estimate.py b/mne/source_estimate.py
--- a/mne/source_estimate.py
+++ b/mne/source_estimate.py
@@ -1131,7 +1131,8 @@ def _morph_buffer(data, idx_use, e, smooth, n_vertices, nearest, maps,
     """
 
     n_iter = 99  # max nb of smoothing iterations (minus one)
-    smooth -= 1
+    if smooth is not None:
+        smooth -= 1
     # make sure we're in CSR format
     e = e.tocsr()
     if sparse.issparse(data):


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

Issue:
Counter is not in Python 2.6
Hi,

Thanks for the cool tools. Unfortunately the installation fails on python 2.6 (on Debian Squeeze):

Traceback (most recent call last):
  File "setup.py", line 6, in <module>
    import mne
  File "/home/gpiantoni/python/mne-python/mne/**init**.py", line 10, in <module>
    from .cov import read_cov, write_cov, Covariance, \
  File "/home/gpiantoni/python/mne-python/mne/cov.py", line 17, in <module>
    from . import fiff, verbose
  File "/home/gpiantoni/python/mne-python/mne/fiff/**init**.py", line 10, in <module>
    from .evoked import Evoked, read_evoked, write_evoked
  File "/home/gpiantoni/python/mne-python/mne/fiff/evoked.py", line 29, in <module>
    from ..viz import plot_evoked
  File "/home/gpiantoni/python/mne-python/mne/viz.py", line 14, in <module>
    from collections import Counter
ImportError: cannot import name Counter

Counter was introduced in python 2.7:
http://docs.python.org/2/library/collections.html

Commenting line 14 of viz.py makes the installation work. Otherwise, you can drop support for python 2.6 (and change the README file:
https://github.com/mne-tools/mne-python#dependencies )

Thanks,
G



Discussion:
Thanks gio for the bug report. Would you consider sending us a PR to fix compat with 2.6?


Resolving patch:
diff --git a/mne/viz.py b/mne/viz.py
--- a/mne/viz.py
+++ b/mne/viz.py
@@ -11,7 +11,6 @@
 from itertools import cycle
 from functools import partial
 from operator import add
-from collections import Counter
 import difflib
 import tempfile
 import webbrowser
@@ -29,7 +28,7 @@
 
 
 # XXX : don't import pylab here or you will break the doc
-from .fixes import tril_indices
+from .fixes import tril_indices, Counter
 from .baseline import rescale
 from .utils import deprecated, get_subjects_dir, get_config, set_config, \
                    _check_subject


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

Issue:
broken plot_sensor_connectivity.py in master
```
    693             tmin_idx = 0
--> 694             tmax_idx = n_times_in
    695             tmin_true = times_in[0]
    696             tmax_true = times_in[-1]

UnboundLocalError: local variable 'n_times_in' referenced before assignment
```

cc @mluessi 



Discussion:

Resolving patch:
diff --git a/mne/connectivity/spectral.py b/mne/connectivity/spectral.py
--- a/mne/connectivity/spectral.py
+++ b/mne/connectivity/spectral.py
@@ -682,14 +682,14 @@ def spectral_connectivity(data, method='coh', indices=None, sfreq=2 * np.pi,
             if isinstance(first_epoch, SourceEstimate):
                 # input is a list of SourceEstimate
                 times_in = first_epoch.times
-                n_times_in = len(times_in)
 
             if times_in is None:
                 # we are not using Epochs or SourceEstimate(s) as input
-                n_times_in = first_epoch.shape[1]
-                times_in = np.linspace(0.0, n_times_in / sfreq, n_times_in,
+                n_times = first_epoch.shape[1]
+                times_in = np.linspace(0.0, n_times / sfreq, n_times,
                                        endpoint=False)
 
+            n_times_in = len(times_in)
             tmin_idx = 0
             tmax_idx = n_times_in
             tmin_true = times_in[0]


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

Issue:
add MNE support to compute_source_psd
stcPSD = compute_source_psd(raw, inverse_operator, lambda2=lambda2, method='MNE',
                         tmin=tmin, tmax=tmax, fmin=fmin, fmax=fmax,
                         pick_normal=True, NFFT=NFFT, label=None)

Fails with 
--> 429     psd = np.zeros((noise_norm.size, np.sum(freqs_mask)))
AttributeError: 'NoneType' object has no attribute 'size'

This is an easy fix, hopefully I'll do all the git stuff right :)



Discussion:
> This is an easy fix, hopefully I'll do all the git stuff right :)

may the force of git be with you :)


Resolving patch:
diff --git a/mne/minimum_norm/time_frequency.py b/mne/minimum_norm/time_frequency.py
--- a/mne/minimum_norm/time_frequency.py
+++ b/mne/minimum_norm/time_frequency.py
@@ -426,7 +426,7 @@ def compute_source_psd(raw, inverse_operator, lambda2=1. / 9., method="dSPM",
     freqs_mask = (freqs >= 0) & (freqs >= fmin) & (freqs <= fmax)
     freqs = freqs[freqs_mask]
     fstep = np.mean(np.diff(freqs))
-    psd = np.zeros((noise_norm.size, np.sum(freqs_mask)))
+    psd = np.zeros((K.shape[0], np.sum(freqs_mask)))
     n_windows = 0
 
     for this_start in np.arange(start, stop, int(NFFT * (1. - overlap))):


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

Issue:
BUG? Epochs decim does not correctly propagate to stc
when using decim, epochs.times and evoked.times match but not stc.times ... ouch.

https://gist.github.com/dengemann/8453113



Discussion:
``` Python
assert_array_almost_equal(evoked.times, stc.times)

# ...

AssertionError:
Arrays are not almost equal to 6 decimals

(mismatch 100.0%)
 x: array([-0.19979521, -0.17981569, -0.15983617, -0.13985665, -0.11987713,
       -0.09989761, -0.07991809, -0.05993856, -0.03995904, -0.01997952,
        0.        ,  0.01997952,  0.03995904,  0.05993856,  0.07991809,...
 y: array([ -1.79815692e-01,  -1.59836171e-01,  -1.39856649e-01,
        -1.19877128e-01,  -9.98976066e-02,  -7.99180853e-02,
        -5.99385639e-02,  -3.99590426e-02,  -1.99795213e-02,...
```

@agramfort @mluessi @Eric89GXL 

does anything speak against changing this line 
https://github.com/mne-tools/mne-python/blob/master/mne/minimum_norm/inverse.py#L769

``` Python
tmin = evoked.times[0]
```

it fixes the issue exposed above.


Resolving patch:
diff --git a/mne/minimum_norm/inverse.py b/mne/minimum_norm/inverse.py
--- a/mne/minimum_norm/inverse.py
+++ b/mne/minimum_norm/inverse.py
@@ -766,7 +766,7 @@ def apply_inverse(evoked, inverse_operator, lambda2, method="dSPM",
         sol *= noise_norm
 
     tstep = 1.0 / evoked.info['sfreq']
-    tmin = float(evoked.first) / evoked.info['sfreq']
+    tmin = float(evoked.times[0])
     vertno = _get_vertno(inv['src'])
     subject = _subject_from_inverse(inverse_operator)
 


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

Issue:
MNE config file should not be required
It seems that mne really wants to find a config file in the user's home directory; however, this creates issues when attempting to run mne inside Python code that's running via a daemon (e.g. uWSGI).  In such cases, there's no HOME directory (and ~ expands to /var/www).

It's rarely a good idea to allow the daemon write access to various parts of the filesystem.  This prevents `mne.utils._get_extra_data_path` from creating /var/www/.mne which causes an `OSError`.  

I think it's reasonable for `get_config` to intercept the OSError and return the default value in such situations.  If `raise_error` is True, an error should be returned telling the user to set the config in the appropriate environment variable (best practice for uWSGI is to use virtualenv and set environment variables in the postactivate script and unset them in the postdeactivate script).

PR to fix this coming shortly ...



Discussion:

Resolving patch:
diff --git a/mne/forward/_lead_dots.py b/mne/forward/_lead_dots.py
--- a/mne/forward/_lead_dots.py
+++ b/mne/forward/_lead_dots.py
@@ -50,7 +50,8 @@ def _get_legen_table(ch_type, volume_integral=False, n_coeff=100,
         raise RuntimeError('n_interp must be even')
     fname = op.join(_get_extra_data_path(), 'tables')
     if not op.isdir(fname):
-        os.mkdir(fname)
+        # Updated due to API chang (GH 1167)
+        os.makedirs(fname)
     if ch_type == 'meg':
         fname = op.join(fname, 'legder_%s_%s.bin' % (n_coeff, n_interp))
         leg_fun = _get_legen_der
diff --git a/mne/utils.py b/mne/utils.py
--- a/mne/utils.py
+++ b/mne/utils.py
@@ -797,10 +797,7 @@ def _get_extra_data_path(home_dir=None):
                              'not be determined, please report this '
                              'error to mne-python developers')
 
-    path = op.join(home_dir, '.mne')
-    if not op.isdir(path):
-        os.mkdir(path)
-    return path
+    return op.join(home_dir, '.mne')
 
 
 def get_config_path(home_dir=None):
@@ -980,8 +977,9 @@ def set_config(key, value, home_dir=None):
     else:
         config[key] = value
 
-    # Write all values
-    directory = op.split(config_path)[0]
+    # Write all values. This may fail if the default directory is not
+    # writeable.
+    directory = op.dirname(config_path)
     if not op.isdir(directory):
         os.mkdir(directory)
     with open(config_path, 'w') as fid:


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

Issue:
FIX: confusing printing behavior in time_gen.py
People tend to think that only one channel is used if in fact multiple channels are used:

https://github.com/mne-tools/mne-python/blob/master/mne/decoding/time_gen.py#L111

cc @agramfort 



Discussion:
fix welcome.


Resolving patch:
diff --git a/mne/decoding/time_gen.py b/mne/decoding/time_gen.py
--- a/mne/decoding/time_gen.py
+++ b/mne/decoding/time_gen.py
@@ -106,9 +106,9 @@ def time_generalization(epochs_list, clf=None, cv=5, scoring="roc_auc",
 
     cv = check_cv(cv, X, y, classifier=True)
 
-    ch_types = set([channel_type(info, idx) for idx in data_picks])
+    ch_types = set(channel_type(info, idx) for idx in data_picks)
     logger.info('Running time generalization on %s epochs using %s.' %
-                (len(X), ch_types.pop()))
+                (len(X), ' and '.join(ch_types)))
 
     if shuffle:
         rng = check_random_state(random_state)


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

Issue:
BUG: picks parameter of create_ecg_epochs ignored
https://github.com/mne-tools/mne-python/blob/master/mne/preprocessing/ecg.py#L268

Surely that should read:

```
if picks is None:
```

instead of

```
if picks is not None:
```

BUG: picks parameter of create_ecg_epochs ignored
https://github.com/mne-tools/mne-python/blob/master/mne/preprocessing/ecg.py#L268

Surely that should read:

```
if picks is None:
```

instead of

```
if picks is not None:
```



Discussion:
@wmvanvliet oh boy. Fix welcome.

@wmvanvliet oh boy. Fix welcome.


Resolving patch:
diff --git a/mne/channels/interpolation.py b/mne/channels/interpolation.py
--- a/mne/channels/interpolation.py
+++ b/mne/channels/interpolation.py
@@ -125,13 +125,19 @@ def _interpolate_bads_eeg(inst):
     if getattr(inst, 'preload', None) is False:
         raise ValueError('Data must be preloaded.')
 
-    bads_idx = np.array([ch in inst.info['bads'] for ch in inst.ch_names])
+    bads_idx = np.zeros(len(inst.ch_names), dtype=np.bool)
     goods_idx = np.zeros(len(inst.ch_names), dtype=np.bool)
 
     picks = pick_types(inst.info, meg=False, eeg=True, exclude=[])
+    bads_idx[picks] = [inst.ch_names[ch] in inst.info['bads'] for ch in picks]
     goods_idx[picks] = True
     goods_idx[bads_idx] = False
 
+    if len(bads_idx) != len(inst.info['bads']):
+        logger.warning('Channel interpolation is currently only implemented '
+                       'for EEG. The MEG channels marked as bad will remain '
+                       'untouched.')
+
     pos = inst.get_channel_positions(picks)
 
     # Make sure only EEG are used
diff --git a/mne/preprocessing/ecg.py b/mne/preprocessing/ecg.py
--- a/mne/preprocessing/ecg.py
+++ b/mne/preprocessing/ecg.py
@@ -265,7 +265,7 @@ def create_ecg_epochs(raw, ch_name=None, event_id=999, picks=None,
     events, _, _ = find_ecg_events(raw, ch_name=ch_name, event_id=event_id,
                                    l_freq=l_freq, h_freq=h_freq,
                                    verbose=verbose)
-    if picks is not None:
+    if picks is None:
         picks = pick_types(raw.info, meg=True, eeg=True, ref_meg=False)
 
     # create epochs around ECG events and baseline (important)


Test patch:
diff --git a/mne/channels/tests/test_interpolation.py b/mne/channels/tests/test_interpolation.py
--- a/mne/channels/tests/test_interpolation.py
+++ b/mne/channels/tests/test_interpolation.py
@@ -59,7 +59,7 @@ def test_interplation():
     assert_raises(ValueError,  epochs.interpolate_bads_eeg)
     epochs.preload = True
 
-    epochs2.info['bads'] = ['EEG 012']
+    epochs2.info['bads'] = ['EEG 012', 'MEG 1711']
 
     epochs2.interpolate_bads_eeg()
     ave_after2 = epochs2.average().data[n_meg + np.where(bads_idx)[0]]
Repository: mne-tools/mne-python

Issue:
"picks" and "scalings" params are ignored by plot_epochs

"picks" and "scalings" params are ignored by plot_epochs



Discussion:

Resolving patch:
diff --git a/examples/plot_read_epochs.py b/examples/plot_read_epochs.py
--- a/examples/plot_read_epochs.py
+++ b/examples/plot_read_epochs.py
@@ -40,6 +40,7 @@
 epochs = mne.Epochs(raw, events, event_id, tmin, tmax, proj=True,
                     picks=picks, baseline=(None, 0), preload=True,
                     reject=dict(grad=4000e-13, mag=4e-12, eog=150e-6))
+
 evoked = epochs.average()  # average epochs to get the evoked response
 
 ###############################################################################
diff --git a/mne/viz/epochs.py b/mne/viz/epochs.py
--- a/mne/viz/epochs.py
+++ b/mne/viz/epochs.py
@@ -348,7 +348,7 @@ def plot_epochs(epochs, epoch_idx=None, picks=None, scalings=None,
     """
     import matplotlib.pyplot as plt
     import matplotlib as mpl
-    scalings = _mutable_defaults(('scalings_plot_raw', None))[0]
+    scalings = _mutable_defaults(('scalings_plot_raw', scalings))[0]
     if np.isscalar(epoch_idx):
         epoch_idx = [epoch_idx]
     if epoch_idx is None:


Test patch: