Edit a section.

        Modify an existing section.
765690
def edit_section(self, id, course_section_end_at=None, course_section_name=None, course_section_restrict_enrollments_to_section_dates=None, course_section_sis_section_id=None, course_section_start_at=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        # OPTIONAL - course_section[name]
        """The name of the section"""
        if course_section_name is not None:
            data["course_section[name]"] = course_section_name

        # OPTIONAL - course_section[sis_section_id]
        """The sis ID of the section"""
        if course_section_sis_section_id is not None:
            data["course_section[sis_section_id]"] = course_section_sis_section_id

        # OPTIONAL - course_section[start_at]
        """Section start date in ISO8601 format, e.g. 2011-01-01T01:00Z"""
        if course_section_start_at is not None:
            data["course_section[start_at]"] = course_section_start_at

        # OPTIONAL - course_section[end_at]
        """Section end date in ISO8601 format. e.g. 2011-01-01T01:00Z"""
        if course_section_end_at is not None:
            data["course_section[end_at]"] = course_section_end_at

        # OPTIONAL - course_section[restrict_enrollments_to_section_dates]
        """Set to true to restrict user enrollments to the start and end dates of the section."""
        if course_section_restrict_enrollments_to_section_dates is not None:
            data["course_section[restrict_enrollments_to_section_dates]"] = course_section_restrict_enrollments_to_section_dates

        self.logger.debug("PUT /api/v1/sections/{id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("PUT", "/api/v1/sections/{id}".format(**path), data=data, params=params, single_item=True)
1035910
def section(self, section):
        
        if isinstance(section, list):
            for h in section:
                self.add_section(h)
        else:
            self.add_section(section)
946258
def _modify(self, **patch):
        """"""
        if 'state' in patch:
            if patch['state'] != 'user-up' and patch['state'] != 'user-down':
                msg = "The members resource does not support a modify with " \
                      "the value of the 'state' attribute as %s. " \
                      "The accepted values are 'user-up' or " \
                      "'user-down'" % patch['state']
                raise MemberStateModifyUnsupported(msg)
        if 'session' in patch:
            if patch['session'] != 'user-enabled' and patch['session'] != \
                    'user-disabled':
                msg = "The members resource does not support a modify with " \
                      "the value of the 'session' attribute as %s. " \
                      "The accepted values are 'user-enabled' or " \
                      "'user-disabled'" % patch['session']
                raise MemberStateModifyUnsupported(msg)
        super(Members, self)._modify(**patch)
298725
def modify(file, content = nil)
      Pathname.new(file).tap do |file|
        file.open('w') { |f| f.write(content) } if content
        future = Time.now + 60
        file.utime future, future
      end
    end
31942
def section(self, section):
        
        if not isinstance(self._container, ConfigUpdater):
            raise ValueError("Sections can only be added at section level!")
        if isinstance(section, str):
            # create a new section
            section = Section(section, container=self._container)
        elif not isinstance(section, Section):
            raise ValueError("Parameter must be a string or Section type!")
        if section.name in [block.name for block in self._container
                            if isinstance(block, Section)]:
            raise DuplicateSectionError(section.name)
        self._container.structure.insert(self._idx, section)
        self._idx += 1
        return self
128295
public void addSection(String pstrSection, String pstrComments)
    {
        INISection objSec   = null;

        objSec = (INISection) this.mhmapSections.get(pstrSection);
        if (objSec == null)
        {
            objSec = new INISection(pstrSection);
            this.mhmapSections.put(pstrSection, objSec);
        }
        objSec.setSecComments(delRemChars(pstrComments));
        objSec = null;
    }
113510
def modify(self, sort=None, purge=False, done=None, undone=None):
        
        self.model.modifyInPlace(
            sort=self._getPattern(sort),
            purge=purge,
            done=self._getDone(done, undone)
        )
778171
def modify(self, *, sort=None, purge=False, done=None):
        """"""
        return self._modifyInternal(sort=sort, purge=purge, done=done)
627786
def set_section_config(self, section, content):
        

        if not self._config.has_section(section):
            self._config.add_section(section)
        for key in content:
            if isinstance(content[key], bool):
                content[key] = str(content[key]).lower()
            self._config.set(section, key, content[key])
        self._override_config[section] = content
416958
def help_center_section_translation_update(self, section_id, locale, data, **kwargs):
        ""
        api_path = "/api/v2/help_center/sections/{section_id}/translations/{locale}.json"
        api_path = api_path.format(section_id=section_id, locale=locale)
        return self.call(api_path, method="PUT", data=data, **kwargs)
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
980531
public function addSection(Section $section)
    {
        $this->registry['sections'][] = $section;

        $this->currentSection = $section;

        return $this;
    }
444759
def add_section(self, name):
        

        assert isinstance(name, str)

        # Skip existing sections
        for section in self.sections:
            if section.name == name:
                return section

        item = defaults["common"].copy()
        item["name"] = name

        item["itemType"] = "section"

        item = self.add_item(item)
        self.sections.append(item)

        return item
868675
def new_section(self, doc, *args, **kwargs):
    

    section = Section(doc, *args, **kwargs)
    if section.identifier:
      if section.identifier in self.sections:
        raise ValueError('section identifier {!r} already used'
          .format(section.identifier))
      self.sections[section.identifier] = section
    doc.sections.append(section)
    return section
192693
def remove_section(self, section):
        """"""
        existed = section in self._sections
        if existed:
            del self._sections[section]
            del self._proxies[section]
        return existed
1319275
def apply_modification(self):
        """"""
        self.__changing_model = True

        if self.adding_model: self.model.add(self.adding_model)
        elif self.editing_model and self.editing_iter:
            # notifies the currencies model
            path = self.model.get_path(self.editing_iter)
            self.model.row_changed(path, self.editing_iter)            
            pass            
        
        self.view.remove_currency_view()
        self.adding_model = None
        self.editing_model = None
        self.editing_iter = None
        self.curreny = None

        self.unselect()
        self.__changing_model = False
        return
1249078
def add_section(self, section):
        """"""
        section, _, _ = self._validate_value_types(section=section)
        super(ConfigParser, self).add_section(section)