Given a title with a chapter number, e.g. "6.1 Installation using tarball",
 splits the two up.
193769
def extract_chapter(title)
		title =~ /^((\d+\.)*) (.+)$/
		chapter = $1
		pure_title = $3
		if !chapter.nil? && !chapter.empty? && pure_title && !pure_title.empty?
			return [chapter, pure_title]
		else
			return nil
		end
	end
81829
def splitword(self, originalword, *newwords, **kwargs):
        """"""
        if isstring(originalword):
            originalword = self.doc[u(originalword)]
        return self.correctwords([originalword], newwords, **kwargs)
1155267
private void parseRxnCXSMILES(String title, IReaction rxn) {
        CxSmilesState cxstate;
        int pos;
        if (title != null && title.startsWith("|")) {
            if ((pos = CxSmilesParser.processCx(title, cxstate = new CxSmilesState())) >= 0) {

                // set the correct title
                rxn.setProperty(CDKConstants.TITLE, title.substring(pos));

                final Map<IAtom, IAtomContainer> atomToMol = new HashMap<>(100);
                final List<IAtom> atoms = new ArrayList<>();
                handleFragmentGrouping(rxn, cxstate);

                // merge all together
                for (IAtomContainer mol : rxn.getReactants().atomContainers()) {
                    for (IAtom atom : mol.atoms()) {
                        atoms.add(atom);
                        atomToMol.put(atom, mol);
                    }
                }
                for (IAtomContainer mol : rxn.getAgents().atomContainers()) {
                    for (IAtom atom : mol.atoms()) {
                        atoms.add(atom);
                        atomToMol.put(atom, mol);
                    }
                }
                for (IAtomContainer mol : rxn.getProducts().atomContainers()) {
                    for (IAtom atom : mol.atoms()) {
                        atoms.add(atom);
                        atomToMol.put(atom, mol);
                    }
                }

                assignCxSmilesInfo(rxn.getBuilder(), rxn, atoms, atomToMol, cxstate);
            }
        }
    }
440876
def _get_title(self,directory,filename):
        """"""
        # =========== LOAD TITLE ========
        fullfile=os.path.join(directory,filename+'.title')
        try:
            logger.debug('trying to open [%s]'%(fullfile))
            _title=(open(fullfile).readline().strip())
            logger.debug("_updatemeta: %s - title is '%s'",filename,_title)
        except:
            _title=''

        return _title
22625
def cleanupversion(ver):
    """"""
    lst = ver.split(".")
    if len(lst) == 1:
        lst.extend(['0', '0'])
    elif len(lst) == 2:
        lst.extend(['0'])
    elif len(lst) > 2:
        lst = lst[:3]
    lst[2] = '0' # ensure the 3rd number is 0    
    cleanver = '.'.join(lst)
    return cleanver
1303671
function initBook(root, opts) {
    var book = new Book(root, opts);
    var extensionToUse = '.md';

    var chaptersPaths = function(chapters) {
        return _.reduce(chapters || [], function(accu, chapter) {
            var o = {
                title: chapter.title
            };
            if (chapter.path) o.path = chapter.path;

            return accu.concat(
                [o].concat(chaptersPaths(chapter.articles))
            );
        }, []);
    };

    book.log.info.ln('init book at', root);
    return fs.mkdirp(root)
    .then(function() {
        book.log.info.ln('detect structure from SUMMARY (if it exists)');
        return book.parseSummary();
    })
    .fail(function() {
        return Q();
    })
    .then(function() {
        var summary = book.summaryFile || 'SUMMARY.md';
        var chapters = book.summary.chapters || [];
        extensionToUse = path.extname(summary);

        if (chapters.length === 0) {
            chapters = [
                {
                    title: 'Summary',
                    path: 'SUMMARY'+extensionToUse
                },
                {
                    title: 'Introduction',
                    path: 'README'+extensionToUse
                }
            ];
        }

        return Q(chaptersPaths(chapters));
    })
    .then(function(chapters) {
        // Create files that don't exist
        return Q.all(_.map(chapters, function(chapter) {
            if (!chapter.path) return Q();
            var absolutePath = path.resolve(book.root, chapter.path);

            return fs.exists(absolutePath)
            .then(function(exists) {
                if(exists) {
                    book.log.info.ln('found', chapter.path);
                    return;
                } else {
                    book.log.info.ln('create', chapter.path);
                }

                return fs.mkdirp(path.dirname(absolutePath))
                .then(function() {
                    return fs.writeFile(absolutePath, '# '+chapter.title+'\n');
                });
            });
        }));
    })
    .then(function() {
        book.log.info.ln('initialization is finished');
    });
}
940264
def ParseMultiple(self, result_dicts):
    """"""
    status = rdf_client.SoftwarePackage.InstallState.INSTALLED
    packages = []
    for result_dict in result_dicts:
      packages.append(
          rdf_client.SoftwarePackage(
              name=result_dict["Name"],
              description=result_dict["Description"],
              version=result_dict["Version"],
              install_state=status))

    if packages:
      yield rdf_client.SoftwarePackages(packages=packages)
196485
def _split_section_and_key(key):
    """"""
    parts = key.split('.')
    if len(parts) > 1:
        return 'renku "{0}"'.format(parts[0]), '.'.join(parts[1:])
    return 'renku', key
117880
function parseSummary(book) {
    var readme = book.getReadme();
    var logger = book.getLogger();
    var readmeFile = readme.getFile();

    return parseStructureFile(book, 'summary')
    .spread(function(file, result) {
        var summary;

        if (!file) {
            logger.warn.ln('no summary file in this book');
            summary = Summary();
        } else {
            logger.debug.ln('summary file found at', file.getPath());
            summary = Summary.createFromParts(file, result.parts);
        }

        // Insert readme as first entry if not in SUMMARY.md
        var readmeArticle = summary.getByPath(readmeFile.getPath());

        if (readmeFile.exists() && !readmeArticle) {
            summary = SummaryModifier.unshiftArticle(summary, {
                title: 'Introduction',
                ref: readmeFile.getPath()
            });
        }

        // Set new summary
        return book.setSummary(summary);
    });
}
563450
function editPartTitle(summary, index, newTitle) {
    var parts = summary.getParts();

    var part = parts.get(index);
    if (!part) {
        return summary;
    }

    part = part.set('title', newTitle);
    parts = parts.set(index, part);

    return summary.set('parts', parts);
}
1057022
function (version, semverIndex)
	{
		const splittedVersion = version.split('.');
		splittedVersion[ semverIndex ] = parseInt(splittedVersion[ semverIndex ], 10) + 1;
		while (semverIndex < 2)
		{
			splittedVersion[ ++semverIndex ] = '0';
		}
		return splittedVersion.join('.');
	}
54196
public static String resolveTitle(final String title, final String reference) {
        if (StringUtils.isBlank(title) && !StringUtils.isBlank(reference)) {
            // If there is no title, assume the reference is a path and take the last part (the "file name")
            final String[] splitReference = PATH_SEPARATOR_REGEX.split(reference);
            final String lastPart = splitReference[splitReference.length - 1];

            return StringUtils.isBlank(lastPart) || reference.endsWith("/") || reference.endsWith("\\") ? reference : lastPart;
        } else {
            return title;
        }
    }
965811
def split_version(version):
    
    if re.match("^[^0-9].*", version):
        return [version]
    return [int(i) for i in version.split(".")]
814467
def _sanitize_title(self, title):
        
        title = re.sub(self.inside_brackets, "", title)
        title = re.sub(self.after_delimiter, "", title)
        return title.strip()
334150
def get_version():
    """"""
    release = get_release()
    split_version = release.split(".")
    if len(split_version) == 3:
        return ".".join(split_version[:2])
    return release
826372
function ( hash ) {
		var cuts = hash.split ( "/" );
		var name = cuts.pop () || "";
		if (( cuts = name.split ( "." )).length ) {
			cuts.pop ();
		}
		document.title = cuts.join ( "." );
	}
270495
def clean_title title
      title.gsub(GENDER_FILTER,'').
            gsub(SYMBOL_FILTER,'').
            gsub(WORDS_IN_BRACKETS, '\1').
            gsub(CODE_TOKEN_FILTER,'').
            gsub(WHITESPACE,' ').
            downcase.
            strip
    end