<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> import matplotlib . pyplot as plt <EOL> import mne <EOL> from mne . time_frequency import tfr_morlet , psd_multitaper <EOL> from mne . datasets import somato <EOL> data_path = somato . data_path ( ) <EOL> raw_fname = data_path + '<STR_LIT>' <EOL> raw = mne . io . read_raw_fif ( raw_fname ) <EOL> events = mne . find_events ( raw , stim_channel = '<STR_LIT>' ) <EOL> picks = mne . pick_types ( raw . info , meg = '<STR_LIT>' , eeg = False , eog = True , stim = False ) <EOL> event_id , tmin , tmax = <NUM_LIT:1> , - <NUM_LIT:1.> , <NUM_LIT> <EOL> baseline = ( None , <NUM_LIT:0> ) <EOL> epochs = mne . Epochs ( raw , events , event_id , tmin , tmax , picks = picks , <EOL> baseline = baseline , reject = dict ( grad = <NUM_LIT> , eog = <NUM_LIT> ) , <EOL> preload = True ) <EOL> epochs . resample ( <NUM_LIT> , npad = '<STR_LIT>' ) <EOL> epochs . plot_psd ( fmin = <NUM_LIT> , fmax = <NUM_LIT> ) <EOL> epochs . plot_psd_topomap ( ch_type = '<STR_LIT>' , normalize = True ) <EOL> f , ax = plt . subplots ( ) <EOL> psds , freqs = psd_multitaper ( epochs , fmin = <NUM_LIT:2> , fmax = <NUM_LIT> , n_jobs = <NUM_LIT:1> ) <EOL> psds = <NUM_LIT:10> * np . log10 ( psds ) <EOL> psds_mean = psds . mean ( <NUM_LIT:0> ) . mean ( <NUM_LIT:0> ) <EOL> psds_std = psds . mean ( <NUM_LIT:0> ) . std ( <NUM_LIT:0> ) <EOL> ax . plot ( freqs , psds_mean , color = '<STR_LIT:k>' ) <EOL> ax . fill_between ( freqs , psds_mean - psds_std , psds_mean + psds_std , <EOL> color = '<STR_LIT:k>' , alpha = <NUM_LIT> ) <EOL> ax . set ( title = '<STR_LIT>' , xlabel = '<STR_LIT>' , <EOL> ylabel = '<STR_LIT>' ) <EOL> plt . show ( ) <EOL> freqs = np . arange ( <NUM_LIT:6> , <NUM_LIT:30> , <NUM_LIT:3> ) <EOL> n_cycles = freqs / <NUM_LIT> <EOL> power , itc = tfr_morlet ( epochs , freqs = freqs , n_cycles = n_cycles , use_fft = True , <EOL> return_itc = True , decim = <NUM_LIT:3> , n_jobs = <NUM_LIT:1> ) <EOL> power . plot_topo ( baseline = ( - <NUM_LIT:0.5> , <NUM_LIT:0> ) , mode = '<STR_LIT>' , title = '<STR_LIT>' ) <EOL> power . plot ( [ <NUM_LIT> ] , baseline = ( - <NUM_LIT:0.5> , <NUM_LIT:0> ) , mode = '<STR_LIT>' ) <EOL> fig , axis = plt . subplots ( <NUM_LIT:1> , <NUM_LIT:2> , figsize = ( <NUM_LIT:7> , <NUM_LIT:4> ) ) <EOL> power . plot_topomap ( ch_type = '<STR_LIT>' , tmin = <NUM_LIT:0.5> , tmax = <NUM_LIT> , fmin = <NUM_LIT:8> , fmax = <NUM_LIT:12> , <EOL> baseline = ( - <NUM_LIT:0.5> , <NUM_LIT:0> ) , mode = '<STR_LIT>' , axes = axis [ <NUM_LIT:0> ] , <EOL> title = '<STR_LIT>' , vmax = <NUM_LIT> , show = False ) <EOL> power . plot_topomap ( ch_type = '<STR_LIT>' , tmin = <NUM_LIT:0.5> , tmax = <NUM_LIT> , fmin = <NUM_LIT> , fmax = <NUM_LIT> , <EOL> baseline = ( - <NUM_LIT:0.5> , <NUM_LIT:0> ) , mode = '<STR_LIT>' , axes = axis [ <NUM_LIT:1> ] , <EOL> title = '<STR_LIT>' , vmax = <NUM_LIT> , show = False ) <EOL> mne . viz . tight_layout ( ) <EOL> plt . show ( ) <EOL> itc . plot_topo ( title = '<STR_LIT>' , vmin = <NUM_LIT:0.> , vmax = <NUM_LIT:1.> , cmap = '<STR_LIT>' ) </s>
