#!/usr/bin/env python3

import pickle

# any Python object:
# dictionary, list, ..
# instance of a class, tensor, ..
# lists of classes, tensors, ..
data = {'name': 'Alice', 'age': 30, 'city': 'New York'}

# binary serialization, dumping to file
with open('data.pkl', 'wb') as file:
    pickle.dump(data, file)

# deserialization, loading from file
with open('data.pkl', 'rb') as file:
    loaded_data = pickle.load(file)

print(loaded_data)
