'Krippendorff 1980'

def alpha(self):

    if (len(self.K) == 0):
        raise ValueError(u'Cannot    calculate    alpha,    no    data    present!')
    if (len(self.K) == 1):
        log.debug(u'Only    one    annotation    value,    allpha    returning    1.')
        return 1
    if ((len(self.C) == 1) and (len(self.I) == 1)):
        raise ValueError(u'Cannot    calculate    alpha,    only    one    coder    and    item    present!')
    De = 0.0
    label_freqs = FreqDist((x[u'labels'] for x in self.data))
    for j in self.K:
        nj = label_freqs[j]
        for l in self.K:
            De += (float((nj * label_freqs[l])) * self.distance(j, l))
    try:
        De = ((1.0 / ((len(self.I) * len(self.C)) * ((len(self.I) * len(self.C)) - 1))) * De)
        log.debug(u'Expected    disagreement:    %f', De)
        ret = (1.0 - (self.Do_alpha() / De))
    except ZeroDivisionError:
        raise ValueError(u'Cannot    calculate    alpha,    expected    disagreement    zero,    check    the    distance    function!')
    return ret
