def get_valid_passwords(df, validation_method):
    """ Filters all valid passwords of a list.

    :param df: dataframe
    :param validation_method: function that returns a boolean
    :return: dataframe with only valid passwords
    """
    # list of indices that should be dropped
    drop = []

    # find all invalid passwords
    for i in range(len(df.index)):
        if not validation_method(df.iloc[i]):
            drop.append(i)

    # drop invalid passwords and return dataframe
    return df.drop(drop).reset_index(drop=True)