text:
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.OracleClient;
using System.Configuration;
using System.Collections.Generic;

namespace V5_WinLibs.DBUtility
{
	/// <summary>
	/// Copyright (C) 2004-2008 LiTianPing
	/// Êý¾Ý·ÃÎÊ»ù´¡Àà(»ùÓÚOracle)
	/// ¿ÉÒÔÓû§¿ÉÒÔÐÞ¸ÄÂú×ã×Ô¼ºÏîÄ¿µÄÐèÒª¡£
	/// </summary>
	public abstract class DbHelperOra
	{
        public static string connectionString = PubConstant.ConnectionString;
		public DbHelperOra()
		{
		}
        #region ¹«Ó÷½·¨

        public static int GetMaxID(string FieldName, string TableName)
        {
            string strsql = "select max(" + FieldName + ")+1 from " + TableName;
            object obj = DbHelperOra.GetSingle(strsql);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return int.Parse(obj.ToString());
            }
        }
        public static bool Exists(string strSql)
        {
            object obj = DbHelperOra.GetSingle(strSql);
            int cmdresult;
            if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
            {
                cmdresult = 0;
            }
            else
            {
                cmdresult = int.Parse(obj.ToString());
            }
            if (cmdresult == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }

        public static bool Exists(string strSql, params OracleParameter[] cmdParms)
        {
            object obj = DbHelperOra.GetSingle(strSql, cmdParms);
            int cmdresult;
            if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
            {
                cmdresult = 0;
            }
            else
            {
                cmdresult = int.Parse(obj.ToString());
            }
            if (cmdresult == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
        #endregion

		#region  Ö´Ðмòµ¥SQLÓï¾ä

		/// <summary>
		/// Ö´ÐÐSQLÓï¾ä£¬·µ»ØÓ°ÏìµÄ¼Ç¼Êý
		/// </summary>
		/// <param name="SQLString">SQLÓï¾ä</param>
		/// <returns>Ó°ÏìµÄ¼Ç¼Êý</returns>
		public static int ExecuteSql(string SQLString)
		{
			using (OracleConnection connection = new OracleConnection(connectionString))
			{
				using (OracleCommand cmd = new OracleCommand(SQLString,connection))
				{
					try
					{
						connection.Open();
						int rows=cmd.ExecuteNonQuery();
						return rows;
					}
					catch(System.Data.OracleClient.OracleException E)
					{
						connection.Close();
						throw new Exception(E.Message);
					}
                    finally
                    {
                        cmd.Dispose();
                        connection.Close();
                    }
				}
			}
		}

		/// <summary>
		/// Ö´ÐжàÌõSQLÓï¾ä£¬ÊµÏÖÊý¾Ý¿âÊÂÎñ¡£
		/// </summary>
		/// <param name="SQLStringList">¶àÌõSQLÓï¾ä</param>
		public static void ExecuteSqlTran(ArrayList SQLStringList)
		{
            using (OracleConnection connection = new OracleConnection(connectionString))
			{
                connection.Open();
				OracleCommand cmd = new OracleCommand();
                cmd.Connection = connection;
                OracleTransaction tx = connection.BeginTransaction();
				cmd.Transaction=tx;
				try
				{
					for(int n=0;n<SQLStringList.Count;n++)
					{
						string strsql=SQLStringList[n].ToString();
						if (strsql.Trim().Length>1)
						{
							cmd.CommandText=strsql;
							cmd.ExecuteNonQuery();
						}
					}
					tx.Commit();
				}
				catch(System.Data.OracleClient.OracleException E)
				{
					tx.Rollback();
					throw new Exception(E.Message);
				}
                finally
                {
                    cmd.Dispose();
                    connection.Close();
                }
			}
		}
		/// <summary>
		/// Ö´ÐдøÒ»¸ö´æ´¢¹ý³Ì²ÎÊýµÄµÄSQLÓï¾ä¡£
		/// </summary>
		/// <param name="SQLString">SQLÓï¾ä</param>
		/// <param name="content">²ÎÊýÄÚÈÝ,±ÈÈçÒ»¸ö×Ö¶ÎÊǸñʽ¸´ÔÓµÄÎÄÕ£¬ÓÐÌØÊâ·ûºÅ£¬¿ÉÒÔͨ¹ýÕâ¸ö·½Ê½Ìí¼Ó</param>
		/// <returns>Ó°ÏìµÄ¼Ç¼Êý</returns>
		public static int ExecuteSql(string SQLString,string content)
		{
			using (OracleConnection connection = new OracleConnection(connectionString))
			{
				OracleCommand cmd = new OracleCommand(SQLString,connection);
                System.Data.OracleClient.OracleParameter myParameter = new System.Data.OracleClient.OracleParameter("@content", OracleType.NVarChar);
				myParameter.Value = content ;
				cmd.Parameters.Add(myParameter);
				try
				{
					connection.Open();
					int rows=cmd.ExecuteNonQuery();
					return rows;
				}
				catch(System.Data.OracleClient.OracleException E)
				{
					throw new Exception(E.Message);
				}
				finally
				{
					cmd.Dispose();
					connection.Close();
				}
			}
		}
		/// <summary>
		/// ÏòÊý¾Ý¿âÀï²åÈëͼÏñ¸ñʽµÄ×Ö¶Î(ºÍÉÏÃæÇé¿öÀàËƵÄÁíÒ»ÖÖʵÀý)
		/// </summary>
		/// <param name="strSQL">SQLÓï¾ä</param>
		/// <param name="fs">ͼÏñ×Ö½Ú,Êý¾Ý¿âµÄ×Ö¶ÎÀàÐÍΪimageµÄÇé¿ö</param>
		/// <returns>Ó°ÏìµÄ¼Ç¼Êý</returns>
		public static int ExecuteSqlInsertImg(string strSQL,byte[] fs)
		{
			using (OracleConnection connection = new OracleConnection(connectionString))
			{
				OracleCommand cmd = new OracleCommand(strSQL,connection);
                System.Data.OracleClient.OracleParameter myParameter = new System.Data.OracleClient.OracleParameter("@fs", OracleType.LongRaw);
				myParameter.Value = fs ;
				cmd.Parameters.Add(myParameter);
				try
				{
					connection.Open();
					int rows=cmd.ExecuteNonQuery();
					return rows;
				}
				catch(System.Data.OracleClient.OracleException E)
				{
					throw new Exception(E.Message);
				}
				finally
				{
					cmd.Dispose();
					connection.Close();
				}
			}
		}

		/// <summary>
		/// Ö´ÐÐÒ»Ìõ¼ÆËã²éѯ½á¹ûÓï¾ä£¬·µ»Ø²éѯ½á¹û£¨object£©¡£
		/// </summary>
		/// <param name="SQLString">¼ÆËã²éѯ½á¹ûÓï¾ä</param>
		/// <returns>²éѯ½á¹û£¨object£©</returns>
		public static object GetSingle(string SQLString)
		{
			using (OracleConnection connection = new OracleConnection(connectionString))
			{
				using(OracleCommand cmd = new OracleCommand(SQLString,connection))
				{
					try
					{
						connection.Open();
						object obj = cmd.ExecuteScalar();
						if((Object.Equals(obj,null))||(Object.Equals(obj,System.DBNull.Value)))
						{
							return null;
						}
						else
						{
							return obj;
						}
					}
					catch(System.Data.OracleClient.OracleException e)
					{
						connection.Close();
						throw new Exception(e.Message);
					}
                    finally
                    {
                        cmd.Dispose();
                        connection.Close();
                    }
				}
			}
		}
		/// <summary>
        /// Ö´ÐвéѯÓï¾ä£¬·µ»ØOracleDataReader ( ×¢Ò⣺µ÷Óø÷½·¨ºó£¬Ò»¶¨Òª¶ÔSqlDataReader½øÐÐClose )
		/// </summary>
		/// <param name="strSQL">²éѯÓï¾ä</param>
		/// <returns>OracleDataReader</returns>
		public static OracleDataReader ExecuteReader(string strSQL)
		{
			OracleConnection connection = new OracleConnection(connectionString);
			OracleCommand cmd = new OracleCommand(strSQL,connection);
			try
			{
				connection.Open();
                OracleDataReader myReader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
				return myReader;
			}
			catch(System.Data.OracleClient.OracleException e)
			{
				throw new Exception(e.Message);
			}

		}
		/// <summary>
		/// Ö´ÐвéѯÓï¾ä£¬·µ»ØDataSet
		/// </summary>
		/// <param name="SQLString">²éѯÓï¾ä</param>
		/// <returns>DataSet</returns>
		public static DataSet Query(string SQLString)
		{
			using (OracleConnection connection = new OracleConnection(connectionString))
			{
				DataSet ds = new DataSet();
				try
				{
					connection.Open();
					OracleDataAdapter command = new OracleDataAdapter(SQLString,connection);
					command.Fill(ds,"ds");
				}
				catch(System.Data.OracleClient.OracleException ex)
				{
					throw new Exception(ex.Message);
				}
                finally
                {
                    connection.Close();
                }
				return ds;
			}
		}

		#endregion

		#region Ö´Ðдø²ÎÊýµÄSQLÓï¾ä

		/// <summary>
		/// Ö´ÐÐSQLÓï¾ä£¬·µ»ØÓ°ÏìµÄ¼Ç¼Êý
		/// </summary>
		/// <param name="SQLString">SQLÓï¾ä</param>
		/// <returns>Ó°ÏìµÄ¼Ç¼Êý</returns>
		public static int ExecuteSql(string SQLString,params OracleParameter[] cmdParms)
		{
			using (OracleConnection connection = new OracleConnection(connectionString))
			{
				using (OracleCommand cmd = new OracleCommand())
				{
					try
					{
						PrepareCommand(cmd, connection, null,SQLString, cmdParms);
						int rows=cmd.ExecuteNonQuery();
						cmd.Parameters.Clear();
						return rows;
					}
					catch(System.Data.OracleClient.OracleException E)
					{
						throw new Exception(E.Message);
					}
                    finally
                    {
                        cmd.Dispose();
                        connection.Close();
                    }
				}
			}
		}

		/// <summary>
		/// Ö´ÐжàÌõSQLÓï¾ä£¬ÊµÏÖÊý¾Ý¿âÊÂÎñ¡£
		/// </summary>
		/// <param name="SQLStringList">SQLÓï¾äµÄ¹þÏ£±í£¨keyΪsqlÓï¾ä£¬valueÊǸÃÓï¾äµÄOracleParameter[]£©</param>
		public static void ExecuteSqlTran(Hashtable SQLStringList)
		{
			using (OracleConnection conn = new OracleConnection(connectionString))
			{
				conn.Open();
				using (OracleTransaction trans = conn.BeginTransaction())
				{
					OracleCommand cmd = new OracleCommand();
					try
					{
						foreach (DictionaryEntry myDE in SQLStringList)
						{
							string 	cmdText=myDE.Key.ToString();
							OracleParameter[] cmdParms=(OracleParameter[])myDE.Value;
							PrepareCommand(cmd,conn,trans,cmdText, cmdParms);
							int val = cmd.ExecuteNonQuery();
							cmd.Parameters.Clear();

							trans.Commit();
						}
					}
					catch
					{
						trans.Rollback();
						throw;
					}
				}
			}
		}
        /// <summary>
        /// Ö´ÐжàÌõSQLÓï¾ä£¬ÊµÏÖÊý¾Ý¿âÊÂÎñ¡£
        /// </summary>
        /// <param name="SQLStringList">¶àÌõSQLÓï¾ä</param>
        public static int ExecuteSqlTran(List<String> SQLStringList)
        {
            using (OracleConnection connection = new OracleConnection(connectionString))
            {
                connection.Open();
                OracleCommand cmd = new OracleCommand();
                cmd.Connection = connection;
                OracleTransaction tx = connection.BeginTransaction();
                cmd.Transaction = tx;
                try
                {
                    int count = 0;
                    for (int n = 0; n < SQLStringList.Count; n++)
                    {
                        string strsql = SQLStringList[n];
                        if (strsql.Trim().Length > 1)
                        {
                            cmd.CommandText = strsql;
                            count += cmd.ExecuteNonQuery();
                        }
                    }
                    tx.Commit();
                    return count;
                }
                catch
                {
                    tx.Rollback();
                    return 0;
                }
                finally
                {
                    cmd.Dispose();
                    connection.Close();
                }
            }
        }

		/// <summary>
		/// Ö´ÐÐÒ»Ìõ¼ÆËã²éѯ½á¹ûÓï¾ä£¬·µ»Ø²éѯ½á¹û£¨object£©¡£
		/// </summary>
		/// <param name="SQLString">¼ÆËã²éѯ½á¹ûÓï¾ä</param>
		/// <returns>²éѯ½á¹û£¨object£©</returns>
		public static object GetSingle(string SQLString,params OracleParameter[] cmdParms)
		{
			using (OracleConnection connection = new OracleConnection(connectionString))
			{
				using (OracleCommand cmd = new OracleCommand())
				{
					try
					{
						PrepareCommand(cmd, connection, null,SQLString, cmdParms);
						object obj = cmd.ExecuteScalar();
						cmd.Parameters.Clear();
						if((Object.Equals(obj,null))||(Object.Equals(obj,System.DBNull.Value)))
						{
							return null;
						}
						else
						{
							return obj;
						}
					}
					catch(System.Data.OracleClient.OracleException e)
					{
						throw new Exception(e.Message);
					}
                    finally
                    {
                        cmd.Dispose();
                        connection.Close();
                    }
				}
			}
		}

		/// <summary>
        /// Ö´ÐвéѯÓï¾ä£¬·µ»ØOracleDataReader ( ×¢Ò⣺µ÷Óø÷½·¨ºó£¬Ò»¶¨Òª¶ÔSqlDataReader½øÐÐClose )
		/// </summary>
		/// <param name="strSQL">²éѯÓï¾ä</param>
		/// <returns>OracleDataReader</returns>
		public static OracleDataReader ExecuteReader(string SQLString,params OracleParameter[] cmdParms)
		{
			OracleConnection connection = new OracleConnection(connectionString);
			OracleCommand cmd = new OracleCommand();
			try
			{
				PrepareCommand(cmd, connection, null,SQLString, cmdParms);
                OracleDataReader myReader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
				cmd.Parameters.Clear();
				return myReader;
			}
			catch(System.Data.OracleClient.OracleException e)
			{
				throw new Exception(e.Message);
			}

		}

		/// <summary>
		/// Ö´ÐвéѯÓï¾ä£¬·µ»ØDataSet
		/// </summary>
		/// <param name="SQLString">²éѯÓï¾ä</param>
		/// <returns>DataSet</returns>
		public static DataSet Query(string SQLString,params OracleParameter[] cmdParms)
		{
			using (OracleConnection connection = new OracleConnection(connectionString))
			{
				OracleCommand cmd = new OracleCommand();
				PrepareCommand(cmd, connection, null,SQLString, cmdParms);
				using( OracleDataAdapter da = new OracleDataAdapter(cmd) )
				{
					DataSet ds = new DataSet();
					try
					{
						da.Fill(ds,"ds");
						cmd.Parameters.Clear();
					}
					catch(System.Data.OracleClient.OracleException ex)
					{
						throw new Exception(ex.Message);
					}
                    finally
                    {
                        cmd.Dispose();
                        connection.Close();
                    }
					return ds;
				}
			}
		}

		private static void PrepareCommand(OracleCommand cmd,OracleConnection conn,OracleTransaction trans, string cmdText, OracleParameter[] cmdParms)
		{
			if (conn.State != ConnectionState.Open)
				conn.Open();
			cmd.Connection = conn;
			cmd.CommandText = cmdText;
			if (trans != null)
				cmd.Transaction = trans;
			cmd.CommandType = CommandType.Text;
			if (cmdParms != null)
			{
				foreach (OracleParameter parm in cmdParms)
					cmd.Parameters.Add(parm);
			}
		}

		#endregion

		#region ´æ´¢¹ý³Ì²Ù×÷

		/// <summary>
        /// Ö´Ðд洢¹ý³Ì ·µ»ØSqlDataReader ( ×¢Ò⣺µ÷Óø÷½·¨ºó£¬Ò»¶¨Òª¶ÔSqlDataReader½øÐÐClose )
		/// </summary>
		/// <param name="storedProcName">´æ´¢¹ý³ÌÃû</param>
		/// <param name="parameters">´æ´¢¹ý³Ì²ÎÊý</param>
		/// <returns>OracleDataReader</returns>
		public static OracleDataReader RunProcedure(string storedProcName, IDataParameter[] parameters )
		{
			OracleConnection connection = new OracleConnection(connectionString);
			OracleDataReader returnReader;
			connection.Open();
			OracleCommand command = BuildQueryCommand( connection,storedProcName, parameters );
			command.CommandType = CommandType.StoredProcedure;
            returnReader = command.ExecuteReader(CommandBehavior.CloseConnection);
			return returnReader;
		}

		/// <summary>
		/// Ö´Ðд洢¹ý³Ì
		/// </summary>
		/// <param name="storedProcName">´æ´¢¹ý³ÌÃû</param>
		/// <param name="parameters">´æ´¢¹ý³Ì²ÎÊý</param>
		/// <param name="tableName">DataSet½á¹ûÖеıíÃû</param>
		/// <returns>DataSet</returns>
		public static DataSet RunProcedure(string storedProcName, IDataParameter[] parameters, string tableName )
		{
			using (OracleConnection connection = new OracleConnection(connectionString))
			{
				DataSet dataSet = new DataSet();
				connection.Open();
				OracleDataAdapter sqlDA = new OracleDataAdapter();
				sqlDA.SelectCommand = BuildQueryCommand(connection, storedProcName, parameters );
				sqlDA.Fill( dataSet, tableName );
				connection.Close();
				return dataSet;
			}
		}

		/// <summary>
		/// ¹¹½¨ OracleCommand ¶ÔÏó(ÓÃÀ´·µ»ØÒ»¸ö½á¹û¼¯£¬¶ø²»ÊÇÒ»¸öÕûÊýÖµ)
		/// </summary>
		/// <param name="connection">Êý¾Ý¿âÁ¬½Ó</param>
		/// <param name="storedProcName">´æ´¢¹ý³ÌÃû</param>
		/// <param name="parameters">´æ´¢¹ý³Ì²ÎÊý</param>
		/// <returns>OracleCommand</returns>
		private static OracleCommand BuildQueryCommand(OracleConnection connection,string storedProcName, IDataParameter[] parameters)
		{
			OracleCommand command = new OracleCommand( storedProcName, connection );
			command.CommandType = CommandType.StoredProcedure;
			foreach (OracleParameter parameter in parameters)
			{
				command.Parameters.Add( parameter );
			}
			return command;
		}

		/// <summary>
		/// Ö´Ðд洢¹ý³Ì£¬·µ»ØÓ°ÏìµÄÐÐÊý
		/// </summary>
		/// <param name="storedProcName">´æ´¢¹ý³ÌÃû</param>
		/// <param name="parameters">´æ´¢¹ý³Ì²ÎÊý</param>
		/// <param name="rowsAffected">Ó°ÏìµÄÐÐÊý</param>
		/// <returns></returns>
		public static int RunProcedure(string storedProcName, IDataParameter[] parameters, out int rowsAffected )
		{
			using (OracleConnection connection = new OracleConnection(connectionString))
			{
				int result;
				connection.Open();
				OracleCommand command = BuildIntCommand(connection,storedProcName, parameters );
				rowsAffected = command.ExecuteNonQuery();
				result = (int)command.Parameters["ReturnValue"].Value;
				return result;
			}
		}

		/// <summary>
		/// ´´½¨ OracleCommand ¶ÔÏóʵÀý(ÓÃÀ´·µ»ØÒ»¸öÕûÊýÖµ)
		/// </summary>
		/// <param name="storedProcName">´æ´¢¹ý³ÌÃû</param>
		/// <param name="parameters">´æ´¢¹ý³Ì²ÎÊý</param>
		/// <returns>OracleCommand ¶ÔÏóʵÀý</returns>
		private static OracleCommand BuildIntCommand(OracleConnection connection,string storedProcName, IDataParameter[] parameters)
		{
			OracleCommand command = BuildQueryCommand(connection,storedProcName, parameters );
			command.Parameters.Add( new OracleParameter ( "ReturnValue",
                OracleType.Int32, 4, ParameterDirection.ReturnValue,
				false,0,0,string.Empty,DataRowVersion.Default,null ));
			return command;
		}
		#endregion

	}
}


text:
var fnaModel = Store.getModel();
var appData = $.app;
$('#fnaChromePluginData').text(JSON.stringify(
	{
		app_version: appData._application_version,
		fna_id: fnaModel.id,
		user_email: appData.userEmail,
		user_name: appData.userName
	}
));

redpajama_set_name: RedPajamaGithub


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/apigeeregistry/v1/registry_service.proto

package com.google.cloud.apigeeregistry.v1;

public interface ListApiVersionsResponseOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.apigeeregistry.v1.ListApiVersionsResponse)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * The versions from the specified publisher.
   *

   *
   * repeated .google.cloud.apigeeregistry.v1.ApiVersion api_versions = 1;
   */
  java.util.List<com.google.cloud.apigeeregistry.v1.ApiVersion> getApiVersionsList();
  /**
   *
   *
   *

   * The versions from the specified publisher.
   *

   *
   * repeated .google.cloud.apigeeregistry.v1.ApiVersion api_versions = 1;
   */
  com.google.cloud.apigeeregistry.v1.ApiVersion getApiVersions(int index);
  /**
   *
   *
   *

   * The versions from the specified publisher.
   *

   *
   * repeated .google.cloud.apigeeregistry.v1.ApiVersion api_versions = 1;
   */
  int getApiVersionsCount();
  /**
   *
   *
   *

   * The versions from the specified publisher.
   *

   *
   * repeated .google.cloud.apigeeregistry.v1.ApiVersion api_versions = 1;
   */
  java.util.List<? extends com.google.cloud.apigeeregistry.v1.ApiVersionOrBuilder>
      getApiVersionsOrBuilderList();
  /**
   *
   *
   *

   * The versions from the specified publisher.
   *

   *
   * repeated .google.cloud.apigeeregistry.v1.ApiVersion api_versions = 1;
   */
  com.google.cloud.apigeeregistry.v1.ApiVersionOrBuilder getApiVersionsOrBuilder(int index);

  /**
   *
   *
   *

   * A token, which can be sent as `page_token` to retrieve the next page.
   * If this field is omitted, there are no subsequent pages.
   *

   *
   * string next_page_token = 2;
   *
   * @return The nextPageToken.
   */
  java.lang.String getNextPageToken();
  /**
   *
   *
   *

   * A token, which can be sent as `page_token` to retrieve the next page.
   * If this field is omitted, there are no subsequent pages.
   *

   *
   * string next_page_token = 2;
   *
   * @return The bytes for nextPageToken.
   */
  com.google.protobuf.ByteString getNextPageTokenBytes();
}


text:
require "active_support/core_ext/hash/deep_merge"
require 'find'

module Middleman::CoreExtensions::Sitemap
  class << self
    def registered(app)
      app.set :ignored_sitemap_matchers, {
        # dotfiles and folders in the root
        :root_dotfiles => proc { |file, path| file.match(/^\./) },

        # Files starting with an dot, but not .htaccess
        :source_dotfiles => proc { |file, path|
          (file.match(/\/\./) && !file.match(/\/\.htaccess/))
        },

        # Files starting with an underscore, but not a double-underscore
        :partials => proc { |file, path| (file.match(/\/_/) && !file.match(/\/__/)) },

        # Files without any output extension (layouts, partials)
        :extensionless => proc { |file, path| !path.match(/\./) },
      }
      app.send :include, InstanceMethods
    end
    alias :included :registered
  end

  module InstanceMethods
    def initialize
      super

      static_path = source_dir.sub(self.root, "").sub(/^\//, "")
      sitemap_regex = static_path.empty? ? // : (%r{^#{static_path + "/"}})

      self.files.changed sitemap_regex do |file|
        self.sitemap.touch_file(file)
      end

      self.files.deleted sitemap_regex do |file|
        self.sitemap.remove_file(file)
      end
    end

    def sitemap
      @sitemap ||= ::Middleman::Sitemap::Store.new(self)
    end

    def current_page
      sitemap.page(current_path)
    end

    # Keep a path from building
    def ignore(path)
      sitemap.ignore(path)
    end

    def reroute(url, target)
      sitemap.proxy(url, target)
    end

    def provides_metadata(matcher=nil, &block)
      @_provides_metadata ||= []
      @_provides_metadata << [block, matcher] if block_given?
      @_provides_metadata
    end

    def provides_metadata_for_path(matcher=nil, &block)
      @_provides_metadata_for_path ||= []
      @_provides_metadata_for_path << [block, matcher] if block_given?
      @_provides_metadata_for_path
    end
  end
end


text:
<?php

namespace Oro\Bundle\LayoutBundle\Tests\Unit\Layout\Form;

use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\FormView;

use Oro\Bundle\LayoutBundle\Layout\Form\DependencyInjectionFormAccessor;
use Oro\Bundle\LayoutBundle\Layout\Form\FormAction;

class DependencyInjectionFormAccessorTest extends \PHPUnit_Framework_TestCase
{
    const FORM_SERVICE_ID = 'test_service_id';

    /** @var ContainerInterface|\PHPUnit_Framework_MockObject_MockObject */
    protected $container;

    protected function setUp()
    {
        $this->container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
    }

    public function testGetForm()
    {
        $form = $this->getMock('Symfony\Component\Form\Test\FormInterface');
        $form->expects($this->once())->method('getName')->willReturn('form_name');

        $this->container->expects($this->once())
            ->method('get')
            ->with(self::FORM_SERVICE_ID)
            ->will($this->returnValue($form));

        $formAccessor = new DependencyInjectionFormAccessor($this->container, self::FORM_SERVICE_ID);
        $this->assertSame($form, $formAccessor->getForm());
        $this->assertEquals('form_name', $formAccessor->getName());
    }

    public function testToString()
    {
        $formAccessor = new DependencyInjectionFormAccessor($this->container, self::FORM_SERVICE_ID);
        $this->assertEquals(self::FORM_SERVICE_ID, $formAccessor->toString());
    }

    public function testToStringWithAllParams()
    {
        $formAccessor = new DependencyInjectionFormAccessor(
            $this->container,
            self::FORM_SERVICE_ID,
            FormAction::createByRoute('test_route', ['foo' => 'bar']),
            'post',
            'multipart/form-data'
        );
        $this->assertEquals(
            self::FORM_SERVICE_ID . ';action_route:test_route;method:post;enctype:multipart/form-data',
            $formAccessor->toString()
        );
    }

    public function testParamsInitializer()
    {
        $formAccessor = new DependencyInjectionFormAccessor($this->container, self::FORM_SERVICE_ID);

        $formAction = 'test_action';
        $formMethod = 'test_method';

        $form       = $this->getMock('Symfony\Component\Form\Test\FormInterface');
        $formConfig = $this->getMock('Symfony\Component\Form\FormConfigInterface');
        $formView   = new FormView();

        $formView->vars['multipart'] = false;

        $this->container->expects($this->once())
            ->method('get')
            ->with(self::FORM_SERVICE_ID)
            ->will($this->returnValue($form));
        $form->expects($this->once())
            ->method('createView')
            ->will($this->returnValue($formView));
        $form->expects($this->any())
            ->method('getConfig')
            ->will($this->returnValue($formConfig));
        $formConfig->expects($this->once())
            ->method('getAction')
            ->will($this->returnValue($formAction));
        $formConfig->expects($this->once())
            ->method('getMethod')
            ->will($this->returnValue($formMethod));

        $this->assertEquals($formAction, $formAccessor->getAction()->getPath());
        $this->assertEquals(strtoupper($formMethod), $formAccessor->getMethod());
        $this->assertNull($formAccessor->getEnctype());
        $this->assertEquals(self::FORM_SERVICE_ID, $formAccessor->toString());
    }

    public function testParamsInitializerForMultipartForm()
    {
        $formAccessor = new DependencyInjectionFormAccessor($this->container, self::FORM_SERVICE_ID);

        $formAction = 'test_action';
        $formMethod = 'test_method';

        $form       = $this->getMock('Symfony\Component\Form\Test\FormInterface');
        $formConfig = $this->getMock('Symfony\Component\Form\FormConfigInterface');
        $formView   = new FormView();

        $formView->vars['multipart'] = true;

        $this->container->expects($this->once())
            ->method('get')
            ->with(self::FORM_SERVICE_ID)
            ->will($this->returnValue($form));
        $form->expects($this->once())
            ->method('createView')
            ->will($this->returnValue($formView));
        $form->expects($this->any())
            ->method('getConfig')
            ->will($this->returnValue($formConfig));
        $formConfig->expects($this->once())
            ->method('getAction')
            ->will($this->returnValue($formAction));
        $formConfig->expects($this->once())
            ->method('getMethod')
            ->will($this->returnValue($formMethod));

        $this->assertEquals($formAction, $formAccessor->getAction()->getPath());
        $this->assertEquals(strtoupper($formMethod), $formAccessor->getMethod());
        $this->assertEquals('multipart/form-data', $formAccessor->getEnctype());
        $this->assertEquals(self::FORM_SERVICE_ID, $formAccessor->toString());
    }

    public function testGetView()
    {
        // form
        //   field1
        //     field2
        $formView                       = new FormView();
        $formView->vars['id']           = self::FORM_SERVICE_ID;
        $field1View                     = new FormView($formView);
        $formView->children['field1']   = $field1View;
        $field2View                     = new FormView($field1View);
        $field1View->children['field2'] = $field2View;

        $form = $this->getMock('Symfony\Component\Form\Test\FormInterface');
        $this->container->expects($this->once())
            ->method('get')
            ->with(self::FORM_SERVICE_ID)
            ->will($this->returnValue($form));
        $form->expects($this->once())
            ->method('createView')
            ->will($this->returnValue($formView));

        $formAccessor = new DependencyInjectionFormAccessor($this->container, self::FORM_SERVICE_ID);
        $this->assertSame($formView, $formAccessor->getView());
        $this->assertSame($field1View, $formAccessor->getView('field1'));
        $this->assertSame($field2View, $formAccessor->getView('field1.field2'));
        $this->assertSame($formView->vars['id'], $formAccessor->getId());
    }

    public function testProcessedFields()
    {
        $formAccessor = new DependencyInjectionFormAccessor($this->container, self::FORM_SERVICE_ID);

        $this->assertNull($formAccessor->getProcessedFields());

        $processedFields = ['field' => 'block_id'];
        $formAccessor->setProcessedFields($processedFields);
        $this->assertSame($processedFields, $formAccessor->getProcessedFields());
    }

    public function testSetFormData()
    {
        $data = ['test'];

        $form = $this->getMock('Symfony\Component\Form\Test\FormInterface');
        $form->expects($this->once())->method('setData')->with($data);
        $form->expects($this->once())->method('getData')->willReturn($data);

        $this->container->expects($this->once())
            ->method('get')
            ->with(self::FORM_SERVICE_ID)
            ->will($this->returnValue($form));

        $formAccessor = new DependencyInjectionFormAccessor($this->container, self::FORM_SERVICE_ID);

        $formAccessor->setFormData($data);
        $this->assertEquals($data, $formAccessor->getForm()->getData());
    }

    public function testSetters()
    {
        $formConfig = $this->getMock('Symfony\Component\Form\FormConfigInterface');
        $formView = new FormView();
        $formView->vars['multipart'] = true;

        $form = $this->getMock('Symfony\Component\Form\Test\FormInterface');
        $form->expects($this->any())
            ->method('getConfig')
            ->will($this->returnValue($formConfig));
        $form->expects($this->once())
            ->method('createView')
            ->will($this->returnValue($formView));

        $this->container->expects($this->once())
            ->method('get')
            ->with(self::FORM_SERVICE_ID)
            ->will($this->returnValue($form));

        $formAccessor = new DependencyInjectionFormAccessor($this->container, self::FORM_SERVICE_ID);

        $action = FormAction::createByRoute('test_route', ['foo' => 'bar']);
        $formAccessor->setAction($action);
        $this->assertEquals($action, $formAccessor->getAction());

        $formAccessor->setActionRoute('test_route', []);
        $this->assertEquals(FormAction::createByRoute('test_route', []), $formAccessor->getAction());

        $formAccessor->setMethod('post');
        $this->assertEquals('post', $formAccessor->getMethod());

        $formAccessor->setEnctype('multipart/form-data');
        $this->assertEquals('multipart/form-data', $formAccessor->getEnctype());
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Haven.Resources;
using Haven.Utils;
using SharpHaven.Client;
using SharpHaven.Utils;

namespace SharpHaven.Graphics.Sprites.Plants
{
	public class GrowingPlantMaker : SpriteMaker
	{
		private readonly int num;
		private readonly SpritePart[,] strands;
		private readonly NegLayer neg;

		private GrowingPlantMaker(Resource res, int stages, int variants, int num, bool rev)
			: base(res)
		{
			this.num = num;
			this.neg = res.GetLayer<NegLayer>();
			this.strands = new SpritePart[stages, variants];

			foreach (var part in Parts.Where(x => x.Id != -1))
			{
				int stage = rev ? part.Id / variants : part.Id % stages;
				int variant = rev ? part.Id % variants : part.Id / stages;
				strands[stage, variant] = part;
			}
		}

		public static Func<Resource, SpriteMaker> Create(int stages, int variants, int num, bool rev = false)
		{
			return res => new GrowingPlantMaker(res, stages, variants, num, rev);
		}

		public override ISprite MakeInstance(Gob owner, byte[] state)
		{
			var rnd = new Random(owner?.Id ?? RandomUtils.GetSeed());
			var stage = state[0];
			var parts = new List<SpritePart>();
			parts.AddRange(Parts.Where(x => x.Id == -1));
			for (int i = 0; i < num; i++)
			{
				var s = strands[stage, rnd.Next(strands.GetLength(1))];
				var cx = rnd.Next(neg.Hitbox.Width) + neg.Hitbox.X;
				var cy = rnd.Next(neg.Hitbox.Height) + neg.Hitbox.Y;
				var offset = Geometry.MapToScreen(cx, cy).Sub(s.Width / 2, s.Height);
				parts.Add(new SpritePart(s.Image, offset, s.Z, s.SubZ));
			}
			return new StaticSprite(parts);
		}
	}
}


text:
using System;
using System.Linq;

namespace TechTalk.SpecFlow.Parser.Gherkin
{
    public enum StepKeyword
    {
        Given = 1,
        When = 2,
        Then = 3,
        And = 4,
        But = 5
    }

    public enum ScenarioBlock
    {
        Given = 1,
        When = 2,
        Then = 3,
    }

    public interface IGherkinListener
    {
        void Init(GherkinBuffer buffer, bool isPartialScan);
        void Comment(string commentText, GherkinBufferSpan commentSpan);
        void Feature(string keyword, string name, string description, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan);
        void Background(string keyword, string name, string description, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan);
        void Examples(string keyword, string name, string description, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan);
        void Scenario(string keyword, string name, string description, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan);
        void ScenarioOutline(string keyword, string name, string description, GherkinBufferSpan headerSpan, GherkinBufferSpan descriptionSpan);
        void FeatureTag(string name, GherkinBufferSpan tagSpan);
        void ScenarioTag(string name, GherkinBufferSpan tagSpan);
        void ExamplesTag(string name, GherkinBufferSpan tagSpan);
        void Step(string keyword, StepKeyword stepKeyword, ScenarioBlock scenarioBlock, string text, GherkinBufferSpan stepSpan);
        void TableHeader(string[] cells, GherkinBufferSpan rowSpan, GherkinBufferSpan[] cellSpans);
        void TableRow(string[] cells, GherkinBufferSpan rowSpan, GherkinBufferSpan[] cellSpans);
        void MultilineText(string text, GherkinBufferSpan textSpan);
        void EOF(GherkinBufferPosition eofPosition);
        void Error(string message, GherkinBufferPosition errorPosition, Exception exception);
    }
}


text:
<?php

declare (strict_types=1);
namespace Rector\CodeQuality\Rector\Catch_;

use PhpParser\Node;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\Stmt\Catch_;
use PhpParser\Node\Stmt\Throw_;
use PhpParser\NodeTraverser;
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Type\ObjectType;
use PHPStan\Type\TypeWithClassName;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\ValueObject\MethodName;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
 * @changelog https://github.com/thecodingmachine/phpstan-strict-rules/blob/e3d746a61d38993ca2bc2e2fcda7012150de120c/src/Rules/Exceptions/ThrowMustBundlePreviousExceptionRule.php#L83
 * @see \Rector\Tests\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector\ThrowWithPreviousExceptionRectorTest
 */
final class ThrowWithPreviousExceptionRector extends \Rector\Core\Rector\AbstractRector
{
    /**
     * @var int
     */
    private const DEFAULT_EXCEPTION_ARGUMENT_POSITION = 2;
    /**
     * @var \PHPStan\Reflection\ReflectionProvider
     */
    private $reflectionProvider;
    public function __construct(\PHPStan\Reflection\ReflectionProvider $reflectionProvider)
    {
        $this->reflectionProvider = $reflectionProvider;
    }
    public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
    {
        return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('When throwing into a catch block, checks that the previous exception is passed to the new throw clause', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
class SomeClass
{
    public function run()
    {
        try {
            $someCode = 1;
        } catch (Throwable $throwable) {
            throw new AnotherException('ups');
        }
    }
}
CODE_SAMPLE
, <<<'CODE_SAMPLE'
class SomeClass
{
    public function run()
    {
        try {
            $someCode = 1;
        } catch (Throwable $throwable) {
            throw new AnotherException('ups', $throwable->getCode(), $throwable);
        }
    }
}
CODE_SAMPLE
)]);
    }
    /**
     * @return array<class-string<Node>>
     */
    public function getNodeTypes() : array
    {
        return [\PhpParser\Node\Stmt\Catch_::class];
    }
    /**
     * @param Catch_ $node
     */
    public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
    {
        $caughtThrowableVariable = $node->var;
        if (!$caughtThrowableVariable instanceof \PhpParser\Node\Expr\Variable) {
            return null;
        }
        $this->traverseNodesWithCallable($node->stmts, function (\PhpParser\Node $node) use($caughtThrowableVariable) : ?int {
            if (!$node instanceof \PhpParser\Node\Stmt\Throw_) {
                return null;
            }
            return $this->refactorThrow($node, $caughtThrowableVariable);
        });
        return $node;
    }
    private function refactorThrow(\PhpParser\Node\Stmt\Throw_ $throw, \PhpParser\Node\Expr\Variable $catchedThrowableVariable) : ?int
    {
        if (!$throw->expr instanceof \PhpParser\Node\Expr\New_) {
            return null;
        }
        $new = $throw->expr;
        if (!$new->class instanceof \PhpParser\Node\Name) {
            return null;
        }
        $exceptionArgumentPosition = $this->resolveExceptionArgumentPosition($new->class);
        if ($exceptionArgumentPosition === null) {
            return null;
        }
        // exception is bundled
        if (isset($new->args[$exceptionArgumentPosition])) {
            return null;
        }
        if (!isset($new->args[0])) {
            // get previous message
            $new->args[0] = new \PhpParser\Node\Arg(new \PhpParser\Node\Expr\MethodCall($catchedThrowableVariable, 'getMessage'));
        }
        if (!isset($new->args[1])) {
            // get previous code
            $new->args[1] = new \PhpParser\Node\Arg(new \PhpParser\Node\Expr\MethodCall($catchedThrowableVariable, 'getCode'));
        }
        $arg1 = $new->args[1];
        if ($arg1->name instanceof \PhpParser\Node\Identifier && $arg1->name->toString() === 'previous') {
            $new->args[1] = new \PhpParser\Node\Arg(new \PhpParser\Node\Expr\MethodCall($catchedThrowableVariable, 'getCode'));
            $new->args[$exceptionArgumentPosition] = $arg1;
        } else {
            $new->args[$exceptionArgumentPosition] = new \PhpParser\Node\Arg($catchedThrowableVariable);
        }
        // null the node, to fix broken format preserving printers, see https://github.com/rectorphp/rector/issues/5576
        $new->setAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::ORIGINAL_NODE, null);
        // nothing more to add
        return \PhpParser\NodeTraverser::DONT_TRAVERSE_CHILDREN;
    }
    private function resolveExceptionArgumentPosition(\PhpParser\Node\Name $exceptionName) : ?int
    {
        $className = $this->getName($exceptionName);
        // is native exception?
        if (\strpos($className, '\\') === \false) {
            return self::DEFAULT_EXCEPTION_ARGUMENT_POSITION;
        }
        if (!$this->reflectionProvider->hasClass($className)) {
            return self::DEFAULT_EXCEPTION_ARGUMENT_POSITION;
        }
        $classReflection = $this->reflectionProvider->getClass($className);
        $construct = $classReflection->hasMethod(\Rector\Core\ValueObject\MethodName::CONSTRUCT);
        if (!$construct) {
            return self::DEFAULT_EXCEPTION_ARGUMENT_POSITION;
        }
        $constructorReflectionMethod = $classReflection->getConstructor();
        $parametersAcceptor = $constructorReflectionMethod->getVariants()[0];
        foreach ($parametersAcceptor->getParameters() as $position => $parameterReflection) {
            $parameterType = $parameterReflection->getType();
            if (!$parameterType instanceof \PHPStan\Type\TypeWithClassName) {
                continue;
            }
            $objectType = new \PHPStan\Type\ObjectType('Throwable');
            if ($objectType->isSuperTypeOf($parameterType)->no()) {
                continue;
            }
            return $position;
        }
        return null;
    }
}


text:
define(function() {
  // missing use strict

  /**
   * The `fun` namespace contains a collection of utility functions.
   *
   * @name pentaho.util.fun
   * @namespace
   * @private
   * @amd pentaho/util/fun
   */
  return (function() {
    "use strict";

    return /** @lends pentaho.util.fun */{

      /**
       * Determine if the value passed is a `function`.
       *
       * @param {Object|Function|*} f Value to be tested.
       * @return {boolean} `true` if `f` is a function, `false` otherwise.
       */
      is: function(f) {
        return typeof f === "function";
      },

      /**
       * Converts a value to a function, if possible.
       *
       * @param {string|function|Nully} [f] Value to be converted.
       * @return {?function} A function or `null`.
       */
      as: asFun,

      /**
       * Creates a function that always returns the same value.
       *
       * @param {*} v Value to be return by the constant function.
       * @return {Function} Constant function.
       */
      constant: function(v) {
        return function() {
          return v;
        };
      },

      /**
       * Compares its two arguments for order.
       * Returns `-1`, `0`, or `1` as the first argument is less than, equal to, or greater than the second.
       *
       * @param {*} a First comparison value
       * @param {*} b Second comparison value
       * @return {number} The comparison value.
       */
      compare: function(a, b) {
        return (a === b) ? 0 : ((a > b) ? 1 : -1);
      },

      /**
       * Looks through each value in `attrs`, creating a list
       * that contains all the key-value pairs and use that list
       * to create a predicate function.
       *
       * When the created list is empty, will return `null`.
       *
       * @param {Object} [attrs] Attribute names and values to test for.
       * @return {?function} A predicate function, or `null`.
       */
      predicate: function(attrs) {
        var attrValues = [];

        if(attrs) Object.keys(attrs).forEach(function(name) {
          var value = attrs[name];
          if(value !== undefined) attrValues.push([name, value]);
        });

        return attrValues.length ? buildPredicate(attrValues) : null;
      }
    };
  })();

  /**
   * Auxiliary function of {@link pentaho.util.fun.predicate}
   *
   * @param {Array} attrValues Processed attribute names and values, as an array of arrays,
   * each with the name and the value to test for.
   * @return {function} The predicate function.
   */
  function buildPredicate(attrValues) {
    "use strict";

    return function instancePredicate(inst) {
      if(!inst) return false;

      var i = attrValues.length;
      var attrValue;
      while(i--) {
        attrValue = attrValues[i];
        if(inst[attrValue[0]] !== attrValue[1])
          return false;
      }
      return true;
    };
  }

  function asFun(f) {
    /* eslint no-eval: 0 */
    if(f) {
      if(typeof f === "string") f = eval("(" + f + ")");
      if(typeof f === "function") return f;
    }
    return null;
  }
});


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.Network.Models
{
    public partial class IpGroup : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            if (Etag != null)
            {
                writer.WritePropertyName("etag");
                writer.WriteStringValue(Etag);
            }
            if (Id != null)
            {
                writer.WritePropertyName("id");
                writer.WriteStringValue(Id);
            }
            if (Name != null)
            {
                writer.WritePropertyName("name");
                writer.WriteStringValue(Name);
            }
            if (Type != null)
            {
                writer.WritePropertyName("type");
                writer.WriteStringValue(Type);
            }
            if (Location != null)
            {
                writer.WritePropertyName("location");
                writer.WriteStringValue(Location);
            }
            if (Tags != null)
            {
                writer.WritePropertyName("tags");
                writer.WriteStartObject();
                foreach (var item in Tags)
                {
                    writer.WritePropertyName(item.Key);
                    writer.WriteStringValue(item.Value);
                }
                writer.WriteEndObject();
            }
            writer.WritePropertyName("properties");
            writer.WriteStartObject();
            if (ProvisioningState != null)
            {
                writer.WritePropertyName("provisioningState");
                writer.WriteStringValue(ProvisioningState.Value.ToString());
            }
            if (IpAddresses != null)
            {
                writer.WritePropertyName("ipAddresses");
                writer.WriteStartArray();
                foreach (var item in IpAddresses)
                {
                    writer.WriteStringValue(item);
                }
                writer.WriteEndArray();
            }
            if (Firewalls != null)
            {
                writer.WritePropertyName("firewalls");
                writer.WriteStartArray();
                foreach (var item in Firewalls)
                {
                    writer.WriteObjectValue(item);
                }
                writer.WriteEndArray();
            }
            writer.WriteEndObject();
            writer.WriteEndObject();
        }

        internal static IpGroup DeserializeIpGroup(JsonElement element)
        {
            string etag = default;
            string id = default;
            string name = default;
            string type = default;
            string location = default;
            IDictionary<string, string> tags = default;
            ProvisioningState? provisioningState = default;
            IList<string> ipAddresses = default;
            IList<SubResource> firewalls = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("etag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("ipAddresses"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List<string> array = new List<string>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(item.GetString());
                                }
                            }
                            ipAddresses = array;
                            continue;
                        }
                        if (property0.NameEquals("firewalls"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List<SubResource> array = new List<SubResource>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(SubResource.DeserializeSubResource(item));
                                }
                            }
                            firewalls = array;
                            continue;
                        }
                    }
                    continue;
                }
            }
            return new IpGroup(id, name, type, location, tags, etag, provisioningState, ipAddresses, firewalls);
        }
    }
}


text:
layout: post
date: 2018-03-17
title: "Blush Prom Style 11085 Sleeveless Aline/Princess"
category: Blush
tags: [Blush,Aline/Princess ,Jewel,Sleeveless]
---
### Blush Prom Style 11085
Just **$399.99**
###   Sleeveless  Aline/Princess

BRANDS	Blush

Silhouette	Aline/Princess

Neckline	Jewel

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/blush/49158-blush-prom-style-11085.html](https://www.readybrides.com/en/blush/49158-blush-prom-style-11085.html)


text:
require_relative 'scrapper'
require_relative 'website2_utils'

class Website2Scrapper < Scrapper
  include Website2Utils

  def do_scrap
    excluded_urls = YAML.load_file('private-conf/websites.yml')["website2"]["excluded_urls"]
    scrap_allowed_links(excluded_urls)
  end

  def allowed_links(excluded_urls)
    @current_page.links.map {|link| link if link.text.present? && !excluded_urls.any? {|s| link.href.include?(s)} && link.href.size>1}.compact
  end

  def scrap_allowed_links(excluded_urls)
    allowed_links(excluded_urls).each do |link|
      post_name = link.text
      post = Post.create(id, post_name)
      return if post.banished

      @post_id = post.id

      pp "Scrap : #{post.name}"
      page = link.click
      scrap_page(page)
    end
  end
end


text:
package mediatype

import (
	"testing"

	"github.com/stretchr/testify/assert"
	"golang.org/x/text/encoding/unicode"
)

func TestMediatypeErrorForInvalidTypes(t *testing.T) {
	_, err := NewOfString("application")
	assert.Error(t, err, "parser should return error because mediatype doesn't have 2 components")
	_, err = NewOfString("application/atom+xml/extra")
	assert.Error(t, err, "parser should return error because mediatype doesn't have 2 components")
}

func TestMediatypeToString(t *testing.T) {
	mt, err := NewOfString("application/atom+xml;profile=opds-catalog")
	assert.NoError(t, err)
	// Note there is a space between the mediatype semicolon and params. This is the behavior
	// of Go's mime formatter, and differs from the Kotlin implementation
	assert.Equal(t, "application/atom+xml; profile=opds-catalog", mt.String(), "mediatype should render to this string")
}

func TestMediatypeToStringIsNormalized(t *testing.T) {
	mt, err := NewOfString("APPLICATION/ATOM+XML;PROFILE=OPDS-CATALOG   ;   a=0")
	assert.NoError(t, err)
	assert.Equal(t, "application/atom+xml; a=0; profile=OPDS-CATALOG", mt.String(), "mediatype should have the correct final casing")

	mt, err = NewOfString("application/atom+xml;a=0;b=1")
	assert.NoError(t, err)
	assert.Equal(t, "application/atom+xml; a=0; b=1", mt.String(), "mediatype should output as it was input")

	mt, err = NewOfString("application/atom+xml;b=1;a=0")
	assert.NoError(t, err)
	assert.Equal(t, "application/atom+xml; a=0; b=1", mt.String(), "mediatype should have alphabetically sorted parameters")
}

func TestMediatypeGetType(t *testing.T) {
	mt, err := NewOfString("application/atom+xml;profile=opds-catalog")
	assert.NoError(t, err)
	assert.Equal(t, "application", mt.Type, "mediatype type should be equal to \"application\"")

	mt, err = NewOfString("*/jpeg")
	assert.NoError(t, err)
	assert.Equal(t, "*", mt.Type, "mediatype type should be equal to \"*\"")
}

func TestMediatypeGetSubtype(t *testing.T) {
	mt, err := NewOfString("application/atom+xml;profile=opds-catalog")
	assert.NoError(t, err)
	assert.Equal(t, "atom+xml", mt.SubType, "mediatype subtype should be equal to \"atom+xml\"")

	mt, err = NewOfString("image/*")
	assert.NoError(t, err)
	assert.Equal(t, "*", mt.SubType, "mediatype subtype should be equal to \"*\"")
}

func TestMediatypeGetParameters(t *testing.T) {
	mt, err := NewOfString("application/atom+xml;type=entry;profile=opds-catalog")
	assert.NoError(t, err)
	assert.Equal(t, map[string]string{"type": "entry", "profile": "opds-catalog"}, mt.Parameters, "mediatype parameters should match the given map")
}

func TestMediatypeGetEmptyParameters(t *testing.T) {
	mt, err := NewOfString("application/atom+xml")
	assert.NoError(t, err)
	assert.True(t, len(mt.Parameters) == 0, "mediatype should have no parameters in its map")
}

func TestMediatypeGetParametersWithWhitespaces(t *testing.T) {
	mt, err := NewOfString("application/atom+xml    ;    type=entry   ;    profile=opds-catalog   ")
	assert.NoError(t, err)
	assert.Equal(t, map[string]string{"type": "entry", "profile": "opds-catalog"}, mt.Parameters, "mediatype parameters should match the given map")
}

func TestMediatypeGetStructuredSyntaxSuffix(t *testing.T) {
	mt, err := NewOfString("foo/bar")
	assert.NoError(t, err)
	assert.Empty(t, mt.StructuredSyntaxSuffix(), "mediatype should have no structured syntax suffix")

	mt, err = NewOfString("application/zip")
	assert.NoError(t, err)
	assert.Empty(t, mt.StructuredSyntaxSuffix(), "mediatype should have no structured syntax suffix")

	mt, err = NewOfString("application/epub+zip")
	assert.NoError(t, err)
	assert.Equal(t, "+zip", mt.StructuredSyntaxSuffix(), "structured syntax suffix should be \"+zip\"")

	mt, err = NewOfString("foo/bar+json+zip")
	assert.NoError(t, err)
	assert.Equal(t, "+zip", mt.StructuredSyntaxSuffix(), "structured syntax suffix should be \"+zip\"")
}

func TestMediatypeGetCharset(t *testing.T) {
	mt, err := NewOfString("text/html")
	assert.NoError(t, err)
	assert.Nil(t, mt.Charset(), "mediatype should have no charset")

	mt, err = NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	assert.Equal(t, unicode.UTF8, mt.Charset(), "charset should be utf-8")

	mt, err = NewOfString("text/html;charset=utf-16")
	assert.NoError(t, err)
	assert.Equal(t, unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM), mt.Charset(), "charset should be utf-16 le (ignore bom)")
}

func TestMediatypeAllLowercased(t *testing.T) {
	mt, err := NewOfString("APPLICATION/ATOM+XML;PROFILE=OPDS-CATALOG")
	assert.NoError(t, err)
	assert.Equal(t, "application", mt.Type, "type should be lowercased")
	assert.Equal(t, "atom+xml", mt.SubType, "subtype should be lowercased")
	assert.Equal(t, map[string]string{"profile": "OPDS-CATALOG"}, mt.Parameters, "parameter keys should be lowercased")
}

func TestMediatypeChartsetValueIsUppercased(t *testing.T) {
	mt, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	assert.Equal(t, "UTF-8", mt.Parameters["charset"], "charset value should be uppercased")
}

func TestMediatypeCharsetValueCanonicalized(t *testing.T) {
	mt, err := NewOfString("text/html;charset=ascii")
	assert.NoError(t, err)
	assert.Equal(t, "WINDOWS-1252", mt.Parameters["charset"], "charset should be WINDOWS-1252, the ascii equivalent")

	mt, err = NewOfString("text/html;charset=unknown")
	assert.NoError(t, err)
	assert.Equal(t, "UNKNOWN", mt.Parameters["charset"], "charset should be unknown")
}

func TestMediatypeCanonicalize(t *testing.T) {
	mt1, err := New("text/html", "", "html")
	assert.NoError(t, err)
	mt2, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	assert.Equal(t, &mt1, mt2.CanonicalMediaType())

	mt1, err = NewOfString("application/atom+xml;profile=opds-catalog")
	assert.NoError(t, err)
	mt2, err = NewOfString("application/atom+xml;profile=opds-catalog;charset=utf-8")
	assert.NoError(t, err)
	assert.Equal(t, &mt1, mt2.CanonicalMediaType())

	mt1, err = NewOfString("application/unknown;charset=utf-8")
	assert.NoError(t, err)
	mt2, err = NewOfString("application/unknown;charset=utf-8")
	assert.NoError(t, err)
	assert.Equal(t, &mt1, mt2.CanonicalMediaType())
}

func TestMediatypeEquality(t *testing.T) {
	mt1, err := NewOfString("application/atom+xml")
	assert.NoError(t, err)
	mt2, err := NewOfString("application/atom+xml")
	assert.NoError(t, err)
	assert.Equal(t, mt1, mt2)

	mt1, err = NewOfString("application/atom+xml;profile=opds-catalog")
	assert.NoError(t, err)
	mt2, err = NewOfString("application/atom+xml;profile=opds-catalog")
	assert.NoError(t, err)
	assert.Equal(t, mt1, mt2)

	mt1, err = NewOfString("application/atom+xml")
	assert.NoError(t, err)
	mt2, err = NewOfString("application/atom")
	assert.NoError(t, err)
	assert.NotEqual(t, mt1, mt2)

	mt1, err = NewOfString("application/atom+xml")
	assert.NoError(t, err)
	mt2, err = NewOfString("text/atom+xml")
	assert.NoError(t, err)
	assert.NotEqual(t, mt1, mt2)

	mt1, err = NewOfString("application/atom+xml;profile=opds-catalog")
	assert.NoError(t, err)
	mt2, err = NewOfString("application/atom+xml")
	assert.NoError(t, err)
	assert.NotEqual(t, mt1, mt2)
}

// More specifically, equality ignores case of type, subtype and parameter names (but not parameter values!)
func TestMediatypeEqualityIgnoresCases(t *testing.T) {
	mt1, err := NewOfString("application/atom+xml;profile=opds-catalog")
	assert.NoError(t, err)
	mt2, err := NewOfString("APPLICATION/ATOM+XML;PROFILE=opds-catalog")
	assert.NoError(t, err)
	assert.Equal(t, mt1, mt2)

	mt1, err = NewOfString("application/atom+xml;profile=opds-catalog")
	assert.NoError(t, err)
	mt2, err = NewOfString("APPLICATION/ATOM+XML;PROFILE=OPDS-CATALOG")
	assert.NoError(t, err)
	assert.NotEqual(t, mt1, mt2)
}

func TestMediatypeEqualityIgnoresParameterOrder(t *testing.T) {
	mt1, err := NewOfString("application/atom+xml;type=entry;profile=opds-catalog")
	assert.NoError(t, err)
	mt2, err := NewOfString("application/atom+xml;profile=opds-catalog;type=entry")
	assert.NoError(t, err)
	assert.Equal(t, mt1, mt2)
}

func TestMediatypeEqualityIgnoresCharsetCase(t *testing.T) {
	mt1, err := NewOfString("application/atom+xml;charset=utf-8")
	assert.NoError(t, err)
	mt2, err := NewOfString("application/atom+xml;charset=UTF-8")
	assert.NoError(t, err)
	assert.Equal(t, mt1, mt2, "charset parameter should be case-insensitive")
}

func TestMediatypeContainsEqual(t *testing.T) {
	mt1, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	mt2, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt1.Contains(&mt2))
}

func TestMediatypeContainsParametersMatching(t *testing.T) {
	mt1, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	mt2, err := NewOfString("text/html;charset=ascii")
	assert.NoError(t, err)
	assert.False(t, mt1.Contains(&mt2), "mediatypes with different charsets should not be equal")

	mt2, err = NewOfString("text/html")
	assert.NoError(t, err)
	assert.False(t, mt1.Contains(&mt2), "mediatype with/without charset should not be interchangeable")
}

func TestMediatypeContainsIgnoresParameterOrder(t *testing.T) {
	mt1, err := NewOfString("text/html;charset=utf-8;type=entry")
	assert.NoError(t, err)
	mt2, err := NewOfString("text/html;type=entry;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt1.Contains(&mt2), "mediatypes should ignore parameter order")
}

func TestMediatypeContainsIgnoresExtraParameters(t *testing.T) {
	mt1, err := NewOfString("text/html")
	assert.NoError(t, err)
	mt2, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt1.Contains(&mt2), "mediatype contains should ignore extra parameters")
}

func TestMediatypeContainsSupportsWildcards(t *testing.T) {
	mt1, err := NewOfString("*/*")
	assert.NoError(t, err)
	mt2, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt1.Contains(&mt2), "wildcards should contain anything")

	mt1, err = NewOfString("text/*")
	assert.NoError(t, err)
	assert.True(t, mt1.Contains(&mt2), "text/* should contain text/html")

	mt2, err = NewOfString("application/zip")
	assert.NoError(t, err)
	assert.False(t, mt1.Contains(&mt2))
}

func TestMediatypeContainsFromString(t *testing.T) {
	mt, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt.ContainsFromString("text/html;charset=utf-8"))
}

func TestMediatypeMatchesEqual(t *testing.T) {
	mt1, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	mt2, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt1.Matches(&mt2), "two identical mediatypes should match")
}

func TestMediatypeMatchesParametersMatching(t *testing.T) {
	mt1, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	mt2, err := NewOfString("text/html;charset=ascii")
	assert.NoError(t, err)
	assert.False(t, mt1.Matches(&mt2), "mediatypes with different charsets should not match")
}

func TestMediatypeMatchesIgnoresParameterOrder(t *testing.T) {
	mt1, err := NewOfString("text/html;charset=utf-8;type=entry")
	assert.NoError(t, err)
	mt2, err := NewOfString("text/html;type=entry;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt1.Matches(&mt2), "mediatype matches should ignore parameter order")
}

func TestMediatypeMatchesIgnoresExtraParameters(t *testing.T) {
	mt1, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	mt2, err := NewOfString("text/html;charset=utf-8;extra=param")
	assert.NoError(t, err)
	assert.True(t, mt1.Matches(&mt2), "mediatype matches should ignore extra parameters")
	assert.True(t, mt2.Matches(&mt1), "mediatype matches should ignore extra parameters")
}

func TestMediatypeMatchesSupportsWildcards(t *testing.T) {
	mt1, err := NewOfString("*/*")
	assert.NoError(t, err)
	mt2, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt2.Matches(&mt1), "anything should match with a wildcard mediatype")
	assert.True(t, mt1.Matches(&mt2), "anything should match with a wildcard mediatype")

	mt1, err = NewOfString("text/*")
	assert.NoError(t, err)
	assert.True(t, mt2.Matches(&mt1), "text/html should match text/*")
	assert.True(t, mt1.Matches(&mt2), "text/html should match text/*")

	mt2, err = NewOfString("application/zip")
	assert.NoError(t, err)
	assert.False(t, mt2.Matches(&mt1))
	assert.False(t, mt1.Matches(&mt2))
}

func TestMediatypeMatchesFromString(t *testing.T) {
	mt, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt.MatchesFromString("text/html;charset=utf-8"))
}

func TestMediatypeMatchesAny(t *testing.T) {
	mt1, err := NewOfString("text/html")
	assert.NoError(t, err)
	mt2, err := NewOfString("application/zip")
	assert.NoError(t, err)
	mt3, err := NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	mt4, err := NewOfString("text/plain;charset=utf-8")
	assert.NoError(t, err)

	assert.True(t, mt1.Matches(&mt2, &mt3))
	assert.False(t, mt1.Matches(&mt2, &mt4))
	assert.True(t, mt1.MatchesFromString("application/zip", "text/html;charset=utf-8"))
	assert.False(t, mt1.MatchesFromString("application/zip", "text/plain;charset=utf-8"))
}

func TestMediatypeIsZIP(t *testing.T) {
	mt, err := NewOfString("text/plain")
	assert.NoError(t, err)
	assert.False(t, mt.IsZIP())

	mt, err = NewOfString("application/zip")
	assert.NoError(t, err)
	assert.True(t, mt.IsZIP())

	mt, err = NewOfString("application/zip;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt.IsZIP())

	mt, err = NewOfString("application/epub+zip")
	assert.NoError(t, err)
	assert.True(t, mt.IsZIP(), "EPUBs are ZIPs")

	// These media types must be explicitly matched since they don't have any ZIP hint

	mt, err = NewOfString("application/audiobook+lcp")
	assert.NoError(t, err)
	assert.True(t, mt.IsZIP())

	mt, err = NewOfString("application/pdf+lcp")
	assert.NoError(t, err)
	assert.True(t, mt.IsZIP())
}

func TestMediatypeIsJSON(t *testing.T) {
	mt, err := NewOfString("text/plain")
	assert.NoError(t, err)
	assert.False(t, mt.IsJSON())

	mt, err = NewOfString("application/json")
	assert.NoError(t, err)
	assert.True(t, mt.IsJSON())

	mt, err = NewOfString("application/json;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt.IsJSON())

	mt, err = NewOfString("application/opds+json")
	assert.NoError(t, err)
	assert.True(t, mt.IsJSON())
}

func TestMediatypeIsOPDS(t *testing.T) {
	mt, err := NewOfString("text/html")
	assert.NoError(t, err)
	assert.False(t, mt.IsOPDS())

	for _, r := range []string{
		"application/atom+xml;profile=opds-catalog",
		"application/atom+xml;type=entry;profile=opds-catalog",
		"application/opds+json",
		"application/opds-publication+json",
		"application/opds+json;charset=utf-8",
		"application/opds-authentication+json",
	} {
		mt, err = NewOfString(r)
		assert.NoError(t, err)
		assert.True(t, mt.IsOPDS(), r+" should be an OPDS document")
	}
}

func TestMediatypeIsHTML(t *testing.T) {
	mt, err := NewOfString("application/opds+json")
	assert.NoError(t, err)
	assert.False(t, mt.IsHTML())

	mt, err = NewOfString("text/html")
	assert.NoError(t, err)
	assert.True(t, mt.IsHTML())

	mt, err = NewOfString("application/xhtml+xml")
	assert.NoError(t, err)
	assert.True(t, mt.IsHTML())

	mt, err = NewOfString("text/html;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt.IsHTML())
}

func TestMediatypeIsBitmap(t *testing.T) {
	mt, err := NewOfString("text/html")
	assert.NoError(t, err)
	assert.False(t, mt.IsBitmap())

	for _, r := range []string{
		"image/bmp",
		"image/gif",
		"image/jpeg",
		"image/png",
		"image/tiff",
		"image/tiff;charset=utf-8",
		"image/webp",
		"image/avif",
		"image/jxl",
	} {
		mt, err = NewOfString(r)
		assert.NoError(t, err)
		assert.True(t, mt.IsBitmap(), r+" should be a bitmap")
	}
}

func TestMediatypeIsAudio(t *testing.T) {
	mt, err := NewOfString("text/html")
	assert.NoError(t, err)
	assert.False(t, mt.IsAudio())

	mt, err = NewOfString("audio/unknown")
	assert.NoError(t, err)
	assert.True(t, mt.IsAudio())

	mt, err = NewOfString("audio/mpeg;param=value")
	assert.NoError(t, err)
	assert.True(t, mt.IsAudio())
}

func TestMediatypeIsVideo(t *testing.T) {
	mt, err := NewOfString("text/html")
	assert.NoError(t, err)
	assert.False(t, mt.IsVideo())

	mt, err = NewOfString("video/unknown")
	assert.NoError(t, err)
	assert.True(t, mt.IsVideo())

	mt, err = NewOfString("video/mpeg;param=value")
	assert.NoError(t, err)
	assert.True(t, mt.IsVideo())
}

func TestMediatypeIsRWPM(t *testing.T) {
	mt, err := NewOfString("text/html")
	assert.NoError(t, err)
	assert.False(t, mt.IsRwpm())

	mt, err = NewOfString("application/audiobook+json")
	assert.NoError(t, err)
	assert.True(t, mt.IsRwpm())

	mt, err = NewOfString("application/divina+json")
	assert.NoError(t, err)
	assert.True(t, mt.IsRwpm())

	mt, err = NewOfString("application/webpub+json")
	assert.NoError(t, err)
	assert.True(t, mt.IsRwpm())

	mt, err = NewOfString("application/webpub+json;charset=utf-8")
	assert.NoError(t, err)
	assert.True(t, mt.IsRwpm())
}

func TestMediatypeIsPublication(t *testing.T) {
	mt, err := NewOfString("text/html")
	assert.NoError(t, err)
	assert.False(t, mt.IsPublication())

	for _, r := range []string{
		"application/audiobook+zip",
		"application/audiobook+json",
		"application/audiobook+lcp",
		"application/audiobook+json;charset=utf-8",
		"application/divina+zip",
		"application/divina+json",
		"application/webpub+zip",
		"application/webpub+json",
		"application/vnd.comicbook+zip",
		"application/epub+zip",
		"application/lpf+zip",
		"application/pdf",
		"application/pdf+lcp",
		"application/x.readium.w3c.wpub+json",
		"application/x.readium.zab+zip",
	} {
		mt, err = NewOfString(r)
		assert.NoError(t, err)
		assert.True(t, mt.IsPublication(), r+" should be a publication")
	}
}


text:
package com.hujiang.restvolley.webapi.request;

import android.content.Context;

import com.android.volley.Request;

/**
 * Get method request.
 *
 * @author simon
 * @version 1.0.0
 * @since 2015-11-24
 */
public class GetRequest extends RestVolleyRequestWithNoBody<GetRequest> {
    /**
     * constructor.
     * @param context {@link Context}
     */
    public GetRequest(Context context) {
        super(context, Request.Method.GET);
    }
}


text:
-----------------------------------------------------------------------------
-- |
-- Module      :  Tokenise
-- Copyright   :  2004 Malcolm Wallace
-- Licence     :  LGPL
--
-- Maintainer  :  Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk>
-- Stability   :  experimental
-- Portability :  All
--
-- The purpose of this module is to lex a source file (language
-- unspecified) into tokens such that cpp can recognise a replaceable
-- symbol or macro-use, and do the right thing.
-----------------------------------------------------------------------------

module Language.Preprocessor.Cpphs.Tokenise
  ( linesCpp
  , reslash
  , tokenise
  , WordStyle(..)
  , deWordStyle
  , parseMacroCall
  ) where

import Char
import Language.Preprocessor.Cpphs.HashDefine
import Language.Preprocessor.Cpphs.Position

-- | A Mode value describes whether to tokenise a la Haskell, or a la Cpp.
--   The main difference is that in Cpp mode we should recognise line
--   continuation characters.
data Mode = Haskell | Cpp

-- | linesCpp is, broadly speaking, Prelude.lines, except that
--   on a line beginning with a \#, line continuation characters are
--   recognised.  In a line continuation, the newline character is
--   preserved, but the backslash is not.
linesCpp :: String -> [String]
linesCpp  []                 = []
linesCpp (x:xs) | x=='#'     = tok Cpp     ['#'] xs
                | otherwise  = tok Haskell [] (x:xs)
  where
    tok Cpp   acc ('\\':'\n':ys)   = tok Cpp ('\n':acc) ys
    tok _     acc ('\n':'#':ys)    = reverse acc: tok Cpp ['#'] ys
    tok _     acc ('\n':ys)        = reverse acc: tok Haskell [] ys
    tok _     acc []               = reverse acc: []
    tok mode  acc (y:ys)           = tok mode (y:acc) ys

-- | Put back the line-continuation characters.
reslash :: String -> String
reslash ('\n':xs) = '\\':'\n':reslash xs
reslash (x:xs)    = x: reslash xs
reslash   []      = []

----
-- | Submodes are required to deal correctly with nesting of lexical
--   structures.
data SubMode = Any | Pred (Char->Bool) (Posn->String->WordStyle)
             | String Char | LineComment | NestComment Int
             | CComment

-- | Each token is classified as one of Ident, Other, or Cmd:
--   * Ident is a word that could potentially match a macro name.
--   * Cmd is a complete cpp directive (\#define etc).
--   * Other is anything else.
data WordStyle = Ident Posn String | Other String | Cmd (Maybe HashDefine)
  deriving (Eq,Show)
other _ s = Other s

deWordStyle :: WordStyle -> String
deWordStyle (Ident _ i) = i
deWordStyle (Other i)   = i
deWordStyle (Cmd _)     = "\n"

-- | tokenise is, broadly-speaking, Prelude.words, except that:
--    * the input is already divided into lines
--    * each word-like "token" is categorised as one of {Ident,Other,Cmd}
--    * \#define's are parsed and returned out-of-band using the Cmd variant
--    * All whitespace is preserved intact as tokens.
--    * C-comments are converted to white-space (depending on first param)
--    * Parens and commas are tokens in their own right.
--    * Any cpp line continuations are respected.
--   No errors can be raised.
--   The inverse of tokenise is (concatMap deWordStyle).
tokenise :: Bool -> Bool -> Bool -> [(Posn,String)] -> [WordStyle]
tokenise _     _    _     [] = []
tokenise strip ansi lang ((pos,str):pos_strs) =
    (if lang then haskell else plaintext) Any [] pos pos_strs str
 where
    -- rules to lex Haskell
  haskell :: SubMode -> String -> Posn -> [(Posn,String)]
             -> String -> [WordStyle]
  haskell Any acc p ls ('\n':'#':xs)      = emit acc $  -- emit "\n" $
                                            cpp Any haskell [] [] p ls xs
    -- warning: non-maximal munch on comment
  haskell Any acc p ls ('-':'-':xs)       = emit acc $
                                            haskell LineComment "--" p ls xs
  haskell Any acc p ls ('{':'-':xs)       = emit acc $
                                            haskell (NestComment 0) "-{" p ls xs
  haskell Any acc p ls ('/':'*':xs)|strip = emit acc $
                                            haskell CComment "  " p ls xs
  haskell Any acc p ls ('"':xs)           = emit acc $
                                            haskell (String '"') ['"'] p ls xs
  haskell Any acc p ls ('\'':xs)          = emit acc $
                                            haskell (String '\'') "'" p ls xs
  haskell Any acc p ls (x:xs) | single x  = emit acc $ emit [x] $
                                            haskell Any [] p ls xs
  haskell Any acc p ls (x:xs) | space x   = emit acc $
                                            haskell (Pred space other) [x]
                                                                        p ls xs
  haskell Any acc p ls (x:xs) | symbol x  = emit acc $
                                            haskell (Pred symbol other) [x]
                                                                        p ls xs
 -- haskell Any [] p ls (x:xs) | ident0 x  = id $
  haskell Any acc p ls (x:xs) | ident0 x  = emit acc $
                                            haskell (Pred ident1 Ident) [x]
                                                                        p ls xs
  haskell Any acc p ls (x:xs)             = haskell Any (x:acc) p ls xs

  haskell pre@(Pred pred ws) acc p ls (x:xs)
                        | pred x    = haskell pre (x:acc) p ls xs
                        | otherwise = ws p (reverse acc):
                                      haskell Any [] p ls (x:xs)
  haskell (Pred _ ws) acc p [] []   = ws p (reverse acc): []
  haskell (String c) acc p ls ('\\':x:xs)
                        | x=='\\'   = haskell (String c) ('\\':'\\':acc) p ls xs
                        | x==c      = haskell (String c) (c:'\\':acc) p ls xs
  haskell (String c) acc p ls (x:xs)
                        | x==c      = emit (c:acc) $ haskell Any [] p ls xs
                        | otherwise = haskell (String c) (x:acc) p ls xs
  haskell LineComment acc p ls xs@('\n':_) = emit acc $ haskell Any [] p ls xs
  haskell LineComment acc p ls (x:xs)      = haskell LineComment (x:acc) p ls xs
  haskell (NestComment n) acc p ls ('{':'-':xs)
                                    = haskell (NestComment (n+1))
                                                            ("-{"++acc) p ls xs
  haskell (NestComment 0) acc p ls ('-':'}':xs)
                                    = emit ("}-"++acc) $ haskell Any [] p ls xs
  haskell (NestComment n) acc p ls ('-':'}':xs)
                                    = haskell (NestComment (n-1))
                                                            ("}-"++acc) p ls xs
  haskell (NestComment n) acc p ls (x:xs) = haskell (NestComment n) (x:acc)
                                                                        p ls xs
  haskell CComment acc p ls ('*':'/':xs)  = emit ("  "++acc) $
                                            haskell Any [] p ls xs
  haskell CComment acc p ls (_:xs)        = haskell CComment (' ':acc) p ls xs
  haskell mode acc _ ((p,l):ls) []        = haskell mode acc p ls ('\n':l)
  haskell _    acc _ [] []                = emit acc $ []

  -- rules to lex Cpp
  cpp :: SubMode -> (SubMode -> String -> Posn -> [(Posn,String)]
                     -> String -> [WordStyle])
         -> String -> [String] -> Posn -> [(Posn,String)]
         -> String -> [WordStyle]
  cpp mode next word line pos remaining input =
    lexcpp mode word line remaining input
   where
    lexcpp Any w l ls ('/':'*':xs)   = lexcpp (NestComment 0) "" (w*/*l) ls xs
    lexcpp Any w l ls ('/':'/':xs)   = lexcpp LineComment "  " (w*/*l) ls xs
    lexcpp Any w l ((p,l'):ls) ('\\':[])  = cpp Any next [] ("\n":w*/*l) p ls l'
    lexcpp Any w l ls ('\\':'\n':xs) = lexcpp Any [] ("\n":w*/*l) ls xs
    lexcpp Any w l ls xs@('\n':_)    = Cmd (parseHashDefine ansi
                                                           (reverse (w*/*l))):
                                       next Any [] pos ls xs
 -- lexcpp Any w l ls ('"':xs)     = lexcpp (String '"') ['"'] (w*/*l) ls xs
 -- lexcpp Any w l ls ('\'':xs)    = lexcpp (String '\'') "'"  (w*/*l) ls xs
    lexcpp Any w l ls ('"':xs)       = lexcpp Any [] ("\"":(w*/*l)) ls xs
    lexcpp Any w l ls ('\'':xs)      = lexcpp Any [] ("'": (w*/*l)) ls xs
    lexcpp Any [] l ls (x:xs)
                    | ident0 x  = lexcpp (Pred ident1 Ident) [x] l ls xs
 -- lexcpp Any w l ls (x:xs) | ident0 x  = lexcpp (Pred ident1 Ident) [x] (w*/*l) ls xs
    lexcpp Any w l ls (x:xs)
                    | single x  = lexcpp Any [] ([x]:w*/*l) ls xs
                    | space x   = lexcpp (Pred space other) [x] (w*/*l) ls xs
                    | symbol x  = lexcpp (Pred symbol other) [x] (w*/*l) ls xs
                    | otherwise = lexcpp Any (x:w) l ls xs
    lexcpp pre@(Pred pred _) w l ls (x:xs)
                    | pred x    = lexcpp pre (x:w) l ls xs
                    | otherwise = lexcpp Any [] (w*/*l) ls (x:xs)
    lexcpp      (Pred _ _) w l [] []      = lexcpp Any [] (w*/*l) [] "\n"
    lexcpp (String c) w l ls ('\\':x:xs)
                    | x=='\\'   = lexcpp (String c) ('\\':'\\':w) l ls xs
                    | x==c      = lexcpp (String c) (c:'\\':w) l ls xs
    lexcpp (String c) w l ls (x:xs)
                    | x==c      = lexcpp Any [] ((c:w)*/*l) ls xs
                    | otherwise = lexcpp (String c) (x:w) l ls xs
    lexcpp LineComment w l ((p,l'):ls) ('\\':[])
                             = cpp LineComment next [] (('\n':w)*/*l) pos ls l'
    lexcpp LineComment w l ls ('\\':'\n':xs)
                                = lexcpp LineComment [] (('\n':w)*/*l) ls xs
    lexcpp LineComment w l ls xs@('\n':_) = lexcpp Any w l ls xs
    lexcpp LineComment w l ls (_:xs)      = lexcpp LineComment (' ':w) l ls xs
    lexcpp (NestComment _) w l ls ('*':'/':xs)
                                          = lexcpp Any [] (w*/*l) ls xs
    lexcpp (NestComment n) w l ls (_:xs)  = lexcpp (NestComment n) (' ':w) l
                                                                        ls xs
    lexcpp mode w l ((p,l'):ls) []        = cpp mode next w l pos ls ('\n':l')
    lexcpp _    _ _ []          []        = []

    -- rules to lex non-Haskell, non-cpp text
  plaintext :: SubMode -> String -> Posn -> [(Posn,String)]
            -> String -> [WordStyle]
  plaintext Any acc p ls ('\n':'#':xs)  = emit acc $  -- emit "\n" $
                                          cpp Any plaintext [] [] p ls xs
  plaintext Any acc p ls ('/':'*':xs)|strip = emit acc $
                                              plaintext CComment "  " p ls xs
  plaintext Any acc p ls (x:xs) | single x  = emit acc $ emit [x] $
                                              plaintext Any [] p ls xs
  plaintext Any acc p ls (x:xs) | space x   = emit acc $
                                              plaintext (Pred space other) [x]
                                                                        p ls xs
  plaintext Any acc p ls (x:xs) | ident0 x  = emit acc $
                                              plaintext (Pred ident1 Ident) [x]
                                                                        p ls xs
  plaintext Any acc p ls (x:xs)             = plaintext Any (x:acc) p ls xs
  plaintext pre@(Pred pred ws) acc p ls (x:xs)
                                | pred x    = plaintext pre (x:acc) p ls xs
                                | otherwise = ws p (reverse acc):
                                              plaintext Any [] p ls (x:xs)
  plaintext (Pred _ ws) acc p [] []         = ws p (reverse acc): []
  plaintext CComment acc p ls ('*':'/':xs)  = emit ("  "++acc) $
                                              plaintext Any [] p ls xs
  plaintext CComment acc p ls (_:xs)    = plaintext CComment (' ':acc) p ls xs
  plaintext mode acc _ ((p,l):ls) []    = plaintext mode acc p ls ('\n':l)
  plaintext _    acc _ [] []            = emit acc $ []

  -- predicates for lexing Haskell.
  ident0 x = isAlpha x    || x `elem` "_`"
  ident1 x = isAlphaNum x || x `elem` "'_`"
  symbol x = x `elem` ":!#$%&*+./<=>?@\\^|-~"
  single x = x `elem` "(),[];{}"
  space  x = x `elem` " \t"
  -- emit a token (if there is one) from the accumulator
  emit ""  = id
  emit xs  = (Other (reverse xs):)
  -- add a reversed word to the accumulator
  "" */* l = l
  w */* l  = reverse w : l

-- | Parse a possible macro call, returning argument list and remaining input
parseMacroCall :: [WordStyle] -> Maybe ([String],[WordStyle])
parseMacroCall = call . skip
  where
    skip (Other x:xs) | all isSpace x = skip xs
    skip xss                          = xss
    call (Other "(":xs)   = (args (0::Int) [] [] . skip) xs
    call _                = Nothing
    args 0 w acc (Other ",":xs)   = args 0 [] (addone w acc) (skip xs)
    args n w acc (Other "(":xs)   = args (n+1) ("(":w) acc xs
    args 0 w acc (Other ")":xs)   = Just (reverse (addone w acc), xs)
    args n w acc (Other ")":xs)   = args (n-1) (")":w) acc xs
    args n w acc (Ident _ var:xs) = args n (var:w) acc xs
    args n w acc (Other var:xs)   = args n (var:w) acc xs
    args _ _ _   _                = Nothing
    addone w acc = concat (reverse (dropWhile (all isSpace) w)): acc