def METHOD_NAME(cls, file_name, samples):
    train_set = [samples[i % len(samples)] for i in range(512)]
    d = zstandard.train_dictionary(1024 * 1024, train_set)
    with open(cls._make_name(file_name), 'wb') as f:
        f.write(d.as_bytes())
    return d