def get_field_type(values):
    """ Determines the type of every item in the value list or dictionary,
        then consolidates that into a single output type.  This is used to 
        determine what type to convert an entire field into - often within
        a database.

        Input 
         - a list or dictionary of strings

        Output:
         - a single value what type the data can be safetly converted into.

        Types identified (and returned) include:
          - unknown
          - string
          - integer
          - float
          - timestamp

        Test Coverage:
          - complete via test harness
    """
    type_freq  = collections.defaultdict(int)

    # count occurances of each type:
    for key in values:
        i = _get_type(key)
        if i != 'unknown':                   # NOTE: unknown is filtered out
            try:                             # values is a dict
                type_freq[i] += values[key]
            except __HOLE__:                # values is a list
                type_freq[i] += 1
    type_list = type_freq.keys()

    # try simple rules:
    result = _get_field_type_rule(type_list)
    if result:
        return result

    # try probabilities:
    result = _get_field_type_probability(type_freq)
    return (result or 'unknown')
dataset/ETHPy150Open kenfar/DataGristle/gristle/field_type.py/get_field_type