Return the character that should be used to fill between blocks
    having a given status
163258
def get_fill_char( maf_status ):
    
    ## assert maf_status not in ( maf.MAF_CONTIG_NESTED_STATUS, maf.MAF_NEW_NESTED_STATUS, 
    ##                            maf.MAF_MAYBE_NEW_NESTED_STATUS ), \
    ##     "Nested rows do not make sense in a single coverage MAF (or do they?)"
    if maf_status in ( maf.MAF_NEW_STATUS, maf.MAF_MAYBE_NEW_STATUS, 
                       maf.MAF_NEW_NESTED_STATUS, maf.MAF_MAYBE_NEW_NESTED_STATUS ):
        return "*"
    elif maf_status in ( maf.MAF_INVERSE_STATUS, maf.MAF_INSERT_STATUS ):
        return "="
    elif maf_status in ( maf.MAF_CONTIG_STATUS, maf.MAF_CONTIG_NESTED_STATUS ):
        return "#"
    elif maf_status == maf.MAF_MISSING_STATUS:
        return "X"
    else:
        raise ValueError("Unknwon maf status")
423379
function updateStatus(runCount, totalRuns, stream) {
  if (runCount % 10 !== 0) return;

  const percent = Math.floor((runCount / totalRuns) * 100);
  const blocks = Math.floor(percent / 2);
  const empty = 50 - blocks;
  const value =
    '|'
    + '\u2588'.repeat(blocks)
    + '\u2591'.repeat(empty)
    + '| '
    + percent.toString()
    + '% || '
    + runCount.toString()
    + ' / '
    + totalRuns.toString();

  readline.cursorTo(stream, 0, null);
  stream.write(value);

  if (percent === 100) stream.write('\n\n');
}
1062097
def status(self):
        """"""
        return {self._acronym_status(l): l for l in self.resp_text.split('\n')
                if l.startswith(self.prefix_status)}
122413
function( status, node ) {
        if ( typeof status !== 'object' ) status = {fill: 'grey', shape: 'ring', text: status}

        node.status(status)
    }
1225682
private static int getBlockLength(String text, int offset)
   {
      int startIndex = offset;
      boolean finished = false;
      char c;

      while (finished == false)
      {
         c = text.charAt(offset);
         switch (c)
         {
            case '\r':
            case '\n':
            case '}':
            {
               finished = true;
               break;
            }

            default:
            {
               ++offset;
               break;
            }
         }
      }

      int length = offset - startIndex;

      return (length);
   }
348555
function tokenizeAnnotatedBlockquote(eat, value, silent) {
    var self = this;
    var offsets = self.offset;
    var tokenizers = self.blockTokenizers;
    var interruptors = self.interruptBlockquote;
    var now = eat.now();
    var currentLine = now.line;
    var length = value.length;
    var values = [];
    var contents = [];
    var indents = [];
    var add;
    var index = 0;
    var character;
    var rest;
    var nextIndex;
    var content;
    var line;
    var startIndex;
    var prefixed;
    var exit;
    var blockType;

    while (index < length) {
        character = value.charAt(index);

        if (
            character !== space &&
            character !== tab &&
            !character.match(/[A-Z]/)
        ) {
            break;
        }

        // store the block type
        if (character.match(/[A-Z]/)) {
            switch (character) {
                case "A":
                    blockType = "aside";
                    break;
                case "W":
                    blockType = "warning";
                    break;
                case "T":
                    blockType = "tip";
                    break;
                case "E":
                    blockType = "error";
                    break;
                case "I":
                    blockType = "information";
                    break;
                case "Q":
                    blockType = "questions";
                    break;
                case "D":
                    blockType = "discussions";
                    break;
                case "X":
                    blockType = "exercises";
                    break;
                default:
                    blockType = "generic";
            }
        }

        index++;
    }

    if (value.charAt(index) !== greaterThan) {
        return;
    }

    if (silent) {
        return true;
    }

    index = 0;

    while (index < length) {
        nextIndex = value.indexOf(lineFeed, index);
        startIndex = index;
        prefixed = false;

        if (nextIndex === -1) {
            nextIndex = length;
        }

        while (index < length) {
            character = value.charAt(index);

            if (
                character !== space &&
                character !== tab &&
                !character.match(/[A-Z]/)
            ) {
                break;
            }

            index++;
        }

        if (value.charAt(index) === greaterThan) {
            index++;
            prefixed = true;

            if (value.charAt(index) === space) {
                index++;
            }
        } else {
            index = startIndex;
        }

        content = value.slice(index, nextIndex);

        if (!prefixed && !trim(content)) {
            index = startIndex;
            break;
        }

        if (!prefixed) {
            rest = value.slice(index);

            // Check if the following code contains a possible block.
            if (interrupt(interruptors, tokenizers, self, [eat, rest, true])) {
                break;
            }
        }

        line =
            startIndex === index ? content : value.slice(startIndex, nextIndex);

        indents.push(index - startIndex);
        values.push(line);
        contents.push(content);

        index = nextIndex + 1;
    }

    index = -1;
    length = indents.length;
    add = eat(values.join(lineFeed));

    while (++index < length) {
        offsets[currentLine] = (offsets[currentLine] || 0) + indents[index];
        currentLine++;
    }

    exit = self.enterBlock();
    contents = self.tokenizeBlock(contents.join(lineFeed), now);
    exit();

    return add({
        type: "blockquote",
        blockType: blockType,
        children: contents
    });
}
729491
def writeBlock(pieceIndex, offset, block)
      id = returnAndIncrRequestId
      return id if @state == :after_stop
      @requests.push [id, :write_block, pieceIndex, offset, block]
      @requestsSemaphore.signal
      id
    end
1275897
def get_block(self, namespace, offset, key):
        """"""
        cursor = self.cursor
        cursor.execute('SELECT data, flags FROM gauged_data '
                       'WHERE namespace = %s AND "offset" = %s AND key = %s',
                       (namespace, offset, key))
        row = cursor.fetchone()
        return (None, None) if row is None else row
789697
def _findMatchingBracket(self, bracket, qpart, block, columnIndex):
        
        if bracket in self._START_BRACKETS:
            charsGenerator = self._iterateDocumentCharsForward(block, columnIndex + 1)
        else:
            charsGenerator = self._iterateDocumentCharsBackward(block, columnIndex)

        depth = 1
        oposite = self._OPOSITE_BRACKET[bracket]
        for block, columnIndex, char in charsGenerator:
            if qpart.isCode(block, columnIndex):
                if char == oposite:
                    depth -= 1
                    if depth == 0:
                        return block, columnIndex
                elif char == bracket:
                    depth += 1
        else:
            return None, None
513992
def highlightBlock(self, text):
        
        # Note that an undefined blockstate is equal to -1, so the first block
        # will have the correct behaviour of starting at 0.
        if self._allow_highlight:
            start = self.previousBlockState() + 1
            end = start + len(text)
            for i, (fmt, letter) in enumerate(self._charlist[start:end]):
                self.setFormat(i, 1, fmt)
            self.setCurrentBlockState(end)
            self.highlight_spaces(text)
901961
def computeSmartIndent(self, block, ch):
        
        if re.search(r'^\s*;;;', block.text()):
            return ''
        elif re.search(r'^\s*;;', block.text()):
            #try to align with the next line
            nextBlock = self._nextNonEmptyBlock(block)
            if nextBlock.isValid():
                return self._blockIndent(nextBlock)

        try:
            foundBlock, foundColumn = self.findBracketBackward(block, 0, '(')
        except ValueError:
            return ''
        else:
            return self._increaseIndent(self._blockIndent(foundBlock))
1145490
def _get_block(self):
    """"""
    b = self._fh.read(4) # get block size bytes
    #print self._fh.tell()
    if not b: raise StopIteration
    block_size = struct.unpack('<i',b)[0]
    return self._fh.read(block_size)
445395
function getBlockIncreaseFromName(methodName) {
  const matchNumbers = String(methodName).match(/_increaseBlockBy(\d+)/);

  if (matchNumbers !== null
    && typeof matchNumbers[1] === 'string') {
    return parseInt(matchNumbers[1], 10);
  }

  return 0;
}
708473
JCBlock block(int pos, long flags) {
        accept(LBRACE);
        List<JCStatement> stats = blockStatements();
        JCBlock t = F.at(pos).Block(flags, stats);
        while (token.kind == CASE || token.kind == DEFAULT) {
            syntaxError("orphaned", token.kind);
            switchBlockStatementGroups();
        }
        // the Block node has a field "endpos" for first char of last token, which is
        // usually but not necessarily the last char of the last token.
        t.endpos = token.pos;
        accept(RBRACE);
        return toP(t);
    }
143807
def get_fixed_block(self, keys=[], unbuffered=False):
        """"""
        if unbuffered or not self._fixed_block:
            self._fixed_block = self._read_fixed_block()
        format = self.fixed_format
        # navigate down list of keys to get to wanted data
        for key in keys:
            format = format[key]
        return _decode(self._fixed_block, format)
714478
function statusToText(status) {
          var words = [];

          if (status.index=='A') {
            words.push({
              code: 'A',
              color: '#00b111',
              title: 'Added'
            });
          }

          if (status.index=='M') {
            words.push({
              code: 'M',
              color: '#9000b1',
              title: 'Modified'
            });
          }

          if (status.index=='R') {
            words.push({
              code: 'R',
              color: '#0065b1',
              title: 'Renamed'
            });
          }

          if (status.index=='!') {
            words.push({
              code: 'I',
              color: '#b16d00',
              title: 'Ignored'
            });
          }

          if (status.index=='C') {
            words.push({
              code: 'C',
              color: '#b16d00',
              title: 'Copied'
            });
          }

          if (status.index==' ') {
            words.push({
              code: ' ',
              color: '#b16d00',
              title: 'Unmodified'
            });
          }

          if (status.index=='D') {
            words.push({
              code: 'D',
              color: '#de2d00',
              title: 'Deleted'
            });
          }

          return words;
        }
258438
def block(self):
        
        if (self.is_actinoid or self.is_lanthanoid) and self.Z not in [71, 103]:
            return "f"
        elif self.is_actinoid or self.is_lanthanoid:
            return "d"
        elif self.group in [1, 2]:
            return "s"
        elif self.group in range(13, 19):
            return "p"
        elif self.group in range(3, 13):
            return "d"
        raise ValueError("unable to determine block")