Unpack EpisodeTitle from title XML element.
190412
def _unpack_episode_title(element: ET.Element):
    """"""
    return EpisodeTitle(title=element.text,
                        lang=element.get(f'{XML}lang'))
500835
def unpack(self, buff, offset=0):
        """"""
        begin = offset
        for name, value in list(self.get_class_attributes())[:-1]:
            size = self._unpack_attribute(name, value, buff, begin)
            begin += size
        self._unpack_attribute('oxm_match_fields', type(self).oxm_match_fields,
                               buff[:offset+self.length], begin)
1005197
def to_xml(self):
        
        root = ET.Element("entry")
        for x in self.xml_tags:
            if getattr(self, x):
                if x in ['episodes', 'scores', 'status', 'dates', 'storage', 'rewatched', 'flags', 'tags']:
                    if x == 'episodes':
                        if self.episodes.current:
                            temp = ET.SubElement(root, 'episode')
                            temp.text = str(self.episodes.current)
                    elif x == 'scores':
                        if self.scores.user:
                            temp = ET.SubElement(root, 'score')
                            temp.text = str(self.scores.user)
                    elif x == 'status':
                        if self.status.user:
                            temp = ET.SubElement(root, 'status')
                            temp.text = str(self.status.user)
                    elif x == 'dates':
                        if self.dates.user.start:
                            start = ET.SubElement(root, 'date_start')
                            start.text = format_date(self.dates.user.start)
                        if self.dates.user.end:
                            end = ET.SubElement(root, 'date_finish')
                            end.text = format_date(self.dates.user.end)
                    elif x == 'storage':
                        if self.storage.type:
                            stype = ET.SubElement(root, 'storage_type')
                            stype.text = str(self.storage.type)
                        if self.storage.value:
                            sval = ET.SubElement(root, 'storage_value')
                            sval.text = str(self.storage.value)
                    elif x == 'rewatched':
                        if self.rewatched.times:
                            rt = ET.SubElement(root, 'times_rewatched')
                            rt.text = str(self.rewatched.times)
                        if self.rewatched.value:
                            rv = ET.SubElement(root, 'rewatch_value')
                            rv.text = str(self.rewatched.value)
                    elif x == 'flags':
                        if self.flags.discussion:
                            df = ET.SubElement(root, 'enable_discussion')
                            df.text = '1' if self.flags.discussion else '0'
                        if self.flags.rewatching:
                            rf = ET.SubElement(root, 'enable_rewatching')
                            rf.text = '1' if self.flags.rewatching else '0'
                    else:
                        if self.tags:
                            temp = ET.SubElement(root, 'tags')
                            temp.text = ','.join(self.tags)
                else:
                    temp = ET.SubElement(root, x)
                    temp.text = str(getattr(self, x))
        return '<?xml version="1.0" encoding="UTF-8"?>{}'.format(ET.tostring(root, encoding="unicode"))
1343886
def _find_title(html_file):
    """"""
    # TODO Is it necessary to read files like this?
    with html_file.open() as f:
        for line in f:
            if '<title>' in line:
                # + 7 to skip len('<title>')
                return line[line.index('<title>') + 7:line.index('</title>')]

    return '(Unknown)'
42926
public String getTitles(List<String> titleList) throws Exception {
    String titles = "";
    String delim = "";
    for (String title : titleList) {
      titles = titles + delim + normalizeTitle(title);
      delim = "%7C";
    }
    return titles;
  }
605056
private static void processSeasonEpisodes(Element eEpisodeList, EpisodeList epList) {
        // Get the season number
        String season = eEpisodeList.getAttribute("no");

        NodeList nlEpisode = eEpisodeList.getElementsByTagName(EPISODE);
        if (nlEpisode == null || nlEpisode.getLength() == 0) {
            return;
        }

        for (int eLoop = 0; eLoop < nlEpisode.getLength(); eLoop++) {
            Node nEpisode = nlEpisode.item(eLoop);
            if (nEpisode.getNodeType() == Node.ELEMENT_NODE) {
                epList.addEpisode(parseEpisode((Element) nEpisode, season));
            }
        }

    }
131650
def strip_tags(self, content, smart=False):
        
        from lxml.html import fromstring

        return get_node_text(fromstring(content), smart=smart)
1368045
public static String extractTitle(String html) {
        Matcher m = TITLE_PATTERN.matcher(html);
        if (m.find()) {
            return clear(m.group(0));
        }
        return null;
    }
539421
def get_title(soup):
  """"""
  if soup.title:
    return soup.title.string
  if soup.h1:
    return soup.h1.string
  return ''
204451
def get_content_title(self, obj):
        """"""
        return Content.objects.get(id=obj.content.id).title
578071
def _frame_title(self, key, group_size=2, separator='\n'):
        
        if self.layout_dimensions is not None:
            dimensions, key = zip(*self.layout_dimensions.items())
        elif not self.dynamic and (not self.uniform or len(self) == 1) or self.subplot:
            return ''
        else:
            key = key if isinstance(key, tuple) else (key,)
            dimensions = self.dimensions
        dimension_labels = [dim.pprint_value_string(k) for dim, k in
                            zip(dimensions, key)]
        groups = [', '.join(dimension_labels[i*group_size:(i+1)*group_size])
                  for i in range(len(dimension_labels))]
        return util.bytes_to_unicode(separator.join(g for g in groups if g))
807332
def title(self):
        """"""
        return (u'[{}] {}>>'.format(
            os.path.split(os.path.abspath('.'))[-1],
            u' '.join(self.command))).encode('utf8')
433243
def parse(link):
    
    html = get_html(link)

    data = {'rating': get_rating(html),
            'name': get_name_date(html)[0]}

    div = html.find(id="title-episode-widget")
    season_tags = get_a(div, find="season=")
    episodes = {}
    for slink in season_tags:
        for e in episode_list(slink):
            season, d = parse_episode(e)
            if season in episodes:
                episodes[season].append(d)
            else:
                episodes[season] = [d]
    data['episodes'] = episodes
    return data
946010
def decrypt_subtitle(self, subtitle):
        
        return self.decrypt(self._build_encryption_key(int(subtitle.id)),
            subtitle['iv'][0].text.decode('base64'),
            subtitle['data'][0].text.decode('base64'))
553506
def extract_full_title
      site_title = extract(:site) || ''
      title      = extract_title || []
      separator  = extract_separator
      reverse    = extract(:reverse) == true

      TextNormalizer.normalize_title(site_title, title, separator, reverse)
    end
152397
private static Episode parseEpisodeInfo(Element eEpisodeInfo) {
        Episode episode = new Episode();

        episode.setTitle(DOMHelper.getValueFromElement(eEpisodeInfo, TITLE));
        episode.setAirDate(DOMHelper.getValueFromElement(eEpisodeInfo, AIRDATE));
        episode.setLink(DOMHelper.getValueFromElement(eEpisodeInfo, "url"));
        episode.setSummary(DOMHelper.getValueFromElement(eEpisodeInfo, SUMMARY));

        // Process the season & episode field
        Pattern pattern = Pattern.compile("(\\d*)[x](\\d*)");
        Matcher matcher = pattern.matcher(DOMHelper.getValueFromElement(eEpisodeInfo, "number"));
        if (matcher.find()) {
            EpisodeNumber en = new EpisodeNumber();
            en.setSeason(matcher.group(MATCH_SEASON));
            en.setEpisode(matcher.group(MATCH_EPISODE));
            episode.setEpisodeNumber(en);
        }

        return episode;
    }
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)