Fast-forward past the BOM if present
335090
function() {
        var bomBuffer = this.read(bytesPerBom);
        if (bomBuffer == null || bomBuffer.length !== bytesPerBom) {
          status = 'error';
          processor.emit('processing.error', {
            file: filePath,
            message: 'Skipping file with errors during read: Unable to read past the expected BOM'
          });
          return callback(null, status);
        }
      }
43004
def rollforward(self, date):
        """"""
        if self.onOffset(date):
            return date
        else:
            return date + YearEnd(month=self.month)
1207108
private void updateNeigbor(Collection<Tile> resolved,
                               Collection<Tile> toResolve,
                               Tile tile,
                               Tile neighbor,
                               int ox,
                               int oy)
    {
        final String group = mapGroup.getGroup(tile);
        final String neighborGroup = mapGroup.getGroup(neighbor);

        final Transition transitionA = getTransition(tile, neighborGroup);
        final Transition transitionB = getTransition(neighbor, group);

        if (transitionA != null && transitionB != null)
        {
            final TransitionType transitionTypeA = transitionA.getType();
            final TransitionType transitionTypeB = transitionB.getType();

            final TransitionType newType = getTransition(transitionTypeA, transitionTypeB, ox, oy);
            if (newType != null)
            {
                final Transition newTransition = new Transition(newType, transitionA.getOut(), transitionB.getIn());
                updateTransition(resolved, toResolve, tile, neighbor, neighborGroup, newTransition);
            }
        }
    }
993636
function MoveNext()
	{
		if (!$this->EOF) {
			$this->_currentRow++;
			if ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {
				$this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);

				if (is_array($this->fields)) {
					if ($this->fields && isset($this->_blobArr)) $this->_fixblobs();
					return true;
				}
			}
			$this->fields = false;
			$this->EOF = true;
		}
		return false;
	}
1195346
def _walk(path, follow_links=False, maximum_depth=None):
    """"""
    root_level = path.rstrip(os.path.sep).count(os.path.sep)
    for root, dirs, files in os.walk(path, followlinks=follow_links):
        yield root, dirs, files
        if maximum_depth is None:
            continue

        if root_level + maximum_depth <= root.count(os.path.sep):
            del dirs[:]
244077
private IRichBolt maybeAddCheckpointTupleForwarder(IRichBolt bolt) {
        if (hasStatefulBolt && !(bolt instanceof StatefulBoltExecutor)) {
            bolt = new CheckpointTupleForwarder(bolt);
        }
        return bolt;
    }
1141249
protected function skipBOM()
    {
        rewind($this->fileHandle);

        switch ($this->inputEncoding) {
            case 'UTF-8':
                fgets($this->fileHandle, 4) == "\xEF\xBB\xBF" ?
                    fseek($this->fileHandle, 3) : fseek($this->fileHandle, 0);
                break;
            case 'UTF-16LE':
                fgets($this->fileHandle, 3) == "\xFF\xFE" ?
                    fseek($this->fileHandle, 2) : fseek($this->fileHandle, 0);
                break;
            case 'UTF-16BE':
                fgets($this->fileHandle, 3) == "\xFE\xFF" ?
                    fseek($this->fileHandle, 2) : fseek($this->fileHandle, 0);
                break;
            case 'UTF-32LE':
                fgets($this->fileHandle, 5) == "\xFF\xFE\x00\x00" ?
                    fseek($this->fileHandle, 4) : fseek($this->fileHandle, 0);
                break;
            case 'UTF-32BE':
                fgets($this->fileHandle, 5) == "\x00\x00\xFE\xFF" ?
                    fseek($this->fileHandle, 4) : fseek($this->fileHandle, 0);
                break;
            default:
                break;
        }
    }
862777
def forwards(self, orm):
        ""
        for a in orm.Article.objects.all():
            if a.updated:
                a.last_updated = a.updated
                a.save(force_update=True)
904655
private void switchToBackward() {
        assert((checkDir > 0 && seq == rawSeq) || (checkDir == 0 && pos == start));
        if(checkDir > 0) {
            // Turn around from forward checking.
            limit = segmentLimit = pos;
            if(pos == segmentStart) {
                start = rawStart;
                checkDir = -1;  // Check backward.
            } else {  // pos > segmentStart
                checkDir = 0;  // Stay in FCD segment.
            }
        } else {
            // Reached the start of the FCD segment.
            if(seq == rawSeq) {
                // The input text segment is FCD, extend it backward.
            } else {
                // The input text segment needed to be normalized.
                // Switch to checking backward from it.
                seq = rawSeq;
                pos = limit = segmentLimit = segmentStart;
            }
            start = rawStart;
            checkDir = -1;
        }
    }
234127
def goForward(self):
        
        if self._slideshow.currentIndex() == self._slideshow.count() - 1:
            self.finished.emit()
        else:
            self._slideshow.slideInNext()
180569
def forwards(self, orm):
        ""

        rows = db.execute("select distinct feature_type from content_content")
        for row in rows:
            feature_type = row[0]
            try:
                ft = orm.FeatureType.objects.get(slug=slugify(feature_type))
            except orm.FeatureType.DoesNotExist:
                ft = orm.FeatureType.objects.create(
                    name=feature_type,
                    slug=slugify(feature_type)
                )
            db.execute("update content_content set feature_type_id = %s where feature_type = %s", [ft.id, feature_type])
1296058
function toAbsolute(files, options) {
  var len = files.length;
  var idx = -1;
  var arr = [];

  while (++idx < len) {
    var file = files[idx];
    if (!file.trim()) continue;
    if (file && options.cwd) {
      file = path.resolve(options.cwd, file);
    }
    if (file && options.realpath === true) {
      file = follow(file);
    }
    if (file) {
      arr.push(file);
    }
  }
  return arr;
}
758648
async def next(self) -> Any:
        """"""
        # So, if we're at BOF, we need to skip till the boundary.
        if self._at_eof:
            return
        await self._maybe_release_last_part()
        if self._at_bof:
            await self._read_until_first_boundary()
            self._at_bof = False
        else:
            await self._read_boundary()
        if self._at_eof:  # we just read the last boundary, nothing to do there
            return
        self._last_part = await self.fetch_next_part()
        return self._last_part
615609
def backwards(self, orm):
        ""
        for c in orm["contenttypes.contenttype"].objects.all():
            if c.app_label == "dublincore":
                c.app_label = "DublinCore"
                c.save()
553093
private void ProcessNextStep() {

        switch (iSelectionStep) {

            case SELECT_SOURCE_CATALOG :
            case SELECT_DEST_CATALOG :
                if (CatalogToSelect()) {
                    fMain.show();

                    return;
                }
                break;

            case SELECT_DEST_SCHEMA :
            case SELECT_SOURCE_SCHEMA :
                if (SchemaToSelect()) {
                    fMain.show();

                    return;
                }
                break;

            case SELECT_SOURCE_TABLES :
                if (iTransferMode == TRFM_TRANSFER) {
                    bStart.setLabel("Start Transfer");
                } else if (iTransferMode == TRFM_DUMP) {
                    bStart.setLabel("Start Dump");
                } else if (iTransferMode == TRFM_RESTORE) {
                    bStart.setLabel("Start Restore");
                }

                bStart.invalidate();
                bStart.setEnabled(false);
                lTable.setMultipleMode(false);
                RefreshMainDisplay();
                break;

            default :
                break;
        }
    }
663216
def forwards(self, orm):
        ""
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        for entry_title in orm.NewsEntryTitle.objects.all():
            entry = NewsEntry.objects.get(pk=entry_title.entry.pk)
            entry.translate(entry_title.language)
            entry.title = entry_title.title
            entry.slug = entry_title.slug
            entry.is_published = entry_title.is_published
            entry.save()
1103670
def forwards(self, orm):
        ""
        orm.Project.objects.update(label=F('name'))
        orm.Cohort.objects.update(label=F('name'))
        orm.Sample.objects.update(name=F('label'))