mf2util.py
def is_name_a_title(name, content):
    """Determine whether the name property represents an explicit title.

    Typically when parsing an h-entry, we check whether p-name ==
    e-content (value). If they are non-equal, then p-name likely
    represents a title.

    However, occasionally we come across an h-entry that does not
    provide an explicit p-name. In this case, the name is
    automatically generated by converting the entire h-entry content
    to plain text. This definitely does not represent a title, and
    looks very bad when displayed as such.

    To handle this case, we broaden the equality check to see if
    content is a subset of name. We also strip out non-alphanumeric
    characters just to make the check a little more forgiving.

    :param str name: the p-name property that may represent a title
    :param str content: the plain-text version of an e-content property
    :return: True if the name likely represents a separate, explicit title
    """
    def normalize(s):
        if not isinstance(s, string_type):
            s = s.decode('utf-8')
        s = unicodedata.normalize('NFKD', s)
        s = s.lower()
        s = re.sub('[^a-z0-9]', '', s)
        return s
    if not content:
        return True
    if not name:
        return False
    return normalize(content) not in normalize(name)
Determine whether the name property represents an explicit title.

    Typically when parsing an h-entry, we check whether p-name ==
    e-content (value). If they are non-equal, then p-name likely
    represents a title.

    However, occasionally we come across an h-entry that does not
    provide an explicit p-name. In this case, the name is
    automatically generated by converting the entire h-entry content
    to plain text. This definitely does not represent a title, and
    looks very bad when displayed as such.

    To handle this case, we broaden the equality check to see if
    content is a subset of name. We also strip out non-alphanumeric
    characters just to make the check a little more forgiving.

    :param str name: the p-name property that may represent a title
    :param str content: the plain-text version of an e-content property
    :return: True if the name likely represents a separate, explicit title
    
Determine whether the name property represents an explicit title.
Typically when parsing an h-entry, we check whether p-name
e-content (value). If they are non-equal, then p-name likely
represents a title.

However, occasionally we come across an h-entry that does not
provide an explicit p-name. In this case, the name is
automatically generated by converting the entire h-entry content
to plain text. This definitely does not represent a title, and
looks very bad when displayed as such.

To handle this case, we broaden the equality check to see if
content is a subset of name. We also strip out non-alphanumeric
characters just to make the check a little more forgiving.
Determine whether the name property represents an explicit title . Typically when parsing an h - entry we check whether p - name e - content ( value ) . If they are non - equal then p - name likely represents a title . However occasionally we come across an h - entry that does not provide an explicit p - name . In this case the name is automatically generated by converting the entire h - entry content to plain text . This definitely does not represent a title and looks very bad when displayed as such . To handle this case we broaden the equality check to see if content is a subset of name . We also strip out non - alphanumeric characters just to make the check a little more forgiving .
def is_name_a_title(name, content):
    def normalize(s):
        if not isinstance(s, string_type):
            s = s.decode('utf-8')
        s = unicodedata.normalize('NFKD', s)
        s = s.lower()
        s = re.sub('[^a-z0-9]', '', s)
        return s
    if not content:
        return True
    if not name:
        return False
    return normalize(content) not in normalize(name)
def is_name_a_title ( name , content ) : def normalize ( s ) : if not isinstance ( s , string_type ) : s = s . decode ( 'utf-8' ) s = unicodedata . normalize ( 'NFKD' , s ) s = s . lower ( ) s = re . sub ( '[^a-z0-9]' , '' , s ) return s if not content : return True if not name : return False return normalize ( content ) not in normalize ( name )
Determine whether the name property represents an explicit title.
Determine whether the name property represents an explicit title .
"""Determine whether the name property represents an explicit title.

    Typically when parsing an h-entry, we check whether p-name ==
    e-content (value). If they are non-equal, then p-name likely
    represents a title.

    However, occasionally we come across an h-entry that does not
    provide an explicit p-name. In this case, the name is
    automatically generated by converting the entire h-entry content
    to plain text. This definitely does not represent a title, and
    looks very bad when displayed as such.

    To handle this case, we broaden the equality check to see if
    content is a subset of name. We also strip out non-alphanumeric
    characters just to make the check a little more forgiving.

    :param str name: the p-name property that may represent a title
    :param str content: the plain-text version of an e-content property
    :return: True if the name likely represents a separate, explicit title
    """
True if the name likely represents a separate, explicit title
True if the name likely represents a separate explicit title
name
the p-name property that may represent a title
the p - name property that may represent a title
content
the plain-text version of an e-content property
the plain - text version of an e - content property