#!/usr/bin/env python3
import pickle

for fbase in {'small', 'tiny', 'large'}:
    fname = f"{fbase}.pickle"
    with open(fname, 'rb') as f:
        data = pickle.load(f)

    movieless_data = []
    for a1, a2, m in data:
        movieless_data.append((a1, a2))

    with open(fname, 'wb') as f:
        pickle.dump(movieless_data, f)

    # check
    print(f"Some entries in the file are now: {movieless_data[:3]}")

    with open(fname, 'rb') as f:
        assert pickle.load(f) == movieless_data, f"{fname} isn't quite right..."
