Initialize inputs patch and report success

 === Parameters
 node(ChefNode):: Chef node used to converge, can be nil (patch is empty in this case)

 === Return
 true:: Always return true
10750
def report_success(node)
      ChefState.merge_attributes(node.normal_attrs) if node
      remove_right_script_params_from_chef_state
      patch = ::RightSupport::Data::HashTools.deep_create_patch(@inputs, ChefState.attributes)
      # We don't want to send back new attributes (ohai etc.)
      patch[:right_only] = { }
      @inputs_patch      = patch
      EM.next_tick { succeed }
      true
    end
1310861
def nodes_changed?(new_nodes)
      return true if address_for(@master) != new_nodes[:master]
      return true if different?(addresses_for(@slaves), new_nodes[:slaves])
      false
    end
1037065
def node
      runner = self
      @node ||= begin
        apply_chef_config!
        client.build_node.tap do |node|
          node.define_singleton_method(:runner) { runner }
        end
      end
    end
356655
def is_loop_helper(node):
    
    return hasattr(node, 'node') and isinstance(node.node, nodes.Name) and node.node.name == 'loop'
940708
private boolean nodeOk( GridNode node ) {
        return node != null && !assignedFlowsMap.isMarked(node.col, node.row);
    }
604681
def node_input():
    
    try:
        node = int(raw_input("Node id: "))
    except ValueError:
        node = INVALID_NODE
        print 'invalid node id: %s' % node
    return node
738246
def add_node(self, node):
        
        if node.id in self.nodes:
            del self.nodes[node.id]
            self.nodes[node.id] = node
        elif len(self) < self.ksize:
            self.nodes[node.id] = node
        else:
            if node.id in self.replacement_nodes:
                del self.replacement_nodes[node.id]
            self.replacement_nodes[node.id] = node
            return False
        return True
775630
def find_recipe(cookbook, recipe_name = nil)
      recipes = cookbook.recipe_filenames_by_name
      if recipe_name.nil?
        default_recipe = recipes["default"]
        raise NoDefaultRecipe.new(cookbook.root_dir, cookbook.name) if default_recipe.nil?
        default_recipe
      else
        recipe = recipes[recipe_name]
        raise RecipeNotFound.new(cookbook.root_dir, recipe_name, recipes.keys, cookbook.name) if recipe.nil?
        recipe
      end
    end
591932
def setInputNode(self, node):
        
        # if the node already matches the current input node, ignore
        if self._inputNode == node:
            return

        # disconnect from the existing node
        self.disconnectSignals(self._inputNode)

        # store the node
        self._inputNode = node

        # connect to the new node
        self.connectSignals(self._inputNode)

        # force the rebuilding of the path
        self.setPath(self.rebuild())
708490
function Node(config) {
    RED.nodes.createNode(this,config);
    var node = this,
      message = '';

    this.on('input', function (msg) {
      node.status({});

      payloadCheck(msg)
      .then(function(){
        return wordcountCheck(msg, config);
      })
      .then(function(){
        return credentialsCheck(node);
      })
      .then(function(){
        return setEndPoint(config);
      })
      .then(function(){
        return prepareParams(msg, config);
      })
      .then(function(params){

        node.status({fill:'blue', shape:'dot', text:'requesting'});
        return executeService(msg, params);
      })
      .then(function(){
        node.status({});
        node.send(msg);
      })
      .catch(function(err){
        payloadutils.reportError(node, msg, err);
        node.send(msg);
      });
    });
  }
392605
private static void initializeNode(Element node) {
        node.attr(CONTENT_SCORE, Integer.toString(0));

        String tagName = node.tagName();
        if ("div".equalsIgnoreCase(tagName)) {
            incrementContentScore(node, 5);
        } else if ("pre".equalsIgnoreCase(tagName)
                || "td".equalsIgnoreCase(tagName)
                || "blockquote".equalsIgnoreCase(tagName)) {
            incrementContentScore(node, 3);
        } else if ("address".equalsIgnoreCase(tagName)
                || "ol".equalsIgnoreCase(tagName)
                || "ul".equalsIgnoreCase(tagName)
                || "dl".equalsIgnoreCase(tagName)
                || "dd".equalsIgnoreCase(tagName)
                || "dt".equalsIgnoreCase(tagName)
                || "li".equalsIgnoreCase(tagName)
                || "form".equalsIgnoreCase(tagName)) {
            incrementContentScore(node, -3);
        } else if ("h1".equalsIgnoreCase(tagName)
                || "h2".equalsIgnoreCase(tagName)
                || "h3".equalsIgnoreCase(tagName)
                || "h4".equalsIgnoreCase(tagName)
                || "h5".equalsIgnoreCase(tagName)
                || "h6".equalsIgnoreCase(tagName)
                || "th".equalsIgnoreCase(tagName)) {
            incrementContentScore(node, -5);
        }

        incrementContentScore(node, getClassWeight(node));
    }
301615
def _do(self, nodes):
        
        if not isinstance(nodes, dict):
            raise TypeError('"nodes" must be a dictionary')

        if not nodes:
            # we're done!
            return
        starting_num_nodes = len(nodes)
        newly_instantiated = set()

        # Instantiate services with an empty dependency set
        for (name, dependency_set) in six.iteritems(nodes):
            if dependency_set:
                # Skip non-empty dependency sets
                continue

            # Instantiate
            config = self._config[name]
            service = self._factory.create_from_dict(config)
            self._factory.add_instantiated_service(name, service)

            newly_instantiated.add(name)

        # We ALWAYS should have instantiated a new service
        # or we'll end up in an infinite loop.
        if not newly_instantiated:
            raise Exception('No newly instantiated services')

        # Remove from Nodes
        for name in newly_instantiated:
            del nodes[name]

        # Check if the number of nodes have changed
        # to prevent infinite loops.
        # We should ALWAYS have removed a node.
        if starting_num_nodes == len(nodes):
            raise Exception('No nodes removed!')

        # Remove newly instantiated services from dependency sets
        for (name, dependency_set) in six.iteritems(nodes):
            nodes[name] = dependency_set.difference(newly_instantiated)

        # Recursion is recursion is ...
        self._do(nodes)
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);
    });
  }
345409
def send_inputs_patch(sequence)
      if has_default_thread?
        begin
          cmd = { :name => :set_inputs_patch, :patch => sequence.inputs_patch }
          @client.send_command(cmd)
        rescue Exception => e
          fail('Failed to update inputs', Log.format("Failed to apply inputs patch after execution", e, :trace))
        end
      end
      true
    ensure
      stop
    end
369563
def match_node(node,expected,label)
        
        #check type 
        if !check_type(node,expected['type'],label,expected['ok_empty'])
          @errors.push('Error: node ' + label + ' is not of an accepted type. Should be one of ' + expected['accepts'].join(', '))
          return false
        end
        
        if (node.kind_of?(Hash) || node.kind_of?(Array))
          
          if node.empty? && !expected['ok_empty']
            @errors.push('Error: node ' + label + ' cannot be empty')
            return false
          elsif !node.empty? && expected.has_key?('accepts')
            valid_content = false
            
            if node.kind_of?(Hash)
              matched = []
              unmatched = []
              node.each_pair{
                |key,value|
                
                expected['accepts'].each{
                  |accepts|
                     
                  result = check_type(value,accepts,key)
                  
                  if result
                    matched.push(key)
                    if !unmatched.find_index(key).nil?
                      unmatched.slice(unmatched.find_index(key))
                    end
                    break
                  else
                    unmatched.push(key)
                  end
                 
                }
                
              }
                   
              if(matched.count==node.count)
                valid_content = true
               else
                unmatched.each{
                  |node|
                  
                  @errors.push('Error: node ' + node + ' is not of an accepted type. Should be one of ' + expected['accepts'].join(', '))
                }
              end
              
            elsif node.kind_of?(Array)
              matched = []
              unmatched = []
              node.each_index{
                |n|
                
                expected['accepts'].each{
                  |accepts|
                  
                  key = label + '[' + n.to_s + ']'
                  result = check_type(node[n],accepts,key)
                  
                  if result
                    
                    matched.push(key)
                    if !unmatched.find_index(key).nil?
                      unmatched.slice(unmatched.find_index(key))
                    end
                    break
                  else
                    unmatched.push(key)
                  end
                  
                }
              }
              
              if(matched.count==node.count)
                valid_content = true
              else
                unmatched.each{
                  |node|
                  
                  @errors.push('Error: node ' + node + ' is not of an accepted type. Should be one of ' + expected['accepts'].join(', '))
                }
              end
            
            end
            
            if !valid_content
              @errors.push('Error: node ' + label + ' contains an unaccepted type.')
              return false
            end
         end
         
        end
       
        return true
                
      end
574487
def _check_node_consistency(self):
        
        # Get list of nodes from the node attributes dict
        nodes_from_attributes = set(self._node_attributes.keys())

        # Get list of hyperedge_ids from the hyperedge attributes dict
        hyperedge_ids_from_attributes = set(self._hyperedge_attributes.keys())

        # Check 5.1: all nodes in the forward star must be in the
        # nodes from attributes
        forward_diff = set(self._forward_star.keys()) - nodes_from_attributes
        if forward_diff != set():
            raise ValueError(
                'Consistency Check 5.1 Failed: nodes %s ' % forward_diff +
                '(from forward star keys) is not in the node ' +
                'attribute dict.')

        # Check 5.2: all nodes in the backward star must be in the
        # nodes from attributes
        backward_diff = set(self._backward_star.keys()) - nodes_from_attributes
        if backward_diff != set():
            raise ValueError(
                'Consistency Check 5.2 Failed: node %s ' % backward_diff +
                '(from backward star keys) is not in the node ' +
                'attribute dict.')

        # Note that, by Check 5.1 and 5.2, self._forward_star.keys() =
        # self._backward_star.keys().

        # Check 5.3: all nodes in hyperedge_attributes dictionary must
        # be in the nodes from attributes.
        for hyperedge_id in hyperedge_ids_from_attributes:
            for tailnode in \
                    self._hyperedge_attributes[hyperedge_id]['tail']:
                if tailnode not in nodes_from_attributes:
                    raise ValueError(
                        'Consistency Check 5.3.1 Failed: tail ' +
                        'node %s of ' % tailnode +
                        'of hyperedge id %s ' % hyperedge_id +
                        'is not in node attribute dict')

            for headnode in self._hyperedge_attributes[hyperedge_id]['head']:
                if headnode not in nodes_from_attributes:
                    raise ValueError(
                        'Consistency Check 5.3.2 Failed: head ' +
                        'node %s of ' % headnode +
                        'of hyperedge id %s ' % hyperedge_id +
                        'is not in node attribute dict')

        # get set of nodes in predecessor dictionary.
        # adds both nodes in headset and nodes in tailset.
        nodes_in_predecessor_dict = set()
        for headset in self._predecessors.keys():
            nodes_in_predecessor_dict.update(headset)
            for tailset in self._predecessors[headset].keys():
                nodes_in_predecessor_dict.update(tailset)

        # get set of nodes in successor dictionary.
        # adds both nodes in headset and nodes in tailset.
        nodes_in_successor_dict = set()
        for headset in self._successors.keys():
            nodes_in_successor_dict.update(headset)
            for tailset in self._successors[headset].keys():
                nodes_in_successor_dict.update(tailset)

        # Check 5.4: the set of nodes in successor dict is the same as
        # the set of nodes in the predecessor dict
        if nodes_in_predecessor_dict != nodes_in_successor_dict:
            raise ValueError(
                'Consistency Check 5.4 Failed: nodes in ' +
                'successor dict are different than nodes ' +
                'in predecessor dict')

        # Check 5.5: all nodes in predecessor and successor dict must
        # be in the nodes from attributes (since 5.4 ensures they're the same)
        for node in nodes_in_predecessor_dict:
            if node not in nodes_from_attributes:
                raise ValueError(
                    'Consistency Check 5.5 Failed: node %s ' % node +
                    'from predecessor or successor dictionary ' +
                    'is not in node attribute dict')
627282
protected void initNode() {
        /**
         * quick fix for integration tests. if hosts property set to "embedded" then a local node is start.
         * maven dependencies need to be defined correctly for this to work
         */
        ClassLoader cl = Thread.currentThread().getContextClassLoader();

        try {
            // Need to use the classloader for Elasticsearch to pick up the property files when
            // running in an OSGi environment
            Thread.currentThread().setContextClassLoader(TransportClient.class.getClassLoader());

            final Properties properties = new Properties();
            try {
                InputStream stream = null;

                if (System.getProperties().containsKey("jboss.server.config.dir")) {
                    File file = new File(System.getProperty("jboss.server.config.dir") + File.separatorChar +
                            HAWKULAR_ELASTICSEARCH_PROPERTIES);
                    stream = new FileInputStream(file);
                } else {
                    stream = this.getClass().getResourceAsStream(File.separatorChar +
                                    HAWKULAR_ELASTICSEARCH_PROPERTIES);
                }
                properties.load(stream);
                stream.close();
            } catch (IOException e) {
                log.log(Level.SEVERE, "Failed to load elasticsearch properties", e);
            }

            node = NodeBuilder.nodeBuilder()
                    .settings(ImmutableSettings.settingsBuilder()
                            .put(properties)).node();

            node.start();
            client = node.client();
        } finally {
            Thread.currentThread().setContextClassLoader(cl);
        }

        if (log.isLoggable(Level.FINEST)) {
            log.finest("Initialized Elasticsearch node=" + node + " client=" + client);
        }
    }