def METHOD_NAME(self, torrent_dict, display_name):
    """
    Calculate the category for a given torrent_dict of a torrent file.
    :return a list of categories this torrent belongs to.
    """
    is_xxx = self.xxx_filter.isXXXTorrent(
        files_list=recursive_unicode(torrent_dict[b'info']["files"] if "files" in torrent_dict[b'info'] else []),
        torrent_name=torrent_dict[b'info'].get(b"name", b'').decode('utf-8'),
        tracker=torrent_dict[b'info'].get(b"announce", b'').decode('utf-8'))
    if is_xxx:
        return "xxx"
    files_list = []
    try:
        # the multi-files mode
        for ifiles in torrent_dict[b'info'][b"files"]:
            files_list.append((ifiles[b'path'][-1].decode('utf-8'), ifiles[b'length'] / float(self.__size_change)))
    except KeyError:
        # single mode
        files_list.append(
            (torrent_dict[b'info'][b"name"].decode('utf-8'),
             torrent_dict[b'info'][b'length'] / float(self.__size_change)))
    tracker = torrent_dict.get(b'announce')
    if not tracker:
        announce_list = torrent_dict.get(b'announce-list', [['']])
        if announce_list and announce_list[0]:
            tracker = announce_list[0][0]
    comment = torrent_dict.get(b'comment')
    return self.calculateCategoryNonDict(files_list, display_name, tracker, comment)