def _get_field_type_probability(type_freq):
    total = sum(type_freq.itervalues())

    # if the sample-size is too small, then we can't be sure:
    if total < 10:
        return 'unknown'

    type_pct  = collections.defaultdict(int)
    for key in type_freq:
        type_pct[key] = type_freq[key] / total

    for key in type_pct:
        if type_pct[key] >= 0.95:
            return key

    # no clear winner, we can't be sure:
    return 'unknown'
Determines type of field based on the type of the vast majority of
dataset/ETHPy150Open kenfar/DataGristle/gristle/field_type.py/_get_field_type_probability