def all_pairs(elements):
    """
    Helper function, giving all pairs of a list of elements

    Parameter
    --------
    elements: List[Any]
        list of elements

    Returns
    -------
    List[Tuple[Any, Any]]
       Unique pairings of the elements in the given list.
    """
    return [(elements[i], elements[j]) for i in range(0, len(elements)) \
            for j in range(i + 1, len(elements))]