def _to_tuple(x):
    """
    Converts an object into a tuple. If the object is not iterable, creates a one-element tuple containing the object.

    Parameters
    ----------
    x : object

    Returns
    -------
    out : tuple
        Tuple representing the object.
    """
    try:
        return tuple(x)
    except TypeError:
        return x,