def clean_invalid(df, flag='flag'):
    """ Remove rows where flag is True. Is `flag` is not in the columns, return 
    the same dataframe.
    
    Parameters
    ----------
    flag  : str
        Column used as flag. Default if `flag`.
    """
    df_new = df.copy()
    
    _meta = df._metadata
    
    if flag in df.columns:
        filtr = (df.flag == False)
        df_new = df_new[filtr]

    df_new._metadata = _meta
    
    return df_new