def check_fname(fname, filetype, endings, endings_err=()):
 if ((len(endings_err) > 0) and (not fname.endswith(endings_err))):
  print_endings = ' or '.join([', '.join(endings_err[:(-1)]), endings_err[(-1)]])
  raise IOError(('The filename (%s) for file type %s must end with %s' % (fname, filetype, print_endings)))
 print_endings = ' or '.join([', '.join(endings[:(-1)]), endings[(-1)]])
 if (not fname.endswith(endings)):
  warn(('This filename (%s) does not conform to MNE naming conventions. All %s files should end with %s' % (fname, filetype, print_endings)))

def check_fname ( fname , filetype , endings , endings_err = ( ) ) : if ( ( len ( endings_err ) > 0 ) and ( not fname . endswith ( endings_err ) ) ) : print_endings = ' or ' . join ( [ ', ' . join ( endings_err [ : ( - 1 ) ] ) , endings_err [ ( - 1 ) ] ] ) raise IOError ( ( 'The filename (%s) for file type %s must end with %s' % ( fname , filetype , print_endings ) ) ) print_endings = ' or ' . join ( [ ', ' . join ( endings [ : ( - 1 ) ] ) , endings [ ( - 1 ) ] ] ) if ( not fname . endswith ( endings ) ) : warn ( ( 'This filename (%s) does not conform to MNE naming conventions. All %s files should end with %s' % ( fname , filetype , print_endings ) ) )
enforce mne filename conventions .