<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> import matplotlib . pyplot as plt <EOL> import mne <EOL> from mne import io <EOL> from mne . datasets import sample <EOL> from mne . minimum_norm import read_inverse_operator , source_induced_power <EOL> print ( __doc__ ) <EOL> data_path = sample . data_path ( ) <EOL> raw_fname = data_path + '<STR_LIT>' <EOL> fname_inv = data_path + '<STR_LIT>' <EOL> label_name = '<STR_LIT>' <EOL> fname_label = data_path + '<STR_LIT>' % label_name <EOL> tmin , tmax , event_id = - <NUM_LIT> , <NUM_LIT:0.5> , <NUM_LIT:2> <EOL> raw = io . read_raw_fif ( raw_fname ) <EOL> events = mne . find_events ( raw , stim_channel = '<STR_LIT>' ) <EOL> inverse_operator = read_inverse_operator ( fname_inv ) <EOL> include = [ ] <EOL> raw . info [ '<STR_LIT>' ] += [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> picks = mne . pick_types ( raw . info , meg = True , eeg = False , eog = True , <EOL> stim = False , include = include , exclude = '<STR_LIT>' ) <EOL> reject = dict ( grad = <NUM_LIT> , mag = <NUM_LIT> , eog = <NUM_LIT> ) <EOL> epochs = mne . Epochs ( raw , events , event_id , tmin , tmax , picks = picks , <EOL> baseline = ( None , <NUM_LIT:0> ) , reject = reject , <EOL> preload = True ) <EOL> frequencies = np . arange ( <NUM_LIT:7> , <NUM_LIT:30> , <NUM_LIT:2> ) <EOL> label = mne . read_label ( fname_label ) <EOL> n_cycles = frequencies / <NUM_LIT> <EOL> epochs_induced = epochs . copy ( ) . subtract_evoked ( ) <EOL> plt . close ( '<STR_LIT:all>' ) <EOL> for ii , ( this_epochs , title ) in enumerate ( zip ( [ epochs , epochs_induced ] , <EOL> [ '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) ) : <EOL> power , phase_lock = source_induced_power ( <EOL> this_epochs , inverse_operator , frequencies , label , baseline = ( - <NUM_LIT:0.1> , <NUM_LIT:0> ) , <EOL> baseline_mode = '<STR_LIT>' , n_cycles = n_cycles , n_jobs = <NUM_LIT:1> ) <EOL> power = np . mean ( power , axis = <NUM_LIT:0> ) <EOL> phase_lock = np . mean ( phase_lock , axis = <NUM_LIT:0> ) <EOL> times = epochs . times <EOL> plt . subplots_adjust ( <NUM_LIT:0.1> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> plt . subplot ( <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:2> * ii + <NUM_LIT:1> ) <EOL> plt . imshow ( <NUM_LIT:20> * power , <EOL> extent = [ times [ <NUM_LIT:0> ] , times [ - <NUM_LIT:1> ] , frequencies [ <NUM_LIT:0> ] , frequencies [ - <NUM_LIT:1> ] ] , <EOL> aspect = '<STR_LIT>' , origin = '<STR_LIT>' , vmin = <NUM_LIT:0.> , vmax = <NUM_LIT> , cmap = '<STR_LIT>' ) <EOL> plt . xlabel ( '<STR_LIT>' ) <EOL> plt . ylabel ( '<STR_LIT>' ) <EOL> plt . title ( '<STR_LIT>' % title ) <EOL> plt . colorbar ( ) <EOL> plt . subplot ( <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:2> * ii + <NUM_LIT:2> ) <EOL> plt . imshow ( phase_lock , <EOL> extent = [ times [ <NUM_LIT:0> ] , times [ - <NUM_LIT:1> ] , frequencies [ <NUM_LIT:0> ] , frequencies [ - <NUM_LIT:1> ] ] , <EOL> aspect = '<STR_LIT>' , origin = '<STR_LIT>' , vmin = <NUM_LIT:0> , vmax = <NUM_LIT> , <EOL> cmap = '<STR_LIT>' ) <EOL> plt . xlabel ( '<STR_LIT>' ) <EOL> plt . ylabel ( '<STR_LIT>' ) <EOL> plt . title ( '<STR_LIT>' % title ) <EOL> plt . colorbar ( ) <EOL> plt . show ( ) </s>
