(element_set: Set)
return el2idx
Create an element to index mapping, that includes a zero and an unknown element.

    :param element_set: set of elements to enumerate
    :return: an index as a dictionary
    >>> get_elements_index({"a", "b", "c", all_zeroes})["_UNKNOWN"] 
    4
Create an element to index mapping, that includes a zero and an unknown element.
Create an element to index mapping that includes a zero and an unknown element .
def get_elements_index(element_set: Set):
    """
    Create an element to index mapping, that includes a zero and an unknown element.

    :param element_set: set of elements to enumerate
    :return: an index as a dictionary
    >>> get_elements_index({"a", "b", "c", all_zeroes})["_UNKNOWN"] 
    4
    """
    element_set = element_set - {all_zeroes, unknown_el}
    element_set = sorted(list(element_set))
    el2idx = {c: i for i, c in enumerate(element_set, 1)}
    el2idx[all_zeroes] = 0
    el2idx[unknown_el] = len(el2idx)
    return el2idx
def get_elements_index ( element_set : Set ) : element_set = element_set - { all_zeroes , unknown_el } element_set = sorted ( list ( element_set ) ) el2idx = { c : i for i , c in enumerate ( element_set , 1 ) } el2idx [ all_zeroes ] = 0 el2idx [ unknown_el ] = len ( el2idx ) return el2idx