text:
/**
 */
package gluemodel.substationStandard.LNNodes.LNGroupX;

import gluemodel.substationStandard.Enumerations.SwitchTypeKind;
import gluemodel.substationStandard.Enumerations.SwitchingCapabilityKind;

import gluemodel.substationStandard.LNNodes.LNGroupC.CSWI;

/**
 *
 * A representation of the model object 'XSWI'.
 *
 *
 *

 * The following features are supported:
 *

 *

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupX.XSWI#getSwOpCap Sw Op Cap}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupX.XSWI#getMaxOpCap Max Op Cap}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupX.XSWI#getSwTyp Sw Typ}

 *
{@link gluemodel.substationStandard.LNNodes.LNGroupX.XSWI#getSwitchControl Switch Control}

 *

 *
 * @see gluemodel.substationStandard.LNNodes.LNGroupX.LNGroupXPackage#getXSWI()
 * @model
 * @generated
 */
public interface XSWI extends GroupX {
	/**
	 * Returns the value of the 'Sw Op Cap' attribute.
	 * The literals are from the enumeration {@link gluemodel.substationStandard.Enumerations.SwitchingCapabilityKind}.
	 *
	 *

	 * If the meaning of the 'Sw Op Cap' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Sw Op Cap' attribute.
	 * @see gluemodel.substationStandard.Enumerations.SwitchingCapabilityKind
	 * @see #setSwOpCap(SwitchingCapabilityKind)
	 * @see gluemodel.substationStandard.LNNodes.LNGroupX.LNGroupXPackage#getXSWI_SwOpCap()
	 * @model
	 * @generated
	 */
	SwitchingCapabilityKind getSwOpCap();

	/**
	 * Sets the value of the '{@link gluemodel.substationStandard.LNNodes.LNGroupX.XSWI#getSwOpCap Sw Op Cap}' attribute.
	 *
	 *
	 * @param value the new value of the 'Sw Op Cap' attribute.
	 * @see gluemodel.substationStandard.Enumerations.SwitchingCapabilityKind
	 * @see #getSwOpCap()
	 * @generated
	 */
	void setSwOpCap(SwitchingCapabilityKind value);

	/**
	 * Returns the value of the 'Max Op Cap' attribute.
	 * The literals are from the enumeration {@link gluemodel.substationStandard.Enumerations.SwitchingCapabilityKind}.
	 *
	 *

	 * If the meaning of the 'Max Op Cap' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Max Op Cap' attribute.
	 * @see gluemodel.substationStandard.Enumerations.SwitchingCapabilityKind
	 * @see #setMaxOpCap(SwitchingCapabilityKind)
	 * @see gluemodel.substationStandard.LNNodes.LNGroupX.LNGroupXPackage#getXSWI_MaxOpCap()
	 * @model
	 * @generated
	 */
	SwitchingCapabilityKind getMaxOpCap();

	/**
	 * Sets the value of the '{@link gluemodel.substationStandard.LNNodes.LNGroupX.XSWI#getMaxOpCap Max Op Cap}' attribute.
	 *
	 *
	 * @param value the new value of the 'Max Op Cap' attribute.
	 * @see gluemodel.substationStandard.Enumerations.SwitchingCapabilityKind
	 * @see #getMaxOpCap()
	 * @generated
	 */
	void setMaxOpCap(SwitchingCapabilityKind value);

	/**
	 * Returns the value of the 'Sw Typ' attribute.
	 * The literals are from the enumeration {@link gluemodel.substationStandard.Enumerations.SwitchTypeKind}.
	 *
	 *

	 * If the meaning of the 'Sw Typ' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Sw Typ' attribute.
	 * @see gluemodel.substationStandard.Enumerations.SwitchTypeKind
	 * @see #setSwTyp(SwitchTypeKind)
	 * @see gluemodel.substationStandard.LNNodes.LNGroupX.LNGroupXPackage#getXSWI_SwTyp()
	 * @model
	 * @generated
	 */
	SwitchTypeKind getSwTyp();

	/**
	 * Sets the value of the '{@link gluemodel.substationStandard.LNNodes.LNGroupX.XSWI#getSwTyp Sw Typ}' attribute.
	 *
	 *
	 * @param value the new value of the 'Sw Typ' attribute.
	 * @see gluemodel.substationStandard.Enumerations.SwitchTypeKind
	 * @see #getSwTyp()
	 * @generated
	 */
	void setSwTyp(SwitchTypeKind value);

	/**
	 * Returns the value of the 'Switch Control' reference.
	 *
	 *

	 * If the meaning of the 'Switch Control' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Switch Control' reference.
	 * @see #setSwitchControl(CSWI)
	 * @see gluemodel.substationStandard.LNNodes.LNGroupX.LNGroupXPackage#getXSWI_SwitchControl()
	 * @model
	 * @generated
	 */
	CSWI getSwitchControl();

	/**
	 * Sets the value of the '{@link gluemodel.substationStandard.LNNodes.LNGroupX.XSWI#getSwitchControl Switch Control}' reference.
	 *
	 *
	 * @param value the new value of the 'Switch Control' reference.
	 * @see #getSwitchControl()
	 * @generated
	 */
	void setSwitchControl(CSWI value);

} // XSWI


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
org.apache.poi.hssf.usermodel.contrib (POI API Documentation)
</TITLE>

<META NAME="date" CONTENT="2009-12-14">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

org.apache.poi.hssf.usermodel.contrib

Classes

HSSFCellUtil

HSSFRegionUtil

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/BPTracker.iml" filepath="$PROJECT_DIR$/BPTracker.iml" />
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
      <module fileurl="file://$PROJECT_DIR$/libs/android-gauge-library/bpt-gauges/bpt-gauges.iml" filepath="$PROJECT_DIR$/libs/android-gauge-library/bpt-gauges/bpt-gauges.iml" />
      <module fileurl="file://$PROJECT_DIR$/libs/spark-sdk-android/cloudsdk/cloudsdk.iml" filepath="$PROJECT_DIR$/libs/spark-sdk-android/cloudsdk/cloudsdk.iml" />
    </modules>
  </component>
</project>


text:
package org.gradle.test.performance.mediummonolithicjavaproject.p285;

import org.gradle.test.performance.mediummonolithicjavaproject.p281.Production5626;
import org.gradle.test.performance.mediummonolithicjavaproject.p283.Production5666;

public class Production5707 {

    private Production5626 property0;

    public Production5626 getProperty0() {
        return property0;
    }

    public void setProperty0(Production5626 value) {
        property0 = value;
    }

    private Production5666 property1;

    public Production5666 getProperty1() {
        return property1;
    }

    public void setProperty1(Production5666 value) {
        property1 = value;
    }

    private Production5706 property2;

    public Production5706 getProperty2() {
        return property2;
    }

    public void setProperty2(Production5706 value) {
        property2 = value;
    }

    private String property3;

    public String getProperty3() {
        return property3;
    }

    public void setProperty3(String value) {
        property3 = value;
    }

    private String property4;

    public String getProperty4() {
        return property4;
    }

    public void setProperty4(String value) {
        property4 = value;
    }

    private String property5;

    public String getProperty5() {
        return property5;
    }

    public void setProperty5(String value) {
        property5 = value;
    }

    private String property6;

    public String getProperty6() {
        return property6;
    }

    public void setProperty6(String value) {
        property6 = value;
    }

    private String property7;

    public String getProperty7() {
        return property7;
    }

    public void setProperty7(String value) {
        property7 = value;
    }

    private String property8;

    public String getProperty8() {
        return property8;
    }

    public void setProperty8(String value) {
        property8 = value;
    }

    private String property9;

    public String getProperty9() {
        return property9;
    }

    public void setProperty9(String value) {
        property9 = value;
    }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>TaxonomyWriter (Lucene 4.6.1 API)</title>
<meta name="date" content="2014-01-23">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

org.apache.lucene.facet.taxonomy

Interface TaxonomyWriter

All Superinterfaces:

Closeable, TwoPhaseCommit

All Known Implementing Classes:

DirectoryTaxonomyWriter

public interface TaxonomyWriter
extends Closeable, TwoPhaseCommit

TaxonomyWriter is the interface which the faceted-search library uses
 to dynamically build the taxonomy at indexing time.

 Notes about concurrent access to the taxonomy:

 An implementation must allow multiple readers and a single writer to be
 active concurrently. Readers follow so-called "point in time" semantics,
 i.e., a reader object will only see taxonomy entries which were available
 at the time it was created. What the writer writes is only available to
 (new) readers after the writer's commit() is called.

 Faceted search keeps two indices - namely Lucene's main index, and this
 taxonomy index. When one or more readers are active concurrently with the
 writer, care must be taken to avoid an inconsistency between the state of
 these two indices: When writing to the indices, the taxonomy must always
 be committed to disk *before* the main index, because the main index
 refers to categories listed in the taxonomy.
 Such control can best be achieved by turning off the main index's
 "autocommit" feature, and explicitly calling commit() for both indices
 (first for the taxonomy, then for the main index).
 In old versions of Lucene (2.2 or earlier), when autocommit could not be
 turned off, a more complicated solution needs to be used. E.g., use
 some sort of (possibly inter-process) locking to ensure that a reader
 is being opened only right after both indices have been flushed (and
 before anything else is written to them).

WARNING: This API is experimental and might change in incompatible ways in the next release.

Method Summary

Methods

Modifier and Type
Method and Description

int
addCategory(CategoryPath categoryPath)

addCategory() adds a category with a given path name to the taxonomy,
 and returns its ordinal.

Map<String,String>
getCommitData()

Returns the commit user data map that was set on
 setCommitData(Map).

int
getParent(int ordinal)

getParent() returns the ordinal of the parent category of the category
 with the given ordinal.

int
getSize()

getSize() returns the number of categories in the taxonomy.

void
setCommitData(Map<String,String> commitUserData)

Sets the commit user data map.

Methods inherited from interface java.io.Closeable

close

Methods inherited from interface org.apache.lucene.index.TwoPhaseCommit

commit, prepareCommit, rollback

Method Detail

addCategory

int addCategory(CategoryPath categoryPath)
                throws IOException

addCategory() adds a category with a given path name to the taxonomy,
 and returns its ordinal. If the category was already present in
 the taxonomy, its existing ordinal is returned.

 Before adding a category, addCategory() makes sure that all its
 ancestor categories exist in the taxonomy as well. As result, the
 ordinal of a category is guaranteed to be smaller then the ordinal of
 any of its descendants.

Throws:

IOException

getParent

int getParent(int ordinal)
              throws IOException

getParent() returns the ordinal of the parent category of the category
 with the given ordinal.

 When a category is specified as a path name, finding the path of its
 parent is as trivial as dropping the last component of the path.
 getParent() is functionally equivalent to calling getPath() on the
 given ordinal, dropping the last component of the path, and then calling
 getOrdinal() to get an ordinal back.

 If the given ordinal is the ROOT_ORDINAL, an INVALID_ORDINAL is returned.
 If the given ordinal is a top-level category, the ROOT_ORDINAL is returned.
 If an invalid ordinal is given (negative or beyond the last available
 ordinal), an ArrayIndexOutOfBoundsException is thrown. However, it is
 expected that getParent will only be called for ordinals which are
 already known to be in the taxonomy.
 TODO (Facet): instead of a getParent(ordinal) method, consider having a

 getCategory(categorypath, prefixlen) which is similar to addCategory
 except it doesn't add new categories; This method can be used to get
 the ordinals of all prefixes of the given category, and it can use
 exactly the same code and cache used by addCategory() so it means less code.

Throws:

IOException

getSize

int getSize()

getSize() returns the number of categories in the taxonomy.

 Because categories are numbered consecutively starting with 0, it
 means the taxonomy contains ordinals 0 through getSize()-1.

 Note that the number returned by getSize() is often slightly higher
 than the number of categories inserted into the taxonomy; This is
 because when a category is added to the taxonomy, its ancestors
 are also added automatically (including the root, which always get
 ordinal 0).

setCommitData

void setCommitData(Map<String,String> commitUserData)

Sets the commit user data map. That method is considered a transaction and
 will be committed even if no other changes were made to
 the writer instance.

 NOTE: the map is cloned internally, therefore altering the map's
 contents after calling this method has no effect.

getCommitData

Map<String,String> getCommitData()

Returns the commit user data map that was set on
 setCommitData(Map).

Overview

Package

Class

Use

Tree

Deprecated

Help

PREV CLASS

NEXT CLASS

FRAMES

NO FRAMES

All Classes

SUMMARY:

NESTED |

FIELD |

CONSTR |

METHOD

DETAIL:

FIELD |

CONSTR |

METHOD

          Copyright © 2000-2014 Apache Software Foundation.  All Rights Reserved.


text:
using Abp.AspNetCore.Mvc.Controllers;
using Abp.Auditing;
using Abp.Web.Api.ProxyScripting;
using Abp.Web.Minifier;
using Abp.Web.Models;
using Microsoft.AspNetCore.Mvc;

namespace Abp.AspNetCore.Mvc.Proxying
{
    [DontWrapResult]
    [DisableAuditing]
    public class AbpServiceProxiesController : AbpController
    {
        private readonly IApiProxyScriptManager _proxyScriptManager;
        private readonly IJavaScriptMinifier _javaScriptMinifier;

        public AbpServiceProxiesController(IApiProxyScriptManager proxyScriptManager,
            IJavaScriptMinifier javaScriptMinifier)
        {
            _proxyScriptManager = proxyScriptManager;
            _javaScriptMinifier = javaScriptMinifier;
        }

        [Produces("application/x-javascript")]
        public ContentResult GetAll(ApiProxyGenerationModel model)
        {
            var script = _proxyScriptManager.GetScript(model.CreateOptions());
            return Content(model.Minify ? _javaScriptMinifier.Minify(script) : script, "application/x-javascript");
        }
    }
}


text:
require "test_helper"

class UserPhoneTest < ActiveSupport::TestCase
  def count_of_main_klass_records_not_in_hm_klass(main_klass, hm_klass, hm_relationship_name)
    foreign_key = main_klass.reflections[hm_relationship_name].instance_variable_get('@active_record').name.foreign_key
    raise 'foreign_key is nil' unless foreign_key
    sql  = %Q{
      select count(*) as count_data
      from #{main_klass.table_name}
      where users.id NOT IN (
        select #{hm_klass.table_name}.#{foreign_key}
        from #{hm_klass.table_name}
      )
    }
    record = main_klass.find_by_sql(sql).first
    record['count_data'].to_i
  end
end


text:
package org.hl7.v3;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for ActClassSupply.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="ActClassSupply">
 *   <restriction base="{urn:hl7-org:v3}cs">
 *     <enumeration value="SPLY"/>
 *     <enumeration value="DIET"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "ActClassSupply")
@XmlEnum
public enum ActClassSupply {

    SPLY,
    DIET;

    public String value() {
        return name();
    }

    public static ActClassSupply fromValue(String v) {
        return valueOf(v);
    }

}


text:
import os
import xml.etree.ElementTree as ET
import urlparse
import re
import itertools

from docutils import nodes, utils
from sphinx.util.nodes import split_explicit_title
from sphinx.util.console import bold, standout

from .parsing import normalise, ParseException

def find_url(doc, symbol):
	"""
	Return the URL for a given symbol.

	This is where the magic happens.
	This function could be a lot more clever. At present it required the passed symbol to be almost exactly the same as the entries in the Doxygen tag file.

	.. todo::

		Maybe print a list of all possible matches as a warning (but still only return the first)

	:Parameters:
		doc : xml.etree.ElementTree
			The XML DOM object
		symbol : string
			The symbol to lookup in the file. E.g. something like 'PolyVox::Array' or 'tidyUpMemory'

	:return: String representing the filename part of the URL
	"""

	#First check for an exact match with a top-level object (namespaces, objects etc.)

	#env = inliner.document.settings.env

	matches = []
	for compound in doc.findall('.//compound'):
		if compound.find('name').text == symbol:
			matches += [{'file':compound.find('filename').text, 'kind':compound.get('kind')}]

	if len(matches) > 1:
		pass
		#env.warn(env.docname, 'There were multiple matches for `%s`: %s' % (symbol, matches))
	if len(matches) == 1:
		return matches[0]

	#Strip off first namespace bit of the compound name so that 'ArraySizes' can match 'PolyVox::ArraySizes'
	for compound in doc.findall('.//compound'):
		symbol_list = compound.find('name').text.split('::', 1)
		if len(symbol_list) == 2:
			reducedsymbol = symbol_list[1]
			if reducedsymbol == symbol:
				return {'file':compound.find('filename').text, 'kind':compound.get('kind')}

	#Now split the symbol by '::'. Find an exact match for the first part and then a member match for the second
	#So PolyVox::Array::operator[] becomes like {namespace: "PolyVox::Array", endsymbol: "operator[]"}
	symbol_list = symbol.rsplit('::', 1)
	if len(symbol_list) == 2:
		namespace = symbol_list[0]
		endsymbol = symbol_list[1]
		for compound in doc.findall('.//compound'):
			if compound.find('name').text == namespace:
				for member in compound.findall('member'):
					#If this compound object contains the matching member then return it
					if member.find('name').text == endsymbol:
						return {'file':(member.findtext('anchorfile') or compound.findtext('filename')) + '#' + member.find('anchor').text, 'kind':member.get('kind')}

	#Then we'll look at unqualified members
	for member in doc.findall('.//member'):
		if member.find('name').text == symbol:
			return {'file':(member.findtext('anchorfile') or compound.findtext('filename')) + '#' + member.find('anchor').text, 'kind':member.get('kind')}

	return None

def parse_tag_file(doc):
	"""
	Takes in an XML tree from a Doxygen tag file and returns a dictionary that looks something like:

	.. code-block:: python

		{'PolyVox': {'file': 'namespace_poly_vox.html',
		             'kind': 'namespace'},
		 'PolyVox::Array': {'file': 'class_poly_vox_1_1_array.html',
		                    'kind': 'class'},
		 'PolyVox::Array1DDouble': {'file': 'namespace_poly_vox.html#a7a1f5fd5c4f7fbb4258a495d707b5c13',
		                            'kind': 'typedef'},
		 'PolyVox::Array1DFloat': {'file': 'namespace_poly_vox.html#a879a120e49733eba1905c33f8a7f131b',
		                           'kind': 'typedef'},
		 'PolyVox::Array1DInt16': {'file': 'namespace_poly_vox.html#aa1463ece448c6ebed55ab429d6ae3e43',
		                           'kind': 'typedef'},
		 'QScriptContext::throwError': {'arglist': {'( Error error, const QString & text )': 'qscriptcontext.html#throwError',
		                                            '( const QString & text )': 'qscriptcontext.html#throwError-2'},
		                                'kind': 'function'},
		 'QScriptContext::toString': {'arglist': {'()': 'qscriptcontext.html#toString'},
		                              'kind': 'function'}}

	Note the different form for functions. This is required to allow for 'overloading by argument type'.

	To access a filename for a symbol you do:

	.. code-block:: python

		symbol_mapping = mapping[symbol]
		if symbol_mapping['kind'] == 'function':
			url = symbol_mapping['arglist'][argument_string]
		else:
			url = symbol_mapping['file']

	:Parameters:
		doc : xml.etree.ElementTree
			The XML DOM object

	:return: a dictionary mapping fully qualified symbols to files
	"""

	mapping = {}
	function_list = [] #This is a list of function to be parsed and inserted into mapping at the end of the function.
	for compound in doc.findall("./compound"):
		compound_kind = compound.get('kind')
		if compound_kind != 'namespace' and compound_kind != 'class':
			continue #Skip everything that isn't a namespace or class

		compound_name = compound.findtext('name')
		compound_filename = compound.findtext('filename')

		#If it's a compound we can simply add it
		mapping[compound_name] = {'kind' : compound_kind, 'file' : compound_filename}

		for member in compound.findall('member'):

			#If the member doesn't have an <anchorfile> element, use the parent compounds <filename> instead
			#This is the way it is in the qt.tag and is perhaps an artefact of old Doxygen
			anchorfile = member.findtext('anchorfile') or compound_filename
			member_symbol = join(compound_name, '::', member.findtext('name'))
			member_kind = member.get('kind')
			arglist_text = member.findtext('./arglist') #If it has an <arglist> then we assume it's a function. Empty <arglist> returns '', not None. Things like typedefs and enums can have empty arglists

			if arglist_text and member_kind != 'variable' and member_kind != 'typedef' and member_kind != 'enumeration':
				function_list.append((member_symbol, arglist_text, member_kind, join(anchorfile,'#',member.findtext('anchor'))))
			else:
				mapping[member_symbol] = {'kind' : member.get('kind'), 'file' : join(anchorfile,'#',member.findtext('anchor'))}

	for old_tuple, normalised_tuple in zip(function_list, itertools.imap(normalise, (member_tuple[1] for member_tuple in function_list))):
		member_symbol = old_tuple[0]
		original_arglist = old_tuple[1]
		kind = old_tuple[2]
		anchor_link = old_tuple[3]
		normalised_arglist = normalised_tuple[1]
		if normalised_tuple[1] is not None: #This is a 'flag' for a ParseException having happened
			if mapping.get(member_symbol):
				mapping[member_symbol]['arglist'][normalised_arglist] = anchor_link
			else:
				mapping[member_symbol] = {'kind' : kind, 'arglist' : {normalised_arglist : anchor_link}}
		else:
			print('Skipping %s %s%s. Error reported from parser was: %s' % (old_tuple[2], old_tuple[0], old_tuple[1], normalised_tuple[0]))

	#from pprint import pprint; pprint(mapping)
	return mapping

def find_url2(mapping, symbol):
	"""
	Return the URL for a given symbol.

	This is where the magic happens.

	.. todo::

		Maybe print a list of all possible matches as a warning (but still only return the first)

	:Parameters:
		mapping : dictionary
			A dictionary of the form returned by :py:func:`parse_tag_file`
		symbol : string
			The symbol to lookup in the file. E.g. something like 'PolyVox::Array' or 'tidyUpMemory'

	:return: String representing the filename part of the URL

	:raises:
		LookupError
			Raised if the symbol could not be matched in the file
	"""
	#print "\n\nSearching for", symbol
	try:
		symbol, normalised_arglist =  normalise(symbol)
	except ParseException as error:
		raise LookupError(error)
	#print symbol, normalised_arglist

	#If we have an exact match then return it.
	if mapping.get(symbol):
		#print ('Exact match')
		return return_from_mapping(mapping[symbol], normalised_arglist)

	#If the user didn't pass in any arguments, i.e. `arguments == ''` then they don't care which version of the overloaded funtion they get.

	#First we check for any mapping entries which even slightly match the requested symbol
	#endswith_list = {}
	#for item, data in mapping.items():
	#	if item.endswith(symbol):
			#print symbol + ' : ' + item
	#		endswith_list[item] = data
	#		mapping[item]['file']

	#If we only find one then we return it.
	#if len(endswith_list) is 1:
	#	return endswith_list.values()[0]['file']

	#print("Still", len(endswith_list), 'possible matches')

	piecewise_list = find_url_piecewise(mapping, symbol)

	#If there is only one match, return it.
	if len(piecewise_list) is 1:
		return return_from_mapping(piecewise_list.values()[0], normalised_arglist)

	#print("Still", len(piecewise_list), 'possible matches')

	#If there is more than one item in piecewise_list then there is an ambiguity
	#Often this is due to the symbol matching the name of the constructor as well as the class name itself
	classes_list = find_url_classes(piecewise_list, symbol)

	#If there is only one by here we return it.
	if len(classes_list) is 1:
		return classes_list.values()[0]

	#print("Still", len(classes_list), 'possible matches')

	#If we exhaused the list by requiring classes, use the list from before the filter.
	if len(classes_list) == 0:
		classes_list = piecewise_list

	no_templates_list = find_url_remove_templates(classes_list, symbol)

	if len(no_templates_list) is 1:
		return return_from_mapping(no_templates_list.values()[0], normalised_arglist)

	#print("Still", len(no_templates_list), 'possible matches')

	#If not found by now, just return the first one in the list
	if len(no_templates_list) != 0:
		#TODO return a warning here?
		return return_from_mapping(no_templates_list.values()[0], normalised_arglist)
	#Else return None if the list is empty
	else:
		LookupError('Could not find a match')

def return_from_mapping(mapping_entry, normalised_arglist=''):
	"""
	Return a mapping to a single URL in the form. This is needed since mapping entries for functions are more complicated due to function overriding.

	If the mapping to be returned is not a function, this will simply return the mapping entry intact. If the entry is a function it will attempt to get the right version based on the function signature.

	:Parameters:
		mapping_entry : dict
			should be a single entry from the large mapping file corresponding to a single symbol. If the symbol is a function, then ``mappingentry['arglist']`` will be a dictionary mapping normalised signatures to URLs
		normalised_arglist : string
			the normalised form of the arglist that the user has requested. This can be empty in which case the function will return just the first element of ``mappingentry['arglist']``. This parameter is ignored if ``mappingentry['kind'] != 'function'``

	:return: dictionary something like:

		.. code-block:: python

			{'kind' : 'function', 'file' : 'something.html#foo'}

	"""
	#If it's a function we need to grab the right signature from the arglist.
	if mapping_entry['kind'] == 'function':
		#If the user has requested a specific function through specifying an arglist then get the right anchor
		if normalised_arglist:
			filename = mapping_entry['arglist'].get(normalised_arglist)
			if not filename: #If we didn't get the filename because it's not in the mapping then we will just return a random one?
				#TODO return a warning here!
				filename = mapping_entry['arglist'].values()[0]
		else:
			#Otherwise just return the first entry (if they don't care they get whatever comes first)
			filename = mapping_entry['arglist'].values()[0]

		return {'kind' : 'function', 'file' : filename}
	elif mapping_entry.get('arglist'):
		#This arglist should only be one entry long and that entry should have '' as its key
		return {'kind' : mapping_entry['kind'], 'file' : mapping_entry['arglist']['']}

	#If it's not a function, then return it raw
	return mapping_entry

def find_url_piecewise(mapping, symbol):
	"""
	Match the requested symbol reverse piecewise (split on ``::``) against the tag names to ensure they match exactly (modulo ambiguity)
	So, if in the mapping there is ``PolyVox::Volume::FloatVolume`` and ``PolyVox::Volume`` they would be split into:

	.. code-block:: python

		['PolyVox', 'Volume', 'FloatVolume'] and ['PolyVox', 'Volume']

	and reversed:

	.. code-block:: python

		['FloatVolume', 'Volume', 'PolyVox'] and ['Volume', 'PolyVox']

	and truncated to the shorter of the two:

	.. code-block:: python

		['FloatVolume', 'Volume'] and ['Volume', 'PolyVox']

	If we're searching for the ``PolyVox::Volume`` symbol we would compare:

	.. code-block:: python

		['Volume', 'PolyVox'] to ['FloatVolume', 'Volume', 'PolyVox'].

	That doesn't match so we look at the next in the mapping:

	.. code-block:: python

		['Volume', 'PolyVox'] to ['Volume', 'PolyVox'].

	Good, so we add it to the list

	"""
	piecewise_list = {}
	for item, data in mapping.items():
		split_symbol = symbol.split('::')
		split_item = item.split('::')

		split_symbol.reverse()
		split_item.reverse()

		min_length = min(len(split_symbol), len(split_item))

		split_symbol = split_symbol[:min_length]
		split_item = split_item[:min_length]

		#print split_symbol, split_item

		if split_symbol == split_item:
			#print symbol + ' : ' + item
			piecewise_list[item] = data

	return piecewise_list

def find_url_classes(mapping, symbol):
	"""Prefer classes over names of constructors"""
	classes_list = {}
	for item, data in mapping.items():
		if data['kind'] == 'class':
			#print symbol + ' : ' + item
			classes_list[item] = data

	return classes_list

def find_url_remove_templates(mapping, symbol):
	"""Now, to disambiguate between ``PolyVox::Array< 1, ElementType >::operator[]`` and ``PolyVox::Array::operator[]`` matching ``operator[]``, we will ignore templated (as in C++ templates) tag names by removing names containing ``<``"""
	no_templates_list = {}
	for item, data in mapping.items():
		if '<' not in item:
			#print symbol + ' : ' + item
			no_templates_list[item] = data

	return no_templates_list

def join(*args):
	return ''.join(args)

def create_role(app, tag_filename, rootdir):
	#Tidy up the root directory path
	if not rootdir.endswith(('/', '\\')):
		rootdir = join(rootdir, os.sep)

	try:
		tag_file = ET.parse(tag_filename)

		cache_name = os.path.basename(tag_filename)

		app.info(bold('Checking tag file cache for %s: ' % cache_name), nonl=True)
		if not hasattr(app.env, 'doxylink_cache'):
			# no cache present at all, initialise it
			app.info('No cache at all, rebuilding...')
			mapping = parse_tag_file(tag_file)
			app.env.doxylink_cache = { cache_name : {'mapping' : mapping, 'mtime' : os.path.getmtime(tag_filename)}}
		elif not app.env.doxylink_cache.get(cache_name):
			# Main cache is there but the specific sub-cache for this tag file is not
			app.info('Sub cache is missing, rebuilding...')
			mapping = parse_tag_file(tag_file)
			app.env.doxylink_cache[cache_name] = {'mapping' : mapping, 'mtime' : os.path.getmtime(tag_filename)}
		elif app.env.doxylink_cache[cache_name]['mtime'] < os.path.getmtime(tag_filename):
			# tag file has been modified since sub-cache creation
			app.info('Sub-cache is out of date, rebuilding...')
			mapping = parse_tag_file(tag_file)
			app.env.doxylink_cache[cache_name] = {'mapping' : mapping, 'mtime' : os.path.getmtime(tag_filename)}
		else:
			#The cache is up to date
			app.info('Sub-cache is up-to-date')
	except IOError:
		tag_file = None
		app.warn(standout('Could not open tag file %s. Make sure your `doxylink` config variable is set correctly.' % tag_filename))

	def find_doxygen_link(name, rawtext, text, lineno, inliner, options={}, content=[]):
		text = utils.unescape(text)
		# from :name:`title <part>`
		has_explicit_title, title, part = split_explicit_title(text)
		warning_messages = []
		if tag_file:
			url = find_url(tag_file, part)
			try:
				url = find_url2(app.env.doxylink_cache[cache_name]['mapping'], part)
			except LookupError as error:
				warning_messages.append('Error while parsing `%s`. Is not a well-formed C++ function call or symbol. If this is not the case, it is a doxylink bug so please report it. Error reported was: %s' % (part, error))
			if url:

				#If it's an absolute path then the link will work regardless of the document directory
				#Also check if it is a URL (i.e. it has a 'scheme' like 'http' or 'file')
				if os.path.isabs(rootdir) or urlparse.urlparse(rootdir).scheme:
					full_url = join(rootdir, url['file'])
				#But otherwise we need to add the relative path of the current document to the root source directory to the link
				else:
					relative_path_to_docsrc = os.path.relpath(app.env.srcdir, os.path.dirname(inliner.document.current_source))
					full_url = join(relative_path_to_docsrc, '/', rootdir, url['file']) #We always use the '/' here rather than os.sep since this is a web link avoids problems like documentation/.\../library/doc/ (mixed slashes)

				if url['kind'] == 'function' and app.config.add_function_parentheses and not normalise(title)[1]:
					title = join(title, '()')

				pnode = nodes.reference(title, title, internal=False, refuri=full_url)
				return [pnode], []
			#By here, no match was found
			warning_messages.append('Could not find match for `%s` in `%s` tag file' % (part, tag_filename))
		else:
			warning_messages.append('Could not find match for `%s` because tag file not found' % (part))

		pnode = nodes.inline(rawsource=title, text=title)
		return [pnode], [inliner.reporter.warning(message, line=lineno) for message in warning_messages]

	return find_doxygen_link

def setup_doxylink_roles(app):
	for name, [tag_filename, rootdir] in app.config.doxylink.iteritems():
		app.add_role(name, create_role(app, tag_filename, rootdir))

def setup(app):
	app.add_config_value('doxylink', {}, 'env')
	app.connect('builder-inited', setup_doxylink_roles)


text:
module Para
  module SeoTools
    module Admin
      class SkeletonResourcesController < ::Para::Admin::CrudResourcesController
        def index
          super
          @available_locales = ::Para::SeoTools::Page.group(:locale).pluck(:locale)
        end
      end
    end
  end
end


text:
TrustKit
========

[![Build Status](https://travis-ci.org/datatheorem/TrustKit.svg)](https://travis-ci.org/datatheorem/TrustKit) [![Version Status](https://img.shields.io/cocoapods/v/TrustKit.svg?style=flat)](https://cocoapods.org/pods/TrustKit) [![Platform](http://img.shields.io/cocoapods/p/TrustKit.svg?style=flat)](https://cocoapods.org/pods/TrustKit) [![License MIT](https://img.shields.io/github/license/datatheorem/trustkit.svg?style=flat)](https://en.wikipedia.org/wiki/MIT_License)

TrustKit is an open source framework that makes it easy to deploy SSL public key
pinning in any iOS or OS X App.

Overview
--------

At a high level, TrustKit intercepts all outgoing SSL connections initiated by
SecureTransport in order to perform additional validation against the server's
certificate chain, based on an App-wide SSL pinning policy. This novel approach
to SSL pinning gives us the following benefits:

* Easy to use: TrustKit can be deployed in minutes in any App. For iOS8+ and OS
X Apps, TrustKit can be used without even modifying the App's source code.
* API-independent pinning by directly hooking Apple's SecureTransport: TrustKit
works on `NSURLSession`, `UIWebView`, `NSStream`, etc. all the way down to BSD
sockets.

Additionally, TrustKit provides the following features:

* Subject Public Key Info pinning, [as opposed to certificate pinning or pinning
the public key bits](https://www.imperialviolet.org/2011/05/04/pinning.html).
* Mechanism to report pinning failures, which allows Apps to send reports
when an unexpected certificate chain is detected, similarly to the _report-uri_
directive described in the [HTTP Public Key Pinning
specification](https://tools.ietf.org/html/rfc7469).

TrustKit was open-sourced at [Black Hat 2015 USA][bh2015-conf].

Getting Started
---------------

* Have a look at the Black Hat USA 2015 [presentation][bh2015-pdf].
* Read the [Getting Started][getting-started] guide.
* Check out the [API documentation][api-doc].

Sample Usage
------------

TrustKit can be deployed using CocoaPods, by adding the following line to your Podfile:

    pod 'TrustKit'

Then run:

    $ pod install

Then, enabling SSL pinning globally in the App only requires initializing TrustKit
with a pinning policy (domains, Subject Public Key Info hashes, and additional settings).

The policy can be configured within the App's Info.plist:

![Info.plist policy](https://datatheorem.github.io/TrustKit/images/linking3_dynamic.png)

Alternatively, the pinning policy can be set programmatically:

    NSDictionary *trustKitConfig;
    trustKitConfig = @{
                       @"www.datatheorem.com" : @{
                               kTSKPublicKeyAlgorithms : @[kTSKAlgorithmRsa2048],
                               kTSKPublicKeyHashes : @[
                                       @"HXXQgxueCIU5TTLHob/bPbwcKOKw6DkfsTWYHbxbqTY=",
                                       @"0SDf3cRToyZJaMsoS17oF72VMavLxj/N7WBNasNuiR8="
                                       ],
                               kTSKEnforcePinning : @NO,
                               kTSKReportUris : @[@"http://report.datatheorem.com/log_report"],
                               },
                       @"yahoo.com" : @{
                               kTSKPublicKeyAlgorithms : @[kTSKAlgorithmRsa4096],
                               kTSKPublicKeyHashes : @[
                                       @"TQEtdMbmwFgYUifM4LDF+xgEtd0z69mPGmkp014d6ZY=",
                                       @"rFjc3wG7lTZe43zeYTvPq8k4xdDEutCmIhI5dn4oCeE=",
                                       ],
                               kTSKIncludeSubdomains : @YES
                               }
                       };

    [TrustKit initializeWithConfiguration:trustKitConfig];

Once TrustKit has been initialized, all SSL connections initiated by Apple
frameworks within the App will verify the server' certificate chains against the
supplied pinning policy. If report URIs have been configured, the App will also
send reports to the specified URIs whenever a pin validation failure occurred.

For more information, see the [Getting Started][getting-started] guide.

Credits
-------

TrustKit is a joint-effort between the security teams at Data Theorem and Yahoo.
See AUTHORS for details.

License
-------

TrustKit is released under the MIT license. See LICENSE for details.

[getting-started]: https://datatheorem.github.io/TrustKit/getting-started/
[bh2015-pdf]: https://datatheorem.github.io/TrustKit/files/TrustKit-BH2015.pdf
[bh2015-conf]: https://www.blackhat.com/us-15/briefings.html#trustkit-code-injection-on-ios-8-for-the-greater-good
[api-doc]: https://datatheorem.github.io/TrustKit/documentation


text:
from __future__ import unicode_literals

import re

from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
    parse_duration,
    unified_strdate,
    str_to_int,
    int_or_none,
    float_or_none,
    ISO639Utils,
    determine_ext,
)

class AdobeTVBaseIE(InfoExtractor):
    _API_BASE_URL = 'http://tv.adobe.com/api/v4/'

class AdobeTVIE(AdobeTVBaseIE):
    _VALID_URL = r'https?://tv\.adobe\.com/(?:(?P<language>fr|de|es|jp)/)?watch/(?P<show_urlname>[^/]+)/(?P<id>[^/]+)'

    _TEST = {
        'url': 'http://tv.adobe.com/watch/the-complete-picture-with-julieanne-kost/quick-tip-how-to-draw-a-circle-around-an-object-in-photoshop/',
        'md5': '9bc5727bcdd55251f35ad311ca74fa1e',
        'info_dict': {
            'id': '10981',
            'ext': 'mp4',
            'title': 'Quick Tip - How to Draw a Circle Around an Object in Photoshop',
            'description': 'md5:99ec318dc909d7ba2a1f2b038f7d2311',
            'thumbnail': r're:https?://.*\.jpg$',
            'upload_date': '20110914',
            'duration': 60,
            'view_count': int,
        },
    }

    def _real_extract(self, url):
        language, show_urlname, urlname = re.match(self._VALID_URL, url).groups()
        if not language:
            language = 'en'

        video_data = self._download_json(
            self._API_BASE_URL + 'episode/get/?language=%s&show_urlname=%s&urlname=%s&disclosure=standard' % (language, show_urlname, urlname),
            urlname)['data'][0]

        formats = [{
            'url': source['url'],
            'format_id': source.get('quality_level') or source['url'].split('-')[-1].split('.')[0] or None,
            'width': int_or_none(source.get('width')),
            'height': int_or_none(source.get('height')),
            'tbr': int_or_none(source.get('video_data_rate')),
        } for source in video_data['videos']]
        self._sort_formats(formats)

        return {
            'id': compat_str(video_data['id']),
            'title': video_data['title'],
            'description': video_data.get('description'),
            'thumbnail': video_data.get('thumbnail'),
            'upload_date': unified_strdate(video_data.get('start_date')),
            'duration': parse_duration(video_data.get('duration')),
            'view_count': str_to_int(video_data.get('playcount')),
            'formats': formats,
        }

class AdobeTVPlaylistBaseIE(AdobeTVBaseIE):
    def _parse_page_data(self, page_data):
        return [self.url_result(self._get_element_url(element_data)) for element_data in page_data]

    def _extract_playlist_entries(self, url, display_id):
        page = self._download_json(url, display_id)
        entries = self._parse_page_data(page['data'])
        for page_num in range(2, page['paging']['pages'] + 1):
            entries.extend(self._parse_page_data(
                self._download_json(url + '&page=%d' % page_num, display_id)['data']))
        return entries

class AdobeTVShowIE(AdobeTVPlaylistBaseIE):
    _VALID_URL = r'https?://tv\.adobe\.com/(?:(?P<language>fr|de|es|jp)/)?show/(?P<id>[^/]+)'

    _TEST = {
        'url': 'http://tv.adobe.com/show/the-complete-picture-with-julieanne-kost',
        'info_dict': {
            'id': '36',
            'title': 'The Complete Picture with Julieanne Kost',
            'description': 'md5:fa50867102dcd1aa0ddf2ab039311b27',
        },
        'playlist_mincount': 136,
    }

    def _get_element_url(self, element_data):
        return element_data['urls'][0]

    def _real_extract(self, url):
        language, show_urlname = re.match(self._VALID_URL, url).groups()
        if not language:
            language = 'en'
        query = 'language=%s&show_urlname=%s' % (language, show_urlname)

        show_data = self._download_json(self._API_BASE_URL + 'show/get/?%s' % query, show_urlname)['data'][0]

        return self.playlist_result(
            self._extract_playlist_entries(self._API_BASE_URL + 'episode/?%s' % query, show_urlname),
            compat_str(show_data['id']),
            show_data['show_name'],
            show_data['show_description'])

class AdobeTVChannelIE(AdobeTVPlaylistBaseIE):
    _VALID_URL = r'https?://tv\.adobe\.com/(?:(?P<language>fr|de|es|jp)/)?channel/(?P<id>[^/]+)(?:/(?P<category_urlname>[^/]+))?'

    _TEST = {
        'url': 'http://tv.adobe.com/channel/development',
        'info_dict': {
            'id': 'development',
        },
        'playlist_mincount': 96,
    }

    def _get_element_url(self, element_data):
        return element_data['url']

    def _real_extract(self, url):
        language, channel_urlname, category_urlname = re.match(self._VALID_URL, url).groups()
        if not language:
            language = 'en'
        query = 'language=%s&channel_urlname=%s' % (language, channel_urlname)
        if category_urlname:
            query += '&category_urlname=%s' % category_urlname

        return self.playlist_result(
            self._extract_playlist_entries(self._API_BASE_URL + 'show/?%s' % query, channel_urlname),
            channel_urlname)

class AdobeTVVideoIE(InfoExtractor):
    _VALID_URL = r'https?://video\.tv\.adobe\.com/v/(?P<id>\d+)'

    _TEST = {
        # From https://helpx.adobe.com/acrobat/how-to/new-experience-acrobat-dc.html?set=acrobat--get-started--essential-beginners
        'url': 'https://video.tv.adobe.com/v/2456/',
        'md5': '43662b577c018ad707a63766462b1e87',
        'info_dict': {
            'id': '2456',
            'ext': 'mp4',
            'title': 'New experience with Acrobat DC',
            'description': 'New experience with Acrobat DC',
            'duration': 248.667,
        },
    }

    def _real_extract(self, url):
        video_id = self._match_id(url)
        webpage = self._download_webpage(url, video_id)

        video_data = self._parse_json(self._search_regex(
            r'var\s+bridge\s*=\s*([^;]+);', webpage, 'bridged data'), video_id)

        formats = [{
            'format_id': '%s-%s' % (determine_ext(source['src']), source.get('height')),
            'url': source['src'],
            'width': int_or_none(source.get('width')),
            'height': int_or_none(source.get('height')),
            'tbr': int_or_none(source.get('bitrate')),
        } for source in video_data['sources']]
        self._sort_formats(formats)

        # For both metadata and downloaded files the duration varies among
        # formats. I just pick the max one
        duration = max(filter(None, [
            float_or_none(source.get('duration'), scale=1000)
            for source in video_data['sources']]))

        subtitles = {}
        for translation in video_data.get('translations', []):
            lang_id = translation.get('language_w3c') or ISO639Utils.long2short(translation['language_medium'])
            if lang_id not in subtitles:
                subtitles[lang_id] = []
            subtitles[lang_id].append({
                'url': translation['vttPath'],
                'ext': 'vtt',
            })

        return {
            'id': video_id,
            'formats': formats,
            'title': video_data['title'],
            'description': video_data.get('description'),
            'thumbnail': video_data['video'].get('poster'),
            'duration': duration,
            'subtitles': subtitles,
        }