from typing import Union


def expand(xs: Union[tuple, list]):
    """Expand a sequence to the same element repeated twice if there is only one
    element.

    Args:
        xs (tuple or list): Sequence to expand.

    Returns:
        tuple or list: `xs * 2` or `xs`.
    """
    return xs * 2 if len(xs) == 1 else xs