<s> """<STR_LIT>""" <EOL> import mne <EOL> from mne . datasets import sample <EOL> from mne . inverse_sparse import mixed_norm <EOL> from mne . minimum_norm import make_inverse_operator , apply_inverse <EOL> from mne . viz import plot_sparse_source_estimates <EOL> print ( __doc__ ) <EOL> data_path = sample . data_path ( ) <EOL> fwd_fname = data_path + '<STR_LIT>' <EOL> ave_fname = data_path + '<STR_LIT>' <EOL> cov_fname = data_path + '<STR_LIT>' <EOL> subjects_dir = data_path + '<STR_LIT>' <EOL> cov = mne . read_cov ( cov_fname ) <EOL> condition = '<STR_LIT>' <EOL> evoked = mne . read_evokeds ( ave_fname , condition = condition , baseline = ( None , <NUM_LIT:0> ) ) <EOL> evoked . crop ( tmin = <NUM_LIT:0> , tmax = <NUM_LIT> ) <EOL> forward = mne . read_forward_solution ( fwd_fname , surf_ori = True ) <EOL> ylim = dict ( eeg = [ - <NUM_LIT:10> , <NUM_LIT:10> ] , grad = [ - <NUM_LIT> , <NUM_LIT> ] , mag = [ - <NUM_LIT> , <NUM_LIT> ] ) <EOL> evoked . plot ( ylim = ylim , proj = True ) <EOL> alpha = <NUM_LIT:50> <EOL> loose , depth = <NUM_LIT> , <NUM_LIT> <EOL> n_mxne_iter = <NUM_LIT:10> <EOL> inverse_operator = make_inverse_operator ( evoked . info , forward , cov , <EOL> loose = None , depth = depth , fixed = True ) <EOL> stc_dspm = apply_inverse ( evoked , inverse_operator , lambda2 = <NUM_LIT:1.> / <NUM_LIT> , <EOL> method = '<STR_LIT>' ) <EOL> stc , residual = mixed_norm ( evoked , forward , cov , alpha , loose = loose , <EOL> depth = depth , maxit = <NUM_LIT> , tol = <NUM_LIT> , <EOL> active_set_size = <NUM_LIT:10> , debias = True , weights = stc_dspm , <EOL> weights_min = <NUM_LIT> , n_mxne_iter = n_mxne_iter , <EOL> return_residual = True ) <EOL> residual . plot ( ylim = ylim , proj = True ) <EOL> plot_sparse_source_estimates ( forward [ '<STR_LIT:src>' ] , stc , bgcolor = ( <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> ) , <EOL> fig_name = "<STR_LIT>" % condition , <EOL> opacity = <NUM_LIT:0.1> ) <EOL> stc_fsaverage = stc . morph ( subject_from = '<STR_LIT>' , subject_to = '<STR_LIT>' , <EOL> grade = None , sparse = True , subjects_dir = subjects_dir ) <EOL> src_fsaverage_fname = subjects_dir + '<STR_LIT>' <EOL> src_fsaverage = mne . read_source_spaces ( src_fsaverage_fname ) <EOL> plot_sparse_source_estimates ( src_fsaverage , stc_fsaverage , bgcolor = ( <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> ) , <EOL> opacity = <NUM_LIT:0.1> ) </s>
