def filtering_restrict_to_train_users(train, test):
    """
    Returns test DataFrame restricted to users from train set.
    """
    train_users = set(train["user"])
    return test[test["user"].isin(train_users)]