code: def save(self, fp, mode='wb'):
          
          if hasattr(fp, 'write'):
              self._record.write(fp)
          else:
              with open(fp, mode) as f:
                  self._record.write(f)
docs: Save the PSD file.
  
          :param fp: filename or file-like object.
          :param mode: file open mode, default 'wb'.