def loadResults(resultsFile):
with open(resultsFile) as f:<EOL><INDENT>raw=f.read().split("<STR_LIT:\n>")<EOL><DEDENT>foldersByDay={}<EOL>for line in raw:<EOL><INDENT>folder=line.split('<STR_LIT:">')[<NUM_LIT:1>]+"<STR_LIT:\\>"<EOL>line=[]+line.split('<STR_LIT:">')[<NUM_LIT:2>].split("<STR_LIT:U+002CU+0020>")<EOL>for day in line[<NUM_LIT:1>:]:<EOL><INDENT>if not day in foldersByDay:<EOL><INDENT>foldersByDay[day]=[]<EOL><DEDENT>foldersByDay[day]=foldersByDay[day]+[folder]<EOL><DEDENT><DEDENT>nActiveDays=len(foldersByDay)<EOL>dayFirst=sorted(foldersByDay.keys())[<NUM_LIT:0>]<EOL>dayLast=sorted(foldersByDay.keys())[-<NUM_LIT:1>]<EOL>dayFirst=datetime.datetime.strptime(dayFirst, "<STR_LIT>" )<EOL>dayLast=datetime.datetime.strptime(dayLast, "<STR_LIT>" )<EOL>nDays = (dayLast - dayFirst).days + <NUM_LIT:1><EOL>emptyDays=<NUM_LIT:0><EOL>for deltaDays in range(nDays):<EOL><INDENT>day=dayFirst+datetime.timedelta(days=deltaDays)<EOL>stamp=datetime.datetime.strftime(day, "<STR_LIT>" )<EOL>if not stamp in foldersByDay:<EOL><INDENT>foldersByDay[stamp]=[]<EOL>emptyDays+=<NUM_LIT:1><EOL><DEDENT><DEDENT>percActive=nActiveDays/nDays*<NUM_LIT:100><EOL>print("<STR_LIT>"%(nActiveDays,nDays,percActive))<EOL>return foldersByDay<EOL>
returns a dict of active folders with days as keys.