def flatten(x):
    """
    Flatten a list

    Performs a single unnesting of a list.

    Parameters
    ----------
    x : list
        A list to be flattened

    Returns
    -------
    The values of `x` but with a single unnesting

    Referneces
    ----------
    https://stackoverflow.com/a/952952/12126576

    Examples
    --------
    x = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
    flatten(x) # [1, 2, 3, 4, 5, 6, 7, 8, 9]

    # Not compatiable with different levels of nesting
    # For this, use unnest()
    x = [[1], [2, [3, 4]]]
    flatten(x) # [1, 2, [3, 4]]
    """
    return [item for sublist in x for item in sublist]