def METHOD_NAME(obj):
    # Pickle doesn't guarantee that there is a single
    # representation for every serialization.  We can try to
    # picke / depickle twice to have a canonical
    # representation.
    key = pickle.dumps(obj, protocol=-1)
    key = pickle.dumps(pickle.loads(key), protocol=-1)
    return key