save waypoints to a file
179695
def save_waypoints(self, filename):
        ''''''
        try:
            #need to remove the leading and trailing quotes in filename
            self.wploader.save(filename.strip('"'))
        except Exception as msg:
            print("Failed to save %s - %s" % (filename, msg))
            return
        print("Saved %u waypoints to %s" % (self.wploader.count(), filename))
608559
def save_to_file(self, path):
        

        with open(path, 'w') as out:
            out.write(json.dumps(self.get_dict()))
425768
def save_feature(self, cat, img, feature, data):
        """"""
        filename = self.path(cat, img, feature)
        mkdir(filename)
        savemat(filename, {'output':data})
978306
def save(self, path):
        

        data = self.encode()

        with open(path, "wb") as out:
            out.write(data)
868768
def save_to(file)
      if file.kind_of?(String)
        begin
          File.open(file, "w") do |f|
            f.puts to_ser.to_yaml
          end
        rescue Errno::ENOENT
          raise DirCatException.new, "DirCat: cannot write into '#{file}'", caller
        end
      else
        file.puts to_ser.to_yaml
      end
    end
1239653
function saveViewport (buffer, selector) {
      const filePath = selectorMap[selector].filePath;

      ensureDirectoryPath(filePath);
      return fs.writeFile(filePath, buffer);
    }
318166
def save_file(self, filename, text):
        """"""
        if not filename.endswith('.py'):
            filename += '.py'
        path = os.path.join(self.currentpath, filename)
        with open(path, 'w', encoding="utf-8") as file_:
            file_.write(text)
725317
function saveToFile(filename, cfg) {
  // Use 'wx' flag to fails if filename exists
  fs.writeFileSync(filename, JSON.stringify(cfg, null, 2), {flag: 'wx'})
}
342843
def save(self, destination, **kwargs):
        
        with open(destination, "wb") as f:
            torch.save(self, f, **kwargs)
1045290
def save(self, path=None, encoding=None, eol=None):
        
        path = path or self.path
        encoding = encoding or self.encoding

        save_file = codecs.open(path, 'w+', encoding=encoding)
        self.write_into(save_file, eol=eol)
        save_file.close()
990337
def save(self, filename, wildcard='*', verbose=False):
        ''''''
        f = open(filename, mode='w')
        k = list(self.keys())
        k.sort()
        count = 0
        for p in k:
            if p and fnmatch.fnmatch(str(p).upper(), wildcard.upper()):
                f.write("%-16.16s %f\n" % (p, self.__getitem__(p)))
                count += 1
        f.close()
        if verbose:
            print("Saved %u parameters to %s" % (count, filename))
604316
private void saveTiles(FileWriting file, int widthInTile, int step, int s) throws IOException
    {
        for (int tx = 0; tx < widthInTile; tx++)
        {
            for (int ty = 0; ty < map.getInTileHeight(); ty++)
            {
                final Tile tile = map.getTile(tx + s * step, ty);
                if (tile != null)
                {
                    saveTile(file, tile);
                }
            }
        }
    }
356203
def _save_file(self, data, path):
        
        with open(path, 'wb') as tfile:
            for chunk in data:
                tfile.write(chunk)
460676
def save_mag_to_file(mag, filename, rhofile):
    
    if rhofile:
        # bring data in shape
        null = np.zeros(len(mag))
        if mag.shape[1] == 3:
            null = np.column_stack((null, null, null, null))
        result = np.column_stack((mag, null))

        # save datapoints
        with open(filename, 'w') as fid:
            fid.write('{0}\n'.format(mag.shape[0]))
        with open(filename, 'ab') as fid:
            np.savetxt(fid, np.array(result), fmt='%f')

    else:
        # bring data in shape
        with open('inv/rho00.mag', 'r') as fid:
            coor = np.loadtxt(fid, skiprows=1, usecols=[0, 1])
        # calculated back to log
        if mag.shape[1] == 3:
            logx = [math.log(d, 10) for d in mag[:, 0]]
            logy = [math.log(d, 10) for d in mag[:, 1]]
            logz = [math.log(d, 10) for d in mag[:, 2]]
            mag_log = np.column_stack((logx, logy, logz))
        else:
            mag_log = [math.log(d, 10) for d in mag]
        content = np.column_stack((coor[:, 0], coor[:, 1], mag_log))

        # save datapoints
        with open(filename, 'w') as fid:
            fid.write('{0}\n'.format(content.shape[0]))
        with open(filename, 'ab') as fid:
            np.savetxt(fid, np.array(content), fmt='%f')
953675
def saveAs(self, path):
        
        if not path:
            path = self._dialogs.getSaveFileName(filter='*.csv')
        if path:
            self._setPath(path)
            with open(str(self._path), 'wb') as stream:
                writer = csv.writer(stream)
                table = self.table()
                for row in table:
                    writer.writerow(row)
1108556
def save_to_file(path)
      fullpath = File.expand_path(path)
      lines = []

      @content.each_pair do |key,value|
        k = "lxc.#{key.gsub('_', '.')}"

        if value.kind_of?(Array)
          lines << value.map { |v| "#{k} = #{v}" }
        else
          lines << "#{k} = #{value}"
        end
      end

      File.open(path, "w") do |f|
        f.write(lines.flatten.join("\n"))
      end
    end
491986
public static void saveTriLine( String path, PolygonSet ps )
    {
        FileWriter writer = null;
        BufferedWriter w = null;
        String file = path+System.currentTimeMillis()+".tri";
        
        if( ps.getPolygons() == null || ps.getPolygons().isEmpty() ) 
        {
            return;
        }
        
        try
        {
            
            writer = new FileWriter(file);
            w = new BufferedWriter(writer);
            for( DelaunayTriangle t : ps.getPolygons().get(0).getTriangles() )
            {
                for( int i=0; i<3; i++ )
                {
                    w.write( Float.toString( t.points[i].getXf() ) +","+ Float.toString( t.points[i].getYf() )+" ");                    
                }
//                w.newLine();
            }
            logger.info( "Saved triangle lines\n" + file );
        }
        catch( IOException e )
        {
            logger.error( "Failed to save triangle lines" + e.getMessage() );
        }
        finally
        {
            if( w != null )
            {
                try
                {
                    w.close();
                }
                catch( IOException e2 )
                {                    
                }
            }
        }
    }