def read_logfile(log_file):
dirname = os.path.dirname(log_file) + '<STR_LIT:/>'<EOL>with open(log_file, '<STR_LIT:r>') as f:<EOL><INDENT>rlog = f.readlines()<EOL><DEDENT>hashind = [i for i, n in enumerate(rlog) if '<STR_LIT:#>' in n]<EOL>pathread = re.compile('<STR_LIT>')<EOL>paths = (pathread.match(l).groups() for l in rlog[hashind[<NUM_LIT:0>] + <NUM_LIT:1>:hashind[-<NUM_LIT:1>]] if pathread.match(l))<EOL>paths = {k: os.path.join(dirname, v) for k, v in paths}<EOL>logread = re.compile('<STR_LIT>')<EOL>runargs = []<EOL>for line in rlog[hashind[<NUM_LIT:1>] + <NUM_LIT:1>:]:<EOL><INDENT>fname, args, kwargs = (logread.match(line).groups())<EOL>runargs.append((fname ,{'<STR_LIT:args>': eval(args), '<STR_LIT>': eval(kwargs)}))<EOL>if fname == '<STR_LIT>':<EOL><INDENT>runargs[-<NUM_LIT:1>][-<NUM_LIT:1>]['<STR_LIT>']['<STR_LIT>'] = '<STR_LIT>'<EOL>runargs[-<NUM_LIT:1>][-<NUM_LIT:1>]['<STR_LIT>']['<STR_LIT>'] = None<EOL>runargs[-<NUM_LIT:1>][-<NUM_LIT:1>]['<STR_LIT>']['<STR_LIT>'] = paths['<STR_LIT>']<EOL>if '<STR_LIT>' in paths:<EOL><INDENT>runargs[-<NUM_LIT:1>][-<NUM_LIT:1>]['<STR_LIT>']['<STR_LIT>'] = paths['<STR_LIT>']<EOL><DEDENT><DEDENT><DEDENT>return runargs, paths<EOL>
Reads an latools analysis.log file, and returns dicts of arguments.

Parameters
----------
log_file : str
    Path to an analysis.log file produced by latools.

Returns
-------
runargs, paths : tuple
    Two dictionaries. runargs contains all the arguments required to run each step
    of analysis in the form (function_name, {'args': (), 'kwargs': {}}). paths contains
    the locations of the data directory and the SRM database used for analysis.