from typing import Iterable


def uniform_dict_keys(iterable_dict: Iterable[dict]) -> int:
    """
    Function evaluates if Iterable of dictionaries
    has same keys for each dictionary.
    If true, this will allow for one query
    to process data. ie one query to insert/update/etc
    all rows vs having to create a query
    for each dictionary (non uniform key/pair data)

    Args:
        iter_dict (_type_): Iterable of dictionaries
        representing data to be processed into database

    Return:
     Length of unique sets of keys. If returns 1,
     then this indicates all dicts in list
     have the same keys (uniform)
    """

    def key_sort(dict) -> tuple:
        """Return sorted dictionary keys for each dict"""
        # sorted(dict) returns keys
        # Need a tuple to process set()
        return tuple(sorted(dict))

    # Compare all tuples of keys and apply set() to identify unique key combinations
    # If len(set) = 1, then all keys same for all dictionaries->uniform data structure
    keys = set(map(key_sort, iterable_dict))

    return len(keys)