code: def save_aspickle(self, fname):
          
          if fname[-4:] != '.pkl':
              fname += '.pkl'
          with open(fname, 'wb') as f:
              pickle.dump(self, f, pickle.HIGHEST_PROTOCOL)
docs: Saves object as pickle.
  
          fname : str
              file path.