def __init__(self, node, write, **kw):

        self.write = write
        self.subset = kw.get('subset')
        if self.subset:
            self.comments = kw.get('comments', 1)
        else:
            self.comments = kw.get('comments', 0)
        self.unsuppressedPrefixes = kw.get('unsuppressedPrefixes')
        nsdict = kw.get('nsdict', { 'xml': XMLNS.XML, 'xmlns': XMLNS.BASE })

        # Processing state.
        self.state = (nsdict, ['xml'], [])

        if node.nodeType == Node.DOCUMENT_NODE:
            self._do_document(node)
        elif node.nodeType == Node.ELEMENT_NODE:
            self.documentOrder = _Element        # At document element
            if self.unsuppressedPrefixes is not None:
                self._do_element(node)
            else:
                inherited = self._inherit_context(node)
                self._do_element(node, inherited)
        elif node.nodeType == Node.DOCUMENT_TYPE_NODE:
            pass
        else:
            raise TypeError, str(node)
Assigns the visual mapping to the given data and adds the right legend
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/SOAPpy/wstools/c14n.py/_implementation.__init__--crossover with--dataset/ETHPy150Open yhat/ggplot/ggplot/components/__init__.py/assign_visual_mapping