text:
package com.github.mjeanroy.maven.plugins.node.mojos;

import com.github.mjeanroy.maven.plugins.node.commands.Command;
import com.github.mjeanroy.maven.plugins.node.commands.CommandExecutor;
import com.github.mjeanroy.maven.plugins.node.commands.CommandResult;
import com.github.mjeanroy.maven.plugins.node.exceptions.PackageJsonNotFoundException;
import com.github.mjeanroy.maven.plugins.node.loggers.NpmLogger;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.settings.Settings;
import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.ArgumentMatchers;
import org.mockito.verification.VerificationMode;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.github.mjeanroy.maven.plugins.node.tests.CollectionTestUtils.newMap;
import static com.github.mjeanroy.maven.plugins.node.tests.CollectionTestUtils.newMapEntry;
import static com.github.mjeanroy.maven.plugins.node.tests.ReflectTestUtils.readPrivate;
import static com.github.mjeanroy.maven.plugins.node.tests.ReflectTestUtils.writePrivate;
import static com.github.mjeanroy.maven.plugins.node.tests.StringTestUtils.join;
import static com.github.mjeanroy.maven.plugins.node.tests.builders.CommandResultTestBuilder.failureResult;
import static com.github.mjeanroy.maven.plugins.node.tests.builders.CommandResultTestBuilder.successResult;
import static com.github.mjeanroy.maven.plugins.node.tests.builders.ProxyTestBuilder.defaultHttpProxy;
import static com.github.mjeanroy.maven.plugins.node.tests.builders.ProxyTestBuilder.defaultHttpsProxy;
import static com.github.mjeanroy.maven.plugins.node.tests.builders.SettingsTestBuilder.newSettings;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonMap;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;

public abstract class AbstractNpmScriptMojoTest<T extends AbstractNpmScriptMojo> extends AbstractNpmMojoTest<T> {

	private static final String NPM = "npm";
	private static final String YARN = "yarn";

	@Test
	public void test_should_create_mojo() {
		T mojo = lookupEmptyMojo("mojo");
		assertThat(mojo).isNotNull();
	}

	@Test
	public void test_should_create_mojo_with_configuration() {
		T mojo = lookupMojo("mojo-with-parameters");

		assertThat(mojo).isNotNull();
		assertThat(readPrivate(mojo, "color", Boolean.class)).isTrue();
		assertThat(readPrivate(mojo, "workingDirectory", File.class)).isNotNull();
	}

	@Test
	public void it_should_execute_mojo_in_success() throws Exception {
		T mojo = lookupMojo("mojo-with-parameters");
		execute_and_verify_successful_mojo_execution(mojo, NPM);
	}

	@Test
	public void it_should_execute_mojo_given_environment_variables() throws Exception {
		Map<String, String> environmentVariables = singletonMap("maven", "true");
		T mojo = lookupMojo("mojo-with-parameters", newMap(asList(
				newMapEntry("environmentVariables", (Object) environmentVariables),
				newMapEntry("color", (Object) true)
		)));

		execute_and_verify_successful_mojo_execution(mojo, NPM, environmentVariables);
	}

	@Test
	public void it_should_execute_mojo_with_yarn_in_success() throws Exception {
		T mojo = lookupMojo("mojo-with-yarn");
		execute_and_verify_successful_mojo_execution(mojo, YARN);
		verify(readPrivate(mojo, "log", Log.class)).warn("Parameter 'yarn' is deprecated, please use 'npmClient' instead.");
	}

	@Test
	public void it_should_execute_mojo_with_custom_npm_client_in_success() throws Exception {
		T mojo = lookupMojo("mojo-with-npm-client");
		execute_and_verify_successful_mojo_execution(mojo, YARN);
		verify(readPrivate(mojo, "log", Log.class), never()).warn(anyString());
	}

	@Test
	public void it_should_execute_mojo_in_success_without_colors() throws Exception {
		T mojo = lookupEmptyMojo("mojo");
		mojo.execute();
		verify_mojo_execution(mojo, NPM, join(defaultArguments(true)));
	}

	@Test
	public void it_should_execute_mojo_in_success_with_custom_script() throws Exception {
		String script = script() + ":foobar";
		T mojo = lookupMojo("mojo-with-parameters", singletonMap(
				scriptParameterName(), script
		));

		mojo.execute();

		verify_mojo_execution(mojo, NPM, "run " + script + " --maven");
	}

	@Test
	public void it_should_execute_mojo_in_success_with_script_with_options() throws Exception {
		String script = script();
		String cmd = script + " --force";
		boolean addRun = !isStandardScript();

		T mojo = lookupMojo("mojo-with-parameters", singletonMap(
				scriptParameterName(), cmd
		));

		mojo.execute();

		verify_mojo_execution(mojo, NPM, (addRun ? "run " : "") + cmd + " --maven");
	}

	@Test
	public void it_should_execute_mojo_in_success_with_custom_script_and_warn_if_deprecated_option_is_used() throws Exception {
		T mojo = lookupMojo("mojo-with-parameters", singletonMap(
				"script", "foobar"
		));

		mojo.execute();

		verify_mojo_execution(mojo, NPM, "run foobar --maven");
		verify(readPrivate(mojo, "log", Log.class)).warn(
				"Parameter `script` has been deprecated to avoid conflict issues, please use `" + scriptParameterName() + "` instead"
		);
	}

	@Test
	public void it_should_skip_mojo_execution() throws Exception {
		T mojo = lookupMojo("mojo", singletonMap(
				"skip", true
		));

		mojo.execute();

		verifySkippedMojo(mojo);
	}

	@Test
	public void it_should_skip_individual_mojo_execution() throws Exception {
		T mojo = lookupMojo("mojo-with-parameters");

		// Enable individual skip.
		enableSkip(mojo);

		mojo.execute();

		verifySkippedMojo(mojo);
	}

	@Test
	public void it_should_skip_individual_mojo_execution_with_yarn() throws Exception {
		T mojo = lookupMojo("mojo-with-parameters");

		// Enable yarn
		writePrivate(mojo, "yarn", true);

		// Enable individual skip.
		enableSkip(mojo);

		mojo.execute();

		verifySkippedMojo(mojo, "yarn");
	}

	@Test
	public void it_should_skip_individual_mojo_execution_with_custom_npm_client() throws Exception {
		T mojo = lookupMojo("mojo-with-parameters");

		// Enable npmClient
		writePrivate(mojo, "npmClient", "yarn");

		// Enable individual skip.
		enableSkip(mojo);

		mojo.execute();

		verifySkippedMojo(mojo, "yarn");
	}

	@Test
	public void it_should_skip_mojo_execution_if_it_has_been_executed() throws Exception {
		T mojo = lookupMojo("mojo-with-parameters");

		mojo.execute();
		mojo.execute();

		String cmd = NPM + (isStandardScript() ? "" : " run") + " " + script();
		verify_executor_has_been_run_once(mojo);
		verify_command_skipped_has_been_logged_once(mojo, cmd);
	}

	@Test
	public void it_should_not_skip_mojo_execution_if_it_has_been_executed_on_another_working_directory() throws Exception {
		// Create two mojos in two different working directory
		T mojo1 = lookupMojo("mojo-fail-on-error-false");
		T mojo2 = lookupMojo("mojo-fail-on-error-true");

		// Share plugin context as in a "normal" build
		Map<?, ?> pluginContext = new HashMap<>();
		mojo1.setPluginContext(pluginContext);
		mojo2.setPluginContext(pluginContext);

		// Execute both mojo
		mojo1.execute();
		mojo2.execute();

		verify_executor_has_been_run_once(mojo1);
		verify_executor_has_been_run_once(mojo2);

		String cmd = NPM + (isStandardScript() ? "" : " run") + " " + script();
		verify_command_skipped_has_not_been_logged(mojo1, cmd);
		verify_command_skipped_has_not_been_logged(mojo2, cmd);
	}

	@Test
	public void it_should_not_skip_mojo_execution_if_it_has_been_executed_on_another_working_directory_using_normalized_path() throws Exception {
		T mojo1 = lookupEmptyMojo("mojo");
		T mojo2 = lookupEmptyMojo("mojo");

		// Override working directories with relative path
		writePrivate(mojo1, "workingDirectory", new File(readPrivate(mojo1, "workingDirectory", File.class), "foo/.."));
		writePrivate(mojo2, "workingDirectory", new File(readPrivate(mojo1, "workingDirectory", File.class), "."));

		// Share plugin context as in a "normal" build
		Map<?, ?> pluginContext = new HashMap<>();
		mojo1.setPluginContext(pluginContext);
		mojo2.setPluginContext(pluginContext);

		// Execute both mojo
		mojo1.execute();
		mojo2.execute();

		verify_executor_has_been_run_once(mojo1);

		String cmd = NPM + (isStandardScript() ? "" : " run") + " " + script();
		verify_command_skipped_has_not_been_logged(mojo1, cmd);
		verify_command_skipped_has_been_logged_once(mojo2, cmd);
	}

	@Test
	public void it_should_execute_mojo_in_failure() throws Exception {
		T mojo = lookupMojo("mojo-fail-on-error-false");

		givenFailExecutor(mojo);

		mojo.execute();

		verify_mojo_error_execution(mojo, NPM, join(defaultArguments(true)));
	}

	@Test
	public void it_should_execute_yarn_mojo_in_failure() throws Exception {
		T mojo = lookupMojo("mojo-yarn-fail-on-error-false");

		givenFailExecutor(mojo);

		mojo.execute();

		verify_mojo_error_execution(mojo, YARN, join(defaultArguments(true)));
	}

	@Test
	public void it_should_execute_mojo_in_failure_and_throw_exception() {
		final T mojo = lookupMojo("mojo-fail-on-error-true");
		final ThrowingCallable mojoExecute = new ThrowingCallable() {
			@Override
			public void call() throws Throwable {
				mojo.execute();
			}
		};

		givenFailExecutor(mojo);

		assertThatThrownBy(mojoExecute).isInstanceOf(MojoExecutionException.class);
	}

	@Test
	public void it_should_throw_exception_if_scripts_does_not_exist() throws Throwable {
		final T mojo = lookupMojo("mojo-without-scripts-fail");
		final ThrowingCallable mojoExecute = new ThrowingCallable() {
			@Override
			public void call() throws Throwable {
				mojo.execute();
			}
		};

		if (isStandardScript()) {
			mojoExecute.call();
		} else {
			assertThatThrownBy(mojoExecute).isInstanceOf(MojoExecutionException.class).hasMessageStartingWith("Cannot execute npm run " + script() + " command: it is not defined in package.json");
		}
	}

	@Test
	public void it_should_not_throw_exception_if_scripts_does_not_exist() throws Exception {
		T mojo = lookupMojo("mojo-without-scripts-do-not-fail");

		mojo.execute();

		VerificationMode verificationModeLog = isStandardScript() ? never() : times(1);
		VerificationMode verificationModeExecutor = isStandardScript() ? times(1) : never();

		Log logger = readPrivate(mojo, "log");

		String expectedPackageJsonPath = new File(mojo.getWorkingDirectory(), "package.json").getAbsolutePath();
		verify(logger, verificationModeLog).warn("Cannot execute npm run " + script() + " command: it is not defined in package.json (please check file: " + expectedPackageJsonPath + "), skipping.");
		verify(logger, never()).error(anyString());

		verify(readPrivate(mojo, "executor", CommandExecutor.class), verificationModeExecutor).execute(
				any(File.class),
				any(Command.class),
				any(NpmLogger.class),
				ArgumentMatchers.<String, String>anyMap()
		);
	}

	@Test
	public void it_should_throw_exception_if_package_json_does_not_exist() {
		final T mojo = lookupMojo("mojo-without-package-json");
		final ThrowingCallable mojoExecute = new ThrowingCallable() {
			@Override
			public void call() throws Throwable {
				mojo.execute();
			}
		};
		assertThatThrownBy(mojoExecute).isInstanceOf(PackageJsonNotFoundException.class).hasMessageEndingWith("package.json does not exist");
	}

	@Test
	public void it_should_add_proxy_configuration() throws Exception {
		T mojo = lookupMojo("mojo-with-proxy");
		givenSettingsWithDefaultProxies(mojo);
		givenFailExecutor(mojo);

		mojo.execute();

		verify_command_execution_with_proxy(mojo);
		verify_proxy_log_output(mojo);
	}

	@Test
	public void it_should_ignore_proxy_configuration() throws Exception {
		T mojo = lookupEmptyMojo("mojo");
		givenSettingsWithDefaultProxies(mojo);
		writePrivate(mojo, "ignoreProxies", true);

		mojo.execute();

		verify_command_execution_ignoring_proxies(mojo);
	}

	@Test
	public void it_should_not_add_maven_argument_if_disabled() throws Exception {
		T mojo = lookupMojo("mojo-without-maven-argument");
		mojo.execute();
		verify_mojo_execution(mojo, NPM, join(defaultArguments(false)));
	}

	@Override
	T lookupMojo(String projectName) {
		return configureMojo(
				super.lookupMojo(projectName)
		);
	}

	@Override
	T lookupEmptyMojo(String projectName) {
		return configureMojo(
				super.lookupEmptyMojo(projectName)
		);
	}

	@Override
	T lookupMojo(String projectName, Map<String, ?> configuration) {
		return configureMojo(
				super.lookupMojo(projectName, configuration)
		);
	}

	private T configureMojo(T mojo) {
		writePrivate(mojo, "executor", givenExecutor(successResult()));
		return mojo;
	}

	/**
	 * Get the script parameter name used by this mojo.
	 *
	 * @return The script parameter name.
	 */
	abstract String scriptParameterName();

	/**
	 * Override mojo script value.
	 *
	 * @param mojo The mojo.
	 */
	abstract void enableSkip(T mojo);

	/**
	 * The expected skipped message.
	 *
	 * @param npmClient The npm client name.
	 * @return Skipped message.
	 */
	String skipMessage(String npmClient) {
		String command = npmClient + " " + (isStandardScript() ? "" : "run ") + script();
		return "Command '" + command + "' is skipped.";
	}

	/**
	 * Get the NPM/YARN script that is tested.
	 *
	 * @return The script name.
	 */
	String script() {
		return mojoName();
	}

	private boolean isStandardScript() {
		String script = script();
		return script.equals("test") || script.equals("install") || script.equals("publish") || script.equals("start") || script.equals("prune");
	}

	private List<String> defaultArguments(boolean withMaven) {
		List<String> arguments = new ArrayList<>();

		String mojoName = script();

		if (!isStandardScript()) {
			arguments.add("run");
		}

		arguments.add(mojoName);

		// Do not forget maven flag
		if (withMaven) {
			arguments.add("--maven");
		}

		return arguments;
	}

	private void verifySkippedMojo(T mojo, String npmClient) {
		verifyZeroInteractions(readPrivate(mojo, "executor"));
		verify(readPrivate(mojo, "log", Log.class)).info(skipMessage(npmClient));
	}

	private void verifySkippedMojo(T mojo) {
		verifySkippedMojo(mojo, "npm");
	}

	private void execute_and_verify_successful_mojo_execution(T mojo, String pkg, Map<String, String> environmentVariables) throws Exception {
		mojo.execute();
		String expectedArgs = join(defaultArguments(true));
		verify_mojo_execution(
				mojo,
				pkg,
				expectedArgs,
				environmentVariables
		);
	}

	private void execute_and_verify_successful_mojo_execution(T mojo, String pkg) throws Exception {
		execute_and_verify_successful_mojo_execution(mojo, pkg, Collections.<String, String>emptyMap());
	}

	private void verify_mojo_execution(T mojo, String pkg, String expectedArgs) {
		verify_mojo_execution(
				mojo,
				pkg,
				expectedArgs,
				Collections.<String, String>emptyMap()
		);
	}

	private void verify_mojo_execution(T mojo, String pkg, String expectedArgs, Map<String, String> environmentVariables) {
		verify_success_output(mojo, pkg, expectedArgs);
		verify_command_execution(mojo, pkg, expectedArgs, environmentVariables);
	}

	private void verify_mojo_error_execution(T mojo, String pkg, String expectedArgs) {
		verify_error_output(mojo, pkg, expectedArgs);
		verify_command_execution(mojo, pkg, expectedArgs, Collections.<String, String>emptyMap());
	}

	private void verify_success_output(T mojo, String pkg, String expectedArgs) {
		Log logger = readPrivate(mojo, "log");
		verify(logger).info("Running: " + pkg + " " + expectedArgs);
		verify(logger, never()).error(anyString());
	}

	private void verify_error_output(T mojo, String pkg, String expectedArgs) {
		Log logger = readPrivate(mojo, "log");
		verify(logger).error("Error during execution of: " + pkg + " " + expectedArgs);
		verify(logger).error("Exit status: 1");
	}

	private void verify_proxy_log_output(T mojo) {
		String expectedArgs = join(defaultArguments(true));

		Log logger = readPrivate(mojo, "log");

		verify(logger).info(
				"Running: npm " + expectedArgs +
						" --proxy http://mjeanroy:********@localhost:8080" +
						" --https-proxy http://mjeanroy:********@localhost:8080"
		);

		verify(logger).error(
				"Error during execution of: npm " + expectedArgs +
						" --proxy http://mjeanroy:********@localhost:8080" +
						" --https-proxy http://mjeanroy:********@localhost:8080"
		);
	}

	private void verify_command_execution_with_proxy(T mojo) {
		ArgumentCaptor<Command> cmdCaptor = ArgumentCaptor.forClass(Command.class);
		verify(readPrivate(mojo, "executor", CommandExecutor.class)).execute(
				any(File.class),
				cmdCaptor.capture(),
				any(NpmLogger.class),
				ArgumentMatchers.<String, String>anyMap()
		);

		Command command = cmdCaptor.getValue();
		assertThat(command.toString())
				.contains("--proxy http://mjeanroy:********@localhost:8080")
				.contains("--https-proxy http://mjeanroy:********@localhost:8080");
	}

	private void verify_command_execution(T mojo, String pkg, String expectedArgs, Map<String, String> environment) {
		ArgumentCaptor<File> workingDirectoryCaptor = ArgumentCaptor.forClass(File.class);
		ArgumentCaptor<Command> cmdCaptor = ArgumentCaptor.forClass(Command.class);
		ArgumentCaptor<NpmLogger> npmLoggerCaptor = ArgumentCaptor.forClass(NpmLogger.class);

		verify(readPrivate(mojo, "executor", CommandExecutor.class)).execute(
				workingDirectoryCaptor.capture(),
				cmdCaptor.capture(),
				npmLoggerCaptor.capture(),
				eq(environment)
		);

		File workingDirectory = workingDirectoryCaptor.getValue();
		Command cmd = cmdCaptor.getValue();
		NpmLogger npmLogger = npmLoggerCaptor.getValue();

		assertThat(workingDirectory).isEqualTo(readPrivate(mojo, "workingDirectory"));
		assertThat(npmLogger).isNotNull();
		assertThat(readPrivate(npmLogger, "log")).isEqualTo(readPrivate(mojo, "log"));
		assertThat(cmd).isNotNull();
		assertThat(cmd.toString()).isEqualTo(pkg + " " + expectedArgs);
	}

	private void verify_command_execution_ignoring_proxies(T mojo) {
		ArgumentCaptor<Command> cmdCaptor = ArgumentCaptor.forClass(Command.class);
		verify(readPrivate(mojo, "executor", CommandExecutor.class)).execute(
				any(File.class),
				cmdCaptor.capture(),
				any(NpmLogger.class),
				ArgumentMatchers.<String, String>anyMap()
		);

		Command command = cmdCaptor.getValue();
		assertThat(command.toString())
				.doesNotContain("--proxy http://root:password@nginx.local:80")
				.doesNotContain("--https-proxy http://root:password@nginx:80");
	}

	private void verify_command_skipped_has_not_been_logged(T mojo1, String cmd) {
		verify(readPrivate(mojo1, "log", Log.class), never()).info(String.format("Command %s already done, skipping.", cmd));
	}

	private void verify_executor_has_been_run_once(T mojo1) {
		verify(readPrivate(mojo1, "executor", CommandExecutor.class), times(1)).execute(
				any(File.class),
				any(Command.class),
				any(NpmLogger.class),
				ArgumentMatchers.<String, String>anyMap()
		);
	}

	private void verify_command_skipped_has_been_logged_once(T mojo1, String cmd) {
		verify(readPrivate(mojo1, "log", Log.class), times(1)).info(String.format("Command %s already done, skipping.", cmd));
	}

	private void givenFailExecutor(T mojo) {
		givenExecutor(mojo, failureResult());
	}

	private void givenSettingsWithDefaultProxies(T mojo) {
		givenSettings(mojo, newSettings(
				defaultHttpProxy(),
				defaultHttpsProxy()
		));
	}

	private void givenSettings(T mojo, Settings settings) {
		writePrivate(mojo, "settings", settings);
	}

	private void givenExecutor(T mojo, CommandResult result) {
		givenExecutor(readPrivate(mojo, "executor", CommandExecutor.class), result);
	}

	private CommandExecutor givenExecutor(CommandResult result) {
		return givenExecutor(mock(CommandExecutor.class), result);
	}

	private CommandExecutor givenExecutor(CommandExecutor executor, CommandResult result) {
		when(executor.execute(any(File.class), any(Command.class), any(NpmLogger.class), ArgumentMatchers.<String, String>anyMap())).thenReturn(result);
		return executor;
	}
}


text:
// Copyright 2017 Elias Kosunen
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This file is a part of scnlib:
//     https://github.com/eliaskosunen/scnlib

#ifndef SCN_UTIL_MATH_H
#define SCN_UTIL_MATH_H

#include "../detail/fwd.h"

#include <cmath>
#include <limits>

namespace scn {
    SCN_BEGIN_NAMESPACE

    namespace detail {
        template <typename Integral>
        SCN_CONSTEXPR14 int _max_digits(int base) noexcept
        {
            using lim = std::numeric_limits<Integral>;

            char base8_digits[8] = {3, 5, 0, 11, 0, 0, 0, 21};

            if (base == 10) {
                return lim::digits10;
            }
            if (base == 8) {
                return static_cast<int>(base8_digits[sizeof(Integral) - 1]);
            }
            if (base == lim::radix) {
                return lim::digits;
            }

            auto i = lim::max();

            Integral digits = 0;
            while (i) {
                i /= static_cast<Integral>(base);
                digits++;
            }
            return static_cast<int>(digits);
        }

        /**
         * Returns the maximum number of digits that an integer in base `base`
         * can have, including the sign.
         *
         * If `base == 0`, uses `2` (longest), and adds 2 to the result, to
         * accommodate for a base prefix (e.g. `0x`)
         */
        template <typename Integral>
        SCN_CONSTEXPR14 int max_digits(int base) noexcept
        {
            auto b = base == 0 ? 2 : base;
            auto d = _max_digits<Integral>(b) +
                     (std::is_signed<Integral>::value ? 1 : 0);
            if (base == 0) {
                return d + 2;  // accommodate for 0x/0o
            }
            return d;
        }

        /**
         * Implementation of `std::div`, which is constexpr pre-C++23
         */
        template <typename T>
        constexpr std::pair<T, T> div(T l, T r) noexcept
        {
            return {l / r, l % r};
        }

        template <typename T>
        struct zero_value;
        template <>
        struct zero_value<float> {
            static constexpr float value = 0.0f;
        };
        template <>
        struct zero_value<double> {
            static constexpr double value = 0.0;
        };
        template <>
        struct zero_value<long double> {
            static constexpr long double value = 0.0l;
        };

        /**
         * Returns `true` if `ch` is a digit for an integer in base `base`.
         */
        template <typename CharT>
        bool is_base_digit(CharT ch, int base)
        {
            if (base <= 10) {
                return ch >= static_cast<CharT>('0') &&
                       ch <= static_cast<CharT>('0') + base - 1;
            }
            return is_base_digit(ch, 10) ||
                   (ch >= static_cast<CharT>('a') &&
                    ch <= static_cast<CharT>('a') + base - 1) ||
                   (ch >= static_cast<CharT>('A') &&
                    ch <= static_cast<CharT>('A') + base - 1);
        }
    }  // namespace detail

    SCN_END_NAMESPACE
}  // namespace scn

#endif

redpajama_set_name: RedPajamaGithub


text:
import printer
import dailyinfo
import time

p = printer.ThermalPrinter(serialport="/dev/ttyAMA0")
weather = dailyinfo.get_hourly_forecast()
for line in weather.split("\n"):
    print line
    p.print_text(line.encode("utf-8"))
    p.linefeed()
    time.sleep(.1)

news = dailyinfo.get_news()
for line in news.split("\n"):
    print line
    p.print_text(line.encode("utf-8"))
    p.linefeed()
    time.sleep(.1)


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
N. Amer. fl. 23:44. 1928 (Standley in Standley & Calderon, Lista pl. Salvador 96. 1925, nom. nud. )

#### Original name
null

### Remarks
null


text:
"$FLOW" stop
echo "// @flow" > test.js
"$FLOW" start --wait
echo "// @flow
import '';" > test.js
"$FLOW" force-recheck --focus test.js --no-auto-start
assert_errors "$FLOW" status --no-auto-start


text:
[Evaluating BatchPrediction results from AutoML Tabular Classification model](https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/model_evaluation/automl_tabular_classification_model_evaluation.ipynb)

Learn how to train a Vertex AI AutoML Tabular Classification model and learn how to evaluate it through a Vertex AI pipeline job using `google_cloud_pipeline_components`:

The steps performed include:

- Create a Vertex AI `Dataset`.
- Train a Automl Tabular Classification model on the `Dataset` resource.
- Import the trained `AutoML model resource` into the pipeline.
- Run a `Batch Prediction` job.
- Evaulate the AutoML model using the `Classification Evaluation Component`.
- Import the classification metrics to the AutoML model resource.

[Evaluating BatchPrediction results from AutoML Tabular Classification model](https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/model_evaluation/automl_video_classification_model_evaluation.ipynb)

Learn how to train a Vertex AI AutoML Tabular Classification model and learn how to evaluate it through a Vertex AI pipeline job using `google_cloud_pipeline_components`:

The steps performed include:

- Create a Vertex AI `Dataset`.
- Train a Automl Tabular Classification model on the `Dataset` resource.
- Import the trained `AutoML model resource` into the pipeline.
- Run a `Batch Prediction` job.
- Evaulate the AutoML model using the `Classification Evaluation Component`.
- Import the classification metrics to the AutoML model resource.

[Evaluating BatchPrediction results from AutoML Tabular regression model](https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/model_evaluation/automl_tabular_regression_model_evaluation.ipynb)

Learn how to evaluate a Vertex AI model resource through a Vertex AI pipeline job using `google_cloud_pipeline_components`:

The steps performed include:

- Create a Vertex AI Dataset
- Configure a `AutoMLTabularTrainingJob`
- Run the `AutoMLTabularTrainingJob` which returns a model
- Import a pre-trained `AutoML model resource` into the pipeline
- Run a `batch prediction` job
- Evaulate the AutoML model using the `regression evaluation component`
- Import the Classification Metrics to the AutoML model resource

[Evaluating Batch Prediction results from Custom Tabular regression model](https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/model_evaluation/custom_tabular_regression_model_evaluation.ipynb)

Learn how to evaluate a Vertex AI model resource through a Vertex AI pipeline job using `google_cloud_pipeline_components`:

The steps performed include:

- Create a Vertex AI `CustomTrainingJob` for training a model.
- Run the `CustomTrainingJob`
- Retrieve and load the model artifacts.
- View the model evaluation.
- Upload the model as a Vertex AI Model resource.
- Import a pre-trained `Vertex AI model resource` into the pipeline
- Run a `batch prediction` job
- Evaulate the model using the `regression evaluation component`
- Import the Classification Metrics to the Vertex AI model resource

[AutoML text classification pipelines using google-cloud-pipeline-components](https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/model_evaluation/automl_text_classification_model_evaluation.ipynb)

Learn how to use `Vertex AI Pipelines` and `Google Cloud Pipeline Components` to build an `AutoML` text classification model.

The steps performed include:

- Create a Vertex AI `Dataset`.
- Train a Automl Tabular Classification model on the `Dataset` resource.
- Import the trained `AutoML model resource` into the pipeline.
- Run a `Batch Prediction` job.
- Evaulate the AutoML model using the `Classification Evaluation Component`.
- Import the classification metrics to the AutoML model resource.


text:
E-Mu Morpheus and Ultra Proteus

Hyperpreset Patch Editor

This editor will work with the E-Mu Morpheus and the E-Mu Ultra Proteus.

Communicating with Edisyn

Set the MIDI ID to the same you'll be setting in Edisyn (typically 0).  In your default MIDI Map, turn OFF Program Change Map, and turn ON Bank Select and Program Change.  Feel free to reduce the Sysex packet delay to 0.  Make certain that the Hyperpreset button is pressed.

Uploading a Proteus Patch

It's easy: just use Edisyn's E-Mu Proteus editor.  Be sure to first turn ON the "Proteus Sysex" option in your unit.

Gotchas

Neither the Morpheus nor the Ultra Proteus can send to the current patch -- they can only write patches, or send individual parameters.  But sending to the current patch is a critical function.  Earlier versions of Edisyn used to write to patch 126, but as of Version 31, Edisyn just (slowly) sends individual parameters to the Morpheus/Ultra Proteus.  This change is because it is unclear if the Morpheus/Ultra Proteus uses Flash RAM, and frequently writing to patch 126 will gradually burn it out.

You cannot request the current patch on the Morpheus or Ultra Proteus.

Thanks

Thanks to Mike Perkowitz (mike@perkowitz.net) and MatrixSynth (matrixsynth@gmail.com) for their crucial help in developing and debugging this patch editor.

By
Sean Luke

Date
October 2018


text:
/* eslint-disable react/sort-comp */
import React, { Component } from "react";
import PropTypes from "prop-types";
import ReactDOM from "react-dom";
import invariant from "invariant";
import deepEqual from "deep-equal";
import hoistStatics from "hoist-non-react-statics";
import Events from "./Events";
import filterPropsSimple from "./utils/filterProps";
import { createManager, pubadsAPI } from "./createManager";
/**
 * An Ad Component using Google Publisher Tags.
 * This component should work standalone w/o context.
 * https://developers.google.com/doubleclick-gpt/
 *
 * @module Bling
 * @class Bling
 * @fires Bling#Events.READY
 * @fires Bling#Events.SLOT_RENDER_ENDED
 * @fires Bling#Events.IMPRESSION_VIEWABLE
 * @fires Bling#Events.SLOT_VISIBILITY_CHANGED
 * @fires Bling#Events.SLOT_LOADED
 */
class Bling extends Component {
    static propTypes = {
        /**
         * An optional string to be used as container div id.
         *
         * @property id
         */
        id: PropTypes.string,
        /**
         * An optional string indicating ad unit path which will be used
         * to create an ad slot.
         *
         * @property adUnitPath
         */
        adUnitPath: PropTypes.string.isRequired,
        /**
         * An optional object which includes ad targeting key-value pairs.
         *
         * @property targeting
         */
        targeting: PropTypes.object,
        /**
         * An optional prop to specify the ad slot size which accepts [googletag.GeneralSize](https://developers.google.com/doubleclick-gpt/reference#googletag.GeneralSize) as a type.
         * This will be preceded by the sizeMapping if specified.
         *
         * @property slotSize
         */
        slotSize: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
        /**
         * An optional array of object which contains an array of viewport size and slot size.
         * This needs to be set if the ad needs to serve different ad sizes per different viewport sizes (responsive ad).
         * Setting the `slot` to any dimension that's not configured in DFP results in rendering an empty ad.
         * The ad slot size which is provided for the viewport size of [0, 0] will be used as default ad size if none of viewport size matches.
         *
         * https://support.google.com/dfp_premium/answer/3423562?hl=en
         *
         * e.g.
         *
         * sizeMapping={[
         *   {viewport: [0, 0], slot: [320, 50]},
         *   {viewport: [768, 0], slot: [728, 90]}
         * ]}
         *
         * @property sizeMapping
         */
        sizeMapping: PropTypes.arrayOf(
            PropTypes.shape({
                viewport: PropTypes.array,
                slot: PropTypes.array
            })
        ),
        /**
         * An optional flag to indicate whether an ad slot should be out-of-page slot.
         *
         * @property outOfPage
         */
        outOfPage: PropTypes.bool,
        /**
         * An optional flag to indicate whether companion ad service should be enabled for the ad.
         * If an object is passed, it takes as a configuration expecting `enableSyncLoading` or `refreshUnfilledSlots`.
         *
         * @property companionAdService
         */
        companionAdService: PropTypes.oneOfType([
            PropTypes.bool,
            PropTypes.object
        ]),
        /**
         * An optional HTML content for the slot. If specified, the ad will render with the HTML content using content service.
         *
         * @property content
         */
        content: PropTypes.string,
        /**
         * An optional click through URL. If specified, any landing page URL associated with the creative that is served is overridden.
         *
         * @property clickUrl
         */
        clickUrl: PropTypes.string,
        /**
         * An optional string or an array of string which specifies a page-level ad category exclusion for the given label name.
         *
         * @property categoryExclusion
         */
        categoryExclusion: PropTypes.oneOfType([
            PropTypes.string,
            PropTypes.array
        ]),
        /**
         * An optional map of key-value pairs for an AdSense attribute on a particular ad slot.
         * see the list of supported key value: https://developers.google.com/doubleclick-gpt/adsense_attributes#adsense_parameters.googletag.Slot
         *
         * @property attributes
         */
        attributes: PropTypes.object,
        /**
         * An optional flag to indicate whether an empty ad should be collapsed or not.
         *
         * @property collapseEmptyDiv
         */
        collapseEmptyDiv: PropTypes.oneOfType([
            PropTypes.bool,
            PropTypes.array
        ]),
        /**
         * An optional flag to indicate whether ads in this slot should be forced to be rendered using a SafeFrame container.
         *
         * @property forceSafeFrame
         */
        forceSafeFrame: PropTypes.bool,
        /**
         * An optional object to set the slot-level preferences for SafeFrame configuration.
         *
         * @property safeFrameConfig
         */
        safeFrameConfig: PropTypes.object,
        /**
         * An optional event handler function for `googletag.events.SlotRenderEndedEvent`.
         *
         * @property onSlotRenderEnded
         */
        onSlotRenderEnded: PropTypes.func,
        /**
         * An optional event handler function for `googletag.events.ImpressionViewableEvent`.
         *
         * @property onImpressionViewable
         */
        onImpressionViewable: PropTypes.func,
        /**
         * An optional event handler function for `googletag.events.slotVisibilityChangedEvent`.
         *
         * @property onSlotVisibilityChanged
         */
        onSlotVisibilityChanged: PropTypes.func,
        /**
         * An optional event handler function for `googletag.events.SlotOnloadEvent`.
         *
         * @property onSlotOnload
         */
        onSlotOnload: PropTypes.func,
        /**
         * An optional flag to indicate whether an ad should only render when it's fully in the viewport area.
         *
         * @property renderWhenViewable
         */
        renderWhenViewable: PropTypes.bool,
        /**
         * An optional number to indicate how much percentage of an ad area needs to be in a viewable area before rendering.
         * Acceptable range is between 0 and 1.
         *
         * @property viewableThreshold
         */
        viewableThreshold: PropTypes.number,
        /**
         * An optional call back function to notify when the script is loaded.
         *
         * @property onScriptLoaded
         */
        onScriptLoaded: PropTypes.func,
        /**
         * An optional call back function to notify when the media queries on the document change.
         *
         * @property onMediaQueryChange
         */
        onMediaQueryChange: PropTypes.func,
        /**
         * An optional object to be applied as `style` props to the container div.
         *
         * @property style
         */
        style: PropTypes.object,
        /**
         * An optional property to control non-personalized Ads.
         * https://support.google.com/admanager/answer/7678538
         *
         * Set to `true` to mark the ad request as NPA, and to `false` for ad requests that are eligible for personalized ads
         * It is `false` by default, according to Google's definition.
         *
         * @property npa
         */
        npa: PropTypes.bool
    };

    /**
     * An array of prop names which can reflect to the ad by calling `refresh`.
     *
     * @property refreshableProps
     * @static
     */
    static refreshableProps = [
        "targeting",
        "sizeMapping",
        "clickUrl",
        "categoryExclusion",
        "attributes",
        "collapseEmptyDiv",
        "companionAdService",
        "forceSafeFrame",
        "safeFrameConfig"
    ];
    /**
     * An array of prop names which requires to create a new ad slot and render as a new ad.
     *
     * @property reRenderProps
     * @static
     */
    static reRenderProps = [
        "adUnitPath",
        "slotSize",
        "outOfPage",
        "content",
        "npa"
    ];
    /**
     * An instance of ad manager.
     *
     * @property _adManager
     * @private
     * @static
     */
    static _adManager = createManager();
    /**
     *
     * @property
     * @private
     * @static
     */
    static _config = {
        /**
         * An optional string for GPT seed file url to override.
         */
        seedFileUrl: "//www.googletagservices.com/tag/js/gpt.js",
        /**
         * An optional flag to indicate whether an ad should only render when it's fully in the viewport area. Default is `true`.
         */
        renderWhenViewable: true,
        /**
         * An optional number to indicate how much percentage of an ad area needs to be in a viewable area before rendering. Default value is 0.5.
         * Acceptable range is between 0 and 1.
         */
        viewableThreshold: 0.5,
        /**
         * An optional function to create an object with filtered current props and next props for a given keys to perform equality check.
         */
        filterProps: filterPropsSimple,
        /**
         * An optional function for the filtered props and the next props to perform equality check.
         */
        propsEqual: deepEqual
    };

    static on(eventType, cb) {
        Bling._on("on", eventType, cb);
    }

    static once(eventType, cb) {
        Bling._on("once", eventType, cb);
    }

    static removeListener(...args) {
        Bling._adManager.removeListener(...args);
    }

    static removeAllListeners(...args) {
        Bling._adManager.removeAllListeners(...args);
    }

    static _on(fn, eventType, cb) {
        if (typeof cb !== "function") {
            return;
        }
        if (eventType === Events.READY && Bling._adManager.isReady) {
            cb.call(Bling._adManager, Bling._adManager.googletag);
        } else {
            Bling._adManager[fn](eventType, cb);
        }
    }

    static configure(config = {}) {
        Bling._config = {
            ...Bling._config,
            ...config
        };
    }
    /**
     * Returns the GPT version.
     *
     * @method getGPTVersion
     * @returns {Number|boolean} a version or false if GPT is not yet ready.
     * @static
     */
    static getGPTVersion() {
        return Bling._adManager.getGPTVersion();
    }
    /**
     * Returns the Pubads Service version.
     *
     * @method getPubadsVersion
     * @returns {Number|boolean} a version or false if Pubads Service is not yet ready.
     * @static
     */
    static getPubadsVersion() {
        return Bling._adManager.getPubadsVersion();
    }
    /**
     * Sets a flag to indicate whether the correlator value should always be same across the ads in the page or not.
     *
     * @method syncCorrelator
     * @param {boolean} value
     * @static
     */
    static syncCorrelator(value) {
        Bling._adManager.syncCorrelator(value);
    }
    /**
     * Trigger re-rendering of all the ads.
     *
     * @method render
     * @static
     */
    static render() {
        Bling._adManager.renderAll();
    }
    /**
     * Refreshes all the ads in the page with a new correlator value.
     *
     * @param {Array} slots An array of ad slots.
     * @param {Object} options You can pass `changeCorrelator` flag.
     * @static
     */
    static refresh(slots, options) {
        Bling._adManager.refresh(slots, options);
    }
    /**
     * Clears the ads for the specified ad slots, if no slots are provided, all the ads will be cleared.
     *
     * @method clear
     * @param {Array} slots An optional array of slots to clear.
     * @static
     */
    static clear(slots) {
        Bling._adManager.clear(slots);
    }
    /**
     * Updates the correlator value for the next ad request.
     *
     * @method updateCorrelator
     * @static
     */
    static updateCorrelator() {
        Bling._adManager.updateCorrelator();
    }

    static set testManager(testManager) {
        invariant(testManager, "Pass in createManagerTest to mock GPT");
        Bling._adManager = testManager;
    }

    state = {
        scriptLoaded: false,
        inViewport: false
    };

    get adSlot() {
        return this._adSlot;
    }

    get viewableThreshold() {
        return this.props.viewableThreshold >= 0
            ? this.props.viewableThreshold
            : Bling._config.viewableThreshold;
    }

    componentDidMount() {
        Bling._adManager.addInstance(this);
        Bling._adManager
            .load(Bling._config.seedFileUrl)
            .then(this.onScriptLoaded.bind(this))
            .catch(this.onScriptError.bind(this));
    }

    componentWillReceiveProps(nextProps) {
        const {propsEqual} = Bling._config;
        const {sizeMapping} = this.props;

        if (
            (nextProps.sizeMapping || sizeMapping) &&
            !propsEqual(nextProps.sizeMapping, sizeMapping)
        ) {
            Bling._adManager.removeMQListener(this, nextProps);
        }
    }

    shouldComponentUpdate(nextProps, nextState) {
        // if adUnitPath changes, need to create a new slot, re-render
        // otherwise, just refresh
        const { scriptLoaded, inViewport } = nextState;
        const notInViewport = this.notInViewport(nextProps, nextState);
        const inViewportChanged = this.state.inViewport !== inViewport;
        const isScriptLoaded = this.state.scriptLoaded !== scriptLoaded;

        // Exit early for visibility change, before executing deep equality check.
        if (notInViewport) {
            return false;
        } else if (inViewportChanged) {
            return true;
        }

        const { filterProps, propsEqual } = Bling._config;
        const refreshableProps = filterProps(
            Bling.refreshableProps,
            this.props,
            nextProps
        );
        const reRenderProps = filterProps(
            Bling.reRenderProps,
            this.props,
            nextProps
        );
        const shouldRender = !propsEqual(
            reRenderProps.props,
            reRenderProps.nextProps
        );
        const shouldRefresh =
            !shouldRender &&
            !propsEqual(refreshableProps.props, refreshableProps.nextProps);

        if (shouldRefresh) {
            this.configureSlot(this._adSlot, nextProps);
        }

        if (Bling._adManager._syncCorrelator) {
            if (shouldRefresh) {
                Bling._adManager.refresh();
            } else if (shouldRender || isScriptLoaded) {
                Bling._adManager.renderAll();
                // return true;
            }
        } else {
            if (shouldRefresh) {
                this.refresh();
                return false;
            }
            if (shouldRender || isScriptLoaded) {
                return true;
            }
        }

        return false;
    }

    componentDidUpdate() {
        if (this.notInViewport(this.props, this.state)) {
            return;
        }
        if (this._divId) {
            // initial render will enable pubads service before any ad renders
            // so taken care of by the manager
            if (Bling._adManager._initialRender) {
                Bling._adManager.render();
            } else {
                this.renderAd();
            }
        }
    }

    componentWillUnmount() {
        Bling._adManager.removeInstance(this);
        if (this._adSlot) {
            Bling._adManager.googletag.destroySlots([this._adSlot]);
            this._adSlot = null;
        }
    }

    onScriptLoaded() {
        const { onScriptLoaded } = this.props;

        if (this.getRenderWhenViewable()) {
            this.foldCheck();
        }
        this.setState({ scriptLoaded: true }, onScriptLoaded); // eslint-disable-line react/no-did-mount-set-state
    }

    onScriptError(err) {
        console.warn(
            `Ad: Failed to load gpt for ${Bling._config.seedFileUrl}`,
            err
        );
    }

    getRenderWhenViewable(props = this.props) {
        return props.renderWhenViewable !== undefined
            ? props.renderWhenViewable
            : Bling._config.renderWhenViewable;
    }

    foldCheck() {
        if (this.state.inViewport) {
            return;
        }

        let slotSize = this.getSlotSize();
        if (Array.isArray(slotSize) && Array.isArray(slotSize[0])) {
            slotSize = slotSize[0];
        }
        if (
            slotSize === "fluid" ||
            (Array.isArray(slotSize) && slotSize[0] === "fluid")
        ) {
            slotSize = [0, 0];
        }
        const viewableThresholdValues = this.getUserViewableThresholdValues();
        const inViewport = Bling._adManager.isInViewport(
            ReactDOM.findDOMNode(this),
            slotSize,
            this.viewableThreshold,
            viewableThresholdValues
        );
        if (inViewport) {
            this.setState({ inViewport: true });
        }
    }

    defineSizeMapping(adSlot, sizeMapping) {
        if (sizeMapping) {
            Bling._adManager.addMQListener(this, this.props);
            const sizeMappingArray = sizeMapping
                .reduce((mapping, size) => {
                    return mapping.addSize(size.viewport, size.slot);
                }, Bling._adManager.googletag.sizeMapping())
                .build();
            adSlot.defineSizeMapping(sizeMappingArray);
        }
    }

    setAttributes(adSlot, attributes) {
        // no clear method, attempting to clear existing attributes before setting new ones.
        const attributeKeys = adSlot.getAttributeKeys();
        attributeKeys.forEach(key => {
            adSlot.set(key, null);
        });
        if (attributes) {
            Object.keys(attributes).forEach(key => {
                adSlot.set(key, attributes[key]);
            });
        }
    }

    setTargeting(adSlot, targeting) {
        adSlot.clearTargeting();
        if (targeting) {
            Object.keys(targeting).forEach(key => {
                adSlot.setTargeting(key, targeting[key]);
            });
        }
    }

    addCompanionAdService(serviceConfig, adSlot) {
        const companionAdsService = Bling._adManager.googletag.companionAds();
        adSlot.addService(companionAdsService);
        if (typeof serviceConfig === "object") {
            if (serviceConfig.hasOwnProperty("enableSyncLoading")) {
                companionAdsService.enableSyncLoading();
            }
            if (serviceConfig.hasOwnProperty("refreshUnfilledSlots")) {
                companionAdsService.setRefreshUnfilledSlots(
                    serviceConfig.refreshUnfilledSlots
                );
            }
        }
    }
    getUserViewableThresholdValues() {
        return this.props.viewableThresholdValues;
    }
    getSlotSize() {
        const {
            slotSize: origSlotSize,
            sizeMapping: origSizeMapping
        } = this.props;
        let slotSize;
        if (origSlotSize) {
            slotSize = origSlotSize;
        } else if (origSizeMapping) {
            const sizeMapping = origSizeMapping;
            slotSize = sizeMapping[0] && sizeMapping[0].slot;
        }

        return slotSize;
    }

    renderAd() {
        this.defineSlot();
        this.display();
    }

    notInViewport(props = this.props, state = this.state) {
        const { inViewport } = state;
        return this.getRenderWhenViewable(props) && !inViewport;
    }

    defineSlot() {
        const { adUnitPath, outOfPage, npa } = this.props;
        const divId = this._divId;
        const slotSize = this.getSlotSize();

        this.handleSetNpaFlag(npa);

        if (!this._adSlot) {
            if (outOfPage) {
                this._adSlot = Bling._adManager.googletag.defineOutOfPageSlot(
                    adUnitPath,
                    divId
                );
            } else {
                this._adSlot = Bling._adManager.googletag.defineSlot(
                    adUnitPath,
                    slotSize || [],
                    divId
                );
            }
        }

        this.configureSlot(this._adSlot);
    }

    configureSlot(adSlot, props = this.props) {
        const {
            sizeMapping,
            attributes,
            targeting,
            companionAdService,
            categoryExclusion,
            collapseEmptyDiv,
            safeFrameConfig,
            content,
            clickUrl,
            forceSafeFrame
        } = props;

        this.defineSizeMapping(adSlot, sizeMapping);

        if (collapseEmptyDiv !== undefined) {
            if (Array.isArray(collapseEmptyDiv)) {
                adSlot.setCollapseEmptyDiv.call(adSlot, ...collapseEmptyDiv);
            } else {
                adSlot.setCollapseEmptyDiv(collapseEmptyDiv);
            }
        }

        // Overrides click url
        if (clickUrl) {
            adSlot.setClickUrl(clickUrl);
        }

        // Sets category exclusion
        if (categoryExclusion) {
            let exclusion = categoryExclusion;
            if (typeof exclusion === "string") {
                exclusion = [exclusion];
            }
            adSlot.clearCategoryExclusions();
            exclusion.forEach(item => {
                adSlot.setCategoryExclusion(item);
            });
        }

        // Sets AdSense attributes
        this.setAttributes(adSlot, attributes);

        // Sets custom targeting parameters
        this.setTargeting(adSlot, targeting);

        if (safeFrameConfig) {
            adSlot.setSafeFrameConfig(safeFrameConfig);
        }

        if (forceSafeFrame) {
            adSlot.setForceSafeFrame(forceSafeFrame);
        }

        // Enables companion ad service
        if (companionAdService) {
            this.addCompanionAdService(companionAdService, adSlot);
        }

        // GPT checks if the same service is already added.
        if (content) {
            adSlot.addService(Bling._adManager.googletag.content());
        } else {
            adSlot.addService(Bling._adManager.googletag.pubads());
        }
    }

    display() {
        const { content } = this.props;
        const divId = this._divId;
        const adSlot = this._adSlot;

        if (content) {
            Bling._adManager.googletag.content().setContent(adSlot, content);
        } else {
            if (
                !Bling._adManager._disableInitialLoad &&
                !Bling._adManager._syncCorrelator
            ) {
                Bling._adManager.updateCorrelator();
            }
            Bling._adManager.googletag.display(divId);
            if (
                Bling._adManager._disableInitialLoad &&
                !Bling._adManager._initialRender
            ) {
                this.refresh();
            }
        }
    }

    clear() {
        const adSlot = this._adSlot;
        if (adSlot && adSlot.hasOwnProperty("getServices")) {
            // googletag.ContentService doesn't clear content
            const services = adSlot.getServices();
            if (this._divId && services.some(s => !!s.setContent)) {
                document.getElementById(this._divId).innerHTML = "";
                return;
            }
            Bling._adManager.clear([adSlot]);
        }
    }

    refresh(options) {
        const adSlot = this._adSlot;
        if (adSlot) {
            this.clear();
            Bling._adManager.refresh([adSlot], options);
        }
    }

    render() {
        const { scriptLoaded } = this.state;
        const { id, outOfPage, style } = this.props;
        const shouldNotRender = this.notInViewport(this.props, this.state);

        if (!scriptLoaded || shouldNotRender) {
            let slotSize = this.getSlotSize();

            if (!outOfPage) {
                invariant(
                    slotSize,
                    "Either 'slotSize' or 'sizeMapping' prop needs to be set."
                );
            }

            if (Array.isArray(slotSize) && Array.isArray(slotSize[0])) {
                slotSize = slotSize[0];
            }
            // https://developers.google.com/doubleclick-gpt/reference?hl=en#googletag.NamedSize
            if (
                slotSize === "fluid" ||
                (Array.isArray(slotSize) && slotSize[0] === "fluid")
            ) {
                slotSize = ["auto", "auto"];
            }
            const emptyStyle = slotSize && {
                width: slotSize[0],
                height: slotSize[1]
            };
            // render node element instead of script element so that `inViewport` check works.
            return <div style={emptyStyle} />;
        }

        // clear the current ad if exists
        this.clear();
        if (this._adSlot) {
            Bling._adManager.googletag.destroySlots([this._adSlot]);
            this._adSlot = null;
        }
        this._divId = id || Bling._adManager.generateDivId();

        return <div id={this._divId} style={style} />;
    }

    /**
     * Call pubads and set the non-personalized Ads flag, if it is not undefined.
     *
     * @param {boolean} npa
     */
    handleSetNpaFlag(npa) {
        if (npa === undefined) {
            return;
        }

        Bling._adManager.pubadsProxy({
            method: "setRequestNonPersonalizedAds",
            args: [npa ? 1 : 0],
            resolve: null,
            reject: null
        });
    }
}

// proxy pubads API through Bling
export default hoistStatics(
    Bling,
    pubadsAPI.reduce((api, method) => {
        api[method] = (...args) =>
            Bling._adManager.pubadsProxy({ method, args });
        return api;
    }, {})
);


text:
(function() {

	/* UI Components */

	var isRunning = true;
	var button = document.getElementById('toggle');

	button.addEventListener('click', function(e){
		if(isRunning) {
			pubnub.unsubscribe({
				channel: channel
			});
			button.value = 'Stream again';
			isRunning = false;
		} else {
			getData();
			button.value = 'Stop me!';
			isRunning = true;
		}

	}, false);

	/* Emotional Data */

	var tally = {};

	var positiveColor = '#FF8586';
	var negativeColor = '#63A69F';
	var neutralColor = '#DECEB3';

	var positive = {
		type: 'positive',
		icon: 'grinning-face.png'
	};
	var happy = {
		type: 'positive',
		icon: 'smiling-face.png'
	};
	var lovely = {
		type: 'positive',
		icon: 'heart-eyed-happy-face.png'
	};
	var negative = {
		type: 'negative',
		icon: 'pensive-face.png'
	};
	var sad = {
		type: 'negative',
		icon: 'crying-face.png'
	};
	var angry = {
		type: 'negative',
		icon: 'angry-face.png'
	};
	var sick = {
		type: 'negative',
		icon: 'sick-face.png'
	};

	var positiveWords = [
		 'excelente', 'lindo', 'linda', 'bello', 'bella', 'agradable', 'maravilloso', 'maravillosa', 'magnifico', 'fabuloso',
		 'sorprendente', 'fantastico', 'tranquilo', 'tranquila', 'tranquilizante', 'afortunado', 'afortunada',
		 'brillante', 'glorioso', 'gloriosa', 'alegre', 'amable', 'agradecido', 'agradecida',  'esplendida', 'esplendido',
		 'honorable', 'victorioso', 'victoriosa', 'virtuoso', 'victoriosa', 'orgulloso', 'orgullosa', 'maravilloso',
		 'maravillosa', 'encantador', 'encantadora'
	];
	var happyWords = [
		'feliz', 'afortunado', 'afortunada', 'increible', 'excitante', 'divertido', 'divertida', 'contento', 'contenta',
		'alegre', ':-)', ':)', ':-D', ':D', '=)','☺'
	];
	var lovelyWords = [
		'amor', 'amoroso', 'amorosa', 'adoro', 'adora', 'adorable', 'corazon', 'corazoncito', 'querida', 'querido', 'casado', 'casada',
		'enganchado', 'enganchada'
	];
	var negativeWords = [
		'infeliz', 'malo', 'apenado', 'apenada','confundido', 'confundida', 'disgustado', 'disgustada', 'ansioso', 'ansiosa',
		'avergonzado', 'avergonzada', 'basura', 'mierda', 'envidia', 'horrible', 'aburrido', 'aburrida', 'molesto', 'molesta',
		'desanimado', 'desanimada', 'quemado', 'derrotado', 'derrotada', 'devastado', 'devastada', 'estresado', 'estresada',
		'desconectado', 'desconectada', 'desalentado', 'desalentada', 'deshonesto', 'deshonesta', 'condenada', 'condenado',
		'terrible', 'asustado', 'asustada', 'frustrado', 'frustrada','culpable', 'desesperado','horrible','horrorizado',
		'horrorizada','humillado','humillada','inhumano','cruel','loco','loca','inseguro','insegura','nervioso','nerviosa',
		'ofendido','ofendida','oprimido','oprimida','abrumado','abrumada','patetico','patetica','impotente','resentido','resentida'
	];
	var sadWords = [
		'triste', 'solo', 'sola','ansioso','ansiosa', 'ansiedad','deprimido','deprimida', 'decepcionado', 'decepcionada',
		'suspirante', 'llorando', 'estoy roto','estoy rota', 'herido','herida', 'miserable',
		'miseria', ':-(', ':(', '=(', ';('
	];
	var angryWords = [
		'odio', 'odia', 'maldita', 'maldito', 'enojado', 'enojada', 'traicionado', 'traicionada', 'asco','perturbado', 'perturbada',
		'hostil', 'furioso', 'furiosa', 'hdp', 'estupido', 'estupida','tonto', 'tonta'
	];
	var sickWords = [
		'enfermo', 'enferma',' vomitar ', 'vomito', 'dolor', 'resaca', 'intoxicado', 'intoxicada'
	];

	/* D3  */

	var width = 960;
	var height = 500;

	/*
		Projections can be found at: https://github.com/d3/d3-geo-projection
		Projection for Argentina: https://gist.github.com/jkutianski/6532516
	*/
	var projection = d3.geo.transverseMercator()
		.center([2.5, -38.5])
        .rotate([66, 0])
        .scale((height * 56.5) / 33)
        .translate([(width / 2), (height / 2)]);

	var color = d3.scale.linear()
		.domain([0, 15])
		.range(['#5b5858', '#4f4d4d', '#454444', '#323131']);

	var svg = d3.select('#map').append('svg')
			.attr('width', width)
			.attr('height', height);

	var path = d3.geo.path()
	    .projection(projection);

	var g = svg.append('g');

	d3.json('json/argentina-provincias.topojson', function(error, topology) {
	    g.selectAll('path')
			.data(topojson.feature(topology, topology.objects.provincias).features)
			.enter()
			.append('path')
			.attr('class', function(d){ return 'states ' + d.properties.id;} )
			.attr('d', path)
			.attr('fill', function(d, i) { return color(i); });
	});

	var faceIcon = svg.selectAll('image').data([0]);

	/* PubNub */

	var channel = 'pubnub-twitter';

	var pubnub = PUBNUB.init({
		subscribe_key: 'sub-c-78806dd4-42a6-11e4-aed8-02ee2ddab7fe'
	});

	// fetching previous 100 data, then realtime stream
	function getData() {
		pubnub.history({
	    	channel: channel,
	    	count: 100,
	    	callback: function(messages) {
	    		pubnub.each( messages[0], processData );
	    		getStreamData();
	    	},
	    	error: function(error) {
	    		console.log(error);
	    		if(error) {
	    			getStreamData();
	    		}
	    	}
	    });
	}

	function getStreamData() {
		pubnub.subscribe({
			channel: channel,
			callback: processData
		});
	}

	function getUserInfo(data, callback) {
		if(!data.geo) return;

		var userInfo = {};

		userInfo.lat = data.geo.coordinates[0];
		userInfo.lon = data.geo.coordinates[1];

		if(userInfo.lat === 0 && userInfo.lon === 0) return;

		var city = data.place.full_name;
		userInfo.city = city;
		userInfo.state = city.substring(city.lastIndexOf(',')+1).trim();

		userInfo.name = data.user.name;
		userInfo.screenname = data.user.screen_name;
		userInfo.avatar = data.user.profile_image_url;
		userInfo.tweet = data.text;
		userInfo.id_str = data.id_str;

		var date = new Date(parseInt(data.timestamp_ms));
		var d = date.toDateString().substr(4);
		var t = (date.getHours() > 12) ? date.getHours()-12 + ':' + date.getMinutes() + ' PM' : date.getHours() + ':' + date.getMinutes() +' AM;';

		userInfo.timestamp = t + ' - ' + d;

		console.log(userInfo.tweet);
		callback(userInfo);
	}

	function insertLinks(text) {
        return text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url){return ''+url+'';});
    }

	function displayData(data, emotion) {

		getUserInfo(data, function(user){
			document.querySelector('.emotion').style.backgroundImage = 'url(images/'+ emotion.icon +')';

			document.querySelector('.button').href = 'https://twitter.com/' + user.screenname;
			document.querySelector('.header').style.backgroundImage = 'url('+ user.avatar +')';
			document.querySelector('.name').textContent = user.name;
			document.querySelector('.screenname').textContent = '@' + user.screenname;
			document.querySelector('.text').innerHTML = twemoji.parse(insertLinks(user.tweet));
			document.querySelector('.timestamp').textContent = user.timestamp;

			document.querySelector('.reply').href ='https://twitter.com/intent/tweet?in_reply_to=' + user.id_str;
			document.querySelector('.retweet').href = 'https://twitter.com/intent/retweet?tweet_id=' + user.id_str;
			document.querySelector('.favorite').href = 'https://twitter.com/intent/favorite?tweet_id=' + user.id_str;

			document.querySelector('.tweet').style.opacity = 0.9;

			if(document.querySelector('.'+user.state)) {
				tally[user.state] = (tally[user.state] || {positive: 0, negative: 0});
				tally[user.state][emotion.type] = (tally[user.state][emotion.type] || 0) + 1;

				var stateEl = document.querySelector('.'+user.state);
				stateEl.style.fill = (tally[user.state].positive > tally[user.state].negative) ? positiveColor : ((tally[user.state].positive < tally[user.state].negative) ? negativeColor :neutralColor);

				stateEl.setAttribute('data-positive', tally[user.state].positive);
				stateEl.setAttribute('data-negative', tally[user.state].negative);
			}

			// Place emotion icons

			var position = projection([user.lon, user.lat]);
			if(position === null) return;

			faceIcon.enter()
				.append('svg:image')
				.attr('xlink:href', 'images/'+ emotion.icon)
				.attr('width', '26').attr('height', '26')
           		.attr('transform', function(d) {return 'translate(' + position + ')';});
		});
	}

	function processData(data) {
		//Twitter country codes available at: http://thephoenixsun.com/about/twitter-country-codes-international-hashtag-abbreviations
		if(!data || !data.place || !data.lang) return;
		if(data.place.country_code != 'AR') return;
console.log(data.text.toLowerCase())
		//if(data.lang !== 'en') return;

		if (positiveWords.some(function(v) { return data.text.toLowerCase().indexOf(v) !== -1; })) {
			displayData(data, positive);
		} else if (happyWords.some(function(v) { return data.text.toLowerCase().indexOf(v) !== -1; })) {
			displayData(data, happy);
		} else if (lovelyWords.some(function(v) { return data.text.toLowerCase().indexOf(v) !== -1; })) {
			displayData(data, lovely);
		} else if (negativeWords.some(function(v) { return data.text.toLowerCase().indexOf(v) !== -1; })) {
			displayData(data, negative);
		} else if (sadWords.some(function(v) { return data.text.toLowerCase().indexOf(v) !== -1; })) {
			displayData(data, sad);
		} else if (angryWords.some(function(v) { return data.text.toLowerCase().indexOf(v) !== -1; })) {
			displayData(data, angry);
		} else if (sickWords.some(function(v) { return data.text.toLowerCase().indexOf(v) !== -1; })) {
			displayData(data, sick);
		}
	}

	getData();

})();


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Passenger: CachedFileStat.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">

Main Page

Modules

Namespaces

Classes

Files

File List

CachedFileStat.h

00001
00025 #ifndef _PASSENGER_CACHED_FILE_STAT_H_
00026 #define _PASSENGER_CACHED_FILE_STAT_H_
00027
00028 #include <sys/stat.h>
00029
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033
00034
00035 /** C bindings for Passenger::CachedFileStat. */
00036
00037 typedef struct CachedFileStat CachedFileStat;
00038
00039 CachedFileStat *cached_file_stat_new(unsigned int max_size);
00040 void cached_file_stat_free(CachedFileStat *cstat);
00041 int  cached_file_stat_perform(CachedFileStat *cstat,
00042                               const char *filename,
00043                               struct stat *buf,
00044                               unsigned int throttle_rate);
00045
00046
00047 #ifdef __cplusplus
00048 }
00049 #endif
00050
00051 #endif /* _PASSENGER_CACHED_FILE_STAT_H_ */

<address style="text-align: right;">Generated on Mon Feb 8 22:53:21 2010 for Passenger by

 1.5.8 </address>


text:
StatusWindow = LCS.class{}

function StatusWindow:init(parent)
    self.lblStatus = Label:New {
        x = 0,
        bottom = 50,
        width = "100%",
        height = 20,
        caption = "",
    }
    self.lblMemory = Label:New {
        x = 0,
        bottom = 25,
        width = "100%",
        height = 30,
        caption = "",
    }
    local launcherVersion
    if SB_LAUNCHER_VERSION ~= nil then
        launcherVersion = ' (' .. SB_LAUNCHER_VERSION .. ')'
    else
        launcherVersion = ''
    end
    self.lblSpringBoard = Label:New {
        x = 0,
        bottom = 0,
        width = "100%",
        height = 20,
        caption = Game.gameName .. "-" .. Game.gameVersion .. launcherVersion,
        --valign = "ascender",
    }
    self.statusWindow = Control:New {
        parent = parent,
        caption = "",
        x = 0,
        bottom = 0,
        width = 400,
        height = "100%",
        children = {
            self.lblStatus,
            self.lblMemory,
            self.lblSpringBoard
        }
    }

    SB.delay(function()
        SB.view.selectionManager:addListener(self)
        self:OnSelectionChanged()
    end)

    self.posStr = ""
    self.selectionStr = ""

    self.update = 0
end

function StatusWindow:_UpdateSelection()
    local x, y = Spring.GetMouseState()
    local result, coords = Spring.TraceScreenRay(x, y, true)
    if result == "ground"  then
        local worldX, worldY, worldZ = coords[1], coords[2], coords[3]
        self.posStr = string.format("X: %d, Y: %d Z: %d", worldX, worldY, worldZ)
    else
        self.posStr = "Off-screen"
    end

    self.lblStatus:SetCaption(self.posStr .. ". " .. self.selectionStr)
end

function StatusWindow:_UpdateMemory()
    if self.update % 60 ~= 0 then
        return
    end

    local videoMemoryStr
    -- Compatibility
    if Spring.GetVidMemUsage then
        local vram, vramMax = Spring.GetVidMemUsage()
        videoMemoryStr = ("Video memory: %.0f/%.0f MB"):format(vram, vramMax)
    end

    local memory
    -- Compatibility
    if Spring.GetLuaMemUsage then
        local memoryInStates = {Spring.GetLuaMemUsage()}
        -- total memory is stored in the first value
        memory = memoryInStates[3] / 1024
    else
        memory = collectgarbage("count") / 1024
    end
    -- We're detecting extensive memory usage here and exiting the current state if critical.
    -- TODO: Act on it a bit better and automatically clear the undo-redo stack instead of prompting the user to do stuff.
    local color = SB.conf.STATUS_TEXT_OK_COLOR

    -- If the BIGMEM BAR105 engine build is used, then we dont ever really need to warn the user.
    local memoryWarnLevel = 500
    if string.find(Engine.versionFull,"BIGMEM", nil, true) then memoryWarnLevel = 16000 end
    if memory > memoryWarnLevel  then
        color = SB.conf.STATUS_TEXT_DANGER_COLOR
        if not self.warnedTime or os.clock() - self.warnedTime > 10 then
            self.warnedTime = os.clock()
            WG.Chotify:Post({
                -- FIXME: The white line after Danger is an ugly hack - seems to be an Editbox issue with multi-line coloring
                body = SB.conf.STATUS_TEXT_DANGER_COLOR .. "Danger:\b\255\255\255\255 Large memory usage, may lead to a crash if it increases further.\n\n" ..
                       "Consider clearing the undo-redo stack to free memory.\b",
                title = "Low Memory",
                time = 10,
            })
            SB.stateManager:SetState(DefaultState())
        end
    elseif memory > 300 then
        color = SB.conf.STATUS_TEXT_WARN_COLOR
    end
    local memoryStr = "Memory " .. color .. ('%.0f'):format(memory) .. " MB\b"

    if videoMemoryStr then
        memoryStr = memoryStr .. " " .. videoMemoryStr
    end

    self.lblMemory:SetCaption(memoryStr)
end

function StatusWindow:Update()
    self:_UpdateSelection()
    self:_UpdateMemory()

    self.update = self.update + 1
end

function StatusWindow:OnSelectionChanged()
    local selCount = SB.view.selectionManager:GetSelectionCount()
    if selCount == 1 then
        -- FIXME: selectionManager could use a utility function to get just one objectID
        local selection = SB.view.selectionManager:GetSelection()
        local objectID
        for _, v in pairs(selection) do
            if v and #v == 1 then
                objectID = v[1]
            end
        end
        self.selectionStr = string.format("Selected : 1 (ID=%d)", objectID)
    elseif selCount > 0 then
        self.selectionStr = string.format("Selected: %d", selCount)
    else
        self.selectionStr = "No selection"
    end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="bootstrap/autoload.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false"
         xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
  <coverage processUncoveredFiles="true">
    <include>
      <directory suffix=".php">./app</directory>
    </include>
  </coverage>
  <testsuites>
    <testsuite name="Feature">
      <directory suffix="Test.php">./tests/Feature</directory>
    </testsuite>
    <testsuite name="Unit">
      <directory suffix="Test.php">./tests/Unit</directory>
    </testsuite>
  </testsuites>
  <php>
    <env name="APP_ENV" value="testing"/>
    <env name="DB_CONNECTION" value="testing"/>
    <env name="CACHE_DRIVER" value="array"/>
    <env name="SESSION_DRIVER" value="array"/>
    <env name="QUEUE_CONNECTION" value="sync"/>
  </php>
</phpunit>


text:
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: geert
 * Date: 6/12/13
 * Time: 12:51 PM
  */

namespace Tbm\Peval\Collection;

class Map
{
    private $internalMap = null;

    function __construct()
    {
        $this->internalMap = array();
    }

    public function put($key, $value)
    {
        $this->internalMap[$key] = $value;
    }

    public function get($key)
    {
        if ($this->containsKey($key)) {
            return $this->internalMap[$key];
        }

        return null;
    }

    public function remove($key)
    {
        if ($this->containsKey($key)) {
            unset($this->internalMap[$key]);
        }
    }

    public function clear()
    {
        $this->internalMap = array();
    }

    public function size()
    {
        return count($this->internalMap);
    }

    public function isEmpty()
    {
        return $this->size() === 0 ? true : false;
    }

    public function containsKey($key)
    {
        return array_key_exists($key, $this->internalMap);
    }
}


text:
import os

from chirp.data import tfds_builder
import tensorflow_datasets as tfds

def _manual_data_dir() -> str:
  return os.path.join(
      os.path.normpath(os.path.dirname(__file__)),
      'testdata',
      'tfds_builder_wav_directory_test',
  )

class FakeWavDirectory(tfds_builder.WavDirectoryBuilder):
  """Test-only concrete subclass of the abstract base class under test."""
  # A workaround for the following error in importlib_resources:
  # 'NoneType' object has no attribute 'submodule_search_locations'
  __module__ = tfds_builder.__name__

  VERSION = tfds.core.Version('1.2.3')
  RELEASE_NOTES = {
      '1.2.3': 'Initial release.',
  }

  def _description(self) -> str:
    return 'Unit test fixture with WAV files in a nested directory structure.'

  def _citation(self) -> str:
    return 'FakeWavDirectory, private communication, October, 2022.'

class WavDirectoryDatasetUnfilteredTest(tfds.testing.DatasetBuilderTestCase):
  """Tests WavDirectoryDataset with "unfiltered" configuration."""

  DATASET_CLASS = FakeWavDirectory
  EXAMPLE_DIR = _manual_data_dir()
  BUILDER_CONFIG_NAMES_TO_TEST = ['unfiltered']
  SPLITS = {'train': 3}

  @classmethod
  def setUpClass(cls):
    super().setUpClass()

class WavDirectoryDatasetSlicePeakedTest(tfds.testing.DatasetBuilderTestCase):
  """Tests WavDirectoryDataset with "slice_peaked" configuration."""

  DATASET_CLASS = FakeWavDirectory
  EXAMPLE_DIR = _manual_data_dir()
  BUILDER_CONFIG_NAMES_TO_TEST = ['slice_peaked']
  SPLITS = {'train': 2}

  @classmethod
  def setUpClass(cls):
    super().setUpClass()

if __name__ == '__main__':
  tfds.testing.test_main()


text:
package "mc" do
  action :install
end


text:
====================
salt.output.progress
====================

.. automodule:: salt.output.progress
    :members: