prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  mne.WatershedBEM creates incorrect command line
  ### Summary
  The mne.WatershedBEM interface `_cmd` do not correspond to the behavior of the stable release of  mne [see documentation](https://martinos.org/mne/stable/generated/commands.html#create-bem-surfaces-using-the-watershed-algorithm-included-with-freesurfer)
   [This line](https://github.com/nipy/nipype/blob/f79581edc042ed38064f48e85b6dcc38bc30a084/nipype/interfaces/mne/base.py#L97) `_cmd = 'mne_watershed_bem'` should be `_cmd = 'mne watershed_bem'`
  mne.WatershedBEM creates incorrect command line
  ### Summary
  The mne.WatershedBEM interface `_cmd` do not correspond to the behavior of the stable release of  mne [see documentation](https://martinos.org/mne/stable/generated/commands.html#create-bem-surfaces-using-the-watershed-algorithm-included-with-freesurfer)
   [This line](https://github.com/nipy/nipype/blob/f79581edc042ed38064f48e85b6dcc38bc30a084/nipype/interfaces/mne/base.py#L97) `_cmd = 'mne_watershed_bem'` should be `_cmd = 'mne watershed_bem'`
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `nipype/interfaces/mne/base.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 from __future__ import (print_function, division, unicode_literals,
  3                         absolute_import)
  4 from builtins import str, bytes
  5 
  6 import os.path as op
  7 import glob
  8 
  9 from ... import logging
  10 from ...utils.filemanip import simplify_list
  11 from ..base import (traits, File, Directory, TraitedSpec, OutputMultiPath)
  12 from ..freesurfer.base import FSCommand, FSTraitedSpec
  13 
  14 iflogger = logging.getLogger('nipype.interface')
  15 
  16 
  17 class WatershedBEMInputSpec(FSTraitedSpec):
  18     subject_id = traits.Str(
  19         argstr='--subject %s',
  20         mandatory=True,
  21         desc='Subject ID (must have a complete Freesurfer directory)')
  22     subjects_dir = Directory(
  23         exists=True,
  24         mandatory=True,
  25         usedefault=True,
  26         desc='Path to Freesurfer subjects directory')
  27     volume = traits.Enum(
  28         'T1',
  29         'aparc+aseg',
  30         'aseg',
  31         'brain',
  32         'orig',
  33         'brainmask',
  34         'ribbon',
  35         argstr='--volume %s',
  36         usedefault=True,
  37         desc='The volume from the "mri" directory to use (defaults to T1)')
  38     overwrite = traits.Bool(
  39         True,
  40         usedefault=True,
  41         argstr='--overwrite',
  42         desc='Overwrites the existing files')
  43     atlas_mode = traits.Bool(
  44         argstr='--atlas',
  45         desc='Use atlas mode for registration (default: no rigid alignment)')
  46 
  47 
  48 class WatershedBEMOutputSpec(TraitedSpec):
  49     mesh_files = OutputMultiPath(
  50         File(exists=True),
  51         desc=('Paths to the output meshes (brain, inner '
  52               'skull, outer skull, outer skin)'))
  53     brain_surface = File(
  54         exists=True,
  55         loc='bem/watershed',
  56         desc='Brain surface (in Freesurfer format)')
  57     inner_skull_surface = File(
  58         exists=True,
  59         loc='bem/watershed',
  60         desc='Inner skull surface (in Freesurfer format)')
  61     outer_skull_surface = File(
  62         exists=True,
  63         loc='bem/watershed',
  64         desc='Outer skull surface (in Freesurfer format)')
  65     outer_skin_surface = File(
  66         exists=True,
  67         loc='bem/watershed',
  68         desc='Outer skin surface (in Freesurfer format)')
  69     fif_file = File(
  70         exists=True,
  71         loc='bem',
  72         altkey='fif',
  73         desc='"fif" format file for EEG processing in MNE')
  74     cor_files = OutputMultiPath(
  75         File(exists=True),
  76         loc='bem/watershed/ws',
  77         altkey='COR',
  78         desc='"COR" format files')
  79 
  80 
  81 class WatershedBEM(FSCommand):
  82     """Uses mne_watershed_bem to get information from dicom directories
  83 
  84     Examples
  85     --------
  86 
  87     >>> from nipype.interfaces.mne import WatershedBEM
  88     >>> bem = WatershedBEM()
  89     >>> bem.inputs.subject_id = 'subj1'
  90     >>> bem.inputs.subjects_dir = '.'
  91     >>> bem.cmdline
  92     'mne_watershed_bem --overwrite --subject subj1 --volume T1'
  93     >>> bem.run() 				# doctest: +SKIP
  94 
  95    """
  96 
  97     _cmd = 'mne_watershed_bem'
  98     input_spec = WatershedBEMInputSpec
  99     output_spec = WatershedBEMOutputSpec
  100     _additional_metadata = ['loc', 'altkey']
  101 
  102     def _get_files(self, path, key, dirval, altkey=None):
  103         globsuffix = '*'
  104         globprefix = '*'
  105         keydir = op.join(path, dirval)
  106         if altkey:
  107             key = altkey
  108         globpattern = op.join(keydir, ''.join((globprefix, key, globsuffix)))
  109         return glob.glob(globpattern)
  110 
  111     def _list_outputs(self):
  112         outputs = self.output_spec().get()
  113         subjects_dir = self.inputs.subjects_dir
  114         subject_path = op.join(subjects_dir, self.inputs.subject_id)
  115         output_traits = self._outputs()
  116         mesh_paths = []
  117         for k in list(outputs.keys()):
  118             if k != 'mesh_files':
  119                 val = self._get_files(subject_path, k,
  120                                       output_traits.traits()[k].loc,
  121                                       output_traits.traits()[k].altkey)
  122                 if val:
  123                     value_list = simplify_list(val)
  124                     if isinstance(value_list, list):
  125                         out_files = []
  126                         for value in value_list:
  127                             out_files.append(op.abspath(value))
  128                     elif isinstance(value_list, (str, bytes)):
  129                         out_files = op.abspath(value_list)
  130                     else:
  131                         raise TypeError
  132                     outputs[k] = out_files
  133                     if not k.rfind('surface') == -1:
  134                         mesh_paths.append(out_files)
  135         outputs['mesh_files'] = mesh_paths
  136         return outputs
  137
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/nipype/interfaces/mne/base.py b/nipype/interfaces/mne/base.py
  --- a/nipype/interfaces/mne/base.py
  +++ b/nipype/interfaces/mne/base.py
  @@ -89,12 +89,12 @@
       >>> bem.inputs.subject_id = 'subj1'
       >>> bem.inputs.subjects_dir = '.'
       >>> bem.cmdline
  -    'mne_watershed_bem --overwrite --subject subj1 --volume T1'
  +    'mne watershed_bem --overwrite --subject subj1 --volume T1'
       >>> bem.run() 				# doctest: +SKIP
   
      """
   
  -    _cmd = 'mne_watershed_bem'
  +    _cmd = 'mne watershed_bem'
       input_spec = WatershedBEMInputSpec
       output_spec = WatershedBEMOutputSpec
       _additional_metadata = ['loc', 'altkey']
  
verification_info: {"golden_diff": "diff --git a/nipype/interfaces/mne/base.py b/nipype/interfaces/mne/base.py\n--- a/nipype/interfaces/mne/base.py\n+++ b/nipype/interfaces/mne/base.py\n@@ -89,12 +89,12 @@\n     >>> bem.inputs.subject_id = 'subj1'\n     >>> bem.inputs.subjects_dir = '.'\n     >>> bem.cmdline\n-    'mne_watershed_bem --overwrite --subject subj1 --volume T1'\n+    'mne watershed_bem --overwrite --subject subj1 --volume T1'\n     >>> bem.run() \t\t\t\t# doctest: +SKIP\n \n    \"\"\"\n \n-    _cmd = 'mne_watershed_bem'\n+    _cmd = 'mne watershed_bem'\n     input_spec = WatershedBEMInputSpec\n     output_spec = WatershedBEMOutputSpec\n     _additional_metadata = ['loc', 'altkey']\n", "issue": "mne.WatershedBEM creates incorrect command line\n### Summary\r\nThe mne.WatershedBEM interface `_cmd` do not correspond to the behavior of the stable release of  mne [see documentation](https://martinos.org/mne/stable/generated/commands.html#create-bem-surfaces-using-the-watershed-algorithm-included-with-freesurfer)\r\n [This line](https://github.com/nipy/nipype/blob/f79581edc042ed38064f48e85b6dcc38bc30a084/nipype/interfaces/mne/base.py#L97) `_cmd = 'mne_watershed_bem'` should be `_cmd = 'mne watershed_bem'`\nmne.WatershedBEM creates incorrect command line\n### Summary\r\nThe mne.WatershedBEM interface `_cmd` do not correspond to the behavior of the stable release of  mne [see documentation](https://martinos.org/mne/stable/generated/commands.html#create-bem-surfaces-using-the-watershed-algorithm-included-with-freesurfer)\r\n [This line](https://github.com/nipy/nipype/blob/f79581edc042ed38064f48e85b6dcc38bc30a084/nipype/interfaces/mne/base.py#L97) `_cmd = 'mne_watershed_bem'` should be `_cmd = 'mne watershed_bem'`\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nfrom __future__ import (print_function, division, unicode_literals,\n                        absolute_import)\nfrom builtins import str, bytes\n\nimport os.path as op\nimport glob\n\nfrom ... import logging\nfrom ...utils.filemanip import simplify_list\nfrom ..base import (traits, File, Directory, TraitedSpec, OutputMultiPath)\nfrom ..freesurfer.base import FSCommand, FSTraitedSpec\n\niflogger = logging.getLogger('nipype.interface')\n\n\nclass WatershedBEMInputSpec(FSTraitedSpec):\n    subject_id = traits.Str(\n        argstr='--subject %s',\n        mandatory=True,\n        desc='Subject ID (must have a complete Freesurfer directory)')\n    subjects_dir = Directory(\n        exists=True,\n        mandatory=True,\n        usedefault=True,\n        desc='Path to Freesurfer subjects directory')\n    volume = traits.Enum(\n        'T1',\n        'aparc+aseg',\n        'aseg',\n        'brain',\n        'orig',\n        'brainmask',\n        'ribbon',\n        argstr='--volume %s',\n        usedefault=True,\n        desc='The volume from the \"mri\" directory to use (defaults to T1)')\n    overwrite = traits.Bool(\n        True,\n        usedefault=True,\n        argstr='--overwrite',\n        desc='Overwrites the existing files')\n    atlas_mode = traits.Bool(\n        argstr='--atlas',\n        desc='Use atlas mode for registration (default: no rigid alignment)')\n\n\nclass WatershedBEMOutputSpec(TraitedSpec):\n    mesh_files = OutputMultiPath(\n        File(exists=True),\n        desc=('Paths to the output meshes (brain, inner '\n              'skull, outer skull, outer skin)'))\n    brain_surface = File(\n        exists=True,\n        loc='bem/watershed',\n        desc='Brain surface (in Freesurfer format)')\n    inner_skull_surface = File(\n        exists=True,\n        loc='bem/watershed',\n        desc='Inner skull surface (in Freesurfer format)')\n    outer_skull_surface = File(\n        exists=True,\n        loc='bem/watershed',\n        desc='Outer skull surface (in Freesurfer format)')\n    outer_skin_surface = File(\n        exists=True,\n        loc='bem/watershed',\n        desc='Outer skin surface (in Freesurfer format)')\n    fif_file = File(\n        exists=True,\n        loc='bem',\n        altkey='fif',\n        desc='\"fif\" format file for EEG processing in MNE')\n    cor_files = OutputMultiPath(\n        File(exists=True),\n        loc='bem/watershed/ws',\n        altkey='COR',\n        desc='\"COR\" format files')\n\n\nclass WatershedBEM(FSCommand):\n    \"\"\"Uses mne_watershed_bem to get information from dicom directories\n\n    Examples\n    --------\n\n    >>> from nipype.interfaces.mne import WatershedBEM\n    >>> bem = WatershedBEM()\n    >>> bem.inputs.subject_id = 'subj1'\n    >>> bem.inputs.subjects_dir = '.'\n    >>> bem.cmdline\n    'mne_watershed_bem --overwrite --subject subj1 --volume T1'\n    >>> bem.run() \t\t\t\t# doctest: +SKIP\n\n   \"\"\"\n\n    _cmd = 'mne_watershed_bem'\n    input_spec = WatershedBEMInputSpec\n    output_spec = WatershedBEMOutputSpec\n    _additional_metadata = ['loc', 'altkey']\n\n    def _get_files(self, path, key, dirval, altkey=None):\n        globsuffix = '*'\n        globprefix = '*'\n        keydir = op.join(path, dirval)\n        if altkey:\n            key = altkey\n        globpattern = op.join(keydir, ''.join((globprefix, key, globsuffix)))\n        return glob.glob(globpattern)\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        subjects_dir = self.inputs.subjects_dir\n        subject_path = op.join(subjects_dir, self.inputs.subject_id)\n        output_traits = self._outputs()\n        mesh_paths = []\n        for k in list(outputs.keys()):\n            if k != 'mesh_files':\n                val = self._get_files(subject_path, k,\n                                      output_traits.traits()[k].loc,\n                                      output_traits.traits()[k].altkey)\n                if val:\n                    value_list = simplify_list(val)\n                    if isinstance(value_list, list):\n                        out_files = []\n                        for value in value_list:\n                            out_files.append(op.abspath(value))\n                    elif isinstance(value_list, (str, bytes)):\n                        out_files = op.abspath(value_list)\n                    else:\n                        raise TypeError\n                    outputs[k] = out_files\n                    if not k.rfind('surface') == -1:\n                        mesh_paths.append(out_files)\n        outputs['mesh_files'] = mesh_paths\n        return outputs\n", "path": "nipype/interfaces/mne/base.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nfrom __future__ import (print_function, division, unicode_literals,\n                        absolute_import)\nfrom builtins import str, bytes\n\nimport os.path as op\nimport glob\n\nfrom ... import logging\nfrom ...utils.filemanip import simplify_list\nfrom ..base import (traits, File, Directory, TraitedSpec, OutputMultiPath)\nfrom ..freesurfer.base import FSCommand, FSTraitedSpec\n\niflogger = logging.getLogger('nipype.interface')\n\n\nclass WatershedBEMInputSpec(FSTraitedSpec):\n    subject_id = traits.Str(\n        argstr='--subject %s',\n        mandatory=True,\n        desc='Subject ID (must have a complete Freesurfer directory)')\n    subjects_dir = Directory(\n        exists=True,\n        mandatory=True,\n        usedefault=True,\n        desc='Path to Freesurfer subjects directory')\n    volume = traits.Enum(\n        'T1',\n        'aparc+aseg',\n        'aseg',\n        'brain',\n        'orig',\n        'brainmask',\n        'ribbon',\n        argstr='--volume %s',\n        usedefault=True,\n        desc='The volume from the \"mri\" directory to use (defaults to T1)')\n    overwrite = traits.Bool(\n        True,\n        usedefault=True,\n        argstr='--overwrite',\n        desc='Overwrites the existing files')\n    atlas_mode = traits.Bool(\n        argstr='--atlas',\n        desc='Use atlas mode for registration (default: no rigid alignment)')\n\n\nclass WatershedBEMOutputSpec(TraitedSpec):\n    mesh_files = OutputMultiPath(\n        File(exists=True),\n        desc=('Paths to the output meshes (brain, inner '\n              'skull, outer skull, outer skin)'))\n    brain_surface = File(\n        exists=True,\n        loc='bem/watershed',\n        desc='Brain surface (in Freesurfer format)')\n    inner_skull_surface = File(\n        exists=True,\n        loc='bem/watershed',\n        desc='Inner skull surface (in Freesurfer format)')\n    outer_skull_surface = File(\n        exists=True,\n        loc='bem/watershed',\n        desc='Outer skull surface (in Freesurfer format)')\n    outer_skin_surface = File(\n        exists=True,\n        loc='bem/watershed',\n        desc='Outer skin surface (in Freesurfer format)')\n    fif_file = File(\n        exists=True,\n        loc='bem',\n        altkey='fif',\n        desc='\"fif\" format file for EEG processing in MNE')\n    cor_files = OutputMultiPath(\n        File(exists=True),\n        loc='bem/watershed/ws',\n        altkey='COR',\n        desc='\"COR\" format files')\n\n\nclass WatershedBEM(FSCommand):\n    \"\"\"Uses mne_watershed_bem to get information from dicom directories\n\n    Examples\n    --------\n\n    >>> from nipype.interfaces.mne import WatershedBEM\n    >>> bem = WatershedBEM()\n    >>> bem.inputs.subject_id = 'subj1'\n    >>> bem.inputs.subjects_dir = '.'\n    >>> bem.cmdline\n    'mne watershed_bem --overwrite --subject subj1 --volume T1'\n    >>> bem.run() \t\t\t\t# doctest: +SKIP\n\n   \"\"\"\n\n    _cmd = 'mne watershed_bem'\n    input_spec = WatershedBEMInputSpec\n    output_spec = WatershedBEMOutputSpec\n    _additional_metadata = ['loc', 'altkey']\n\n    def _get_files(self, path, key, dirval, altkey=None):\n        globsuffix = '*'\n        globprefix = '*'\n        keydir = op.join(path, dirval)\n        if altkey:\n            key = altkey\n        globpattern = op.join(keydir, ''.join((globprefix, key, globsuffix)))\n        return glob.glob(globpattern)\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        subjects_dir = self.inputs.subjects_dir\n        subject_path = op.join(subjects_dir, self.inputs.subject_id)\n        output_traits = self._outputs()\n        mesh_paths = []\n        for k in list(outputs.keys()):\n            if k != 'mesh_files':\n                val = self._get_files(subject_path, k,\n                                      output_traits.traits()[k].loc,\n                                      output_traits.traits()[k].altkey)\n                if val:\n                    value_list = simplify_list(val)\n                    if isinstance(value_list, list):\n                        out_files = []\n                        for value in value_list:\n                            out_files.append(op.abspath(value))\n                    elif isinstance(value_list, (str, bytes)):\n                        out_files = op.abspath(value_list)\n                    else:\n                        raise TypeError\n                    outputs[k] = out_files\n                    if not k.rfind('surface') == -1:\n                        mesh_paths.append(out_files)\n        outputs['mesh_files'] = mesh_paths\n        return outputs\n", "path": "nipype/interfaces/mne/base.py"}]}