#NEWLINE# def pick_channels_evoked( orig , include = [ ] , exclude = 'bads' ) : #NEWLINE# #INDENT# "Pick channels from evoked data\n\n    Parameters\n    ----------\n    orig : Evoked object\n        One evoked dataset.\n    include : list of string, (optional)\n        List of channels to include (if empty, include all available).\n    exclude : list of string | str\n        List of channels to exclude. If empty do not exclude any (default).\n        If 'bads', exclude channels in orig.info['bads']. Defaults to 'bads'.\n\n    Returns\n    -------\n    res : instance of Evoked\n        Evoked data restricted to selected channels. If include and\n        exclude are empty it returns orig without copy.\n    " #NEWLINE# if ( ( len ( include ) == 0 ) and ( len ( exclude ) == 0 ) ) : #NEWLINE# #INDENT# return orig #NEWLINE# #UNINDENT# exclude = _check_excludes_includes ( exclude , info = orig . info , allow_bads = True ) #NEWLINE# sel = pick_channels ( orig . info [ 'ch_names' ] , include = include , exclude = exclude ) #NEWLINE# if ( len ( sel ) == 0 ) : #NEWLINE# #INDENT# raise ValueError ( 'Warning : No channels match the selection.' ) #NEWLINE# #UNINDENT# res = deepcopy ( orig ) #NEWLINE# res . info = pick_info ( exclude . info , sel ) #NEWLINE# res . data = res . data [ sel , : ] #NEWLINE# return res