Create an article title.
330168
def create_title(article, language, title, slug=None, description=None,
                 page_title=None, menu_title=None, meta_description=None,
                 creation_date=None, image=None):
    
    # validate article
    assert isinstance(article, Article)

    # validate language:
    assert language in get_language_list(article.tree.node.site_id)

    # validate creation date
    if creation_date:
        assert isinstance(creation_date, datetime.date)

    # set default slug:
    if not slug:
        slug = settings.CMS_ARTICLES_SLUG_FORMAT.format(
            now=creation_date or now(),
            slug=slugify(title),
        )

    # find unused slug:
    base_slug = slug
    qs = Title.objects.filter(language=language)
    used_slugs = list(s for s in qs.values_list('slug', flat=True) if s.startswith(base_slug))
    i = 1
    while slug in used_slugs:
        slug = '%s-%s' % (base_slug, i)
        i += 1

    # create title
    title = Title.objects.create(
        article=article,
        language=language,
        title=title,
        slug=slug,
        description=description,
        page_title=page_title,
        menu_title=menu_title,
        meta_description=meta_description,
        image=image,
    )

    return title
53363
private function buildTitle()
	{
		$this->layout_ui->getWidget('main_frame')->title =
			sprintf(Swat::_('%s Demo'), $this->available_demos[$this->demo]);
	}
375037
function title(title, widths, opt){
  var wid = title.length;
  var total = widths.reduce((a, b) => a + b + 3, 0) - 1;
  var left = parseInt((total - wid) / 2);
  if (!opt.plain) title = '\u001b[1m' + title + '\u001b[22m';
  log(p[0][0] + widths.map(col => p.h + strN(col, p.h) + p.h).join(p.h) + p[0][2]);
  log(p.v + widths.map(col => ' ' + strN(col, ' ') + ' ').join(' ') + p.v);
  log(p.v + strN(left) + title + strN(total - left - wid) + p.v);
  log(p.v + widths.map(col => ' ' + strN(col, ' ') + ' ').join(' ') + p.v);
}
215173
def title_from_content(content):
    
    for end in (". ", "?", "!", "<br />", "\n", "</p>"):
        if end in content:
            content = content.split(end)[0] + end
            break
    return strip_tags(content)
1257176
def set_title(self, title):
        

        self.title = title

        self.add_metadata('DC', 'title', self.title)
745404
def help_center_article_translation_create(self, article_id, data, **kwargs):
        ""
        api_path = "/api/v2/help_center/articles/{article_id}/translations.json"
        api_path = api_path.format(article_id=article_id)
        return self.call(api_path, method="POST", data=data, **kwargs)
658297
def title(msg):
    """"""
    if sys.platform.startswith("win"):
        ctypes.windll.kernel32.SetConsoleTitleW(tounicode(msg))
729156
def write_title(self, title, level=1, id=None):
        
        if id:
            self.write('<h{lv} id="{id}">{title}</h{lv}>',
                       title=title, lv=level, id=id)
        else:
            self.write('<h{lv}>{title}</h{lv}>',
                       title=title, lv=level)
787933
def create(self, section, article):
        
        return CRUDRequest(self).post(article, create=True, id=section)
185774
function insertArticle(summary, article, level) {
    article = SummaryArticle(article);
    level = is.string(level)? level : level.getLevel();

    var parent = summary.getParent(level);
    if (!parent) {
        return summary;
    }

    // Find the index to insert at
    var articles = parent.getArticles();
    var index = getLeafIndex(level);

    // Insert the article at the right index
    articles = articles.insert(index, article);

    // Reindex the level from here
    parent = parent.set('articles', articles);
    parent = indexArticleLevels(parent);

    return mergeAtLevel(summary, parent.getLevel(), parent);
}
865244
def heading_title(self):
        
        art_title = self.article.root.xpath('./front/article-meta/title-group/article-title')[0]
        article_title = deepcopy(art_title)
        article_title.tag = 'h1'
        article_title.attrib['id'] = 'title'
        article_title.attrib['class'] = 'article-title'
        return article_title
543578
def _make_x_title(self):
        """"""
        y = (self.height - self.margin_box.bottom + self._x_labels_height)
        if self._x_title:
            for i, title_line in enumerate(self._x_title, 1):
                text = self.svg.node(
                    self.nodes['title'],
                    'text',
                    class_='title',
                    x=self.margin_box.left + self.view.width / 2,
                    y=y + i * (self.style.title_font_size + self.spacing)
                )
                text.text = title_line
970454
protected Element getArticleTitle() {
        Element articleTitle = mDocument.createElement("h1");
        articleTitle.html(mDocument.title());
        return articleTitle;
    }
211553
def _add_title(hist: HistogramBase, vega: dict, kwargs: dict):
    """"""
    title = kwargs.pop("title", hist.title)
    if title:
        vega["title"] = {
            "text": title
        }
598055
protected function _prepareArticleTitle($oArticle)
    {
        // create title part for uri
        if (!($sTitle = $oArticle->oxarticles__oxtitle->value)) {
            // taking parent article title
            if (($sParentId = $oArticle->oxarticles__oxparentid->value)) {
                // looking in cache ..
                if (!isset(self::$_aTitleCache[$sParentId])) {
                    $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
                    $sQ = "select oxtitle from " . $oArticle->getViewName() . " where oxid = " . $oDb->quote($sParentId);
                    self::$_aTitleCache[$sParentId] = $oDb->getOne($sQ);
                }
                $sTitle = self::$_aTitleCache[$sParentId];
            }
        }

        // variant has varselect value
        if ($oArticle->oxarticles__oxvarselect->value) {
            $sTitle .= ($sTitle ? ' ' : '') . $oArticle->oxarticles__oxvarselect->value . ' ';
        } elseif (!$sTitle || ($oArticle->oxarticles__oxparentid->value)) {
            // in case nothing was found - looking for number
            $sTitle .= ($sTitle ? ' ' : '') . $oArticle->oxarticles__oxartnum->value;
        }

        return $this->_prepareTitle($sTitle, false, $oArticle->getLanguage()) . $this->_getUrlExtension();
    }
204877
def title(self):
        """"""
        if self.event:
            if self.release['name']:
                return u'{0}: {1}'.format(
                    self.repository['full_name'], self.release['name']
                )
        return u'{0} {1}'.format(self.repo_model.name, self.model.tag)
492067
def _make_y_title(self):
        """"""
        if self._y_title:
            yc = self.margin_box.top + self.view.height / 2
            for i, title_line in enumerate(self._y_title, 1):
                text = self.svg.node(
                    self.nodes['title'],
                    'text',
                    class_='title',
                    x=self._legend_at_left_width,
                    y=i * (self.style.title_font_size + self.spacing) + yc
                )
                text.attrib['transform'] = "rotate(%d %f %f)" % (
                    -90, self._legend_at_left_width, yc
                )
                text.text = title_line