def _from_pairs_to_dict(pairs):
    """Convert a list of StrStrPair or StrIntPair into a flat dictionary."""
    result = {}
    for pair in pairs:
        key = pair.first
        value = pair.second
        result[key] = value
    return result