text:
<?php
/**
 * Twenty Sixteen Customizer functionality
 *
 * @package WordPress
 * @subpackage Twenty_Sixteen
 * @since Twenty Sixteen 1.0
 */

/**
 * Sets up the WordPress core custom header and custom background features.
 *
 * @since Twenty Sixteen 1.0
 *
 * @see twentysixteen_header_style()
 */
function twentysixteen_custom_header_and_background() {
	$color_scheme             = twentysixteen_get_color_scheme();
	$default_background_color = trim( $color_scheme[0], '#' );
	$default_text_color       = trim( $color_scheme[3], '#' );

	/**
	 * Filter the arguments used when adding 'custom-background' support in Twenty Sixteen.
	 *
	 * @since Twenty Sixteen 1.0
	 *
	 * @param array $args {
	 *     An array of custom-background support arguments.
	 *
	 *     @type string $default-color Default color of the background.
	 * }
	 */
	add_theme_support( 'custom-background', apply_filters( 'twentysixteen_custom_background_args', array(
		'default-color' => $default_background_color,
	) ) );

	/**
	 * Filter the arguments used when adding 'custom-header' support in Twenty Sixteen.
	 *
	 * @since Twenty Sixteen 1.0
	 *
	 * @param array $args {
	 *     An array of custom-header support arguments.
	 *
	 *     @type string $default-text-color Default color of the header text.
	 *     @type int      $width            Width in pixels of the custom header image. Default 1200.
	 *     @type int      $height           Height in pixels of the custom header image. Default 280.
	 *     @type bool     $flex-height      Whether to allow flexible-height header images. Default true.
	 *     @type callable $wp-head-callback Callback function used to style the header image and text
	 *                                      displayed on the blog.
	 * }
	 */
	add_theme_support( 'custom-header', apply_filters( 'twentysixteen_custom_header_args', array(
		'default-text-color'     => $default_text_color,
		'width'                  => 1200,
		'height'                 => 280,
		'flex-height'            => true,
		'wp-head-callback'       => 'twentysixteen_header_style',
	) ) );
}
add_action( 'after_setup_theme', 'twentysixteen_custom_header_and_background' );

if ( ! function_exists( 'twentysixteen_header_style' ) ) :
/**
 * Styles the header text displayed on the site.
 *
 * Create your own twentysixteen_header_style() function to override in a child theme.
 *
 * @since Twenty Sixteen 1.0
 *
 * @see twentysixteen_custom_header_and_background().
 */
function twentysixteen_header_style() {
	// If the header text option is untouched, let's bail.
	if ( display_header_text() ) {
		return;
	}

	// If the header text has been hidden.
	?>
	<style type="text/css" id="twentysixteen-header-css">
		.site-branding {
			margin: 0 auto 0 0;
		}

		.site-branding .site-title,
		.site-description {
			clip: rect(1px, 1px, 1px, 1px);
			position: absolute;
		}
	</style>
	<?php
}
endif; // twentysixteen_header_style

/**
 * Adds postMessage support for site title and description for the Customizer.
 *
 * @since Twenty Sixteen 1.0
 *
 * @param WP_Customize_Manager $wp_customize The Customizer object.
 */
function twentysixteen_customize_register( $wp_customize ) {
	$color_scheme = twentysixteen_get_color_scheme();

	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';

	if ( isset( $wp_customize->selective_refresh ) ) {
		$wp_customize->selective_refresh->add_partial( 'blogname', array(
			'selector' => '.site-title a',
			'container_inclusive' => false,
			'render_callback' => 'twentysixteen_customize_partial_blogname',
		) );
		$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
			'selector' => '.site-description',
			'container_inclusive' => false,
			'render_callback' => 'twentysixteen_customize_partial_blogdescription',
		) );
	}

	// Add color scheme setting and control.
	$wp_customize->add_setting( 'color_scheme', array(
		'default'           => 'default',
		'sanitize_callback' => 'twentysixteen_sanitize_color_scheme',
		'transport'         => 'postMessage',
	) );

	$wp_customize->add_control( 'color_scheme', array(
		'label'    => __( 'Base Color Scheme', 'twentysixteen' ),
		'section'  => 'colors',
		'type'     => 'select',
		'choices'  => twentysixteen_get_color_scheme_choices(),
		'priority' => 1,
	) );

	// Add page background color setting and control.
	$wp_customize->add_setting( 'page_background_color', array(
		'default'           => $color_scheme[1],
		'sanitize_callback' => 'sanitize_hex_color',
		'transport'         => 'postMessage',
	) );

	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'page_background_color', array(
		'label'       => __( 'Page Background Color', 'twentysixteen' ),
		'section'     => 'colors',
	) ) );

	// Remove the core header textcolor control, as it shares the main text color.
	$wp_customize->remove_control( 'header_textcolor' );

	// Add link color setting and control.
	$wp_customize->add_setting( 'link_color', array(
		'default'           => $color_scheme[2],
		'sanitize_callback' => 'sanitize_hex_color',
		'transport'         => 'postMessage',
	) );

	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array(
		'label'       => __( 'Link Color', 'twentysixteen' ),
		'section'     => 'colors',
	) ) );

	// Add main text color setting and control.
	$wp_customize->add_setting( 'main_text_color', array(
		'default'           => $color_scheme[3],
		'sanitize_callback' => 'sanitize_hex_color',
		'transport'         => 'postMessage',
	) );

	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'main_text_color', array(
		'label'       => __( 'Main Text Color', 'twentysixteen' ),
		'section'     => 'colors',
	) ) );

	// Add secondary text color setting and control.
	$wp_customize->add_setting( 'secondary_text_color', array(
		'default'           => $color_scheme[4],
		'sanitize_callback' => 'sanitize_hex_color',
		'transport'         => 'postMessage',
	) );

	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'secondary_text_color', array(
		'label'       => __( 'Secondary Text Color', 'twentysixteen' ),
		'section'     => 'colors',
	) ) );
}
add_action( 'customize_register', 'twentysixteen_customize_register', 11 );

/**
 * Render the site title for the selective refresh partial.
 *
 * @since Twenty Sixteen 1.2
 * @see twentysixteen_customize_register()
 *
 * @return void
 */
function twentysixteen_customize_partial_blogname() {
	bloginfo( 'name' );
}

/**
 * Render the site tagline for the selective refresh partial.
 *
 * @since Twenty Sixteen 1.2
 * @see twentysixteen_customize_register()
 *
 * @return void
 */
function twentysixteen_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

/**
 * Registers color schemes for Twenty Sixteen.
 *
 * Can be filtered with {@see 'twentysixteen_color_schemes'}.
 *
 * The order of colors in a colors array:
 * 1. Main Background Color.
 * 2. Page Background Color.
 * 3. Link Color.
 * 4. Main Text Color.
 * 5. Secondary Text Color.
 *
 * @since Twenty Sixteen 1.0
 *
 * @return array An associative array of color scheme options.
 */
function twentysixteen_get_color_schemes() {
	/**
	 * Filter the color schemes registered for use with Twenty Sixteen.
	 *
	 * The default schemes include 'default', 'dark', 'gray', 'red', and 'yellow'.
	 *
	 * @since Twenty Sixteen 1.0
	 *
	 * @param array $schemes {
	 *     Associative array of color schemes data.
	 *
	 *     @type array $slug {
	 *         Associative array of information for setting up the color scheme.
	 *
	 *         @type string $label  Color scheme label.
	 *         @type array  $colors HEX codes for default colors prepended with a hash symbol ('#').
	 *                              Colors are defined in the following order: Main background, page
	 *                              background, link, main text, secondary text.
	 *     }
	 * }
	 */
	return apply_filters( 'twentysixteen_color_schemes', array(
		'default' => array(
			'label'  => __( 'Default', 'twentysixteen' ),
			'colors' => array(
				'#1a1a1a',
				'#ffffff',
				'#007acc',
				'#1a1a1a',
				'#686868',
			),
		),
		'dark' => array(
			'label'  => __( 'Dark', 'twentysixteen' ),
			'colors' => array(
				'#262626',
				'#1a1a1a',
				'#9adffd',
				'#e5e5e5',
				'#c1c1c1',
			),
		),
		'gray' => array(
			'label'  => __( 'Gray', 'twentysixteen' ),
			'colors' => array(
				'#616a73',
				'#4d545c',
				'#c7c7c7',
				'#f2f2f2',
				'#f2f2f2',
			),
		),
		'red' => array(
			'label'  => __( 'Red', 'twentysixteen' ),
			'colors' => array(
				'#ffffff',
				'#ff675f',
				'#640c1f',
				'#402b30',
				'#402b30',
			),
		),
		'yellow' => array(
			'label'  => __( 'Yellow', 'twentysixteen' ),
			'colors' => array(
				'#3b3721',
				'#ffef8e',
				'#774e24',
				'#3b3721',
				'#5b4d3e',
			),
		),
	) );
}

if ( ! function_exists( 'twentysixteen_get_color_scheme' ) ) :
/**
 * Retrieves the current Twenty Sixteen color scheme.
 *
 * Create your own twentysixteen_get_color_scheme() function to override in a child theme.
 *
 * @since Twenty Sixteen 1.0
 *
 * @return array An associative array of either the current or default color scheme HEX values.
 */
function twentysixteen_get_color_scheme() {
	$color_scheme_option = get_theme_mod( 'color_scheme', 'default' );
	$color_schemes       = twentysixteen_get_color_schemes();

	if ( array_key_exists( $color_scheme_option, $color_schemes ) ) {
		return $color_schemes[ $color_scheme_option ]['colors'];
	}

	return $color_schemes['default']['colors'];
}
endif; // twentysixteen_get_color_scheme

if ( ! function_exists( 'twentysixteen_get_color_scheme_choices' ) ) :
/**
 * Retrieves an array of color scheme choices registered for Twenty Sixteen.
 *
 * Create your own twentysixteen_get_color_scheme_choices() function to override
 * in a child theme.
 *
 * @since Twenty Sixteen 1.0
 *
 * @return array Array of color schemes.
 */
function twentysixteen_get_color_scheme_choices() {
	$color_schemes                = twentysixteen_get_color_schemes();
	$color_scheme_control_options = array();

	foreach ( $color_schemes as $color_scheme => $value ) {
		$color_scheme_control_options[ $color_scheme ] = $value['label'];
	}

	return $color_scheme_control_options;
}
endif; // twentysixteen_get_color_scheme_choices

if ( ! function_exists( 'twentysixteen_sanitize_color_scheme' ) ) :
/**
 * Handles sanitization for Twenty Sixteen color schemes.
 *
 * Create your own twentysixteen_sanitize_color_scheme() function to override
 * in a child theme.
 *
 * @since Twenty Sixteen 1.0
 *
 * @param string $value Color scheme name value.
 * @return string Color scheme name.
 */
function twentysixteen_sanitize_color_scheme( $value ) {
	$color_schemes = twentysixteen_get_color_scheme_choices();

	if ( ! array_key_exists( $value, $color_schemes ) ) {
		return 'default';
	}

	return $value;
}
endif; // twentysixteen_sanitize_color_scheme

/**
 * Enqueues front-end CSS for color scheme.
 *
 * @since Twenty Sixteen 1.0
 *
 * @see wp_add_inline_style()
 */
function twentysixteen_color_scheme_css() {
	$color_scheme_option = get_theme_mod( 'color_scheme', 'default' );

	// Don't do anything if the default color scheme is selected.
	if ( 'default' === $color_scheme_option ) {
		return;
	}

	$color_scheme = twentysixteen_get_color_scheme();

	// Convert main text hex color to rgba.
	$color_textcolor_rgb = twentysixteen_hex2rgb( $color_scheme[3] );

	// If the rgba values are empty return early.
	if ( empty( $color_textcolor_rgb ) ) {
		return;
	}

	// If we get this far, we have a custom color scheme.
	$colors = array(
		'background_color'      => $color_scheme[0],
		'page_background_color' => $color_scheme[1],
		'link_color'            => $color_scheme[2],
		'main_text_color'       => $color_scheme[3],
		'secondary_text_color'  => $color_scheme[4],
		'border_color'          => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.2)', $color_textcolor_rgb ),

	);

	$color_scheme_css = twentysixteen_get_color_scheme_css( $colors );

	wp_add_inline_style( 'twentysixteen-style', $color_scheme_css );
}
add_action( 'wp_enqueue_scripts', 'twentysixteen_color_scheme_css' );

/**
 * Binds the JS listener to make Customizer color_scheme control.
 *
 * Passes color scheme data as colorScheme global.
 *
 * @since Twenty Sixteen 1.0
 */
function twentysixteen_customize_control_js() {
	wp_enqueue_script( 'color-scheme-control', get_template_directory_uri() . '/js/color-scheme-control.js', array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), '20160816', true );
	wp_localize_script( 'color-scheme-control', 'colorScheme', twentysixteen_get_color_schemes() );
}
add_action( 'customize_controls_enqueue_scripts', 'twentysixteen_customize_control_js' );

/**
 * Binds JS handlers to make the Customizer preview reload changes asynchronously.
 *
 * @since Twenty Sixteen 1.0
 */
function twentysixteen_customize_preview_js() {
	wp_enqueue_script( 'twentysixteen-customize-preview', get_template_directory_uri() . '/js/customize-preview.js', array( 'customize-preview' ), '20160816', true );
}
add_action( 'customize_preview_init', 'twentysixteen_customize_preview_js' );

/**
 * Returns CSS for the color schemes.
 *
 * @since Twenty Sixteen 1.0
 *
 * @param array $colors Color scheme colors.
 * @return string Color scheme CSS.
 */
function twentysixteen_get_color_scheme_css( $colors ) {
	$colors = wp_parse_args( $colors, array(
		'background_color'      => '',
		'page_background_color' => '',
		'link_color'            => '',
		'main_text_color'       => '',
		'secondary_text_color'  => '',
		'border_color'          => '',
	) );

	return <<<CSS
	/* Color Scheme */

	/* Background Color */
	body {
		background-color: {$colors['background_color']};
	}

	/* Page Background Color */
	.site {
		background-color: {$colors['page_background_color']};
	}

	mark,
	ins,
	button,
	button[disabled]:hover,
	button[disabled]:focus,
	input[type="button"],
	input[type="button"][disabled]:hover,
	input[type="button"][disabled]:focus,
	input[type="reset"],
	input[type="reset"][disabled]:hover,
	input[type="reset"][disabled]:focus,
	input[type="submit"],
	input[type="submit"][disabled]:hover,
	input[type="submit"][disabled]:focus,
	.menu-toggle.toggled-on,
	.menu-toggle.toggled-on:hover,
	.menu-toggle.toggled-on:focus,
	.pagination .prev,
	.pagination .next,
	.pagination .prev:hover,
	.pagination .prev:focus,
	.pagination .next:hover,
	.pagination .next:focus,
	.pagination .nav-links:before,
	.pagination .nav-links:after,
	.widget_calendar tbody a,
	.widget_calendar tbody a:hover,
	.widget_calendar tbody a:focus,
	.page-links a,
	.page-links a:hover,
	.page-links a:focus {
		color: {$colors['page_background_color']};
	}

	/* Link Color */
	.menu-toggle:hover,
	.menu-toggle:focus,
	a,
	.main-navigation a:hover,
	.main-navigation a:focus,
	.dropdown-toggle:hover,
	.dropdown-toggle:focus,
	.social-navigation a:hover:before,
	.social-navigation a:focus:before,
	.post-navigation a:hover .post-title,
	.post-navigation a:focus .post-title,
	.tagcloud a:hover,
	.tagcloud a:focus,
	.site-branding .site-title a:hover,
	.site-branding .site-title a:focus,
	.entry-title a:hover,
	.entry-title a:focus,
	.entry-footer a:hover,
	.entry-footer a:focus,
	.comment-metadata a:hover,
	.comment-metadata a:focus,
	.pingback .comment-edit-link:hover,
	.pingback .comment-edit-link:focus,
	.comment-reply-link,
	.comment-reply-link:hover,
	.comment-reply-link:focus,
	.required,
	.site-info a:hover,
	.site-info a:focus {
		color: {$colors['link_color']};
	}

	mark,
	ins,
	button:hover,
	button:focus,
	input[type="button"]:hover,
	input[type="button"]:focus,
	input[type="reset"]:hover,
	input[type="reset"]:focus,
	input[type="submit"]:hover,
	input[type="submit"]:focus,
	.pagination .prev:hover,
	.pagination .prev:focus,
	.pagination .next:hover,
	.pagination .next:focus,
	.widget_calendar tbody a,
	.page-links a:hover,
	.page-links a:focus {
		background-color: {$colors['link_color']};
	}

	input[type="date"]:focus,
	input[type="time"]:focus,
	input[type="datetime-local"]:focus,
	input[type="week"]:focus,
	input[type="month"]:focus,
	input[type="text"]:focus,
	input[type="email"]:focus,
	input[type="url"]:focus,
	input[type="password"]:focus,
	input[type="search"]:focus,
	input[type="tel"]:focus,
	input[type="number"]:focus,
	textarea:focus,
	.tagcloud a:hover,
	.tagcloud a:focus,
	.menu-toggle:hover,
	.menu-toggle:focus {
		border-color: {$colors['link_color']};
	}

	/* Main Text Color */
	body,
	blockquote cite,
	blockquote small,
	.main-navigation a,
	.menu-toggle,
	.dropdown-toggle,
	.social-navigation a,
	.post-navigation a,
	.pagination a:hover,
	.pagination a:focus,
	.widget-title a,
	.site-branding .site-title a,
	.entry-title a,
	.page-links > .page-links-title,
	.comment-author,
	.comment-reply-title small a:hover,
	.comment-reply-title small a:focus {
		color: {$colors['main_text_color']};
	}

	blockquote,
	.menu-toggle.toggled-on,
	.menu-toggle.toggled-on:hover,
	.menu-toggle.toggled-on:focus,
	.post-navigation,
	.post-navigation div + div,
	.pagination,
	.widget,
	.page-header,
	.page-links a,
	.comments-title,
	.comment-reply-title {
		border-color: {$colors['main_text_color']};
	}

	button,
	button[disabled]:hover,
	button[disabled]:focus,
	input[type="button"],
	input[type="button"][disabled]:hover,
	input[type="button"][disabled]:focus,
	input[type="reset"],
	input[type="reset"][disabled]:hover,
	input[type="reset"][disabled]:focus,
	input[type="submit"],
	input[type="submit"][disabled]:hover,
	input[type="submit"][disabled]:focus,
	.menu-toggle.toggled-on,
	.menu-toggle.toggled-on:hover,
	.menu-toggle.toggled-on:focus,
	.pagination:before,
	.pagination:after,
	.pagination .prev,
	.pagination .next,
	.page-links a {
		background-color: {$colors['main_text_color']};
	}

	/* Secondary Text Color */

	/**
	 * IE8 and earlier will drop any block with CSS3 selectors.
	 * Do not combine these styles with the next block.
	 */
	body:not(.search-results) .entry-summary {
		color: {$colors['secondary_text_color']};
	}

	blockquote,
	.post-password-form label,
	a:hover,
	a:focus,
	a:active,
	.post-navigation .meta-nav,
	.image-navigation,
	.comment-navigation,
	.widget_recent_entries .post-date,
	.widget_rss .rss-date,
	.widget_rss cite,
	.site-description,
	.author-bio,
	.entry-footer,
	.entry-footer a,
	.sticky-post,
	.taxonomy-description,
	.entry-caption,
	.comment-metadata,
	.pingback .edit-link,
	.comment-metadata a,
	.pingback .comment-edit-link,
	.comment-form label,
	.comment-notes,
	.comment-awaiting-moderation,
	.logged-in-as,
	.form-allowed-tags,
	.site-info,
	.site-info a,
	.wp-caption .wp-caption-text,
	.gallery-caption,
	.widecolumn label,
	.widecolumn .mu_register label {
		color: {$colors['secondary_text_color']};
	}

	.widget_calendar tbody a:hover,
	.widget_calendar tbody a:focus {
		background-color: {$colors['secondary_text_color']};
	}

	/* Border Color */
	fieldset,
	pre,
	abbr,
	acronym,
	table,
	th,
	td,
	input[type="date"],
	input[type="time"],
	input[type="datetime-local"],
	input[type="week"],
	input[type="month"],
	input[type="text"],
	input[type="email"],
	input[type="url"],
	input[type="password"],
	input[type="search"],
	input[type="tel"],
	input[type="number"],
	textarea,
	.main-navigation li,
	.main-navigation .primary-menu,
	.menu-toggle,
	.dropdown-toggle:after,
	.social-navigation a,
	.image-navigation,
	.comment-navigation,
	.tagcloud a,
	.entry-content,
	.entry-summary,
	.page-links a,
	.page-links > span,
	.comment-list article,
	.comment-list .pingback,
	.comment-list .trackback,
	.comment-reply-link,
	.no-comments,
	.widecolumn .mu_register .mu_alert {
		border-color: {$colors['main_text_color']}; /* Fallback for IE7 and IE8 */
		border-color: {$colors['border_color']};
	}

	hr,
	code {
		background-color: {$colors['main_text_color']}; /* Fallback for IE7 and IE8 */
		background-color: {$colors['border_color']};
	}

	@media screen and (min-width: 56.875em) {
		.main-navigation li:hover > a,
		.main-navigation li.focus > a {
			color: {$colors['link_color']};
		}

		.main-navigation ul ul,
		.main-navigation ul ul li {
			border-color: {$colors['border_color']};
		}

		.main-navigation ul ul:before {
			border-top-color: {$colors['border_color']};
			border-bottom-color: {$colors['border_color']};
		}

		.main-navigation ul ul li {
			background-color: {$colors['page_background_color']};
		}

		.main-navigation ul ul:after {
			border-top-color: {$colors['page_background_color']};
			border-bottom-color: {$colors['page_background_color']};
		}
	}

CSS;
}

/**
 * Outputs an Underscore template for generating CSS for the color scheme.
 *
 * The template generates the css dynamically for instant display in the
 * Customizer preview.
 *
 * @since Twenty Sixteen 1.0
 */
function twentysixteen_color_scheme_css_template() {
	$colors = array(
		'background_color'      => '{{ data.background_color }}',
		'page_background_color' => '{{ data.page_background_color }}',
		'link_color'            => '{{ data.link_color }}',
		'main_text_color'       => '{{ data.main_text_color }}',
		'secondary_text_color'  => '{{ data.secondary_text_color }}',
		'border_color'          => '{{ data.border_color }}',
	);
	?>
	<script type="text/html" id="tmpl-twentysixteen-color-scheme">
		<?php echo twentysixteen_get_color_scheme_css( $colors ); ?>
	</script>
	<?php
}
add_action( 'customize_controls_print_footer_scripts', 'twentysixteen_color_scheme_css_template' );

/**
 * Enqueues front-end CSS for the page background color.
 *
 * @since Twenty Sixteen 1.0
 *
 * @see wp_add_inline_style()
 */
function twentysixteen_page_background_color_css() {
	$color_scheme          = twentysixteen_get_color_scheme();
	$default_color         = $color_scheme[1];
	$page_background_color = get_theme_mod( 'page_background_color', $default_color );

	// Don't do anything if the current color is the default.
	if ( $page_background_color === $default_color ) {
		return;
	}

	$css = '
		/* Custom Page Background Color */
		.site {
			background-color: %1$s;
		}

		mark,
		ins,
		button,
		button[disabled]:hover,
		button[disabled]:focus,
		input[type="button"],
		input[type="button"][disabled]:hover,
		input[type="button"][disabled]:focus,
		input[type="reset"],
		input[type="reset"][disabled]:hover,
		input[type="reset"][disabled]:focus,
		input[type="submit"],
		input[type="submit"][disabled]:hover,
		input[type="submit"][disabled]:focus,
		.menu-toggle.toggled-on,
		.menu-toggle.toggled-on:hover,
		.menu-toggle.toggled-on:focus,
		.pagination .prev,
		.pagination .next,
		.pagination .prev:hover,
		.pagination .prev:focus,
		.pagination .next:hover,
		.pagination .next:focus,
		.pagination .nav-links:before,
		.pagination .nav-links:after,
		.widget_calendar tbody a,
		.widget_calendar tbody a:hover,
		.widget_calendar tbody a:focus,
		.page-links a,
		.page-links a:hover,
		.page-links a:focus {
			color: %1$s;
		}

		@media screen and (min-width: 56.875em) {
			.main-navigation ul ul li {
				background-color: %1$s;
			}

			.main-navigation ul ul:after {
				border-top-color: %1$s;
				border-bottom-color: %1$s;
			}
		}
	';

	wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $page_background_color ) );
}
add_action( 'wp_enqueue_scripts', 'twentysixteen_page_background_color_css', 11 );

/**
 * Enqueues front-end CSS for the link color.
 *
 * @since Twenty Sixteen 1.0
 *
 * @see wp_add_inline_style()
 */
function twentysixteen_link_color_css() {
	$color_scheme    = twentysixteen_get_color_scheme();
	$default_color   = $color_scheme[2];
	$link_color = get_theme_mod( 'link_color', $default_color );

	// Don't do anything if the current color is the default.
	if ( $link_color === $default_color ) {
		return;
	}

	$css = '
		/* Custom Link Color */
		.menu-toggle:hover,
		.menu-toggle:focus,
		a,
		.main-navigation a:hover,
		.main-navigation a:focus,
		.dropdown-toggle:hover,
		.dropdown-toggle:focus,
		.social-navigation a:hover:before,
		.social-navigation a:focus:before,
		.post-navigation a:hover .post-title,
		.post-navigation a:focus .post-title,
		.tagcloud a:hover,
		.tagcloud a:focus,
		.site-branding .site-title a:hover,
		.site-branding .site-title a:focus,
		.entry-title a:hover,
		.entry-title a:focus,
		.entry-footer a:hover,
		.entry-footer a:focus,
		.comment-metadata a:hover,
		.comment-metadata a:focus,
		.pingback .comment-edit-link:hover,
		.pingback .comment-edit-link:focus,
		.comment-reply-link,
		.comment-reply-link:hover,
		.comment-reply-link:focus,
		.required,
		.site-info a:hover,
		.site-info a:focus {
			color: %1$s;
		}

		mark,
		ins,
		button:hover,
		button:focus,
		input[type="button"]:hover,
		input[type="button"]:focus,
		input[type="reset"]:hover,
		input[type="reset"]:focus,
		input[type="submit"]:hover,
		input[type="submit"]:focus,
		.pagination .prev:hover,
		.pagination .prev:focus,
		.pagination .next:hover,
		.pagination .next:focus,
		.widget_calendar tbody a,
		.page-links a:hover,
		.page-links a:focus {
			background-color: %1$s;
		}

		input[type="date"]:focus,
		input[type="time"]:focus,
		input[type="datetime-local"]:focus,
		input[type="week"]:focus,
		input[type="month"]:focus,
		input[type="text"]:focus,
		input[type="email"]:focus,
		input[type="url"]:focus,
		input[type="password"]:focus,
		input[type="search"]:focus,
		input[type="tel"]:focus,
		input[type="number"]:focus,
		textarea:focus,
		.tagcloud a:hover,
		.tagcloud a:focus,
		.menu-toggle:hover,
		.menu-toggle:focus {
			border-color: %1$s;
		}

		@media screen and (min-width: 56.875em) {
			.main-navigation li:hover > a,
			.main-navigation li.focus > a {
				color: %1$s;
			}
		}
	';

	wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $link_color ) );
}
add_action( 'wp_enqueue_scripts', 'twentysixteen_link_color_css', 11 );

/**
 * Enqueues front-end CSS for the main text color.
 *
 * @since Twenty Sixteen 1.0
 *
 * @see wp_add_inline_style()
 */
function twentysixteen_main_text_color_css() {
	$color_scheme    = twentysixteen_get_color_scheme();
	$default_color   = $color_scheme[3];
	$main_text_color = get_theme_mod( 'main_text_color', $default_color );

	// Don't do anything if the current color is the default.
	if ( $main_text_color === $default_color ) {
		return;
	}

	// Convert main text hex color to rgba.
	$main_text_color_rgb = twentysixteen_hex2rgb( $main_text_color );

	// If the rgba values are empty return early.
	if ( empty( $main_text_color_rgb ) ) {
		return;
	}

	// If we get this far, we have a custom color scheme.
	$border_color = vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.2)', $main_text_color_rgb );

	$css = '
		/* Custom Main Text Color */
		body,
		blockquote cite,
		blockquote small,
		.main-navigation a,
		.menu-toggle,
		.dropdown-toggle,
		.social-navigation a,
		.post-navigation a,
		.pagination a:hover,
		.pagination a:focus,
		.widget-title a,
		.site-branding .site-title a,
		.entry-title a,
		.page-links > .page-links-title,
		.comment-author,
		.comment-reply-title small a:hover,
		.comment-reply-title small a:focus {
			color: %1$s
		}

		blockquote,
		.menu-toggle.toggled-on,
		.menu-toggle.toggled-on:hover,
		.menu-toggle.toggled-on:focus,
		.post-navigation,
		.post-navigation div + div,
		.pagination,
		.widget,
		.page-header,
		.page-links a,
		.comments-title,
		.comment-reply-title {
			border-color: %1$s;
		}

		button,
		button[disabled]:hover,
		button[disabled]:focus,
		input[type="button"],
		input[type="button"][disabled]:hover,
		input[type="button"][disabled]:focus,
		input[type="reset"],
		input[type="reset"][disabled]:hover,
		input[type="reset"][disabled]:focus,
		input[type="submit"],
		input[type="submit"][disabled]:hover,
		input[type="submit"][disabled]:focus,
		.menu-toggle.toggled-on,
		.menu-toggle.toggled-on:hover,
		.menu-toggle.toggled-on:focus,
		.pagination:before,
		.pagination:after,
		.pagination .prev,
		.pagination .next,
		.page-links a {
			background-color: %1$s;
		}

		/* Border Color */
		fieldset,
		pre,
		abbr,
		acronym,
		table,
		th,
		td,
		input[type="date"],
		input[type="time"],
		input[type="datetime-local"],
		input[type="week"],
		input[type="month"],
		input[type="text"],
		input[type="email"],
		input[type="url"],
		input[type="password"],
		input[type="search"],
		input[type="tel"],
		input[type="number"],
		textarea,
		.main-navigation li,
		.main-navigation .primary-menu,
		.menu-toggle,
		.dropdown-toggle:after,
		.social-navigation a,
		.image-navigation,
		.comment-navigation,
		.tagcloud a,
		.entry-content,
		.entry-summary,
		.page-links a,
		.page-links > span,
		.comment-list article,
		.comment-list .pingback,
		.comment-list .trackback,
		.comment-reply-link,
		.no-comments,
		.widecolumn .mu_register .mu_alert {
			border-color: %1$s; /* Fallback for IE7 and IE8 */
			border-color: %2$s;
		}

		hr,
		code {
			background-color: %1$s; /* Fallback for IE7 and IE8 */
			background-color: %2$s;
		}

		@media screen and (min-width: 56.875em) {
			.main-navigation ul ul,
			.main-navigation ul ul li {
				border-color: %2$s;
			}

			.main-navigation ul ul:before {
				border-top-color: %2$s;
				border-bottom-color: %2$s;
			}
		}
	';

	wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $main_text_color, $border_color ) );
}
add_action( 'wp_enqueue_scripts', 'twentysixteen_main_text_color_css', 11 );

/**
 * Enqueues front-end CSS for the secondary text color.
 *
 * @since Twenty Sixteen 1.0
 *
 * @see wp_add_inline_style()
 */
function twentysixteen_secondary_text_color_css() {
	$color_scheme    = twentysixteen_get_color_scheme();
	$default_color   = $color_scheme[4];
	$secondary_text_color = get_theme_mod( 'secondary_text_color', $default_color );

	// Don't do anything if the current color is the default.
	if ( $secondary_text_color === $default_color ) {
		return;
	}

	$css = '
		/* Custom Secondary Text Color */

		/**
		 * IE8 and earlier will drop any block with CSS3 selectors.
		 * Do not combine these styles with the next block.
		 */
		body:not(.search-results) .entry-summary {
			color: %1$s;
		}

		blockquote,
		.post-password-form label,
		a:hover,
		a:focus,
		a:active,
		.post-navigation .meta-nav,
		.image-navigation,
		.comment-navigation,
		.widget_recent_entries .post-date,
		.widget_rss .rss-date,
		.widget_rss cite,
		.site-description,
		.author-bio,
		.entry-footer,
		.entry-footer a,
		.sticky-post,
		.taxonomy-description,
		.entry-caption,
		.comment-metadata,
		.pingback .edit-link,
		.comment-metadata a,
		.pingback .comment-edit-link,
		.comment-form label,
		.comment-notes,
		.comment-awaiting-moderation,
		.logged-in-as,
		.form-allowed-tags,
		.site-info,
		.site-info a,
		.wp-caption .wp-caption-text,
		.gallery-caption,
		.widecolumn label,
		.widecolumn .mu_register label {
			color: %1$s;
		}

		.widget_calendar tbody a:hover,
		.widget_calendar tbody a:focus {
			background-color: %1$s;
		}
	';

	wp_add_inline_style( 'twentysixteen-style', sprintf( $css, $secondary_text_color ) );
}
add_action( 'wp_enqueue_scripts', 'twentysixteen_secondary_text_color_css', 11 );


text:
Strings

-- Source: https://help.autodesk.com/view/MAXDEV/2022/ENU/?guid=GUID-5E5E1A71-24E2-4605-9720-2178B941DECC

plugin RenderEffect MonoChrome
name:"MonoChrome"
classID:#(0x9e6e9e77, 0xbe815df4)
(
rollout about_rollout "About..."
(
  label about_label "MonoChrome Filter"
)
on apply r_image progressCB: do
(
  progressCB.setTitle "MonoChrome Effect"
  local oldEscapeEnable = escapeEnable
  escapeEnable = false
  bmp_w = r_image.width
  bmp_h = r_image.height
  for y = 0 to bmp_h-1 do
  (
    if progressCB.progress y (bmp_h-1) then exit
    pixel_line = getPixels r_image [0,y] bmp_w
    for x = 1 to bmp_w do
    (
      p_v = pixel_line[x].value
      pixel_line[x] = color p_v p_v p_v pixel_line[x].alpha
    )--end x loop
    setPixels r_image [0,y] pixel_line
  )--end y loop
  escapeEnable = oldEscapeEnable
)--end on apply
)--end plugin

redpajama_set_name: RedPajamaGithub


text:
class OrganizationsService:
    def __init__(self, client):
        self.client = client

    def CreateNewOrganization(self, data, headers=None, query_params=None):
        """
        Create a new organization. 1 user should be in the owners list. Validation is performed to check if the securityScheme allows management on this user.
        It is method for POST /organizations
        """
        uri = self.client.base_url + "/organizations"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def GetOrganization(self, globalid, headers=None, query_params=None):
        """
        Get organization info
        It is method for GET /organizations/{globalid}
        """
        uri = self.client.base_url + "/organizations/"+globalid
        return self.client.session.get(uri, headers=headers, params=query_params)

    def CreateNewSubOrganization(self, data, globalid, headers=None, query_params=None):
        """
        Create a new suborganization.
        It is method for POST /organizations/{globalid}
        """
        uri = self.client.base_url + "/organizations/"+globalid
        return self.client.post(uri, data, headers=headers, params=query_params)

    def UpdateOrganization(self, data, globalid, headers=None, query_params=None):
        """
        Update organization info
        It is method for PUT /organizations/{globalid}
        """
        uri = self.client.base_url + "/organizations/"+globalid
        return self.client.put(uri, data, headers=headers, params=query_params)

    def DeleteOrganization(self, globalid, headers=None, query_params=None):
        """
        Deletes an organization and all data linked to it (join-organization-invitations, oauth_access_tokens, oauth_clients, logo)
        It is method for DELETE /organizations/{globalid}
        """
        uri = self.client.base_url + "/organizations/"+globalid
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def Set2faValidityTime(self, data, globalid, headers=None, query_params=None):
        """
        Update the 2FA validity time for the organization
        It is method for POST /organizations/{globalid}/2fa/validity
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/2fa/validity"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def Get2faValidityTime(self, globalid, headers=None, query_params=None):
        """
        Get the 2FA validity time for the organization, in seconds
        It is method for GET /organizations/{globalid}/2fa/validity
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/2fa/validity"
        return self.client.session.get(uri, headers=headers, params=query_params)

    def CreateNewOrganizationAPIKey(self, data, globalid, headers=None, query_params=None):
        """
        Create a new API Key, a secret itself should not be provided, it will be generated serverside.
        It is method for POST /organizations/{globalid}/apikeys
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/apikeys"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def GetOrganizationAPIKeyLabels(self, globalid, headers=None, query_params=None):
        """
        Get the list of active api keys.
        It is method for GET /organizations/{globalid}/apikeys
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/apikeys"
        return self.client.session.get(uri, headers=headers, params=query_params)

    def UpdateOrganizationAPIKey(self, data, label, globalid, headers=None, query_params=None):
        """
        Updates the label or other properties of a key.
        It is method for PUT /organizations/{globalid}/apikeys/{label}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/apikeys/"+label
        return self.client.put(uri, data, headers=headers, params=query_params)

    def GetOrganizationAPIKey(self, label, globalid, headers=None, query_params=None):
        """
        It is method for GET /organizations/{globalid}/apikeys/{label}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/apikeys/"+label
        return self.client.session.get(uri, headers=headers, params=query_params)

    def DeleteOrganizationAPIKey(self, label, globalid, headers=None, query_params=None):
        """
        Removes an API key
        It is method for DELETE /organizations/{globalid}/apikeys/{label}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/apikeys/"+label
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def GetOrganizationContracts(self, globalid, headers=None, query_params=None):
        """
        Get the contracts where the organization is 1 of the parties. Order descending by date.
        It is method for GET /organizations/{globalid}/contracts
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/contracts"
        return self.client.session.get(uri, headers=headers, params=query_params)

    def CreateOrganizationContracty(self, data, globalid, headers=None, query_params=None):
        """
        Create a new contract.
        It is method for POST /organizations/{globalid}/contracts
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/contracts"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def UpdateDescription(self, data, globalid, headers=None, query_params=None):
        """
        Update the description for this organization for a given language key
        It is method for PUT /organizations/{globalid}/description
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/description"
        return self.client.put(uri, data, headers=headers, params=query_params)

    def SetDescription(self, data, globalid, headers=None, query_params=None):
        """
        Set the description for this organization for a given language key
        It is method for POST /organizations/{globalid}/description
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/description"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def DeleteDescription(self, langkey, globalid, headers=None, query_params=None):
        """
        Delete the description for this organization for a given language key
        It is method for DELETE /organizations/{globalid}/description/{langkey}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/description/"+langkey
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def GetDescription(self, langkey, globalid, headers=None, query_params=None):
        """
        Get the description for an organization for this langkey
        It is method for GET /organizations/{globalid}/description/{langkey}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/description/"+langkey
        return self.client.session.get(uri, headers=headers, params=query_params)

    def GetDescriptionWithFallback(self, langkey, globalid, headers=None, query_params=None):
        """
        Get the description for an organization for this langkey, try to use the English is there is no description for this langkey
        It is method for GET /organizations/{globalid}/description/{langkey}/withfallback
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/description/"+langkey+"/withfallback"
        return self.client.session.get(uri, headers=headers, params=query_params)

    def CreateOrganizationDns(self, data, globalid, headers=None, query_params=None):
        """
        Creates a new DNS name associated with an organization
        It is method for POST /organizations/{globalid}/dns
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/dns"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def DeleteOrganizationDns(self, dnsname, globalid, headers=None, query_params=None):
        """
        Removes a DNS name associated with an organization
        It is method for DELETE /organizations/{globalid}/dns/{dnsname}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/dns/"+dnsname
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def UpdateOrganizationDns(self, data, dnsname, globalid, headers=None, query_params=None):
        """
        Updates an existing DNS name associated with an organization
        It is method for PUT /organizations/{globalid}/dns/{dnsname}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/dns/"+dnsname
        return self.client.put(uri, data, headers=headers, params=query_params)

    def GetPendingOrganizationInvitations(self, globalid, headers=None, query_params=None):
        """
        Get the list of pending invitations for users to join this organization.
        It is method for GET /organizations/{globalid}/invitations
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/invitations"
        return self.client.session.get(uri, headers=headers, params=query_params)

    def RemovePendingOrganizationInvitation(self, username, globalid, headers=None, query_params=None):
        """
        Cancel a pending invitation.
        It is method for DELETE /organizations/{globalid}/invitations/{username}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/invitations/"+username
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def GetOrganizationLogo(self, globalid, headers=None, query_params=None):
        """
        Get the Logo from an organization
        It is method for GET /organizations/{globalid}/logo
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/logo"
        return self.client.session.get(uri, headers=headers, params=query_params)

    def SetOrganizationLogo(self, data, globalid, headers=None, query_params=None):
        """
        Set the organization Logo for the organization
        It is method for PUT /organizations/{globalid}/logo
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/logo"
        return self.client.put(uri, data, headers=headers, params=query_params)

    def DeleteOrganizationLogo(self, globalid, headers=None, query_params=None):
        """
        Removes the Logo from an organization
        It is method for DELETE /organizations/{globalid}/logo
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/logo"
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def UpdateOrganizationMemberShip(self, data, globalid, headers=None, query_params=None):
        """
        Update an organization membership
        It is method for PUT /organizations/{globalid}/members
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/members"
        return self.client.put(uri, data, headers=headers, params=query_params)

    def AddOrganizationMember(self, data, globalid, headers=None, query_params=None):
        """
        Assign a member to organization.
        It is method for POST /organizations/{globalid}/members
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/members"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def RemoveOrganizationMember(self, username, globalid, headers=None, query_params=None):
        """
        Remove a member from an organization.
        It is method for DELETE /organizations/{globalid}/members/{username}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/members/"+username
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def UpdateOrganizationOrgMemberShip(self, data, globalid, headers=None, query_params=None):
        """
        Update the membership status of an organization
        It is method for PUT /organizations/{globalid}/orgmembers
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/orgmembers"
        return self.client.put(uri, data, headers=headers, params=query_params)

    def SetOrgMember(self, data, globalid, headers=None, query_params=None):
        """
        Add another organization as a member of this one
        It is method for POST /organizations/{globalid}/orgmembers
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/orgmembers"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def DeleteOrgMember(self, globalid2, globalid, headers=None, query_params=None):
        """
        Remove an organization as a member
        It is method for DELETE /organizations/{globalid}/orgmembers/{globalid2}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/orgmembers/"+globalid2
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def SetOrgOwner(self, data, globalid, headers=None, query_params=None):
        """
        Add another organization as an owner of this one
        It is method for POST /organizations/{globalid}/orgowners
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/orgowners"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def DeleteOrgOwner(self, globalid2, globalid, headers=None, query_params=None):
        """
        Remove an organization as an owner
        It is method for DELETE /organizations/{globalid}/orgowners/{globalid2}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/orgowners/"+globalid2
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def AddOrganizationOwner(self, data, globalid, headers=None, query_params=None):
        """
        Invite a user to become owner of an organization.
        It is method for POST /organizations/{globalid}/owners
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/owners"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def RemoveOrganizationOwner(self, username, globalid, headers=None, query_params=None):
        """
        Remove an owner from organization
        It is method for DELETE /organizations/{globalid}/owners/{username}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/owners/"+username
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def ListOrganizationRegistry(self, globalid, headers=None, query_params=None):
        """
        Lists the RegistryEntries in an organization's registry.
        It is method for GET /organizations/{globalid}/registry
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/registry"
        return self.client.session.get(uri, headers=headers, params=query_params)

    def AddOrganizationRegistryEntry(self, data, globalid, headers=None, query_params=None):
        """
        Adds a RegistryEntry to the organization's registry, if the key is already used, it is overwritten.
        It is method for POST /organizations/{globalid}/registry
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/registry"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def GetOrganizationRegistryEntry(self, key, globalid, headers=None, query_params=None):
        """
        Get a RegistryEntry from the organization's registry.
        It is method for GET /organizations/{globalid}/registry/{key}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/registry/"+key
        return self.client.session.get(uri, headers=headers, params=query_params)

    def DeleteOrganizationRegistryEntry(self, key, globalid, headers=None, query_params=None):
        """
        Removes a RegistryEntry from the organization's registry
        It is method for DELETE /organizations/{globalid}/registry/{key}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/registry/"+key
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def AddRequiredScope(self, data, globalid, headers=None, query_params=None):
        """
        Adds a required scope
        It is method for POST /organizations/{globalid}/requiredscopes
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/requiredscopes"
        return self.client.post(uri, data, headers=headers, params=query_params)

    def UpdateRequiredScope(self, data, requiredscope, globalid, headers=None, query_params=None):
        """
        Updates a required scope
        It is method for PUT /organizations/{globalid}/requiredscopes/{requiredscope}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/requiredscopes/"+requiredscope
        return self.client.put(uri, data, headers=headers, params=query_params)

    def DeleteRequiredScope(self, requiredscope, globalid, headers=None, query_params=None):
        """
        Deletes a required scope
        It is method for DELETE /organizations/{globalid}/requiredscopes/{requiredscope}
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/requiredscopes/"+requiredscope
        return self.client.session.delete(uri, headers=headers, params=query_params)

    def GetOrganizationTree(self, globalid, headers=None, query_params=None):
        """
        It is method for GET /organizations/{globalid}/tree
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/tree"
        return self.client.session.get(uri, headers=headers, params=query_params)

    def GetOrganizationUsers(self, globalid, headers=None, query_params=None):
        """
        Get all users from this organization, not including suborganizations.
        It is method for GET /organizations/{globalid}/users
        """
        uri = self.client.base_url + "/organizations/"+globalid+"/users"
        return self.client.session.get(uri, headers=headers, params=query_params)


text:
namespace content {
class WebUIController;
}

namespace electron {

class ElectronWebUIControllerFactory : public content::WebUIControllerFactory {
 public:
  static ElectronWebUIControllerFactory* GetInstance();

  ElectronWebUIControllerFactory();
  ~ElectronWebUIControllerFactory() override;

  // disable copy
  ElectronWebUIControllerFactory(const ElectronWebUIControllerFactory&) =
      delete;
  ElectronWebUIControllerFactory& operator=(
      const ElectronWebUIControllerFactory&) = delete;

  // content::WebUIControllerFactory:
  content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context,
                                      const GURL& url) override;
  bool UseWebUIForURL(content::BrowserContext* browser_context,
                      const GURL& url) override;
  std::unique_ptr<content::WebUIController> CreateWebUIControllerForURL(
      content::WebUI* web_ui,
      const GURL& url) override;

 private:
  friend struct base::DefaultSingletonTraits<ElectronWebUIControllerFactory>;
};

}  // namespace electron

#endif  // ELECTRON_SHELL_BROWSER_ELECTRON_WEB_UI_CONTROLLER_FACTORY_H_


text:
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="mcdemgel"
		      xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
		      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<fileSets>
		<fileSet filtered="true" packaged="true" encoding="UTF-8">
			<directory>src/main/java</directory>
			<includes>
				<include>**/*.java</include>
			</includes>
		</fileSet>
		<fileSet filtered="true" encoding="UTF-8">
			<directory>src/main/resources</directory>
			<includes>
				<include>**/*.*</include>
			</includes>
		</fileSet>
		<fileSet filtered="true" encoding="UTF-8">
			<directory></directory>
			<includes>
				<include>HEADER.txt</include>
			</includes>
		</fileSet>
		<fileSet filtered="false" encoding="UTB-8">
			<directory>src/site</directory>
			<inlcude>**/*.*</inlcude>
		</fileSet>
	</fileSets>

	<requiredProperties>

		<!-- Allows the user to specify a custom package structure. -->
		<requiredProperty key="package">
			<defaultValue>${groupId}.${artifactId}</defaultValue>
		</requiredProperty>

		<!-- Allows the user to specify a name for their plugin that is different from the artifactId. -->
		<requiredProperty key="pluginName">
			<defaultValue>${artifactId}</defaultValue>
		</requiredProperty>

		<!-- For Vanilla-dependent plugins. When true, Vanilla is included as a dependency. -->
		<requiredProperty key="includeVanilla">
			<defaultValue>false</defaultValue>
		</requiredProperty>

		<!-- Allows automatic generation of a Spout-plugin-themed header for each file. -->
		<requiredProperty key="includeHeaders">
			<defaultValue>false</defaultValue>
		</requiredProperty>

		<!-- Allows automatic generation of a Maven WebSite -->
		<requiredProperty key="mavensite">
			<defaultValue>false</defaultValue>
		</requiredProperty>

	</requiredProperties>

</archetype-descriptor>


text:
package com.github.rutledgepaulv.qbuilders.properties.virtual;

import com.github.rutledgepaulv.qbuilders.builders.QBuilder;
import com.github.rutledgepaulv.qbuilders.conditions.Condition;

import java.util.Collection;

/**
 * For acting against a field via a list of values.
 */
public interface ListableProperty<T extends QBuilder<T>, S> extends Property<T> {

    /**
     * Specifies that the field's value must occur at least once in the list of provided values.
     *
     * @param values The values that make up the set of things that the field's value must occur in.
     * @return The logically complete condition.
     */
    Condition<T> in(S... values);

    /**
     * Specifies that the field's value must occur at least once in the list of provided values.
     *
     * @param values The values that make up the set of things that the field's value must occur in.
     * @return The logically complete condition.
     */
    Condition<T> in(Collection<S> values);

    /**
     * Specifies that the field's value must never occur in the list of provided values.
     *
     * @param values The values that make up the set of things that the field's value must never occur in.
     * @return The logically complete condition.
     */
    Condition<T> nin(S... values);

    /**
     * Specifies that the field's value must never occur in the list of provided values.
     *
     * @param values The values that make up the set of things that the field's value must never occur in.
     * @return The logically complete condition.
     */
    Condition<T> nin(Collection<S> values);

}


text:
using std::size_t;
using std::ptrdiff_t;

/// 解析器的错误类
class SyntaxError
{
public:
    /// 错误原因与位置
    std::string what;
    ptrdiff_t LineNumber = 1, ColumnStart = -1, ColumnEnd = -1;

    /// 生成错误
    SyntaxError();
    SyntaxError(std::string what);
    SyntaxError(std::string what, ptrdiff_t LineNumber, ptrdiff_t ColumnStart);
    SyntaxError(std::string what, ptrdiff_t LineNumber, ptrdiff_t ColumnStart, ptrdiff_t ColumnEnd);

    ~SyntaxError();
};

#endif // _SYNTAXERROR_H_


text:
These files are heavily influenced by ryanb's files (https://github.com/ryanb/dotfiles)

These are config files to set up a system the way I like it. It now uses [Oh My ZSH](https://github.com/robbyrussell/oh-my-zsh). If you would like to see my old, custom Bash and ZSH config, check out [this branch](https://github.com/ryanb/dotfiles/tree/custom-bash-zsh)

I am running on Mac OS X, but it will likely work on Linux as well.

## Installation

Run the following commands in your terminal. It will prompt you before it does anything destructive. Check out the [Rakefile](https://github.com/ryanb/dotfiles/blob/custom-bash-zsh/Rakefile) to see exactly what it does.

```terminal
git clone git://github.com/telnicky/dots
cd ~/dots
rake install
```

After installing, open a new terminal window to see the effects.

Feel free to customize the .zshrc file to match your preference.

## Uninstall

To remove the dotfile configs, run the following commands. Be certain to double check the contents of the files before removing so you don't lose custom settings.

```
unlink ~/.bin
unlink ~/.gitignore
unlink ~/.gemrc
unlink ~/.gvimrc
unlink ~/.irbrc
unlink ~/.vim
unlink ~/.vimrc
rm ~/.zshrc # careful here
rm ~/.gitconfig
rm -rf ~/.dots
rm -rf ~/.oh-my-zsh
chsh -s /bin/bash # change back to Bash if you want
```

Then open a new terminal window to see the effects.


text:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta charset="utf-8"/>
    <title>edit</title>
    <link rel="stylesheet" href="/static/main.css"/>
  </head>
  <body>
%include article_nav.html name=name
%include edit_suffix.html content=content, token=token


text:
ansible-role-sensuserver
========================

Ansible role to setup a sensu Server


text:
package org.apache.hadoop.fs.adl;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configuration.DeprecationDelta;

/**
 * Constants.
 */
@InterfaceAudience.Public
@InterfaceStability.Evolving
public final class AdlConfKeys {
  // OAuth2 Common Configuration
  public static final String AZURE_AD_REFRESH_URL_KEY =
      "fs.adl.oauth2.refresh.url";

  // optional when provider type is refresh or client id.
  public static final String AZURE_AD_TOKEN_PROVIDER_CLASS_KEY =
      "fs.adl.oauth2.access.token.provider";
  public static final String AZURE_AD_CLIENT_ID_KEY =
      "fs.adl.oauth2.client.id";
  public static final String AZURE_AD_TOKEN_PROVIDER_TYPE_KEY =
      "fs.adl.oauth2.access.token.provider.type";
  public static final TokenProviderType AZURE_AD_TOKEN_PROVIDER_TYPE_DEFAULT =
      TokenProviderType.ClientCredential;

  // OAuth Refresh Token Configuration
  public static final String AZURE_AD_REFRESH_TOKEN_KEY =
      "fs.adl.oauth2.refresh.token";

  public static final String TOKEN_PROVIDER_TYPE_REFRESH_TOKEN = "RefreshToken";
  // OAuth Client Cred Token Configuration
  public static final String AZURE_AD_CLIENT_SECRET_KEY =
      "fs.adl.oauth2.credential";
  public static final String TOKEN_PROVIDER_TYPE_CLIENT_CRED =
      "ClientCredential";

  public static final String READ_AHEAD_BUFFER_SIZE_KEY =
      "adl.feature.client.cache.readahead";

  public static final String WRITE_BUFFER_SIZE_KEY =
      "adl.feature.client.cache.drop.behind.writes";
  static final String SECURE_TRANSPORT_SCHEME = "https";
  static final String INSECURE_TRANSPORT_SCHEME = "http";
  static final String ADL_DEBUG_OVERRIDE_LOCAL_USER_AS_OWNER =
      "adl.debug.override.localuserasfileowner";

  static final boolean ADL_DEBUG_SET_LOCAL_USER_AS_OWNER_DEFAULT = false;
  static final long ADL_BLOCK_SIZE = 256 * 1024 * 1024;
  static final int ADL_REPLICATION_FACTOR = 1;
  static final String ADL_HADOOP_CLIENT_NAME = "hadoop-azure-datalake-";
  static final String ADL_HADOOP_CLIENT_VERSION =
      "2.0.0-SNAPSHOT";
  static final String ADL_EVENTS_TRACKING_CLUSTERNAME =
      "adl.events.tracking.clustername";

  static final String ADL_EVENTS_TRACKING_CLUSTERTYPE =
      "adl.events.tracking.clustertype";
  static final int DEFAULT_READ_AHEAD_BUFFER_SIZE = 4 * 1024 * 1024;
  static final int DEFAULT_WRITE_AHEAD_BUFFER_SIZE = 4 * 1024 * 1024;

  static final String LATENCY_TRACKER_KEY =
      "adl.enable.client.latency.tracker";
  static final boolean LATENCY_TRACKER_DEFAULT = true;

  static final String ADL_EXPERIMENT_POSITIONAL_READ_KEY =
      "adl.feature.experiment.positional.read.enable";
  static final boolean ADL_EXPERIMENT_POSITIONAL_READ_DEFAULT = true;

  static final String ADL_SUPPORT_ACL_BIT_IN_FSPERMISSION =
      "adl.feature.support.acl.bit";
  static final boolean ADL_SUPPORT_ACL_BIT_IN_FSPERMISSION_DEFAULT = true;

  static final String ADL_ENABLEUPN_FOR_OWNERGROUP_KEY =
      "adl.feature.ownerandgroup.enableupn";
  static final boolean ADL_ENABLEUPN_FOR_OWNERGROUP_DEFAULT = false;

  public static void addDeprecatedKeys() {
    Configuration.addDeprecations(new DeprecationDelta[]{
        new DeprecationDelta("dfs.adls.oauth2.access.token.provider.type",
            AZURE_AD_TOKEN_PROVIDER_TYPE_KEY),
        new DeprecationDelta("dfs.adls.oauth2.client.id",
            AZURE_AD_CLIENT_ID_KEY),
        new DeprecationDelta("dfs.adls.oauth2.refresh.token",
            AZURE_AD_REFRESH_TOKEN_KEY),
        new DeprecationDelta("dfs.adls.oauth2.refresh.url",
            AZURE_AD_REFRESH_URL_KEY),
        new DeprecationDelta("dfs.adls.oauth2.credential",
            AZURE_AD_CLIENT_SECRET_KEY),
        new DeprecationDelta("dfs.adls.oauth2.access.token.provider",
            AZURE_AD_TOKEN_PROVIDER_CLASS_KEY),
        new DeprecationDelta("adl.dfs.enable.client.latency.tracker",
            LATENCY_TRACKER_KEY)
    });
    Configuration.reloadExistingConfigurations();
  }

  private AdlConfKeys() {
  }
}


text:
@interface DBManager : NSObject {
    NSString *databasePath;
}

+(DBManager *)getSharedInstance;
-(BOOL) createDB;
-(BOOL) saveNewSheet:(NSString *)name;
-(BOOL) deleteSheet:(NSString *)sheetNumber;
-(BOOL) saveSheetData:(NSString *)sheetNumber name:(NSString *)name location:(NSString *)location;
-(BOOL) saveSongListData:(NSString *)listNumber sheetNumber:(NSString *)cueSheet songName:(NSString *)name volumeLevel:(NSString *)volume fadeTime:(NSString *)fade sortOrder:(NSString *)sortorder;
-(BOOL) saveNewSongListData:(NSString *)cueSheet songName:(NSString *)name volumeLevel:(NSString *)volume fadeTime:(NSString *)fade sortOrder:(NSString *)sortorder;
-(BOOL) deleteSong:(NSString *)listNumber;
-(NSArray *)findCuesheetBySheetNumber:(NSString*)sheetNumber;
-(NSArray *)getAllCuesheets;
-(NSArray*) findAllSongsByCueSheetNumber:(NSString*)sheetNumber;

@end


text:
package net.glowstone.block.state;

import net.glowstone.block.GlowBlock;
import net.glowstone.block.GlowBlockState;
import net.glowstone.block.entity.TEJukebox;
import net.glowstone.entity.GlowPlayer;
import org.bukkit.Effect;
import org.bukkit.Material;
import org.bukkit.block.Jukebox;
import org.bukkit.inventory.ItemStack;

import java.util.Collection;

public class GlowJukebox extends GlowBlockState implements Jukebox {

    private ItemStack playing;

    public GlowJukebox(GlowBlock block) {
        super(block);
        if (block.getType() != Material.JUKEBOX) {
            throw new IllegalArgumentException("GlowNoteBlock: expected JUKEBOX, got " + block.getType());
        }
        playing = getTileEntity().getPlaying();
    }

    private TEJukebox getTileEntity() {
        return (TEJukebox) getBlock().getTileEntity();
    }

    @Override
    public boolean update(boolean force, boolean applyPhysics) {
        boolean result = super.update(force, applyPhysics);
        if (result) {
            getTileEntity().setPlaying(playing);
        }
        return result;
    }

    public ItemStack getPlayingItem() {
        return playing;
    }

    ////////////////////////////////////////////////////////////////////////////
    // Implementation

    @Override
    public Material getPlaying() {
        return playing.getType();
    }

    @Override
    public boolean isPlaying() {
        return getRawData() == 1;
    }

    @Override
    public void setPlaying(Material record) {
        int id = 0;
        if (record == null || record == Material.AIR) {
            playing = null;
        } else {
            playing = new ItemStack(record);
            id = record.getId();
        }
        Collection<GlowPlayer> players = getWorld().getRawPlayers();
        for (GlowPlayer player : players) {
            player.playEffect(getLocation(), Effect.RECORD_PLAY, id);
        }
        setRawData((byte) (id > 0 ? 1 : 0));
    }

    @Override
    public boolean eject() {
        if (isPlaying()) {
            getWorld().dropItemNaturally(getLocation(), playing);
            setPlaying(null);
            return true;
        }
        return false;
    }

}


text:
<?php namespace ZN\Comparison;
/**
 * ZN PHP Web Framework
 *
 * "Simplicity is the ultimate sophistication." ~ Da Vinci
 *
 * @package ZN
 * @license MIT [http://opensource.org/licenses/MIT]
 * @author  Ozan UYKUN [ozan@znframework.com]
 */

class MemoryUsage
{
    /**
     * Calculate memory
     *
     * @param string $result
     *
     * @return float
     */
    public static function calculate(string $result) : Float
    {
        $resend  = $result."_end";
        $restart = $result."_start";

        if( ! isset(Properties::$memtests[$restart]) )
        {
            throw new Exception\InvalidParameterException(NULL, ['&' => 'calculatedMemory', '%' => $result, 'start']); // @codeCoverageIgnore
        }

        if( ! isset(Properties::$memtests[$resend]) )
        {
            throw new Exception\InvalidParameterException(NULL, ['&' => 'calculatedMemory', '%' => $result, 'end']); // @codeCoverageIgnore
        }

        return Properties::$memtests[$resend] - Properties::$memtests[$restart];
    }

    /**
     * Usage memory
     *
     * @param bool $realMemory = false
     *
     * @return int
     */
    public static function normal(bool $realMemory = false) : int
    {
        return  memory_get_usage($realMemory);
    }

    /**
     * Usage max memory
     *
     * @param bool $realMemory = false
     *
     * @return int
     */
    public static function maximum(bool $realMemory = false) : int
    {
        return  memory_get_peak_usage($realMemory);
    }
}


text:
<!DOCTYPE html>

<html>

	<head>
		<title> XMPP - IO MANAGER STAGE Unit Tests</title>
		<link rel="stylesheet" type="text/css" href="/vendors/oocss/core/libraries.css" />
		<link rel="stylesheet" type="text/css" href="/vendors/oocss/core/grid/grids.css" />
		<link rel="stylesheet" type="text/css" href="/vendors/oocss/core/content.css" />
		<link rel="stylesheet" type="text/css" href="/src/library/console/themes/basic/css/console.css" />

		<script src="/test/unit.js"></script>
		<script src="/src/library/stage/stage.js"></script>
		<script src="/src/library/selectors/sizzle/sizzle.js"></script>
		<script src="/src/library/function/function.js"></script>
		<script src="/src/library/array/array.js"></script>
		<script src="/src/library/position/position.js"></script>
		<script src="/src/library/string/string.js"></script>
		<script src="/src/library/json/json.js"></script>
		<script src="/src/library/structs/structs.js"></script>
		<script src="/src/library/structs/hash/hash.js"></script>
		<script src="/src/library/structs/queue/queue.js"></script>
		<script src="/src/library/events/events.js"></script>
		<script src="/src/library/storage/storage.js"></script>
		<script src="/src/library/io/ioManager.js"></script>
		<script src="/src/library/io/transport/outSocket/ajax/ajax.js"></script>
		<script src="/src/library/io/transport/outSocket/iframe/iframe.js"></script>
		<script src="/src/library/io/transport/outSocket/script/script.js"></script>
		<script src="/src/library/io/transport/outSocket/jsonp/jsonp.js"></script>
		<script src="/src/library/io/transport/inSocket/streaming/streaming.js"></script>
		<script src="/src/library/io/transport/inSocket/poll/poll.js"></script>
		<script src="/src/library/io/transport/inSocket/longPoll/longPoll.js"></script>
		<script src="/src/library/io/transport/ioSocket/socket/socket.js"></script>
		<script src="/src/library/io/transport/ioSocket/webSocket/webSocket.js"></script>

		<script src="/src/library/io/protocols/protocol.js"></script>

		<script src="/src/library/dom/dom.js"></script>
		<script src="/src/library/css/css.js"></script>
		<script src="/src/library/xml/xml.js"></script>
		<script src="/src/library/xslt/xslt.js"></script>
		<script src="/src/library/gestures/gestural.js"></script>
		<script src="/src/library/dragdrop/dragdrop.js"></script>
		<script src="/src/library/resize/resize.js"></script>
		<script src="/src/library/console/console.js"></script>
		<script src="/src/library/console/consoles/protocols/protocolsConsole.js"></script>

</head>

<body>

	<script>

		var asyncTestCase = goog.testing.AsyncTestCase.createAndInstall();
		asyncTestCase.stepTimeout = 30 * 1000;

		var testCallback = function(){

			var NSTestCallback = {
							start:	{response:[],i:null},
							stop:	{response:[],i:null},
							message:{response:[],i:null},
							error:	{response:[],error:null,i:null}
								};
			NSTestCallback.i = 0;

			NSTestCallback.protocolSettings = {

				onStart:function(response){

					NSTestCallback.start.response.push(response);
					NSTestCallback.start.i = NSTestCallback.i++;
				},
				onStop:function(response){

					NSTestCallback.stop.response.push(response);
					NSTestCallback.stop.i = NSTestCallback.i++;
				},

				onMessage:function(response){

					NSTestCallback.message.response.push(response);
					NSTestCallback.message.i = NSTestCallback.i++;
				},

				onError:function(childSocket, error){

					stage.console.warning(error);

					NSTestCallback.error.response.push(childSocket);
					NSTestCallback.error.error = error;
					NSTestCallback.error.i = NSTestCallback.i++;
				}

			};

			return NSTestCallback;

		};

		//** PROTO A **//
		var PROTOA = function(settings){

			//this.transport = new socket(param);

		};

		PROTOA.prototype.send = function(data){

			res = "<capsuleA>"+data+"</capsuleA>";

			//console.log("<capsuleA>"+data+"</capsuleA>");
			//this.transport.send("<capsuleA>"+data+"</capsuleA>");
		};

		//** PROTO B **//
		var PROTOB = stage.herite(function(settings){

			this.$super.constructor(settings);
			this.superProto = this.$super;

		},stage.io.protocols.protocol.protocol);

		PROTOB.prototype.send = function(data){

			this.superProto.send("<capsuleB>"+data+"</capsuleB>");
		};

		//** PROTO C **//
		var PROTOC = stage.herite(function(settings){

			this.$super.constructor(settings);
			this.superProto = this.$super;

		},stage.io.protocols.protocol.protocol);

		function test_01_protocol(){

			var NSTestCallback = new testCallback();
			var protocolSettings = NSTestCallback.protocolSettings;

			//protocolSettings.urlServerBindHTTP = 'http://stage-box.fr:5280/http-bind/';

			var protoA = new PROTOA(protocolSettings);
			//console.log(protoA);

			var NSTestCallback = new testCallback();
			var protocolSettings = NSTestCallback.protocolSettings;
			protocolSettings.type = "over";
			protocolSettings.transport = protoA;

			var protoB = new PROTOB(protocolSettings);
			//console.log(protoB);

			//protoB.send("DATA protoB");
			//protoB.send("");

			var NSTestCallback = new testCallback();
			var protocolSettings = NSTestCallback.protocolSettings;
			protocolSettings.type = "over";
			protocolSettings.transport = protoB;

			var protoC = new PROTOC(protocolSettings);
			//console.log(protoC);

			protoC.send("DATA protoC");

			assertEquals("Result is not equals","<capsuleA><capsuleB>DATA protoC</capsuleB></capsuleA>",res);

		};

	</script>
</body>
</html>


text:
<?php

namespace Zend\Memory\Container;
use Zend\Memory,
    Zend\Memory\Exception;

/**
 * Memory value container
 *
 * Movable (may be swapped with specified backend and unloaded).
 *
 * @uses       \Zend\Memory\Container\AbstractContainer
 * @uses       \Zend\Memory\Exception
 * @uses       \Zend\Memory\Value
 * @category   Zend
 * @package    Zend_Memory
 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Movable extends AbstractContainer
{
    /**
     * Internal object Id
     *
     * @var integer
     */
    protected $_id;

    /**
     * Memory manager reference
     *
     * @var \Zend\Memory\MemoryManager
     */
    private $_memManager;

    /**
     * Value object
     *
     * @var \Zend\Memory\Value
     */
    private $_value;

    /** Value states */
    const LOADED   = 1;
    const SWAPPED  = 2;
    const LOCKED   = 4;

    /**
     * Value state (LOADED/SWAPPED/LOCKED)
     *
     * @var integer
     */
    private $_state;

    /**
     * Object constructor
     *
     * @param \Zend\Memory\MemoryManager $memoryManager
     * @param integer $id
     * @param string $value
     */
    public function __construct(Memory\MemoryManager $memoryManager, $id, $value)
    {
        $this->_memManager = $memoryManager;
        $this->_id    = $id;
        $this->_state = self::LOADED;
        $this->_value = new Memory\Value($value, $this);
    }

    /**
     * Lock object in memory.
     */
    public function lock()
    {
        if ( !($this->_state & self::LOADED) ) {
            $this->_memManager->load($this, $this->_id);
            $this->_state |= self::LOADED;
        }

        $this->_state |= self::LOCKED;

        /**
         * @todo
         * It's possible to set "value" container attribute to avoid modification tracing, while it's locked
         * Check, if it's  more effective
         */
    }

    /**
     * Unlock object
     */
    public function unlock()
    {
        // Clear LOCKED state bit
        $this->_state &= ~self::LOCKED;
    }

    /**
     * Return true if object is locked
     *
     * @return boolean
     */
    public function isLocked()
    {
        return $this->_state & self::LOCKED;
    }

    /**
     * Get handler
     *
     * Loads object if necessary and moves it to the top of loaded objects list.
     * Swaps objects from the bottom of loaded objects list, if necessary.
     *
     * @param string $property
     * @return string
     * @throws \Zend\Memory\Exception
     */
    public function __get($property)
    {
        if ($property != 'value') {
            throw new Exception\InvalidArgumentException('Unknown property: \Zend\Memory\Container\Movable::$' . $property);
        }

        if ( !($this->_state & self::LOADED) ) {
            $this->_memManager->load($this, $this->_id);
            $this->_state |= self::LOADED;
        }

        return $this->_value;
    }

    /**
     * Set handler
     *
     * @param string $property
     * @param  string $value
     * @throws Exception\InvalidArgumentException
     */
    public function __set($property, $value)
    {
        if ($property != 'value') {
            throw new Exception\InvalidArgumentException('Unknown property: \Zend\Memory\Container\Movable::$' . $property);
        }

        $this->_state = self::LOADED;
        $this->_value = new Memory\Value($value, $this);

        $this->_memManager->processUpdate($this, $this->_id);
    }

    /**
     * Get string value reference
     *
     * _Must_ be used for value access before PHP v 5.2
     * or _may_ be used for performance considerations
     *
     * @return &string
     */
    public function &getRef()
    {
        if ( !($this->_state & self::LOADED) ) {
            $this->_memManager->load($this, $this->_id);
            $this->_state |= self::LOADED;
        }

        return $this->_value->getRef();
    }

    /**
     * Signal, that value is updated by external code.
     *
     * Should be used together with getRef()
     */
    public function touch()
    {
        $this->_memManager->processUpdate($this, $this->_id);
    }

    /**
     * Process container value update.
     * Must be called only by value object
     *
     * @internal
     */
    public function processUpdate()
    {
        // Clear SWAPPED state bit
        $this->_state &= ~self::SWAPPED;

        $this->_memManager->processUpdate($this, $this->_id);
    }

    /**
     * Start modifications trace
     *
     * @internal
     */
    public function startTrace()
    {
        if ( !($this->_state & self::LOADED) ) {
            $this->_memManager->load($this, $this->_id);
            $this->_state |= self::LOADED;
        }

        $this->_value->startTrace();
    }

    /**
     * Set value (used by memory manager when value is loaded)
     *
     * @internal
     */
    public function setValue($value)
    {
        $this->_value = new Memory\Value($value, $this);
    }

    /**
     * Clear value (used by memory manager when value is swapped)
     *
     * @internal
     */
    public function unloadValue()
    {
        // Clear LOADED state bit
        $this->_state &= ~self::LOADED;

        $this->_value = null;
    }

    /**
     * Mark, that object is swapped
     *
     * @internal
     */
    public function markAsSwapped()
    {
        // Clear LOADED state bit
        $this->_state |= self::LOADED;
    }

    /**
     * Check if object is marked as swapped
     *
     * @internal
     * @return boolean
     */
    public function isSwapped()
    {
        return $this->_state & self::SWAPPED;
    }

    /**
     * Get object id
     *
     * @internal
     * @return integer
     */
    public function getId()
    {
        return $this->_id;
    }
    /**
     * Destroy memory container and remove it from memory manager list
     *
     * @internal
     */
    public function destroy()
    {
        /**
         * We don't clean up swap because of performance considerations
         * Cleaning is performed by Memory Manager destructor
         */

        $this->_memManager->unlink($this, $this->_id);
    }
}


text:
package main

import (
	"fmt"
	"log"
	"strings"

	"github.com/knadh/koanf"
	"github.com/knadh/koanf/parsers/yaml"
	"github.com/knadh/koanf/providers/env"
	"github.com/knadh/koanf/providers/file"
)

// Global koanf instance. Use . as the key path delimiter. This can be / or anything.
var k = koanf.New(".")

func main() {
	// Load JSON config.
	if err := k.Load(file.Provider("mock/mock.yaml"), yaml.Parser()); err != nil {
		log.Fatalf("error loading config: %v", err)
	}

	// Load environment variables and merge into the loaded config.
	// "MYVAR" is the prefix to filter the env vars by.
	// "." is the delimiter used to represent the key hierarchy in env vars.
	// The (optional, or can be nil) function can be used to transform
	// the env var names, for instance, to lowercase them.
	//
	// For example, env vars: MYVAR_TYPE and MYVAR_PARENT1_CHILD1_NAME
	// will be merged into the "type" and the nested "parent1.child1.name"
	// keys in the config file here as we lowercase the key,
	// replace `_` with `.` and strip the MYVAR_ prefix so that
	// only "parent1.child1.name" remains.
	k.Load(env.Provider("MYVAR_", ".", func(s string) string {
		return strings.Replace(strings.ToLower(
			strings.TrimPrefix(s, "MYVAR_")), "_", ".", -1)
	}), nil)

	fmt.Println("name is = ", k.String("parent1.child1.name"))
}


text:
require "simplecov-html"

SimpleCov.profiles.define "root_filter" do
  # Exclude all files outside of simplecov root
  root_filter = /\A#{Regexp.escape(SimpleCov.root)}/io
  add_filter do |src|
    !(src.filename =~ root_filter)
  end
end

SimpleCov.profiles.define "test_frameworks" do
  add_filter "/test/"
  add_filter "/features/"
  add_filter "/spec/"
  add_filter "/autotest/"
end

SimpleCov.profiles.define "bundler_filter" do
  add_filter "/vendor/bundle/"
end

SimpleCov.profiles.define "rails" do
  load_profile "test_frameworks"

  add_filter "/config/"
  add_filter "/db/"

  add_group "Controllers", "app/controllers"
  add_group "Models", "app/models"
  add_group "Mailers", "app/mailers"
  add_group "Helpers", "app/helpers"
  add_group "Libraries", "lib"
end

# Default configuration
SimpleCov.configure do
  formatter SimpleCov::Formatter::HTMLFormatter
  load_profile "bundler_filter"
  # Exclude files outside of SimpleCov.root
  load_profile "root_filter"
end

# Gotta stash this a-s-a-p, see the CommandGuesser class and i.e. #110 for further info
SimpleCov::CommandGuesser.original_run_command = "#{$PROGRAM_NAME} #{ARGV.join(' ')}"

at_exit do
  # If we are in a different process than called start, don't interfere.
  next if SimpleCov.pid != Process.pid

  if $! # was an exception thrown?
    # if it was a SystemExit, use the accompanying status
    # otherwise set a non-zero status representing termination by some other exception
    # (see github issue 41)
    @exit_status = $!.is_a?(SystemExit) ? $!.status : SimpleCov::ExitCodes::EXCEPTION
  else
    # Store the exit status of the test run since it goes away after calling the at_exit proc...
    @exit_status = SimpleCov::ExitCodes::SUCCESS
  end

  SimpleCov.at_exit.call

  if SimpleCov.result? # Result has been computed
    covered_percent = SimpleCov.result.covered_percent.round(2)
    covered_percentages = SimpleCov.result.covered_percentages.map { |p| p.round(2) }

    if @exit_status == SimpleCov::ExitCodes::SUCCESS # No other errors
      if covered_percent < SimpleCov.minimum_coverage # rubocop:disable Metrics/BlockNesting
        $stderr.printf("Coverage (%.2f%%) is below the expected minimum coverage (%.2f%%).\n", covered_percent, SimpleCov.minimum_coverage)
        @exit_status = SimpleCov::ExitCodes::MINIMUM_COVERAGE
      elsif covered_percentages.any? { |p| p < SimpleCov.minimum_coverage_by_file } # rubocop:disable Metrics/BlockNesting
        $stderr.printf("File (%s) is only (%.2f%%) covered. This is below the expected minimum coverage per file of (%.2f%%).\n", SimpleCov.result.least_covered_file, covered_percentages.min, SimpleCov.minimum_coverage_by_file)
        @exit_status = SimpleCov::ExitCodes::MINIMUM_COVERAGE
      elsif (last_run = SimpleCov::LastRun.read) # rubocop:disable Metrics/BlockNesting
        diff = last_run["result"]["covered_percent"] - covered_percent
        if diff > SimpleCov.maximum_coverage_drop # rubocop:disable Metrics/BlockNesting
          $stderr.printf("Coverage has dropped by %.2f%% since the last time (maximum allowed: %.2f%%).\n", diff, SimpleCov.maximum_coverage_drop)
          @exit_status = SimpleCov::ExitCodes::MAXIMUM_COVERAGE_DROP
        end
      end
    end

    SimpleCov::LastRun.write(:result => {:covered_percent => covered_percent})
  end

  # Force exit with stored status (see github issue #5)
  # unless it's nil or 0 (see github issue #281)
  Kernel.exit @exit_status if @exit_status && @exit_status > 0
end

# Autoload config from ~/.simplecov if present
require "etc"
home_dir = File.expand_path("~") || Etc.getpwuid.dir || (ENV["USER"] && File.expand_path("~#{ENV['USER']}"))
if home_dir
  global_config_path = File.join(home_dir, ".simplecov")
  load global_config_path if File.exist?(global_config_path)
end

# Autoload config from .simplecov if present
config_path = File.join(SimpleCov.root, ".simplecov")
load config_path if File.exist?(config_path)


text:
package com.google.common.reflect;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ClassPathTest {

    /**
     * Logger for ClassPathTest
     */
    private static final Logger logger = LoggerFactory.getLogger(ClassPathTest.class);

    @Test
    public void test_getTopLevelClasses() throws Exception {
        ClassPath classpath = ClassPath.from(Thread.currentThread().getContextClassLoader());
        for (ClassPath.ClassInfo classInfo : classpath.getTopLevelClasses(this.getClass().getPackage().getName())) {
            logger.info(classInfo.getName());
        }
    }

}


text:
package com.utils;

import java.util.Collection;
import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

import com.pojos.Event;

public class EventManager {

	private static SessionFactory factory;
	private static EventManager instance = new EventManager();

	private EventManager() {
		Configuration config = new Configuration().configure().addAnnotatedClass(Event.class);
		factory = config.buildSessionFactory();
	}

	public synchronized Event persistEvent(Event event) {
		Session session = factory.openSession();
		session.beginTransaction();
		session.save(event);
		session.getTransaction().commit();
		session.close();
		return event;
	}

	public Event findEvent(int eventID) {
		Session session = factory.openSession();
		session.beginTransaction();
		Event event = session.load(Event.class, eventID);
		session.getTransaction().commit();
		session.close();
		return event;
	}

	public List<Event> findAll() {
		Session session = factory.openSession();
		session.beginTransaction();
		@SuppressWarnings("unchecked")
		List<Event> events = session.createQuery("from Event").getResultList();
		session.getTransaction().commit();
		session.close();

		return events;
	}

	public synchronized void removeEvent(int id) {
		Session session = factory.openSession();
		session.beginTransaction();
		Event event = findEvent(id);
		session.delete(event);
		session.getTransaction().commit();
		session.close();
	}

	public synchronized Event updateEvent(Event event) {
		Session session = factory.openSession();
		session.beginTransaction();
		session.update(event);
		session.getTransaction().commit();
		session.close();
		return findEvent(event.getId());

	}

	public List<Event> searchEvents(String weather, double lon, double lat) {

		Session session = factory.openSession();
		session.beginTransaction();
		@SuppressWarnings("unchecked")
		List<Event> events = session
				.createQuery("select ev from Event ev where ev.lon = ?1 and ev.lat = ?2 and ev.weather = ?3")
				.setParameter(1, lon).setParameter(2, lat).setParameter(3, weather).getResultList();
		session.getTransaction().commit();
		session.close();
		return events;
	}

	public void persistEvents(Collection<Event> events) {
		List<Event> list = (List<Event>) events;

		Session session = factory.openSession();
		session.beginTransaction();
		System.out.println(list.size());
		for (int i = 0; i < list.size(); i++) {

			session.save(list.get(i));
			if (i % 100 == 0) {
				session.flush();
				session.clear();
			}

		}
		session.getTransaction().commit();
		session.close();
	}

	public static EventManager getManager() {
		return instance;
	}

	public static void closeManager() {
		factory.close();
	}
}


text:
describe('View#appendTo()', function() {
  var viewToTest;

  beforeEach(function() {
    viewToTest = helpers.createView();
  });

  test("Should return the view for a fluent interface.", function() {
    var sandbox = document.createElement('div'),
        sandbox2 = document.createElement('div'),
        existing = document.createElement('div');

    sandbox2.appendChild(existing);

    expect(viewToTest.render().appendTo(sandbox)).toBe(viewToTest);
    expect(viewToTest.render().insertBefore(sandbox2, existing)).toBe(viewToTest);
  });

  test("Should append the view element as a child of the given element.", function() {
    var sandbox = document.createElement('div');

    viewToTest
      .render()
      .appendTo(sandbox);

    expect(viewToTest.el).toBe(sandbox.firstElementChild);
  });

  test("Should not destroy existing element contents.", function() {
    var sandbox = document.createElement('div'),
        existing = document.createElement('div');

    sandbox.appendChild(existing);

    viewToTest
      .render()
      .appendTo(sandbox);

    expect(existing).toBe(sandbox.firstElementChild);
    expect(viewToTest.el).toBe(sandbox.lastElementChild);
  });

  test("Should insert before specified element.", function() {
    var sandbox = document.createElement('div'),
        existing1 = document.createElement('div'),
        existing2 = document.createElement('div');

    sandbox.appendChild(existing1);
    sandbox.appendChild(existing2);

    viewToTest
      .render()
      .insertBefore(sandbox, existing2);

    expect(existing1).toBe(sandbox.firstElementChild);
    expect(viewToTest.el).toBe(existing1.nextSibling);
    expect(existing2).toBe(viewToTest.el.nextSibling);
  });

  afterEach(function() {
    helpers.emptySandbox();
    helpers.destroyView();
    viewToTest = null;
  });
});


text:
<?php

namespace Nonalweb\LieuBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * LieuRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class LieuRepository extends EntityRepository
{
	public function listerLieuxPourDiscipline($disciplineId){

		$queryBuilder = $this->createQueryBuilder('l');

		// Méthode équivalente, mais plus longue :
		$queryBuilder = $this->_em->createQueryBuilder()
		  ->select('l')
		  ->from($this->_entityName, 'l')
		  ->innerJoin('l.lieuxDisciplines', 'ld')
		  ->where('ld.discipline = :disciplineId')
		  ->andWhere('l.actif = :actif')
		  ->setParameter('disciplineId', $disciplineId)
		  ->setParameter('actif', true)
		  ;
		// On a fini de construire notre requête.

		// On récupère la Query à partir du QueryBuilder
		$query = $queryBuilder->getQuery();

		// On récupère les résultats à partir de la Query
		$resultats = $query->getResult();

		// On retourne ces résultats
		return $resultats;
	}
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace IHLoader
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Infrastructure;

    public partial class IHEntities : DbContext
    {
        public IHEntities()
            : base("name=IHEntities")
        {
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            throw new UnintentionalCodeFirstException();
        }

        public virtual DbSet<accomodation> accomodations { get; set; }
        public virtual DbSet<accomodationBrand> accomodationBrands { get; set; }
        public virtual DbSet<accomodationDetail> accomodationDetails { get; set; }
        public virtual DbSet<accomodationHotelRoom> accomodationHotelRooms { get; set; }
        public virtual DbSet<accomodationType> accomodationTypes { get; set; }
        public virtual DbSet<alert> alerts { get; set; }
        public virtual DbSet<bank> banks { get; set; }
        public virtual DbSet<cancellationcondition> cancellationconditions { get; set; }
        public virtual DbSet<country> countries { get; set; }
        public virtual DbSet<customerfeedback> customerfeedbacks { get; set; }
        public virtual DbSet<distance> distances { get; set; }
        public virtual DbSet<exchangerate> exchangerates { get; set; }
        public virtual DbSet<exchangeratetype> exchangeratetypes { get; set; }
        public virtual DbSet<HotelAttribute> HotelAttributes { get; set; }
        public virtual DbSet<insidedescription> insidedescriptions { get; set; }
        public virtual DbSet<LocalizedDictionary> LocalizedDictionaries { get; set; }
        public virtual DbSet<LocalizedDictionaryType> LocalizedDictionaryTypes { get; set; }
        public virtual DbSet<MIKI_BookingStatus> MIKI_BookingStatus { get; set; }
        public virtual DbSet<outsidedescription> outsidedescriptions { get; set; }
        public virtual DbSet<payment> payments { get; set; }
        public virtual DbSet<picture> pictures { get; set; }
        public virtual DbSet<picturesBody> picturesBodies { get; set; }
        public virtual DbSet<place> places { get; set; }
        public virtual DbSet<price> prices { get; set; }
        public virtual DbSet<price_service> price_service { get; set; }
        public virtual DbSet<price_SpecialOffer> price_SpecialOffer { get; set; }
        public virtual DbSet<Quality> Qualities { get; set; }
        public virtual DbSet<region> regions { get; set; }
        public virtual DbSet<ReservedHouse> ReservedHouses { get; set; }
        public virtual DbSet<salesoffice> salesoffices { get; set; }
        public virtual DbSet<service> services { get; set; }
        public virtual DbSet<servicedescription> servicedescriptions { get; set; }
        public virtual DbSet<servicedescription_textcode> servicedescription_textcode { get; set; }
        public virtual DbSet<servicedestination> servicedestinations { get; set; }
        public virtual DbSet<serviceentity> serviceentities { get; set; }
        public virtual DbSet<servicetype> servicetypes { get; set; }
        public virtual DbSet<specialofferdefiniton> specialofferdefinitons { get; set; }
        public virtual DbSet<Status_Log> Status_Log { get; set; }
        public virtual DbSet<sysdiagram> sysdiagrams { get; set; }
        public virtual DbSet<Unit> Units { get; set; }
        public virtual DbSet<vacancy> vacancies { get; set; }
    }
}


text:
var redis = require("redis");
var logutils = require('./log.utils');
var configUtils = require('../common/config.utils');

function createDefRedisClientAndWait (callback)
{
    var config = configUtils.getConfig();
    var server_port = (config.redis_server_port) ?
        config.redis_server_port : global.DFLT_REDIS_SERVER_PORT;
    var server_ip = (config.redis_server_ip) ?
        config.redis_server_ip : global.DFLT_REDIS_SERVER_IP;
    createRedisClientAndWait(server_port, server_ip, global.WEBUI_DFLT_REDIS_DB,
                             function(redisClient) {
        callback(redisClient);
    });
}

function createRedisClientAndWait (port, ip, uiDB, callback)
{
    var options = {};
    var redisClient = redis.createClient(port, ip);
    redisClient.retry_backoff = 1;
    redisClient.retry_delay = 30 * 1000; //30 Seconds
    redisClient.on('connect', selectRedisDB(uiDB, redisClient, callback));
    redisClient.on('ready', redisLog('ready'));
    redisClient.on('reconnecting', redisLog('reconnecting'));
    redisClient.on('error', redisLog('error'));
    redisClient.on('end', redisLog('end'));
}

function createRedisClient (port, ip, uiDB)
{
    var doNotSelect = false;
    var config = configUtils.getConfig();
    if (-1 == port) {
        doNotSelect = true;
        port = null;
    }
    port = (null != port) ? port :
        ((config.redis_server_port) ? config.redis_server_port :
         global.DFLT_REDIS_SERVER_PORT);
    ip = (null != ip) ? ip :
        ((config.redis_server_ip) ? config.redis_server_ip :
         global.DFLT_REDIS_SERVER_IP);
    uiDB = (null != uiDB) ? uiDB : global.WEBUI_DFLT_REDIS_DB;
    var redisClient = redis.createClient(port, ip);
    redisClient.retry_backoff = 1;
    redisClient.retry_delay = 30 * 1000; //30 Seconds
    if (false == doNotSelect) {
        redisClient.select(uiDB);
    }
    redisClient.on('error', redisLog('error'));
    redisClient.on('connect', redisLog('connect'));
    redisClient.on('ready', redisLog('ready'));//selectRedisDB(uiDB, redisClient, callback));
    redisClient.on('reconnecting', redisLog('reconnecting'));
    return redisClient;
}

function selectRedisDB (uiDB, redisClient, callback)
{
    return function() {
        if ((null == redisClient) || (true == redisClient.pub_sub_mode)) {
            callback(redisClient);
        } else {
            redisClient.select(uiDB, function(err, res) {
                if (err) {
                    logutils.logger.error('Redis DB ' + uiDB + ' SELECT error:' + err);
                } else {
                    logutils.logger.debug('Redis DB ' + uiDB + ' SELECT suuccess:');
                }
                callback(redisClient);
            });
        }
    }
}

function redisLog(type)
{
    return function() {
        switch(type) {
        case 'error':
            process.redisErrored = true;
            for (key in arguments) {
                var dispStr = arguments[key];
                /* Display first one */
                break;
            }
            if (global.service.MIDDLEWARE == process.mainModule.exports.myIdentity) {
                process.kueReinitReqd = true;
            }
            logutils.logger.error('Redis: ' + type + ' String: ' + dispStr);
            break;
        case 'connect':
            if ((global.service.MIDDLEWARE ===
                 process.mainModule.exports.myIdentity) &&
                (true == process.redisErrored) &&
                (true == process.connected)) {
                process.send({cmd: global.MSG_CMD_KILLALL});
                process.redisErrored = false;
            }
        default:
            logutils.logger.debug('Redis: ' + type);
            break;
        }
    }
}

function subscribeToRedisEvents (redisClient)
{
    redisClient.on('error', redisLog('error'));
}

function redisSetAndPostProcess (key, postRedisLookupCallback, req,
                                 appData, callback)
{
    postRedisLookupCallback(req, appData, function(err, data) {
        if ((null == err) && (null != data)) {
            process.mainModule.exports.redisClient.set(key, JSON.stringify(data),
                                                       function(setErr) {
                callback(err, data);
            });
        } else {
            callback(err, data);
        }
    });
}

function checkAndGetRedisDataByKey (key, postRedisLookupCallback, req,
                                    appData, callback)
{
    var forceRefresh = req.param('forceRefresh');
    if (null != forceRefresh) {
        redisSetAndPostProcess(key, postRedisLookupCallback, req, appData,
                               callback);
        return;
    }
    process.mainModule.exports.redisClient.get(key, function(err, value) {
        if ((null != err) || (null == value)) {
            redisSetAndPostProcess(key, postRedisLookupCallback, req, appData,
                                   callback);
            return;
        }
        callback(err, JSON.parse(value));
    });
}

function getRedisData (key, callback) {
    process.mainModule.exports.redisClient.get(key, function(err, value) {
        if ((null != err) || (null == value)) {
            callback(err, null);
            return;
        }
        callback(err, JSON.parse(value));
    });
}

function setRedisData (key, value, callback) {
    var data = JSON.stringify(value);
    process.mainModule.exports.redisClient.set(key, data, function(error) {
        if (callback) {
            callback(error);
        }
    });
}

function setexRedisData (key, expiry, value, callback) {
    process.mainModule.exports.redisClient.setex(key, expiry, JSON.stringify(value),
                                                 function(error) {
        if (callback) {
            callback(error);
        }
    });
}

exports.createRedisClient = createRedisClient;
exports.redisLog = redisLog;
exports.createRedisClientAndWait = createRedisClientAndWait;
exports.createDefRedisClientAndWait = createDefRedisClientAndWait;
exports.checkAndGetRedisDataByKey = checkAndGetRedisDataByKey;
exports.subscribeToRedisEvents = subscribeToRedisEvents;
exports.getRedisData = getRedisData;
exports.setRedisData = setRedisData;
exports.setexRedisData = setexRedisData;