original_string: public function addNodes($nodes, $weight = 1)
      {
          foreach ($nodes as $node) {
              $this->_nodes[] = array('n' => $node, 'w' => $weight);
              $this->_nodeCount++;
  
              $nodeIndex = $this->_nodeCount - 1;
              $nodeString = serialize($node);
  
              $numberOfReplicas = (int)($weight * $this->_numberOfReplicas);
              for ($i = 0; $i < $numberOfReplicas; $i++) {
                  $this->_circle[$this->hash($nodeString . $i)] = $nodeIndex;
              }
          }
  
          $this->_updateCircle();
      }
code: public function addNodes($nodes, $weight = 1)
      {
          foreach ($nodes as $node) {
              $this->_nodes[] = array('n' => $node, 'w' => $weight);
              $this->_nodeCount++;
  
              $nodeIndex = $this->_nodeCount - 1;
              $nodeString = serialize($node);
  
              $numberOfReplicas = (int)($weight * $this->_numberOfReplicas);
              for ($i = 0; $i < $numberOfReplicas; $i++) {
                  $this->_circle[$this->hash($nodeString . $i)] = $nodeIndex;
              }
          }
  
          $this->_updateCircle();
      }
code_tokens: public function addNodes ( $ nodes , $ weight = 1 ) { foreach ( $ nodes as $ node ) { $ this -> _nodes [ ] = array ( 'n' => $ node , 'w' => $ weight ) ; $ this -> _nodeCount ++ ; $ nodeIndex = $ this -> _nodeCount - 1 ; $ nodeString = serialize ( $ node ) ; $ numberOfReplicas = ( int ) ( $ weight * $ this -> _numberOfReplicas ) ; for ( $ i = 0 ; $ i < $ numberOfReplicas ; $ i ++ ) { $ this -> _circle [ $ this -> hash ( $ nodeString . $ i ) ] = $ nodeIndex ; } } $ this -> _updateCircle ( ) ; }
docstring: Add multiple nodes to the hash with the same weight.
  
  @param array    $nodes   An array of nodes.
  @param integer  $weight  The weight to add the nodes with.
docstring_tokens: Add multiple nodes to the hash with the same weight .