tools/metrics/common/models.py
def Unmarshall(self, node):
    """Extracts the content of the node to an object.

    Args:
      node: The XML node to extract data from.

    Returns:
      The object representation of the node.
    """

    obj = {}
    obj[COMMENT_KEY] = GetCommentsForNode(node)

    if not node.firstChild:
      return obj
    text = node.firstChild.nodeValue
    obj[TEXT_KEY] = '\n\n'.join(pretty_print_xml.SplitParagraphs(text))

    # TextNode shouldn't have any child.
    unexpected = GetUnexpectedChildren(node, set())
    if unexpected:
      raise ValueError("Unexpected children: %s in <%s> node" %
                       (','.join(unexpected), self.tag))

    return obj
Extracts the content of the node to an object.

    Args:
      node: The XML node to extract data from.

    Returns:
      The object representation of the node.
    
Extracts the content of the node to an object.
Extracts the content of the node to an object .
def Unmarshall(self, node):
    obj = {}
    obj[COMMENT_KEY] = GetCommentsForNode(node)
    if not node.firstChild:
      return obj
    text = node.firstChild.nodeValue
    obj[TEXT_KEY] = '\n\n'.join(pretty_print_xml.SplitParagraphs(text))
    unexpected = GetUnexpectedChildren(node, set())
    if unexpected:
      raise ValueError("Unexpected children: %s in <%s> node" %
                       (','.join(unexpected), self.tag))
    return obj
def Unmarshall ( self , node ) : obj = { } obj [ COMMENT_KEY ] = GetCommentsForNode ( node ) if not node . firstChild : return obj text = node . firstChild . nodeValue obj [ TEXT_KEY ] = '\n\n' . join ( pretty_print_xml . SplitParagraphs ( text ) ) unexpected = GetUnexpectedChildren ( node , set ( ) ) if unexpected : raise ValueError ( "Unexpected children: %s in <%s> node" % ( ',' . join ( unexpected ) , self . tag ) ) return obj
Extracts the content of the node to an object.
Extracts the content of the node to an object .
"""Extracts the content of the node to an object.

    Args:
      node: The XML node to extract data from.

    Returns:
      The object representation of the node.
    """ # TextNode shouldn't have any child.
The object representation of the node.
The object representation of the node .
self
node
The XML node to extract data from.
The XML node to extract data from .