@@ -0,0 +1,894 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport re%0A%0A%0Adef parse_access_log(filepath):%0A    def create_dict(elem):%0A        kv = elem.split(':')%0A        return dict(%5B(kv%5B0%5D, kv%5B1%5D)%5D)%0A%0A    lst=%5B%5D%0A    with open(filepath) as tsvfile:%0A        import csv%0A        reader=csv.reader(tsvfile, delimiter='%5Ct')%0A        for row in reader:%0A            r = %7B%7D%0A            for pair in row:%0A                r.update(create_dict(pair))%0A            lst.append(r)%0A    return lst%0A%0Adef filter_access_to_not_textual_contents(logmap):%0A    return %5Bx for x in logmap if not re.search('(.ico%7Cjs%7Ccss)$', x%5B'request_uri'%5D)%5D%0A%0Adef create_accesscount_by_time_map(logmaps):%0A    d = %7B%7D%0A    for logmap in logmaps:%0A        key = logmap%5B'time_local'%5D%0A        d%5Bkey%5D=d.get(key, 0) + 1%0A    return d%0A%0Alogmaps = parse_access_log('access.log')%0A%0Aprint (create_accesscount_by_time_map(filter_access_to_not_textual_contents(logmaps)))%0A

add a function to create a time-accesscount map