Repository: mne-tools/mne-python

Issue:
mne.set_config(None) doesn't work as described
The [docs](https://mne-tools.github.io/dev/generated/mne.set_config.html) for `mne.set_config` say:

```
mne.set_config(key, value, home_dir=None, set_env=True)
Parameters:
key : str | None
    The preference key to set. If None, a tuple of the valid keys is returned, and value and home_dir are ignored.
```

however, if `key` is `None` then `value` is *not* ignored:

```
(mnedev) [~] $ ipython
In [1]: import mne                                                                                                                    
In [2]: mne.set_config(None)                                                                                                          
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-26697f64a5bd> in <module>
----> 1 mne.set_config(None)

TypeError: set_config() missing 1 required positional argument: 'value'
In [3]: mne.sys_info()                                                                                                                
Platform:      Linux-4.15.0-46-generic-x86_64-with-debian-buster-sid
Python:        3.6.7 |Anaconda, Inc.| (default, Oct 23 2018, 19:16:44)  [GCC 7.3.0]
Executable:    /opt/miniconda3/envs/mnedev/bin/python
CPU:           x86_64: 8 cores
Memory:        7.6 GB

mne:           0.18.dev0
numpy:         1.15.4 {blas=mkl_rt, lapack=mkl_rt}
scipy:         1.1.0
matplotlib:    3.0.2 {backend=Qt5Agg}

sklearn:       0.20.2
nibabel:       2.3.1
mayavi:        4.7.0.dev0 {qt_api=pyqt5, PyQt5=5.9.2}
cupy:          Not found
pandas:        0.23.4
dipy:          0.15.0
```



Discussion:
It should say `If key and value are both None, ...`
Alternatively, it would probably be more intuitive if `mne.set_config()` returned the valid keys (i.e. by default the function should use `key=None, value=None`).
+1 to set them both to `None` by default and use `mne.set_config()` to get the answer. (even if `set_config` to mean **get** me the confing might seem weird)
It does not get the config, just the valid keys that you can use to set the configuration. get_config() gets the current configuration (keys and values).

Resolving patch:
diff --git a/mne/datasets/_fsaverage/base.py b/mne/datasets/_fsaverage/base.py
--- a/mne/datasets/_fsaverage/base.py
+++ b/mne/datasets/_fsaverage/base.py
@@ -98,7 +98,7 @@ def _get_create_subjects_dir(subjects_dir):
     from ..utils import _get_path
     subjects_dir = get_subjects_dir(subjects_dir, raise_error=False)
     if subjects_dir is None:
-        subjects_dir = _get_path(None, '', 'montage coregistration')
+        subjects_dir = _get_path(None, 'MNE_DATA', 'montage coregistration')
         subjects_dir = op.join(subjects_dir, 'MNE-fsaverage-data')
         os.makedirs(subjects_dir, exist_ok=True)
     return subjects_dir
diff --git a/mne/utils/config.py b/mne/utils/config.py
--- a/mne/utils/config.py
+++ b/mne/utils/config.py
@@ -172,7 +172,8 @@ def get_config(key=None, default=None, raise_error=False, home_dir=None,
         The preference key to look for. The os environment is searched first,
         then the mne-python config file is parsed.
         If None, all the config parameters present in environment variables or
-        the path are returned.
+        the path are returned. If key is an empty string, a list of all valid
+        keys (but not values) is returned.
     default : str | None
         Value to return if the key is not found.
     raise_error : bool
@@ -198,6 +199,9 @@ def get_config(key=None, default=None, raise_error=False, home_dir=None,
     """
     _validate_type(key, (str, type(None)), "key", 'string or None')
 
+    if key == '':
+        return known_config_types
+
     # first, check to see if key is in env
     if use_env and key is not None and key in os.environ:
         return os.environ[key]
@@ -238,9 +242,8 @@ def set_config(key, value, home_dir=None, set_env=True):
 
     Parameters
     ----------
-    key : str | None
-        The preference key to set. If None, a tuple of the valid
-        keys is returned, and ``value`` and ``home_dir`` are ignored.
+    key : str
+        The preference key to set.
     value : str |  None
         The value to assign to the preference key. If None, the key is
         deleted.
@@ -256,7 +259,11 @@ def set_config(key, value, home_dir=None, set_env=True):
     get_config
     """
     if key is None:
+        warn('set_config(key=None, value=None) to get a list of valid keys '
+             'has been deprecated and will be removed in version 0.19. Use '
+             'get_config(key='') instead.', DeprecationWarning)
         return known_config_types
+
     _validate_type(key, 'str', "key")
     # While JSON allow non-string types, we allow users to override config
     # settings using env, which are strings, so we enforce that here


Test patch:
diff --git a/mne/utils/tests/test_config.py b/mne/utils/tests/test_config.py
--- a/mne/utils/tests/test_config.py
+++ b/mne/utils/tests/test_config.py
@@ -18,7 +18,7 @@ def test_config(tmpdir):
     assert (get_config(key) == value)
     del os.environ[key]
     # catch the warning about it being a non-standard config key
-    assert (len(set_config(None, None)) > 10)  # tuple of valid keys
+    assert (len(get_config('')) > 10)  # tuple of valid keys
     with pytest.warns(RuntimeWarning, match='non-standard'):
         set_config(key, None, home_dir=tempdir, set_env=False)
     assert (get_config(key, home_dir=tempdir) is None)