text:
package com.artemis.system;

import org.junit.Assert;
import org.junit.Test;

import com.artemis.World;
import com.artemis.annotations.Profile;
import com.artemis.util.SimpleProfiler;

@SuppressWarnings("static-method")
public class ProfiledSystemsTest {

	@Test
	public void plain_profiled_system_invoked_during_process() {
		World world = new World();
		world.setSystem(new ProfiledSystem());
		world.initialize();

		Assert.assertNull(
				ProfiledSystem.class.getAnnotation(Profile.class));

		world.process();
		world.process();

		SimpleProfiler simpleProfiler = SimpleProfiler.lastInstance;
		Assert.assertNotNull(simpleProfiler);

		simpleProfiler.validate();

		Assert.assertEquals(2, simpleProfiler.startCount);
		Assert.assertEquals(2, simpleProfiler.stopCount);

		world.process();
		Assert.assertEquals(3, simpleProfiler.startCount);
		Assert.assertEquals(3, simpleProfiler.stopCount);
	}

	@Test
	public void multiple_exit_points_profiled_system() {
		World world = new World();
		world.setSystem(new ProfiledSystemB());
		world.initialize();

		Assert.assertNull(
				ProfiledSystemB.class.getAnnotation(Profile.class));

		world.process();

		SimpleProfiler simpleProfiler = SimpleProfiler.lastInstance;
		Assert.assertNotNull(simpleProfiler);

		simpleProfiler.validate();

		Assert.assertEquals(1, simpleProfiler.startCount);
		Assert.assertEquals(1, simpleProfiler.stopCount);

		world.process();
		Assert.assertEquals(2, simpleProfiler.startCount);
		Assert.assertEquals(2, simpleProfiler.stopCount);
	}
}


text:
var express = require('express');

exports = function (logger) {
  var log = logger.log();

  function index (req, res) {
    res.render('index', {
      title: 'node.js www boilerplate'
    });
  }

  var router = express.Router();
  router.get('/', index);

  return {
    router: router
  };
};

exports.__module = {
  args: ['logger']
};

module.exports = exports;

redpajama_set_name: RedPajamaGithub


text:
class HgFastExport < Formula
  include Language::Python::Shebang

  desc "Fast Mercurial to Git converter"
  homepage "https://repo.or.cz/fast-export.git"
  url "https://github.com/frej/fast-export/archive/v221024.tar.gz"
  sha256 "0dfecc3a2fd0833434d7ef57eb34c16432a8b2930df22a56ccf1a2bbb4626ba7"
  license "GPL-2.0-or-later"
  revision 1

  bottle do
    sha256 cellar: :any_skip_relocation, all: "e34f2ca7004b96237a3ccb2c6f611e5a5062c843dc632da74c5b8ac0aa3852df"
  end

  depends_on "mercurial"
  depends_on "python@3.11"

  def install
    # The Python executable is tested from PATH
    # Prepend ours Python to the executable candidate list (python2 python python3)
    # See https://github.com/Homebrew/homebrew-core/pull/90709#issuecomment-988548657
    %w[hg-fast-export.sh hg-reset.sh].each do |f|
      inreplace f, "for python_cmd in ",
                   "for python_cmd in '#{which("python3.11")}' "
    end

    libexec.install Dir["*"]

    %w[hg-fast-export.py hg-fast-export.sh hg-reset.py hg-reset.sh hg2git.py].each do |f|
      rewrite_shebang detected_python_shebang, libexec/f
      bin.install_symlink libexec/f
    end
  end

  test do
    mkdir testpath/"hg-repo" do
      system "hg", "init"
      (testpath/"hg-repo/test.txt").write "Hello"
      system "hg", "add", "test.txt"
      system "hg", "commit", "-u", "test@test", "-m", "test"
    end

    mkdir testpath/"git-repo" do
      system "git", "config", "--global", "init.defaultBranch", "master"
      system "git", "init"
      system "git", "config", "core.ignoreCase", "false"
      system "hg-fast-export.sh", "-r", "#{testpath}/hg-repo"
      system "git", "checkout", "HEAD"
    end

    assert_predicate testpath/"git-repo/test.txt", :exist?
    assert_equal "Hello", (testpath/"git-repo/test.txt").read
  end
end


text:
var gulp = require('gulp');
gulp.task('default', function() {
  console.log('Howdy!!');
});

var babel = require('gulp-babel');
gulp.task('babel', function() {
  return gulp.src('src/*.js')
    .pipe(babel())
    .pipe(gulp.dest('dist_babel/'));
});

var webpack = require('gulp-webpack');
// Plugin for each name of file.
// Now, 'webpack.config.js' configure these settings.
// var named = require('vinyl-named');
gulp.task('webpack', function() {
  return gulp.src('dist_babel/*.js')
    // .pipe(named())
    .pipe(webpack(require('./webpack.config.js')))
    .pipe(gulp.dest('dist_webpack'));
});

var bookmarklet = require('gulp-bookmarklet');
gulp.task('bookmarklet', function() {
  return gulp.src('dist_webpack/*.js')
    .pipe(bookmarklet())
    .pipe(gulp.dest('dist_bookmarklet/'));
});

var runS = require('run-sequence');
gulp.task('build', ['clean'], function(cb) {
  runS('babel', 'webpack', 'bookmarklet', cb);
});

var watch = require('gulp-watch');
// var plumber = require('gulp-plumber');
gulp.task('watch', function () {
  watch('src/main.js', { ignoreInitial: false }, function() {
    gulp.start('build');
  })
    // .pipe(plumber()); // It's not make sense for my case
});

var eslint = require('gulp-eslint');
gulp.task('lint', function() {
  // ESLint ignores files with "node_modules" paths.
  // So, it's best to have gulp ignore the directory as well.
  // Also, Be sure to return the stream from the task;
  // Otherwise, the task may end before the stream has finished.
  return gulp.src(['src/*.js','!node_modules/**'])
    // eslint() attaches the lint output to the "eslint" property
    // of the file object so it can be used by other modules.
    .pipe(eslint())
    // eslint.format() outputs the lint results to the console.
    // Alternatively use eslint.formatEach() (see Docs).
    .pipe(eslint.format())
    // To have the process exit with an error code (1) on
    // lint error, return the stream and pipe to failAfterError last.
    .pipe(eslint.failAfterError());
});

var del = require('del');
gulp.task('clean', function() {
  return del(['dist*/*.js']);
});

gulp.task('test', function() {
  console.log("Test flow: 1. npm run lint, 2. npm run build");
});