def unpack_singleton(x):
    """
    Return original except when it is a sequence of length 1 in which case return the only element
    :param x: a list
    :return: the original list or its only element
    """
    if len(x) == 1:
        return x[0]
    else:
        return x