This method saves plots in the appropriate section folder.
        As a consequence two plots cannot have the same name within the same section.
968540
def __save_plots_of_the_current_page(self, section, page, output_path):
        """"""
        
        for key in self.sections[section].pages[page].elements.keys():
            print(section, page, key) # debug print
            
            buf_temp = self.sections[section].pages[page].elements[key].plot_object
            if buf_temp is not None :

                plot_path = os.path.join(output_path, "output", self.name, "site", section, key + ".svg")
                
                
                try :
                    my_file = open(plot_path, "wb")
                    my_file.write(buf_temp)
                    my_file.close()
                except Exception as e:
                    print (e)
                    print ("In {section} and {page}, an element exists without a valid plot object.".format(section = section, page = page))
1157254
def save_files(self):
        """"""
        while True:
            try:
                os.mkdir(self.output_name)
            except Exception as e:
                self.output_name = raw_input("This directory already exists - please enter a new name:")
            else:
                break
        self.workdir = os.getcwd()
        os.chdir(self.workdir+"/"+self.output_name)
71826
public void setSection (Section section)
    {
        _sections.put(key(section.x, section.y), section);
    }
184058
def write_plot_area   # :nodoc:
      second_chart = @combined
      @writer.tag_elements('c:plotArea') do
        # Write the c:layout element.
        write_layout(@plotarea.layout, 'plot')
        # Write the subclass chart type elements for primary and secondary axes.
        write_chart_type(:primary_axes => 1)
        write_chart_type(:primary_axes => 0)

        # Configure a combined chart if present.
        if second_chart

          # Secondary axis has unique id otherwise use same as primary.
          if second_chart.is_secondary?
            second_chart.id = 1000 + @id
          else
            second_chart.id = @id
          end

          # Share the same writer for writing.
          second_chart.writer = @writer

          # Share series index with primary chart.
          second_chart.series_index = @series_index

          # Write the subclass chart type elements for combined chart.
          second_chart.write_chart_type(:primary_axes => 1)
          second_chart.write_chart_type(:primary_axes => 0)
        end

        # Write the category and value elements for the primary axes.
        params = {
          :x_axis   => @x_axis,
          :y_axis   => @y_axis,
          :axis_ids => @axis_ids
        }

        if @date_category
          write_date_axis(params)
        else
          write_cat_axis(params)
        end

        write_val_axis(@x_axis, @y_axis, @axis_ids)

        # Write the category and value elements for the secondary axes.
        params = {
          :x_axis   => @x2_axis,
          :y_axis   => @y2_axis,
          :axis_ids => @axis2_ids
        }

        write_val_axis(@x2_axis, @y2_axis, @axis2_ids)

        # Write the secondary axis for the secondary chart.
        if second_chart && second_chart.is_secondary?

          params = {
            :x_axis   => second_chart.x2_axis,
            :y_axis   => second_chart.y2_axis,
            :axis_ids => second_chart.axis2_ids
          }

          second_chart.write_val_axis(
            second_chart.x2_axis,
            second_chart.y2_axis,
            second_chart.axis2_ids
          )
        end

        if @date_category
          write_date_axis(params)
        else
          write_cat_axis(params)
        end

        # Write the c:dTable element.
        write_d_table

        # Write the c:spPr element for the plotarea formatting.
        write_sp_pr(@plotarea)
      end
    end
701249
def save(self, filename, image_format="eps", width=8, height=6):
        
        self.get_plot(width, height).savefig(filename, format=image_format)
54866
def _set_up_savefolder(self):
        
        if not os.path.isdir(self.cells_path):
            os.mkdir(self.cells_path)

        if not os.path.isdir(self.figures_path):
            os.mkdir(self.figures_path)

        if not os.path.isdir(self.populations_path):
            os.mkdir(self.populations_path)
746492
def save_option(self, path, section, option, value):
        
        config = ConfigParser.SafeConfigParser()
        config.read(path)
        if not config.has_section(section):
            config.add_section(section)
        config.set(section, option, value)
        fp = open(path, 'w')
        config.write(fp)
        fp.close()
        if not self.has_section(section):
            self.add_section(section)
        self.set(section, option, value)
1074965
def save_plots(Figs, filenames, **kwargs):
    
    saved = []
    for key in list(Figs.keys()):
        try:
            plt.figure(num=Figs[key])
            fname = filenames[key]
            if set_env.IS_WIN:  # always truncate filenames if on Windows
                fname = os.path.split(fname)[1]
            if not isServer:  # remove illegal ':' character for windows
                fname = fname.replace(':', '_')
            if 'incl_directory' in kwargs.keys() and not set_env.IS_WIN:
                if kwargs['incl_directory']:
                    pass # do not flatten file name
                else:
                    fname = fname.replace('/', '-') # flatten file name
            else:
                fname = fname.replace('/', '-') # flatten file name
            if 'dpi' in list(kwargs.keys()):
                plt.savefig(fname, dpi=kwargs['dpi'])
            elif isServer:
                plt.savefig(fname, dpi=240)
            else:
                plt.savefig(fname)
            if verbose:
                print(Figs[key], " saved in ", fname)
            saved.append(fname)
            plt.close(Figs[key])
        except Exception as ex:
            print(type(ex), ex)
            print('could not save: ', Figs[key], filenames[key])
            print("output file format not supported ")
    return saved
1000390
def _ensure_module_folder_exists():
  
  if not os.path.isdir(MODULES_FOLDER_PATH):
    try:
      os.mkdir(MODULES_FOLDER_PATH)
    except OSError, e:
      if "file already exists" in str(e):
        raise RuntimeError("Could not create modules folder: file exists with the same name")
563205
def add_section(self, section):
        
        if section == self.default_section:
            raise ValueError('Invalid section name: %r' % section)

        if section in self._sections:
            raise DuplicateSectionError(section)
        self._sections[section] = self._dict()
        self._proxies[section] = SectionProxy(self, section)
1287243
def save(self, *args, **kwargs):
        """"""

        if not self.slug:
            self.slug = slugify(self.name)

        section = super(Section, self).save(*args, **kwargs)

        if self.query and self.query != {}:
            self._save_percolator()

        return section
1369092
function saveSlot(aList, bList, index, slot) {
	setEither(aList, bList, index, slot);

	var isInFirst = (index === 0 || index === aList.sizes.length);
	var len = isInFirst ? 0 : getEither(aList.sizes, bList.sizes, index - 1);

	setEither(aList.sizes, bList.sizes, index, len + length(slot));
}
224720
def save_scan_plot(self, filename="scan.pdf",
                       img_format="pdf", coords=None):
        
        plt = self.get_scan_plot(coords)
        plt.savefig(filename, format=img_format)
913712
public void addSection(final Section SECTION) {
        if (null == SECTION) return;
        sections.add(SECTION);
        Collections.sort(sections, new SectionComparator());
        fireUpdateEvent(SECTION_EVENT);
    }
1035910
def section(self, section):
        
        if isinstance(section, list):
            for h in section:
                self.add_section(h)
        else:
            self.add_section(section)
1231240
public void addTickLabelSection(final Section SECTION) {
        if (null == SECTION) return;
        tickLabelSections.add(SECTION);
        Collections.sort(tickLabelSections, new SectionComparator());
        fireUpdateEvent(REDRAW_EVENT);
    }
918821
def save_html(out_file, plot_html):
    

    internal_open = False
    if type(out_file) == str:
        out_file = open(out_file, "w")
        internal_open = True
    out_file.write("<html><head><script>\n")

    # dump the js code
    bundle_path = os.path.join(os.path.split(__file__)[0], "resources", "bundle.js")
    with io.open(bundle_path, encoding="utf-8") as f:
        bundle_data = f.read()
    out_file.write(bundle_data)
    out_file.write("</script></head><body>\n")

    out_file.write(plot_html.data)

    out_file.write("</body></html>\n")

    if internal_open:
        out_file.close()