Writes the definition part for a new section
19103
public void writeSectionDefinition(final OutputStream result) throws IOException
    {
        if(landscape) {
            result.write(LANDSCAPE);
            result.write(SECTION_PAGE_WIDTH);
            result.write(intToByteArray(pageWidth));
            result.write(SECTION_PAGE_HEIGHT);
            result.write(intToByteArray(pageHeight));
            this.document.outputDebugLinebreak(result);
        } else {
            result.write(SECTION_PAGE_WIDTH);
            result.write(intToByteArray(pageWidth));
            result.write(SECTION_PAGE_HEIGHT);
            result.write(intToByteArray(pageHeight));
            this.document.outputDebugLinebreak(result);
        }
        result.write(SECTION_MARGIN_LEFT);
        result.write(intToByteArray(marginLeft));
        result.write(SECTION_MARGIN_RIGHT);
        result.write(intToByteArray(marginRight));
        result.write(SECTION_MARGIN_TOP);
        result.write(intToByteArray(marginTop));
        result.write(SECTION_MARGIN_BOTTOM);
        result.write(intToByteArray(marginBottom));    	
    }
437542
public function WriteContent() {
        $output = $this->WriteGetListMethod();
        $output .= PhpCodeSnippets::CRLF;
        fwrite($this->writer, $output);
    }
1250086
def add_section(self, section_name: str) -> None:
        """"""
        section_name = self._whitespace_re.sub('_', section_name)
        self._sections.append(section_name)
        setattr(self, section_name, Section())
1035910
def section(self, section):
        
        if isinstance(section, list):
            for h in section:
                self.add_section(h)
        else:
            self.add_section(section)
41191
def add_section(self, section):
        
        # check if section already exists
        if not self.config.has_section(section):
            self.config.add_section(section)
            # return updated sections
            return (True, self.config.sections())
        return (False, 'Section: ' + section + ' already exists')
788997
def write_modified(self, url_data):
        """"""
        self.write(self.part("modified") + self.spaces("modified"))
        self.writeln(self.format_modified(url_data.modified))
330031
private void buildDefinitionTitle(MarkupDocBuilder markupDocBuilder, String title, String anchor) {
        markupDocBuilder.sectionTitleWithAnchorLevel2(title, anchor);
    }
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
462996
def section_block(definitions, width)
      doc = []
      definitions.each do |scope, values|
        doc << "#{scope}:"
        values.each do |label, text|
          helpline = "      #{text}"
          wrapped  = word_wrap helpline, width
          doc << "  #{label}\n#{wrapped}\n"
        end
      end
      doc
    end
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
715580
function editArticleInPart(part, level, newArticle) {
    var articles = part.getArticles();
    articles = editArticleInList(articles, level, newArticle);

    return part.set('articles', articles);
}
316520
def get_or_new_section(self, name, params=None):
        """"""
        if name not in self.sections:
            self.sections[name.lower()] = SectionTerm(None, name, term_args=params, doc=self)

        return self.sections[name.lower()]
1020117
protected void __startSection(String name) {
        if (null == name) throw new NullPointerException("section name cannot be null");
        if (null != tmpOut) throw new IllegalStateException("section cannot be nested");
        tmpCaller = __caller;
        __caller = null;
        tmpOut = __buffer;
        __buffer = new StringBuilder();
        section = name;
    }
602108
def write_to_file(self, f):
        """"""
        for section, values in self._values.iteritems():
            try:
                section_name, subsection_name = section
            except ValueError:
                (section_name, ) = section
                subsection_name = None
            if subsection_name is None:
                f.write("[%s]\n" % section_name)
            else:
                f.write("[%s \"%s\"]\n" % (section_name, subsection_name))
            for key, value in values.iteritems():
                f.write("%s = %s\n" % (key, _escape_value(value)))
941685
def create_section(self, name, overwrite=True):
        

        if overwrite:
            sect = ManifestSection(name)
            self.sub_sections[name] = sect

        else:
            sect = self.sub_sections.get(name, None)
            if sect is None:
                sect = ManifestSection(name)
                self.sub_sections[name] = sect

        return sect
865534
private void defineWriteUnionMethod()
    {
        MethodDefinition write = new MethodDefinition(
                a(PUBLIC),
                "write",
                null,
                arg("struct", structType),
                arg("protocol", TProtocol.class)
        );

        classDefinition.addMethod(write);

        // TProtocolWriter writer = new TProtocolWriter(protocol);
        write.addLocalVariable(type(TProtocolWriter.class), "writer");
        write.newObject(TProtocolWriter.class);
        write.dup();
        write.loadVariable("protocol");
        write.invokeConstructor(type(TProtocolWriter.class), type(TProtocol.class));
        write.storeVariable("writer");

        LocalVariableDefinition protocol = write.getLocalVariable("writer");

        // protocol.writeStructBegin("bonk");
        write.loadVariable(protocol)
            .loadConstant(metadata.getStructName())
            .invokeVirtual(TProtocolWriter.class, "writeStructBegin", void.class, String.class);

        // find the @ThriftUnionId field
        ThriftFieldMetadata idField = getOnlyElement(metadata.getFields(THRIFT_UNION_ID));

        // load its value
        loadFieldValue(write, idField);

        // switch(fieldId)
        List<CaseStatement> cases = new ArrayList<>();
        for (ThriftFieldMetadata field : metadata.getFields(THRIFT_FIELD)) {
            cases.add(caseStatement(field.getId(), field.getName() + "-write-field"));
        }
        write.switchStatement("default-write", cases);

        // write fields
        for (ThriftFieldMetadata field : metadata.getFields(THRIFT_FIELD)) {
            write.visitLabel(field.getName() + "-write-field");
            writeField(write, protocol, field);
            write.gotoLabel("default-write");
        }

        write.visitLabel("default-write")
            .loadVariable(protocol)
            .invokeVirtual(TProtocolWriter.class, "writeStructEnd", void.class);

        write.ret();
    }
1106425
protected void writeSection(Section section, int indent) throws IOException {
        if (section.getTitle() != null) {
            int depth = section.getDepth() - 1;
            if (depth > 5) {
                depth = 5;
            }
            Properties styleAttributes = new Properties();
            if (section.getTitle().hasLeading()) styleAttributes.setProperty(Markup.CSS_KEY_LINEHEIGHT, section.getTitle().getTotalLeading() + "pt");
            // start tag
            addTabs(indent);
            writeStart(HtmlTags.H[depth]);
            write(section.getTitle().getFont(), styleAttributes);
            String alignment = HtmlEncoder.getAlignment(section.getTitle().getAlignment());
            if (!"".equals(alignment)) {
                write(HtmlTags.ALIGN, alignment);
            }
            writeMarkupAttributes(markup);
            os.write(GT);
            currentfont.push(section.getTitle().getFont());
            // contents
            for (Iterator i = section.getTitle().iterator(); i.hasNext(); ) {
                write((Element)i.next(), indent + 1);
            }
            // end tag
            addTabs(indent);
            writeEnd(HtmlTags.H[depth]);
            currentfont.pop();
        }
        for (Iterator i = section.iterator(); i.hasNext(); ) {
            write((Element) i.next(), indent);
        }
    }