Here is a sample code that you can try:
You have to use pickle.dump() to write your data to a pickle file. If you want to read the saved pickle file, you can use pickle.load()
>>> import pickle
>>> labels = {True:{1,2,3}, False:{4,5,6}}
>>> with open('abc.pkl', 'wb') as fh:
... pickle.dump(labels, fh, protocol=pickle.HIGHEST_PROTOCOL)
...
>>> with open('abc.pkl', 'rb') as fh:
... data = pickle.load(fh)
...
>>> data
{True: {1, 2, 3}, False: {4, 5, 6}}
>>>