text:
ImageTrove is a tool for ingesting and archiving NIF datasets. It is made up of a number of components:

* PostgreSQL database.
* Web front end: [MyTARDIS](http://mytardis.org/), a [Django](https://www.djangoproject.com/) application.
* DICOM server: [DICOM](http://dicom.offis.de/dcmtk.php.en).
* Dataset uploader: [imagetrove-uploader](https://github.com/NIF-au/imagetrove-uploader).
* Federated authentication: end users log in to MyTARDIS using their institutional identity, which is verified by
  the Australian Access Federation's [Rapid Connect](https://rapid.aaf.edu.au) service.

For ease of deployment, all of the components are packaged into a [Docker](https://www.docker.com/) container.

The flow of data through the system is as follows:

1. Instrument user chooses a dataset to archive.
2. At the instrument console, the user sends the dataset to the ImageTrove modality (this is the DCMTK server).
3. Periodically, imagetrove-uploader scans the DCMTK storage directory for new datasets which are converted to [MINC](http://www.bic.mni.mcgill.ca/ServicesSoftware/MINC) and Nifti and imported into MyTARDIS, along with metadata.

# System requirements

* A 64bit Linux system with sufficient storage for the
datasets. For example a [Nectar VM](http://nectar.org.au/) with an
[RDSI](https://www.rdsi.edu.au/) storage allocation mounted as NFS. Any
distribution of Linux is acceptable as long as there is a [Docker package](https://docs.docker.com/installation/#installation).
* Each instrument's DICOM server must be able to connect to the DCMTK DICOM server (defaults to port 4242).
* The ImageTrove web server must be able to accept a HTTPS POST request from an AAF system.

# Installation

## Docker

Follow the instructions at https://docs.docker.com/installation/#installation

By default Docker stores its images in ```/var/lib/docker``` so ensure that this
directory is on a partition with sufficient free space. Check these settings in ```/etc/default/docker```:

    DOCKER_OPTS="--graph=/mnt/bigdrive/docker"
    export TMPDIR="/mnt/bigdrive/docker-tmp"

While not necessary, running Docker with AUFS makes building containers much faster. You can
check if AUFS is enabled by looking at the ```Storage Driver``` field:

    $ sudo docker info
    Containers: 22
    Images: 652
    Storage Driver: aufs
     Root Dir: /var/lib/docker/aufs
     Dirs: 696
    Execution Driver: native-0.2
    Kernel Version: 3.14.0-2-amd64
    Operating System: Debian GNU/Linux jessie/sid (containerized)
    WARNING: No memory limit support
    WARNING: No swap limit support

You might need to install the kernel package ```linux-image-extra-`uname -r` ``` for AUFS to work.
## ImageTrove

Clone the imagetrove and MyTARDIS repositories.

For the older 3.5 release:

    git clone https://github.com/NIF-au/imagetrove
    cd imagetrove
    git clone git://github.com/carlohamalainen/mytardis.git # current dev fork; later will be git://github.com/mytardis/mytardis.git

For the current develop branch:

    git clone https://github.com/NIF-au/imagetrove
    cd imagetrove
    git clone git://github.com/mytardis/mytardis.git

## Configuration

### Local settings

Look for ```CHANGEME``` in ```create_admin.py```, ```postgresql_first_run.sh```, ```settings.py```, and ```imagetrove_uploader.conf```.

### AAF authentication

To use AAF authentication you must register your service at https://rapid.aaf.edu.au
For the purposes of testing you can use a plain ```http``` callback URL, but for production
you need a ```https``` callback.

TODO Configuration of SSL certificates in the container.

The callback URL is at ```/rc```, so in the test federation use

    RAPID_CONNECT_CONFIG['aud'] = 'http://imagetrove.example.com/rc/'

and in production,

    RAPID_CONNECT_CONFIG['aud'] = 'https://imagetrove.example.com/rc/'

### Shell access

To get a shell in a running container, use ```docker exec```:

    sudo docker exec -it <hash> bash

where ```<hash>``` is the value in the first column of output given by ```docker ps```.

Alternatively, do it in one line with:

    sudo docker exec -it `sudo docker ps | grep 'user/imagetrove:latest' | awk '{print $1}'` bash

### DICOM modalities

Each instrument must be specified in a config file; see [CAI_all.conf](https://github.com/NIF-au/imagetrove-uploader/blob/master/sample_config_files/CAI_all.conf) for an example.

The fields in each instrument block are:

* ```instrument```: list of name/value pairs used to identify a DICOM dataset as belonging to this instrument.
* ```experiment_title```: list of DICOM fields that will be used to construct the experiment title for the corresponding MyTARDIS experiment.
* ```dataset_title```: list of DICOM fields that will be used to construct the dataset name for the corresponding MyTARDIS dataset.
* ```default_institution_name```: institution name to be used if the DICOM field ```InstitutionName``` is missing.
* ```default_institutional_department_name```:  department name to be uesd if the DICOM field ```InstitutionalDepartmentName``` is missing.
* ```default_institutional_address```: institutional address to be used if the DICOM field ```InstitutionAddress``` is missing.
* ```schema_experiment```: URL-style identifier for the MyTARDIS experiment schema, e.g. ```http://cai.edu.au/schema/1```
* ```schema_dataset```:    URL-style identifier for the MyTARDIS dataset schema, e.g. ```http://cai.edu.au/schema/2```
* ```schema_file```:       URL-style identifier for the MyTARDIS file schema, e.g. ```http://cai.edu.au/schema/3```

At the top level the fields are:

* ```user```: MyTardis username (the admin user).
* ```pass```: password for the admin user.
* ```mytardis_directory```: directory to store experiment files. This is probably your big NFS share.
* ```dcmtk_dir```: incoming directory for DCMTK's DICOM server.
* ```tmp```: temporary directory for processing DICOM to Zip, Minc, Nifti, etc.

### Network access

Each instrument's DICOM server needs to be able to connect to the
STORESCP server on port 4242.

## Build the ImageTrove container

    sudo docker build -t='user/imagetrove' .

## Configure volumes

The container uses external volumes for persistent storage.

* ```imagetrove```: our shared storage location with MyTARDIS.
* ```data```: postgresql database files.
* ```var_log```: logfiles for supervisord, postgresql, mytardis, etc.

# Running ImageTrove

Create directories for the persistent storage:

    mkdir -p /somewhere/imagetrove          \
             /somewhere/data                \
             /somewhere/var_log/supervisor  \
             /somewhere/var_log/nginx       \

Run the container:

    sudo docker run -i -t --rm                              \
        -p 0.0.0.0:8000:8000                                \
        -v /somewhere/imagetrove:/imagetrove                \
        -v /somewhere/data:/data                            \
        -v /somewhere/var_log:/var/log                      \
        -P user/imagetrove

Now go to http://localhost:8000 and you should see the default MyTARDIS front page.

# Testing

## Log in: admin

The MyTARDIS login button directs to AAF. To log in as the
local admin user visit [http://localhost:8000/admin](http://localhost:8000/admin).

This also gives you access to the Django admin interface.

## Log in: AAF

Click the blue Log in button. You will be redirected to your
institution's authentication page, and then back to MyTARDIS.


text:
package net.imglib2.ops.function.general;

import net.imglib2.ops.function.Function;
import net.imglib2.type.numeric.ComplexType;

/**
 * A {@link Function} that always returns NaN values.
 *
 * @author Barry DeZonia
 * @deprecated Use net.imagej.ops instead.
 */
@Deprecated
public class NullNumericFunction<INPUT, T extends ComplexType<T>>
	implements Function<INPUT,T>
{
	// -- instance variables --

	private T type;

	// -- constructor --

	public NullNumericFunction(T type) {
		this.type = type;
	}

	// -- Function methods --

	@Override
	public void compute(INPUT point, T output) {
		output.setComplexNumber(Double.NaN, Double.NaN);
	}

	@Override
	public T createOutput() {
		return type.createVariable();
	}

	@Override
	public NullNumericFunction<INPUT,T> copy() {
		return new NullNumericFunction<INPUT,T>(type.copy());
	}
}

redpajama_set_name: RedPajamaGithub


text:
package org.apereo.cas.config;

import org.apereo.cas.CentralAuthenticationService;
import org.apereo.cas.audit.AuditableExecution;
import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.support.oauth.OAuth20Constants;
import org.apereo.cas.support.oauth.web.endpoints.OAuth20AccessTokenEndpointController;
import org.apereo.cas.support.oauth.web.endpoints.OAuth20AuthorizeEndpointController;
import org.apereo.cas.support.oauth.web.endpoints.OAuth20CallbackAuthorizeEndpointController;
import org.apereo.cas.support.oauth.web.endpoints.OAuth20ConfigurationContext;
import org.apereo.cas.support.oauth.web.endpoints.OAuth20DeviceUserCodeApprovalEndpointController;
import org.apereo.cas.support.oauth.web.endpoints.OAuth20IntrospectionEndpointController;
import org.apereo.cas.support.oauth.web.endpoints.OAuth20RevocationEndpointController;
import org.apereo.cas.support.oauth.web.endpoints.OAuth20UserProfileEndpointController;
import org.apereo.cas.support.oauth.web.mgmt.OAuth20TokenManagementEndpoint;
import org.apereo.cas.token.JwtBuilder;
import org.apereo.cas.web.ProtocolEndpointConfigurer;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * This this {@link CasOAuth20EndpointsConfiguration}.
 *
 * @author Misagh Moayyed
 * @since 6.2.0
 */
@Configuration(value = "casOAuth20EndpointsConfiguration", proxyBeanMethods = false)
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class CasOAuth20EndpointsConfiguration {

    @Autowired
    private CasConfigurationProperties casProperties;

    @Autowired
    @Qualifier("accessTokenJwtBuilder")
    private ObjectProvider<JwtBuilder> accessTokenJwtBuilder;

    @Autowired
    @Qualifier("centralAuthenticationService")
    private ObjectProvider<CentralAuthenticationService> centralAuthenticationService;

    @Autowired
    @Qualifier("accessTokenGrantAuditableRequestExtractor")
    private ObjectProvider<AuditableExecution> accessTokenGrantAuditableRequestExtractor;

    @Bean
    @ConditionalOnMissingBean(name = "callbackAuthorizeController")
    @RefreshScope
    @Autowired
    public OAuth20CallbackAuthorizeEndpointController callbackAuthorizeController(
        @Qualifier("oauth20ConfigurationContext") final OAuth20ConfigurationContext context) {
        return new OAuth20CallbackAuthorizeEndpointController(context);
    }

    @ConditionalOnMissingBean(name = "introspectionEndpointController")
    @Bean
    @Autowired
    public OAuth20IntrospectionEndpointController introspectionEndpointController(
        @Qualifier("oauth20ConfigurationContext") final OAuth20ConfigurationContext context) {
        return new OAuth20IntrospectionEndpointController(context);
    }

    @ConditionalOnMissingBean(name = "accessTokenController")
    @Bean
    @Autowired
    public OAuth20AccessTokenEndpointController accessTokenController(
        @Qualifier("oauth20ConfigurationContext") final OAuth20ConfigurationContext context) {
        return new OAuth20AccessTokenEndpointController(context, accessTokenGrantAuditableRequestExtractor.getObject());
    }

    @ConditionalOnMissingBean(name = "deviceUserCodeApprovalEndpointController")
    @Bean
    @Autowired
    public OAuth20DeviceUserCodeApprovalEndpointController deviceUserCodeApprovalEndpointController(
        @Qualifier("oauth20ConfigurationContext") final OAuth20ConfigurationContext context) {
        return new OAuth20DeviceUserCodeApprovalEndpointController(context);
    }

    @ConditionalOnMissingBean(name = "oauthProfileController")
    @Bean
    @Autowired
    public OAuth20UserProfileEndpointController oauthProfileController(
        @Qualifier("oauth20ConfigurationContext") final OAuth20ConfigurationContext context) {
        return new OAuth20UserProfileEndpointController(context);
    }

    @ConditionalOnMissingBean(name = "oauthRevocationController")
    @Bean
    @Autowired
    public OAuth20RevocationEndpointController oauthRevocationController(
        @Qualifier("oauth20ConfigurationContext") final OAuth20ConfigurationContext context) {
        return new OAuth20RevocationEndpointController(context);
    }

    @ConditionalOnMissingBean(name = "authorizeController")
    @Bean
    @RefreshScope
    public OAuth20AuthorizeEndpointController authorizeController(
        @Qualifier("oauth20ConfigurationContext") final OAuth20ConfigurationContext context) {
        return new OAuth20AuthorizeEndpointController(context);
    }

    @Bean
    @ConditionalOnAvailableEndpoint
    public OAuth20TokenManagementEndpoint oauth20TokenManagementEndpoint() {
        return new OAuth20TokenManagementEndpoint(casProperties,
            centralAuthenticationService.getObject(), accessTokenJwtBuilder.getObject());
    }

    @Bean
    public ProtocolEndpointConfigurer oauth20ProtocolEndpointConfigurer() {
        return () -> List.of(StringUtils.prependIfMissing(OAuth20Constants.BASE_OAUTH20_URL, "/"));
    }
}


text:
SWEP.Gun					= ("tfa_sw_repsnip") --Make sure this is unique.  Specically, your folder name.
if (GetConVar(SWEP.Gun.."_allowed")) != nil then
	if not (GetConVar(SWEP.Gun.."_allowed"):GetBool()) then SWEP.Base = "tfa_blacklisted" SWEP.PrintName = SWEP.Gun return end
end
SWEP.Base				= "tfa_3dscoped_base"
SWEP.Category				= "TFA Star Wars" --The category.  Please, just choose something generic or something I've already done if you plan on only doing like one swep..
SWEP.Manufacturer = nil --Gun Manufactrer (e.g. Hoeckler and Koch )
SWEP.Author				= "TFA" --Author Tooltip
SWEP.Contact				= "http://www.steamcommunity.com/id/theforgottenarchitect" --Contact Info Tooltip
SWEP.Purpose				= "" --Purpose Tooltip
SWEP.Instructions				= "" --Instructions Tooltip
SWEP.Spawnable				= true --Can you, as a normal user, spawn this?
SWEP.AdminSpawnable			= true --Can an adminstrator spawn this?  Does not tie into your admin mod necessarily, unless its coded to allow for GMod's default ranks somewhere in its code.  Evolve and ULX should work, but try to use weapon restriction rather than these.
SWEP.DrawCrosshair			= true		-- Draw the crosshair?
SWEP.DrawCrosshairIS = false --Draw the crosshair in ironsights?
SWEP.PrintName				= "Republic Sniper"		-- Weapon name (Shown on HUD)
SWEP.Slot				= 2				-- Slot in the weapon selection menu.  Subtract 1, as this starts at 0.
SWEP.SlotPos				= 73			-- Position in the slot
SWEP.DrawAmmo				= true		-- Should draw the default HL2 ammo counter if enabled in the GUI.
SWEP.DrawWeaponInfoBox			= false		-- Should draw the weapon info box
SWEP.BounceWeaponIcon   		= 	false	-- Should the weapon icon bounce?
SWEP.AutoSwitchTo			= true		-- Auto switch to if we pick it up
SWEP.AutoSwitchFrom			= true		-- Auto switch from if you pick up a better weapon
SWEP.Weight				= 30			-- This controls how "good" the weapon is for autopickup.
--[[WEAPON HANDLING]]--
--Firing related
SWEP.Primary.Sound 			= Sound("weapons/shared/shared_clonesniper_fire.ogg")				-- This is the sound of the weapon, when you shoot.
SWEP.Primary.SilencedSound 			= nil				-- This is the sound of the weapon, when silenced.
SWEP.Primary.PenetrationMultiplier = 1 --Change the amount of something this gun can penetrate through
SWEP.Primary.Damage		= 150					-- Damage, in standard damage points.
SWEP.Primary.HullSize = 0.5 --Big bullets, increase this value.  They increase the hull size of the hitscan bullet.
SWEP.DamageType = DMG_SHOCK--See DMG enum.  This might be DMG_SHOCK, DMG_BURN, DMG_BULLET, etc.
SWEP.Primary.NumShots	= 1 --The number of shots the weapon fires.  SWEP.Shotgun is NOT required for this to be >1.
SWEP.Primary.Automatic			= false					-- Automatic/Semi Auto
SWEP.Primary.RPM				= 65					-- This is in Rounds Per Minute / RPM
SWEP.Primary.RPM_Semi				= nil					-- RPM for semi-automatic or burst fire.  This is in Rounds Per Minute / RPM
SWEP.FiresUnderwater = false
SWEP.CanBeSilenced = false --Can we silence?  Requires animations.
SWEP.Silenced = false --Silenced by default?
-- Selective Fire Stuff
SWEP.SelectiveFire		= false --Allow selecting your firemode?
SWEP.DisableBurstFire	= false --Only auto/single?
SWEP.OnlyBurstFire		= false --No auto, only burst/single?
SWEP.DefaultFireMode 	= "" --Default to auto or whatev
SWEP.FireModeName = nil --Change to a text value to override it
--Ammo Related
SWEP.Primary.ClipSize			= 7					-- This is the size of a clip
--		= 80					-- This is the number of bullets the gun gives you, counting a clip as defined directly above.
SWEP.Primary.Ammo			= "battery"					-- What kind of ammo.  Options, besides custom, include pistol, 357, smg1, ar2, buckshot, slam, SniperPenetratedRound, and AirboatGun.
--Pistol, buckshot, and slam like to ricochet. Use AirboatGun for a light metal peircing shotgun pellets
SWEP.DisableChambering = true --Disable round-in-the-chamber
--Recoil Related
SWEP.Primary.KickUp			= 0.2					-- This is the maximum upwards recoil (rise)
SWEP.Primary.KickDown			= 0.2					-- This is the maximum downwards recoil (skeet)
SWEP.Primary.KickHorizontal			= 0.3					-- This is the maximum sideways recoil (no real term)
SWEP.Primary.StaticRecoilFactor = 0.05 	--Amount of recoil to directly apply to EyeAngles.  Enter what fraction or percentage (in decimal form) you want.  This is also affected by a convar that defaults to 0.5.
--Firing Cone Related
SWEP.Primary.Spread		= .005					--This is hip-fire acuracy.  Less is more (1 is horribly awful, .0001 is close to perfect)
SWEP.Primary.IronAccuracy = .0025	-- Ironsight accuracy, should be the same for shotguns
--Range Related
SWEP.Primary.Range = -1 -- The distance the bullet can travel in source units.  Set to -1 to autodetect based on damage/rpm.
SWEP.Primary.RangeFalloff = -1 -- The percentage of the range the bullet damage starts to fall off at.  Set to 0.8, for example, to start falling off after 80% of the range.
--Penetration Related
SWEP.MaxPenetrationCounter = 2 --The maximum number of ricochets.  To prevent stack overflows.
--Misc
SWEP.IronRecoilMultiplier=0.5 --Multiply recoil by this factor when we're in ironsights.  This is proportional, not inversely.
SWEP.CrouchRecoilMultiplier=0.65  --Multiply recoil by this factor when we're crouching.  This is proportional, not inversely.
SWEP.JumpRecoilMultiplier=1.3  --Multiply recoil by this factor when we're crouching.  This is proportional, not inversely.
SWEP.WallRecoilMultiplier=1.1  --Multiply recoil by this factor when we're changing state e.g. not completely ironsighted.  This is proportional, not inversely.
SWEP.ChangeStateRecoilMultiplier=1.3  --Multiply recoil by this factor when we're crouching.  This is proportional, not inversely.
SWEP.CrouchAccuracyMultiplier=0.5--Less is more.  Accuracy * 0.5 = Twice as accurate, Accuracy * 0.1 = Ten times as accurate
SWEP.ChangeStateAccuracyMultiplier=1.5 --Less is more.  A change of state is when we're in the progress of doing something, like crouching or ironsighting.  Accuracy * 2 = Half as accurate.  Accuracy * 5 = 1/5 as accurate
SWEP.JumpAccuracyMultiplier=2--Less is more.  Accuracy * 2 = Half as accurate.  Accuracy * 5 = 1/5 as accurate
SWEP.WalkAccuracyMultiplier=1.35--Less is more.  Accuracy * 2 = Half as accurate.  Accuracy * 5 = 1/5 as accurate
SWEP.IronSightTime = 0.3 --The time to enter ironsights/exit it.
SWEP.NearWallTime = 0.25 --The time to pull up  your weapon or put it back down
SWEP.ToCrouchTime = 0.05 --The time it takes to enter crouching state
SWEP.WeaponLength = 40 --Almost 3 feet Feet.  This should be how far the weapon sticks out from the player.  This is used for calculating the nearwall trace.
SWEP.MoveSpeed = 1 --Multiply the player's movespeed by this.
SWEP.IronSightsMoveSpeed = 0.8 --Multiply the player's movespeed by this when sighting.
SWEP.SprintFOVOffset = 3.75 --Add this onto the FOV when we're sprinting.
--[[PROJECTILES]]--
SWEP.ProjectileEntity = nil --Entity to shoot
SWEP.ProjectileVelocity = 0 --Entity to shoot's velocity
SWEP.ProjectileModel = nil --Entity to shoot's model
--[[VIEWMODEL]]--
SWEP.ViewModel			= "models/weapons/cstrike/c_rif_ak47.mdl" --Viewmodel path
SWEP.ViewModelFOV			= 56		-- This controls how big the viewmodel looks.  Less is more.
SWEP.ViewModelFlip			= false		-- Set this to true for CSS models, or false for everything else (with a righthanded viewmodel.)
SWEP.MaterialTable = nil --Make sure the viewmodel and the worldmodel have the same material ids.  Next, fill this in with your desired submaterials.
SWEP.UseHands = true --Use gmod c_arms system.
SWEP.VMPos = Vector(0,0,0) --The viewmodel positional offset, constantly.  Subtract this from any other modifications to viewmodel position.
SWEP.VMAng = Vector(0,0,0) --The viewmodel angular offset, constantly.   Subtract this from any other modifications to viewmodel angle.
SWEP.VMBodyGroups = nil --{
	--[0] = 1,
	--[1] = 4,
	--[2] = etc.
--}
--[[WORLDMODEL]]--
SWEP.WorldModel			= "models/weapons/w_irifle.mdl" -- Weapon world model path
SWEP.WMBodyGroups = nil--{
	--[0] = 1,
	--[1] = 4,
	--[2] = etc.
--}
SWEP.HoldType 				= "rpg"		-- This is how others view you carrying the weapon. Options include:
-- normal melee melee2 fist knife smg ar2 pistol rpg physgun grenade shotgun crossbow slam passive
-- You're mostly going to use ar2, smg, shotgun or pistol. rpg and crossbow make for good sniper rifles
SWEP.Offset = { --Procedural world model animation, defaulted for CS:S purposes.
        Pos = {
        Up = 1.75,
        Right = 0.5,
        Forward = 11.5,
        },
        Ang = {
        Up = -1,
        Right = -2,
        Forward = 178
        },
		Scale = 0.9
}
SWEP.ThirdPersonReloadDisable = false --Disable third person reload?  True disables.
--[[SCOPES]]--
--3dScopedBase stuff
SWEP.RTMaterialOverride = 0
SWEP.RTScopeAttachment = -1
SWEP.Scoped_3D = true
SWEP.ScopeReticule = "scope/gdcw_blue_nobar"
SWEP.Secondary.ScopeZoom = 8
SWEP.ScopeReticule_Scale = {2.5,2.5}
SWEP.Secondary.UseACOG			= false	 --Overlay option
SWEP.Secondary.UseMilDot			= false			 --Overlay option
SWEP.Secondary.UseSVD			= false		 --Overlay option
SWEP.Secondary.UseParabolic		= false		 --Overlay option
SWEP.Secondary.UseElcan			= false	 --Overlay option
SWEP.Secondary.UseGreenDuplex		= false		 --Overlay option
if surface then
	SWEP.Secondary.ScopeTable = nil --[[
		{
			scopetex = surface.GetTextureID("scope/gdcw_closedsight"),
			reticletex = surface.GetTextureID("scope/gdcw_acogchevron"),
			dottex = surface.GetTextureID("scope/gdcw_acogcross")
		}
	]]--
end
--[[
SWEP.IronSightsSensitivity = 0.25 --Useful for a RT scope.  Change this to 0.25 for 25% sensitivity.  This is if normal FOV compenstaion isn't your thing for whatever reason, so don't change it for normal scopes.
SWEP.BoltAction			= false  --Unscope/sight after you shoot?
SWEP.Scoped				= true  --Draw a scope overlay?
SWEP.ScopeOverlayThreshold = 0.875 --Percentage you have to be sighted in to see the scope.
SWEP.BoltTimerOffset = 0.25 --How long you stay sighted in after shooting, with a bolt action.
SWEP.ScopeScale = 0.55 --Scale of the scope overlay
SWEP.ReticleScale = 0.7 --Scale of the reticle overlay
--GDCW Overlay Options.  Only choose one.
SWEP.Secondary.UseACOG			= false	 --Overlay option
SWEP.Secondary.UseMilDot			= false			 --Overlay option
SWEP.Secondary.UseSVD			= false		 --Overlay option
SWEP.Secondary.UseParabolic		= false		 --Overlay option
SWEP.Secondary.UseElcan			= false	 --Overlay option
SWEP.Secondary.UseGreenDuplex		= true		 --Overlay option
if surface then
	SWEP.Secondary.ScopeTable = nil --[[
		{
			scopetex = surface.GetTextureID("scope/gdcw_closedsight"),
			reticletex = surface.GetTextureID("scope/gdcw_acogchevron"),
			dottex = surface.GetTextureID("scope/gdcw_acogcross")
		}
	--
end--]]
--[[SHOTGUN CODE]]--
SWEP.Shotgun = false --Enable shotgun style reloading.
SWEP.ShellTime			= .35 -- For shotguns, how long it takes to insert a shell.
--[[SPRINTING]]--
SWEP.RunSightsPos = Vector(0.0, -2, 0)
SWEP.RunSightsAng = Vector(-8.443, 10.553, -16.181)
--[[IRONSIGHTS]]--
SWEP.data 				= {}
SWEP.data.ironsights			= 1 --Enable Ironsights
SWEP.Secondary.IronFOV			= 16					-- How much you 'zoom' in. Less is more!  Don't have this be <= 0.  A good value for ironsights is like 70.
SWEP.IronSightsPos = Vector(-6.52, -11, 5)
SWEP.IronSightsAng = Vector(0, 0, 0)
--[[INSPECTION]]--
--[[VIEWMODEL ANIMATION HANDLING]]--
SWEP.ShootWhileDraw=false --Can you shoot while draw anim plays?
SWEP.AllowReloadWhileDraw=false --Can you reload while draw anim plays?
SWEP.SightWhileDraw=false --Can we sight in while the weapon is drawing / the draw anim plays?
SWEP.AllowReloadWhileHolster=true --Can we interrupt holstering for reloading?
SWEP.ShootWhileHolster=true --Cam we interrupt holstering for shooting?
SWEP.SightWhileHolster=false --Cancel out "iron"sights when we holster?
SWEP.UnSightOnReload=true --Cancel out ironsights for reloading.
SWEP.AllowReloadWhileSprinting=false --Can you reload when close to a wall and facing it?
SWEP.AllowReloadWhileNearWall=false --Can you reload when close to a wall and facing it?
SWEP.SprintBobMult=1.5 -- More is more bobbing, proportionally.  This is multiplication, not addition.  You want to make this > 1 probably for sprinting.
SWEP.IronBobMult=0  -- More is more bobbing, proportionally.  This is multiplication, not addition.  You want to make this < 1 for sighting, 0 to outright disable.
SWEP.IronBobMultWalk=0.2  -- More is more bobbing, proportionally.  This is multiplication, not addition.  You want to make this < 1 for sighting, 0 to outright disable.
SWEP.AllowViewAttachment = true --Allow the view to sway based on weapon attachment while reloading or drawing, IF THE CLIENT HAS IT ENABLED IN THEIR CONVARS!!!!11111oneONEELEVEN
--[[VIEWMODEL BLOWBACK]]--
SWEP.BlowbackEnabled = true --Enable Blowback?
SWEP.BlowbackVector = Vector(0,-2,0.1) --Vector to move bone <or root> relative to bone <or view> orientation.
SWEP.BlowbackCurrentRoot = 0 --Amount of blowback currently, for root
SWEP.BlowbackCurrent = 0 --Amount of blowback currently, for bones
SWEP.BlowbackBoneMods = nil --Viewmodel bone mods via SWEP Creation Kit
SWEP.Blowback_Only_Iron = true --Only do blowback on ironsights
SWEP.Blowback_PistolMode = false --Do we recover from blowback when empty?
SWEP.Blowback_Shell_Enabled = true
SWEP.Blowback_Shell_Effect = ""
SWEP.LuaShellEject = true
SWEP.LuaShellEjectDelay = 0
SWEP.LuaShellEffect = "" --Defaults to blowback
--[[HOLDTYPES]]--
SWEP.IronSightHoldTypeOverride=""  --This variable overrides the ironsights holdtype, choosing it instead of something from the above tables.  Change it to "" to disable.
SWEP.SprintHoldTypeOverride=""  --This variable overrides the sprint holdtype, choosing it instead of something from the above tables.  Change it to "" to disable.
--[[ANIMATION]]--
SWEP.ForceDryFireOff = true --Disables dryfire.  Set to false to enable them.
SWEP.DisableIdleAnimations = true --Disables idle animations.  Set to false to enable them.
SWEP.ForceEmptyFireOff = true --Disables empty fire animations.  Set to false to enable them.
--If you really want, you can remove things from SWEP.actlist and manually enable animations and set their lengths.
SWEP.SequenceEnabled = {} --Self explanitory.  This can forcefully enable or disable a certain ACT_VM
SWEP.SequenceLength = {}  --This controls the length of a certain ACT_VM
SWEP.SequenceLengthOverride={} --Override this if you want to change the length of a sequence but not the next idle
--[[EFFECTS]]--
--Muzzle Smoke
SWEP.SmokeParticles = { pistol = "smoke_trail_controlled",  --These are particle effects INSIDE a pcf file, not PCF files, that are played when you shoot.
	smg = "smoke_trail_tfa",
	grenade = "smoke_trail_tfa",
	ar2 = "smoke_trail_tfa",
	shotgun = "smoke_trail_wild",
	rpg = "smoke_trail_tfa",
	physgun = "smoke_trail_tfa",
	crossbow = "smoke_trail_tfa",
	melee = "smoke_trail_tfa",
	slam = "smoke_trail_tfa",
	normal = "smoke_trail_tfa",
	melee2 = "smoke_trail_tfa",
	knife = "smoke_trail_tfa",
	duel = "smoke_trail_tfa",
	camera = "smoke_trail_tfa",
	magic = "smoke_trail_tfa",
	revolver = "smoke_trail_tfa",
	silenced = "smoke_trail_controlled"
}
--Muzzle Flash
SWEP.MuzzleAttachment			= "1" 		-- Should be "1" for CSS models or "muzzle" for hl2 models
--SWEP.MuzzleAttachmentRaw = 1 --This will override whatever string you gave.  This is the raw attachment number.  This is overridden or created when a gun makes a muzzle event.
SWEP.ShellAttachment			= "2" 		-- Should be "2" for CSS models or "shell" for hl2 models
SWEP.DoMuzzleFlash = false --Do a muzzle flash?
SWEP.CustomMuzzleFlash = false --Disable muzzle anim events and use our custom flashes?
SWEP.AutoDetectMuzzleAttachment = false --For multi-barrel weapons, detect the proper attachment?
SWEP.MuzzleFlashEffect = "" --Change to a string of your muzzle flash effect.  Copy/paste one of the existing from the base.
--Shell eject override
SWEP.LuaShellEject = true
SWEP.LuaShellEjectDelay = 0.0
SWEP.LuaShellEffect = "" --Defaults to blowback
--Tracer Stuff
SWEP.Tracer				= 0		--Bullet tracer.  TracerName overrides this.
SWEP.TracerName 		= "effect_sw_laser_blue" 	--Change to a string of your tracer name.  Can be custom.
								--There is a nice example at https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/base/entities/effects/tooltracer.lua
SWEP.TracerCount 		= 1 	--0 disables, otherwise, 1 in X chance
SWEP.TracerLua 			= false --Use lua effect, TFA Muzzle syntax.  Currently obsolete.
SWEP.TracerDelay		= 0.01 --Delay for lua tracer effect
--Impact Effects
SWEP.ImpactEffect = "effect_sw_impact" --Impact Effect
--[[EVENT TABLE]]--
SWEP.EventTable = {} --Event Table, used for custom events when an action is played.  This can even do stuff like playing a pump animation after shooting.
--example:
--SWEP.EventTable = {
--	[ACT_VM_RELOAD] = {
--		{ ['time'] = 0.1, ['type'] = "lua", ['value'] = examplefunction, ['client'] = true, ['server'] = false  },
--		{ ['time'] = 0.2, ['type'] = "sound", ['value'] = Sound("ExampleGun.Sound1", ['client'] = true, ['server'] = false ) }
--	}
--}
--[[AKIMBO]]--
SWEP.Akimbo = false --Akimbo gun?  Alternates between primary and secondary attacks.
SWEP.AnimCycle = 0 -- Start on the right
--[[TTT]]--
local gm = engine.ActiveGamemode()
if string.find(gm,"ttt") or string.find(gm,"terrorist") then
	SWEP.Kind = WEAPON_HEAVY
	SWEP.AutoSpawnable = false
	SWEP.AllowDrop = true
	SWEP.AmmoEnt = "item_ammo_smg1_ttt"
end
--[[Stuff you SHOULD NOT touch after this]]--
--Allowed VAnimations.  These are autodetected, so not really needed except as an extra precaution.  Do NOT change these, unless absolutely necessary.
SWEP.CanDrawAnimate=true
SWEP.CanDrawAnimateEmpty=false
SWEP.CanDrawAnimateSilenced=false
SWEP.CanHolsterAnimate=true
SWEP.CanHolsterAnimateEmpty=false
SWEP.CanIdleAnimate=true
SWEP.CanIdleAnimateEmpty=false
SWEP.CanIdleAnimateSilenced=false
SWEP.CanShootAnimate=true
SWEP.CanShootAnimateSilenced=false
SWEP.CanReloadAnimate=true
SWEP.CanReloadAnimateEmpty=false
SWEP.CanReloadAnimateSilenced=false
SWEP.CanDryFireAnimate=false
SWEP.CanDryFireAnimateSilenced=false
SWEP.CanSilencerAttachAnimate=false
SWEP.CanSilencerDetachAnimate=false
--Misc
SWEP.ShouldDrawAmmoHUD=false--THIS IS PROCEDURALLY CHANGED AND SHOULD NOT BE TWEAKED.  BASE DEPENDENT VALUE.  DO NOT CHANGE OR THINGS MAY BREAK.  NO USE TO YOU.
SWEP.DefaultFOV=90 --BASE DEPENDENT VALUE.  DO NOT CHANGE OR THINGS MAY BREAK.  NO USE TO YOU.
--Disable secondary crap
SWEP.Secondary.ClipSize			= 0					-- Size of a clip
SWEP.Secondary.DefaultClip			= 0					-- Default ammo to give...
SWEP.Secondary.Automatic			= false					-- Automatic/Semi Auto
SWEP.Secondary.Ammo			= "none" -- Self explanitory, ammo type.
--Convar support
SWEP.ConDamageMultiplier = 1
SWEP.ViewModelBoneMods = {
	["v_weapon.AK47_Bolt"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
	["ValveBiped.Bip01_L_Clavicle"] = { scale = Vector(1.003, 1.003, 1.003), pos = Vector(-0.461, 1.5, -0.299), angle = Angle(0, 0, 0) },
	["ValveBiped.Bip01_L_Finger01"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(0, -15.417, 0) },
	["v_weapon.AK47_Parent"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
	["v_weapon.AK47_ClipRelease"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
	["v_weapon.AK47_Trigger"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
	["v_weapon.AK47_Clip"] = { scale = Vector(0.009, 0.009, 0.009), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) },
	["ValveBiped.Bip01_L_Finger0"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-2.346, 6.815, 0) }
}
SWEP.VElements = {
	["rtcircle"] = { type = "Model", model = "models/rtcircle.mdl", bone = "v_weapon.AK47_Parent", rel = "", pos = Vector(0.065, -5.45, 2.28), angle = Angle(90, 180, 90), size = Vector(0.333, 0.333, 0.333), color = Color(255, 255, 255, 255), surpresslightning = false, material = "!tfa_rtmaterial", skin = 0, bodygroup = {} },
	["wep"] = { type = "Model", model = "models/swbf3/rep/sniperrifle.mdl", bone = "v_weapon.AK47_Parent", rel = "", pos = Vector(-0.049, 0.875, -8.695), angle = Angle(-87.015, 88.999, 0), size = Vector(1, 1, 1), color = Color(255, 255, 255, 255), surpresslightning = true, material = "", skin = 0, bodygroup = {} }
}
SWEP.WElements = {
	["element_name"] = { type = "Model", model = "models/swbf3/rep/sniperrifle.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(13.164, 1.521, 0.76), angle = Angle(-15.735, -5, 178), size = Vector(1, 1, 1), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.ShowWorldModel = false
SWEP.Primary.ReloadSound = Sound("weapons/shared/standard_reload.ogg")
SWEP.DoProceduralReload = true --Do we reload using lua instead of a .mdl animation
SWEP.ProceduralReloadTime = 3 --Time to take when procedurally reloading, including transition in (but not out)
SWEP.ImpactDecal = "FadingScorch"
function SWEP:DrawHands()
	self.UseHandsDefault = self.UseHandsDefault or self.UseHands
	if !self.UseHandsDefault then return end
	if !IsValid(self) or !self:OwnerIsValid() then return end
	local vm = self.OwnerViewModel
	if !IsValid(vm) then return end

	if !IsValid(self.Owner.SWHands) then
		self.Owner.SWHands = ClientsideModel("models/weapons/c_clonearms.mdl")
		self.Owner.SWHands:SetParent(vm)
		self.Owner.SWHands:SetPos(self.Owner:GetShootPos())
		self.Owner.SWHands:SetAngles(self.Owner:EyeAngles())
		self.Owner.SWHands:AddEffects( EF_BONEMERGE )
		self.Owner.SWHands:SetNoDraw(true)
		self.Owner.SWHands.BoneMergedEnt = vm
	elseif self.Owner.SWHands:GetParent() != vm then
		self.Owner.SWHands:SetModel("models/weapons/c_clonearms.mdl")
		self.Owner.SWHands:SetParent(vm)
		self.Owner.SWHands:SetPos(self.Owner:GetShootPos())
		self.Owner.SWHands:SetAngles(self.Owner:EyeAngles())
		self.Owner.SWHands:AddEffects( EF_BONEMERGE )
	elseif self.Owner.SWHands:GetModel()!="models/weapons/c_clonearms.mdl" then
		self.Owner.SWHands:SetModel("models/weapons/c_clonearms.mdl")
	end

	if self.Owner.SWHands then
		self.Owner.SWHands:DrawModel()
	end

	self.UseHands = false

end
DEFINE_BASECLASS( SWEP.Base )


text:
#include <aws/ec2/model/Tag.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

#include <utility>

using namespace Aws::EC2::Model;
using namespace Aws::Utils::Xml;
using namespace Aws::Utils;

Tag::Tag() :
    m_keyHasBeenSet(false),
    m_valueHasBeenSet(false)
{
}

Tag::Tag(const XmlNode& xmlNode) :
    m_keyHasBeenSet(false),
    m_valueHasBeenSet(false)
{
  *this = xmlNode;
}

Tag& Tag::operator =(const XmlNode& xmlNode)
{
  XmlNode resultNode = xmlNode;

  if(!resultNode.IsNull())
  {
    XmlNode keyNode = resultNode.FirstChild("key");
    if(!keyNode.IsNull())
    {
      m_key = StringUtils::Trim(keyNode.GetText().c_str());
      m_keyHasBeenSet = true;
    }
    XmlNode valueNode = resultNode.FirstChild("value");
    if(!valueNode.IsNull())
    {
      m_value = StringUtils::Trim(valueNode.GetText().c_str());
      m_valueHasBeenSet = true;
    }
  }

  return *this;
}

void Tag::OutputToStream(Aws::OStream& oStream, const char* location, unsigned index, const char* locationValue) const
{
  if(m_keyHasBeenSet)
  {
      oStream << location << index << locationValue << ".Key=" << StringUtils::URLEncode(m_key.c_str()) << "&";
  }
  if(m_valueHasBeenSet)
  {
      oStream << location << index << locationValue << ".Value=" << StringUtils::URLEncode(m_value.c_str()) << "&";
  }
}

void Tag::OutputToStream(Aws::OStream& oStream, const char* location) const
{
  if(m_keyHasBeenSet)
  {
      oStream << location << ".Key=" << StringUtils::URLEncode(m_key.c_str()) << "&";
  }
  if(m_valueHasBeenSet)
  {
      oStream << location << ".Value=" << StringUtils::URLEncode(m_value.c_str()) << "&";
  }
}


text:
<?php
namespace oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2;

use un\unece\uncefact\data\specification\UnqualifiedDataTypesSchemaModule\_2;
/**
 * @xmlNamespace urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2
 * @xmlType IdentifierType
 * @xmlName IdentificationIDType
 * @var oasis\names\specification\ubl\schema\xsd\CommonBasicComponents_2\IdentificationIDType
 */
class IdentificationIDType
	extends _2\IdentifierType
	{

} // end class IdentificationIDType


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

import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.StreamingOutput;

import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.JsonSyntaxException;

import org.apache.aurora.gen.AuroraAdmin.Iface;
import org.apache.aurora.scheduler.storage.entities.AuroraAdminMetadata;
import org.apache.aurora.scheduler.thrift.Responses;
import org.apache.aurora.scheduler.thrift.aop.AnnotatedAuroraAdmin;

import static org.apache.aurora.scheduler.http.api.GsonMessageBodyHandler.GSON;

/**
 * A scheduler interface that allows interaction with the thrift API via traditional JSON,
 * rather than thrift's preferred means which uses field IDs.
 */
@Path(ApiBeta.PATH)
public class ApiBeta {
  static final String PATH = "/apibeta";

  private static final Logger LOG = Logger.getLogger(ApiBeta.class.getName());

  private final Iface api;

  @Inject
  ApiBeta(AnnotatedAuroraAdmin api) {
    this.api = Objects.requireNonNull(api);
  }

  private JsonElement getJsonMember(JsonObject json, String memberName) {
    return (json == null) ? null : json.get(memberName);
  }

  private static Response errorResponse(Status status, String message) {
    return Response.status(status)
        .entity(Responses.error(message))
        .build();
  }

  private static Response badRequest(String message) {
    return errorResponse(Status.BAD_REQUEST, message);
  }

  /**
   * Parses method parameters into the appropriate types.  For a method call to be successful,
   * the elements supplied in the request must match the names of those specified in the thrift
   * method definition.  If a method parameter does not exist in the request object, {@code null}
   * will be substituted.
   *
   * @param json Incoming request data, to translate into method parameters.
   * @param fields Field metadata map. Map iteration order must match the order
   *               defined in the thrift method.
   * @return Parsed method parameters.
   * @throws WebApplicationException If a parameter could not be parsed.
   */
  private Object[] readParams(JsonObject json, Map<String, Type> fields)
      throws WebApplicationException {

    List<Object> params = Lists.newArrayList();
    for (Map.Entry<String, Type> entry : fields.entrySet()) {
      try {
        params.add(GSON.fromJson(getJsonMember(json, entry.getKey()), entry.getValue()));
      } catch (JsonParseException e) {
        throw new WebApplicationException(
            e,
            badRequest("Failed to parse parameter " + entry.getKey() + ": " + e.getMessage()));
      }
    }
    return params.toArray();
  }

  private Method getApiMethod(String name, Map<String, Type> metadata) {
    try {
      return Iface.class.getMethod(name, metadata.values().toArray(new Class<?>[0]));
    } catch (NoSuchMethodException e) {
      throw Throwables.propagate(e);
    }
  }

  @POST
  @Path("{method}")
  @Produces(MediaType.APPLICATION_JSON)
  public Response invoke(@PathParam("method") String methodName, String postData) {
    if (LOG.isLoggable(Level.FINE)) {
      LOG.info("Call to " + methodName + " with data: " + postData);
    }

    // First, verify that this is a valid method on the interface.
    Map<String, Type> methodMetadata = AuroraAdminMetadata.METHODS.get(methodName);
    if (methodMetadata == null) {
      return errorResponse(Status.NOT_FOUND, "Method " + methodName + " does not exist.");
    }

    JsonObject parameters;
    try {
      JsonElement json = GSON.fromJson(postData, JsonElement.class);
      // The parsed object will be null if there was no post data.  This is okay, since that is
      // expected for a zero-parameter method.
      if (json != null && !(json instanceof JsonObject)) {
        throw new WebApplicationException(
            badRequest("Request data must be a JSON object of method parameters."));
      }
      parameters = (JsonObject) json;
    } catch (JsonSyntaxException e) {
      throw new WebApplicationException(e, badRequest("Request must be valid JSON"));
    }

    final Method method = getApiMethod(methodName, methodMetadata);
    final Object[] params = readParams(parameters, methodMetadata);
    return Response.ok(new StreamingOutput() {
      @Override
      public void write(OutputStream output) throws IOException {
        try {
          Object response = method.invoke(api, params);
          try (OutputStreamWriter out = new OutputStreamWriter(output, StandardCharsets.UTF_8)) {
            GSON.toJson(response, out);
          }
        } catch (IllegalAccessException | InvocationTargetException e) {
          throw Throwables.propagate(e);
        }
      }
    }).build();
  }

  @GET
  @Produces(MediaType.TEXT_HTML)
  public Response getIndex() {
    return Response.seeOther(URI.create("/apihelp/index.html")).build();
  }
}


text:
using System;
using System.Configuration;
using Nucleo.Providers.Configuration;

namespace Nucleo.DynamicExecution.Configuration
{
	public class DynamicExecutionPathSection : ConfigurationSection
	{
		#region " Properties "

		/// <summary>
		/// Gets or sets whether to fail the run on an exception thrown.
		/// </summary>
		[ConfigurationProperty("failOnException", DefaultValue = true)]
		public bool FailOnException
		{
			get { return (bool)this["failOnException"]; }
			set { this["failOnException"] = value; }
		}

		/// <summary>
		/// Gets or sets whether to fail the run on the first failure that occurs (using the custom event argument property).
		/// </summary>
		[ConfigurationProperty("failOnFirstFailure", DefaultValue = true)]
		public bool FailOnFirstFailure
		{
			get { return (bool)this["failOnFirstFailure"]; }
			set { this["failOnFirstFailure"] = value; }
		}

		public static DynamicExecutionPathSection Instance
		{
			get { return ConfigurationManager.GetSection("nucleo/dynamicExecutionPath") as DynamicExecutionPathSection; }
		}

		[
		ConfigurationProperty("methods", IsDefaultCollection=false),
		ConfigurationCollection(typeof(DynamicExecutionPathMethodElementCollection))
		]
		public DynamicExecutionPathMethodElementCollection Methods
		{
			get { return (DynamicExecutionPathMethodElementCollection)this["methods"]; }
		}

		[ConfigurationProperty("methodProviders")]
		public DynamicExecutionPathMethodProvidersElement MethodProviders
		{
			get { return this["methodProviders"] as DynamicExecutionPathMethodProvidersElement; }
		}

		#endregion
	}
}


text:
Option Strict On

Public Class frmAbout

    Private Sub frmAbout_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        wbAbout.DocumentText = My.Resources.about
    End Sub

    Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub

    Private Sub wbAbout_Navigating(sender As Object, e As WebBrowserNavigatingEventArgs) Handles wbAbout.Navigating
        Dim urlString As String = e.Url.ToString
        If urlString = "about:blank" Then Return
        e.Cancel = True
        Process.Start(urlString)
    End Sub

End Class


text:
Tumblr API for Clojure.  Work in progress.

I had trouble getting other API versions to work.  I'll get this one
to the point where it suits my purposes.  Then hopefully fill out the
rest of the API.  Working examples, for now, in `core.clj`.

## License

Copyright © 2015 John Jacobsen. MIT License (see LICENSE).

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


text:
describe Facter::Resolvers::Windows::Fips do
  describe '#resolve' do
    let(:reg) { instance_double('Win32::Registry::HKEY_LOCAL_MACHINE') }

    before do
      allow(reg).to receive(:close)
      allow(reg).to receive(:[]).with('Enabled').and_return(is_fips)
      allow(reg).to receive(:any?).and_yield('Enabled', '1')
      allow(Win32::Registry::HKEY_LOCAL_MACHINE).to receive(:open)
        .with('System\\CurrentControlSet\\Control\\Lsa\\FipsAlgorithmPolicy').and_return(reg)
    end

    after do
      Facter::Resolvers::Windows::Fips.invalidate_cache
    end

    context 'when field exists in registry' do
      let(:is_fips) { 255 }

      it 'detects that fips is enabled' do
        expect(Facter::Resolvers::Windows::Fips.resolve(:fips_enabled)).to be(true)
      end
    end

    context "when field doesn't exists in registry" do
      let(:is_fips) { 0 }

      it "detects that fips isn't enabled" do
        expect(Facter::Resolvers::Windows::Fips.resolve(:fips_enabled)).to be(false)
      end
    end
  end
end


text:
export class CardVendor {
    cardVendorId: Number;
    name: string;
    cardStart: Number;
}


text:
set -e

if [ $# -ne 1 ]; then
    echo "Usage: $1 <output file>"
    exit 2
fi

SCRIPTDIR=$(readlink -f "$(dirname "$0")")
REPOROOT=$(readlink -f "${SCRIPTDIR}/../../..")

if [ ! -d ${REPOROOT}/.git ]; then
    echo "Not in a git checkout. Not generating commit log for packaging."
    exit 0
fi

export GIT_DIR=${REPOROOT}/.git

last_bump_rev=`git log -1 --author='Crosswalk Release Engineering' --format='%H'`
if [ -z "${last_bump_rev}" ]; then
    echo "It looks like there has never been a version bump commit before."
    echo "Are you in src/xwalk?"
    exit 1
fi

OUTPUT=`readlink -f $1`
git log --no-merges --reverse --format='%s' $last_bump_rev.. > $OUTPUT


text:
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { basePageWrap } from '../BasePage';
import './HomePage.scss';

import Hero from 'Components/Hero';

class HomePage extends PureComponent {
    state = {};

    static defaultProps = {
        title: '',
    };

    static propTypes = {
        title: PropTypes.string.isRequired,
    };

    render() {
        const { title } = this.props;

        return (
            <div className="HomePage">
                <Hero title={title} />
            </div>
        );
    }
}

export default basePageWrap(HomePage);


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Sid** | Pointer to **string** | A 34 character string that uniquely identifies this resource. |
**AccountSid** | Pointer to **string** | The unique id of the Account that is responsible for this resource. |
**CredentialListSid** | Pointer to **string** | The unique id that identifies the credential list that includes this credential |
**Username** | Pointer to **string** | The username for this credential. |
**DateCreated** | Pointer to **string** | The date that this resource was created, given as GMT in RFC 2822 format. |
**DateUpdated** | Pointer to **string** | The date that this resource was last updated, given as GMT in RFC 2822 format. |
**Uri** | Pointer to **string** | The URI for this resource, relative to https://api.twilio.com |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
//
//  lwStoreManagerModel.h
//  shopCart
//
//  Created by lw on 16/4/28.
//  Copyright © 2016年 lw. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef enum : NSUInteger {
    lwStoreManagerModelTypeText = 0,
    lwStoreManagerModelTypeImg,
    lwStoreManagerModelTypeSelect,
    lwStoreManagerModelTypeMap
} lwStoreManagerModelType;

typedef enum : NSUInteger {
    lwStoreModelInputTypeNumber = 0,
    lwStoreModelInputTypeString
} lwStoreModelInputType;

NS_ASSUME_NONNULL_BEGIN

@interface lwStoreManagerModel : NSObject

/**标题*/
@property (copy, nonatomic) NSString *title;
/**内容类型*/
@property (assign, nonatomic) lwStoreManagerModelType type;
/**副标题*/
@property (copy, nonatomic) NSString *subtitle;
/**副标题的输入类型*/

/**只有在类型为图片的时候才用到*/
@property (retain, nonatomic) UIImage *img;

- (id)initWithDict:(NSDictionary *)dict;

@end

@interface lwStoreModel : NSObject

#pragma mark - 商家资料
@property (copy, nonatomic) NSString *merchantTitle;
@property (copy, nonatomic) NSString *merchantSubtitle;
@property (copy, nonatomic) NSString *managerAccount;
@property (copy, nonatomic) NSString *merchantArea;
@property (copy, nonatomic) NSString *detailAddress;
@property (copy, nonatomic) NSString *coordicate;
@property (copy, nonatomic) NSString *headerPic;
@property (copy, nonatomic) NSString *mallLogo;
@property (copy, nonatomic) NSString *merchantMail;

#pragma mark - 店主信息
@property (copy, nonatomic) NSString *merchantTelephone;
@property (copy, nonatomic) NSString *merchantIdCardNo;
@property (copy, nonatomic) NSString *merchantIdCardFront;
@property (copy, nonatomic) NSString *merchantIdCardBack;

#pragma mark - 营业执照
/// 统一社会信用代码
@property (copy, nonatomic) NSString *creditNo;
@property (copy, nonatomic) NSString *businessLicensePic;
@property (copy, nonatomic) NSString *mainIndustry;
@property (copy, nonatomic) NSString *subIndustry;

#pragma mark - 银行信息
@property (copy, nonatomic) NSString *bankName;
@property (copy, nonatomic) NSString *bankUsername;
@property (copy, nonatomic) NSString *bankCradNo;

@end

NS_ASSUME_NONNULL_END


text:
require 'native'

describe Array do
  describe '#to_n' do
    it 'converts an array with native objects to a JS array' do
      obj = [`{ key: 1 }`]
      native = obj.to_n
      `#{native}[0].key`.should == 1
    end
  end
end


text:
/// <reference path="../../_references.ts"/>

module powerbitests.customVisuals.sampleDataViews {
    import ValueType = powerbi.ValueType;

    export class MekkoChartData extends DataViewBuilder {
        public static ColumnCategory: string = "Name";
        public static ColumnSeries: string = "Territory";
        public static ColumnY: string = "This Year Sales";
        public static ColumnWidth: string = "Sum Total Units This Year";

        public valuesCaregorySeries: string[][] = [
                ["William", "DE"],
                ["James", "GA"],
                ["Harper", "KY"],
                ["Aiden", "MD"],
                ["Lucas", "NC"],
                ["Daniel", "OH"],
                ["Henry", "PA"],
                ["Olivia", "SC"],
                ["Ella", "TN"],
                ["Carter", "VA"],
                ["Logan", "WV"],
                ["James", "TN"],
                ["Aiden", "DE"],
                ["Daniel", "KY"],
                ["Henry", "SC"],
                ["Olivia", "NC"],
                ["Ella", "VA"],
                ["Logan", "MD"],
        ];
        public valuesY: number[] = helpers.getRandomNumbers(this.valuesCaregorySeries.length, 1000, 100000);
        public valuesWidth: number[] = helpers.getRandomNumbers(this.valuesCaregorySeries.length, 1000, 100000);

        public getDataView(columnNames?: string[]): powerbi.DataView {
            return this.createCategoricalDataViewBuilder([
            {
                source: {
                    displayName: MekkoChartData.ColumnCategory,
                    roles: { Category: true },
                    type: ValueType.fromDescriptor({ text: true })
                },
                values: this.valuesCaregorySeries.map(x => x[0])
            },
            {
                isGroup: true,
                source: {
                    displayName: MekkoChartData.ColumnSeries,
                    roles: { Series: true },
                    type: ValueType.fromDescriptor({ text: true })
                },
                values: this.valuesCaregorySeries.map(x => x[1]),
            }
            ],[
            {
                source: {
                    displayName: MekkoChartData.ColumnY,
                    format: "\"$\"#,##0;\\(\"$\"#,##0\\)",
                    roles: { Y: true },
                    isMeasure: true,
                    type: ValueType.fromDescriptor({ numeric: true })
                },
                values: this.valuesY
            },
            {
                source: {
                    displayName: MekkoChartData.ColumnWidth,
                    format: "\"$\"#,##0;\\(\"$\"#,##0\\)",
                    roles: { Width: true },
                    isMeasure: true,
                    type: ValueType.fromDescriptor({ numeric: true })
                },
                values: this.valuesWidth
            }], columnNames).build();
        }
    }
}


text:
package io.milton.http.webdav;

import java.util.HashMap;
import java.util.Map;
import java.util.Stack;

import javax.xml.namespace.QName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class PropFindSaxHandler extends DefaultHandler {

    private static final Logger log = LoggerFactory.getLogger( PropFindSaxHandler.class );

    private Stack<QName> elementPath = new Stack<QName>();
    private Map<QName, String> attributes = new HashMap<QName, String>();
    private StringBuilder sb = new StringBuilder();
    private boolean inProp;
    private boolean allProp;

    @Override
    public void startElement( String uri, String localName, String name, Attributes attributes ) throws SAXException {
        if( elementPath.size() > 0 ) {
            String elname = elementPath.peek().getLocalPart();
            if( elname.equals( "prop" ) ) {
                inProp = true;
            }
        }
        if( localName.equals( "allprop" ) ) {
            allProp = true;
        }

        QName qname = new QName( uri, localName );
        elementPath.push( qname );
        super.startElement( uri, localName, name, attributes );
    }

    @Override
    public void characters( char[] ch, int start, int length ) throws SAXException {
        if( inProp ) {
            sb.append( ch, start, length );
        }
    }

    @Override
    public void endElement( String uri, String localName, String name ) throws SAXException {
        elementPath.pop();
        if( elementPath.size() > 0 && elementPath.peek().getLocalPart().endsWith( "prop" ) ) {
            if( sb != null ) {
//                uri = uri.substring( 0, uri.length()-1); // need to strip trailing :
                QName qname = new QName( uri, localName );
                getAttributes().put( qname, sb.toString().trim() );
            }
            sb.delete( 0, sb.length() );
        }

        super.endElement( uri, localName, name );
    }

    public Map<QName, String> getAttributes() {
        return attributes;
    }

    public boolean isAllProp() {
        return allProp;
    }
}


text:
@interface BusinessLocation ()
@end

@implementation BusinessLocation

- (id)initWithBusiness:(Business *)business {
    if ((self = [super init])) {
        self.business = business;
    }
    return self;
}

- (NSString *)title {
    return _business.name;
}

- (NSString *)subtitle {
    return _business.address;
}

- (CLLocationCoordinate2D)coordinate {
    return CLLocationCoordinate2DMake(_business.latitude, _business.longitude);
}

- (MKMapItem*)mapItem {
    //NSDictionary *addressDict = @{(NSString*)kABPersonAddressStreetKey : _address};

    MKPlacemark *placemark = [[MKPlacemark alloc]
                              initWithCoordinate:self.coordinate
                              addressDictionary:nil];

    MKMapItem *mapItem = [[MKMapItem alloc] initWithPlacemark:placemark];
    mapItem.name = self.title;

    return mapItem;
}

@end


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title></title>

    <link rel="stylesheet" type="text/css" href="../../ui/arongi/font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="../../ui/arongi/page.css" />
    <link rel="stylesheet" type="text/css" href="../../ui/arongi/AXJ.min.css" />

    <button class="AXButton">액시스제이</button>
    액시스제이
    <input type="button" class="AXButton" value="액시스제이" />

    <button class="AXButton Red">액시스제이</button>
    <button class="AXButton Green">액시스제이</button>
    <button class="AXButton Blue">액시스제이</button>
    <button class="AXButton Classic">액시스제이</button>

    <button class="AXButtonLarge Red"> 액시스제이</button>
    <button class="AXButtonSmall Green"> 액시스제이</button>
    <button class="AXButton Blue"> 액시스제이</button>
    <button class="AXButton Classic W200"> 액시스제이</button>


text:
ifndef buildDir
buildDir =	$(CURDIR)/..
endif

include $(buildDir)/config/config.mk
include $(buildDir)/config/platform.mk
include $(buildDir)/config/directories.mk
include $(buildDir)/config/common.mk

extendedICAT.h =	$(buildDir)/modules/extendedICAT/extendedICAT.h

#
# Source files
#	core	utility functions
#	md5	MD5 hash generation functions
#	api	client API functions (LIB_API_OBJS is set by api.mk)
#
# Core
LIB_CORE_OBJS =	\
		$(libCoreObjDir)/base64.o \
		$(libCoreObjDir)/chksumUtil.o \
		$(libCoreObjDir)/clientLogin.o \
		$(libCoreObjDir)/cpUtil.o \
		$(libCoreObjDir)/getRodsEnv.o \
		$(libCoreObjDir)/getUtil.o \
		$(libCoreObjDir)/lsUtil.o \
		$(libCoreObjDir)/miscUtil.o \
		$(libCoreObjDir)/mkdirUtil.o \
		$(libCoreObjDir)/msParam.o \
		$(libCoreObjDir)/mvUtil.o \
		$(libCoreObjDir)/obf.o \
		$(libCoreObjDir)/packStruct.o \
		$(libCoreObjDir)/parseCommandLine.o \
		$(libCoreObjDir)/phymvUtil.o \
		$(libCoreObjDir)/procApiRequest.o \
		$(libCoreObjDir)/putUtil.o \
		$(libCoreObjDir)/rcConnect.o \
		$(libCoreObjDir)/rcMisc.o \
		$(libCoreObjDir)/rcPortalOpr.o \
		$(libCoreObjDir)/regUtil.o \
		$(libCoreObjDir)/replUtil.o \
		$(libCoreObjDir)/rmUtil.o \
		$(libCoreObjDir)/rmtrashUtil.o \
		$(libCoreObjDir)/rodsLog.o \
		$(libCoreObjDir)/rodsPath.o \
		$(libCoreObjDir)/rsyncUtil.o \
		$(libCoreObjDir)/sockComm.o \
		$(libCoreObjDir)/stringOpr.o \
		$(libCoreObjDir)/trimUtil.o	\
		$(libCoreObjDir)/mcollUtil.o	\
		$(libCoreObjDir)/bunUtil.o	\
		$(libCoreObjDir)/phybunUtil.o \
		$(libCoreObjDir)/scanUtil.o \
		$(libCoreObjDir)/fsckUtil.o \
		$(libCoreObjDir)/osauth.o \
		$(libCoreObjDir)/sslSockComm.o

ifdef NETCDF_CLIENT
LIB_CORE_OBJS += $(libCoreObjDir)/ncattrUtil.o $(libCoreObjDir)/ncUtil.o
endif

ifdef USE_BOOST_ASIO
LIB_CORE_OBJS += $(libCoreObjDir)/socket_wrapper.o
endif

ifdef GSI_AUTH
LIB_CORE_OBJS += $(libCoreObjDir)/igsi.o
endif
ifdef KRB_AUTH
LIB_CORE_OBJS += $(libCoreObjDir)/ikrb.o
ifdef GSI_AUTH
# when using both KRB and GSI, include the KRB wrapper
LIB_CORE_OBJS += $(libCoreObjDir)/ikrbGSSAPIWrapper.o
endif
endif
INCLUDES +=	-I$(libCoreIncDir)

ifdef EXTENDED_ICAT
CFLAGS +=	-DEXTENDED_ICAT
INCLUDES +=	-I$(svrExtIcatIncDir)
endif

ifdef OOI_CI
LIB_CORE_OBJS += $(libCoreObjDir)/ooiCi.o
endif

# Logging (automatically generated source)
LOG_SRC =	$(libCoreSrcDir)/rodsLog.c

# MD5
LIB_MD5_OBJS =	\
		$(libMd5ObjDir)/md5c.o \
		$(libMd5ObjDir)/md5Checksum.o
INCLUDES +=	-I$(libMd5IncDir)

# rbudp
ifdef RBUDP_TRANSFER
LIB_RBUDP_OBJS =  \
		$(libRbudpObjDir)/QUANTAnet_rbudpBase_c.o \
		$(libRbudpObjDir)/QUANTAnet_rbudpSender_c.o 	\
		$(libRbudpObjDir)/QUANTAnet_rbudpReceiver_c.o
endif

# GSI
ifdef GSI_AUTH
INCLUDES += 	-I$(GLOBUS_LOCATION)/include/$(GSI_INSTALL_TYPE)
endif

# Kerberos
ifdef KRB_AUTH
ifdef KRB_LOCATION
INCLUDES += 	-I$(KRB_LOCATION)/include
endif
endif

# API (see api.mk, which is automatically generated)
include $(buildDir)/config/api.mk
INCLUDES +=	-I$(libApiIncDir)

# All objects
OBJS =		$(LIB_CORE_OBJS) $(LIB_API_OBJS) $(LIB_MD5_OBJS)	\
		$(LIB_RBUDP_OBJS)

# Server configuration
CONFIG =	$(svrConfigDir)/server.config $(svrConfigDir)/irodsHost

# Compilation flags
CFLAGS_OPTIONS := $(CFLAGS) $(MY_CFLAG)
CFLAGS =	$(CFLAGS_OPTIONS) $(INCLUDES) $(SVR_INCLUDES)

MD5_CFLAGS_OPTIONS := $(CFLAGS_OPTIONS)
MD5_CFLAGS =	$(CFLAGS)
ifeq ($(CC_IS_GCC), 1)
MD5_CFLAGS_OPTIONS += -O3
MD5_CFLAGS += -O3
endif
ifdef GSI_AUTH
CFLAGS_OPTIONS += -D GSI_AUTH
endif
ifdef KRB_AUTH
CFLAGS_OPTIONS += -D KRB_AUTH
endif
ifdef PAM_AUTH
CFLAGS_OPTIONS += -D PAM_AUTH
endif
ifdef USE_SSL
CFLAGS_OPTIONS += -D USE_SSL
endif
ifdef IRODS_SYSLOG
CFLAGS_OPTIONS += -D IRODS_SYSLOG
endif

#
# Princpal Targets
#
.PHONY:	all lib libs clean print_cflags
vpath %c	$(libCoreSrcDir) $(libApiSrcDir) $(libMd5SrcDir) 	\
		$(libRbudpSrcDir)

# Build everything
all:	libs
	@true

# Build the library
lib:	libs
	@true

libs:	print_cflags $(CONFIG) $(LOG_SRC) $(LIBRARY)
	@true

$(LIBRARY): $(OBJS)
	@echo "Building lib$(LIBRARY_NAME).a"
	@rm -f $(LIBRARY)
	@$(AR) $(AROPT) $(LIBRARY) $^
	@$(RANLIB) $(LIBRARY)

# Server configuration
$(svrConfigDir)/irodsHost:
	@$(MAKE) --no-print-directory -C .. config

$(svrConfigDir)/server.config:
	@$(MAKE) --no-print-directory -C .. config

# Show compile flags
print_cflags:
	@echo "Compile flags:"
	@echo "    $(CFLAGS_OPTIONS)"
	@echo "MD5-only compile flags:"
	@echo "    $(MD5_CFLAGS_OPTIONS)"

# Clean
clean:
	@echo "Cleaning library..."
	@rm -f $(OBJS)
	@rm -f $(LIBRARY)

#
# Compilation Targets
#
# Build core
$(LIB_CORE_OBJS):  $(libCoreObjDir)/%.o: $(libCoreSrcDir)/%.c $(extendedICAT.h) $(DEPEND)
	@echo "Compile core `basename $@`..."
	@$(CC) -c $(CFLAGS) -o $@ $<
$(extendedICAT.h):
	@touch $(extendedICAT.h)

# Build API
$(LIB_API_OBJS):  $(libApiObjDir)/%.o: $(libApiSrcDir)/%.c $(DEPEND)
	@echo "Compile api `basename $@`..."
	@$(CC) -c $(CFLAGS) -o $@ $<

# Build MD5
#	Requires -O3 for optimization
$(LIB_MD5_OBJS):  $(libMd5ObjDir)/%.o: $(libMd5SrcDir)/%.c $(configMk) $(platformMk)
	@echo "Compile md5 `basename $@`..."
	@$(CC) -c $(MD5_CFLAGS) -o $@ $<

ifdef RBUDP_TRANSFER
$(LIB_RBUDP_OBJS):  $(libRbudpObjDir)/%.o: $(libRbudpSrcDir)/%.c $(configMk) $(platformMk)
	@echo "Compile rbudp `basename $@`..."
	@$(CC) -c $(CFLAGS) -o $@ $<
endif

# Build logging source
rodslog:  $(libCoreSrcDir)/rodsLog.c
	@true

$(libCoreSrcDir)/rodsLog.c:  $(libCoreIncDir)/rodsErrorTable.h
	@$(PERL) $(perlScriptsDir)/updateRodsLog.pl


text:
#ifndef MAILBOX_LIST_INDEX_H
#define MAILBOX_LIST_INDEX_H

/* Mailbox list index basically contains:

   Header contains ID => name mapping. The name isn't the full mailbox name,
   but rather each hierarchy level has its own ID and name. For example a
   mailbox name "foo/bar" (with '/' as separator) would have separate IDs for
   "foo" and "bar" names.

   The records contain { parent_uid, uid, name_id } field that can be used to
   build the whole mailbox tree. parent_uid=0 means root, otherwise it's the
   parent node's uid.

   Each record also contains GUID for each selectable mailbox. If a mailbox
   is recreated using the same name, its GUID also changes. Note however that
   the UID doesn't change, because the UID refers to the mailbox name, not to
   the mailbox itself.

   The records may contain also extensions for allowing mailbox_get_status()
   to return values directly from the mailbox list index. Storage backends
   may also add their own extensions to figure out if a record is up to date.
*/

#include "module-context.h"
#include "mail-types.h"
#include "mail-storage.h"
#include "mailbox-list-private.h"

#define MAILBOX_LIST_INDEX_HIERARHCY_SEP '~'
#define MAILBOX_LIST_INDEX_PREFIX "dovecot.list.index"

#define INDEX_LIST_CONTEXT(obj) \
	MODULE_CONTEXT(obj, mailbox_list_index_module)

struct mail_index_view;

/* stored in mail_index_record.flags: */
enum mailbox_list_index_flags {
	MAILBOX_LIST_INDEX_FLAG_NONEXISTENT = MAIL_DELETED,
	MAILBOX_LIST_INDEX_FLAG_NOSELECT = MAIL_DRAFT,
	MAILBOX_LIST_INDEX_FLAG_NOINFERIORS = MAIL_ANSWERED,

	/* set during syncing for mailboxes that still exist */
	MAILBOX_LIST_INDEX_FLAG_SYNC_EXISTS = MAIL_FLAGGED
};

struct mailbox_list_index_header {
	uint8_t refresh_flag;
	/* array of { uint32_t id; char name[]; } */
};

struct mailbox_list_index_record {
	/* points to given id in header */
	uint32_t name_id;
	/* parent mailbox's UID, 0 = root */
	uint32_t parent_uid;

	/* the following fields are temporarily zero while unknown,
	   also permanently zero for \NoSelect and \Nonexistent mailboxes: */

	guid_128_t guid;
	uint32_t uid_validity;
};

struct mailbox_list_index_msgs_record {
	uint32_t messages;
	uint32_t unseen;
	uint32_t recent;
	uint32_t uidnext;
};

struct mailbox_list_index_node {
	struct mailbox_list_index_node *parent;
	struct mailbox_list_index_node *next;
	struct mailbox_list_index_node *children;

	uint32_t name_id, uid;
	enum mailbox_list_index_flags flags;
	const char *name;
};

struct mailbox_list_index {
	union mailbox_list_module_context module_ctx;

	const char *path;
	struct mail_index *index;
	uint32_t ext_id, msgs_ext_id, hmodseq_ext_id, subs_hdr_ext_id;

	pool_t mailbox_pool;
	/* uin32_t id => name */
	HASH_TABLE(void *, char *) mailbox_names;
	uint32_t highest_name_id;

	struct mailbox_list_index_sync_context *sync_ctx;
	uint32_t sync_log_file_seq;
	uoff_t sync_log_file_offset;
	uint32_t sync_stamp;
	struct timeout *to_refresh;

	/* uint32_t uid => node */
	HASH_TABLE(void *, struct mailbox_list_index_node *) mailbox_hash;
	struct mailbox_list_index_node *mailbox_tree;

	unsigned int pending_init:1;
	unsigned int opened:1;
	unsigned int syncing:1;
	unsigned int updating_status:1;
	unsigned int has_backing_store:1;
};

struct mailbox_list_index_iterate_context {
	struct mailbox_list_iterate_context ctx;
	struct mailbox_list_iterate_context *backend_ctx;
	pool_t mailbox_pool;

	struct mailbox_info info;
	pool_t info_pool;

	unsigned int parent_len;
	string_t *path;
	struct mailbox_list_index_node *next_node;

	unsigned int failed:1;
};

extern MODULE_CONTEXT_DEFINE(mailbox_list_index_module,
			     &mailbox_list_module_register);

void mailbox_list_index_set_index_error(struct mailbox_list *list);
struct mailbox_list_index_node *
mailbox_list_index_lookup(struct mailbox_list *list, const char *name);
struct mailbox_list_index_node *
mailbox_list_index_lookup_uid(struct mailbox_list_index *ilist, uint32_t uid);
void mailbox_list_index_node_get_path(const struct mailbox_list_index_node *node,
				      char sep, string_t *str);
void mailbox_list_index_node_unlink(struct mailbox_list_index *ilist,
				    struct mailbox_list_index_node *node);

bool mailbox_list_index_need_refresh(struct mailbox_list_index *ilist,
				     struct mail_index_view *view);
int mailbox_list_index_refresh(struct mailbox_list *list);
void mailbox_list_index_refresh_later(struct mailbox_list *list);

struct mailbox_list_index_node *
mailbox_list_index_node_find_sibling(struct mailbox_list_index_node *node,
				     const char *name);
void mailbox_list_index_reset(struct mailbox_list_index *ilist);
int mailbox_list_index_parse(struct mailbox_list *list,
			     struct mail_index_view *view, bool force);

struct mailbox_list_iterate_context *
mailbox_list_index_iter_init(struct mailbox_list *list,
			     const char *const *patterns,
			     enum mailbox_list_iter_flags flags);
const struct mailbox_info *
mailbox_list_index_iter_next(struct mailbox_list_iterate_context *ctx);
int mailbox_list_index_iter_deinit(struct mailbox_list_iterate_context *ctx);

bool mailbox_list_index_status(struct mailbox_list *list,
			       struct mail_index_view *view,
			       uint32_t seq, enum mailbox_status_items items,
			       struct mailbox_status *status_r,
			       uint8_t *mailbox_guid);
void mailbox_list_index_status_set_info_flags(struct mailbox *box, uint32_t uid,
					      enum mailbox_info_flags *flags);
void mailbox_list_index_update_mailbox_index(struct mailbox *box,
					     const struct mailbox_update *update);

int mailbox_list_index_notify_init(struct mailbox_list *list,
				   enum mailbox_list_notify_event mask,
				   struct mailbox_list_notify **notify_r);
void mailbox_list_index_notify_deinit(struct mailbox_list_notify *notify);
int mailbox_list_index_notify_next(struct mailbox_list_notify *notify,
				   const struct mailbox_list_notify_rec **rec_r);
void mailbox_list_index_notify_wait(struct mailbox_list_notify *notify,
				    void (*callback)(void *context),
				    void *context);

void mailbox_list_index_status_init_mailbox(struct mailbox *box);
void mailbox_list_index_backend_init_mailbox(struct mailbox *box);
void mailbox_list_index_status_init_finish(struct mailbox_list *list);

#endif


text:
using System;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Messaging;

namespace Beyova.AOP
{
    /// <summary>
    /// Class BaseAOPMessageProcessor.
    /// </summary>
    [Obsolete("MarshalObject Based AOP is retired. Please use Proxy based AOP")]
    internal class AOPMessageProcessor : IContextProperty, IContributeObjectSink
    {
        /// <summary>
        /// The handle exception delegate
        /// </summary>
        protected MethodMessageInjectionDelegates messageDelegates;

        /// <summary>
        /// Initializes a new instance of the <see cref="AOPMessageProcessor" /> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="messageDelegates">The message delegates.</param>
        public AOPMessageProcessor(string name, MethodMessageInjectionDelegates messageDelegates)
        {
            this.Name = name;
            this.messageDelegates = messageDelegates;
        }

        #region IContextProperty Member

        /// <summary>
        /// Called when the context is frozen.
        /// </summary>
        /// <param name="newContext">The context to freeze.</param>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
        ///   </PermissionSet>
        public virtual void Freeze(Context newContext)
        {
        }

        /// <summary>
        /// Returns a Boolean value indicating whether the context property is compatible with the new context.
        /// </summary>
        /// <param name="newCtx">The new context in which the <see cref="T:System.Runtime.Remoting.Contexts.ContextProperty" /> has been created.</param>
        /// <returns>true if the context property can coexist with the other context properties in the given context; otherwise, false.</returns>
        public virtual bool IsNewContextOK(Context newCtx)
        {
            return true;
        }

        /// <summary>
        /// Gets the name of the property under which it will be added to the context.
        /// </summary>
        /// <value>The name.</value>
        /// <returns>The name of the property.</returns>
        ///   <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Infrastructure" />
        ///   </PermissionSet>
        public string Name
        {
            get;
            protected set;
        }

        #endregion IContextProperty Member

        #region IContributeObjectSink Member

        /// <summary>
        /// Chains the message sink of the provided server object in front of the given sink chain.
        /// </summary>
        /// <param name="obj">The server object which provides the message sink that is to be chained in front of the given chain.</param>
        /// <param name="nextSink">The chain of sinks composed so far.</param>
        /// <returns>The composite sink chain.</returns>
        public IMessageSink GetObjectSink(MarshalByRefObject obj, System.Runtime.Remoting.Messaging.IMessageSink nextSink)
        {
            return new AOPSinkProcessor(obj, nextSink, this.messageDelegates);
        }

        #endregion IContributeObjectSink Member
    }
}


text:
#include "iterhash.h"

NAMESPACE_BEGIN(CryptoPP)

/// SHA-1
class SHA : public IteratedHashWithStaticTransform<word32, BigEndian, 64, SHA>
{
public:
	enum {DIGESTSIZE = 20};
	SHA() : IteratedHashWithStaticTransform<word32, BigEndian, 64, SHA>(DIGESTSIZE) {Init();}
	static void Transform(word32 *digest, const word32 *data);
	static const char *StaticAlgorithmName() {return "SHA-1";}

protected:
	void Init();
};

typedef SHA SHA1;

//! implements the SHA-256 standard
class SHA256 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, SHA256>
{
public:
	enum {DIGESTSIZE = 32};
	SHA256() : IteratedHashWithStaticTransform<word32, BigEndian, 64, SHA256>(DIGESTSIZE) {Init();}
	static void Transform(word32 *digest, const word32 *data);
	static const char *StaticAlgorithmName() {return "SHA-256";}

protected:
	void Init();

	static const word32 K[64];
};

#ifdef WORD64_AVAILABLE

//! implements the SHA-512 standard
class SHA512 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, SHA512>
{
public:
	enum {DIGESTSIZE = 64};
	SHA512() : IteratedHashWithStaticTransform<word64, BigEndian, 128, SHA512>(DIGESTSIZE) {Init();}
	static void Transform(word64 *digest, const word64 *data);
	static const char *StaticAlgorithmName() {return "SHA-512";}

protected:
	void Init();

	static const word64 K[80];
};

//! implements the SHA-384 standard
class SHA384 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, SHA512>
{
public:
	enum {DIGESTSIZE = 48};
	SHA384() : IteratedHashWithStaticTransform<word64, BigEndian, 128, SHA512>(64) {Init();}
	unsigned int DigestSize() const {return DIGESTSIZE;};
	static const char *StaticAlgorithmName() {return "SHA-384";}

protected:
	void Init();
};

#endif

NAMESPACE_END

#endif


text:
<!DOCTYPE html>

    <meta charset='utf-8' />
    <meta http-equiv="X-UA-Compatible" content="chrome=1" />
    <meta name="description" content="PSICK: Puppet Systems Intrastructure Construction Kit" />
    <link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
    <link rel="stylesheet" type="text/css" href="stylesheets/angular-wizard.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <title>PSICK: Puppet Systems Intrastructure Construction Kit</title>

          View on GitHub

PSICK Setup

Create your Puppet control-repo step by step

Building a Puppet control repo

A single [git] repository that contains all you need to setup a Puppet infrastructure: code, data, references to external modules.

An essential skeleton .

        <button ng-click="stepToggle()">Toggle</button>
        <wizard on-finish="finished()" indicators-position="bottom" name="topWizard">
          <wz-step wz-title="manifest" canexit="exitWithAPromise">

Everything starts from the manifest dir

It's the first place where Puppet starts to evaluate our code.

Historically the main manifest here has always been site.ppIt's the first place where Puppet starts to evaluate our code.

            <input type="submit" wz-next value="NEXT"/>
          </wz-step>
          <wz-step wz-title="hiera" canexit="exitValidation">

Hiera, data, hierarchies, and everything

Hiera remains the choice of reference for managing Puppet data, and in any case is the choice we currently prefer.

            <input type="button" wz-previous="logStep()" value="BACK" />
            <input type="button" wz-next="logStep()" value="NEXT" />
          </wz-step>
          <wz-step wz-title="profiles" canexit="exitValidation">

Our site profiles [and tools]

You're now in the second step of this wizard.

            <input type="button" wz-previous="logStep()" value="BACK" />
            <input type="button" wz-next="logStep()" value="NEXT" />
          </wz-step>
          <wz-step wz-title="modules">

The Puppetfile and all the modules we need

            <input type="button" wz-previous="logStep()" value="BACK" />
            <input type="button" wz-next="logStep()" value="NEXT" />
          </wz-step>
          <wz-step wz-title="extra">

Integrations with tools and technologies

The full PSICK setup has integrations with third party tools. We recommended them all, but you can pick only the ones you prefer.

Fabric

Vagrant

Docker

            <input type="button" wz-previous="logStep()" value="BACK" />
            <input type="button" wz-next="logStep()" value="NEXT" />
          </wz-step>
          <wz-step wz-title="finish">

Good. Let's review how your new control repo looks like

            <input type="button" wz-previous="logStep()" value="BACK" />
            <input type="button" wz-next="logStep()" value="END" />
            <input type="button" ng-click="goBack()" value="Click here to start again" />
            <input type="button" wz-reset value="Click here to reset" />
          </wz-step>
        </wizard>

Angular-wizard maintained by mgonto

Published with GitHub Pages


text:
<?php

namespace Symfony\Component\HttpKernel\EventListener;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Profiler\Profiler;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;

/**
 * ProfilerListener collects data for the current request by listening to the onCoreResponse event.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class ProfilerListener
{
    protected $profiler;
    protected $matcher;
    protected $onlyException;
    protected $onlyMasterRequests;
    protected $exception;
    protected $children;

    /**
     * Constructor.
     *
     * @param Profiler                $profiler           A Profiler instance
     * @param RequestMatcherInterface $matcher            A RequestMatcher instance
     * @param Boolean                 $onlyException      true if the profiler only collects data when an exception occurs, false otherwise
     * @param Boolean                 $onlyMasterRequests true if the profiler only collects data when the request is a master request, false otherwise
     */
    public function __construct(Profiler $profiler, RequestMatcherInterface $matcher = null, $onlyException = false, $onlyMasterRequests = false)
    {
        $this->profiler = $profiler;
        $this->matcher = $matcher;
        $this->onlyException = (Boolean) $onlyException;
        $this->onlyMasterRequests = (Boolean) $onlyMasterRequests;
        $this->children = array();
    }

    /**
     * Handles the onCoreException event.
     *
     * @param GetResponseForExceptionEvent $event A GetResponseForExceptionEvent instance
     */
    public function onCoreException(GetResponseForExceptionEvent $event)
    {
        if ($this->onlyMasterRequests && HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
            return;
        }

        $this->exception = $event->getException();
    }

    /**
     * Handles the onCoreResponse event.
     *
     * @param FilterResponseEvent $event A FilterResponseEvent instance
     */
    public function onCoreResponse(FilterResponseEvent $event)
    {
        $master = HttpKernelInterface::MASTER_REQUEST === $event->getRequestType();
        if ($this->onlyMasterRequests && !$master) {
            return;
        }

        if ($this->onlyException && null === $this->exception) {
            return;
        }

        $exception = $this->exception;
        $this->exception = null;

        if (null !== $this->matcher && !$this->matcher->matches($event->getRequest())) {
            return;
        }

        if ($profile = $this->profiler->collect($event->getRequest(), $event->getResponse(), $exception)) {
            if ($master) {
                $this->profiler->saveProfile($profile);
                foreach ($this->children as $child) {
                    $child->setParent($profile);
                    $this->profiler->saveProfile($child);
                }
                $this->children = array();
            } else {
                $this->children[] = $profile;
            }
        }
    }
}


text:
module EventMachine
  # Support for Erlang-style processes.
  #
  class SpawnedProcess
    # Send a message to the spawned process
    def notify *x
      me = self
      EM.next_tick {
        # A notification executes in the context of this
        # SpawnedProcess object. That makes self and notify
        # work as one would expect.
        #
        y = me.call(*x)
        if y and y.respond_to?(:pull_out_yield_block)
          a,b = y.pull_out_yield_block
          set_receiver a
          self.notify if b
        end
      }
    end
    alias_method :resume, :notify
    alias_method :run, :notify # for formulations like (EM.spawn {xxx}).run
    #attr_accessor :receiver

    #--
    # I know I'm missing something stupid, but the inside of class << s
    # can't see locally-bound values. It can see globals, though.
    def set_receiver blk
      $em______tmpglobal = blk
      class << self
        define_method :call, $em______tmpglobal.dup
      end
    end

  end

  class YieldBlockFromSpawnedProcess # :nodoc:
    def initialize block, notify
      @block = [block,notify]
    end
    def pull_out_yield_block
      @block
    end
  end

  # Spawn an erlang-style process
  def self.spawn &block
    s = SpawnedProcess.new
    s.set_receiver block
    s
  end

  def self.yield &block # :nodoc:
    return YieldBlockFromSpawnedProcess.new( block, false )
  end

  def self.yield_and_notify &block # :nodoc:
    return YieldBlockFromSpawnedProcess.new( block, true )
  end
end


text:
date: 2017-01-19T13:46:35+02:00
menu: "menucloud"
product: "Balsamiq Cloud"
title: "Account Management"
weight: 35
---

A Balsamiq Cloud account is your ticket to super-fast wireframing. You only need one account as it can belong to as many spaces as you make, or are invited to.

## Signing Up for a Balsamiq Cloud Account

The first thing you need to do to start working in Balsamiq Cloud is sign up for an account. To get started, head over to [https://balsamiq.cloud](https://balsamiq.cloud).

![](//media.balsamiq.com/img/support/docs/cloud/signup_homepage.png)

We offer two sign up methods. You can complete our sign up form:

![](//media.balsamiq.com/img/support/docs/cloud/signup_form.png)

Or you can use your Google Account to sign up and [authenticate automatically](#a-note-about-google-authentication).

Once your account is set up, you will be brought to your [Spaces](../spaces). If you were invited to join another space, it should be listed here, or you can [create your own](../spaces/#creating-a-new-space).

### Switching From Google Authentication to Username + Password

If you have been using Google Authentication to log into Balsamiq Cloud (or signed up with it by mistake), you can switch to a normal Username and Password setup by logging in and going to your [User Settings](#user-settings).

In your User Settings, click on the **Send Me an Email to Set a Password for Cloud** button.

![](//media.balsamiq.com/img/support/docs/cloud/set_password.png)

This will send an email to the Google email that was used for your account authentication. If you follow the link from that email, you will be able to set a new password for Cloud.

![](//media.balsamiq.com/img/support/docs/cloud/change_password.png)

This new password, plus your registered email, become your new login for Cloud.

### A Note About Google Authentication

When logging into Balsamiq Cloud via Google, you might notice that the sign in screen mentions Auth0, not Balsamiq cloud.

![](//media.balsamiq.com/img/support/docs/cloud/auth0.png)

The (short) reason for this is because we use Auth0.com to provide authentication for our Balsamiq Cloud customers.

The longer reason is that authentication and login security are really hard! Rather than split our resources to handle it, we have decided to entrust Auth0 with it because authentication is the only thing that they do. They have become the industry standard when it comes to authentication libraries and they authenticate more than one billion logins a month. They have invested way more than what we could do on our own.

We would like Google to allow us to specify balsamiq.cloud on that dialog boss but, at the moment, that [is not possible](//community.auth0.com/questions/3724/in-social-registration-is-there-any-way-to-change).

If you have _any_ questions or concerns about this, please don't hesitate to [get in touch](mailto:support@balsamiq.com). We take security very seriously and want to make sure you feel secure in Balsamiq Cloud!

## User Settings

In the upper-right corner of the of the Spaces, Projects, and Editor views, you'll see your user avatar (icon).

![](//media.balsamiq.com/img/support/docs/cloud/user-avatar.png)

Clicking on it will give you two options: **User Settings** and **Logout**.

The User Settings dialog looks like this:

![](//media.balsamiq.com/img/support/docs/cloud/user-settings.png)

You can use it to **change your name and email address,** as well as **reset your password**.

You can also **delete your Balsamiq Cloud** account by clicking the blue button at the bottom.


text:
"""End-to-end test for the wordcount example."""

# pytype: skip-file

import logging
import os
import time
import unittest

import pytest
from hamcrest.core.core.allof import all_of

from apache_beam.examples import wordcount
from apache_beam.internal.gcp import auth
from apache_beam.testing.load_tests.load_test_metrics_utils import InfluxDBMetricsPublisherOptions
from apache_beam.testing.load_tests.load_test_metrics_utils import MetricsReader
from apache_beam.testing.pipeline_verifiers import FileChecksumMatcher
from apache_beam.testing.pipeline_verifiers import PipelineStateMatcher
from apache_beam.testing.test_pipeline import TestPipeline
from apache_beam.testing.test_utils import delete_files

class WordCountIT(unittest.TestCase):

  # The default checksum is a SHA-1 hash generated from a sorted list of
  # lines read from expected output. This value corresponds to the default
  # input of WordCount example.
  DEFAULT_CHECKSUM = '33535a832b7db6d78389759577d4ff495980b9c0'

  @pytest.mark.it_postcommit
  def test_wordcount_it(self):
    self._run_wordcount_it(wordcount.run)

  @pytest.mark.it_postcommit
  @pytest.mark.sickbay_direct
  @pytest.mark.sickbay_spark
  @pytest.mark.sickbay_flink
  def test_wordcount_impersonation_it(self):
    """Tests impersonation on dataflow.

    For testing impersonation, we use three ingredients:
    - a principal to impersonate
    - a dataflow service account that only that principal is
      allowed to launch jobs as
    - a temp root that only the above two accounts have access to

    Jenkins and Dataflow workers both run as GCE default service account.
    So we remove that account from all the above.
    """
    # Credentials need to be reset or this test will fail and credentials
    # from a previous test will be used.
    with auth._Credentials._credentials_lock:
      auth._Credentials._credentials_init = False
    try:
      ACCOUNT_TO_IMPERSONATE = (
          'allows-impersonation@apache-'
          'beam-testing.iam.gserviceaccount.com')
      RUNNER_ACCOUNT = (
          'impersonation-dataflow-worker@'
          'apache-beam-testing.iam.gserviceaccount.com')
      TEMP_DIR = 'gs://impersonation-test-bucket/temp-it'
      STAGING_LOCATION = 'gs://impersonation-test-bucket/staging-it'
      extra_options = {
          'impersonate_service_account': ACCOUNT_TO_IMPERSONATE,
          'service_account_email': RUNNER_ACCOUNT,
          'temp_location': TEMP_DIR,
          'staging_location': STAGING_LOCATION
      }
      self._run_wordcount_it(wordcount.run, **extra_options)
    finally:
      # Reset credentials for future tests.
      with auth._Credentials._credentials_lock:
        auth._Credentials._credentials_init = False

  @pytest.mark.it_postcommit
  @pytest.mark.it_validatescontainer
  def test_wordcount_fnapi_it(self):
    self._run_wordcount_it(wordcount.run, experiment='beam_fn_api')

  @pytest.mark.it_validatescontainer
  def test_wordcount_it_with_prebuilt_sdk_container_local_docker(self):
    self._run_wordcount_it(
        wordcount.run,
        experiment='beam_fn_api',
        prebuild_sdk_container_engine='local_docker')

  @pytest.mark.it_validatescontainer
  def test_wordcount_it_with_prebuilt_sdk_container_cloud_build(self):
    self._run_wordcount_it(
        wordcount.run,
        experiment='beam_fn_api',
        prebuild_sdk_container_engine='cloud_build')

  @pytest.mark.it_validatescontainer
  def test_wordcount_it_with_use_sibling_sdk_workers(self):
    self._run_wordcount_it(wordcount.run, experiment='use_sibling_sdk_workers')

  def _run_wordcount_it(self, run_wordcount, **opts):
    test_pipeline = TestPipeline(is_integration_test=True)
    extra_opts = {}

    # Set extra options to the pipeline for test purpose
    test_output = '/'.join([
        test_pipeline.get_option('output'),
        str(int(time.time() * 1000)),
        'results'
    ])
    extra_opts['output'] = test_output

    test_input = test_pipeline.get_option('input')
    if test_input:
      extra_opts['input'] = test_input

    arg_sleep_secs = test_pipeline.get_option('sleep_secs')
    sleep_secs = int(arg_sleep_secs) if arg_sleep_secs is not None else None
    expect_checksum = (
        test_pipeline.get_option('expect_checksum') or self.DEFAULT_CHECKSUM)
    pipeline_verifiers = [
        PipelineStateMatcher(),
        FileChecksumMatcher(
            test_output + '*-of-*', expect_checksum, sleep_secs)
    ]
    extra_opts['on_success_matcher'] = all_of(*pipeline_verifiers)
    extra_opts.update(opts)

    # Register clean up before pipeline execution
    self.addCleanup(delete_files, [test_output + '*'])

    publish_to_bq = bool(test_pipeline.get_option('publish_to_big_query'))

    # Start measure time for performance test
    start_time = time.time()

    # Get pipeline options from command argument: --test-pipeline-options,
    # and start pipeline job by calling pipeline main function.
    run_wordcount(
        test_pipeline.get_full_options_as_args(**extra_opts),
        save_main_session=False,
    )

    end_time = time.time()
    run_time = end_time - start_time

    if publish_to_bq:
      self._publish_metrics(test_pipeline, run_time)

  def _publish_metrics(self, pipeline, metric_value):
    influx_options = InfluxDBMetricsPublisherOptions(
        pipeline.get_option('influx_measurement'),
        pipeline.get_option('influx_db_name'),
        pipeline.get_option('influx_hostname'),
        os.getenv('INFLUXDB_USER'),
        os.getenv('INFLUXDB_USER_PASSWORD'),
    )
    metric_reader = MetricsReader(
        project_name=pipeline.get_option('project'),
        bq_table=pipeline.get_option('metrics_table'),
        bq_dataset=pipeline.get_option('metrics_dataset'),
        publish_to_bq=True,
        influxdb_options=influx_options,
    )

    metric_reader.publish_values([(
        'runtime',
        metric_value,
    )])

if __name__ == '__main__':
  logging.getLogger().setLevel(logging.DEBUG)
  unittest.main()