<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dropna(expr, how='any', thresh=None, subset=None):
 """ Return object with labels on given axis omitted where alternately any or all of the data are missing :param DataFrame expr: input DataFrame :param how: can be ‘any’ or ‘all’. If 'any' is specified any NA values are present, drop that label. If 'all' is specified and all values are NA, drop that label. :param thresh: require that many non-NA values :param subset: Labels along other axis to consider, e.g. if you are dropping rows these would be a list of columns to include :return: DataFrame """

    if subset is None:
        subset = [expr._get_field(c) for c in expr.schema.names]
    else:
        subset = [expr._get_field(c) for c in utils.to_list(subset)]

    if not subset:
        raise ValueError('Illegal subset is provided.')

    if thresh is None:
        thresh = len(subset) if how == 'any' else 1

    sum_exprs = reduce(operator.add, (s.notnull().ifelse(1, 0) for s in subset))
    return expr.filter(sum_exprs >= thresh)