def sort_by_other(sequence, order):
    """
    Order a list a another list that contains the desired order.
    
    Args:
        sequence (list): The list that is ordered. All items must be
            contained in order.
        order (list): The list containing the order.
    
    Returns:
        list: The sequence ordered according to order.
    """
    # Map the names of order to their indexes.
    order_dict = dict({(key, idx) for idx, key,  in enumerate(order)})
    # Get the indexes in respect to order from sequence.
    implicit_order = [order_dict[val] for val in sequence]
    # Zip and sort.
    return [val for (idx, val) in sorted(zip(implicit_order, sequence))]