def forceTwoTuple(x):
    """
    If `x` is a tuple or a list, return `x`, otherwise return `(x, x)`.
    """
    if isinstance(x, list):
        x = tuple(x)
    if not isinstance(x, tuple):
        x = (x, x)
    return x