<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dense_rank(expr, sort=None, ascending=True):
 """ Calculate dense rank of a sequence expression. :param expr: expression for calculation :param sort: name of the sort column :param ascending: whether to sort in ascending order :return: calculated column """

    return _rank_op(expr, DenseRank, types.int64, sort=sort, ascending=ascending)