make sure thresh % feature is contained within insertion
325789
def check_overlap(pos, ins, thresh):
    
    ins_pos = ins[0]
    ins_len = ins[2]
    ol = overlap(ins_pos, pos)
    feat_len = pos[1] - pos[0] + 1
#    print float(ol) / float(feat_len)
    if float(ol) / float(feat_len) >= thresh:
        return True
    return False
183255
function ensureTimestamps(columns, allowSyncedAt) {
  var now = Date.now();
  if (!allowSyncedAt || !columns.syncedAt) {
    columns.syncedAt = now;
  }
  if (!columns.createdAt) {
    // Take the value from the client, if present:
    columns.createdAt = columns.updatedAt;
  }
}
1237486
function insertFormattedLineBreak(cursor) {
	const indent = cursor.editor.getTabText();
	const lineIndent = getLineIndent(cursor);

	cursor.selection.insertText(`\n${lineIndent}${indent}\n${lineIndent}`, { autoIndent: false });

	// Put caret at the end of indented newline
	cursor.moveUp();
	cursor.moveToEndOfLine();
}
1267799
def forced_insert(self):
        
        # If we have any tokens we are waiting for
        if self.insert_till:
            # Determine where to append this token
            append_at = -1
            if self.inserted_line:
                append_at = -self.inserted_line+1

            # Reset insert_till if we found it
            if self.current.tokenum == self.insert_till[0] and self.current.value == self.insert_till[1]:
                self.insert_till = None
            else:
                # Adjust self.adjust_indent_at to take into account the new token
                for index, value in enumerate(self.adjust_indent_at):
                    if value < len(self.result) - append_at:
                        self.adjust_indent_at[index] = value + 1

                # Insert the new token
                self.result.insert(append_at, (self.current.tokenum, self.current.value))

            # We appended the token
            return True
590049
private void checkTypeDepth(Feature feature, Class<?> current)
    {
        for (final Class<?> type : current.getInterfaces())
        {
            if (type.isAnnotationPresent(FeatureInterface.class))
            {
                final Feature old;
                // CHECKSTYLE IGNORE LINE: InnerAssignment
                if ((old = typeToFeature.put(type.asSubclass(Feature.class), feature)) != null)
                {
                    throw new LionEngineException(ERROR_FEATURE_EXISTS
                                                  + feature.getClass()
                                                  + AS
                                                  + type
                                                  + WITH
                                                  + old.getClass());
                }
                checkTypeDepth(feature, type);
            }
        }
        final Class<?> parent = current.getSuperclass();
        if (parent != null)
        {
            checkTypeDepth(feature, parent);
        }
    }
1083149
def prepareInsert(self, oself, store):
        
        if self.relative:
            fspath = self.__get__(oself)
            oself.__dirty__[self.attrname] = self, self.infilter(fspath, oself, store)
522579
public void updateAfterInsert(Suffix<T, S> suffix) {
        if (activeNode == root && suffix.isEmpty()) {
            activeNode = root;
            activeEdge = null;
            activeLength = 0;
        } else if (activeNode == root) {
            Object item = suffix.getStart();
            activeEdge = root.getEdgeStarting(item);
            decrementLength();
            fixActiveEdgeAfterSuffixLink(suffix);
            if (activeLength == 0)
                activeEdge = null;
        } else if (activeNode.hasSuffixLink()) {
            activeNode = activeNode.getSuffixLink();
            findTrueActiveEdge();
            fixActiveEdgeAfterSuffixLink(suffix);
            if (activeLength == 0)
                activeEdge = null;
        } else {
            activeNode = root;
            findTrueActiveEdge();
            fixActiveEdgeAfterSuffixLink(suffix);
            if (activeLength == 0)
                activeEdge = null;
        }
    }
349186
function insertAt(items, item, index) {
  var copy = items.slice();
  copy.splice(index, 0, item);
  return copy;
}
392298
def enriched(self, thresh=0.05, idx=True):
        
        return self.upregulated(thresh=thresh, idx=idx)
436488
def _insertNewBlock(self):
        
        cursor = self.textCursor()
        atStartOfLine = cursor.positionInBlock() == 0
        with self:
            cursor.insertBlock()
            if not atStartOfLine:  # if whole line is moved down - just leave it as is
                self._indenter.autoIndentBlock(cursor.block())
        self.ensureCursorVisible()
1185227
def _readline_insert(self, char, echo, insptr, line):
        """"""
        if not self._readline_do_echo(echo):
            return
        # Write out the remainder of the line
        self.write(char + ''.join(line[insptr:]))
        # Cursor Left to the current insert point
        char_count = len(line) - insptr
        self.write(self.CODES['CSRLEFT'] * char_count)
348228
def _ensure_insert(self, new_items, insert_to):
        
        insert_to = insert_to or []
        insert_to.insert(0, new_items)
        return insert_to
813868
def confirm_push(self, coord, version):
    """"""
    if not self.get_options().prompt:
      return True
    try:
      isatty = os.isatty(sys.stdin.fileno())
    except ValueError:
      # In tests, sys.stdin might not have a fileno
      isatty = False
    if not isatty:
      return True
    push = input('\nPublish {} with revision {} ? [y|N] '.format(
      coord, version
    ))
    print('\n')
    return push.strip().lower() == 'y'
1263859
public boolean insertIntoTheCurrentSlot() {
		if (!getVal(currentPos(), INTEGER).equals(EMPTY_CONST))
			return false;
		
		setVal(currentPos(), INUSE_CONST);
		return true;
	}
941721
def insert_text_to(cursor, text, fmt):
    """"""
    while True:
        index = text.find(chr(8))  # backspace
        if index == -1:
            break
        cursor.insertText(text[:index], fmt)
        if cursor.positionInBlock() > 0:
            cursor.deletePreviousChar()
        text = text[index+1:]
    cursor.insertText(text, fmt)
229818
def push(**kwargs):
  '''  '''

  output, err = cli_syncthing_adapter.refresh(**kwargs)

  if output:
    click.echo("%s" % output, err=err)

  if kwargs['verbose'] and not err:
    with click.progressbar(
      iterable=None,
      length=100,
      label='Synchronizing') as bar:

      device_num = 0
      max_devices = 1
      prev_percent = 0

      while True:
        kwargs['progress'] = True
        kwargs['device_num'] = device_num
        data, err = cli_syncthing_adapter.refresh(**kwargs)

        device_num = data['device_num']
        max_devices = data['max_devices']

        cur_percent = math.floor(data['percent']) - prev_percent
        if cur_percent > 0:
          bar.update(cur_percent)
          prev_percent = math.floor(data['percent'])

        if device_num < max_devices:
          time.sleep(0.5)
        else:
          break
1159980
def get_info(line, bit_thresh):
    
    if len(line) >= 18: # output is from cmsearch
        id, model, bit, inc = line[0].split()[0], line[2], float(line[14]), line[16]
        sstart, send, strand = int(line[7]), int(line[8]), line[9]
        mstart, mend = int(line[5]), int(line[6])
    elif len(line) == 9: # output is from ssu-cmsearch
        if bit_thresh == 0:
            print('# ssu-cmsearch does not include a model-specific inclusion threshold, ', file=sys.stderr)
            print('# please specify a bit score threshold', file=sys.stderr)
            exit()
        id, model, bit = line[1].split()[0], line[0], float(line[6])
        inc = '!' # this is not a feature of ssu-cmsearch
        sstart, send = int(line[2]), int(line[3])
        mstart, mend = int(4), int(5)
        if send >= sstart:
            strand = '+'
        else:
            strand = '-'
    else:
        print('# unsupported hmm format:', file=sys.stderr)
        print('# provide tabular output from ssu-cmsearch and cmsearch supported', file=sys.stderr)
        exit()
    coords = [sstart, send]
    sstart, send = min(coords), max(coords)
    mcoords = [mstart, mend]
    mstart, mend = min(mcoords), max(mcoords)
    return id, model, bit, sstart, send, mstart, mend, strand, inc