For testing only.
342522
public static void main(String[] pArgs) throws Exception {
    // -- Print DTD
    System.out.println("DTD: \n" + DTD);
    System.out.println("--");

    // -- Test load
    System.out.println("Reading properties from \"" + pArgs[0] + "\"...");
    XMLProperties props = new XMLProperties();

    props.load(new FileInputStream(new File(pArgs[0])));
    props.list(System.out);
    System.out.println("--");

    // -- Test recursion
    String     key = "key";
    Object     old = props.setProperty(key, "AAA");
    Properties p1  = new XMLProperties(new XMLProperties(props));
    Properties p2  = new Properties(new Properties(props));

    System.out.println("XMLProperties: " + p1.getProperty(key) + " ==" + " Properties: " + p2.getProperty(key));
    if (old == null) {
      props.remove("key");
    } else {
      props.put("key", old);  // Put old value back, to avoid confusion...
    }
    System.out.println("--");

    // -- Test store
    //props.store(System.out, "XML Properties file written by XMLProperties.");
    File out = new File("copy_of_" + pArgs[0]);

    System.out.println("Writing properties to \"" + out.getName() + "\"");
    if (!out.exists()) {
      props.store(new FileOutputStream(out), "XML Properties file written by XMLProperties.");
    } else {
      System.err.println("File \"" + out.getName() + "\" allready exists, cannot write!");
    }

    // -- Test utility methods
    // Write normal properties from XMLProperties
    out = new File("copy_of_" + pArgs[0].substring(0, pArgs[0].lastIndexOf(".")) + ".properties");
    System.out.println("Writing properties to \"" + out.getName() + "\"");
    if (!out.exists()) {
      storeProperties(props, new FileOutputStream(out), "Properties file written by XMLProperties.");
    } else {
      System.err.println("File \"" + out.getName() + "\" allready exists, cannot write!");
    }
    System.out.println("--");

    // -- Test type attribute
    System.out.println("getPropertyValue(\"one\"): " + props.getPropertyValue("one") + " class: "
                       + props.getPropertyValue("one").getClass());
    System.out.println("setPropertyValue(\"now\", " + new Date() + "): " + props.setPropertyValue("now", new Date()) + " class: "
                       + props.getPropertyValue("now").getClass());
    System.out.println("getPropertyValue(\"date\"): " + props.getPropertyValue("date") + " class: "
                       + props.getPropertyValue("date").getClass());
    System.out.println("getPropertyValue(\"time\"): " + props.getPropertyValue("time") + " class: "
                       + props.getPropertyValue("time").getClass());
  }
1030058
def onlyOnce(fn):
    ''
    def wrap(*args, **kwargs):
        if hasattr(fn, 'called'):
            return
        fn.called = 1
        return fn(*args, **kwargs)
    util.mergeFunctionMetadata(fn, wrap)
    return wrap
764132
def show_active_only(self, state):
        
        query = self._copy()
        query.active_only = state
        return query
563687
def only(self, *fields):
        '''
        
        '''
        s = self._clone()
        if len(fields) == 1 and fields[0] == '__model':
            s._only = '__model'
        else:
            s._only = fields
        return s
1326210
function(sControlName, aControlsToTest, aExcludedControls, bIncludeNonRenderable, bIncludeNonInstantiable) {
		if (!sControlName) {
			return false;
		}

		if (aControlsToTest.length) { // only test specific controls
			if (aControlsToTest.indexOf(sControlName) === -1) { // not one of the chosen ones
				return false;
			}
		} else if (aExcludedControls.indexOf(sControlName) > -1) {
			return false;
		}

		if (!bIncludeNonRenderable && !ControlIterator.controlCanBeRendered(sControlName)) {
			return false;
		}

		if (!bIncludeNonInstantiable && !ControlIterator.controlCanBeInstantiated(sControlName)) {
			return false;
		}

		return true;
	}
395829
async function measure(test, bench) {
  let {
    delay,
    minTime,
    minSamples,
    minWarmups,
    onCycle,
    onSample,
  } = bench.config
  let { name, run } = test

  delay *= 1e3
  minTime *= 1e3

  let samples = []
  let cycle = {
    name, // test name
    hz: null, // samples per second
    size: null, // number of samples
    time: null, // elapsed time (including delays)
    stats: null,
  }

  let n = 0
  let t = process.hrtime()
  let warmups = -1

  // synchronous test
  if (run.length == 0) {
    let start
    while (true) {
      bench.before.forEach(call)
      if (test.before) test.before()

      start = process.hrtime()
      run()
      let sample = clock(start)

      if (test.after) test.after()
      bench.after.forEach(call)

      if (warmups == -1) {
        warmups = Math.max(minWarmups, sample > 100 ? 1 : sample > 10 ? 5 : 50)
      }
      if (warmups > 0) {
        warmups--
      } else {
        samples[n++] = sample
        onSample(samples[n - 1], cycle)

        if (minTime <= clock(t) && minSamples <= n) {
          break // all done!
        }
      }

      // wait then repeat
      await wait(delay)
    }
  }

  // asynchronous test
  else {
    let start
    const next = function() {
      bench.before.forEach(call)
      if (test.before) test.before()

      start = process.hrtime()
      run(done)
    }

    // called by the test function for every sample
    const done = function() {
      let sample = clock(start)

      if (test.after) test.after()
      bench.after.forEach(call)

      if (warmups == -1) {
        warmups = Math.max(minWarmups, sample > 100 ? 1 : sample > 10 ? 5 : 50)
      }
      if (warmups > 0) {
        warmups--
      } else {
        samples[n++] = sample
        onSample(samples[n - 1], cycle)

        if (minTime <= clock(t) && minSamples <= n) {
          return cycle.done() // all done!
        }
      }

      // wait then repeat
      wait(delay).then(next)
    }

    defer(cycle) // wrap cycle with a promise
    next() // get the first sample

    // wait for samples
    await cycle.promise
  }

  const time = clock(t)
  const stats = analyze(samples)
  cycle.hz = 1000 / stats.mean
  cycle.size = n
  cycle.time = time
  cycle.stats = stats

  onCycle(cycle, bench.config)
}
537291
protected void run(List<TestDescription> selectedTests) {
    mRunning = true;
    mTotalTestCount = selectedTests.size();
    mRunnerBean.run(this, selectedTests);
  }
368776
def _only_main(func):
    """"""
    @wraps(func)
    def wrapper(self, *args, **kwargs):
        if not self.is_main:
            return getattr(self.main, func.__name__)(*args, **kwargs)
        return func(self, *args, **kwargs)
    return wrapper
110752
def only(names)
      filtered_stats = @stats.select do |stat|
        names.include? stat[:name]
      end
      StatsRegistry.new(filtered_stats)
    end
950759
function filter(fp, opts) {
  if (opts && opts.filter) {
    return opts.filter(fp, opts);
  }
  return /[^x]\.js$/.test(fp);
}
1103537
function measure(test, done) {
    var start = now();
    test(function (error, results) {
        var stop = now();
        done(error, results, stop - start);
    });
}
778855
function(mocha, test) {
        test.parent._onlyTests = test.parent._onlyTests.concat(test);
        mocha.options.hasOnly = true;
        return test;
      }
1263409
def demo(quiet, shell, speed, prompt, commentecho):
    """"""
    run(
        DEMO,
        shell=shell,
        speed=speed,
        test_mode=TESTING,
        prompt_template=prompt,
        quiet=quiet,
        commentecho=commentecho,
    )
1346623
function(url) {
		if (silentMode) {
			return;
		}

		console.log(
			colors.bold('\nTesting ' + link(url)) +
				' ... please wait, this may take a minute.'
		);
		if (program.timer) {
			console.time('Total test time');
		}
	}
1306415
def _run_check_onlyif(self, low_data, cmd_opts):
        '''
        
        '''
        ret = {'result': False}

        if not isinstance(low_data['onlyif'], list):
            low_data_onlyif = [low_data['onlyif']]
        else:
            low_data_onlyif = low_data['onlyif']

        def _check_cmd(cmd):
            if cmd != 0 and ret['result'] is False:
                ret.update({'comment': 'onlyif condition is false',
                            'skip_watch': True,
                            'result': True})
            elif cmd == 0:
                ret.update({'comment': 'onlyif condition is true', 'result': False})

        for entry in low_data_onlyif:
            if isinstance(entry, six.string_types):
                cmd = self.functions['cmd.retcode'](
                    entry, ignore_retcode=True, python_shell=True, **cmd_opts)
                log.debug('Last command return code: %s', cmd)
                _check_cmd(cmd)
            elif isinstance(entry, dict):
                if 'fun' not in entry:
                    ret['comment'] = 'no `fun` argument in onlyif: {0}'.format(entry)
                    log.warning(ret['comment'])
                    return ret
                result = self.functions[entry.pop('fun')](**entry)
                if self.state_con.get('retcode', 0):
                    _check_cmd(self.state_con['retcode'])
                elif not result:
                    ret.update({'comment': 'onlyif condition is false',
                                'skip_watch': True,
                                'result': True})
                else:
                    ret.update({'comment': 'onlyif condition is true',
                                'result': False})

            else:
                ret.update({'comment': 'onlyif execution failed, bad type passed', 'result': False})
        return ret
686881
def any(self, func=None):
        
        if func is None:
            func = lambda x, *args: x
        self.antmp = False

        def testEach(value, index, *args):
            if func(value, index, *args) is True:
                self.antmp = True
                return "breaker"

        self._clean.each(testEach)
        return self._wrap(self.antmp)
24250
def diff_write_only(resource):
        """"""
        if resource.present and not resource.existing:
            return ADD
        elif not resource.present and resource.existing:
            return DEL
        elif resource.present and resource.existing:
            return OVERWRITE

        return NOOP