<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __kullback_leibler(h1, h2):
 # 36.3 us """ The actual KL implementation. @see kullback_leibler() for details. Expects the histograms to be of type scipy.ndarray. """

    result = h1.astype(scipy.float_)
    mask = h1 != 0
    result[mask] = scipy.multiply(h1[mask], scipy.log(h1[mask] / h2[mask]))
    return scipy.sum(result)