#NEWLINE# def set_mne_root( set_mne_bin = False ) : #NEWLINE# #INDENT# "Set the MNE_ROOT environment variable\n\n    Parameters\n    ----------\n    set_mne_bin : bool\n        Also add the MNE binary directory to the PATH (default: False).\n\n    Returns\n    -------\n    success : bool\n        True if the environment variable could be set, False if MNE_ROOT\n        could not be found.\n\n    Notes\n    -----\n    If MNE_ROOT can't be found, the user is prompted with a file dialog.\n    If specified successfully, the resulting path is stored with\n    mne.set_config().\n    " #NEWLINE# mne_root = get_mne_root ( ) #NEWLINE# if ( mne_root is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# os . environ [ 'MNE_ROOT' ] = mne_bin #NEWLINE# if set_mne_bin : #NEWLINE# #INDENT# mne_bin = os . path . realpath ( os . path . join ( mne_root , 'bin' ) ) #NEWLINE# if ( mne_bin not in map ( _expand_path , os . environ [ 'PATH' ] . split ( ':' ) ) ) : #NEWLINE# #INDENT# os . environ [ 'PATH' ] += ( ':' + mne_bin ) #NEWLINE# #UNINDENT# #UNINDENT# return True