def uniq(elems: list) -> dict:
    """generate a set of unique objects

    The list is browsed in order to remove duplicates. Each of the unique
    objects has been assigned an identifier to produce a dictionary where keys
    are identifiers and values are objects.

    **Note**: Objects to be compatible with the `uniq()` function has to be
    comparable (`__eq__()`) and has a property called `identifier` which will
    be used in the process of assigning an identifier to the object.

    Args:
        elems: an input `list` of objects

    Returns:
        A dictionary `{identifier: object}`.
    """
    output = {}
    identifier = 0
    for elem in elems:
        duplicate = False
        # look up for duplicates
        for oid, other in output.items():
            if elem == other:
                # creating a relationship
                elem.identifier = oid
                duplicate = True
                break
        # a new benchmark found
        if not duplicate:
            elem.identifier = identifier
            output[identifier] = elem
            identifier += 1
    return output