Transforms a `member` doclet element.

@param {Object} node - doclet element
@returns {Object} filtered object
424159
function transform( node ) {
	var type;
	if ( node.type ) {
		if ( node.type.length === 1 ) {
			type = node.type[ 0 ];
		} else {
			type = node.type;
		}
	} else {
		type = '';
	}
	return {
		'name': node.name,
		'description': node.description || '',
		'type': type,
		'access': node.access || '',
		'virtual': !!node.virtual
	};
}
1099062
function getTextNodes(el) {
  el = el || document.body

  var doc = el.ownerDocument || document
    , walker = doc.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false)
    , textNodes = []
    , node

  while (node = walker.nextNode()) {
    textNodes.push(node)
  }
  return textNodes
}
400021
def transform(self, transform, node):
        
        method = transform.get('Algorithm')
        if method not in constants.TransformUsageDSigTransform:
            raise Exception('Method not allowed')
        # C14N methods are allowed
        if method in constants.TransformUsageC14NMethod:
            return self.canonicalization(method, etree.fromstring(node))
        # Enveloped method removes the Signature Node from the element
        if method == constants.TransformEnveloped:
            tree = transform.getroottree()
            root = etree.fromstring(node)
            signature = root.find(
                tree.getelementpath(
                    transform.getparent().getparent().getparent().getparent()
                )
            )
            root.remove(signature)
            return self.canonicalization(
                    constants.TransformInclC14N, root)
        if method == constants.TransformBase64:
            try:
                root = etree.fromstring(node)
                return base64.b64decode(root.text)
            except Exception:
                return base64.b64decode(node)

        raise Exception('Method not found')
1266812
def transform(self, node, results):
        
        """
        params = results.get(u"params")
        ret = results.get(u"ret")
        if ret is not None:
            assert ret.prev_sibling.type == token.RARROW, u"Invalid return annotation"
            self.warn_once(node, reason=warning_text)
            ret.prev_sibling.remove()
            ret.remove()
        if params is None: return
        if params.type == syms.typedargslist:
            # more than one param in a typedargslist
            for param in params.children:
                if param.type == syms.tname:
                    self.warn_once(node, reason=warning_text)
                    param.replace(param_without_annotations(param))
        elif params.type == syms.tname:
            # one param
            self.warn_once(node, reason=warning_text)
            params.replace(param_without_annotations(params))
618850
function replaceNodeWith(node, newNode) {
    let done = false;
    const parent = node.$parent;
    const keys = Object.keys(parent);
    keys.forEach(function(key) {
        if (parent[key] === node) {
            parent[key] = newNode;
            done = true;
        }
    });

    if (done) {
        return;
    }

    // second pass, now check arrays
    keys.forEach(function(key) {
        if (Array.isArray(parent[key])) {
            const arr = parent[key];
            for (let i = 0; i < arr.length; i++) {
                if (arr[i] === node) {
                    arr[i] = newNode;
                    done = true;
                }
            }
        }
    });

    assert(done);
}
224179
function (node) {
            if (this.type == 'root' || (this.type == 'element' && !dtd.$empty[this.tagName])) {
                if (!this.children) {
                    this.children = []
                }
                if(node.parentNode){
                    node.parentNode.removeChild(node);
                }
                for (var i = 0, ci; ci = this.children[i]; i++) {
                    if (ci === node) {
                        this.children.splice(i, 1);
                        break;
                    }
                }
                this.children.push(node);
                node.parentNode = this;
                return node;
            }


        }
862881
function(node) {
    if (node.type !== 'AssignmentExpression') return false;

    return node.left.type === 'MemberExpression' &&
      node.left.object.type === 'Identifier' && node.left.object.name === 'module' &&
      node.left.property.type === 'Identifier' && node.left.property.name === 'exports';
    // TODO: detect module.exports.foo = (or exports.foo =) property assignments, non-default exports
  }
1020960
function transformNode(el) {
  const attr = Object.keys(el.attrsMap).find(attr => attr.startsWith('~'))

  if (attr) {
    const attrName = attr.substr(1)
    let [arg, ...modifiers] = attrName.split('.')
    modifiers = modifiers.reduce((mods, mod) => {
      mods[mod] = true
      return mods
    }, {})
    getAndRemoveAttr(el, attr)
    addDirective(el, 'view', `v-view:${attrName}`, '', arg, modifiers)
  }
}
368073
function(doc) {
        var node = this._node;
        doc = (doc) ? doc._node || doc : node[OWNER_DOCUMENT];
        if (doc.documentElement) {
            return Y_DOM.contains(doc.documentElement, node);
        }
    }
750543
def cleanup_nodes(doc):
    
    for node in doc.documentElement.childNodes:
        if node.nodeType == Node.TEXT_NODE and node.nodeValue.isspace():
            doc.documentElement.removeChild(node)
    return doc
183662
public Node transform(AstNode node) {
        switch (node.getType()) {
          case Token.ARRAYCOMP:
              return transformArrayComp((ArrayComprehension)node);
          case Token.ARRAYLIT:
              return transformArrayLiteral((ArrayLiteral)node);
          case Token.BLOCK:
              return transformBlock(node);
          case Token.BREAK:
              return transformBreak((BreakStatement)node);
          case Token.CALL:
              return transformFunctionCall((FunctionCall)node);
          case Token.CONTINUE:
              return transformContinue((ContinueStatement)node);
          case Token.DO:
              return transformDoLoop((DoLoop)node);
          case Token.EMPTY:
              return node;
          case Token.FOR:
              if (node instanceof ForInLoop) {
                  return transformForInLoop((ForInLoop)node);
              }
              return transformForLoop((ForLoop)node);
          case Token.FUNCTION:
              return transformFunction((FunctionNode)node);
          case Token.GENEXPR:
              return transformGenExpr((GeneratorExpression)node);
          case Token.GETELEM:
              return transformElementGet((ElementGet)node);
          case Token.GETPROP:
              return transformPropertyGet((PropertyGet)node);
          case Token.HOOK:
              return transformCondExpr((ConditionalExpression)node);
          case Token.IF:
              return transformIf((IfStatement)node);

          case Token.TRUE:
          case Token.FALSE:
          case Token.THIS:
          case Token.NULL:
          case Token.DEBUGGER:
              return transformLiteral(node);

          case Token.NAME:
              return transformName((Name)node);
          case Token.NUMBER:
              return transformNumber((NumberLiteral)node);
          case Token.NEW:
              return transformNewExpr((NewExpression)node);
          case Token.OBJECTLIT:
              return transformObjectLiteral((ObjectLiteral)node);
          case Token.REGEXP:
              return transformRegExp((RegExpLiteral)node);
          case Token.RETURN:
              return transformReturn((ReturnStatement)node);
          case Token.SCRIPT:
              return transformScript((ScriptNode)node);
          case Token.STRING:
              return transformString((StringLiteral)node);
          case Token.SWITCH:
              return transformSwitch((SwitchStatement)node);
          case Token.THROW:
              return transformThrow((ThrowStatement)node);
          case Token.TRY:
              return transformTry((TryStatement)node);
          case Token.WHILE:
              return transformWhileLoop((WhileLoop)node);
          case Token.WITH:
              return transformWith((WithStatement)node);
          case Token.YIELD:
              return transformYield((Yield)node);
          default:
              if (node instanceof ExpressionStatement) {
                  return transformExprStmt((ExpressionStatement)node);
              }
              if (node instanceof Assignment) {
                  return transformAssignment((Assignment)node);
              }
              if (node instanceof UnaryExpression) {
                  return transformUnary((UnaryExpression)node);
              }
              if (node instanceof XmlMemberGet) {
                  return transformXmlMemberGet((XmlMemberGet)node);
              }
              if (node instanceof InfixExpression) {
                  return transformInfix((InfixExpression)node);
              }
              if (node instanceof VariableDeclaration) {
                  return transformVariables((VariableDeclaration)node);
              }
              if (node instanceof ParenthesizedExpression) {
                  return transformParenExpr((ParenthesizedExpression)node);
              }
              if (node instanceof LabeledStatement) {
                  return transformLabeledStatement((LabeledStatement)node);
              }
              if (node instanceof LetNode) {
                  return transformLetNode((LetNode)node);
              }
              if (node instanceof XmlRef) {
                  return transformXmlRef((XmlRef)node);
              }
              if (node instanceof XmlLiteral) {
                  return transformXmlLiteral((XmlLiteral)node);
              }
              throw new IllegalArgumentException("Can't transform: " + node);
        }
    }
26222
function (writer, filter) {
            var self = this, tmp, attrName, tagName = self.tagName;    // special treat for doctype
            // special treat for doctype
            if (tagName === '!doctype') {
                writer.append(this.toHtml() + '\n');
                return;
            }
            self.__filter = filter;
            self.isChildrenFiltered = 0;    // process its open tag
            // process its open tag
            if (filter) {
                // element filtered by its name directly
                if (!(tagName = filter.onTagName(tagName))) {
                    return;
                }
                self.tagName = tagName;
                tmp = filter.onTag(self);
                if (tmp === false) {
                    return;
                }    // replaced
                // replaced
                if (tmp) {
                    self = tmp;
                }    // replaced by other type of node
                // replaced by other type of node
                if (self.nodeType !== 1) {
                    self.writeHtml(writer, filter);
                    return;
                }    // preserve children but delete itself
                // preserve children but delete itself
                if (!self.tagName) {
                    self._writeChildrenHTML(writer);
                    return;
                }
            }
            writer.openTag(self);    // process its attributes
            // process its attributes
            var attributes = self.attributes;
            for (var i = 0; i < attributes.length; i++) {
                var attr = attributes[i];
                attrName = attr.name;
                if (filter) {
                    // filtered directly by name
                    if (!(attrName = filter.onAttributeName(attrName, self))) {
                        continue;
                    }
                    attr.name = attrName;    // filtered by value and node
                    // filtered by value and node
                    if (filter.onAttribute(attr, self) === false) {
                        continue;
                    }
                }
                writer.attribute(attr, self);
            }    // close its open tag
            // close its open tag
            writer.openTagClose(self);
            if (!self.isSelfClosed) {
                self._writeChildrenHTML(writer);    // process its close tag
                // process its close tag
                writer.closeTag(self);
            }
        }
358027
function cleanUpNodeJSDoc(
  node,
  JSDocCommentValue = getJSDocCommentValue(node),
) {
  t.removeComments(node);
  t.addComment(node, 'leading', createJSDocCommentValue(JSDocCommentValue));
}
107427
private Node transformXmlRef(XmlRef node) {
        int memberTypeFlags = node.isAttributeAccess()
            ? Node.ATTRIBUTE_FLAG : 0;
        return transformXmlRef(null, node, memberTypeFlags);
    }
236718
function transform(node, viewport) {
  let trans = getTranslation(viewport);

  // Let SVG natively transform the element
  node.setAttribute('transform', `scale(${viewport.scale}) rotate(${viewport.rotation}) translate(${trans.x}, ${trans.y})`);
  
  // Manually adjust x/y for nested SVG nodes
  if (!isFirefox && node.nodeName.toLowerCase() === 'svg') {
    node.setAttribute('x', parseInt(node.getAttribute('x'), 10) * viewport.scale);
    node.setAttribute('y', parseInt(node.getAttribute('y'), 10) * viewport.scale);

    let x = parseInt(node.getAttribute('x', 10));
    let y = parseInt(node.getAttribute('y', 10));
    let width = parseInt(node.getAttribute('width'), 10);
    let height = parseInt(node.getAttribute('height'), 10);
    let path = node.querySelector('path');
    let svg = path.parentNode;
   
    // Scale width/height
    [node, svg, path, node.querySelector('rect')].forEach((n) => {
      n.setAttribute('width', parseInt(n.getAttribute('width'), 10) * viewport.scale);
      n.setAttribute('height', parseInt(n.getAttribute('height'), 10) * viewport.scale);
    });

    // Transform path but keep scale at 100% since it will be handled natively
    transform(path, objectAssign({}, viewport, { scale: 1 }));
    
    switch(viewport.rotation % 360) {
      case 90:
        node.setAttribute('x', viewport.width - y - width);
        node.setAttribute('y', x);
        svg.setAttribute('x', 1);
        svg.setAttribute('y', 0);
        break;
      case 180:
        node.setAttribute('x', viewport.width - x - width);
        node.setAttribute('y', viewport.height - y - height);
        svg.setAttribute('y', 2);
        break;
      case 270:
        node.setAttribute('x', y);
        node.setAttribute('y', viewport.height - x - height);
        svg.setAttribute('x', -1);
        svg.setAttribute('y', 0);
        break;
    }
  }

  return node;
}
120522
public Document nodeToDom(org.w3c.dom.Node node) throws S2SException {
        try {
            javax.xml.transform.TransformerFactory tf = javax.xml.transform.TransformerFactory.newInstance();
            javax.xml.transform.Transformer xf = tf.newTransformer();
            javax.xml.transform.dom.DOMResult dr = new javax.xml.transform.dom.DOMResult();
            xf.transform(new javax.xml.transform.dom.DOMSource(node), dr);
            return (Document) dr.getNode();

        }
        catch (javax.xml.transform.TransformerException ex) {
            throw new S2SException(ex.getMessage());
        }
    }
262978
function doesMemberExpressionContainCallExpression(node) {
            let currentNode = node.object;
            let currentNodeType = node.object.type;

            while (currentNodeType === "MemberExpression") {
                currentNode = currentNode.object;
                currentNodeType = currentNode.type;
            }

            return currentNodeType === "CallExpression";
        }