text:
<?php
namespace W3TC;

// Define repeated regex to simplify changes
define( 'MINIFY_AUTO_FILENAME_REGEX', '([a-zA-Z0-9-_]+)\\.(css|js)([?].*)?' );
define( 'MINIFY_MANUAL_FILENAME_REGEX', '([a-f0-9]+)\\.(.+)\\.(include(\\-(footer|body))?)\\.[a-f0-9]+\\.(css|js)' );
/**
 * class Minify_MinifiedFileRequestHandler
 */
class Minify_MinifiedFileRequestHandler {
	/**
	 * Config
	 */
	var $_config = null;

	/**
	 * Tracks if an error has occurred.
	 *
	 * @var bool
	 */
	var $_error_occurred = false;

	/**
	 * PHP5 constructor
	 */
	function __construct() {
		$this->_config = Dispatcher::config();
	}

	/**
	 * Runs minify
	 *
	 * @param string|null $file
	 *
	 * @return void
	 */
	function process( $file = NULL, $quiet = false ) {
		/**
		 * Check for rewrite test request
		 */
		$rewrite_marker = 'rewrite_test.css';
		if ( substr( $file, strlen( $file ) - strlen( $rewrite_marker ) ) ==
			$rewrite_marker ) {
			echo 'Minify OK';
			exit();
		}

		$filelength_test_marker = 'XXX.css';
		if ( substr( $file, strlen( $file ) - strlen( $filelength_test_marker ) ) ==
			$filelength_test_marker ) {
			$cache = $this->_get_cache();
			header( 'Content-type: text/css' );

			if ( ! $cache->store( basename( $file ), array( 'content' => 'content ok' ) ) ) {
				echo 'error storing';
			} else {
				if ( ( function_exists( 'gzencode' ) &&
						$this->_config->get_boolean( 'browsercache.enabled' ) &&
						$this->_config->get_boolean( 'browsercache.cssjs.compression' ) ) )
					if ( !$cache->store( basename( $file ) . '.gzip',
							array( 'content' => gzencode( 'content ok' ) ) ) ) {
						echo 'error storing';
						exit();
					}

				$v = $cache->fetch( basename( $file ) );
				if ( $v['content'] == 'content ok' )
					echo 'content ok';
				else
					echo 'error storing';
			}

			exit();
		}

		// remove querystring
		if ( preg_match( '~(.+)(\?x[0-9]{5})$~', $file, $m ) )
			$file = $m[1];

		// remove blog_id
		$levels = '';
		if ( defined( 'W3TC_BLOG_LEVELS' ) ) {
			for ( $n = 0; $n < W3TC_BLOG_LEVELS; $n++ )
				$levels .= '[0-9]+\/';
		}

		if ( preg_match( '~^(' . $levels . '[0-9]+)\/(.+)$~', $file, $matches ) )
			$file = $matches[2];

		// normalize according to browsercache
		$file = Dispatcher::requested_minify_filename( $this->_config, $file );

		// parse file
		$hash = '';
		$matches = null;
		$location = '';
		$type = '';

		if ( preg_match( '~^' . MINIFY_AUTO_FILENAME_REGEX .'$~', $file, $matches ) ) {
			list( , $hash, $type ) = $matches;
		} elseif ( preg_match( '~^' . MINIFY_MANUAL_FILENAME_REGEX . '$~', $file, $matches ) ) {
			list( , $theme, $template, $location, , , $type ) = $matches;
		} else {
			return $this->finish_with_error( sprintf( 'Bad file param format: "%s"', $file ), $quiet, false );
		}

		/**
		 * Set cache engine
		 */
		$cache = $this->_get_cache();
		\Minify0_Minify::setCache( $cache );

		/**
		 * Set cache ID
		 */
		$cache_id = $this->get_cache_id( $file );
		\Minify0_Minify::setCacheId( $file );

		/**
		 * Set logger
		 */
		\Minify_Logger::setLogger( array(
				$this,
				'debug_error' ) );

		/**
		 * Set options
		 */
		$browsercache = $this->_config->get_boolean( 'browsercache.enabled' );

		$serve_options = array_merge( $this->_config->get_array( 'minify.options' ), array(
				'debug' => $this->_config->get_boolean( 'minify.debug' ),
				'maxAge' => $this->_config->get_integer( 'browsercache.cssjs.lifetime' ),
				'encodeOutput' => ( $browsercache &&
					!defined( 'W3TC_PAGECACHE_OUTPUT_COMPRESSION_OFF' ) &&
					!$quiet &&
					$this->_config->get_boolean( 'browsercache.cssjs.compression' ) ),
				'bubbleCssImports' => ( $this->_config->get_string( 'minify.css.imports' ) == 'bubble' ),
				'processCssImports' => ( $this->_config->get_string( 'minify.css.imports' ) == 'process' ),
				'cacheHeaders' => array(
					'use_etag' => ( $browsercache && $this->_config->get_boolean( 'browsercache.cssjs.etag' ) ),
					'expires_enabled' => ( $browsercache && $this->_config->get_boolean( 'browsercache.cssjs.expires' ) ),
					'cacheheaders_enabled' => ( $browsercache && $this->_config->get_boolean( 'browsercache.cssjs.cache.control' ) ),
					'cacheheaders' => $this->_config->get_string( 'browsercache.cssjs.cache.policy' )
				),
				'quiet' => $quiet
			) );

		/**
		 * Set sources
		 */
		if ( $hash ) {
			$_GET['f_array'] = $this->minify_filename_to_filenames_for_minification( $hash, $type );
			$_GET['ext'] = $type;
		} else {
			$_GET['g'] = $location;
			$serve_options['minApp']['groups'] = $this->get_groups( $theme, $template, $type );
		}

		/**
		 * Set minifier
		 */
		$w3_minifier = Dispatcher::component( 'Minify_ContentMinifier' );

		if ( $type == 'js' ) {
			$minifier_type = 'application/x-javascript';

			switch ( true ) {
			case ( ( $hash || $location == 'include' ) && $this->_config->get_boolean( 'minify.js.combine.header' ) ):
			case ( $location == 'include-body' && $this->_config->get_boolean( 'minify.js.combine.body' ) ):
			case ( $location == 'include-footer' && $this->_config->get_boolean( 'minify.js.combine.footer' ) ):
				$engine = 'combinejs';
				break;

			default:
				$engine = $this->_config->get_string( 'minify.js.engine' );

				if ( !$w3_minifier->exists( $engine ) || !$w3_minifier->available( $engine ) ) {
					$engine = 'js';
				}
				break;
			}

		} elseif ( $type == 'css' ) {
			$minifier_type = 'text/css';

			if ( ( $hash || $location == 'include' ) && $this->_config->get_boolean( 'minify.css.combine' ) ) {
				$engine = 'combinecss';
			} else {
				$engine = $this->_config->get_string( 'minify.css.engine' );

				if ( !$w3_minifier->exists( $engine ) || !$w3_minifier->available( $engine ) ) {
					$engine = 'css';
				}
			}
		}

		/**
		 * Initialize minifier
		 */
		$w3_minifier->init( $engine );

		$serve_options['minifiers'][$minifier_type] = $w3_minifier->get_minifier( $engine );
		$serve_options['minifierOptions'][$minifier_type] = $w3_minifier->get_options( $engine );

		/**
		 * Send X-Powered-By header
		 */
		if ( !$quiet && $browsercache && $this->_config->get_boolean( 'browsercache.cssjs.w3tc' ) ) {
			@header( 'X-Powered-By: ' . Util_Environment::w3tc_header() );
		}

		if ( empty( $_GET['f_array'] ) && empty( $_GET['g'] ) ) {
			return $this->finish_with_error( 'Nothing to minify', $quiet, false );
		}

		/**
		 * Minify!
		 */
		$return = array();
		try {
			$return = \Minify0_Minify::serve( 'MinApp', $serve_options );
		} catch ( \Exception $exception ) {
			return $this->finish_with_error( $exception->getMessage(), $quiet );
		}

		if ( !is_null( \Minify0_Minify::$recoverableError ) )
			$this->_handle_error( \Minify0_Minify::$recoverableError );

		$state = Dispatcher::config_state_master();
		if ( !$this->_error_occurred && $state->get_boolean( 'minify.show_note_minify_error' ) ) {
			$error_file = $state->get_string( 'minify.error.file' );
			if ( $error_file == $file ) {
				$state->set( 'minify.show_note_minify_error', false );
				$state->save();
			}
		}

		return $return;
	}

	public function w3tc_usage_statistics_of_request( $storage ) {
		$stats = \Minify0_Minify::getUsageStatistics();
		if ( count( $stats ) > 0 ) {
			$storage->counter_add( 'minify_requests_total', 1 );
			if ( $stats['content_type'] == 'text/css' ) {
				$storage->counter_add( 'minify_original_length_css',
					(int)( $stats['content_original_length'] / 102.4 ) );
				$storage->counter_add( 'minify_output_length_css',
					(int)( $stats['content_output_length'] / 102.4 ) );
			} else {
				$storage->counter_add( 'minify_original_length_js',
					(int)( $stats['content_original_length'] / 102.4 ) );
				$storage->counter_add( 'minify_output_length_js',
					(int)( $stats['content_output_length'] / 102.4 ) );
			}
		}
	}

	/**
	 * Returns size statistics about cache files
	 */
	public function get_stats_size( $timeout_time ) {
		$cache = $this->_get_cache();
		if ( method_exists( $cache, 'get_stats_size' ) )
			return $cache->get_stats_size( $timeout_time );

		return array();
	}

	/**
	 * Flushes cache
	 *
	 * @return boolean
	 */
	function flush() {
		$cache = $this->_get_cache();
		// used to debug - which plugin calls flush all the time and breaks
		// performance
		if ( $this->_config->get_boolean( 'minify.debug' ) ) {
			Minify_Core::log( 'Minify flush called from' );
			Minify_Core::log( json_encode( debug_backtrace () ) );
		}

		return $cache->flush();
	}

	/**
	 * Returns custom data storage for minify file, based on url
	 *
	 * @param string  $url
	 * @return mixed
	 */
	function get_url_custom_data( $url ) {
		if ( preg_match( '~/' . MINIFY_AUTO_FILENAME_REGEX .'$~', $url, $matches ) ) {
			list( , $hash, $type ) = $matches;

			$key = $this->get_custom_data_key( $hash, $type );
			return $this->_cache_get( $key );
		}

		return null;
	}

	/**
	 * Returns custom data storage for minify file
	 *
	 * @param string  $file
	 * @param mixed   $data
	 */
	function set_file_custom_data( $file, $data ) {
		if ( preg_match( '~' . MINIFY_AUTO_FILENAME_REGEX .'$~', $file, $matches ) ) {
			list( , $hash, $type ) = $matches;

			$key = $this->get_custom_data_key( $hash, $type );
			$this->_cache_set( $key, $data );
		}
	}

	/**
	 * Returns minify groups
	 *
	 * @param string  $theme
	 * @param string  $template
	 * @param string  $type
	 * @return array
	 */
	function get_groups( $theme, $template, $type ) {
		$result = array();

		switch ( $type ) {
		case 'css':
			$groups = $this->_config->get_array( 'minify.css.groups' );
			break;

		case 'js':
			$groups = $this->_config->get_array( 'minify.js.groups' );
			break;

		default:
			return $result;
		}

		if ( isset( $groups[$theme]['default'] ) ) {
			$locations = (array) $groups[$theme]['default'];
		} else {
			$locations = array();
		}

		if ( $template != 'default' && isset( $groups[$theme][$template] ) ) {
			$locations = array_merge_recursive( $locations, (array) $groups[$theme][$template] );
		}

		foreach ( $locations as $location => $config ) {
			if ( !empty( $config['files'] ) ) {
				foreach ( (array) $config['files'] as $url ) {
					if ( !Util_Environment::is_url( $url ) )
						$url = Util_Environment::home_domain_root_url() . '/' .
							ltrim( $url, '/' );

					$file = Util_Environment::url_to_docroot_filename( $url );

					if ( Util_Environment::is_url( $file ) ) {
						$precached_file = $this->_precache_file( $file, $type );

						if ( $precached_file ) {
							$result[$location][$file] = $precached_file;
						} else {
							Minify_Core::debug_error( sprintf( 'Unable to cache remote file: "%s"', $file ) );
						}
					} else {
						$path = Util_Environment::document_root() . '/' . $file;

						if ( file_exists( $path ) ) {
							$result[$location][$file] = '//' . $file;
						} else {
							Minify_Core::debug_error( sprintf( 'File "%s" doesn\'t exist', $path ) );
						}
					}
				}
			}
		}

		return $result;
	}

	/**
	 * Returns minify cache ID
	 *
	 * @param string  $file
	 * @return string
	 */
	function get_cache_id( $file ) {
		return $file;
	}

	/**
	 * Returns array of group sources
	 *
	 * @param string  $theme
	 * @param string  $template
	 * @param string  $location
	 * @param string  $type
	 * @return array
	 */
	function get_sources_group( $theme, $template, $location, $type ) {
		$sources = array();
		$groups = $this->get_groups( $theme, $template, $type );

		if ( isset( $groups[$location] ) ) {
			$files = (array) $groups[$location];

			$document_root = Util_Environment::document_root();

			foreach ( $files as $file ) {
				if ( is_a( $file, '\Minify_Source' ) ) {
					$path = $file->filepath;
				} else {
					$path = rtrim( $document_root, '/' ) . '/' . ltrim( $file, '/' );
				}

				$sources[] = $path;
			}
		}

		return $sources;
	}

	/**
	 * Returns ID key for group
	 *
	 * @param unknown $theme
	 * @param unknown $template
	 * @param unknown $location
	 * @param unknown $type
	 * @return string
	 */
	function get_id_key_group( $theme, $template, $location, $type ) {
		return sprintf( '%s/%s.%s.%s.id', $theme, $template, $location, $type );
	}

	/**
	 * Returns id for group
	 *
	 * @param string  $theme
	 * @param string  $template
	 * @param string  $location
	 * @param string  $type
	 * @return integer
	 */
	function get_id_group( $theme, $template, $location, $type ) {
		$key = $this->get_id_key_group( $theme, $template, $location, $type );
		$id = $this->_cache_get( $key );

		if ( $id === false ) {
			$sources = $this->get_sources_group( $theme, $template, $location, $type );

			if ( count( $sources ) ) {
				$id = $this->_generate_id( $sources, $type );

				if ( $id ) {
					$this->_cache_set( $key, $id );
				}
			}
		}

		return $id;
	}

	/**
	 * Returns custom files key
	 *
	 * @param string  $hash
	 * @param string  $type
	 * @return string
	 */
	function get_custom_data_key( $hash, $type ) {
		return sprintf( '%s.%s.customdata', $hash, $type );
	}

	/**
	 * Returns custom files
	 *
	 * @param string  $hash
	 * @param string  $type
	 * @return array
	 */
	function minify_filename_to_filenames_for_minification( $hash, $type ) {
		// if bad data passed as get parameter - it shouldn't fire internal errors
		try {
			$files = Minify_Core::minify_filename_to_urls_for_minification(
				$hash, $type );
		} catch ( Exception $e ) {
			$files = array();
		}

		$result = array();
		if ( is_array( $files ) && count( $files ) > 0 ) {
			foreach ( $files as $file ) {
				$file = Util_Environment::url_to_docroot_filename( $file );

				if ( Util_Environment::is_url( $file ) ) {
					$precached_file = $this->_precache_file( $file, $type );

					if ( $precached_file ) {
						$result[] = $precached_file;
					} else {
						Minify_Core::debug_error( sprintf( 'Unable to cache remote file: "%s"', $file ) );
					}
				} else {
					$path = Util_Environment::document_root() . '/' . $file;

					if ( file_exists( $path ) ) {
						$result[] = $file;
					} else {
						Minify_Core::debug_error( sprintf( 'File "%s" doesn\'t exist', $path ) );
					}
				}
			}
		} else {
			Minify_Core::debug_error( sprintf( 'Unable to fetch custom files list: "%s.%s"', $hash, $type ), false, 404 );
		}

		return $result;
	}

	/**
	 * Sends error response
	 *
	 * @param string  $error
	 * @param boolean $handle
	 * @param integer $status
	 * @return void
	 */
	function finish_with_error( $error, $quiet = false, $report_about_error = true ) {
		$this->_error_occurred = true;

		Minify_Core::debug_error( $error );

		if ( $report_about_error ) {
			$this->_handle_error( $error );
		}

		$message = '
W3TC Minify Error
';

		if ( $debug ) {
			$message .= sprintf( '
%s.
', $error );
		} else {
			$message .= '
Enable debug mode to see error message.
';
		}

		if ( $quiet ) {
			return array(
				'content' => array( 'content' => $message )
			);
		}

		if ( defined( 'W3TC_IN_MINIFY' ) ) {
			status_header( 400 );
			echo $message;
			die();
		}
	}

	public function debug_error( $error ) {
		Minify_Core::debug_error( $error );
	}

	/**
	 * Pre-caches external file
	 *
	 * @param string  $url
	 * @param string  $type
	 * @return string
	 */
	function _precache_file( $url, $type ) {
		$lifetime = $this->_config->get_integer( 'minify.lifetime' );
		$cache_path = sprintf( '%s/minify_%s.%s', Util_Environment::cache_blog_dir( 'minify' ), md5( $url ), $type );

		if ( !file_exists( $cache_path ) || @filemtime( $cache_path ) < ( time() - $lifetime ) ) {

			if ( !@is_dir( dirname( $cache_path ) ) ) {

				Util_File::mkdir_from( dirname( $cache_path ), W3TC_CACHE_DIR );
			}
			Util_Http::download( $url, $cache_path );
		}

		return file_exists( $cache_path ) ? $this->_get_minify_source( $cache_path, $url ) : false;
	}

	/**
	 * Returns minify source
	 *
	 * @param unknown $file_path
	 * @param unknown $url
	 * @return Minify_Source
	 */
	function _get_minify_source( $file_path, $url ) {
		return new \Minify_Source( array(
				'filepath' => $file_path,
				'minifyOptions' => array(
					'prependRelativePath' => $url
				)
			) );
	}

	/**
	 * Returns minify cache object
	 *
	 * @return object
	 */
	function _get_cache() {
		static $cache = array();

		if ( !isset( $cache[0] ) ) {
			switch ( $this->_config->get_string( 'minify.engine' ) ) {
			case 'memcached':
				$config = array(
					'blog_id' => Util_Environment::blog_id(),
					'instance_id' => Util_Environment::instance_id(),
					'host' =>  Util_Environment::host(),
					'module' => 'minify',
					'servers' => $this->_config->get_array( 'minify.memcached.servers' ),
					'persistent' => $this->_config->get_boolean( 'minify.memcached.persistent' ),
					'aws_autodiscovery' => $this->_config->get_boolean( 'minify.memcached.aws_autodiscovery' ),
					'username' => $this->_config->get_boolean( 'minify.memcached.username' ),
					'password' => $this->_config->get_boolean( 'minify.memcached.password' )
				);
				if ( class_exists( 'Memcached' ) ) {
					$w3_cache = new Cache_Memcached( $config );
				} else if ( class_exists( 'Memcache' ) ) {
						$w3_cache = new Cache_Memcache( $config );
					}

				$cache[0] = new \Minify_Cache_W3TCDerived( $w3_cache );
				break;

			case 'redis':
				$config = array(
					'blog_id' => Util_Environment::blog_id(),
					'instance_id' => Util_Environment::instance_id(),
					'host' =>  Util_Environment::host(),
					'module' => 'minify',
					'servers' => $this->_config->get_array( 'minify.redis.servers' ),
					'persistent' => $this->_config->get_boolean( 'minify.redis.persistent' ),
					'dbid' => $this->_config->get_boolean( 'minify.redis.dbid' ),
					'password' => $this->_config->get_boolean( 'minify.redis.password' )
				);
				if ( class_exists( 'Memcached' ) ) {
					$w3_cache = new Cache_Memcached( $config );
				} else if ( class_exists( 'Memcache' ) ) {
						$w3_cache = new Cache_Memcache( $config );
					}

				$cache[0] = new \Minify_Cache_W3TCDerived( $w3_cache );
				break;

			case 'apc':
				$config = array(
					'blog_id' => Util_Environment::blog_id(),
					'instance_id' => Util_Environment::instance_id(),
					'host' =>  Util_Environment::host(),
					'module' => 'minify'
				);

				if ( function_exists( 'apcu_store' ) )
					$w3_cache = new Cache_Apcu( $config );
				else if ( function_exists( 'apc_store' ) )
						$w3_cache = new Cache_Apc( $config );

					$cache[0] = new \Minify_Cache_W3TCDerived( $w3_cache );
				break;

			case 'eaccelerator':
				$config = array(
					'blog_id' => Util_Environment::blog_id(),
					'instance_id' => Util_Environment::instance_id(),
					'host' =>  Util_Environment::host(),
					'module' => 'minify'
				);
				$w3_cache = new Cache_Eaccelerator( $config );
				$cache[0] = new \Minify_Cache_W3TCDerived( $w3_cache );
				break;

			case 'xcache':
				$config = array(
					'blog_id' => Util_Environment::blog_id(),
					'instance_id' => Util_Environment::instance_id(),
					'host' =>  Util_Environment::host(),
					'module' => 'minify'
				);
				$w3_cache = new Cache_Xcache( $config );
				$cache[0] = new \Minify_Cache_W3TCDerived( $w3_cache );
				break;

			case 'wincache':
				$config = array(
					'blog_id' => Util_Environment::blog_id(),
					'instance_id' => Util_Environment::instance_id(),
					'host' =>  Util_Environment::host(),
					'module' => 'minify'
				);
				$w3_cache = new Cache_Wincache( $config );
				$cache[0] = new \Minify_Cache_W3TCDerived( $w3_cache );
				break;

			case 'file':
			default:
				$cache[0] = new \Minify_Cache_File(
					Util_Environment::cache_blog_minify_dir(),
					array(
						'.htaccess',
						'index.php',
						'*.old'
					),
					$this->_config->get_boolean( 'minify.file.locking' ),
					$this->_config->get_integer( 'timelimit.cache_flush' ),
					( Util_Environment::blog_id() == 0 ? W3TC_CACHE_MINIFY_DIR : null )
				);
				break;
			}
		}

		return $cache[0];
	}

	/**
	 * Handle minify error
	 *
	 * @param string  $error
	 * @return void
	 */
	function _handle_error( $error ) {
		$notification = $this->_config->get_string( 'minify.error.notification' );

		if ( $notification ) {
			$file = Util_Request::get_string( 'file' );
			$state = Dispatcher::config_state_master();

			if ( $file ) {
				$state->set( 'minify.error.file', $file );
			}

			if ( stristr( $notification, 'admin' ) !== false ) {
				$state->set( 'minify.error.last', $error );
				$state->set( 'minify.show_note_minify_error', true );
			}

			if ( stristr( $notification, 'email' ) !== false ) {
				$last = $state->get_integer( 'minify.error.notification.last' );

				/**
				 * Prevent email flood: send email every 5 min
				 */
				if ( ( time() - $last ) > 300 ) {
					$state->set( 'minify.error.notification.last', time() );
					$this->_send_notification();
				}
			}

			$state->save();
		}
	}

	/**
	 * Send E-mail notification when error occurred
	 *
	 * @return boolean
	 */
	function _send_notification() {
		$from_email = 'wordpress@' . Util_Environment::host();
		$from_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
		$to_name = $to_email = get_option( 'admin_email' );
		$body = @file_get_contents( W3TC_INC_DIR . '/email/minify_error_notification.php' );

		$headers = array(
			sprintf( 'From: "%s" <%s>', addslashes( $from_name ), $from_email ),
			sprintf( 'Reply-To: "%s" <%s>', addslashes( $to_name ), $to_email ),
			'Content-Type: text/html; charset=utf-8'
		);

		@set_time_limit( $this->_config->get_integer( 'timelimit.email_send' ) );

		$result = @wp_mail( $to_email, 'W3 Total Cache Error Notification', $body, implode( "\n", $headers ) );

		return $result;
	}

	/**
	 * Generates file ID
	 *
	 * @param array   $sources
	 * @param string  $type
	 * @return string
	 */
	function _generate_id( $sources, $type ) {
		$values =array();
		foreach ( $sources as $source )
			if ( is_string( $source ) )
				$values[] = $source;
			else
				$values[] = $source->filepath;
			foreach ( $sources as $source ) {
				if ( is_string( $source ) && file_exists( $source ) ) {
					$data = @file_get_contents( $source );

					if ( $data !== false ) {
						$values[] = md5( $data );
					} else {
						return false;
					}
				} else {
					$headers = @get_headers( $source->minifyOptions['prependRelativePath'] );
					if ( strpos( $headers[0], '200' ) !== false ) {
						$segments = explode( '.', $source->minifyOptions['prependRelativePath'] );
						$ext = strtolower( array_pop( $segments ) );
						$pc_source = $this->_precache_file( $source->minifyOptions['prependRelativePath'], $ext );
						$data = @file_get_contents( $pc_source->filepath );

						if ( $data !== false ) {
							$values[] = md5( $data );
						} else {
							return false;
						}
					}else {
						return false;
					}
				}
			}

		$keys = array(
			'minify.debug',
			'minify.engine',
			'minify.options',
			'minify.symlinks',
		);

		if ( $type == 'js' ) {
			$engine = $this->_config->get_string( 'minify.js.engine' );

			switch ( $engine ) {
			case 'js':
				$keys = array_merge( $keys, array(
						'minify.js.combine.header',
						'minify.js.combine.body',
						'minify.js.combine.footer',
						'minify.js.strip.comments',
						'minify.js.strip.crlf',
					) );
				break;

			case 'yuijs':
				$keys = array_merge( $keys, array(
						'minify.yuijs.options.line-break',
						'minify.yuijs.options.nomunge',
						'minify.yuijs.options.preserve-semi',
						'minify.yuijs.options.disable-optimizations',
					) );
				break;

			case 'ccjs':
				$keys = array_merge( $keys, array(
						'minify.ccjs.options.compilation_level',
						'minify.ccjs.options.formatting',
					) );
				break;
			}
		} elseif ( $type == 'css' ) {
			$engine = $this->_config->get_string( 'minify.css.engine' );

			switch ( $engine ) {
			case 'css':
				$keys = array_merge( $keys, array(
						'minify.css.combine',
						'minify.css.strip.comments',
						'minify.css.strip.crlf',
						'minify.css.imports',
					) );
				break;

			case 'yuicss':
				$keys = array_merge( $keys, array(
						'minify.yuicss.options.line-break',
					) );
				break;

			case 'csstidy':
				$keys = array_merge( $keys, array(
						'minify.csstidy.options.remove_bslash',
						'minify.csstidy.options.compress_colors',
						'minify.csstidy.options.compress_font-weight',
						'minify.csstidy.options.lowercase_s',
						'minify.csstidy.options.optimise_shorthands',
						'minify.csstidy.options.remove_last_;',
						'minify.csstidy.options.case_properties',
						'minify.csstidy.options.sort_properties',
						'minify.csstidy.options.sort_selectors',
						'minify.csstidy.options.merge_selectors',
						'minify.csstidy.options.discard_invalid_properties',
						'minify.csstidy.options.css_level',
						'minify.csstidy.options.preserve_css',
						'minify.csstidy.options.timestamp',
						'minify.csstidy.options.template',
					) );
				break;
			}
		}

		foreach ( $keys as $key ) {
			$values[] = $this->_config->get( $key );
		}

		$id = substr( md5( implode( '', $this->_flatten_array( $values ) ) ), 0, 6 );

		return $id;
	}

	/**
	 * Takes a multidimensional array and makes it singledimensional
	 *
	 * @param unknown $values
	 * @return array
	 */
	private function _flatten_array( $values ) {
		$flatten = array();

		foreach ( $values as $key => $value ) {
			if ( is_array( $value ) )
				$flatten = array_merge( $flatten, $this->_flatten_array( $value ) );
			else
				$flatten[$key] = $value;
		}
		return $flatten;
	}

	/**
	 * Returns cache data
	 *
	 * @param string  $key
	 * @return bool|array
	 */
	function _cache_get( $key ) {
		$cache = $this->_get_cache();

		$data = $cache->fetch( $key );

		if ( isset( $data['content'] ) ) {
			$value = @unserialize( $data['content'] );

			return $value;
		}

		return false;
	}

	/**
	 * Sets cache date
	 *
	 * @param string  $key
	 * @param string  $value
	 * @return boolean
	 */
	function _cache_set( $key, $value ) {
		$cache = $this->_get_cache();

		return $cache->store( $key, array( 'content' => serialize( $value ) ) );
	}
}


text:
"""Package des masques du module perso."""

from . import chambre

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Descanso</title>
	</head>
	<body>
		<script src="jquery.js" type="text/javascript"></script>
		<script src="underscore.js" type="text/javascript"></script>
		<script src="descanso.js" type="text/javascript"></script>
	</body>
</html>


text:
/**
 * Flick on the touch screen using finger motion events. This flickcommand starts
 * at a particulat screen location.
 *
 * @param {String} ID      ID of the element where the flick starts
 * @param {Number} xoffset the x offset in pixels to flick by
 * @param {Number} yoffset the y offset in pixels to flick by
 * @param {Number} speed   the speed in pixels per seconds
 *
 * @see  https://code.google.com/p/selenium/wiki/JsonWireProtocol#session/:sessionId/touch/flick
 * @type protocol
 *
 */

var ErrorHandler = require('../utils/ErrorHandler.js');

module.exports = function touchFlick(id, xoffset, yoffset, speed) {

    /*!
     * make sure that callback contains chainit callback
     */
    var callback = arguments[arguments.length - 1];

    var data = {};

    if (typeof id === 'number' && typeof xoffset === 'number') {

        data = {
            xoffset: id,
            yoffset: xoffset
        };

    } else if (!id && typeof xoffset === 'number' && typeof yoffset === 'number') {

        data = {
            xoffset: xoffset,
            yoffset: yoffset
        };

    } else if (typeof id === 'string' && typeof xoffset === 'number' && typeof yoffset === 'number' && typeof speed === 'number') {

        data = {
            element: id,
            xoffset: xoffset,
            yoffset: yoffset,
            speed: speed,
        };

    } else {

        return callback(new ErrorHandler.ProtocolError('number or type of arguments don\'t agree with touchFlick command'));

    }

    this.requestHandler.create(
        '/session/:sessionId/touch/flick',
        data,
        callback
    );

};


text:
% CSIntro -- Info for SpinDemo
%
%   The .m files in this firectory can reproduce the figures
%   in the article
%            Translation-Invariant DeNoising
%                         by
%              D.L. Donoho and R.R. Coifman
%
%    to appear in Wavelets in Statistics, Edited by
%    Anestis Antoniadis and Georges Oppenheim, Springer Verlag
%
%   These figures illustrate the application of Translation
%   Invariant De-Noising methods, which exhibit reduced Gibbs Phenomena
%   and greater accuracy.
%
%   The manuscript is available over the internet at
%   http://www-stat.stanford.edu/~donoho/Reports/1995/TIDeNoise.ps.Z
%

%
%  Part of Wavelab Version 850
%  Built Tue Jan  3 13:20:42 EST 2006
%  This is Copyrighted Material
%  For Copying permissions see COPYING.m
%  Comments? e-mail wavelab@stat.stanford.edu


text:
#include "arch/arm/fastmodel/reset_controller/example.hh"

#include <algorithm>

#include "base/logging.hh"

namespace gem5
{
namespace fastmodel
{

ResetControllerExample::CorePins::CorePins(const std::string &module_name)
    : reset(module_name + ".reset", 0, this),
      halt(module_name + ".halt", 0, this)
{}

ResetControllerExample::Registers::Registers(
    const std::string &module_name, Iris::BaseCPU *c, CorePins *p)
    : RegisterBankLE(module_name, 0), cpu(c), pins(p),
      nsrvbar(module_name + ".nsrvbar"),
      rvbar(module_name + ".rvbar"),
      reset(module_name + ".reset"),
      halt(module_name + ".halt")
{
      panic_if(cpu == nullptr, "ResetControllerExample needs a target cpu.");
      nsrvbar.writer(
          [this] (auto &reg, auto val)
          {
              cpu->setResetAddr(val, false);
          });
      rvbar.writer(
          [this] (auto &reg, auto val)
          {
              cpu->setResetAddr(val, true);
          });
      reset.writer(
          [this] (auto &reg, auto val)
          {
              panic_if(!pins->reset.isConnected(),
                       "%s is not connected.", pins->reset.name());

              if (val)
                  pins->reset.raise();
              else
                  pins->reset.lower();
          });
      halt.writer(
          [this] (auto &reg, auto val)
          {
              panic_if(!pins->halt.isConnected(),
                       "%s is not connected.", pins->halt.name());

              if (val)
                  pins->halt.raise();
              else
                  pins->halt.lower();
          });

      addRegisters({
          nsrvbar,
          rvbar,
          reset,
          halt,
      });
}

ResetControllerExample::ResetControllerExample(const Params &p)
    : BasicPioDevice(p, 0x20),
      pins(p.name + ".pins"),
      registers(p.name  + ".registers", p.cpu, &pins)
{}

Tick
ResetControllerExample::read(PacketPtr pkt)
{
    pkt->makeResponse();
    auto data = pkt->getPtr<uint8_t>();
    auto size = pkt->getSize();
    std::fill(data, data + size, 0);
    return pioDelay;
}

Tick
ResetControllerExample::write(PacketPtr pkt)
{
    pkt->makeResponse();
    size_t size = pkt->getSize();
    if (size != 4 && size != 8) {
        pkt->setBadAddress();
    } else {
        auto addr = pkt->getAddr() - pioAddr;
        registers.write(addr, pkt->getPtr<void>(), size);
    }
    return pioDelay;
}

Port &
ResetControllerExample::getPort(const std::string &if_name, PortID idx)
{
    if (if_name == "reset")
        return pins.reset;
    else if (if_name == "halt")
        return pins.halt;

    return BasicPioDevice::getPort(if_name, idx);
}

} // namespace fastmodel
} // namespace gem5


text:
//
//  UAASPutScalingPolicyRequest.m
//  AWS iOS SDK
//
//  Copyright © Unsigned Apps 2014. See License file.
//  Created by Rob Amos.
//
//

#import "UAASPutScalingPolicyRequest.h"
#import "UAAWSAdditionalAccessors.h"
#import "UAASPutScalingPolicyResponse.h"

@interface UAASPutScalingPolicyRequest ()

@property (nonatomic, copy) NSString *action;
@property (nonatomic, copy) NSString *version;

@end

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wincomplete-implementation"

@implementation UAASPutScalingPolicyRequest

@synthesize action=_action, version=_version, autoScalingGroupName=_autoScalingGroupName, policyName=_policyName, scalingAdjustment=_scalingAdjustment, adjustmentType=_adjustmentType, cooldown=_cooldown, minAdjustmentStep=_minAdjustmentStep;

- (id)init
{
	if (self = [super init])
	{
		[self setAction:@"PutScalingPolicy"];
		[self setVersion:@"2011-01-01"];

	}
	return self;
}

- (Class)UA_ResponseClass
{
	return [UAASPutScalingPolicyResponse class];
}

+ (NSDictionary *)queryStringKeyPathsByPropertyKey
{
    // Start with super's key paths (if there are any)
    NSMutableDictionary *keyPaths = [[UAASRequest queryStringKeyPathsByPropertyKey] mutableCopy];

    [keyPaths addEntriesFromDictionary:
    @{
        @"action": @"Action",
        @"version": @"Version",
        @"autoScalingGroupName": @"AutoScalingGroupName",
        @"policyName": @"PolicyName",
        @"scalingAdjustment": @"ScalingAdjustment",
        @"adjustmentType": @"AdjustmentType",
        @"cooldown": @"Cooldown",
        @"minAdjustmentStep": @"MinAdjustmentStep"
    }];
    return [keyPaths copy];
}

+ (NSValueTransformer *)adjustmentTypeJSONTransformer
{
    return [NSValueTransformer UA_ENUMTransformerWithValues:@[ @(UAASScalingPolicyAdjustmentTypeChangeInCapacity), @(UAASScalingPolicyAdjustmentTypeExactCapacity), @(UAASScalingPolicyAdjustmentTypePercentChangeInCapacity) ]
                                               stringValues:@[ @"ChangeInCapacity", @"ExactCapacity", @"PercentChangeInCapacity" ]
                                               unknownValue:@(UAASScalingPolicyAdjustmentTypeUnknown)];
}

+ (NSValueTransformer *)adjustmentTypeQueryStringTransformer
{
    return [NSValueTransformer UA_ENUMTransformerWithValues:@[ @(UAASScalingPolicyAdjustmentTypeChangeInCapacity), @(UAASScalingPolicyAdjustmentTypeExactCapacity), @(UAASScalingPolicyAdjustmentTypePercentChangeInCapacity) ]
                                               stringValues:@[ @"ChangeInCapacity", @"ExactCapacity", @"PercentChangeInCapacity" ]
                                               unknownValue:@(UAASScalingPolicyAdjustmentTypeUnknown)];
}

/*#pragma mark - Invocation

- (void)invokeWithOwner:(id)owner completionBlock:(UAASPutScalingPolicyRequestCompletionBlock)completionBlock
{
    [self setUA_Owner:owner];
    [self setUA_RequestCompletionBlock:completionBlock];
    [self invoke];
}

- (void)waitWithOwner:(id)owner shouldContinueWaitingBlock:(UAASPutScalingPolicyRequestShouldContinueWaitingBlock)shouldContinueWaitingBlock completionBlock:(UAASPutScalingPolicyRequestCompletionBlock)completionBlock
{
    [self setUA_Owner:owner];
    [self setUA_ShouldContinueWaiting:shouldContinueWaitingBlock];
    [self setUA_RequestCompletionBlock:completionBlock];
    [self invoke];
}

- (void)waitWithOwner:(id)owner untilValueAtKeyPath:(NSString *)keyPath isInArray:(NSArray *)array completionBlock:(UAASPutScalingPolicyRequestCompletionBlock)completionBlock
{
    [self setUA_Owner:self];
    [self setUA_ShouldContinueWaiting:[UAAWSRequest UA_ShouldContinueWaitingBlockUntilValueAtKeyPath:keyPath isInArray:array]];
    [self setUA_RequestCompletionBlock:completionBlock];
    [self invoke];
}
*/
@end

#pragma clang diagnostic pop


text:
package com.qianxuefeng.mountain.service;

import com.qianxuefeng.mountain.domain.Result;

import java.io.InputStream;

/**
 * @author qianxuefeng
 * @since 2016年12月22日
 */
public interface IFileService {

	public Result uploadFile(String originalFileName, String uploadType, InputStream data);

}


text:
from allauth.socialaccount.tests import create_oauth2_tests
from allauth.tests import MockedResponse
from allauth.socialaccount.providers import registry

from .provider import AmazonProvider

class AmazonTests(create_oauth2_tests(registry.by_id(AmazonProvider.id))):
    def get_mocked_response(self):
        return MockedResponse(200, """
        {
          "Profile":{
                        "CustomerId":"amzn1.account.K2LI23KL2LK2",
                        "Name":"John Doe",
                        "PrimaryEmail":"johndoe@gmail.com"
                    }
        }""")


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.navercorp.pinpoint</groupId>
        <artifactId>pinpoint-profiler-optional-parent</artifactId>
        <relativePath>../profiler-optional-parent</relativePath>
        <version>1.6.0-SNAPSHOT</version>
    </parent>

    <artifactId>pinpoint-profiler-optional-jdk8</artifactId>
    <name>pinpoint-profiler-optional-jdk8</name>
    <packaging>jar</packaging>
    <description>pinpoint profiler optional package for jdk 8</description>

    <properties>
        <jdk.version>1.8</jdk.version>
        <jdk.home>${env.JAVA_8_HOME}</jdk.home>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.navercorp.pinpoint</groupId>
            <artifactId>pinpoint-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.18.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jvm>${jdk.home}/bin/java</jvm>
                    <!-- AbstractPinpointPluginTestSuite needs this to resolve
                        path of required jars -->
                    <useSystemClassLoader>false</useSystemClassLoader>
                    <failIfNoTests>true</failIfNoTests>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
<?php

namespace DCarbone\PHPFHIRGenerated\STU3\PHPFHIRTests\FHIRElement\FHIRBackboneElement\FHIRAuditEvent;

use PHPUnit\Framework\TestCase;
use DCarbone\PHPFHIRGenerated\STU3\FHIRElement\FHIRBackboneElement\FHIRAuditEvent\FHIRAuditEventDetail;

/**
 * Class FHIRAuditEventDetailTest
 * @package \DCarbone\PHPFHIRGenerated\STU3\PHPFHIRTests\FHIRElement\FHIRBackboneElement\FHIRAuditEvent
 */
class FHIRAuditEventDetailTest extends TestCase
{
    public function testCanConstructTypeNoArgs()
    {
        $type = new FHIRAuditEventDetail();
        $this->assertInstanceOf('\DCarbone\PHPFHIRGenerated\STU3\FHIRElement\FHIRBackboneElement\FHIRAuditEvent\FHIRAuditEventDetail', $type);
    }
}


text:
[![devDependency Status](https://david-dm.org/habaneroconsulting/sp2013-commandpalette/dev-status.svg)](https://david-dm.org/habaneroconsulting/sp2013-commandpalette#info=devDependencies) [![Build status](https://travis-ci.org/habaneroconsulting/sp2013-commandpalette.svg)](http://travis-ci.org/habaneroconsulting/sp2013-commandpalette)

## Screenshot

![Command Palette Screenshot](http://i.imgur.com/FolLxHQ.png)

## Getting Started

1. [Download the latest release of the script](https://github.com/habaneroconsulting/sp2013-commandpalette/releases/latest).

2. Upload the JavaScript file to your `Style Library`.

3. Edit your masterpage and add a reference to the new file. For example:

        <script src="/Style Library/Scripts/sp2013-commandpalette.min.js"></script>

4. Save and publish your masterpage.

5. Go back to your portal and try it out by pressing Ctrl + Shift + L, or Command + Shift + L on a Mac.

## Support

If you have a bug, or a feature request, please post in the [issue tracker](https://github.com/habaneroconsulting/sp2013-commandpalette/issues).

## Build Instructions

1. Install [NodeJS](http://nodejs.org/)

2. Run `npm install` from command line at root project folder.

3. Use the following commands:

    - `npm start` will minify and concatenate the vendor and source files
    - `npm test` will run all code through linting

## License

Copyright (c) 2015 Habanero Consulting Group

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.androidmanagement.v1.model;

/**
 * Security policies set to the most secure values by default. To maintain the security posture of a
 * device, we don't recommend overriding any of the default values.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Android Management API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class AdvancedSecurityOverrides extends com.google.api.client.json.GenericJson {

  /**
   * The policy for untrusted apps (apps from unknown sources) enforced on the device. Replaces
   * install_unknown_sources_allowed (deprecated).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String untrustedAppsPolicy;

  /**
   * The policy for untrusted apps (apps from unknown sources) enforced on the device. Replaces
   * install_unknown_sources_allowed (deprecated).
   * @return value or {@code null} for none
   */
  public java.lang.String getUntrustedAppsPolicy() {
    return untrustedAppsPolicy;
  }

  /**
   * The policy for untrusted apps (apps from unknown sources) enforced on the device. Replaces
   * install_unknown_sources_allowed (deprecated).
   * @param untrustedAppsPolicy untrustedAppsPolicy or {@code null} for none
   */
  public AdvancedSecurityOverrides setUntrustedAppsPolicy(java.lang.String untrustedAppsPolicy) {
    this.untrustedAppsPolicy = untrustedAppsPolicy;
    return this;
  }

  @Override
  public AdvancedSecurityOverrides set(String fieldName, Object value) {
    return (AdvancedSecurityOverrides) super.set(fieldName, value);
  }

  @Override
  public AdvancedSecurityOverrides clone() {
    return (AdvancedSecurityOverrides) super.clone();
  }

}


text:
using extensions::manifest_keys::kStorageManagedSchema;

namespace extensions {

StorageSchemaManifestHandler::StorageSchemaManifestHandler() {}

StorageSchemaManifestHandler::~StorageSchemaManifestHandler() {}

// static
policy::Schema StorageSchemaManifestHandler::GetSchema(
    const Extension* extension,
    std::string* error) {
  std::string path;
  extension->manifest()->GetString(kStorageManagedSchema, &path);
  base::FilePath file = base::FilePath::FromUTF8Unsafe(path);
  if (file.IsAbsolute() || file.ReferencesParent()) {
    *error = base::StringPrintf("%s must be a relative path without ..",
                                kStorageManagedSchema);
    return policy::Schema();
  }
  file = extension->path().AppendASCII(path);
  if (!base::PathExists(file)) {
    *error = base::StringPrintf("File does not exist: %" PRFilePath,
                                file.value().c_str());
    return policy::Schema();
  }
  std::string content;
  if (!base::ReadFileToString(file, &content)) {
    *error =
        base::StringPrintf("Can't read %" PRFilePath, file.value().c_str());
    return policy::Schema();
  }
  return policy::Schema::Parse(content, error);
}

bool StorageSchemaManifestHandler::Parse(Extension* extension,
                                         std::u16string* error) {
  std::string path;
  if (!extension->manifest()->GetString(kStorageManagedSchema, &path)) {
    *error = base::ASCIIToUTF16(
        base::StringPrintf("%s must be a string", kStorageManagedSchema));
    return false;
  }

  // If an extension declares the "storage.managed_schema" key then it gets
  // the "storage" permission implicitly.
  PermissionsParser::AddAPIPermission(extension,
                                      mojom::APIPermissionID::kStorage);

  return true;
}

bool StorageSchemaManifestHandler::Validate(
    const Extension* extension,
    std::string* error,
    std::vector<InstallWarning>* warnings) const {
  return GetSchema(extension, error).valid();
}

base::span<const char* const> StorageSchemaManifestHandler::Keys() const {
  static constexpr const char* kKeys[] = {kStorageManagedSchema};
  return kKeys;
}

}  // namespace extensions


text:
from django.contrib import admin

# Register your models here.

from .models import UnprocessedImg
admin.site.register(UnprocessedImg)

from .models import ProcessedImg
admin.site.register(ProcessedImg)


text:
import {bootstrap}    from '@angular/platform-browser-dynamic';
import {AppComponent} from './components/app.component';
import {ROUTER_PROVIDERS} from '@angular/router';

bootstrap(AppComponent,[ROUTER_PROVIDERS]);


text:
package org.apache.camel.component.spring.integration;

import java.util.Map;

import org.apache.camel.Exchange;
import org.springframework.integration.message.GenericMessage;

/**
 * The helper class for Mapping between the Spring Integration message and the Camel Message.
 *
 * @version
 */
public final class SpringIntegrationBinding {

    private SpringIntegrationBinding() {
        // Helper class
    }

    public static org.springframework.integration.Message<?> createSpringIntegrationMessage(Exchange exchange) {
        return createSpringIntegrationMessage(exchange, exchange.getIn().getHeaders());
    }

    public static org.springframework.integration.Message<?> createSpringIntegrationMessage(Exchange exchange, Map<String, Object> headers) {
        org.apache.camel.Message message = exchange.getIn();
        return new GenericMessage<Object>(message.getBody(), headers);
    }

    public static org.springframework.integration.Message<?> storeToSpringIntegrationMessage(org.apache.camel.Message message) {
        return new GenericMessage<Object>(message.getBody(), message.getHeaders());
    }

    public static void storeToCamelMessage(org.springframework.integration.Message<?> siMessage, org.apache.camel.Message cMessage) {
        cMessage.setBody(siMessage.getPayload());
        cMessage.setHeaders(siMessage.getHeaders());
    }

}


text:
package com.streamsets.pipeline.stage.origin.logtail;

import com.google.common.base.Joiner;
import com.streamsets.pipeline.api.Config;
import com.streamsets.pipeline.api.StageException;
import com.streamsets.pipeline.api.StageUpgrader;
import com.streamsets.pipeline.api.impl.Utils;
import com.streamsets.pipeline.config.upgrade.DataFormatUpgradeHelper;

import java.util.ArrayList;
import java.util.List;

public class FileTailSourceUpgrader implements StageUpgrader {

  private static final String CONF = "conf";
  private static final String DATA_FORMAT_CONFIG= "dataFormatConfig";
  private static final String ALLOW_LATE_DIRECTORIES = "allowLateDirectories";
  private static final Joiner joiner = Joiner.on(".");

  private final List<Config> configsToRemove = new ArrayList<>();
  private final List<Config> configsToAdd = new ArrayList<>();

  @Override
  public List<Config> upgrade(String library, String stageName, String stageInstance, int fromVersion, int toVersion,
                              List<Config> configs) throws StageException {
    switch(fromVersion) {
      case 1:
        upgradeV1ToV2(configs);
        if (toVersion == 2) {
          break;
        }
        //fall through
      case 2:
        upgradeV2ToV3(configs);
        if (toVersion == 3) {
          break;
        }
        // fall through
      case 3:
        upgradeV3ToV4(configs);
        break;
      default:
        throw new IllegalStateException(Utils.format("Unexpected fromVersion {}", fromVersion));
    }
    return configs;
  }

  private static void upgradeV3ToV4(List<Config> configs) {
    DataFormatUpgradeHelper.upgradeAvroParserWithSchemaRegistrySupport(configs);
  }

  private void upgradeV1ToV2(List<Config> configs) {
    for (Config config : configs) {
      switch (config.getName()) {
        case "dataFormat":
        case "multiLineMainPattern":
        case "batchSize":
        case "maxWaitTimeSecs":
        case "fileInfos":
        case "postProcessing":
        case "archiveDir":
          configsToAdd.add(new Config(joiner.join(CONF, config.getName()), config.getValue()));
          configsToRemove.add(config);
          break;
        case "charset":
        case "removeCtrlChars":
        case "logMode":
        case "logMaxObjectLen":
        case "retainOriginalLine":
        case "customLogFormat":
        case "regex":
        case "fieldPathsToGroupName":
        case "grokPatternDefinition":
        case "grokPattern":
        case "enableLog4jCustomLogFormat":
        case "log4jCustomLogFormat":
          configsToAdd.add(new Config(joiner.join(CONF, DATA_FORMAT_CONFIG, config.getName()), config.getValue()));
          configsToRemove.add(config);
          break;
        case "maxLineLength":
          // Data format can be Text, JSON, or LOG. So we set max length for all of them.
          configsToAdd.add(new Config(joiner.join(CONF, DATA_FORMAT_CONFIG, "textMaxLineLen"), config.getValue()));
          configsToAdd.add(new Config(joiner.join(CONF, DATA_FORMAT_CONFIG, "jsonMaxObjectLen"), config.getValue()));
          configsToAdd.add(new Config(joiner.join(CONF, DATA_FORMAT_CONFIG, "logMaxObjectLen"), config.getValue()));
          configsToRemove.add(config);
        default:
          // no op
      }
    }
    configs.addAll(configsToAdd);
    configs.removeAll(configsToRemove);
  }

  private void upgradeV2ToV3(List<Config> configs) {
    configs.add(new Config(joiner.join(CONF, ALLOW_LATE_DIRECTORIES), false));
  }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/default_padding"
        android:layout_marginRight="@dimen/default_padding"
        android:layout_marginTop="@dimen/default_mini_padding"
        android:layout_marginBottom="@dimen/default_mini_padding">

    <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:padding="@dimen/default_padding"
            android:orientation="vertical">

        <TextView
                android:text="@string/contact"
                android:gravity="center_horizontal"
                android:textSize="@dimen/text_size_headline_material"
                android:textColor="@color/medium_black"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
        <View
                android:layout_width="@dimen/list_avatar_width"
                android:layout_height="@dimen/underline_height"
                android:layout_marginTop="@dimen/default_micro_padding"
                android:paddingBottom="@dimen/default_mini_padding"
                android:background="@color/pink"
                android:layout_gravity="center_horizontal"/>

        <TextView
                android:text="@string/email_title"
                android:gravity="center_horizontal"
                android:paddingTop="@dimen/default_padding"
                android:textSize="@dimen/text_size_title_material"
                android:textColor="@color/medium_black"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

        <Button
                android:id="@+id/btn_email"
                android:text="@string/email_address"
                android:textAllCaps="false"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="@color/pink"
                android:minHeight="@dimen/touch_target_size"
                style="?android:attr/borderlessButtonStyle"/>
    </LinearLayout>
</android.support.v7.widget.CardView>


text:
using System;

namespace SharpKit.Html.svg
{

using SharpKit.JavaScript;
using SharpKit.Html.fileapi;
using SharpKit.Html.html.shadow;
using SharpKit.Html.html.track;
using SharpKit.Html.inspector;
using SharpKit.Html.loader.appcache;
using SharpKit.Html.battery;
using SharpKit.Html.filesystem;
using SharpKit.Html.gamepad;
using SharpKit.Html.geolocation;
using SharpKit.Html.indexeddb;
using SharpKit.Html.intents;
using SharpKit.Html.mediasource;
using SharpKit.Html.mediastream;
using SharpKit.Html.navigatorcontentutils;
using SharpKit.Html.networkinfo;
using SharpKit.Html.notifications;
using SharpKit.Html.proximity;
using SharpKit.Html.quota;
using SharpKit.Html.speech;
using SharpKit.Html.vibration;
using SharpKit.Html.webaudio;
using SharpKit.Html.webdatabase;
using SharpKit.Html.plugins;
using SharpKit.Html.storage;
using SharpKit.Html.svg;
using SharpKit.Html.workers;

[JsType(JsMode.Prototype, Export = false, PropertiesAsFields = true, NativeCasts = true, Name = "SVGFilterElement")]
public partial class SvgFilterElement : SvgElement, SvgURIReference, SvgLangSpace, SvgExternalResourcesRequired, SvgStylable
{
	[JsMethod(OmitParanthesis = true, OmitNewOperator = true, Name = "document.createElement('filter')")]
	public   SvgFilterElement() {}
	public  SvgAnimatedEnumeration filterUnits {get; set; }
	public  SvgAnimatedEnumeration primitiveUnits {get; set; }
	public  SvgAnimatedLength x {get; set; }
	public  SvgAnimatedLength y {get; set; }
	public  SvgAnimatedLength width {get; set; }
	public  SvgAnimatedLength height {get; set; }
	public  SvgAnimatedInteger filterResX {get; set; }
	public  SvgAnimatedInteger filterResY {get; set; }
	public  void setFilterRes(int filterResX, int filterResY) {}
	public  SvgAnimatedString href {get; set; }
	public  JsString xmllang {get; set; }
	public  JsString xmlspace {get; set; }
	public  SvgAnimatedBoolean externalResourcesRequired {get; set; }
	public  SvgAnimatedString className {get; set; }
	public  CssStyleDeclaration style {get; set; }
	public  CssValue getPresentationAttribute(string name) { return default(CssValue); }
}

}


text:
#pragma checksum "..\..\GameView.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "091FA4D2CE2BC89810B3BD7DD35D387F"
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.296
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using Microsoft.Surface.Presentation;
using Microsoft.Surface.Presentation.Controls;
using Microsoft.Surface.Presentation.Controls.Primitives;
using Microsoft.Surface.Presentation.Controls.TouchVisualizations;
using Microsoft.Surface.Presentation.Input;
using Microsoft.Surface.Presentation.Palettes;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;

namespace IPIPIP_Tablette_tactile {

    /// <summary>
    /// GameView
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
    public partial class GameView : Microsoft.Surface.Presentation.Controls.SurfaceWindow, System.Windows.Markup.IComponentConnector {

        #line 8 "..\..\GameView.xaml"
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
        internal System.Windows.Controls.Canvas MyCanvas;

        #line default
        #line hidden

        private bool _contentLoaded;

        /// <summary>
        /// InitializeComponent
        /// </summary>
        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public void InitializeComponent() {
            if (_contentLoaded) {
                return;
            }
            _contentLoaded = true;
            System.Uri resourceLocater = new System.Uri("/IPIPIP_Tablette_tactile;component/gameview.xaml", System.UriKind.Relative);

            #line 1 "..\..\GameView.xaml"
            System.Windows.Application.LoadComponent(this, resourceLocater);

            #line default
            #line hidden
        }

        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
            switch (connectionId)
            {
            case 1:

            #line 6 "..\..\GameView.xaml"
            ((IPIPIP_Tablette_tactile.GameView)(target)).TouchDown += new System.EventHandler<System.Windows.Input.TouchEventArgs>(this.OnTouchDown);

            #line default
            #line hidden
            return;
            case 2:
            this.MyCanvas = ((System.Windows.Controls.Canvas)(target));
            return;
            }
            this._contentLoaded = true;
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <artifactId>codeforfun</artifactId>
    <groupId>cn.codeforfun</groupId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>cloud-gateway</artifactId>
  <dependencies>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-eureka</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-config</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-zuul</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-devtools</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-actuator</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-oauth2</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-security</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
    </dependency>
    <dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>druid</artifactId>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
    </dependency>
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-swagger2</artifactId>
      <version>2.7.0</version>
    </dependency>
    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-swagger-ui</artifactId>
      <version>2.7.0</version>
    </dependency>
  </dependencies>
  <build>
    <finalName>cloud-gateway</finalName>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.spotify</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>0.4.14</version>
        <executions>
          <execution>
            <id>build-image</id>
            <phase>package</phase>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
          <!-- 解决Connect to localhost:2375的问题的其中一种方式,注意要跟docker-machine env相一致 -->
          <!--<dockerHost>https://192.168.99.100:2376</dockerHost>-->
          <!--<dockerCertPath>C:\Users\Administrator\.docker\machine\machines\default</dockerCertPath>-->
          <baseImage>java:8</baseImage>
          <entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
          <resources>
            <resource>
              <targetPath>/</targetPath>
              <directory>${project.build.directory}</directory>
              <include>${project.build.finalName}.jar</include>
            </resource>
          </resources>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _typeof = require("@babel/runtime/helpers/typeof");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.StringInputLayout = exports.StringInput = void 0;

var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _components = require("@looker/components");

var _isArray = _interopRequireDefault(require("lodash/isArray"));

var _react = _interopRequireWildcard(require("react"));

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _filter_styles = require("../../../../../../utils/filter_styles");

var _option_utils = require("../../../../../../utils/option_utils");

var _use_option_filtering = require("../../../../../../utils/use_option_filtering");

var _use_placeholder = require("../../../../../../utils/use_placeholder");

var _templateObject;

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

var StringInputLayout = function StringInputLayout(_ref) {
  var className = _ref.className,
      onChange = _ref.onChange,
      onInputChange = _ref.onInputChange,
      isLoading = _ref.isLoading,
      item = _ref.item,
      suggestions = _ref.suggestions,
      enumerations = _ref.enumerations,
      validationMessage = _ref.validationMessage,
      id = _ref.id,
      _ref$width = _ref.width,
      width = _ref$width === void 0 ? _filter_styles.multiInputWidth : _ref$width,
      height = _ref.height;
  var options = (0, _react.useMemo)(function () {
    return suggestions ? (0, _option_utils.createOptions)(suggestions) : enumerations || [];
  }, [suggestions, enumerations]);

  var _useOptionFiltering = (0, _use_option_filtering.useOptionFiltering)({
    excludeValues: true,
    onInputChange: onInputChange,
    options: options,
    value: item.value
  }),
      filteredOptions = _useOptionFiltering.filteredOptions,
      noOptionsLabel = _useOptionFiltering.noOptionsLabel,
      onFilter = _useOptionFiltering.onFilter;

  var handleChange = function handleChange(newValue) {
    onFilter(newValue || '');
    onChange === null || onChange === void 0 ? void 0 : onChange(item.id, {
      value: [newValue]
    });
  };

  var comboboxInputRef = _react["default"].useRef(null);

  var handleKeyDown = function handleKeyDown(event) {
    if (event.key === 'Enter') {
      var _comboboxInputRef$cur;

      event.preventDefault();
      comboboxInputRef === null || comboboxInputRef === void 0 ? void 0 : (_comboboxInputRef$cur = comboboxInputRef.current) === null || _comboboxInputRef$cur === void 0 ? void 0 : _comboboxInputRef$cur.click();
    }
  };

  var placeholderProps = (0, _use_placeholder.usePlaceholder)(item.value, validationMessage);

  var commonProps = _objectSpread(_objectSpread({}, placeholderProps), {}, {
    className: className,
    height: height,
    id: id,
    maxHeight: 145,
    onChange: handleChange,
    noErrorIcon: true,
    validationType: validationMessage === null || validationMessage === void 0 ? void 0 : validationMessage.type,
    width: width
  });

  var value = (0, _isArray["default"])(item.value) && item.value.length ? item.value[0] : item.value;
  return _react["default"].createElement(_components.InputSearch, (0, _extends2["default"])({}, commonProps, {
    options: filteredOptions,
    noOptionsLabel: noOptionsLabel,
    indicator: false,
    isLoading: isLoading,
    value: value,
    onKeyDown: handleKeyDown,
    isClearable: true,
    ref: comboboxInputRef,
    hideSearchIcon: true,
    openOnClick: true
  }));
};

exports.StringInputLayout = StringInputLayout;
var StringInput = (0, _styledComponents["default"])(StringInputLayout).withConfig({
  displayName: "StringInput",
  componentId: "sc-feqdof-0"
})(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n  ", "\n  ", " {\n    ", "\n  }\n"])), _filter_styles.inputPlacementStyle, _components.InputText, _filter_styles.inputPlacementStyle);
exports.StringInput = StringInput;
//# sourceMappingURL=StringInput.js.map


text:
package com.exxeta.iss.sonar.esql;

import org.sonar.api.Plugin;
import org.sonar.api.PropertyType;
import org.sonar.api.config.PropertyDefinition;
import org.sonar.api.resources.Qualifiers;

import com.exxeta.iss.sonar.esql.metrics.EsqlMetrics;

public class EsqlPlugin implements Plugin {

	private static final String GENERAL = "General";
	private static final String ESQL_CATEGORY = "Esql";

	// Global ESQL constants
	public static final String PROPERTY_PREFIX = "sonar.esql";

	public static final String IGNORE_HEADER_COMMENTS = PROPERTY_PREFIX + ".ignoreHeaderComments";
	public static final Boolean IGNORE_HEADER_COMMENTS_DEFAULT_VALUE = true;

	public static final String ESQL_EXCLUSIONS_KEY = PROPERTY_PREFIX + ".exclusions";
	public static final String ESQL_EXCLUSIONS_DEFAULT_VALUE = "";

	public static final String TRACE_PATHS_PROPERTY = "sonar.esql.trace.reportPaths";
	public static final String TRACE_PATHS_DEFAULT_VALUE = "target/iibTrace";
	public static final String FILE_SUFFIXES_NAME = "File Suffixes";
	public static final String FILE_SUFFIXES_DESCRIPTION = "List of suffixes for files to analyze.";

	@Override
	public void define(Context context) {
		context.addExtensions(
				EsqlLanguage.class,
				EsqlSensor.class,
				EsqlExclusionsFileFilter.class,
				EsqlRulesDefinition.class,
				EsqlProfilesDefinition.class,
				EsqlMetrics.class);

		  context.addExtensions(
			PropertyDefinition.builder(EsqlLanguage.FILE_SUFFIXES_KEY)
			        .defaultValue(EsqlLanguage.FILE_SUFFIXES_DEFVALUE)
			        .name(FILE_SUFFIXES_NAME)
			        .description(FILE_SUFFIXES_DESCRIPTION)
			        .subCategory(GENERAL)
			        .category(ESQL_CATEGORY)
			        .multiValues(true)
			        .onQualifiers(Qualifiers.PROJECT)
			        .build(),

	      PropertyDefinition.builder(EsqlPlugin.IGNORE_HEADER_COMMENTS)
	        .defaultValue(EsqlPlugin.IGNORE_HEADER_COMMENTS_DEFAULT_VALUE.toString())
	        .name("Ignore header comments")
	        .description("True to not count file header comments in comment metrics.")
	        .onQualifiers(Qualifiers.PROJECT)
	        .subCategory(GENERAL)
	        .category(ESQL_CATEGORY)
	        .type(PropertyType.BOOLEAN)
	        .build(),

	       PropertyDefinition.builder(TRACE_PATHS_PROPERTY)
			      .defaultValue(TRACE_PATHS_DEFAULT_VALUE)
			      .category("Esql")
			      .subCategory("Trace")
			      .name("IIB trace file")
			      .description("Path to the IIB trace files containing coverage data. The path may be absolute or relative to the project base directory.")
			      .onQualifiers(Qualifiers.PROJECT)
			      .multiValues(true)
			      .build(),

		  PropertyDefinition.builder(EsqlPlugin.ESQL_EXCLUSIONS_KEY)
				  .defaultValue(ESQL_EXCLUSIONS_DEFAULT_VALUE)
				  .name("ESQL Exclusions")
				  .description("List of file path patterns to be excluded from analysis of ESQL files.")
				  .onQualifiers(Qualifiers.PROJECT)
				  .subCategory(GENERAL)
				  .multiValues(true)
				  .category(ESQL_CATEGORY)
				  .build()
			);

	}

}


text:
<?php

namespace API\V1;
use BaseController;
use View;
use Response;
use TurnRepositoryInterface;

class TurnsController extends BaseController {

	public function __construct(TurnRepositoryInterface $turns)
    {
    	$this->turns = $turns;
    }
	/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */
	public function index()
	{
		return $this->turns->findAll();
	}

	/**
	 * Show the form for creating a new resource.
	 *
	 * @return Response
	 */
	public function create()
	{
		//
	}

	/**
	 * Store a newly created resource in storage.
	 *
	 * @return Response
	 */
	public function store()
	{
		//
	}

	/**
	 * Display the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
		//
	}

	/**
	 * Show the form for editing the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function edit($id)
	{
		//
	}

	/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function update($id)
	{
		//
	}

	/**
	 * Remove the specified resource from storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function destroy($id)
	{
		//
	}

}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using HttpRequestMethod = Recurly.Client.HttpRequestMethod;

namespace Recurly
{
    public abstract class RecurlyList<T> : IEnumerable<T> where T : RecurlyEntity
    {
        protected List<T> Items = new List<T>();
        internal HttpRequestMethod Method;
        protected string BaseUrl;

        protected string StartUrl { get; set; }
        protected string NextUrl { get; set; }
        protected string PrevUrl { get; set; }
        protected int PerPage { get; set; }

        public int Count
        {
            get {
                return Items.Count;
            }
        }

        private int _capacity = -1;
        public int Capacity
        {
            get { return _capacity < 0 ? Count : _capacity; }
        }

        public abstract RecurlyList<T> Start { get; }
        public abstract RecurlyList<T> Next { get; }
        public abstract RecurlyList<T> Prev { get; }

        public IList<T> All
        {
            get
            {
                var that = HasStartPage() ? Start : this;
                var list = new List<T>();
                while (that.Any())
                {
                    list.AddRange(that);
                    that = that.Next;
                }
                return list;
            }
        }

        public bool HasStartPage()
        {
            return !StartUrl.IsNullOrEmpty();
        }

        public bool HasNextPage()
        {
            return !NextUrl.IsNullOrEmpty();
        }

        public bool HasPrevPage()
        {
            return !PrevUrl.IsNullOrEmpty();
        }

        public virtual bool includeEmptyTag()
        {
            return false;
        }

        internal RecurlyList()
        {
            PerPage = Client.Instance.Settings.PageSize;
        }

        internal RecurlyList(HttpRequestMethod method, string url)
        {
            PerPage = Client.Instance.Settings.PageSize;
            Method = method;
            BaseUrl = url;

            GetItems();
        }

        public void GetItems()
        {
            Client.Instance.PerformRequest(Method,
                ApplyPaging(BaseUrl),
                ReadXmlList);
        }

        protected string ApplyPaging(string baseUrl)
        {
            var divider = baseUrl.Contains("?") ? "&" : "?";
            return baseUrl + divider + "per_page=" + PerPage;
        }

        internal void ReadXmlList(XmlTextReader xmlReader, int records, string start, string next, string prev)
        {
            Items = records > 0 ? new List<T>(records) : new List<T>();
            _capacity = records;
            StartUrl = start;
            NextUrl = next;
            PrevUrl = prev;
            ReadXml(xmlReader);
        }

        internal abstract void ReadXml(XmlTextReader reader);

        #region List methods

        internal virtual void Add(T item)
        {
            Items.Add(item);
        }
        internal void AddRange(IEnumerable<T> items)
        {
            foreach (var item in items) Add(item);
        }
        public void Clear()
        {
            Items.Clear();
        }
        internal System.Collections.ObjectModel.ReadOnlyCollection<T> AsReadOnly()
        {
            return Items.AsReadOnly();
        }
        internal bool Contains(T item)
        {
            return Items.Contains(item);
        }
        internal bool Contains(T value, IEqualityComparer<T> comparer)
        {
            return Items.Contains(value, comparer);
        }
        internal bool Exists(Predicate <T> match)
        {
            return Items.Exists(match);
        }
        internal T Find(Predicate<T> match)
        {
            return Items.Find(match);
        }
        internal List<T> FindAll(Predicate<T> match)
        {
            return Items.FindAll(match);
        }
        internal T FindLast(Predicate<T> match)
        {
            return Items.FindLast(match);
        }
        internal void ForEach(Action<T> action)
        {
            Items.ForEach(action);
        }
        internal int IndexOf(T item)
        {
            return Items.IndexOf(item);
        }
        internal int IndexOf(T item, int index)
        {
            return Items.IndexOf(item, index);
        }
        internal int IndexOf(T item, int index, int count)
        {
            return Items.IndexOf(item, index, count);
        }
        public void RemoveAt(int i)
        {
            Items.RemoveAt(i);
        }
        internal bool Remove(T item)
        {
            return Items.Remove(item);
        }
        internal int RemoveAll(Predicate<T> match)
        {
            return Items.RemoveAll(match);
        }
        internal void Reverse()
        {
            Items.Reverse();
        }
        internal void Reverse(int index, int count)
        {
            Items.Reverse(index, count);
        }
        internal void Sort()
        {
            Items.Sort();
        }
        internal void Sort(Comparison<T> comparison)
        {
            Items.Sort(comparison);
        }
        internal void Sort(IComparer<T> comparer)
        {
            Items.Sort(comparer);
        }
        internal void Sort(int index, int count, IComparer<T> comparer)
        {
            Items.Sort(index, count, comparer);
        }
        internal T[] ToArray()
        {
            return Items.ToArray();
        }

        #endregion List methods

        public IEnumerator<T> GetEnumerator()
        {
            return Items.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        public T this[int i]
        {
            get { return Items[i]; }
            set { throw new NotSupportedException("RecurlyLists are readonly!"); }
        }
    }

    public class RecurlyList
    {
        public static RecurlyList<T> Empty<T>() where T : RecurlyEntity
        {
            return EmptyRecurlyList<T>.Instance;
        }
    }

    internal class EmptyRecurlyList<T> where T : RecurlyEntity
    {
        private static volatile EmptyRecurlyListImpl<T> _instance;

        public static RecurlyList<T> Instance
        {
            get { return _instance ?? (_instance = new EmptyRecurlyListImpl<T>()); }
        }
    }

    internal class EmptyRecurlyListImpl<T> : RecurlyList<T> where T : RecurlyEntity
    {
        public EmptyRecurlyListImpl()
        {
            Items = new List<T>();
        }

        public override RecurlyList<T> Start
        {
            get { return new EmptyRecurlyListImpl<T>(); }
        }

        public override RecurlyList<T> Next
        {
            get { return new EmptyRecurlyListImpl<T>(); }
        }

        public override RecurlyList<T> Prev
        {
            get { return new EmptyRecurlyListImpl<T>(); }
        }

        internal override void ReadXml(XmlTextReader reader)
        {
            throw new NotSupportedException("Empty Recurly Lists are read only!");
        }
    }
}


text:
This directory imports [Outdoor Air Quality Data](https://aqs.epa.gov/aqsweb/airdata/download_files.html) into Data Commons. This includes mean/max concentration and AQI for Ozone, SO2, CO, NO2, PM2.5, and PM10 measured at various monitors throughout the  US, Puerto Rico and US Virgin Islands. Source CSVs are downloaded directly from the pre-generated data files.

The scripts generate:
- `EPA_AirQuality.csv`
- `EPA_AirQuality.tmcf`
- `EPA_AQI.csv`
- `EPA_AQI.tmcf`

and relies on the following StatisticalVariables:
- Mean_Concentration_AirPollutant_Ozone
- Max_Concentration_AirPollutant_Ozone
- AirQualityIndex_AirPollutant_Ozone
- Mean_Concentration_AirPollutant_SO2
- Max_Concentration_AirPollutant_SO2
- AirQualityIndex_AirPollutant_SO2
- Mean_Concentration_AirPollutant_CO
- Max_Concentration_AirPollutant_CO
- AirQualityIndex_AirPollutant_CO
- Mean_Concentration_AirPollutant_NO2
- Max_Concentration_AirPollutant_NO2
- AirQualityIndex_AirPollutant_NO2
- Mean_Concentration_AirPollutant_PM2.5
- Max_Concentration_AirPollutant_PM2.5
- AirQualityIndex_AirPollutant_PM2.5
- Mean_Concentration_AirPollutant_PM10
- Max_Concentration_AirPollutant_PM10
- AirQualityIndex_AirPollutant_PM10
- AirQualityIndex_AirPollutant (only for county/CSBA)

## Notes on the Data
Pollutant-specific metrics are provided on the site monitor level. For simplicity in the place mapping, we select a single monitor per site and pollutant and provide the monitor id (POC) as airQualitySiteMonitor in the observation. So, a given observation is distinguished by observationDate, observationAbout (AirQualitySite), and measurementMethod (pollutant standard).

County/CBSA level AQI metrics include the defining site and pollutant, which are included in the StatVarObservation.

## Generating Artifacts
To generate `EPA_AirQuality.csv` and `EPA_AirQuality.tmcf`, run:
```
python3 air_quality.py <end_year>
```
To generate `EPA_AQI.csv` and `EPA_AQI.tmcf`, run:
```
python3 air_quality_aggregate.py <end_year>
```
As of June 2021, this currently includes data up to 2021.

### Running Tests
To run unit tests:
```
python3 -m unittest discover -v -s ../ -p "*_test.py"
```


text:
<?php

declare(strict_types=1);

namespace Sonata\AdminBundle\Form\Type\Operator;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType as FormChoiceType;
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

final class ContainsOperatorType extends AbstractType
{
    public const TYPE_CONTAINS = 1;
    public const TYPE_NOT_CONTAINS = 2;
    public const TYPE_EQUAL = 3;

    /**
     * @return void
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'choice_translation_domain' => 'SonataAdminBundle',
            'choices' => [
                'label_type_contains' => self::TYPE_CONTAINS,
                'label_type_not_contains' => self::TYPE_NOT_CONTAINS,
                'label_type_equals' => self::TYPE_EQUAL,
            ],
        ]);
    }

    /**
     * @return string
     *
     * @phpstan-return class-string<FormTypeInterface>
     */
    public function getParent()
    {
        return FormChoiceType::class;
    }

    public function getBlockPrefix()
    {
        return 'sonata_type_operator_contains';
    }
}


text:
title: Number Bases Introduction and Binary Numbers
localeTitle: Введение в числовые двоичные и двоичные числа
---
## Введение в числовые двоичные и двоичные числа

Это заглушка. [Помогите нашему сообществу расширить его](https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/number-bases-introduction-and-binary-numbers/index.md) .

[Это руководство по быстрому стилю поможет вам принять ваш запрос на тягу](https://github.com/freecodecamp/guides/blob/master/README.md) .

#### Дополнительная информация:


text:
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Model_admin extends CI_Model {

        public function __construct()
        {
                // Call the CI_Model constructor
                parent::__construct();
        }

		function ambil_user($limit,$offset)
		{
			$this->db->select('
			tbl_user.id,
			tbl_user.userid,
			tbl_user.password,
			tbl_user.nama,
			tbl_user.level,
			tbl_user.aktif,
			');
			$this->db->limit($limit);
			$this->db->offset($offset);
			$this->db->from('tbl_user');
			return $this->db->get();
		}
}


text:
Update metadata for module

##2015-09-01 - Release 1.2.0
###Summary

Add source and limitaccess parameters to allow for local offline install

###Features
- All runs now will run with /Quiet
- Munge truthy and falsy values to be of type boolean
- Add source param to allow for local access source
- Add limitaccess parameter

###Bugfixes
- Remove legacy ensurable block to ensure compatibility with Puppet 4.x

##2014-11-25 - Release 1.1.0
###Summary

Add the ability to specify NoRestart (MODULES-1389)

##2014-08-06 - Release 1.0.0
###Summary

Preparing for Puppet 3.7 and x64 Ruby, refacter dism executable lookup and
refactored to only look for resource once.

##2014-07-15 - Release 0.2.1
###Summary

This release merely updates metadata.json so the module can be uninstalled and
upgraded via the puppet module command.

##2014-06-18 - Release 0.2.0
###Features
- Added 'all' parameter to indicate whether or not all dependencies should be
installed
- Add support for additional exit codes
- Add workaround for https://bugs.ruby-lang.org/issues/8083
- Add Apache 2.0 License

###Bugfixes
- Documentation typo fix


text:
namespace WshLst.MonoForAndroid
{

	public partial class Resource
	{

		public partial class Attribute
		{

			// aapt resource value: 0x7f010000
			public const int MvxBind = 2130771968;

			// aapt resource value: 0x7f010002
			public const int MvxDropDownItemTemplate = 2130771970;

			// aapt resource value: 0x7f010003
			public const int MvxHttpSource = 2130771971;

			// aapt resource value: 0x7f010001
			public const int MvxItemTemplate = 2130771969;

			private Attribute()
			{
			}
		}

		public partial class Drawable
		{

			// aapt resource value: 0x7f020000
			public const int ic_menu_add = 2130837504;

			// aapt resource value: 0x7f020001
			public const int ic_menu_delete = 2130837505;

			// aapt resource value: 0x7f020002
			public const int ic_menu_edit = 2130837506;

			// aapt resource value: 0x7f020003
			public const int ic_menu_save = 2130837507;

			// aapt resource value: 0x7f020004
			public const int Icon = 2130837508;

			// aapt resource value: 0x7f020005
			public const int icontransparent = 2130837509;

			private Drawable()
			{
			}
		}

		public partial class Id
		{

			// aapt resource value: 0x7f040001
			public const int MvxBindableListItemTagUnique = 2130968577;

			// aapt resource value: 0x7f040000
			public const int MvxBindingTagUnique = 2130968576;

			// aapt resource value: 0x7f040023
			public const int addEntry = 2130968611;

			// aapt resource value: 0x7f040021
			public const int addList = 2130968609;

			// aapt resource value: 0x7f040014
			public const int buttonAddPhoto = 2130968596;

			// aapt resource value: 0x7f040019
			public const int buttonCancel = 2130968601;

			// aapt resource value: 0x7f040015
			public const int buttonRemovePhoto = 2130968597;

			// aapt resource value: 0x7f04001a
			public const int buttonSave = 2130968602;

			// aapt resource value: 0x7f040009
			public const int buttonScanBarcode = 2130968585;

			// aapt resource value: 0x7f04000f
			public const int checkLocation = 2130968591;

			// aapt resource value: 0x7f040003
			public const int checkSelected = 2130968579;

			// aapt resource value: 0x7f040013
			public const int imagePhoto = 2130968595;

			// aapt resource value: 0x7f04001b
			public const int labelDesc = 2130968603;

			// aapt resource value: 0x7f04001d
			public const int labelName = 2130968605;

			// aapt resource value: 0x7f04001f
			public const int labelNotes = 2130968607;

			// aapt resource value: 0x7f04001e
			public const int labelStore = 2130968606;

			// aapt resource value: 0x7f040002
			public const int linearLayout1 = 2130968578;

			// aapt resource value: 0x7f040004
			public const int linearLayout2 = 2130968580;

			// aapt resource value: 0x7f040018
			public const int linearLayout3 = 2130968600;

			// aapt resource value: 0x7f040022
			public const int logout = 2130968610;

			// aapt resource value: 0x7f040020
			public const int mvxList = 2130968608;

			// aapt resource value: 0x7f040024
			public const int shareWishList = 2130968612;

			// aapt resource value: 0x7f04000b
			public const int tableLayout1 = 2130968587;

			// aapt resource value: 0x7f04000c
			public const int tableRow1 = 2130968588;

			// aapt resource value: 0x7f040007
			public const int text1 = 2130968583;

			// aapt resource value: 0x7f040008
			public const int text2 = 2130968584;

			// aapt resource value: 0x7f04001c
			public const int textDescription = 2130968604;

			// aapt resource value: 0x7f040006
			public const int textEmail = 2130968582;

			// aapt resource value: 0x7f040005
			public const int textName = 2130968581;

			// aapt resource value: 0x7f040017
			public const int textNotes = 2130968599;

			// aapt resource value: 0x7f040011
			public const int textPrice = 2130968593;

			// aapt resource value: 0x7f04000e
			public const int textStore = 2130968590;

			// aapt resource value: 0x7f04000a
			public const int textView1 = 2130968586;

			// aapt resource value: 0x7f04000d
			public const int textView2 = 2130968589;

			// aapt resource value: 0x7f040010
			public const int textView3 = 2130968592;

			// aapt resource value: 0x7f040012
			public const int textView4 = 2130968594;

			// aapt resource value: 0x7f040016
			public const int textView5 = 2130968598;

			private Id()
			{
			}
		}

		public partial class Layout
		{

			// aapt resource value: 0x7f030000
			public const int ListItem_Contact = 2130903040;

			// aapt resource value: 0x7f030001
			public const int ListItem_Entry = 2130903041;

			// aapt resource value: 0x7f030002
			public const int ListItem_List = 2130903042;

			// aapt resource value: 0x7f030003
			public const int ListItem_Login = 2130903043;

			// aapt resource value: 0x7f030004
			public const int Page_EditEntryView = 2130903044;

			// aapt resource value: 0x7f030005
			public const int Page_EditWishListView = 2130903045;

			// aapt resource value: 0x7f030006
			public const int Page_EntryView = 2130903046;

			// aapt resource value: 0x7f030007
			public const int Page_LoginView = 2130903047;

			// aapt resource value: 0x7f030008
			public const int Page_ShareView = 2130903048;

			// aapt resource value: 0x7f030009
			public const int Page_WishListsView = 2130903049;

			// aapt resource value: 0x7f03000a
			public const int Page_WishListView = 2130903050;

			// aapt resource value: 0x7f03000b
			public const int SplashScreen = 2130903051;

			private Layout()
			{
			}
		}

		public partial class Menu
		{

			// aapt resource value: 0x7f060000
			public const int ListsView_Menu = 2131099648;

			// aapt resource value: 0x7f060001
			public const int ListView_Menu = 2131099649;

			private Menu()
			{
			}
		}

		public partial class String
		{

			// aapt resource value: 0x7f050001
			public const int app_name = 2131034113;

			// aapt resource value: 0x7f050000
			public const int hello = 2131034112;

			private String()
			{
			}
		}

		public partial class Styleable
		{

			public static int[] MvxBindableListView = new int[] {
					2130771969,
					2130771970};

			// aapt resource value: 1
			public const int MvxBindableListView_MvxDropDownItemTemplate = 1;

			// aapt resource value: 0
			public const int MvxBindableListView_MvxItemTemplate = 0;

			public static int[] MvxBinding = new int[] {
					2130771968};

			// aapt resource value: 0
			public const int MvxBinding_MvxBind = 0;

			public static int[] MvxHttpImageView = new int[] {
					2130771971};

			// aapt resource value: 0
			public const int MvxHttpImageView_MvxHttpSource = 0;

			private Styleable()
			{
			}
		}
	}
}


text:
package rx.operators;

import java.util.Arrays;
import java.util.concurrent.TimeUnit;

import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;

import rx.*;
import rx.internal.operators.*;

/**
 * Benchmark typical atomic operations on volatile fields and AtomicXYZ classes.
 *

 * gradlew benchmarks "-Pjmh=-f 1 -tu s -bm thrpt -wi 5 -i 5 -r 1 .*FromComparison.*"
 *

 * gradlew benchmarks "-Pjmh=-f 1 -tu ns -bm avgt -wi 5 -i 5 -r 1 .*FromComparison.*"
 */
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.SECONDS)
@State(Scope.Thread)
public class FromComparison {
    @Param({ "1", "10", "100", "1000", "1000000" })
    public int times;

    Observable<Integer> iterableSource;

    Observable<Integer> arraySource;

    @Setup
    public void setup() {
        Integer[] array = new Integer[times];

        Arrays.fill(array, 1);

        iterableSource = Observable.create(new OnSubscribeFromIterable<Integer>(Arrays.asList(array)));
        arraySource = Observable.create(new OnSubscribeFromArray<Integer>(array));
    }

    @Benchmark
    public void fastpathIterable(Blackhole bh) {
        iterableSource.subscribe(new RequestingSubscriber<Object>(bh, Long.MAX_VALUE));
    }

    @Benchmark
    public void fastpathArray(Blackhole bh) {
        arraySource.subscribe(new RequestingSubscriber<Object>(bh, Long.MAX_VALUE));
    }

    @Benchmark
    public void slowpathIterable(Blackhole bh) {
        iterableSource.subscribe(new RequestingSubscriber<Object>(bh, times + 1));
    }

    @Benchmark
    public void slowpathArray(Blackhole bh) {
        arraySource.subscribe(new RequestingSubscriber<Object>(bh, times + 1));
    }

    @Benchmark
    public void slowpathIterable2(Blackhole bh) {
        iterableSource.subscribe(new RequestingSubscriber<Object>(bh, 128));
    }

    @Benchmark
    public void slowpathArray2(Blackhole bh) {
        arraySource.subscribe(new RequestingSubscriber<Object>(bh, 128));
    }

    static final class RequestingSubscriber<T> extends Subscriber<T> {
        final Blackhole bh;
        final long limit;
        long received;
        Producer p;

        public RequestingSubscriber(Blackhole bh, long limit) {
            this.bh = bh;
            this.limit = limit;
        }

        @Override
        public void onNext(T t) {
            bh.consume(t);
            if (++received >= limit) {
                received = 0L;
                p.request(limit);
            }
        }

        @Override
        public void onError(Throwable e) {
            e.printStackTrace();
        }

        @Override
        public void onCompleted() {

        }

        @Override
        public void setProducer(Producer p) {
            this.p = p;
            p.request(limit);
        }
    }
}


text:
Returns a context manager for defining an op that creates variables.

This context manager validates that the given `values` are from the
same graph, ensures that graph is the default graph, and pushes a
name scope and a variable scope.

If `name_or_scope` is not None, it is used as is in the variable scope. If
`scope` is None, then `default_name` is used.  In that case, if the same name
has been previously used in the same scope, it will made unique be appending
`_N` to it.

This is intended to be used when defining generic ops and so reuse is always
inherited.

For example, to define a new Python op called `my_op_with_vars`:

```python
def my_op_with_vars(a, b, scope=None):
  with tf.variable_op_scope([a, b], scope, "MyOp") as scope:
    a = tf.convert_to_tensor(a, name="a")
    b = tf.convert_to_tensor(b, name="b")
    c = tf.get_variable('c')
    # Define some computation that uses `a`, `b`, and `c`.
    return foo_op(..., name=scope)
```

##### Args:

*  <b>`values`</b>: The list of `Tensor` arguments that are passed to the op function.
*  <b>`name_or_scope`</b>: The name argument that is passed to the op function,
    this name_or_scope is not uniquified in the variable scope.
*  <b>`default_name`</b>: The default name to use if the `name_or_scope` argument is
    `None`, this name will be uniquified. If name_or_scope is provided it
    won't be used and therefore it is not required and can be None.
*  <b>`initializer`</b>: The default initializer to pass to variable scope.
*  <b>`regularizer`</b>: The default regularizer for variables within this scope.
*  <b>`caching_device`</b>: The default caching device for variables within this scope.
*  <b>`partitioner`</b>: The default partitioner for variables within this scope.
*  <b>`custom_getter`</b>: The default custom getter for variables within this scope.
*  <b>`reuse`</b>: `True` or `None`; if `True`, we go into reuse mode for this scope as
    well as all sub-scopes; if `None`, we just inherit the parent scope reuse.
*  <b>`dtype`</b>: The default type of variables created in this scope, defaults to the
    type of the parent scope.

##### Returns:

  A context manager for use in defining a Python op.

##### Raises:

*  <b>`ValueError`</b>: when trying to reuse within a create scope, or create within
    a reuse scope, or if reuse is not `None` or `True`.
*  <b>`TypeError`</b>: when the types of some arguments are not appropriate.


text:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
  <Appenders>
    <Console name="Console" target="SYSTEM_OUT">
      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
    </Console>
    <NoSql name="MongoDb">
      <!-- <MongoDb databaseName="hhub" collectionName="logs" server="mongodb://hhub1.hefame.es,hhub2.hefame.es,hhub3.hefame.es,hhub4.hefame.es/?replicaSet=rs0" username="log4j" password="12345678" /> -->
      <MongoDb factoryClassName="jhefame.hub.util.MongoProvider" factoryMethodName="get_client" databaseName="hhub" collectionName="logs"/>
    </NoSql>
  </Appenders>
  <Loggers>
    <Root level="TRACE" >
      <AppenderRef ref="MongoDb"/>
    </Root>
  </Loggers>
</Configuration>