::return: \
            a clone of the current HtmlElement
970415
def clone(self):
        '''
        
        '''
        return HtmlElement(self.tag, self.prefix, self.suffix, self.display,
                           self.margin_before, self.margin_after, self.padding,
                           self.whitespace)
318174
function(element) {
    if ('outerHTML' in element) return element.outerHTML;
    var ns = "http://www.w3.org/1999/xhtml";
    var container = document.createElementNS(ns, '_');
    var xmlSerializer = new XMLSerializer();
    var html;
    if (document.xmlVersion) {
      return xmlSerializer.serializeToString(element);
    } else {
      container.appendChild(element.cloneNode(false));
      html = container.innerHTML.replace('><', '>' + element.innerHTML + '<');
      container.innerHTML = '';
      return html;
    }
  }
464343
def update_DOM(self):
        
        response = self.fetch()
        self._DOM = html.fromstring(response.text)
        return self
224982
function(html, element) {
      var template = document.createElement('template');
      template.innerHTML = html;
      var fragment = this.instanceTemplate(template);
      if (element) {
        element.textContent = '';
        element.appendChild(fragment);
      }
      return fragment;
    }
439225
function getHTML(sel) {
	sel = sel || getSelection();
	if (!sel.rangeCount || sel.isCollapsed) { return null; }

	var len = sel.rangeCount;
	var container = doc.createElement('div');

	for (var i = 0; i < len; ++i) {
		container.appendChild(sel.getRangeAt(i).cloneContents());
	}

	return container.innerHTML;
}
880690
def _repr_html_(self):
        
        # Use StringIO to avoid a large number of memory allocations with string concat
        with io.StringIO() as out:
            out.write('<{tag}'.format(tag=escape(self.tag_name)))
            if self.style:
                # Important values are in double quotes - cgi.escape only escapes double quotes, not single quotes!
                out.write(' style="{css}"'.format(
                    css=escape(self._to_inline_css(self.style))))

            for k, v in self.attributes.items():
                k2 = k
                if k2 == 'class_':
                    k2 = 'class'
                # Important values are in double quotes - cgi.escape only escapes double quotes, not single quotes!
                if isinstance(v, string_types):
                    out.write(' {key}="{value}"'.format(
                        key=escape(k2), value=escape(v)))
                if isinstance(v, bool) and v:
                    out.write(' {key}'.format(key=escape(k2)))
            out.write('>')

            for c in self.children:
                if isinstance(c, string_types):
                    out.write(escape(safe_unicode(c)))
                else:
                    out.write(c._repr_html_())

            out.write('</{tag}>'.format(tag=escape(self.tag_name)))

            return out.getvalue()
1222440
def html_factory(tag, **defaults):
    '''

    '''
    def html_input(*children, **params):
        p = defaults.copy()
        p.update(params)
        return Html(tag, *children, **p)
    return html_input
657762
def to_html(self):
        

        text = self.text
        if text is None:
            text = self.uri
        return '<a href="%s"%s>%s</a>' % (
            self.uri, self.html_attributes(), text)
650015
function(el, deep) {
    var sub = document.createElement(el.nodeName)
      , attr = el.attributes
      , i = attr.length;

    while (i--) {
      if (attr[i].nodeValue) {
        sub.setAttribute(attr[i].name, attr[i].value);
      }
    }

    if (el.namespaceURI) {
      sub.namespaceURI = el.namespaceURI;
    }

    if (el.baseURI) {
      sub.baseURI = el.baseURI;
    }

    if (deep) {
      DOM.setContent(sub, DOM.getContent(el));
    }

    return clone; 
  }
1279060
def fromElement(cls, elem):
        

        self = cls()

        self.oid = elem.get("OID")
        self.name = elem.get("Name")
        return self
945760
def clone(self):
        # TODO: check docstring
        

        new_node = self.__class__(self._name, self._demand)

        return new_node
776358
def element(self, inp=None):
        """"""
        if inp is not None:
            s = str(inp)[:self.length]
            s += ' ' * (self.length - len(s))
            return s
        else:
            return ' ' * self.length
1269820
def _repr_html_(self):
    
    parts = []
    if self._class:
      parts.append('<div id="hh_%s" class="%s">%s</div>' % (self._id, self._class, self._markup))
    else:
      parts.append('<div id="hh_%s">%s</div>' % (self._id, self._markup))

    if len(self._script) != 0:
      parts.append('<script>')
      parts.append('require([')
      parts.append(','.join(['"%s"' % d[0] for d in self._dependencies]))
      parts.append('], function(')
      parts.append(','.join([d[1] for d in self._dependencies]))
      parts.append(') {')
      parts.append(self._script)
      parts.append('});')
      parts.append('</script>')

    return ''.join(parts)
1201483
def to_html(input, context = {}, result = nil)
      result = call(input, context, result = nil)
      output = result[:output]
      if output.respond_to?(:to_html)
        output.to_html
      else
        output.to_s
      end
    end
970233
def copy_contents_to(element)
      contents.map do |content|
        Content.copy(content, element_id: element.id)
      end
    end
406686
def import_element(self, xml_element):
        

        super(HTMLElement, self).import_element(xml_element)

        self.content = self.get_html_content()
152685
def get_html_string(self):
        """"""
        if self.__htmltree is not None:
            return htmltostring(self.__htmltree)
        else:
            self.__make_tree()
            return htmltostring(self.__htmltree)