<s> """<STR_LIT>""" <EOL> import imp <EOL> import os <EOL> import re <EOL> from optparse import OptionParser <EOL> import mne <EOL> def get_optparser ( cmdpath , usage = None ) : <EOL> """<STR_LIT>""" <EOL> command = os . path . basename ( cmdpath ) <EOL> if re . match ( '<STR_LIT>' , command ) : <EOL> command = command [ <NUM_LIT:4> : - <NUM_LIT:3> ] <EOL> elif re . match ( '<STR_LIT>' , command ) : <EOL> command = command [ <NUM_LIT:4> : - <NUM_LIT:4> ] <EOL> if cmdpath . endswith ( '<STR_LIT>' ) : <EOL> mod = imp . load_compiled ( '<STR_LIT>' , cmdpath ) <EOL> else : <EOL> mod = imp . load_source ( '<STR_LIT>' , cmdpath ) <EOL> if mod . __doc__ : <EOL> doc , description , epilog = mod . __doc__ , None , None <EOL> doc_lines = doc . split ( '<STR_LIT:\n>' ) <EOL> description = doc_lines [ <NUM_LIT:0> ] <EOL> if len ( doc_lines ) > <NUM_LIT:1> : <EOL> epilog = '<STR_LIT:\n>' . join ( doc_lines [ <NUM_LIT:1> : ] ) <EOL> OptionParser . format_epilog = lambda self , formatter : self . epilog <EOL> parser = OptionParser ( prog = "<STR_LIT>" % command , <EOL> version = mne . __version__ , <EOL> description = description , <EOL> epilog = epilog , usage = usage ) <EOL> return parser </s>
