def _remove_duplicates(list_of_elements):
    """
    Remove duplicates from a list but maintain the order
    :param list list_of_elements: list to be deduped
    :returns: list containing a distinct list of elements
    :rtype: list
    """
    seen = set()
    return [x for x in list_of_elements if not (x in seen or seen.add(x))]