# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.conf import settings
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.conf import settings
from .models import Tag, Book
from os.path import getmtime
import cPickle
from collections import defaultdict
from .models import Tag, Book
from os.path import getmtime
import cPickle
from collections import defaultdict
BOOK_CATEGORIES = ('author', 'epoch', 'genre', 'kind')
BOOK_CATEGORIES = ('author', 'epoch', 'genre', 'kind')
def get_top_level_related_tags(tags, categories=None):
"""
Finds tags related to given tags through books, and counts their usage.
def get_top_level_related_tags(tags, categories=None):
"""
Finds tags related to given tags through books, and counts their usage.