Add a new Section object to the config. Should be a subclass of
        _AbstractSection.
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
1197078
def derive_from(cls, section, name=None):
        
        new_section = deepcopy(section)

        if name:
            new_section.name = name

        return new_section
148706
def get_config(self, section=None):
        
        config = self.session.config
        section = self.config_section() if section is None else section
        try:
            return config[section]
        except KeyError:
            config.add_section(section)
            return config[section]
538987
public void addSection(final TimeSection SECTION) {
        if (null == SECTION) return;
        sections.add(SECTION);
        Collections.sort(sections, new TimeSectionComparator());
        fireUpdateEvent(SECTION_EVENT);
    }
547992
public function add_sections() {
		if ( ! empty( Kirki::$sections ) ) {
			foreach ( Kirki::$sections as $section_args ) {
				// Extra checks for nested sections.
				if ( isset( $section_args['section'] ) ) {
					if ( isset( Kirki::$sections[ $section_args['section'] ] ) ) {
						// Set the type to nested.
						$section_args['type'] = 'kirki-nested';
						// We need to check if the parent section is nested inside a panel.
						$parent_section = Kirki::$sections[ $section_args['section'] ];
						if ( isset( $parent_section['panel'] ) ) {
							$section_args['panel'] = $parent_section['panel'];
						}
					}
				}
				new Section( $section_args );
			}
		}
	}
407909
public void addSpec(String sectionName, String objectName, String specText) {
        PageSection pageSection = findSection(sectionName);

        if (pageSection == null) {
            pageSection = new PageSection(sectionName);
            sections.add(pageSection);
        }

        ObjectSpecs objectSpecs = new ObjectSpecs(objectName);
        objectSpecs.addSpec(new SpecReader().read(specText));
        pageSection.addObjects(objectSpecs);
    }
59460
def _get_section_new(cls, dir_base):
        
        from uwsgiconf.presets.nice import PythonSection
        from django.conf import settings

        wsgi_app = settings.WSGI_APPLICATION

        path_wsgi, filename, _, = wsgi_app.split('.')
        path_wsgi = os.path.join(dir_base, path_wsgi, '%s.py' %filename)

        section = PythonSection(
            wsgi_module=path_wsgi,

        ).networking.register_socket(
            PythonSection.networking.sockets.http('127.0.0.1:8000')

        ).main_process.change_dir(dir_base)

        return section
692758
def NewSection(self, token_type, section_name, pre_formatters):
        """"""
        pre_formatters = [self._GetFormatter(f) for f in pre_formatters]
        
        # TODO: Consider getting rid of this dispatching, and turn _Do* into methods
        if token_type == REPEATED_SECTION_TOKEN:
            new_block = _RepeatedSection(section_name, pre_formatters)
            func = _DoRepeatedSection
        elif token_type == SECTION_TOKEN:
            new_block = _Section(section_name, pre_formatters)
            func = _DoSection
        elif token_type == DEF_TOKEN:
            new_block = _Section(section_name, [])
            func = _DoDef
        else:
            raise AssertionError('Invalid token type %s' % token_type)
        
        self._NewSection(func, new_block)
617897
def header_add(self, name, value):
        
        self._set('add-header', '%s: %s' % (name, value), multi=True)

        return self._section
1142533
private function createSection()
    {
        $this->section = $this->modelFactory()->create($this->sectionClass());

        return $this->section;
    }
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;
    }
1150019
def merge_section(self, section, filter_func=None):
    
    for check in section.checks:
      if filter_func and not filter_func(check):
        continue
      self.add_check(check)
1367769
def fill(self, config, section):
        
        if config.has_section(section):
            default_url = self.DEFAULT_REPOSITORIES.get(self.name, '')
            self.url = RepositoryURL(config_get(config, section, 'repository', default_url))
            self.username = config_get(config, section, 'username', '')
            self.password = config_get(config, section, 'password', '')
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
980531
public function addSection(Section $section)
    {
        $this->registry['sections'][] = $section;

        $this->currentSection = $section;

        return $this;
    }
414138
def add_section(self, name=None, anchor=None, description='', comment='', helptext='', plot='', content='', autoformat=True, autoformat_type='markdown'):
        

        # Default anchor
        if anchor is None:
            if name is not None:
                nid = name.lower().strip().replace(' ','-')
                anchor = '{}-{}'.format(self.anchor, nid)
            else:
                sl = len(self.sections) + 1
                anchor = '{}-section-{}'.format(self.anchor, sl)

        # Skip if user has a config to remove this module section
        if anchor in config.remove_sections:
            logger.debug("Skipping section '{}' because specified in user config".format(anchor))
            return

        # Sanitise anchor ID and check for duplicates
        anchor = report.save_htmlid(anchor)

        # See if we have a user comment in the config
        if anchor in config.section_comments:
            comment = config.section_comments[anchor]

        # Format the content
        if autoformat:
            if len(description) > 0:
                description = textwrap.dedent(description)
                if autoformat_type == 'markdown':
                    description = markdown.markdown(description)
            if len(comment) > 0:
                comment = textwrap.dedent(comment)
                if autoformat_type == 'markdown':
                    comment = markdown.markdown(comment)
            if len(helptext) > 0:
                helptext = textwrap.dedent(helptext)
                if autoformat_type == 'markdown':
                    helptext = markdown.markdown(helptext)

        # Strip excess whitespace
        description = description.strip()
        comment = comment.strip()
        helptext = helptext.strip()

        self.sections.append({
            'name': name,
            'anchor': anchor,
            'description': description,
            'comment': comment,
            'helptext': helptext,
            'plot': plot,
            'content': content,
            'print_section': any([ n is not None and len(n) > 0 for n in [description, comment, helptext, plot, content] ])
        })
900511
def _add_section(self, node):
        
        self._filldown(node.lineno)

        # push a new context onto stack
        self.context.append(node.name)
        self._update_current_context()

        for _ in map(self.visit, iter_child_nodes(node)):
            pass

        # restore current context
        self.context.pop()
        self._update_current_context()