Parses author name from itunes tags and sets value
420371
def set_itunes_author_name(self):
        """"""
        try:
            self.itunes_author_name = self.soup.find('itunes:author').string
        except AttributeError:
            self.itunes_author_name = None
449440
def set_subtitle(self):
        """"""
        try:
            self.subtitle = self.soup.find('itunes:subtitle').string
        except AttributeError:
            self.subtitle = None
988442
def set_itunes_explicit(self):
        """"""
        try:
            self.itunes_explicit = self.soup.find('itunes:explicit').string
            self.itunes_explicit = self.itunes_explicit.lower()
        except AttributeError:
            self.itunes_explicit = None
438972
function unset(appName, tagNames, callback) {
    if (!util.isArray(tagNames)) {
      return callback(new Error('To unset a tag pass an array of names'));
    }

    var keyValues = {};
    tagNames.forEach(function eachTag(tagName) {
      keyValues[tagName] = null;
    });

    set(appName, keyValues, callback);
  }
1098960
def from_string(cls, name, separator='-', reverse=False):
        
        recv = [t.strip() for t in name.split(separator)]
        if len(recv) < 2:
            logger.error('Wrong format!')
            return None

        if reverse:
            title = recv[0]
            artist = ''.join(recv[1:])
        else:
            artist = recv[0]
            title = ''.join(recv[1:])

        if not artist or not title:
            logger.error('Wrong format!')
            return None

        song = cls(artist, title)
        return song
862564
function() {
    var metadata = {};
    var values = {};
    var metaElements = this._doc.getElementsByTagName("meta");

    // Match "description", or Twitter's "twitter:description" (Cards)
    // in name attribute.
    var namePattern = /^\s*((twitter)\s*:\s*)?(description|title)\s*$/gi;

    // Match Facebook's Open Graph title & description properties.
    var propertyPattern = /^\s*og\s*:\s*(description|title)\s*$/gi;

    // Find description tags.
    this._forEachNode(metaElements, function(element) {
      var elementName = element.getAttribute("name");
      var elementProperty = element.getAttribute("property");

      if ([elementName, elementProperty].indexOf("author") !== -1) {
        metadata.byline = element.getAttribute("content");
        return;
      }

      var name = null;
      if (namePattern.test(elementName)) {
        name = elementName;
      } else if (propertyPattern.test(elementProperty)) {
        name = elementProperty;
      }

      if (name) {
        var content = element.getAttribute("content");
        if (content) {
          // Convert to lowercase and remove any whitespace
          // so we can match below.
          name = name.toLowerCase().replace(/\s/g, '');
          values[name] = content.trim();
        }
      }
    });

    if ("description" in values) {
      metadata.excerpt = values["description"];
    } else if ("og:description" in values) {
      // Use facebook open graph description.
      metadata.excerpt = values["og:description"];
    } else if ("twitter:description" in values) {
      // Use twitter cards description.
      metadata.excerpt = values["twitter:description"];
    }

    metadata.title = this._getArticleTitle();
    if (!metadata.title) {
      if ("og:title" in values) {
        // Use facebook open graph title.
        metadata.title = values["og:title"];
      } else if ("twitter:title" in values) {
        // Use twitter cards title.
        metadata.title = values["twitter:title"];
      }
    }

    return metadata;
  }
614180
private function setAuthorData()
    {
        $this->Author = trim($this->Author);
        $nameParts = explode(' ', $this->Author);
        foreach ($nameParts as $key => $namePart) {
            if ($namePart === '') {
                unset($nameParts[$key]);
            }
        }
        $this->Author = implode(' ', $nameParts);
        /** @var AuthorHelper $author */
        $author = AuthorHelper::get()->filter('OriginalName', trim($this->Author));
        if (!$author->Count()) {
            $author = AuthorHelper::create();
            $author->OriginalName = trim($this->Author);
            $author->write();
        } else {
            $author = $author->first();
        }
        $this->AuthorHelperID = $author->ID;
    }
872718
def p_NsContentNameAsIdList(p):
    '''
    
    '''
    if len(p) == 2:
        p[0] = NsContentNameAsIdList(None, p[1])
    else:
        p[0] = NsContentNameAsIdList(p[1], p[3])
130111
def _parse_authors(authors):
    
    link = authors.find("a")
    link = link[0].params.get("href") if link else None

    author_list = _strip_content(authors)

    if "(" in author_list:
        author_list = author_list.split("(")[0]

    if not author_list.strip():
        return []

    return map(
        lambda author: Author(author.strip(), link),
        author_list.strip().split(",")
    )
1067996
def set_itunes_subtitle(self):
        """"""
        try:
            self.itunes_subtitle = self.soup.find('itunes:subtitle').string
        except AttributeError:
            self.itunes_subtitle = None
288973
def set_itunes_summary(self):
        """"""
        try:
            self.itunes_summary = self.soup.find('itunes:summary').string
        except AttributeError:
            self.itunes_summary = None
1351559
def string_tag(name, value):
    """"""
    return name.encode('utf-8') + \
        len(value).to_bytes(4, byteorder='big') + \
        value.encode('utf-8')
496158
function unParsePeople (data) {
  if (data.author) data.author = unParsePerson(data.author)
  ;["maintainers", "contributors"].forEach(function (set) {
    if (!Array.isArray(data[set])) return;
    data[set] = data[set].map(unParsePerson)
  })
  return data
}
1076773
def __parse_tag(self, tag, count):
        """"""

        fileobj = cBytesIO(tag)

        for i in xrange(count):
            tag_data = fileobj.read(8)
            # someone writes wrong item counts
            if not tag_data:
                break
            if len(tag_data) != 8:
                raise error
            size = cdata.uint32_le(tag_data[:4])
            flags = cdata.uint32_le(tag_data[4:8])

            # Bits 1 and 2 bits are flags, 0-3
            # Bit 0 is read/write flag, ignored
            kind = (flags & 6) >> 1
            if kind == 3:
                raise APEBadItemError("value type must be 0, 1, or 2")

            key = value = fileobj.read(1)
            if not key:
                raise APEBadItemError
            while key[-1:] != b'\x00' and value:
                value = fileobj.read(1)
                if not value:
                    raise APEBadItemError
                key += value
            if key[-1:] == b"\x00":
                key = key[:-1]

            if PY3:
                try:
                    key = key.decode("ascii")
                except UnicodeError as err:
                    reraise(APEBadItemError, err, sys.exc_info()[2])
            value = fileobj.read(size)
            if len(value) != size:
                raise APEBadItemError

            value = _get_value_type(kind)._new(value)

            self[key] = value
1194632
def parse_author(self, value):
        
        tokens = tuple([t.upper().strip() for t in value.split(',')])
        if len(tokens) == 1:
            tokens = value.split(' ')
        if len(tokens) > 0:
            if len(tokens) > 1:
                aulast, auinit = tokens[0:2]    # Ignore JR, II, III, etc.
            else:
                aulast = tokens[0]
                auinit = ''
        else:
            aulast, auinit = tokens[0], ''
        aulast = _strip_punctuation(aulast).upper()
        auinit = _strip_punctuation(auinit).upper()
        return aulast, auinit
218063
def author_string
      auth = nil
      if authors.size > 0 # Build based on People 
        case authors.size
        when 1
          auth = authors.first.last_name # self.author
        when 2 
          auth = authors.map(&:last_name).join(" & ")
        when 3...100
          auth =  authors[0..-1].map(&:last_name).join(", ") + " & " + authors.last.last_name
        end
      else # Build based on string
        auth = self.author
      end
      auth
    end
998475
def tagsOf(self, obj):
        
        return self.store.query(
            Tag,
            AND(Tag.catalog == self,
                Tag.object == obj)).getColumn("name")