__DOCSPLACEHOLDER__

@param {any} n __DOCSPLACEHOLDER__
186440
function EmailNode(n) {
        RED.nodes.createNode(this, n);
        this.topic = n.topic;
        this.name = n.name;
        this.outserver = n.server;
        this.outport = n.port;
        this.secure = n.secure;
        let flag = false;
        if (this.credentials && this.credentials.hasOwnProperty('userid')) {
            this.userid = this.credentials.userid;
        } else {
            if (globalkeys) {
                this.userid = globalkeys.user;
                flag = true;
            }
        }
        if (this.credentials && this.credentials.hasOwnProperty('password')) {
            this.password = this.credentials.password;
        } else {
            if (globalkeys) {
                this.password = globalkeys.pass;
                flag = true;
            }
        }
        if (flag) {
            RED.nodes.addCredentials(n.id, {userid: this.userid, password: this.password, global: true});
        }
        let node = this;

        let smtpOptions = {
            host: node.outserver,
            port: node.outport,
            secure: node.secure,
        };

        if (this.userid && this.password) {
            smtpOptions.auth = {
                user: node.userid,
                pass: node.password,
            };
        }
        let smtpTransport = nodemailer.createTransport(smtpOptions);

        this.on('input', function(msg) {
            let params = processValuesFromContext(node, msg, [
                {name: 'port', type: 'portType'},
                {name: 'server', type: 'serverType'},
                {name: 'userid', type: 'useridType'},
                {name: 'password', type: 'passwordType'},
            ]);
            console.log('params are ....');
            console.log(JSON.stringify(params));

            if (params.userid && params.password) {
                smtpOptions.auth = {
                    user: params.userid,
                    pass: params.password,
                };
            }

            if (params.port && params.server) {
                smtpOptions.host = params.server;
                smtpOptions.port = params.port;
            }


            if (msg.hasOwnProperty('payload')) {
                if (smtpTransport) {
                    node.status({fill: 'blue', shape: 'dot', text: 'email.status.sending'});
                    if (msg.to && node.name && (msg.to !== node.name)) {
                        node.warn(RED._('node-red:common.errors.nooverride'));
                    }
                    let sendopts = {from: ((msg.from) ? msg.from : node.userid)}; // sender address
                    sendopts.to = node.name || msg.to; // comma separated list of addressees
                    if (node.name === '') {
                        sendopts.cc = msg.cc;
                        sendopts.bcc = msg.bcc;
                    }
                    sendopts.subject = msg.topic || msg.title || 'Message from Node-RED'; // subject line
                    if (msg.hasOwnProperty('envelope')) {
                        sendopts.envelope = msg.envelope;
                    }
                    if (Buffer.isBuffer(msg.payload)) { // if it's a buffer in the payload then auto create an attachment instead
                        if (!msg.filename) {
                            let fe = 'bin';
                            if ((msg.payload[0] === 0xFF) && (msg.payload[1] === 0xD8)) {
                                fe = 'jpg';
                            }
                            if ((msg.payload[0] === 0x47) && (msg.payload[1] === 0x49)) {
                                fe = 'gif';
                            } // 46
                            if ((msg.payload[0] === 0x42) && (msg.payload[1] === 0x4D)) {
                                fe = 'bmp';
                            }
                            if ((msg.payload[0] === 0x89) && (msg.payload[1] === 0x50)) {
                                fe = 'png';
                            } // 4E
                            msg.filename = 'attachment.' + fe;
                        }
                        let fname = msg.filename.replace(/^.*[\\\/]/, '') || 'file.bin';
                        sendopts.attachments = [{content: msg.payload, filename: fname}];
                        if (msg.hasOwnProperty('headers') && msg.headers.hasOwnProperty('content-type')) {
                            sendopts.attachments[0].contentType = msg.headers['content-type'];
                        }
                        // Create some body text..
                        sendopts.text = RED._('email.default-message', {filename: fname, description: (msg.description || '')});
                    } else {
                        let payload = RED.util.ensureString(msg.payload);
                        sendopts.text = payload; // plaintext body
                        if (/<[a-z][\s\S]*>/i.test(payload)) {
                            sendopts.html = payload;
                        } // html body
                        if (msg.attachments) {
                            sendopts.attachments = msg.attachments;
                        } // add attachments
                    }
                    smtpTransport.sendMail(sendopts, function(error, info) {
                        if (error) {
                            node.error(error, msg);
                            node.status({fill: 'red', shape: 'ring', text: 'email.status.sendfail'});
                        } else {
                            node.log(RED._('email.status.messagesent', {response: info.response}));
                            node.status({});
                        }
                    });
                } else {
                    node.warn(RED._('email.errors.nosmtptransport'));
                }
            } else {
                node.warn(RED._('email.errors.nopayload'));
            }
        });
    }
319530
final void initDocument(int documentNumber)
        {
                // save masked DTM document handle
                m_docHandle = documentNumber<<DOCHANDLE_SHIFT;

                // Initialize the doc -- no parent, no next-sib
                nodes.writeSlot(0,DOCUMENT_NODE,-1,-1,0);
                // wait for the first startElement to create the doc root node
                done = false;
        }
1307843
function simplifyDOM(root, atEnd) {
    var doc = root.ownerDocument;
    var result = [];
    var leaving = true;

    function simplifyNode(node, top) {
      if (node.nodeType == 3) {
        var text = node.nodeValue = fixSpaces(node.nodeValue.replace(/[\r\u200b]/g, "").replace(/\n/g, " "));
        if (text.length) leaving = false;
        result.push(node);
      }
      else if (isBR(node) && node.childNodes.length == 0) {
        leaving = true;
        result.push(node);
      }
      else {
        forEach(node.childNodes, simplifyNode);
        if (!leaving && newlineElements.hasOwnProperty(node.nodeName.toUpperCase())) {
          leaving = true;
          if (!atEnd || !top)
            result.push(doc.createElement("BR"));
        }
      }
    }

    simplifyNode(root, true);
    return result;
  }
1275795
function(doc) {
        var node_list = doc.getElementsByTagName("node");
        var nodes = {};
        for (var i = 0; i < node_list.length; i++) {
            var node = node_list[i];
            var id = node.getAttribute("id");
            nodes[id] = {
                'lat': node.getAttribute("lat"),
                'lon': node.getAttribute("lon"),
                'node': node
            };
        }
        return nodes;
    }
250318
private ChangeEvent<BsonDocument> getSynthesizedRemoteChangeEventForDocument(
      final MongoNamespace ns,
      final BsonValue documentId,
      final BsonDocument document
  ) {
    // a. When the document is looked up, if it cannot be found the synthesized change event is a
    // DELETE, otherwise it's a REPLACE.
    if (document == null) {
      return ChangeEvents.changeEventForLocalDelete(ns, documentId, false);
    }
    return ChangeEvents.changeEventForLocalReplace(ns, documentId, document, false);
  }
1161628
def removeUnreferencedElements(doc, keepDefs):
    
    global _num_elements_removed
    num = 0

    # Remove certain unreferenced elements outside of defs
    removeTags = ['linearGradient', 'radialGradient', 'pattern']
    identifiedElements = findElementsWithId(doc.documentElement)
    referencedIDs = findReferencedElements(doc.documentElement)

    for id in identifiedElements:
        if id not in referencedIDs:
            goner = identifiedElements[id]
            if (goner is not None and goner.nodeName in removeTags
                and goner.parentNode is not None
                    and goner.parentNode.tagName != 'defs'):
                goner.parentNode.removeChild(goner)
                num += 1
                _num_elements_removed += 1

    if not keepDefs:
        # Remove most unreferenced elements inside defs
        defs = doc.documentElement.getElementsByTagName('defs')
        for aDef in defs:
            elemsToRemove = removeUnusedDefs(doc, aDef)
            for elem in elemsToRemove:
                elem.parentNode.removeChild(elem)
                _num_elements_removed += 1
                num += 1
    return num
953231
function (docId, name, value, changedByUserId, destroyedAt, recordedAt, updatedAt,
  seq, quorum, userUUID, colId, docUUID, forUserId, forUserUUID,
  recordedByUserId, colName, recordedByUUID) {
  this.docId = docId;
  this.name = name;
  this.value = value;
  this.changedByUserId = changedByUserId;
  this.destroyedAt = destroyedAt;
  this.recordedAt = recordedAt;
  this.updatedAt = updatedAt;
  this.seq = seq;
  this.quorum = quorum;
  this.userUUID = userUUID;
  this.colId = colId;
  this.docUUID = docUUID;
  this.forUserId = forUserId;
  this.forUserUUID = forUserUUID;
  this.recordedByUserId = recordedByUserId;
  this.colName = colName;
  this.recordedByUUID = recordedByUUID;
}
46427
private void validateFunctionJsDoc(Node n, JSDocInfo info) {
    if (info == null) {
      return;
    }

    if (info.containsFunctionDeclaration() && !info.hasType() && !isJSDocOnFunctionNode(n, info)) {
      // This JSDoc should be attached to a FUNCTION node, or an assignment
      // with a function as the RHS, etc.

      reportMisplaced(
          n,
          "function",
          "This JSDoc is not attached to a function node. " + "Are you missing parentheses?");
    }
  }
676791
function () {
      this.removeChildInstances();

      if (this.template) {
        // temporarily assign a new node to get the content in a doc fragment
        this.vscope=this.parent.vscope; // to come back to original state, when the scope has not been changed by the template
        var targs=this.getTemplateArguments(), cargs=this.getCptArguments();
        var realNode = this.node;
        var df = doc.createDocumentFragment();
        this.node = df;
        this.template.call(this, targs, cargs); // WARNING: this changes vscope to the template vscope

        realNode.insertBefore(df, this.node2);
        this.replaceNodeBy(df , realNode); // recursively remove doc fragment reference
        // now this.node=realNode
        this.isDOMempty = false;
      }
  }
857772
function(e) {
		if (!e.doclet) return;
	
        if (e.doclet.description) e.doclet.description = spripP(e.doclet.description);
		
		if (e.doclet.params){   
			e.doclet.params.forEach(function(prm){
				if (prm.description)  prm.description = spripP(prm.description);
			});
        }
    }
37198
function (elements, id) {
      return function (editor) {
        var i, textBlockElementsMap = editor.schema.getTextBlockElements();

        for (i = 0; i < elements.length; i++) {
          if (elements[i].nodeName === 'TABLE') {
            return null;
          }
        }

        for (i = 0; i < elements.length; i++) {
          if (elements[i].nodeName in textBlockElementsMap) {
            if (editor.dom.isEmpty(elements[i])) {
              return Matcher.result(id, Measure.getSelectionRect(editor));
            }

            return null;
          }
        }

        return null;
      };
    }
426898
function validateDoc (doc) {
  let issues = []

  function ignore (field) {
    return IGNORE_WARNINGS[field].indexOf(doc.name) !== -1
  }

  if (!doc.name) {
    issues.push('name missing in document')
  }

  if (!doc.description) {
    issues.push('function "' + doc.name + '": description missing')
  }

  if (!doc.syntax || doc.syntax.length === 0) {
    issues.push('function "' + doc.name + '": syntax missing')
  }

  if (!doc.examples || doc.examples.length === 0) {
    issues.push('function "' + doc.name + '": examples missing')
  }

  if (doc.parameters && doc.parameters.length) {
    doc.parameters.forEach(function (param, index) {
      if (!param.name || !param.name.trim()) {
        issues.push('function "' + doc.name + '": name missing of parameter ' + index + '')
      }
      if (!param.description || !param.description.trim()) {
        issues.push('function "' + doc.name + '": description missing for parameter ' + (param.name || index))
      }
      if (!param.types || !param.types.length) {
        issues.push('function "' + doc.name + '": types missing for parameter ' + (param.name || index))
      }
    })
  } else {
    if (!ignore('parameters')) {
      issues.push('function "' + doc.name + '": parameters missing')
    }
  }

  if (doc.returns) {
    if (!doc.returns.description || !doc.returns.description.trim()) {
      issues.push('function "' + doc.name + '": description missing of returns')
    }
    if (!doc.returns.types || !doc.returns.types.length) {
      issues.push('function "' + doc.name + '": types missing of returns')
    }
  } else {
    if (!ignore('returns')) {
      issues.push('function "' + doc.name + '": returns missing')
    }
  }

  if (!doc.seeAlso || doc.seeAlso.length === 0) {
    if (!ignore('seeAlso')) {
      issues.push('function "' + doc.name + '": seeAlso missing')
    }
  }

  return issues
}
1132673
function fromPres( preHtmls, newBlock )
	{
		var docFrag;
		if ( preHtmls.length > 1 )
			docFrag = new CKEDITOR.dom.documentFragment( newBlock.getDocument() );

		for ( var i = 0 ; i < preHtmls.length ; i++ )
		{
			var blockHtml = preHtmls[ i ];

			// 1. Trim the first and last line-breaks immediately after and before <pre>,
			// they're not visible.
			 blockHtml =  blockHtml.replace( /(\r\n|\r)/g, '\n' ) ;
			 blockHtml = replace(  blockHtml, /^[ \t]*\n/, '' ) ;
			 blockHtml = replace(  blockHtml, /\n$/, '' ) ;
			// 2. Convert spaces or tabs at the beginning or at the end to &nbsp;
			 blockHtml = replace(  blockHtml, /^[ \t]+|[ \t]+$/g, function( match, offset, s )
					{
						if ( match.length == 1 )	// one space, preserve it
							return '&nbsp;' ;
						else if ( !offset )		// beginning of block
							return CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ) + ' ';
						else				// end of block
							return ' ' + CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 );
					} ) ;

			// 3. Convert \n to <BR>.
			// 4. Convert contiguous (i.e. non-singular) spaces or tabs to &nbsp;
			 blockHtml =  blockHtml.replace( /\n/g, '<br>' ) ;
			 blockHtml =  blockHtml.replace( /[ \t]{2,}/g,
					function ( match )
					{
						return CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ) + ' ' ;
					} ) ;

			if ( docFrag )
			{
				var newBlockClone = newBlock.clone();
				newBlockClone.setHtml(  blockHtml );
				docFrag.append( newBlockClone );
			}
			else
				newBlock.setHtml( blockHtml );
		}

		return docFrag || newBlock;
	}
1102212
function includeReferences(include, doc) {
  _.each(include, function (keypath) {
    var parts = keypath.split('.')
    var key = parts.shift()

    if (_.has(doc, key) && _.isString(doc[key])) {
      var ref = doc[key].split(':')
      doc[key] = getDocument({ collection: ref[0], id: ref[1] })

      if (parts.length > 0) {
        includeReferences(parts.slice(1), doc[key])
      }
    }
  })
}
160214
private static boolean isNamespacePlaceholder(Node n) {
    if (!n.getBooleanProp(Node.IS_NAMESPACE)) {
      return false;
    }

    Node value = null;
    if (n.isExprResult()) {
      Node assign = n.getFirstChild();
      value = assign.getLastChild();
    } else if (n.isVar()) {
      Node name = n.getFirstChild();
      value = name.getFirstChild();
    }

    if (value == null) {
      return false;
    }
    if (value.isCast()) {
      // There may be a cast to unknown type wrapped around the value.
      value = value.getOnlyChild();
    }
    return value.isObjectLit() && !value.hasChildren();
  }
869705
def t_heredocvar_ENCAPSED_AND_WHITESPACE(t):
    '
    t.lexer.lineno += t.value.count("\n")
    t.lexer.pop_state()
    return t
1313905
function (namespaceURI, qualifiedName, doctype) {
        return Node.createDocument({
            name: qualifiedName,
            namespaceURI: namespaceURI,
            doctype: doctype
        });
    }