Get normalized text of node which matches the css path.
341058
def css_text(self, path, default=NULL, smart=False, normalize_space=True):
        

        try:
            return get_node_text(self.css_one(path), smart=smart,
                                 normalize_space=normalize_space)
        except IndexError:
            if default is NULL:
                raise
            else:
                return default
1131844
def get_text(self, node):
        """"""
        try:
            return node.children[0].content or ""
        except (AttributeError, IndexError):
            return node.content or ""
917678
def cssText(self) -> str:
        """"""
        _style = self.style.cssText
        if _style:
            return '{0} {{{1}}}'.format(self.selectorText, _style)
        return ''
510928
def string_value(node):
    """"""
    if (node.nodeType == node.DOCUMENT_NODE or
        node.nodeType == node.ELEMENT_NODE):
        s = u''
        for n in axes['descendant'](node):
            if n.nodeType == n.TEXT_NODE:
                s += n.data
        return s

    elif node.nodeType == node.ATTRIBUTE_NODE:
        return node.value

    elif (node.nodeType == node.PROCESSING_INSTRUCTION_NODE or
          node.nodeType == node.COMMENT_NODE or
          node.nodeType == node.TEXT_NODE):
        return node.data
1314118
def _normalize_path(path):
        
        if isinstance(path, FileInfo):
            path = path.path
        if len(path) == 0:
            return '/'
        if not path.startswith('/'):
            path = '/' + path
        return path
823029
def innertext(node):
    """"""
    if not len(node):
        return node.text

    return (node.text or '') + ''.join([etree.tostring(c) for c in node]) + (node.tail or '')
1128159
function getContent(node) {
    var text = '', atom;
    for (var i = 0; i<node.childNodes.length; i++) {
      if (node.childNodes[i].nodeType === 1) {
        atom = node.childNodes[i]._bfs_text;
      } else if (node.childNodes[i].nodeType === 3) {
        atom = node.childNodes[i].data;
      } else
        continue;
      if (text.match(/[\t ]+$/) && atom.match(/^[\t ]+/)) {
        text = text.replace(/[\t ]+$/,'') + ' ' + atom.replace(/^[\t ]+/, '');
      } else {
        text = text + atom;
      }
    }
    return text;
  }
939503
def match_division(node):
    
    """
    slash = token.SLASH
    return node.type == slash and not node.next_sibling.type == slash and \
                                  not node.prev_sibling.type == slash
798104
function getDOMPath(node, dontGoUpTheDom /* = false */ ) {
		var path = [],
			entry = '';

		if (node === window) {
			return 'window';
		}

		while (node instanceof Node) {
			// div
			entry = node.nodeName.toLowerCase();

			// shorten the path a bit
			if (['body', 'head', 'html'].indexOf(entry) > -1) {
				path.push(entry);
				break;
			}

			if (node instanceof DocumentFragment) {
				entry = 'DocumentFragment';
			}

			// div#foo
			if (node.id && node.id !== '') {
				entry += '#' + node.id;
			}
			// div#foo.bar.test
			else if (typeof node.className === 'string' && node.className !== '') {
				entry += '.' + node.className.trim().replace(/\s+/g, '.');
			}
			// div[0] <- index of child node
			else if (node.parentNode instanceof Node) {
				entry += '[' + Math.max(0, Array.prototype.indexOf.call(node.parentNode.children || node.parentNode.childNodes, node)) + ']';
			}

			path.push(entry);

			if (dontGoUpTheDom === true) {
				break;
			}

			// go up the DOM
			node = node && node.parentNode;
		}

		return (path.length > 0) ? path.reverse().join(' > ') : false;
	}
414160
def normalized_path(value):
    """"""
    if not value:
        return
    norm = os.path.normpath(value)
    norm = os.path.abspath(os.path.expanduser(norm))
    return norm
651893
function( path ) {
      var normalized = [];
      var parts = path.split( '/' );

      for( var i = 0; i < parts.length; i++ ) {
         if( parts[i] === '.' ) {
            continue;
         }

         if( parts[i] === '..' && normalized.length && normalized[normalized.length - 1] !== '..' ) {
            normalized.pop();
            continue;
         }

         normalized.push( parts[i] );
      }

      return normalized.join( '/' );
   }
1339537
function(node) {
      var cssStyleMatch;
      while (node) {
        cssStyleMatch = this.cssStyle ? hasStyleAttr(node, this.similarStyleRegExp) : false;

        if (node.nodeType == wysihtml5.ELEMENT_NODE && node.getAttribute("contenteditable") != "false" && rangy.dom.arrayContains(this.tagNames, node.tagName.toLowerCase()) && cssStyleMatch) {
          return node;
        }
        node = node.parentNode;
      }
      return false;
    }
28536
def normalize(self, text):
        """"""
        text = super(ChemNormalizer, self).normalize(text)
        # Normalize element spelling
        if self.chem_spell:
            text = re.sub(r'sulph', r'sulf', text, flags=re.I)
            text = re.sub(r'aluminum', r'aluminium', text, flags=re.I)
            text = re.sub(r'cesium', r'caesium', text, flags=re.I)
        return text
1242605
function(node)
	{
		if (node.innerText !== undefined)
		{
			return node.innerText;
		}
		else
		{
			return (node != null) ? node[(node.textContent === undefined) ? 'text' : 'textContent'] : '';
		}
	}
1071190
def get_path_style(path, fill=True):
    """"""
    style = {}
    style['alpha'] = path.get_alpha()
    if style['alpha'] is None:
        style['alpha'] = 1
    style['edgecolor'] = color_to_hex(path.get_edgecolor())
    if fill:
        style['facecolor'] = color_to_hex(path.get_facecolor())
    else:
        style['facecolor'] = 'none'
    style['edgewidth'] = path.get_linewidth()
    style['dasharray'] = get_dasharray(path)
    style['zorder'] = path.get_zorder()
    return style
1287027
def normalize_element(path)
      path = Pathname.new(path)
      path = @root.join(path) if path.relative?
      path.expand_path.to_s
    end
852865
def get_node_text(self, node):
        
        text_children = [n.nodeValue for n in self.get_node_children(node)
                         if n.nodeType == xml.dom.Node.TEXT_NODE]
        if text_children:
            return u''.join(text_children)
        else:
            return None