code: def dump(self, obj, file, return_digest=False, *args, **kwargs):
      if return_digest:
          pickled_data = pickle.dumps(obj)
          file.write(pickled_data)
          digest = hmac.new(
              self.key, pickled_data, hashlib.sha1
          ).hexdigest()
          return digest
      else:
          pickle.dump(obj, file, *args, **kwargs)
  
file_path: BigDL/python/ppml/src/bigdl/ppml/utils/safepickle.py
imports: import pickle
  import hmac
  import hashlib
  from bigdl.ppml.utils.log4Error import invalidInputError
label_desc: Use image node_id 1 for calling the SafePickle obj's underlying member method code with example usage: obj.dump(obj, file, return_digest) and returns: digest