Returns the block if nothing else if given and blocks are allowed to be
   values.
197106
def value_from_args(args, &block)
      return block if ChainOptions::Util.blank?(args) && block && allow_block

      flat_value(args)
    end
175042
private WyalFile.Stmt or(WyalFile.Stmt lhs, WyalFile.Stmt rhs) {
		if (lhs == null) {
			return rhs;
		} else if (rhs == null) {
			return rhs;
		} else {
			WyalFile.Stmt.Block lhsBlock = new WyalFile.Stmt.Block(lhs);
			WyalFile.Stmt.Block rhsBlock = new WyalFile.Stmt.Block(rhs);
			return new WyalFile.Stmt.CaseOf(lhsBlock, rhsBlock);
		}
	}
1235293
final bbBlock findBlockHelper(int pos, int lo, int hi)
    {
        bbBlock block;
        int     ii;
        if ((hi - lo) <= 3) {
            for (ii=lo; ii<hi; ii++) {
                block = this._blocks.get(ii);
                if (pos > block._offset + block._limit) continue;
                if (block.containsForRead(pos)) {
                    return block;
                }
                if (block._offset >= pos) break;
            }
            return this._blocks.get(ii - 1);    // this will always be > 0
        }
        int mid = (hi + lo) / 2;
        block = this._blocks.get(mid);
        assert block != null;
        if (block._offset > pos) {
            return findBlockHelper(pos, lo, mid);
        }
        return findBlockHelper(pos, mid, hi);
    }
315779
public static Tuple<Decl.Variable> determineModifiedVariables(Stmt.Block block) {
		HashSet<Decl.Variable> modified = new HashSet<>();
		determineModifiedVariables(block, modified);
		return new Tuple<>(modified);
	}
52168
public int getBlock() {
    if (DocumentLine_Type.featOkTst && ((DocumentLine_Type)jcasType).casFeat_block == null)
      jcasType.jcas.throwFeatMissing("block", "ch.epfl.bbp.uima.types.DocumentLine");
    return jcasType.ll_cas.ll_getIntValue(addr, ((DocumentLine_Type)jcasType).casFeatCode_block);}
719771
def get_nonmatching_blocks(matching_blocks):
    
    i = j = 0
    for match in matching_blocks:
        a, b, size = match
        yield (i, a, j, b)
        i = a + size
        j = b + size
466637
static boolean isEmptyBlock(Node block) {
    if (!block.isBlock()) {
      return false;
    }

    for (Node n = block.getFirstChild(); n != null; n = n.getNext()) {
      if (!n.isEmpty()) {
        return false;
      }
    }
    return true;
  }
1082602
function checkForBlock(node) {
            const scope = context.getScope();

            /*
             * In ES5, some node type such as `BlockStatement` doesn't have that scope.
             * `scope.block` is a different node in such a case.
             */
            if (scope.block === node) {
                findVariablesInScope(scope);
            }
        }
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]
987943
def tryCondition(self, block):
        
        currentBlock = self._prevNonEmptyBlock(block)
        if not currentBlock.isValid():
            return None

        # found non-empty line
        currentText = currentBlock.text()
        if currentText.rstrip().endswith(';') and \
           re.search(r'^\s*(if\b|[}]?\s*else|do\b|while\b|for)', currentText) is None:
            # idea: we had something like:
            #   if/while/for (expression)
            #       statement();  <-- we catch this trailing ';'
            # Now, look for a line that starts with if/for/while, that has one
            # indent level less.
            currentIndentation = self._lineIndent(currentText)
            if not currentIndentation:
                return None

            for block in self.iterateBlocksBackFrom(currentBlock.previous()):
                if block.text().strip(): # not empty
                    indentation = self._blockIndent(block)

                    if len(indentation) < len(currentIndentation):
                        if re.search(r'^\s*(if\b|[}]?\s*else|do\b|while\b|for)[^{]*$', block.text()) is not None:
                            dbg("tryCondition: success in line %d" % block.blockNumber())
                            return indentation
                        break

        return None
1089676
def maybe(&block)
      if (result = block.call).nil?
        Data::Nothing.new
      else
        Data::Just.new(result)
      end
    end
694617
function getCurrentItem(opts: Options, value: Value, block?: Block): ?Block {
    const { document } = value;

    if (!block) {
        if (!value.selection.startKey) return null;
        block = value.startBlock;
    }

    const parent = document.getParent(block.key);
    return parent && parent.type === opts.typeItem ? parent : null;
}
773100
def _parse_block(self):
        """"""
        if self._iter_rows is not None:
            return

        rows = _avro_rows(self._block, self._avro_schema)
        self._num_items = self._block.avro_rows.row_count
        self._remaining = self._block.avro_rows.row_count
        self._iter_rows = iter(rows)
846929
def select!
      if block_given?
        return_nil = true
        @data.each do |k,v|
          unless yield(k,v)
            @data.delete(k)
            return_nil = false
          end
        end
        return nil if return_nil
      end
      self
    end
519787
def get(self, block_alias, context):
        """"""
        contents = []

        dynamic_block_contents = self.get_contents_dynamic(block_alias, context)
        if dynamic_block_contents:
            contents.append(dynamic_block_contents)

        static_block_contents = self.get_contents_static(block_alias, context)
        if static_block_contents:
            contents.append(static_block_contents)

        if not contents:
            return ''

        return choice(contents)
851912
def assert_either_value_or_block(value, block)
      if value.nil? && block.nil?
        raise ArgumentError, 'Need to set either value or block'
      elsif !(value.nil? || block.nil?)
        raise ArgumentError, "Can't set both value and block"
      end
    end
365116
def if_state(*expected_states)
      mutex.lock
      raise ArgumentError, 'no block given' unless block_given?

      if expected_states.include? @state
        yield
      else
        false
      end
    ensure
      mutex.unlock
    end