def sort(df, sort_column, ascending=True):
    """
    Sorts a given DataFrame by a given column and returns it.

    :param df: (pandas DataFrame) the data to be sorted.
    :param sort_column: (string) describes which column on the given DataFrame to sort. Raises KeyError if the column
                        does not exist in the DataFrame.
    :param ascending: (boolean, optional) if True, sorts the given DataFrame in ascending order on the given column
    :return df: (pandas DataFrame) the data, now sorted on the given sort column.
    """
    if sort_column not in df.columns:
        raise KeyError("The sorting column is not present in the given DataFrame.")

    return df.sort_values(sort_column, ascending=ascending)