Support `node`, `service`, `check`, `state`
541347
def health(self, **kwargs):
        '''
        
        '''
        if not len(kwargs):
            raise ValueError('no resource provided')
        for resource, name in kwargs.iteritems():
            endpoint = 'health/{}/{}'.format(resource, name)
        return self._get(endpoint)
382950
function verify(node) {
	switch (node.type) {
		case esprima.Syntax.FunctionDeclaration:
			if (node.leadingComments && node.leadingComments.length === 1) {
				analyzeFunction(node);
			}
			break;
		default:
			break;
	}
}
429915
function(node){
    var stmt = t.switchStatement(
      node.astExpr || this.parseExpr(node.expr),
      this.visit(node.block, node)
    );
    return [stmt];
  }
571608
function maybeAddChecksumNode(path, nodeType, callback) {
    fsUtils.isPathUnsynced(fs, path, function(err, unsynced) {
      if(err) {
        return callback(err);
      }

      if(unsynced) {
        return callback();
      }

      getChecksum(fs, path, function(err, checksum) {
        if(err) {
          return callback(err);
        }
        // If we shouldn't add the checksum stamp or
        // the node does not exist (cannot add a stamp)
        // immediately add the checksum
        if(!stampNode || checksum === "") {
          return addChecksumNode(path, nodeType, checksum, callback);
        }

        // Stamp the node with the checksum
        fsUtils.setChecksum(fs, path, checksum, function(err) {
          if(err) {
            return callback(err);
          }

          addChecksumNode(path, nodeType, checksum, callback);
        });
      });
    });
  }
376584
def on_if(self, node):    # ('test', 'body', 'orelse')
        """"""
        block = node.body
        if not self.run(node.test):
            block = node.orelse
        for tnode in block:
            self.run(tnode)
1051130
function callHook(vnode3) {
		var original = vnode3.state
		try {
			return this.apply(original, arguments)
		} finally {
			checkState(vnode3, original)
		}
	}
685544
function nodeGlobalRequire(file) {
  vm.runInThisContext.call(global, fs.readFileSync(file), file);
}
895911
function check(node) {
            const elements = node.elements;
            const normalizedOptions = normalizeOptions(context.options[0]);
            const options = normalizedOptions[node.type];

            let elementBreak = false;

            /*
             * MULTILINE: true
             * loop through every element and check
             * if at least one element has linebreaks inside
             * this ensures that following is not valid (due to elements are on the same line):
             *
             * [
             *      1,
             *      2,
             *      3
             * ]
             */
            if (options.multiline) {
                elementBreak = elements
                    .filter(element => element !== null)
                    .some(element => element.loc.start.line !== element.loc.end.line);
            }

            const linebreaksCount = node.elements.map((element, i) => {
                const previousElement = elements[i - 1];

                if (i === 0 || element === null || previousElement === null) {
                    return false;
                }

                const commaToken = sourceCode.getFirstTokenBetween(previousElement, element, astUtils.isCommaToken);
                const lastTokenOfPreviousElement = sourceCode.getTokenBefore(commaToken);
                const firstTokenOfCurrentElement = sourceCode.getTokenAfter(commaToken);

                return !astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement);
            }).filter(isBreak => isBreak === true).length;

            const needsLinebreaks = (
                elements.length >= options.minItems ||
                (
                    options.multiline &&
                    elementBreak
                ) ||
                (
                    options.consistent &&
                    linebreaksCount > 0 &&
                    linebreaksCount < node.elements.length
                )
            );

            elements.forEach((element, i) => {
                const previousElement = elements[i - 1];

                if (i === 0 || element === null || previousElement === null) {
                    return;
                }

                const commaToken = sourceCode.getFirstTokenBetween(previousElement, element, astUtils.isCommaToken);
                const lastTokenOfPreviousElement = sourceCode.getTokenBefore(commaToken);
                const firstTokenOfCurrentElement = sourceCode.getTokenAfter(commaToken);

                if (needsLinebreaks) {
                    if (astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) {
                        reportRequiredLineBreak(firstTokenOfCurrentElement);
                    }
                } else {
                    if (!astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) {
                        reportNoLineBreak(firstTokenOfCurrentElement);
                    }
                }
            });
        }
1354773
function replaceEnv(node, state, value) {
        utils.catchup(node.range[0], state);
        utils.append(JSON.stringify(value), state);
        utils.move(node.range[1], state);
    }
518603
def _handle_nodes(nodes: MaybeNodeList) -> List[BaseEntity]:
    """"""
    if isinstance(nodes, BaseEntity):
        return [nodes]

    return [
        (
            parse_result_to_dsl(node)
            if not isinstance(node, BaseEntity) else
            node
        )
        for node in nodes
    ]
1059821
function feed(op, pnode) {
        if (numStreams > 0) {
            changes.push({op:op, pnode:pnode.toJSON()})
        }
    }
913122
function Node (config) {
    RED.nodes.createNode(this, config);
    var node = this;

    // Invoked when the node has received an input as part of a flow.
    this.on('input', function (msg) {
      processOnInput(msg, config, node);
    });
  }
372829
function setupBotStatus(bot, node) {
    var updates = 0;
    var replies = 0;
    var updateText = function updateText() {
        return updates !== 1 ? updates + ' updates' : updates + ' update';
    };
    var replyText= function replyText() {
        return replies !== 1 ? replies + ' replies': replies + ' reply';
    };
    var updateStatus = function updateStatus() {
        node.status({fill: 'green', shape: 'dot',
            text: updateText() + '; ' + replyText()
        });
    };
    node.status({fill: 'grey', shape: 'ring', text: 'inactive'});
    bot.on('update', function updateCallback() {
        updates += 1;
        updateStatus();
    });

    bot.on('error', function errorCallback(error) {
        node.error(error);
        node.status({fill: 'red', shape: 'dot', text: 'error'});
    });

    bot.use('outgoing', function outgoingCallback(bot, update, message, next) {
        replies += 1;
        updateStatus();
        next();
    });
}
52870
def check(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('app:check', **{
        'node': ctx.repo.create_secure_service('node'),
        'name': name,
    })
1343138
function NLUNode (config) {
    RED.nodes.createNode(this, config);
    var node = this;

    this.on('input', function (msg) {
      var message = '',
        options = {};

      node.status({});

      username = sUsername || this.credentials.username;
      password = sPassword || this.credentials.password;
      apikey = sApikey || this.credentials.apikey;

      endpoint = sEndpoint;
      if ((!config['default-endpoint']) && config['service-endpoint']) {
        endpoint = config['service-endpoint'];
      }

      initialCheck(username, password, apikey)
        .then(function(){
          return payloadCheck(msg, options);
        })
        .then(function(){
          return checkAdditonalMsgOptions(msg, options);
        })
        .then(function(){
          return checkFeatureRequest(config, options);
        })
        .then(function(){
          return checkFeatureOptions(msg, config, options);
        })
        .then(function(){
          return checkNonFeatureOptions(config, options);
        })
        .then(function(){
          node.status({fill:'blue', shape:'dot', text:'requesting'});
          return invokeService(options);
        })
        .then(function(data){
          msg.features = data;
          node.send(msg);
          node.status({});
        })
        .catch(function(err){
          reportError(node,msg,err);
        });

    });
  }
615777
function ancestor(node, visitors, base, state) {
  if (!base) base = exports.base;
  if (!state) state = [];(function c(node, st, override) {
    var type = override || node.type,
        found = visitors[type];
    if (node != st[st.length - 1]) {
      st = st.slice();
      st.push(node);
    }
    base[type](node, st, c);
    if (found) found(node, st);
  })(node, state);
}
1115753
function ENV_node() {
      var Module = module.constructor;

      var parent = module.parent;
      var req = util.bind(parent, parent && parent.require || require);

      var fs = req('fs');
      var path = req('path');
      var vm = req('vm');

      this.requireCache = require.cache;
      this.main = require.main;
      this.name = 'node';
      this.global = global;
      this.isWindowsNode = (process.platform === 'win32');

      var _cwd = process.cwd();
      this.setCwd = function (cwd) { _cwd = path.resolve(_cwd, cwd); };
      this.getCwd = function () { return _cwd; };

      this.pathSep = path.sep;

      // var parentPath = util.splitPath(module.parent.filename);
      // module.parent.require = function(request, opts) {
      //   if (!opts) { opts = {}; }
      //   opts.dontExport = true;
      //   return _require({}, parentPath.directory, parentPath.filename, request, opts);
      // };

      this.log = function() {
        var msg;
        try {
          msg = Array.prototype.map.call(arguments, function(a) {
              if ((a instanceof Error) && a.message) {
                return 'Error:' + a.message + '\nStack:' + a.stack + '\nArguments:' + a.arguments;
              }
              return (typeof a == 'string' ? a : JSON.stringify(a));
            }).join(' ') + '\n';
        } catch(e) {
          msg = Array.prototype.join.call(arguments, ' ') + '\n';
        }

        process.stderr.write(msg);
        return msg;
      };

      this.getPath = function() {
        return __dirname;
      };

      this.eval = function (code, path) {
        return vm.runInThisContext(code, path, true);
      };

      this.fetch = function (p) {
        p = util.resolve(this.getCwd(), p);

        var filename, lowercaseFilename, files;
        try {
          var dirname = path.dirname(p);
          filename = path.basename(p);
          lowercaseFilename = filename.toLowerCase();
          files = fs.readdirSync(dirname);
        } catch (e) {
          return false;
        }

        for (var i = 0, testName; testName = files[i]; ++i) {
          if (testName.toLowerCase() == lowercaseFilename && testName != filename) {
            throw "Invalid case when importing [" + p + "].  You probably meant" + testName;
          }
        }

        try {
          return fs.readFileSync(p, 'utf8');
        } catch(e) {
          return false;
        }
      };

      var stackRe = /\((?!module.js)(?:file:\/\/)?(.*?)(:\d+)(:\d+)\)/g;
      this.loadModule = function (baseLoader, fromDir, fromFile, item, opts) {
        if (fromFile == INITIAL_FILE && !opts.initialImport) {
          var stack = new Error().stack;
          var match;
          stackRe.lastIndex = 0;
          do {
            match = stackRe.exec(stack);
          } while (match && /jsio\.js$/.test(match[1]));

          if (match) {
            fromDir = path.dirname(match[1]);
            fromFile = path.basename(match[1]);
          }
        }

        try {
          return baseLoader(null, fromDir, fromFile, item, opts);
        } catch(e) {
          if (e.code == MODULE_NOT_FOUND) {
            var require = req;
            // lookup node module for relative imports
            var module;
            var filename = path.join(fromDir, fromFile);
            module = this.requireCache[filename];
            if (!module) {
              module = new Module(filename);
              module.filename = filename;
              module.paths = Module._nodeModulePaths(path.dirname(filename));
            }
            var request = item.original || item.from;
            try {
              return {
                exports: module ? module.require(request) : require(request),
                path: item.from
              };
            } catch (e2) {
              if (e2.code == MODULE_NOT_FOUND) {
                throw e;
              }

              throw e2;
            }
          } else {
            throw e;
          }
        }
      };
    }