def METHOD_NAME(pairs: Tuple[str, Any]):
    ret = {}
    for field, value in pairs:
        if not ret.get(field):
            ret[field] = []
        ret[field].append(value)
    for key, value in ret.items():
        if len(value) == 1:
            ret[key] = value[0]
    return ret