﻿# -*- coding: utf-8 -*-
""" Task 803 """
import math

def catprob(bayes, cat):
    """ oblicza logarytm prawodpodobieństwa P(C=c) """
    if cat not in bayes.class_count:
        return -1e300
    return math.log(bayes.class_count[cat] \
        / float(sum(bayes.class_count.values())))