brandizzi icon

An empty function with a doctest

brandizzi | PRO | 02/26/18 09:12:03 AM UTC | 0 ⭐ | 1235 👁️ | Never ⏰ | []
Python |

690 B

|

None

|

0 👍

/

0 👎

def get_css_class_dict(node):
    """
    Given an xml.dom.minidom.Node, returns a map from every "class" attribute
    from it to a list of nodes with this class.
 
    For example, for the document below:
 
    >>> doc = xml.dom.minidom.parseString(
    ...     '''
    ...     <html>
    ...         <body>
    ...             <div class="a b"><span class="a"></span></div>
    ...         </body>
    ...     </html>
    ...     ''')
 
    ...we will get this:
 
    >>> d = get_css_class_dict(doc)
    >>> d['a']  # doctest: +ELLIPSIS
    [<DOM Element: div at ...>, <DOM Element: span at ...>]
    >>> d['b']  # doctest: +ELLIPSIS
    [<DOM Element: span at ...>]
    """
    pass

Comments