Set a section. If section already exists, overwrite the old one.
161805
def set_section(self, section):
        
        if not isinstance(section, Section):
            raise Exception("You")

        try:
            self.remove_section(section.name)
        except:
            pass

        self._sections[section.name] = copy.deepcopy(section)
927294
def set_ownership(self):
        """"""
        assert self.section is not None

        for t in self.children:
            t.parent = self
            t._section = self.section
            t.doc = self.doc
            t.set_ownership()
44360
protected void updateOverwriteExisting() {

        if (m_overwriteExisting != null) {
            boolean move = (m_dialogMode == DialogMode.move) || (m_actionCombo.getValue() == Action.move);
            if (move) {
                m_overwriteExisting.setValue(Boolean.FALSE);
                m_overwriteExisting.setVisible(false);
            } else {
                m_overwriteExisting.setVisible(true);
            }
        }
    }
1219054
def setPar(theDict, name, value):
    
    section, previousVal = findFirstPar(theDict, name)
    # "section" is the actual object, not a copy
    section[name] = value
899029
def set_if_missing(cfg,section,option,value):
    """"""
    try:
        cfg.get(section,option)
    except NoSectionError:
        cfg.add_section(section)
        cfg.set(section,option,value)
    except NoOptionError:
        cfg.set(section,option,value)
180871
private void put(String section, String key, String value, boolean append) {
        // ignore lines without =
        if (key == null) {
            return;
        }
        if (section == null) {
            put(key, value, append);
            return;
        }
        put(key.isEmpty()
                        ? section
                        : section + '.' + key,
                value, append);
    }
71826
public void setSection (Section section)
    {
        _sections.put(key(section.x, section.y), section);
    }
538987
public void addSection(final TimeSection SECTION) {
        if (null == SECTION) return;
        sections.add(SECTION);
        Collections.sort(sections, new TimeSectionComparator());
        fireUpdateEvent(SECTION_EVENT);
    }
1110160
def set(self, value, start=None, stop=None):
		""""""
		_check_start_stop(start, stop)
		# start_index, stop_index will denote the sections we are replacing
		start_index = self._bisect_left(start)
		if start is not None:  # start_index == 0
			prev_value = self._values[start_index - 1]
			if prev_value == value:
				# We're setting a range where the left range has the same
				# value, so create one big range
				start_index -= 1
				start = self._keys[start_index]
		if stop is None:
			new_keys = [start]
			new_values = [value]
			stop_index = len(self._keys)
		else:
			stop_index = self._bisect_right(stop)
			stop_value = self._values[stop_index - 1]
			stop_key = self._keys[stop_index - 1]
			if stop_key == stop and stop_value == value:
				new_keys = [start]
				new_values = [value]
			else:
				new_keys = [start, stop]
				new_values = [value, stop_value]
		self._keys[start_index:stop_index] = new_keys
		self._values[start_index:stop_index] = new_values
1056006
def add_section(self, section, friendly_name = None):
  """"""
  if not isinstance(section, BASESTRING): # Make sure the user isn't expecting to use something stupid as a key.
   raise ValueError(section)
  # See if we've got this section already:
  if section in self.config:
   raise DuplicateSectionError(section) # Yep... Kick off.
  else:
   self.config[section] = OrderedDict() # Nope... Ad it
   if friendly_name == None:
    friendly_name = section.title()
   if '&' not in friendly_name:
    friendly_name = '&' + friendly_name
   self.section_names[section] = friendly_name
857992
def add_section(name)
      if section_exists?(name)
        raise IniParseError.new(_("Section %{name} is already defined, cannot redefine") % { name: name.inspect }, @file)
      end

      section = Section.new(name, @file)
      @contents << section

      section
    end
385627
public void addSection(String section, ConfigParams sectionParams) {
		if (section == null)
			throw new NullPointerException("Section name cannot be null");

		if (sectionParams != null) {
			for (Map.Entry<String, String> entry : sectionParams.entrySet()) {
				String key = entry.getKey();

				if (key.length() > 0 && section.length() > 0)
					key = section + "." + key;
				else if (key.length() == 0)
					key = section;

				String value = entry.getValue();

				put(key, value);
			}
		}
	}
333449
def toggle(self, section, option):
  """"""
  self.set(section, option, not self.get(section, option))
507780
def add_section(self, section):
        """"""
        if not issubclass(section.__class__, _AbstractSection):
            raise TypeError("argument should be a subclass of Section")
        self.sections[section.get_key_name()] = section
        return section
686511
def rename_section(self, section, new_name):
        
        if not self.has_section(section):
            raise ValueError("Source section '%s' doesn't exist" % section)
        if self.has_section(new_name):
            raise ValueError("Destination section '%s' already exists" % new_name)

        super(GitConfigParser, self).add_section(new_name)
        for k, v in self.items(section):
            self.set(new_name, k, self._value_to_string(v))
        # end for each value to copy

        # This call writes back the changes, which is why we don't have the respective decorator
        self.remove_section(section)
        return self
1186730
def add_section(self, section):
        
        self._sections = self._ensure_append(section, self._sections)
422759
public boolean add(ConfigurationSection section) {
    if (section instanceof SingletonConfigurationSection) {
      if (getSection(section.getClass()) !=  null) {
        throw new IllegalArgumentException("Section of same type already inserted: " + section.getClass().getName());
      }
    }
    return sections.add(section);
  }