Sets all blocks in this chunk, using either a list or dictionary.  
        Blocks not explicitly set can be filled to air by setting fill_air to True.
771162
def set_blocks(self, list=None, dict=None, fill_air=False):
        
        if list:
            # Inputting a list like self.blocksList
            self.blocksList = list
        elif dict:
            # Inputting a dictionary like result of self.get_blocks_struct()
            list = []
            for x in range(16):
                for z in range(16):
                    for y in range(128):
                        coord = x,y,z
                        offset = y + z*128 + x*128*16
                        if (coord in dict):
                            list.append(dict[coord])
                        else:
                            if (self.blocksList[offset] and not fill_air):
                                list.append(self.blocksList[offset])
                            else:
                                list.append(0) # Air
            self.blocksList = list
        else:
            # None of the above...
            return False
        return True
482760
def _simple_blockify(tuples, dtype):
    
    values, placement = _stack_arrays(tuples, dtype)

    # CHECK DTYPE?
    if dtype is not None and values.dtype != dtype:  # pragma: no cover
        values = values.astype(dtype)

    block = make_block(values, placement=placement)
    return [block]
729428
def add_block(self, name):
        

        if not self.RE_NAME.match(name):
            raise ValueError(u"Invalid block name '{0}'"
                             .format(common.from_utf8(name)))

        if name in self._block_map:
            raise ValueError(u"Block '{0}' already exists"
                             .format(common.from_utf8(name)))

        # add new block and index mapping
        self._block_map[name] = len(self._ast[2])  # must come first
        option_list = []
        block = [name, option_list]
        self._ast[2].append(block)
1354748
def have_all_block_data(self):
        
        if not (self.num_blocks_received == self.num_blocks_requested):
            log.debug("num blocks received = %s, num requested = %s" % (self.num_blocks_received, self.num_blocks_requested))
            return False

        return True
139353
def _sparse_blockify(tuples, dtype=None):
    

    new_blocks = []
    for i, names, array in tuples:
        array = _maybe_to_sparse(array)
        block = make_block(array, placement=[i])
        new_blocks.append(block)

    return new_blocks
73191
def _reset(self):
        

        self._filename = None
        self._block_map = {}
        self._ast = []
        self._ast.append(None)  # header
        self._ast.append([])    # options list
        self._ast.append([])
857574
public void getSet(int which , FastQueue<Point2D_I32> list ) {
		list.reset();

		BlockIndexLength set = sets.get(which);

		for (int i = 0; i < set.length; i++) {
			int index = set.start + i*2;
			int blockIndex = set.block + index/blockLength;
			index %= blockLength;

			int block[] = blocks.get( blockIndex );
			list.grow().set( block[index] , block[index+1] );
		}
	}
222220
private static <S, L> void updateBlockReferences(Block<S, L> block) {
        UnorderedCollection<State<S, L>> states = block.getStates();
        for (ElementReference ref : states.references()) {
            State<S, L> state = states.get(ref);
            state.setBlockReference(ref);
            state.setBlock(block);
        }
    }
664867
def blocks(self, *args, **kwargs):
    
    return Stream(blocks(iter(self), *args, **kwargs))
66140
def set(self, locs, values):
        
        try:
            self.values[locs] = values
        except (ValueError):

            # broadcasting error
            # see GH6171
            new_shape = list(values.shape)
            new_shape[0] = len(self.items)
            self.values = np.empty(tuple(new_shape), dtype=self.dtype)
            self.values.fill(np.nan)
            self.values[locs] = values
1090219
def p_block_statements(self, p):
        ''
        p[0] = p[1] + (p[2],)
        p.set_lineno(0, p.lineno(1))
1007108
def set(cls, obj, keys, value, fill_list_value=None):
        
        current = obj
        keys_list = keys.split(".")

        for idx, key in enumerate(keys_list, 1):
            if type(current) == list:
                # Validate this key works with a list.
                try:
                    key = int(key)
                except ValueError:
                    raise cls.Missing(key)

            try:
                # This is the last key, so set the value.
                if idx == len(keys_list):
                    if type(current) == list:
                        safe_list_set(
                            current,
                            key,
                            lambda: copy.copy(fill_list_value),
                            value
                        )
                    else:
                        current[key] = value

                    # done.
                    return

                # More keys left, ensure we have a container for this key.
                if type(key) == int:
                    try:
                        current[key]
                    except IndexError:
                        # Create a list for this key.
                        cnext = container_for_key(keys_list[idx])
                        if type(cnext) == list:
                            def fill_with():
                                return []
                        else:
                            def fill_with():
                                return {}

                        safe_list_set(
                            current,
                            key,
                            fill_with,
                            [] if type(cnext) == list else {}
                        )
                else:
                    if key not in current:
                        # Create a list for this key.
                        current[key] = container_for_key(keys_list[idx])

                # Move on to the next key.
                current = current[key]
            except (IndexError, KeyError, TypeError):
                raise cls.Missing(key)
719450
def blocks(self, ignore_blank_lines=True):
        
        start, end = self.get_range(ignore_blank_lines=ignore_blank_lines)
        block = self._trigger.next()
        while block.blockNumber() <= end and block.isValid():
            yield block
            block = block.next()
1213160
public void addBlock(Block block)
    {
        try {
            this.stack.getFirst().add(block);
        } catch (NoSuchElementException e) {
            throw new IllegalStateException("All container blocks are closed, too many calls to endBlockList().");
        }
    }
1267724
def set_many(self, block, update_dict):
        """"""
        updated_dict = {}

        # Generate a new dict with the correct mappings.
        for (key, value) in six.iteritems(update_dict):
            updated_dict[self._key(block, key)] = value

        self._kvs.set_many(updated_dict)
779257
private void processBlock(List<GenericCriteria> list, byte[] block)
   {
      if (block != null)
      {
         if (MPPUtility.getShort(block, 0) > 0x3E6)
         {
            addCriteria(list, block);
         }
         else
         {
            switch (block[0])
            {
               case (byte) 0x0B:
               {
                  processBlock(list, getChildBlock(block));
                  break;
               }

               case (byte) 0x06:
               {
                  processBlock(list, getListNextBlock(block));
                  break;
               }

               case (byte) 0xED: // EQUALS
               {
                  addCriteria(list, block);
                  break;
               }

               case (byte) 0x19: // AND
               case (byte) 0x1B:
               {
                  addBlock(list, block, TestOperator.AND);
                  break;
               }

               case (byte) 0x1A: // OR
               case (byte) 0x1C:
               {
                  addBlock(list, block, TestOperator.OR);
                  break;
               }
            }
         }
      }
   }
348922
def block(self, *blocks, **kwargs) -> "CodeBlock":
        
        assert "name" not in kwargs
        kwargs.setdefault("code", self)
        code = CodeBlock(**kwargs)
        for block in blocks:
            if block is not None:
                code._blocks.append((0, block))
        return code