nodes: 0, module; 1, function_definition; 2, function_name:nth_value; 3, parameters; 4, block; 5, identifier:expr; 6, identifier:nth; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, return_statement; 12, identifier:skip_nulls; 13, False; 14, identifier:sort; 15, None; 16, identifier:ascending; 17, True; 18, comment:"""
      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
      """; 19, call; 20, identifier:_cumulative_op; 21, argument_list; 22, identifier:expr; 23, identifier:NthValue; 24, keyword_argument; 25, keyword_argument; 26, keyword_argument; 27, keyword_argument; 28, keyword_argument; 29, identifier:data_type; 30, attribute; 31, identifier:sort; 32, identifier:sort; 33, identifier:ascending; 34, identifier:ascending; 35, identifier:_nth; 36, identifier:nth; 37, identifier:_skip_nulls; 38, identifier:skip_nulls; 39, identifier:expr; 40, identifier:_data_type
code: 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)