code: def to_soft(self, path_or_handle, as_gzip=False):
          
          if isinstance(path_or_handle, str):
              if as_gzip:
                  with gzip.open(path_or_handle, 'wt') as outfile:
                      outfile.write(self._get_object_as_soft())
              else:
                  with open(path_or_handle, 'w') as outfile:
                      outfile.write(self._get_object_as_soft())
          else:
              path_or_handle.write(self._get_object_as_soft())
docs: Save the object in a SOFT format.
  
          Args:
              path_or_handle (:obj:`str` or :obj:`file`): Path or handle to
                  output file
              as_gzip (:obj:`bool`): Save as gzip