<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nth_value(expr, nth, skip_nulls=False, sort=None, ascending=True):
 """ Get nth value of a grouped and sorted expression. :param expr: expression for calculation :param nth: integer position :param skip_nulls: whether to skip null values, False by default :param sort: name of the sort column :param ascending: whether to sort in ascending order :return: calculated column """

    return _cumulative_op(expr, NthValue, data_type=expr._data_type, sort=sort,
                          ascending=ascending, _nth=nth, _skip_nulls=skip_nulls)