Returns the raw element instead of the fake cE=false element
356789
function (selection) {
      var rng = selection.getSel().getRangeAt(0);
      var startContainer = rng.startContainer;
      return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer;
    }
384573
def _get_element(name, element_type, server=None, with_properties=True):
    '''
    
    '''
    element = {}
    name = quote(name, safe='')
    data = _api_get('{0}/{1}'.format(element_type, name), server)

    # Format data, get properties if asked, and return the whole thing
    if any(data['extraProperties']['entity']):
        for key, value in data['extraProperties']['entity'].items():
            element[key] = value
        if with_properties:
            element['properties'] = _get_element_properties(name, element_type)
        return element
    return None
435663
function getNearestTypeElement(element) {
		var found = false;
		var moduleBoundaryReached = false;

		// We need to check for the existence of 'element' since occasionally we call this on a detached element node.
		// For example:
		//  1. event handlers like mouseout may sometimes detach nodes from the DOM
		//  2. event handlers like mouseleave will still fire on the detached node
		// Checking existence of element.parentNode ensures the element is a valid HTML Element
		while (!found && element && element.parentNode && !moduleBoundaryReached) {
			found = isTypeElement(element);
			moduleBoundaryReached = isModuleElement(element);

			if (!found) {
				element = element.parentNode;
			}

		}

		return found ? element : null;
	}
556463
def raw_html(self) -> _RawHTML:
        
        if self._html:
            return self._html
        else:
            return etree.tostring(self.element, encoding='unicode').strip().encode(self.encoding)
12204
def encodePathElement(element):
    """"""
    return urllib.parse.quote(
        (
            element.encode('utf-8')
            if isinstance(element, str)
            else str(element)
            if isinstance(element, int)
            else element
        ),
        safe=d1_common.const.URL_PATHELEMENT_SAFE_CHARS,
    )
1247283
def getTypeRef(self, element):
        """"""
        typeattr = self.getAttr(element, 'type', default=None)
        if typeattr is None:
            return None
        parts = typeattr.split(':', 1)
        if len(parts) == 2:
            nsuri = self.findNamespaceURI(parts[0], element)
        else:
            nsuri = self.findDefaultNS(element)
        return (nsuri, parts[1])
437923
def _get_substitute_element(head, elt, ps):
    '''
    '''
    if not isinstance(head, ElementDeclaration):
        return None

    return ElementDeclaration.getSubstitutionElement(head, elt, ps)
950982
def text(self, force_get=False):
        
        def text_element():
            """
            Wrapper to get text of element
            """
            return self.element.text

        def force_text_element():
            """Get text by javascript"""
            return self.driver_wrapper.js_executor.execute_template_and_return_result(
                'getElementText.js', {}, self.element
            )

        if force_get:
            return self.execute_and_handle_webelement_exceptions(force_text_element, 'get text by javascript')
        else:
            return self.execute_and_handle_webelement_exceptions(text_element, 'get text')
537542
long getCEFromOffsetCE32(int c, int ce32) {
        long dataCE = ces[Collation.indexFromCE32(ce32)];
        return Collation.makeCE(Collation.getThreeBytePrimaryForOffsetData(c, dataCE));
    }
839829
def raw(self, url, extra_headers=None, params=None):
        ''
        r = self.request(url, extra_headers=extra_headers, params=params)
        # uncomment to dump raw xml
#         with open('/tmp/%s.xml' % time.time(), 'wb') as f:
#             f.write(r.content)

        if not r.ok:
            o = lxml.objectify.fromstring(r.content)
            JFSError.raiseError(o, url)
        return r.content
549846
def dump_element(element):
    
    # Check type
    try:
        assert isinstance(element, sleekxmpp.ElementBase)
    except AssertionError:
        raise TypeError("Not an ElementBase: {0}".format(type(element)))

    # Prepare string
    output = StringIO()
    output.write("ElementBase : {0}\n".format(type(element)))
    output.write("- name......: {0}\n".format(element.name))
    output.write("- namespace.: {0}\n".format(element.namespace))

    output.write("- interfaces:\n")
    for itf in sorted(element.interfaces):
        output.write("\t- {0}: {1}\n".format(itf, element[itf]))

    if element.sub_interfaces:
        output.write("- sub-interfaces:\n")
        for itf in sorted(element.sub_interfaces):
            output.write("\t- {0}: {1}\n".format(itf, element[itf]))

    return output.getvalue()
452577
def raw(self) -> str:
        
        if not isinstance(self.identity, Identity):
            raise MalformedDocumentError("Can not return full certification document created from inline")

        return """Version: {version}
Type: Certification
Currency: {currency}
Issuer: {issuer}
IdtyIssuer: {certified_pubkey}
IdtyUniqueID: {certified_uid}
IdtyTimestamp: {certified_ts}
IdtySignature: {certified_signature}
CertTimestamp: {timestamp}
""".format(version=self.version,
           currency=self.currency,
           issuer=self.pubkey_from,
           certified_pubkey=self.identity.pubkey,
           certified_uid=self.identity.uid,
           certified_ts=self.identity.timestamp,
           certified_signature=self.identity.signatures[0],
           timestamp=self.timestamp)
556886
def element_data_from_Z(Z):
    '''
    '''

    # Z may be a str
    if isinstance(Z, str) and Z.isdecimal():
        Z = int(Z)

    if Z not in _element_Z_map:
        raise KeyError('No element data for Z = {}'.format(Z))
    return _element_Z_map[Z]
1202803
def element(self, inp=None):
        
        if inp is None:
            return self.elements[0]
        elif inp in self.elements:
            return inp
        else:
            raise ValueError('cannot convert inp {} to element in {}'
                             ''.format(inp, self))
733635
function getElement () {
  if (element === null) {
    element = document.createElement('a');
    element.innerText = 'Download';
    element.style.position = 'absolute';
    element.style.top = '-100px';
    element.style.left = '0px';
  }

  return element;
}
731284
def raw(self, query, settings=None, stream=False):
        '''
        
        '''
        query = self._substitute(query, None)
        return self._send(query, settings=settings, stream=stream).text
124686
function raw(obj) {
  const result = {}
  for (const key in obj) {
    const value = obj[key]
    if (value !== null && value !== undefined) {
      result[key] = value.toString()
    }
  }
  return result
}