text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
    	xmlns:android="http://schemas.android.com/apk/res/android"
    	xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/tool_barlearning"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        android:minHeight="?attr/actionBarSize"
        android:theme="@style/ThemeOverlay.AppCompat.ActionBar">

    	<!-- android:background="?attr/colorPrimary" ????? Where define colorPrimary-->
    	<!-- android:background="#3DC49D" ????? Where define colorPrimary-->

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:background="?attr/selectableItemBackground"
                android:padding="10dp"
                android:textSize="18sp"
        		android:textStyle="bold"
                android:text="@string/app_name"/>

        </RelativeLayout>

</android.support.v7.widget.Toolbar>


text:
// Copyright 2017,2018,2019,2020,2021 Sony Corporation.
// Copyright 2021 Sony Group Corporation.
//
// 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.

/** BinaryTanh
 */
#ifndef __NBLA_FUNCTION_BINARY_TANH_HPP__
#define __NBLA_FUNCTION_BINARY_TANH_HPP__

#include <nbla/function/utils/base_transform_unary.hpp>

#include <cmath>

namespace nbla {

/** @class BinaryTanh
@brief BinaryTanh defined as
@f[
y_i = \left \{
    \begin{array}{ll}
      1 & (x_i > 0)\\
      -1 & (x_i \leq 0)
    \end{array} \right..
@f]

Inputs:
- N-D array.

Outputs:
- N-D array.

@tparam T Data type for computation.

@sa Courbariaux, Matthieu, and Yoshua Bengio. Binarynet: Training deep
neural networks with weights and activations constrained to+ 1 or-1.
preprint arXiv:1602.02830 (2016).

\ingroup FunctionImplGrp
 */
NBLA_DEFINE_TRANSFORM_UNARY(BinaryTanh, (x > (T)0) ? (T)1 : (T)-1,
                            (std::abs(x) >= (T)1) ? (T)0 : dy, false, true);
}
#endif

redpajama_set_name: RedPajamaGithub


text:
package me.lyneira.MachinaCore;

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

import org.bukkit.Material;

/**
 * Factory class for constructing a modular blueprint for a {@link Movable} machina.
 *
 * An instance of this class should be set to null and discarded once it has
 * been passed to the constructor of {@link MovableBlueprint}.
 *
 * @author Lyneira
 */
public class BlueprintFactory {
    final List<ModuleFactory> modules;

    public BlueprintFactory(int initialCapacity) {
        modules = new ArrayList<ModuleFactory>(initialCapacity);
    }

    /**
     * Adds a new module to this blueprint and returns the id.
     *
     * @return The id of the new module.
     */
    public int newModule() {
        int newId = modules.size();
        ModuleFactory newModule = new ModuleFactory();
        modules.add(newModule);
        return newId;
    }

    /**
     * Adds a non-key block to the blueprint.
     *
     * @param vector
     *            {@link BlockVector} specifying where this block is located in
     *            relation to the anchor
     * @param type
     *            {@link Material}
     * @param id
     */
    public final BlueprintBlock add(BlockVector vector, Material type, int id) {
        return modules.get(id).add(vector, type);
    }

    /**
     * Adds a key block to the blueprint. A key block will not be detected
     * automatically when a Movable machina is first activated.
     *
     * @param vector
     *            {@link BlockVector} specifying where this block is located in
     *            relation to the anchor
     * @param type
     *            {@link Material}
     * @param id
     */
    public final BlueprintBlock addKey(BlockVector vector, Material type, int id) {
        return modules.get(id).addKey(vector, type);
    }
}


text:
using Lumos.GUI;
using Lumos.GUI.Input;
using LumosLIB.Kernel.Log;
using LumosLIB.Tools;
using org.dmxc.lumos.Kernel.Resource;
using System;
using System.ComponentModel;
using System.Linq;
using WeifenLuo.WinFormsUI.Docking;
using System.Xml.Linq;
namespace MidiPlugin
{
	public class RuleSet : IDisposable
	{
		public class RuleEventArgs : EventArgs
		{
			public DeviceRule Rule
			{
				get;
				set;
			}
		}
		private const int StatusMask = -256;
		protected const int DataMask = 255;
		private const int Data1Mask = -65281;
		private const int Data2Mask = 65535;
		private static ILumosLog log = LumosLogger.getInstance(typeof(RuleSet));
		private string name;
		public MidiInput InputDevice;
		public MidiOutput OutputDevice;
		public bool InputUsed;
		public bool OutputUsed;
		public BindingList<DeviceRule> Rules;
		private RuleSetEditForm editWindow;
		public event EventHandler<MidiEventArgs> SendMessage;
		public event EventHandler NameChanged;
		public event EventHandler<RuleSet.RuleEventArgs> RuleAdded;
		public event EventHandler<RuleSet.RuleEventArgs> RuleDeleted;
		public string Name
		{
			get
			{
				return this.name;
			}
			set
			{
				this.name = value;
				if (this.NameChanged != null)
				{
					this.NameChanged(this, null);
				}
			}
		}
		public int RuleCount
		{
			get
			{
				return this.Rules.Count;
			}
		}
		public string InputDeviceID
		{
			get
			{
				return (this.InputDevice != null) ? this.InputDevice.DeviceID.ToString() : string.Empty;
			}
			set
			{
				if (!this.InputUsed)
				{
					if (this.InputDevice != null)
					{
						this.InputDevice.MessageReceived -= new EventHandler<MidiEventArgs>(this.HandleMessageReceived);
					}
					DeviceId devId = DeviceId.Parse(value);
					if (devId != null && ContextManager.DeviceInformation.InputDevices.Any((MidiInput i) => i.DeviceID.Equals(devId)))
					{
						this.InputDevice = ContextManager.DeviceInformation.InputDevices.First((MidiInput i) => i.DeviceID.Equals(devId));
						this.InputDevice.MessageReceived += new EventHandler<MidiEventArgs>(this.HandleMessageReceived);
					}
					else
					{
						this.InputDevice = null;
					}
				}
			}
		}
		public string OutputDeviceID
		{
			get
			{
				return (this.OutputDevice != null) ? this.OutputDevice.DeviceID.ToString() : string.Empty;
			}
			set
			{
				if (!this.OutputUsed)
				{
					DeviceId devId = DeviceId.Parse(value);
					if (devId != null && ContextManager.DeviceInformation.OutputDevices.Any((MidiOutput i) => i.DeviceID.Equals(devId)))
					{
						this.OutputDevice = ContextManager.DeviceInformation.OutputDevices.First((MidiOutput i) => i.DeviceID.Equals(devId));
					}
					else
					{
						this.OutputDevice = null;
					}
				}
			}
		}
		public string GUID
		{
			get;
			private set;
		}
		[Browsable(false)]
		public MidiInputLayer InputLayer
		{
			get;
			private set;
		}
		public static RuleSet Load(ManagedTreeItem mti)
		{
			RuleSet ret = new RuleSet(false);
			Pair<string, object> nameAt = mti.Attributes.FirstOrDefault((Pair<string, object> i) => i.Left == "Name");
			ret.Name = ((nameAt != null) ? ((string)nameAt.Right) : "");
			Pair<string, object> inp = mti.Attributes.FirstOrDefault((Pair<string, object> i) => i.Left == "InputDeviceID");
			ret.InputDeviceID = ((inp != null) ? ((string)inp.Right) : null);
			Pair<string, object> outp = mti.Attributes.FirstOrDefault((Pair<string, object> i) => i.Left == "OutputDeviceID");
			ret.OutputDeviceID = ((outp != null) ? ((string)outp.Right) : null);
			if (mti.hasValue<string>("GUID"))
			{
				ret.GUID = mti.getValue<string>("GUID");
			}
			else
			{
				ret.GUID = Guid.NewGuid().ToString();
			}
			ret.genInputLayer();
			foreach (ManagedTreeItem item in mti.GetChildren("Rule"))
			{
                    if (DeviceRule.Load(ret, item) == null)
                    {
                        RuleSet.log.Warn("Failed to load DeviceRule in RuleSet {0}, Invalid Cast and/or constructor missing!", ret.Name);
                    }
			}
			foreach (DeviceRule item2 in ret.Rules)
			{
				item2.UpdateBacktrack();
			}
			return ret;
		}
		private void genInputLayer()
		{
			this.InputLayer = new MidiInputLayer(InputLayerManager.getInstance().SessionName, this);
		}
		public void Save(ManagedTreeItem mti)
		{
            ContextManager.log.Debug("Saving RuleSet {0}", Name);
			mti.setValue<string>("Name", this.Name);
			mti.setValue<string>("InputDeviceID", this.InputDeviceID);
			mti.setValue<string>("OutputDeviceID", this.OutputDeviceID);
			mti.setValue<string>("GUID", this.GUID);
			foreach (DeviceRule rule in this.Rules)
			{
				ManagedTreeItem mtir = new ManagedTreeItem("Rule");
				rule.Save(mtir);
				mti.AddChild(mtir);
			}
		}
		protected void OnSendMessage(object s, MidiEventArgs m)
		{
			if (this.OutputDevice != null)
			{
				this.OutputUsed = true;
                int msg = (m.m.channel + m.m.message) + (m.m.data1 << 8) + (m.m.data2 << 16) - 1;
                try
                {
                    this.OutputDevice.OutputDevice.Send(msg);
                }
                catch(Exception)
                {
                    ContextManager.log.Warn("Error sending Midi Message to device {0}, message: {1}.{2}, {3},{4}", OutputDevice.DeviceID, m.m.channel, m.m.message, m.m.data1, m.m.data2);
                }
				this.OutputUsed = false;
			}
			if (this.SendMessage != null)
			{
				this.SendMessage(this, m);
			}
		}
		public RuleSet() : this(true)
		{
		}
		private RuleSet(bool genGuid)
		{
			this.Rules = new BindingList<DeviceRule>();
			this.Name = "New RuleSet";
			this.editWindow = new RuleSetEditForm(this);
			if (genGuid)
			{
				this.GUID = Guid.NewGuid().ToString();
				this.genInputLayer();
			}
		}
		private void HandleMessageReceived(object s, MidiEventArgs e)
		{
			foreach (DeviceRule item in this.Rules)
			{
				item.Process(e.m);
			}
		}
		public DeviceRule createRule(string t)
		{
            var type = ContextManager.AssemblyHelper.DeviceRuleTypes.FirstOrDefault(j => j.FullName == t);
            if (type == null) return null;
            var obj = Activator.CreateInstance(type) as DeviceRule;

            return obj;
		}
		public void AddRule(DeviceRule r)
		{
			this.Rules.Add(r);
			r.MidiMessageSend += new EventHandler<MidiEventArgs>(this.OnSendMessage);
			this.OnRuleAdded(r);
		}
		public void DeleteRule(DeviceRule r)
		{
			this.Rules.Remove(r);
			r.MidiMessageSend -= new EventHandler<MidiEventArgs>(this.OnSendMessage);
			this.OnRuleDeleted(r);
		}
		public void OpenEditWindow()
		{
			WindowManager.getInstance().ShowWindow(this.editWindow, DockState.Float);
		}
		public void Dispose()
		{
			this.editWindow.Dispose();
		}
		protected void OnRuleAdded(DeviceRule r)
		{
			if (this.RuleAdded != null)
			{
				this.RuleAdded(this, new RuleSet.RuleEventArgs
				{
					Rule = r
				});
			}
		}
		protected void OnRuleDeleted(DeviceRule r)
		{
			if (this.RuleDeleted != null)
			{
				this.RuleDeleted(this, new RuleSet.RuleEventArgs
				{
					Rule = r
				});
			}
		}

        public XElement Serialize()
        {
            var xElement = new XElement("RuleSet");
            xElement.Add(new XAttribute("Name", this.name));
            foreach (var rule in this.Rules)
            {
                xElement.Add(rule.Serialize());
            }
            return xElement;
            throw new NotImplementedException();
        }

        public static RuleSet LoadFromXml(XElement element)
        {
            var ruleset = new RuleSet(true);
            ruleset.name = element.Attribute("Name").Value;
            ruleset.genInputLayer();
            foreach (var item in element.Elements("Rule"))
            {
                ruleset.AddRule(DeviceRule.LoadFromXml(item));
            }
            return ruleset;
        }
    }
}


text:
package org.hisp.dhis.android.core.arch.repositories.filters.internal;

import org.hisp.dhis.android.core.arch.repositories.collection.BaseRepository;
import org.hisp.dhis.android.core.arch.repositories.collection.internal.BaseRepositoryFactory;
import org.hisp.dhis.android.core.arch.repositories.scope.RepositoryScope;
import org.hisp.dhis.android.core.arch.repositories.scope.internal.FilterItemOperator;

public final class DoubleFilterConnector<R extends BaseRepository>
        extends BaseAbstractFilterConnector<R, Double> {

    DoubleFilterConnector(BaseRepositoryFactory<R> repositoryFactory,
                          RepositoryScope scope,
                          String key) {
        super(repositoryFactory, scope, key);
    }

    /**
     * Returns a new repository whose scope is the one of the current repository plus the new filter being applied.
     * The smallerThan filter checks if the given field has a value which is smaller than the one provided.
     * @param value value to compare with the target field
     * @return the new repository
     */
    public R smallerThan(double value) {
        return newWithWrappedScope(FilterItemOperator.LT, value);
    }

    /**
     * Returns a new repository whose scope is the one of the current repository plus the new filter being applied.
     * The biggerThan filter checks if the given field has a value which is bigger than the one provided.
     * @param value value to compare with the target field
     * @return the new repository
     */
    public R biggerThan(double value) {
        return newWithWrappedScope(FilterItemOperator.GT, value);
    }

    /**
     * Returns a new repository whose scope is the one of the current repository plus the new filter being applied.
     * The biggerOrEqualTo filter checks if the given field has a value which is bigger or equal to the one provided.
     * @param value value to compare with the target field
     * @return the new repository
     */
    public R biggerOrEqualTo(double value) {
        return newWithWrappedScope(FilterItemOperator.GE, value);
    }

    String wrapValue(Double value) {
        return value.toString();
    }
}


text:
package vpp2106

import (
	"go.ligato.io/vpp-agent/v3/plugins/vpp"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/abf"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/acl"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/af_packet"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/arp"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/bond"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/dhcp"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/dns"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/flowprobe"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/gre"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/gtpu"
	interfaces "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/interface"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/ip"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/ip6_nd"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/ip_neighbor"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/ipfix_export"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/ipip"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/ipsec"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/l2"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/l3xc"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/memclnt"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/memif"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/nat44_ed"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/nat44_ei"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/punt"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/rd_cp"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/rdma"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/span"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/sr"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/stn"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/tapv2"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/teib"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/vmxnet3"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/vpe"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/vxlan"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/vxlan_gpe"
	"go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/wireguard"
)

// Version is used to identify VPP binapi version
const Version = "21.06"

func init() {
	binapi.Versions[Version] = binapi.VersionMsgs{
		Core: vpp.Messages(
			af_packet.AllMessages,
			arp.AllMessages,
			bond.AllMessages,
			gre.AllMessages,
			interfaces.AllMessages,
			ip.AllMessages,
			ip6_nd.AllMessages,
			ip_neighbor.AllMessages,
			ipfix_export.AllMessages,
			ipip.AllMessages,
			ipsec.AllMessages,
			l2.AllMessages,
			memclnt.AllMessages,
			punt.AllMessages,
			rd_cp.AllMessages,
			span.AllMessages,
			sr.AllMessages,
			tapv2.AllMessages,
			teib.AllMessages,
			vpe.AllMessages,
			vxlan.AllMessages,
			vxlan_gpe.AllMessages,
		),
		Plugins: vpp.Messages(
			abf.AllMessages,
			acl.AllMessages,
			dhcp.AllMessages,
			dns.AllMessages,
			flowprobe.AllMessages,
			gtpu.AllMessages,
			l3xc.AllMessages,
			memif.AllMessages,
			nat44_ed.AllMessages,
			nat44_ei.AllMessages,
			rdma.AllMessages,
			stn.AllMessages,
			vmxnet3.AllMessages,
			wireguard.AllMessages,
		),
	}
}

//go:generate -command binapigen binapi-generator --no-version-info --output-dir=.
//go:generate binapigen --input-file=$VPP_API_DIR/core/af_packet.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/arp.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/bond.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/gre.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/interface.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/ip.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/ip6_nd.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/ip_neighbor.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/ipfix_export.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/ipip.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/ipsec.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/l2.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/memclnt.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/punt.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/rd_cp.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/span.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/sr.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/tapv2.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/teib.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/vpe.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/vxlan.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/core/vxlan_gpe.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/abf.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/acl.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/dhcp.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/dns.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/flowprobe.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/gtpu.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/l3xc.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/memif.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/nat44_ed.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/nat44_ei.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/rdma.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/stn.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/vmxnet3.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/wireguard.api.json
//go:generate binapigen --input-file=$VPP_API_DIR/plugins/vrrp.api.json


text:
package com.nasaApp.f3r10.data;

/**
 * A data class representing offline notes added by user.
 *
 * @author Mostafa Gazar <eng.mostafa.gazar@gmail.com>
 */

public class OfflineNote {

    public int id;
    public int photoId;
    public String note;

}


text:
<?php

namespace openWebX\Imap\Search\Flag;

use openWebX\Imap\Search\AbstractCondition;

/**
 * Represents a UNFLAGGED flag condition. Messages must no have the \\FLAGGED
 * flag (i.e. urgent or important) set in order to match the condition.
 */
class Unflagged extends AbstractCondition {
    /**
     * Returns the keyword that the condition represents.
     *
     * @return string
     */
    public function getKeyword() {
        return 'UNFLAGGED';
    }
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="GetTests.cs" company="Epworth Consulting Ltd.">
//   © Epworth Consulting Ltd.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Atlas.Persistence.NHibernate.Tests.NHibernateFluentConfiguration
{
   using Atlas.Persistence.TestsBase;
   using NUnit.Framework;

   [TestFixture]
   public class GetTests : GetTestsBase
   {
      protected override IUnitOfWorkFactory CreateUnitOfWorkFactory()
      {
         return Helper.CreateUnitOfWorkFactory();
      }
   }
}


text:
class PostMailerTest < ActionMailer::TestCase
  def test_invite
    post = Post.new
    email = PostMailer.notification(Post.new)

    assert_emails 1 do
      email.deliver_now
    end

    expected = "<p>\n  Hello!\n</p>"
    assert_equal expected, email.body.to_s
  end
end


text:
package org.gestern.gringotts.accountholder;

/**
 * Provides AccountHolder objects for a given id.
 * An AccountHolderProvider has its own internal mapping of ids to account holders.
 * For example, a Factions provider would return a FactionAccountHolder object when given the faction's id.
 *
 * @author jast
 */
public interface AccountHolderProvider {

    /**
     * Get the AccountHolder object mapped to the given id for this provider.
     *
     * @param id id of account holder
     * @return account holder for id
     */
    AccountHolder getAccountHolder(String id);
}


text:
package es.gob.afirma.signers.xades;

import java.net.MalformedURLException;
import java.net.URL;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;
import java.util.logging.Logger;
import java.util.regex.Pattern;

import javax.xml.crypto.dsig.DigestMethod;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;

import net.java.xades.security.xml.XAdES.CommitmentTypeIdImpl;
import net.java.xades.security.xml.XAdES.CommitmentTypeIndication;
import net.java.xades.security.xml.XAdES.CommitmentTypeIndicationImpl;
import net.java.xades.security.xml.XAdES.XAdES_EPES;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

import es.gob.afirma.core.AOException;
import es.gob.afirma.core.signers.AOSignConstants;

final class XAdESUtil {

	private static final String COMMITMENT_TYPE_INDICATOR_PROPERTY_PREFIX = "commitmentTypeIndication"; //$NON-NLS-1$

	private static final Logger LOGGER = Logger.getLogger("es.gob.afirma");	//$NON-NLS-1$

	private static final String COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_ORIGIN = "urn:oid:1.2.840.113549.1.9.16.6.1"; //$NON-NLS-1$
	private static final String COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_RECEIPT = "urn:oid:1.2.840.113549.1.9.16.6.2"; //$NON-NLS-1$
	private static final String COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_DELIVERY = "urn:oid:1.2.840.113549.1.9.16.6.3"; //$NON-NLS-1$
	private static final String COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_SENDER = "urn:oid:1.2.840.113549.1.9.16.6.4"; //$NON-NLS-1$
	private static final String COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_APPROVAL = "urn:oid:1.2.840.113549.1.9.16.6.5"; //$NON-NLS-1$
	private static final String COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_CREATION = "urn:oid:1.2.840.113549.1.9.16.6.6"; //$NON-NLS-1$
	private static final Map<String, String> COMMITMENT_TYPE_IDENTIFIERS = new HashMap<String, String>(6);
	static {
		COMMITMENT_TYPE_IDENTIFIERS.put("1", COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_ORIGIN); //$NON-NLS-1$
		COMMITMENT_TYPE_IDENTIFIERS.put("2", COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_RECEIPT); //$NON-NLS-1$
		COMMITMENT_TYPE_IDENTIFIERS.put("3", COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_DELIVERY); //$NON-NLS-1$
		COMMITMENT_TYPE_IDENTIFIERS.put("4", COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_SENDER); //$NON-NLS-1$
		COMMITMENT_TYPE_IDENTIFIERS.put("5", COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_APPROVAL); //$NON-NLS-1$
		COMMITMENT_TYPE_IDENTIFIERS.put("6", COMMITMENT_TYPE_IDENTIFIER_PROOF_OF_CREATION); //$NON-NLS-1$
	}

	private XAdESUtil() {
		// No permitimos la instanciacion
	}

	static AOXMLAdvancedSignature getXmlAdvancedSignature(final XAdES_EPES xades,
			                                              final String signedPropertiesTypeUrl,
			                                              final String digestMethodAlgorithm,
			                                              final String canonicalizationAlgorithm) throws AOException {
		final AOXMLAdvancedSignature xmlSignature;
		try {
			xmlSignature = AOXMLAdvancedSignature.newInstance(xades);
		}
		catch (final Exception e) {
			throw new AOException(
				"No se ha podido instanciar la firma XML Avanzada de JXAdES", e //$NON-NLS-1$
			);
		}

		// Establecemos el tipo de propiedades firmadas
		xmlSignature.setSignedPropertiesTypeUrl(signedPropertiesTypeUrl);

		try {
			xmlSignature.setDigestMethod(digestMethodAlgorithm);
			xmlSignature.setCanonicalizationMethod(canonicalizationAlgorithm);
		}
		catch (final Exception e) {
			throw new AOException(
				"No se ha podido establecer el algoritmo de huella digital: " + e, e //$NON-NLS-1$
			);
		}

		return xmlSignature;
	}

	static Element getFirstElmentFromXPath(final String xpathExpression, final Element sourceElement) throws AOException {
		final NodeList nodeList;
		try {
			 nodeList = (NodeList)XPathFactory.newInstance().newXPath().evaluate(xpathExpression, sourceElement, XPathConstants.NODESET);
		}
		catch (final XPathExpressionException e1) {
			throw new AOException(
				"No se ha podido evaluar la expresion indicada para la insercion de la firma Enveloped ('" + xpathExpression + "'): " + e1, //$NON-NLS-1$ //$NON-NLS-2$
				e1
			);
		}
		if (nodeList.getLength() < 1) {
			throw new AOException(
				"La expresion indicada para la insercion de la firma Enveloped ('" + xpathExpression + "') no ha devuelto ningun nodo" //$NON-NLS-1$ //$NON-NLS-2$
			);
		}
		if (nodeList.getLength() > 1) {
			LOGGER.warning(
				"La expresion indicada para la insercion de la firma Enveloped ('" + xpathExpression + "') ha devuelto varios nodos, se usara el primero" //$NON-NLS-1$ //$NON-NLS-2$
			);
		}
		return (Element) nodeList.item(0);
	}

	static List<CommitmentTypeIndication> parseCommitmentTypeIndications(final Properties xParams, final String signedDataId) {

		final List<CommitmentTypeIndication> ret = new ArrayList<CommitmentTypeIndication>();

		if (xParams == null) {
			return ret;
		}
		String tmpStr = xParams.getProperty("commitmentTypeIndications"); //$NON-NLS-1$
		if (tmpStr == null) {
			return ret;
		}
		final int nCtis;
		try {
			nCtis = Integer.parseInt(tmpStr);
			if (nCtis < 1) {
				throw new NumberFormatException();
			}
		}
		catch(final Exception e) {
			LOGGER.severe(
				"El parametro adicional 'CommitmentTypeIndications' debe contener un valor numerico entero (el valor actual es " + tmpStr + "), no se anadira el CommitmentTypeIndication: " + e //$NON-NLS-1$ //$NON-NLS-2$
			);
			return ret;
		}

		String identifier;
		String description;
		ArrayList<String> documentationReferences;
		ArrayList<String> commitmentTypeQualifiers;

		for(int i=0;i<=nCtis;i++) {

			// Identifier
			tmpStr = xParams.getProperty(COMMITMENT_TYPE_INDICATOR_PROPERTY_PREFIX + Integer.toString(i) + "Identifier"); //$NON-NLS-1$
			if (tmpStr == null) {
				continue;
			}
			identifier = COMMITMENT_TYPE_IDENTIFIERS.get(tmpStr);
			if (identifier == null)  {
				LOGGER.severe(
					"El identificador del CommitmentTypeIndication " + i + " no es un tipo soportado (" + tmpStr + "), se omitira y se continuara con el siguiente" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
				);
				continue;
			}

			// Description
			description = xParams.getProperty(COMMITMENT_TYPE_INDICATOR_PROPERTY_PREFIX + Integer.toString(i) + "Description"); //$NON-NLS-1$

			// DocumentationReferences
			tmpStr = xParams.getProperty(COMMITMENT_TYPE_INDICATOR_PROPERTY_PREFIX + Integer.toString(i) + "DocumentationReferences"); //$NON-NLS-1$
			if (tmpStr == null) {
				documentationReferences = new ArrayList<String>(0);
			}
			else {
				documentationReferences = new ArrayList<String>();
				final String[] docRefs = tmpStr.split(Pattern.quote("|")); //$NON-NLS-1$
				for (final String docRef : docRefs) {
					try {
						documentationReferences.add(new URL(docRef).toString());
					}
					catch (final MalformedURLException e) {
						LOGGER.severe(
							"La referencia documental '" + docRef + "' del CommitmentTypeIndication " + i + " no es una URL, se omitira y se continuara con la siguiente referencia documental: " + e //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
						);
						continue;
					}
				}
			}

			// CommitmentTypeQualifiers
			tmpStr = xParams.getProperty(COMMITMENT_TYPE_INDICATOR_PROPERTY_PREFIX + Integer.toString(i) + "CommitmentTypeQualifiers"); //$NON-NLS-1$
			if (tmpStr == null) {
				commitmentTypeQualifiers = new ArrayList<String>(0);
			}
			else {
				commitmentTypeQualifiers = new ArrayList<String>();
				final String[] ctqs = tmpStr.split(Pattern.quote("|")); //$NON-NLS-1$
				for (final String ctq : ctqs) {
					commitmentTypeQualifiers.add(ctq);
				}
			}

			ret.add(
				new CommitmentTypeIndicationImpl(
					new CommitmentTypeIdImpl(
						"OIDAsURN",				// OID como URI u OID como URN //$NON-NLS-1$
						identifier,				// Un OID
						description,			// Descripcion textual (opcional)
						documentationReferences	// Lista de URL (opcional)
					),
					"#" + signedDataId,			// Una URI //$NON-NLS-1$
					commitmentTypeQualifiers	// Lista de elementos textuales (opcional)
				)
			);
		}
		return ret;
	}

	static String getDigestMethodByCommonName(final String identifierHashAlgorithm) throws NoSuchAlgorithmException {
		final String normalDigAlgo = AOSignConstants.getDigestAlgorithmName(identifierHashAlgorithm);
		if ("SHA1".equalsIgnoreCase(normalDigAlgo)) { //$NON-NLS-1$
			return DigestMethod.SHA1;
		}
		if ("SHA-256".equalsIgnoreCase(normalDigAlgo)) { //$NON-NLS-1$
			return DigestMethod.SHA256;
		}
		if ("SHA-512".equalsIgnoreCase(normalDigAlgo)) { //$NON-NLS-1$
			return DigestMethod.SHA512;
		}
		throw new NoSuchAlgorithmException("No se soporta el algoritmo: " + normalDigAlgo); //$NON-NLS-1$
	}

	static Element getRootElement(final Document docSignature, final Properties extraParams) {

		final Properties xParams = extraParams != null ? extraParams : new Properties();
		final String nodeName            = xParams.getProperty("RootXmlNodeName" , AOXAdESSigner.AFIRMA); //$NON-NLS-1$
		final String nodeNamespace       = xParams.getProperty("RootXmlNodeNamespace"); //$NON-NLS-1$
		final String nodeNamespacePrefix = xParams.getProperty("RootXmlNodeNamespacePrefix"); //$NON-NLS-1$

		final Element afirmaRoot;
		if (nodeNamespace == null) {
			afirmaRoot = docSignature.createElement(nodeName);
		}
		else {
			afirmaRoot = docSignature.createElementNS(nodeNamespace, nodeName);
			if (nodeNamespacePrefix != null) {
				afirmaRoot.setAttribute(
					nodeNamespacePrefix.startsWith("xmlns:") ?  nodeNamespacePrefix : "xmlns:" + nodeNamespacePrefix, //$NON-NLS-1$ //$NON-NLS-2$
					nodeNamespace
				);
			}
		}
		afirmaRoot.setAttributeNS(null, XAdESSigner.ID_IDENTIFIER, nodeName + "-Root-" + UUID.randomUUID().toString());  //$NON-NLS-1$

		return afirmaRoot;
	}

}


text:
/* global describe expect it */
import VirtualAudioGraph from '../../src/index.js';
import pingPongDelayParamsFactory from '../tools/pingPongDelayParamsFactory';

describe('virtualAudioGraph.defineNode - error throwing:', () => {
  it('throws if name provided is a standard node', () => {
    const audioContext = new AudioContext();
    const virtualAudioGraph = new VirtualAudioGraph({
      audioContext,
      output: audioContext.destination,
    });

    expect(() => virtualAudioGraph.defineNode(pingPongDelayParamsFactory, 'gain'))
      .toThrow();
  });
});


text:
@interface BoxFolderTests : SenTestCase
{
    NSDictionary *JSONDictionaryFull;
    NSDictionary *JSONDictionaryMini;
    NSDictionary *JSONDictionaryRoot;
    BoxFolder *folder;
    BoxFolder *miniFolder;
    // The root folder is special and has keys that are not normally nullable
    BoxFolder *rootFolder;
}

@end


text:
namespace inet {

namespace physicallayer {

Define_Module(Radio);

simsignal_t Radio::minSNIRSignal = cComponent::registerSignal("minSNIR");
simsignal_t Radio::packetErrorRateSignal = cComponent::registerSignal("packetErrorRate");
simsignal_t Radio::bitErrorRateSignal = cComponent::registerSignal("bitErrorRate");
simsignal_t Radio::symbolErrorRateSignal = cComponent::registerSignal("symbolErrorRate");

Radio::~Radio()
{
    // NOTE: can't use the medium module here, because it may have been already deleted
    cModule *medium = getSimulation()->getModule(mediumModuleId);
    if (medium != nullptr)
        check_and_cast<IRadioMedium *>(medium)->removeRadio(this);
    cancelAndDelete(transmissionTimer);
    cancelAndDelete(switchTimer);
}

void Radio::initialize(int stage)
{
    PhysicalLayerBase::initialize(stage);
    if (stage == INITSTAGE_LOCAL) {
        // Added
        receptionCounter = 0;
        for (int i=0; i<maxReceptionTimers; i++)
            receptionTimers[i] = nullptr;

        transmissionTimer = new cMessage("transmissionTimer");
        antenna = check_and_cast<IAntenna *>(getSubmodule("antenna"));
        transmitter = check_and_cast<ITransmitter *>(getSubmodule("transmitter"));
        receiver = check_and_cast<IReceiver *>(getSubmodule("receiver"));
        medium = getModuleFromPar<IRadioMedium>(par("radioMediumModule"), this);
        mediumModuleId = check_and_cast<cModule *>(medium)->getId();
        upperLayerIn = gate("upperLayerIn");
        upperLayerOut = gate("upperLayerOut");
        radioIn = gate("radioIn");
        radioIn->setDeliverOnReceptionStart(true);
        separateTransmissionParts = par("separateTransmissionParts");
        separateReceptionParts = par("separateReceptionParts");
        displayCommunicationRange = par("displayCommunicationRange");
        displayInterferenceRange = par("displayInterferenceRange");
        WATCH(radioMode);
        WATCH(receptionState);
        WATCH(transmissionState);
        WATCH(receivedSignalPart);
        WATCH(transmittedSignalPart);
    }
    else if (stage == INITSTAGE_PHYSICAL_LAYER) {
        medium->addRadio(this);
        switchTimer = new cMessage("switchTimer");
        parseRadioModeSwitchingTimes();
    }
    else if (stage == INITSTAGE_LAST) {
        EV_INFO << "Initialized " << getCompleteStringRepresentation() << endl;
    }
}

std::ostream& Radio::printToStream(std::ostream& stream, int level) const
{
    stream << static_cast<const cSimpleModule *>(this);
    if (level <= PRINT_LEVEL_TRACE)
        stream << ", antenna = " << printObjectToString(antenna, level + 1)
               << ", transmitter = " << printObjectToString(transmitter, level + 1)
               << ", receiver = " << printObjectToString(receiver, level + 1);
    return stream;
}

void Radio::setRadioMode(RadioMode newRadioMode)
{
    Enter_Method_Silent();

    if (newRadioMode < RADIO_MODE_OFF || newRadioMode > RADIO_MODE_SWITCHING)
        throw cRuntimeError("Unknown radio mode: %d", newRadioMode);

    else if (newRadioMode == RADIO_MODE_SWITCHING)
        throw cRuntimeError("Cannot switch manually to RADIO_MODE_SWITCHING");

    else if (radioMode == RADIO_MODE_SWITCHING || switchTimer->isScheduled())
        throw cRuntimeError("Cannot switch to a new radio mode while another switch is in progress");

    else if (newRadioMode != radioMode && newRadioMode != nextRadioMode) {
        simtime_t switchingTime = switchingTimes[radioMode][newRadioMode];

        if (switchingTime != 0)
            startRadioModeSwitch(newRadioMode, switchingTime);
        else
            completeRadioModeSwitch(newRadioMode);
    }
}

void Radio::parseRadioModeSwitchingTimes()
{
    const char *times = par("switchingTimes");

    char prefix[3];
    unsigned int count = sscanf(times, "%s", prefix);

    if (count > 2)
        throw cRuntimeError("Metric prefix should be no more than two characters long");

    double metric = 1;

    if (strcmp("s", prefix) == 0)
        metric = 1;
    else if (strcmp("ms", prefix) == 0)
        metric = 0.001;
    else if (strcmp("ns", prefix) == 0)
        metric = 0.000000001;
    else
        throw cRuntimeError("Undefined or missed metric prefix for switchingTimes parameter");

    cStringTokenizer tok(times + count + 1);
    unsigned int idx = 0;
    while (tok.hasMoreTokens()) {
        switchingTimes[idx / RADIO_MODE_SWITCHING][idx % RADIO_MODE_SWITCHING] = atof(tok.nextToken()) * metric;
        idx++;
    }
    if (idx != RADIO_MODE_SWITCHING * RADIO_MODE_SWITCHING)
        throw cRuntimeError("Check your switchingTimes parameter! Some parameters may be missed");
}

void Radio::startRadioModeSwitch(RadioMode newRadioMode, simtime_t switchingTime)
{
    EV_DETAIL << "Starting to change radio mode from " << getRadioModeName(radioMode) << " to " << getRadioModeName(newRadioMode) << endl;

    previousRadioMode = radioMode;

    radioMode = RADIO_MODE_SWITCHING;

    nextRadioMode = newRadioMode;

    emit(radioModeChangedSignal, radioMode);

    scheduleAt(simTime() + switchingTime, switchTimer);
}

// Making reception/transmission abort decisions here
void Radio::completeRadioModeSwitch(RadioMode newRadioMode)
{
    EV_INFO << "Radio mode changed from " << getRadioModeName(previousRadioMode) << " to " << getRadioModeName(newRadioMode) << endl;

    bool activeReceptionTimer = false;
    if (receptionCounter > 0) {
        for (int i=0; i<receptionCounter; i++) {
            if (receptionTimers[i] != nullptr) { // This check should be redundant
                activeReceptionTimer = true;
                break;
            }
        }
    }

    // Have to abort *all* reception timers
    if (!isReceiverMode(newRadioMode) && activeReceptionTimer) {
        for (int i=0; i<receptionCounter; i++) {
            if (receptionTimers[i] != nullptr) { // This check should be redundant
                abortReception(receptionTimers[i]);
            }
        }

        // Have aborted all reception timers
        receptionCounter = 0;
    }

//    if (!isReceiverMode(newRadioMode) && receptionTimer != nullptr)
//            abortReception(receptionTimer);

    if (!isTransmitterMode(newRadioMode) && transmissionTimer->isScheduled())
        abortTransmission();

    radioMode = previousRadioMode = nextRadioMode = newRadioMode;

    emit(radioModeChangedSignal, newRadioMode);

    updateTransceiverState();
    updateTransceiverPart();
}

const ITransmission *Radio::getTransmissionInProgress() const
{
    if (!transmissionTimer->isScheduled())
        return nullptr;
    else
        return static_cast<RadioFrame *>(transmissionTimer->getContextPointer())->getTransmission();
}

// TODO: Pray we don't have to deal with this as there is no telling which receptionTimer we should use ...
const ITransmission *Radio::getReceptionInProgress() const
{
    bool expectingReceptionTimer = false;
    int timerAt = -1;
    if (receptionCounter > 0) {
        for (int i=0; i<receptionCounter; i++) {
            if (receptionTimers[i] != nullptr) {
                expectingReceptionTimer = true;
                timerAt = i;
                break;
            }
        }
    }

    if (!expectingReceptionTimer)
        return nullptr;
    else
        return static_cast<RadioFrame *>(receptionTimers[timerAt]->getControlInfo())->getTransmission();

//    if (receptionTimer == nullptr)
//        return nullptr;
//    else
//        return static_cast<RadioFrame *>(receptionTimer->getControlInfo())->getTransmission();
}

IRadioSignal::SignalPart Radio::getTransmittedSignalPart() const
{
    return transmittedSignalPart;
}

IRadioSignal::SignalPart Radio::getReceivedSignalPart() const
{
    return receivedSignalPart;
}

void Radio::handleMessageWhenDown(cMessage *message)
{
    if (message->getArrivalGate() == radioIn || isReceptionTimer(message))
        delete message;
    else
        OperationalBase::handleMessageWhenDown(message);
}

// *here* -> handleSelf|Upper|Lower...
void Radio::handleMessageWhenUp(cMessage *message)
{
    if (message->isSelfMessage())
        handleSelfMessage(message);

    else if (message->getArrivalGate() == upperLayerIn) {
        if (!message->isPacket()) {
            handleUpperCommand(message);
            delete message;
        }
        else
            handleUpperPacket(check_and_cast<cPacket *>(message));
    }

    else if (message->getArrivalGate() == radioIn) {
        if (!message->isPacket()) {
            handleLowerCommand(message);
            delete message;
        }
        else
            handleLowerPacket(check_and_cast<RadioFrame *>(message));
    }
    else
        throw cRuntimeError("Unknown arrival gate '%s'.", message->getArrivalGate()->getFullName());
}

void Radio::handleSelfMessage(cMessage *message)
{
    if (message == switchTimer)
        handleSwitchTimer(message);

    else if (message == transmissionTimer)
        handleTransmissionTimer(message);

    else if (isReceptionTimer(message))
        handleReceptionTimer(message);

    else
        throw cRuntimeError("Unknown self message");
}

void Radio::handleSwitchTimer(cMessage *message)
{
    completeRadioModeSwitch(nextRadioMode);
}

void Radio::handleTransmissionTimer(cMessage *message)
{
    if (message->getKind() == IRadioSignal::SIGNAL_PART_WHOLE)
        endTransmission();
    else if (message->getKind() == IRadioSignal::SIGNAL_PART_PREAMBLE)
        continueTransmission();
    else if (message->getKind() == IRadioSignal::SIGNAL_PART_HEADER)
        continueTransmission();
    else if (message->getKind() == IRadioSignal::SIGNAL_PART_DATA)
        endTransmission();
    else
        throw cRuntimeError("Unknown self message");
}

void Radio::handleReceptionTimer(cMessage *message)
{
    // Only place that endReception is called
    if (message->getKind() == IRadioSignal::SIGNAL_PART_WHOLE)
        endReception(message);

    // Hopefully won't have to deal with these
    else if (message->getKind() == IRadioSignal::SIGNAL_PART_PREAMBLE)
        continueReception(message);
    else if (message->getKind() == IRadioSignal::SIGNAL_PART_HEADER)
        continueReception(message);
    else if (message->getKind() == IRadioSignal::SIGNAL_PART_DATA)
        endReception(message);

    else
        throw cRuntimeError("Unknown self message");
}

void Radio::handleUpperCommand(cMessage *message)
{
    if (message->getKind() == RADIO_C_CONFIGURE) {
        ConfigureRadioCommand *configureCommand = check_and_cast<ConfigureRadioCommand *>(message->getControlInfo());
        if (configureCommand->getRadioMode() != -1)
            setRadioMode((RadioMode)configureCommand->getRadioMode());
    }
    else
        throw cRuntimeError("Unsupported command");
}

void Radio::handleLowerCommand(cMessage *message)
{
    throw cRuntimeError("Unsupported command");
}

void Radio::handleUpperPacket(cPacket *packet)
{
    emit(LayeredProtocolBase::packetReceivedFromUpperSignal, packet);

    if (isTransmitterMode(radioMode)) {
        if (transmissionTimer->isScheduled())
            throw cRuntimeError("Received frame from upper layer while already transmitting.");

        if (separateTransmissionParts)
            startTransmission(packet, IRadioSignal::SIGNAL_PART_PREAMBLE);
        else
            startTransmission(packet, IRadioSignal::SIGNAL_PART_WHOLE);
    }
    else {
        EV_ERROR << "Radio is not in transmitter or transceiver mode, dropping frame." << endl;
        delete packet;
    }
}

void Radio::handleLowerPacket(RadioFrame *radioFrame)
{
    auto receptionTimer = createReceptionTimer(radioFrame);

    if (separateReceptionParts)
        startReception(receptionTimer, IRadioSignal::SIGNAL_PART_PREAMBLE);
    else
        startReception(receptionTimer, IRadioSignal::SIGNAL_PART_WHOLE);
}

// Lifecycle
bool Radio::handleNodeStart(IDoneCallback *doneCallback)
{
    // NOTE: we ignore radio mode switching during start
    completeRadioModeSwitch(RADIO_MODE_OFF);
    return PhysicalLayerBase::handleNodeStart(doneCallback);
}

bool Radio::handleNodeShutdown(IDoneCallback *doneCallback)
{
    // NOTE: we ignore radio mode switching and ongoing transmission during shutdown
    cancelEvent(switchTimer);
    if (transmissionTimer->isScheduled())
        abortTransmission();
    completeRadioModeSwitch(RADIO_MODE_OFF);
    return PhysicalLayerBase::handleNodeShutdown(doneCallback);
}

void Radio::handleNodeCrash()
{
    cancelEvent(switchTimer);
    if (transmissionTimer->isScheduled())
        abortTransmission();
    completeRadioModeSwitch(RADIO_MODE_OFF);
    PhysicalLayerBase::handleNodeCrash();
}

// Transmission
void Radio::startTransmission(cPacket *macFrame, IRadioSignal::SignalPart part)
{
    auto radioFrame = createRadioFrame(macFrame);
    auto transmission = radioFrame->getTransmission();
    transmissionTimer->setKind(part);
    transmissionTimer->setContextPointer(const_cast<RadioFrame *>(radioFrame));

#ifdef NS3_VALIDATION
    auto *df = dynamic_cast<inet::ieee80211::Ieee80211DataFrame *>(macFrame);
    const char *ac = "NA";
    if (df != nullptr && df->getType() == inet::ieee80211::ST_DATA_WITH_QOS) {
        switch (df->getTid()) {
            case 1: case 2: ac = "AC_BK"; break;
            case 0: case 3: ac = "AC_BE"; break;
            case 4: case 5: ac = "AC_VI"; break;
            case 6: case 7: ac = "AC_VO"; break;
            default: ac = "???"; break;
        }
    }
    const char *lastSeq = strchr(macFrame->getName(), '-');
    if (lastSeq == nullptr)
        lastSeq = "-1";
    else
        lastSeq++;
    std::cout << "TX: node = " << getId() << ", ac = " << ac << ", seq = " << lastSeq << ", start = " << simTime().inUnit(SIMTIME_PS) << ", duration = " << radioFrame->getDuration().inUnit(SIMTIME_PS) << std::endl;
#endif

    scheduleAt(transmission->getEndTime(part), transmissionTimer);
    EV_INFO << "Transmission started: " << (IRadioFrame *)radioFrame << " " << IRadioSignal::getSignalPartName(part) << " as " << transmission << endl;
    updateTransceiverState();
    updateTransceiverPart();
    check_and_cast<RadioMedium *>(medium)->fireTransmissionStarted(transmission);
}

void Radio::continueTransmission()
{
    auto previousPart = (IRadioSignal::SignalPart)transmissionTimer->getKind();
    auto nextPart = (IRadioSignal::SignalPart)(previousPart + 1);
    auto radioFrame = static_cast<RadioFrame *>(transmissionTimer->getContextPointer());
    auto transmission = radioFrame->getTransmission();
    EV_INFO << "Transmission ended: " << (IRadioFrame *)radioFrame << " " << IRadioSignal::getSignalPartName(previousPart) << " as " << radioFrame->getTransmission() << endl;
    transmissionTimer->setKind(nextPart);
    scheduleAt(transmission->getEndTime(nextPart), transmissionTimer);
    EV_INFO << "Transmission started: " << (IRadioFrame *)radioFrame << " " << IRadioSignal::getSignalPartName(nextPart) << " as " << transmission << endl;
    updateTransceiverState();
    updateTransceiverPart();
}

void Radio::endTransmission()
{
    auto part = (IRadioSignal::SignalPart)transmissionTimer->getKind();
    auto radioFrame = static_cast<RadioFrame *>(transmissionTimer->getContextPointer());
    auto transmission = radioFrame->getTransmission();
    transmissionTimer->setContextPointer(nullptr);
    EV_INFO << "Transmission ended: " << (IRadioFrame *)radioFrame << " " << IRadioSignal::getSignalPartName(part) << " as " << transmission << endl;
    updateTransceiverState();
    updateTransceiverPart();
    check_and_cast<RadioMedium *>(medium)->fireTransmissionEnded(transmission);
}

void Radio::abortTransmission()
{
    auto part = (IRadioSignal::SignalPart)transmissionTimer->getKind();
    auto radioFrame = static_cast<RadioFrame *>(transmissionTimer->getContextPointer());
    auto transmission = radioFrame->getTransmission();
    transmissionTimer->setContextPointer(nullptr);
    EV_INFO << "Transmission aborted: " << (IRadioFrame *)radioFrame << " " << IRadioSignal::getSignalPartName(part) << " as " << transmission << endl;
    EV_WARN << "Aborting ongoing transmissions is not supported" << endl;
    cancelEvent(transmissionTimer);
    updateTransceiverState();
    updateTransceiverPart();
}

RadioFrame *Radio::createRadioFrame(cPacket *packet) const
{
    RadioFrame *radioFrame = check_and_cast<RadioFrame *>(medium->transmitPacket(this, packet));
    ASSERT(radioFrame->getDuration() != 0);
    return radioFrame;
}

// handleLowerPacket -> *here*
void Radio::startReception(cMessage *timer, IRadioSignal::SignalPart part)
{
    auto radioFrame = static_cast<RadioFrame *>(timer->getControlInfo());

    auto arrival = radioFrame->getArrival();
    auto reception = radioFrame->getReception();

// TODO: should be this, but it breaks fingerprints: if (receptionTimer == nullptr && isReceiverMode(radioMode) && arrival->getStartTime(part) == simTime()) {
    if (isReceiverMode(radioMode)) {

        if (arrival->getStartTime(part) == simTime()) {
            auto transmission = radioFrame->getTransmission();

            // TODO: AODV See call hierarchy isReceptionAttempted is fairly complex
            auto isReceptionAttempted = medium->isReceptionAttempted(this, transmission, part);

            EV_INFO << "Reception started: " << (isReceptionAttempted ? "attempting" : "not attempting")
                    << " " << (IRadioFrame *)radioFrame
                    << " " << IRadioSignal::getSignalPartName(part)
                    << " as " << reception << endl;

            if (isReceptionAttempted) {
//                receptionTimer = timer;

                // Added
                receptionTimers[receptionCounter] = timer;
                receptionCounter ++;

                if (receptionCounter > maxReceptionTimers)
                    throw cRuntimeError("receptionCounter > maxReceptionTimers");
            }

        }
        else
            EV_INFO << "Reception started: ignoring " << (IRadioFrame *)radioFrame
                    << " REASON: arrival->getStartTime(part) != simTime()"
                    << " " << IRadioSignal::getSignalPartName(part)
                    << " as " << reception << endl;
    }
    else
        EV_INFO << "Reception started: ignoring " << (IRadioFrame *)radioFrame
        << " REASON: !isReceiverMode(radioMode)"
        << " " << IRadioSignal::getSignalPartName(part)
        << " as " << reception << endl;

    timer->setKind(part);
    scheduleAt(arrival->getEndTime(part), timer);

    updateTransceiverState();
    updateTransceiverPart();

    // TODO: Check affects
    check_and_cast<RadioMedium *>(medium)->fireReceptionStarted(reception);
}

// Won't affect WHOLE transmissions
void Radio::continueReception(cMessage *timer)
{
    // Just making sure
    throw cRuntimeError("In continueReception");

    auto previousPart = (IRadioSignal::SignalPart)timer->getKind();
    auto nextPart = (IRadioSignal::SignalPart)(previousPart + 1);

    auto radioFrame = static_cast<RadioFrame *>(timer->getControlInfo());

    auto arrival = radioFrame->getArrival();
    auto reception = radioFrame->getReception();

    if (timer == receptionTimer && isReceiverMode(radioMode) && arrival->getEndTime(previousPart) == simTime()) {
        auto transmission = radioFrame->getTransmission();

        bool isReceptionSuccessful = medium->isReceptionSuccessful(this, transmission, previousPart);

        EV_INFO << "Reception ended: " << (isReceptionSuccessful ? "successfully" : "unsuccessfully")
                << " for " << (IRadioFrame *)radioFrame
                << " " << IRadioSignal::getSignalPartName(previousPart)
                << " as " << reception << endl;

        if (!isReceptionSuccessful)
            receptionTimer = nullptr;

        auto isReceptionAttempted = medium->isReceptionAttempted(this, transmission, nextPart);

        EV_INFO << "Reception started: " << (isReceptionAttempted ? "attempting" : "not attempting")
                << " " << (IRadioFrame *)radioFrame
                << " " << IRadioSignal::getSignalPartName(nextPart)
                << " as " << reception << endl;

        if (!isReceptionAttempted)
            receptionTimer = nullptr;
    }
    else {
        EV_INFO << "Reception ended: ignoring " << (IRadioFrame *)radioFrame
                << " " << IRadioSignal::getSignalPartName(previousPart)
                << " as " << reception << endl;
        EV_INFO << "Reception started: ignoring " << (IRadioFrame *)radioFrame
                << " " << IRadioSignal::getSignalPartName(nextPart)
                << " as " << reception << endl;
    }

    timer->setKind(nextPart);
    scheduleAt(arrival->getEndTime(nextPart), timer);

    updateTransceiverState();
    updateTransceiverPart();
}

// handleLowerPacket -> startReception -> handleSelfMessage -> handleReceptionTimer -> *here*
void Radio::endReception(cMessage *timer)
{
    auto part = (IRadioSignal::SignalPart)timer->getKind();

    // createReceptionTimer attaches message from lower as controlInfo to receptionTimer
    auto radioFrame = static_cast<RadioFrame *>(timer->getControlInfo());

    auto arrival = radioFrame->getArrival();
    auto reception = radioFrame->getReception();

    bool isExpected = false;
    int timerFoundAt = -1;
    for (int i=0; i<receptionCounter; i++) {
        if (timer == receptionTimers[i]) { // timer is in list of expected receptionTimers
            isExpected = true;
            timerFoundAt = i;
            break;
        }
    }

//    if (!isExpected)
//        throw cRuntimeError("End: Received reception timer that was not expected");

//    if (timer == receptionTimer) { // Surely things will break before this if the timer is some random timer or nullptr?
    if (isExpected) {

        // No longer need to hold onto this reception timer
        receptionTimers[timerFoundAt] = nullptr;

        // If timer was not found at the end of the list
        if (timerFoundAt != (receptionCounter - 1)) {
            // Fill gap with last reception timer in array
            receptionTimers[timerFoundAt] = receptionTimers[(receptionCounter - 1)];

            // Remove last reception timer in array
            receptionTimers[(receptionCounter - 1)] = nullptr;
        }

        // One less receptionTimer expected
        receptionCounter--;

        if (receptionCounter < 0)
            throw cRuntimeError("End: ReceptionCounter < 0");

        if (isReceiverMode(radioMode)) {
            if (arrival->getEndTime() == simTime()) {

                auto transmission = radioFrame->getTransmission();

                // TODO: this would draw twice from the random number generator in isReceptionSuccessful: auto isReceptionSuccessful = medium->isReceptionSuccessful(this, transmission, part);
                auto isReceptionSuccessful = medium->getReceptionDecision(this, radioFrame->getListening(), transmission, part)->isReceptionSuccessful();

                EV_INFO << "Reception ended: " << (isReceptionSuccessful ? "successfully" : "unsuccessfully")
                        << " for " << (IRadioFrame *)radioFrame
                        << " " << IRadioSignal::getSignalPartName(part)
                        << " as " << reception << endl;

                auto macFrame = medium->receivePacket(this, radioFrame);

                emit(LayeredProtocolBase::packetSentToUpperSignal, macFrame);

                sendUp(macFrame);

                // Why here after so timing and mode checks? Could leave receptionTimer with an odd value
                // We got the right timer but at the wrong time>
//                receptionTimer = nullptr;

            }
            else
                EV_INFO << "Reception ended: ignoring " << (IRadioFrame *)radioFrame
                        << " REASON: arrival->getEndTime() == simTime()"
                        << " " << IRadioSignal::getSignalPartName(part)
                        << " as " << reception << endl;
        }
        else
            EV_INFO << "Reception ended: ignoring " << (IRadioFrame *)radioFrame
                    << " REASON: isReceiverMode(radioMode)"
                    << " " << IRadioSignal::getSignalPartName(part)
                    << " as " << reception << endl;
    }
    else
        EV_INFO << "Reception ended: ignoring " << (IRadioFrame *)radioFrame
//                << " REASON: timer != receptionTimer"
                << " REASON: !isExpected"
                << " " << IRadioSignal::getSignalPartName(part)
                << " as " << reception << endl;

    updateTransceiverState();
    updateTransceiverPart();

    check_and_cast<RadioMedium *>(medium)->fireReceptionEnded(reception);

    delete timer;
}

void Radio::abortReception(cMessage *timer)
{
    auto radioFrame = static_cast<RadioFrame *>(timer->getControlInfo());

    auto part = (IRadioSignal::SignalPart)timer->getKind();
    auto reception = radioFrame->getReception();

    EV_INFO << "Reception aborted: for " << (IRadioFrame *)radioFrame
            << " REASON: !isReceiverMode(newRadioMode) && receptionTimer != nullptr"
            << " " << IRadioSignal::getSignalPartName(part)
            << " as " << reception << endl;

    bool isExpected = false;
    for (int i=0; i<receptionCounter; i++) {
        if (timer == receptionTimers[i]) { // timer is in list of expected receptionTimers
            isExpected = true;

            // No longer need to hold onto this reception timer
            receptionTimers[i] = nullptr;

            // Don't want to fill gaps because we are iterating through all timers and aborting them one by one
            break;
        }
    }

//    if (!isExpected)
//        throw cRuntimeError("Abort: Received reception timer that was not expected");

//    // Should we cancel and delete timer when aborting a reception?
//    cancelAndDelete(timer);

//    if (timer == receptionTimer)
//        receptionTimer = nullptr;

    updateTransceiverState();
    updateTransceiverPart();
}

void Radio::captureReception(cMessage *timer)
{
    // TODO: this would be called when the receiver switches to a stronger signal while receiving a weaker one
    throw cRuntimeError("Not yet implemented");
}

void Radio::sendUp(cPacket *macFrame)
{
    auto indication = check_and_cast<const ReceptionIndication *>(macFrame->getControlInfo());
    emit(minSNIRSignal, indication->getMinSNIR());

    if (!std::isnan(indication->getPacketErrorRate()))
        emit(packetErrorRateSignal, indication->getPacketErrorRate());

    if (!std::isnan(indication->getBitErrorRate()))
        emit(bitErrorRateSignal, indication->getBitErrorRate());

    if (!std::isnan(indication->getSymbolErrorRate()))
        emit(symbolErrorRateSignal, indication->getSymbolErrorRate());

    EV_INFO << "Sending up " << macFrame << endl;
    send(macFrame, upperLayerOut);
}

// Will this const cause issues?
cMessage *Radio::createReceptionTimer(RadioFrame *radioFrame) const
{
    cMessage *timer = new cMessage("receptionTimer");
    // Packet from lower placed in control info
    timer->setControlInfo(radioFrame);
    return timer;
}

bool Radio::isReceptionTimer(const cMessage *message) const
{
    return !strcmp(message->getName(), "receptionTimer");
}

bool Radio::isReceiverMode(IRadio::RadioMode radioMode) const
{
    return radioMode == RADIO_MODE_RECEIVER || radioMode == RADIO_MODE_TRANSCEIVER;
}

bool Radio::isTransmitterMode(IRadio::RadioMode radioMode) const
{
    return radioMode == RADIO_MODE_TRANSMITTER || radioMode == RADIO_MODE_TRANSCEIVER;
}

bool Radio::isListeningPossible() const
{
    const simtime_t now = simTime();
    const Coord position = antenna->getMobility()->getCurrentPosition();
    // TODO: use 2 * minInterferenceTime for lookahead? or maybe simply use 0 duration listening?
    const IListening *listening = receiver->createListening(this, now, now + 1E-12, position, position);
    const IListeningDecision *listeningDecision = medium->listenOnMedium(this, listening);
    bool isListeningPossible = listeningDecision->isListeningPossible();
    delete listening;
    delete listeningDecision;
    return isListeningPossible;
}

// Reception/Transmission state change handling
void Radio::updateTransceiverState()
{
    bool expectingReceptionTimer = false;
    if (receptionCounter > 0) {
        for (int i=0; i<receptionCounter; i++) {
            if (receptionTimers[i] != nullptr && receptionTimers[i]->isScheduled()) {
                expectingReceptionTimer = true;
                break;
            }
        }
    }

    //
    // reception state
    //
    ReceptionState newRadioReceptionState;
    if (radioMode == RADIO_MODE_OFF || radioMode == RADIO_MODE_SLEEP || radioMode == RADIO_MODE_TRANSMITTER)
        newRadioReceptionState = RECEPTION_STATE_UNDEFINED;

    else if (expectingReceptionTimer)
        newRadioReceptionState = RECEPTION_STATE_RECEIVING;

//    else if (receptionTimer && receptionTimer->isScheduled())
//        newRadioReceptionState = RECEPTION_STATE_RECEIVING;

    else if (isListeningPossible())
        newRadioReceptionState = RECEPTION_STATE_BUSY;

    else
        newRadioReceptionState = RECEPTION_STATE_IDLE;

    if (receptionState != newRadioReceptionState) {
        EV_INFO << "Changing radio reception state from " << getRadioReceptionStateName(receptionState)
                << " to " << getRadioReceptionStateName(newRadioReceptionState) << "." << endl;

        receptionState = newRadioReceptionState;

        emit(receptionStateChangedSignal, newRadioReceptionState);
    }

    //
    // transmission state
    //
    TransmissionState newRadioTransmissionState;
    if (radioMode == RADIO_MODE_OFF || radioMode == RADIO_MODE_SLEEP || radioMode == RADIO_MODE_RECEIVER)
        newRadioTransmissionState = TRANSMISSION_STATE_UNDEFINED;
    else if (transmissionTimer->isScheduled())
        newRadioTransmissionState = TRANSMISSION_STATE_TRANSMITTING;
    else
        newRadioTransmissionState = TRANSMISSION_STATE_IDLE;
    if (transmissionState != newRadioTransmissionState) {
        EV_INFO << "Changing radio transmission state from " << getRadioTransmissionStateName(transmissionState) << " to " << getRadioTransmissionStateName(newRadioTransmissionState) << "." << endl;
        transmissionState = newRadioTransmissionState;
        emit(transmissionStateChangedSignal, newRadioTransmissionState);
    }
}

// TODO: Pray we don't have to deal with this as there is no telling which receptionTimer we should use ...
void Radio::updateTransceiverPart()
{
    IRadioSignal::SignalPart newReceivedPart = IRadioSignal::SIGNAL_PART_NONE;
    if (receptionCounter > 0) {
        if (receptionTimers[(receptionCounter - 1)] != nullptr) // There should always be a timer at this location in this case
            newReceivedPart = (IRadioSignal::SignalPart)receptionTimers[(receptionCounter - 1)]->getKind();
    }

//    IRadioSignal::SignalPart newReceivedPart = receptionTimer == nullptr ? IRadioSignal::SIGNAL_PART_NONE : (IRadioSignal::SignalPart)receptionTimer->getKind();

    if (receivedSignalPart != newReceivedPart) {
        EV_INFO << "Changing radio received signal part from " << IRadioSignal::getSignalPartName(receivedSignalPart)
                << " to " << IRadioSignal::getSignalPartName(newReceivedPart) << "." << endl;

        receivedSignalPart = newReceivedPart;
        emit(receivedSignalPartChangedSignal, receivedSignalPart);
    }
    IRadioSignal::SignalPart newTransmittedPart = !transmissionTimer->isScheduled() ? IRadioSignal::SIGNAL_PART_NONE : (IRadioSignal::SignalPart)transmissionTimer->getKind();
    if (transmittedSignalPart != newTransmittedPart) {
        EV_INFO << "Changing radio transmitted signal part from " << IRadioSignal::getSignalPartName(transmittedSignalPart)
                << " to " << IRadioSignal::getSignalPartName(newTransmittedPart) << "." << endl;

        transmittedSignalPart = newTransmittedPart;
        emit(transmittedSignalPartChangedSignal, transmittedSignalPart);
    }
}

} // namespace physicallayer

} // namespace inet


text:
require File.join('.', File.dirname(__FILE__), '..', 'test_helper')

module SimpleXlsx

class DocumentTest < Test::Unit::TestCase

  def open_stream_for_sheet sheets_size
    assert_equal sheets_size, @doc.sheets.size
    yield self
  end

  def write arg
  end

  def test_add_sheet
    @doc = Document.new self
    assert_equal [], @doc.sheets
    @doc.add_sheet "new sheet"
    assert_equal 1, @doc.sheets.size
    assert_equal 'new sheet', @doc.sheets.first.name
  end

end
end


text:
import os
import re

import enum
from oslo_config import cfg
from oslo_log import log as logging
from six.moves import urllib
import webob

from jacket.api.storage.openstack import wsgi
from jacket.api.storage import xmlutil
from jacket.common.storage import constants
from jacket.storage import exception
from jacket.storage.i18n import _
import jacket.storage.policy
from jacket.storage import utils

api_common_opts = [
    cfg.StrOpt('osapi_volume_base_URL',
               help='Base URL that will be presented to users in links '
                    'to the OpenStack Volume API',
               deprecated_name='osapi_compute_link_prefix'),
    cfg.ListOpt('query_volume_filters',
                default=['name', 'status', 'metadata',
                         'availability_zone',
                         'bootable'],
                help="Volume filter options which "
                     "non-admin user could use to "
                     "query volumes. Default values "
                     "are: ['name', 'status', "
                     "'metadata', 'availability_zone' ,"
                     "'bootable']")
]

CONF = cfg.CONF
CONF.register_opts(api_common_opts)

LOG = logging.getLogger(__name__)

XML_NS_V1 = 'http://docs.openstack.org/api/openstack-block-storage/1.0/content'
XML_NS_V2 = 'http://docs.openstack.org/api/openstack-block-storage/2.0/content'

METADATA_TYPES = enum.Enum('METADATA_TYPES', 'user image')

# Regex that matches alphanumeric characters, periods, hyphens,
# colons and underscores:
# ^ assert position at start of the string
# [\w\.\-\:\_] match expression
# $ assert position at end of the string
VALID_KEY_NAME_REGEX = re.compile(r"^[\w\.\-\:\_]+$", re.UNICODE)

def validate_key_names(key_names_list):
    """Validate each item of the list to match key name regex."""
    for key_name in key_names_list:
        if not VALID_KEY_NAME_REGEX.match(key_name):
            return False
    return True

def validate_policy(context, action):
    try:
        jacket.storage.policy.enforce_action(context, action)
        return True
    except exception.PolicyNotAuthorized:
        return False

def get_pagination_params(params, max_limit=None):
    """Return marker, limit, offset tuple from request.

    :param params: `wsgi.Request`'s GET dictionary, possibly containing
                   'marker',  'limit', and 'offset' variables. 'marker' is the
                   id of the last element the client has seen, 'limit' is the
                   maximum number of items to return and 'offset' is the number
                   of items to skip from the marker or from the first element.
                   If 'limit' is not specified, or > max_limit, we default to
                   max_limit. Negative values for either offset or limit will
                   cause exc.HTTPBadRequest() exceptions to be raised. If no
                   offset is present we'll default to 0 and if no marker is
                   present we'll default to None.
    :max_limit: Max value 'limit' return value can take
    :returns: Tuple (marker, limit, offset)
    """
    max_limit = max_limit or CONF.osapi_max_limit
    limit = _get_limit_param(params, max_limit)
    marker = _get_marker_param(params)
    offset = _get_offset_param(params)
    return marker, limit, offset

def _get_limit_param(params, max_limit=None):
    """Extract integer limit from request's dictionary or fail.

   Defaults to max_limit if not present and returns max_limit if present
   'limit' is greater than max_limit.
    """
    max_limit = max_limit or CONF.osapi_max_limit
    try:
        limit = int(params.pop('limit', max_limit))
    except ValueError:
        msg = _('limit param must be an integer')
        raise webob.exc.HTTPBadRequest(explanation=msg)
    if limit < 0:
        msg = _('limit param must be positive')
        raise webob.exc.HTTPBadRequest(explanation=msg)
    limit = min(limit, max_limit)
    return limit

def _get_marker_param(params):
    """Extract marker id from request's dictionary (defaults to None)."""
    return params.pop('marker', None)

def _get_offset_param(params):
    """Extract offset id from request's dictionary (defaults to 0) or fail."""
    offset = params.pop('offset', 0)
    return utils.validate_integer(offset, 'offset', 0, constants.DB_MAX_INT)

def limited(items, request, max_limit=None):
    """Return a slice of items according to requested offset and limit.

    :param items: A sliceable entity
    :param request: ``wsgi.Request`` possibly containing 'offset' and 'limit'
                    GET variables. 'offset' is where to start in the list,
                    and 'limit' is the maximum number of items to return. If
                    'limit' is not specified, 0, or > max_limit, we default
                    to max_limit. Negative values for either offset or limit
                    will cause exc.HTTPBadRequest() exceptions to be raised.
    :kwarg max_limit: The maximum number of items to return from 'items'
    """
    max_limit = max_limit or CONF.osapi_max_limit
    marker, limit, offset = get_pagination_params(request.GET.copy(),
                                                  max_limit)
    range_end = offset + (limit or max_limit)
    return items[offset:range_end]

def limited_by_marker(items, request, max_limit=None):
    """Return a slice of items according to the requested marker and limit."""
    max_limit = max_limit or CONF.osapi_max_limit
    marker, limit, __ = get_pagination_params(request.GET.copy(), max_limit)

    start_index = 0
    if marker:
        start_index = -1
        for i, item in enumerate(items):
            if 'flavorid' in item:
                if item['flavorid'] == marker:
                    start_index = i + 1
                    break
            elif item['id'] == marker or item.get('uuid') == marker:
                start_index = i + 1
                break
        if start_index < 0:
            msg = _('marker [%s] not found') % marker
            raise webob.exc.HTTPBadRequest(explanation=msg)
    range_end = start_index + limit
    return items[start_index:range_end]

def get_sort_params(params, default_key='created_at', default_dir='desc'):
    """Retrieves sort keys/directions parameters.

    Processes the parameters to create a list of sort keys and sort directions
    that correspond to either the 'sort' parameter or the 'sort_key' and
    'sort_dir' parameter values. The value of the 'sort' parameter is a comma-
    separated list of sort keys, each key is optionally appended with
    ':<sort_direction>'.

    Note that the 'sort_key' and 'sort_dir' parameters are deprecated in kilo
    and an exception is raised if they are supplied with the 'sort' parameter.

    The sort parameters are removed from the request parameters by this
    function.

    :param params: webob.multidict of request parameters (from
                   storage.api.storage.openstack.wsgi.Request.params)
    :param default_key: default sort key value, added to the list if no
                        sort keys are supplied
    :param default_dir: default sort dir value, added to the list if the
                        corresponding key does not have a direction
                        specified
    :returns: list of sort keys, list of sort dirs
    :raise webob.exc.HTTPBadRequest: If both 'sort' and either 'sort_key' or
                                     'sort_dir' are supplied parameters
    """
    if 'sort' in params and ('sort_key' in params or 'sort_dir' in params):
        msg = _("The 'sort_key' and 'sort_dir' parameters are deprecated and "
                "cannot be used with the 'sort' parameter.")
        raise webob.exc.HTTPBadRequest(explanation=msg)
    sort_keys = []
    sort_dirs = []
    if 'sort' in params:
        for sort in params.pop('sort').strip().split(','):
            sort_key, _sep, sort_dir = sort.partition(':')
            if not sort_dir:
                sort_dir = default_dir
            sort_keys.append(sort_key.strip())
            sort_dirs.append(sort_dir.strip())
    else:
        sort_key = params.pop('sort_key', default_key)
        sort_dir = params.pop('sort_dir', default_dir)
        sort_keys.append(sort_key.strip())
        sort_dirs.append(sort_dir.strip())
    return sort_keys, sort_dirs

def get_request_url(request):
    url = request.application_url
    headers = request.headers
    forwarded = headers.get('X-Forwarded-Host')
    if forwarded:
        url_parts = list(urllib.parse.urlsplit(url))
        url_parts[1] = re.split(',\s?', forwarded)[-1]
        url = urllib.parse.urlunsplit(url_parts).rstrip('/')
    return url

def remove_version_from_href(href):
    """Removes the first api version from the href.

    Given: 'http://www.storage.com/v1.1/123'
    Returns: 'http://www.storage.com/123'

    Given: 'http://www.storage.com/v1.1'
    Returns: 'http://www.storage.com'

    """
    parsed_url = urllib.parse.urlsplit(href)
    url_parts = parsed_url.path.split('/', 2)

    # NOTE: this should match vX.X or vX
    expression = re.compile(r'^v([0-9]+|[0-9]+\.[0-9]+)(/.*|$)')
    if expression.match(url_parts[1]):
        del url_parts[1]

    new_path = '/'.join(url_parts)

    if new_path == parsed_url.path:
        msg = 'href %s does not contain version' % href
        LOG.debug(msg)
        raise ValueError(msg)

    parsed_url = list(parsed_url)
    parsed_url[2] = new_path
    return urllib.parse.urlunsplit(parsed_url)

class ViewBuilder(object):
    """Model API responses as dictionaries."""

    _collection_name = None

    def _get_links(self, request, identifier):
        return [{"rel": "self",
                 "href": self._get_href_link(request, identifier), },
                {"rel": "bookmark",
                 "href": self._get_bookmark_link(request, identifier), }]

    def _get_next_link(self, request, identifier, collection_name):
        """Return href string with proper limit and marker params."""
        params = request.params.copy()
        params["marker"] = identifier
        prefix = self._update_link_prefix(get_request_url(request),
                                          CONF.osapi_volume_base_URL)
        url = os.path.join(prefix,
                           request.environ["storage.context"].project_id,
                           collection_name)
        return "%s?%s" % (url, urllib.parse.urlencode(params))

    def _get_href_link(self, request, identifier):
        """Return an href string pointing to this object."""
        prefix = self._update_link_prefix(get_request_url(request),
                                          CONF.osapi_volume_base_URL)
        return os.path.join(prefix,
                            request.environ["storage.context"].project_id,
                            self._collection_name,
                            str(identifier))

    def _get_bookmark_link(self, request, identifier):
        """Create a URL that refers to a specific resource."""
        base_url = remove_version_from_href(get_request_url(request))
        base_url = self._update_link_prefix(base_url,
                                            CONF.osapi_volume_base_URL)
        return os.path.join(base_url,
                            request.environ["storage.context"].project_id,
                            self._collection_name,
                            str(identifier))

    def _get_collection_links(self, request, items, collection_name,
                              item_count=None, id_key="uuid"):
        """Retrieve 'next' link, if applicable.

        The next link is included if we are returning as many items as we can,
        given the restrictions of limit optional request parameter and
        osapi_max_limit configuration parameter as long as we are returning
        some elements.

        So we return next link if:

        1) 'limit' param is specified and equal to the number of items.
        2) 'limit' param is NOT specified and the number of items is
           equal to CONF.osapi_max_limit.

        :param request: API request
        :param items: List of collection items
        :param collection_name: Name of collection, used to generate the
                                next link for a pagination query
        :param item_count: Length of the list of the original collection
                           items
        :param id_key: Attribute key used to retrieve the unique ID, used
                       to generate the next link marker for a pagination query
        :returns: links
        """
        item_count = item_count or len(items)
        limit = _get_limit_param(request.GET.copy())
        if len(items) and limit <= item_count:
            return self._generate_next_link(items, id_key, request,
                                            collection_name)

        return []

    def _generate_next_link(self, items, id_key, request,
                            collection_name):
        links = []
        last_item = items[-1]
        if id_key in last_item:
            last_item_id = last_item[id_key]
        else:
            last_item_id = last_item["id"]
        links.append({
            "rel": "next",
            "href": self._get_next_link(request, last_item_id,
                                        collection_name),
        })
        return links

    def _update_link_prefix(self, orig_url, prefix):
        if not prefix:
            return orig_url
        url_parts = list(urllib.parse.urlsplit(orig_url))
        prefix_parts = list(urllib.parse.urlsplit(prefix))
        url_parts[0:2] = prefix_parts[0:2]
        url_parts[2] = prefix_parts[2] + url_parts[2]

        return urllib.parse.urlunsplit(url_parts).rstrip('/')

class MetadataDeserializer(wsgi.MetadataXMLDeserializer):
    def deserialize(self, text):
        dom = utils.safe_minidom_parse_string(text)
        metadata_node = self.find_first_child_named(dom, "metadata")
        metadata = self.extract_metadata(metadata_node)
        return {'body': {'metadata': metadata}}

class MetaItemDeserializer(wsgi.MetadataXMLDeserializer):
    def deserialize(self, text):
        dom = utils.safe_minidom_parse_string(text)
        metadata_item = self.extract_metadata(dom)
        return {'body': {'meta': metadata_item}}

class MetadataXMLDeserializer(wsgi.XMLDeserializer):

    def extract_metadata(self, metadata_node):
        """Marshal the metadata attribute of a parsed request."""
        if metadata_node is None:
            return {}
        metadata = {}
        for meta_node in self.find_children_named(metadata_node, "meta"):
            key = meta_node.getAttribute("key")
            metadata[key] = self.extract_text(meta_node)
        return metadata

    def _extract_metadata_container(self, datastring):
        dom = utils.safe_minidom_parse_string(datastring)
        metadata_node = self.find_first_child_named(dom, "metadata")
        metadata = self.extract_metadata(metadata_node)
        return {'body': {'metadata': metadata}}

    def create(self, datastring):
        return self._extract_metadata_container(datastring)

    def update_all(self, datastring):
        return self._extract_metadata_container(datastring)

    def update(self, datastring):
        dom = utils.safe_minidom_parse_string(datastring)
        metadata_item = self.extract_metadata(dom)
        return {'body': {'meta': metadata_item}}

metadata_nsmap = {None: xmlutil.XMLNS_V11}

class MetaItemTemplate(xmlutil.TemplateBuilder):
    def construct(self):
        sel = xmlutil.Selector('meta', xmlutil.get_items, 0)
        root = xmlutil.TemplateElement('meta', selector=sel)
        root.set('key', 0)
        root.text = 1
        return xmlutil.MasterTemplate(root, 1, nsmap=metadata_nsmap)

class MetadataTemplateElement(xmlutil.TemplateElement):
    def will_render(self, datum):
        return True

class MetadataTemplate(xmlutil.TemplateBuilder):
    def construct(self):
        root = MetadataTemplateElement('metadata', selector='metadata')
        elem = xmlutil.SubTemplateElement(root, 'meta',
                                          selector=xmlutil.get_items)
        elem.set('key', 0)
        elem.text = 1
        return xmlutil.MasterTemplate(root, 1, nsmap=metadata_nsmap)


text:
import vehicleTypes from '../constants/vehicleTypes';
import cityTypes from '../constants/cityTypes';
export default [{
  price: '500',
  persons: 3,
  vehicleType: vehicleTypes.STANDARD,
  destinations: [
    {city: 'Split', countryShort: 'ST', type: cityTypes.CITY, primary: true},
    {city: 'Rijeka', countryShort: 'RI', type: cityTypes.CITY, primary: false},
  ],
}, {
  price: '600',
  persons: 3,
  vehicleType: vehicleTypes.STANDARD_VIP,
  destinations: [
    {city: 'Split', countryShort: 'ST', type: cityTypes.CITY, primary: true},
    {city: 'Rijeka', countryShort: 'RI', type: cityTypes.CITY, primary: false},
  ],
}, {
  price: '700',
  persons: 3,
  vehicleType: vehicleTypes.MINIBUS,
  destinations: [
    {city: 'Split', countryShort: 'ST', type: cityTypes.CITY, primary: true},
    {city: 'Rijeka', countryShort: 'RI', type: cityTypes.CITY, primary: false},
  ],
}, {
  price: '800',
  persons: 3,
  vehicleType: vehicleTypes.MINIBUS_VIP,
  destinations: [
    {city: 'Split', countryShort: 'ST', type: cityTypes.CITY, primary: true},
    {city: 'Rijeka', countryShort: 'RI', type: cityTypes.CITY, primary: false},
  ],
}];


text:
[![Build Status](https://travis-ci.org/miclle/brandy.svg?branch=master)](https://travis-ci.org/miclle/brandy)
[![Go Report Card](https://goreportcard.com/badge/github.com/miclle/brandy)](https://goreportcard.com/report/github.com/miclle/brandy)
[![Coverage Status](https://coveralls.io/repos/github/miclle/brandy/badge.svg?branch=master)](https://coveralls.io/github/miclle/brandy?branch=master)

## Usage:
  brandy init APP_PATH

## Commands:

### help, h

Display help text

### init

Create

### clean

### build

### server

## Global Options:

### -port, --port

Specify a port to use

## Example:
  brandy new ~/code/app


text:
const webpack = require('webpack');
const config = require('./webpack.common.config');

config.plugins.push(
    new webpack.SourceMapDevToolPlugin({
        filename: '[file].map',
    })
);

config.module.loaders[0].query.env = {
    development: {
        presets: ['react-hmre'],
    },
};

config.watchOptions = {
    poll: 1000,
};

module.exports = config;


text:
import React from 'react'
import Loading from './loading'
import {connect} from '../../util/store'
import {moduleType} from './reducer'

const ModuleContain = connect((state, props)=>{
    return{
        type:state.moduleShow
    }
})(props =>{
    switch (props.type){
        case moduleType.loading:
            return (<Loading />)
        default:
            return null
    }
})

export default ModuleContain


text:
CREATE OR REPLACE VIEW `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.FixedAssetsMD`
OPTIONS(
  description = "Fixed Assets Master Data"
)
AS
SELECT
  ANLA.MANDT AS Client_MANDT, ANLA.BUKRS AS CompanyCode_BUKRS,
  ANLA.ANLN1 AS MainAssetNumber_ANLN1, ANLA.ANLN2 AS AssetSubnumber_ANLN2,
  ANLA.ANLKL AS AssetClass_ANLKL, ANLA.GEGST AS TechnicalAssetNumber_GEGST,
  ANLA.ANLAR AS AssetTypes_ANLAR, ANLA.ERNAM AS NameOfPersonWhoCreatedTheObject_ERNAM,
  ANLA.ERDAT AS DateOnWhichRecordWasCreated_ERDAT,
  ANLA.AENAM AS NameOfPersonWhoChangedObject_AENAM,
  ANLA.AEDAT AS ChangedOn_AEDAT,
  ANLA.XLOEV AS Indicator_AccountMarkedForDeletion_XLOEV,
  ANLA.XSPEB AS Indicator_AssetLockedToAcquisitionPostings_XSPEB,
  ANLA.FELEI AS ScreenLayoutForAssetAccounting_FELEI,
  ANLA.KTOGR AS AccountDetermination_KTOGR,
  ANLA.XOPVW AS AssetUnderConstructWithLineItemSettlement_XOPVW,
  ANLA.ANLTP AS AssetCategory_ANLTP,
  ANLA.ZUJHR AS FiscalYearInWhichFirstAcquisitionWasPosted_ZUJHR,
  ANLA.ZUPER AS PeriodInWhichFirstAcquisitionWasPosted_ZUPER,
  ANLA.ZUGDT AS AssetValueDateOfTheFirstPosting_ZUGDT,
  ANLA.AKTIV AS AssetCapitalizationDate_AKTIV,
  ANLA.ABGDT AS AssetValueDateForTheLastRetirement_ABGDT,
  ANLA.DEAKT AS DeactivationDate_DEAKT,
  ANLA.GPLAB AS PlannedRetirementDate_GPLAB, ANLA.BSTDT AS AssetPurchaseOrderDate_BSTDT,
  ANLA.ORD41 AS EvaluationGroup1_ORD41, ANLA.ORD42 AS EvaluationGroup2_ORD42,
  ANLA.ORD43 AS EvaluationGroup3_ORD43,
  ANLA.ORD44 AS EvaluationGroup4_ORD44, ANLA.ANLUE AS AssetSuperNumber_ANLUE,
  ANLA.ZUAWA AS KeyForSortingAccordingToAssignmentNumbers_ZUAWA,
  ANLA.ANEQK AS Indicator_HistoricalManagement_ANEQK,
  ANLA.ANEQS AS CompletenessIndicatorForTheAsset_ANEQS,
  ANLA.LIFNR AS AccountNumberOfVendor__otherKeyWord___LIFNR,
  ANLA.LAND1 AS AssetsCountryOfOrigin_LAND1, ANLA.LIEFE AS NameOfAssetSupplier_LIEFE,
  ANLA.HERST AS ManufacturerOfAsset_HERST, ANLA.EIGKZ AS PropertyIndicator_EIGKZ,
  ANLA.AIBN1 AS OriginalAssetThatWasTransferred_AIBN1,
  ANLA.AIBN2 AS OriginalAssetThatWasTransferred_AIBN2,
  ANLA.AIBDT AS OriginalAcquisitionDateOfAucTransferredAsset_AIBDT,
  ANLA.URJHR AS FiscalYearOfOriginalAcquisition_URJHR,
  ANLA.URWRT AS OriginalAcquisitionValue_URWRT,
  ANLA.ANTEI AS InHouseProductionPercentage_ANTEI,
  ANLA.PROJN AS Old_ProjectNumber_Ps_posnr_PROJN,
  ANLA.EAUFN AS InvestmentOrder_EAUFN, ANLA.MEINS AS BaseUnitOfMeasure_MEINS,
  ANLA.MENGE AS Quantity_MENGE, ANLA.TYPBZ AS AssetTypeName_TYPBZ,
  ANLA.IZWEK AS ReasonForInvestment_IZWEK, ANLA.INKEN AS InventoryIndicator_INKEN,
  ANLA.IVDAT AS LastInventoryDate_IVDAT,
  ANLA.INVZU AS SupplementaryInventorySpecifications_INVZU,
  ANLA.VMGLI AS PropertyClassificationKey_VMGLI,
  ANLA.XVRMW AS ManualNetWorthTaxValue_XVRMW, ANLA.WRTMA AS ManualNetWorthTaxValue_WRTMA,
  ANLA.EHWRT AS AssessedValue_EHWRT, ANLA.AUFLA AS DateOfConveyance_AUFLA,
  ANLA.EHWZU AS DateOfLastNoticeOfAssessment_EHWZU,
  ANLA.EHWNR AS TaxNumberOfTheNoticeOfAssessment_EHWNR, ANLA.GRUVO AS LandRegisterOf_GRUVO,
  ANLA.GREIN AS LandRegisterEntryOn_GREIN, ANLA.GRBND AS LandRegisterVolume_GRBND,
  ANLA.GRBLT AS LandRegisterPage_GRBLT,
  ANLA.GRLFD AS LandRegisterEntry_SequenceNumber_GRLFD,
  ANLA.FLURK AS LandRegisterMapNumber_FLURK, ANLA.FLURN AS PlotNumber_FLURN,
  ANLA.FIAMT AS LocalTaxOffice_FIAMT, ANLA.STADT AS Municipality_STADT,
  ANLA.GRUND AS ReasonForManualValuationOfNetAssets_GRUND, ANLA.FEINS AS AreaUnit_FEINS,
  ANLA.GRUFL AS SurfaceArea_GRUFL, ANLA.INVNR AS InventoryNumber_INVNR,
  ANLA.VBUND AS CompanyIdOfTradingPartner_VBUND,
  ANLA.SPRAS AS LanguageKeyANLA_SPRAS, ANLA.TXT50 AS AssetDescriptionMD_TXT50, ANLA.TXA50 AS AdditionalAssetDescription_TXA50, ANLA.XLTXID AS Indicator_LongTextActive_XLTXID,
  ANLA.XVERID AS LongTextIndicator_PropertyValues_XVERID,
  ANLA.XTCHID AS Indicator_TechnicalViewLongText_XTCHID,
  ANLA.XKALID AS Indicator_LongTextActive_XKALID,
  ANLA.XHERID AS Indicator_LongTextForManufacturerorigin_XHERID,
  ANLA.XLEAID AS Indicator_LeasingDataLongText_XLEAID,
  ANLA.LEAFI AS LeasingCompany_LEAFI, ANLA.LVDAT AS LeasingAgreementDate_LVDAT,
  ANLA.LKDAT AS LeasingAgreementNoticeDate_LKDAT, ANLA.LEABG AS LeaseStartDate_LEABG,
  ANLA.LEJAR AS LengthOfLeaseInYears_LEJAR,
  ANLA.LEPER AS LengthOfLeaseInPeriods_LEPER, ANLA.LRYTH AS LeasePaymentCycle_LRYTH,
  ANLA.LEGEB AS PeriodicLeasePaymentPaidToLeasingCompanylessor_LEGEB,
  ANLA.LBASW AS LeasingBaseValueAsNew_LBASW,
  ANLA.LKAUF AS LeasedAssetPurchasePrice_LKAUF,
  ANLA.LMZIN AS LeasingMonthlyInterestRate__capitalLease___LMZIN,
  ANLA.LZINS AS LeasingInterestRate__capitalLease___LZINS,
  ANLA.LTZBW AS PostingDateOfTheLastLeasePayment_LTZBW,
  ANLA.LKUZA AS TotalOfPostedLeasingPayments_LKUZA,
  ANLA.LKUZI AS TotalLeasingInterestPosted_LKUZI,
  ANLA.LLAVB AS TotalOfLongTermLeasingLiability_LLAVB,
  ANLA.LEANZ AS NumberOfLeasePayments_LEANZ,
  ANLA.LVTNR AS LeasingAgreementNumber_LVTNR,
  ANLA.LETXT AS LeasingDataText_LETXT,
  ANLA.XAKTIV AS Indicator_CapitalizeFixedAsset_XAKTIV,
  ANLA.ANUPD AS Indicator_TypeOfChangeToTable_ANUPD,
  ANLA.LBLNR AS NoOfLastDocumentWithWhichPostingToAssetWasMade_LBLNR,
  ANLA.XV0DT AS ChangeDate_View0_XV0DT,
  ANLA.XV0NM AS NameOfPersonInChargeWhoChangedView0_XV0NM,
  ANLA.XV1DT AS ChangeDate_View1_XV1DT,
  ANLA.XV1NM AS NameOfPersonInChargeWhoChangedView1_XV1NM,
  ANLA.XV2DT AS ChangeDate_View2_XV2DT, ANLA.XV2NM AS NameOfThePersonInChargeWhoChangedView2_XV2NM, ANLA.XV3DT AS ChangeDate_View3_XV3DT,
  ANLA.XV3NM AS NameOfThePersonInChargeWhoChangedView3_XV3NM,
  ANLA.XV4DT AS ChangeDate_View4_XV4DT,
  ANLA.XV4NM AS NameOfThePersonInChargeWhoChangedView4_XV4NM,
  ANLA.XV5DT AS ChangeDate_View5_XV5DT,
  ANLA.XV5NM AS NameOfThePersonInChargeWhoChangedView5_XV5NM,
  ANLA.XV6DT AS ChangeDate_View6_XV6DT,
  ANLA.XV6NM AS NameOfThePersonInChargeWhoChangedView6_XV6NM,
  ANLA.AIMMO AS Indicator_RealEstate_AIMMO,
  ANLA.OBJNR AS ObjectNumber_OBJNR, ANLA.LEART AS LeasingType_LEART,
  ANLA.LVORS AS AdvancePayments_LVORS, ANLA.GDLGRP AS EvaluationGroup5_GDLGRP,
  ANLA.POSNR AS WbsElementInvestmentProject_POSNR,
  ANLA.XERWRT AS Indicator_IgnoreMemoValue_XERWRT,
  ANLA.XAFABCH AS AssetAcquiredUsed_XAFABCH,
  ANLA.XANLGR AS Indicator_AssetIsAGroupAsset_XANLGR,
  ANLA.MCOA1 AS SearchTermForMatchcodeSearch_MCOA1,
  ANLA.XINVM AS AssetUnderConstructionForInvestmentMeasures_XINVM,
  ANLA.SERNR AS SerialNumber_SERNR, ANLA.UMWKZ AS ReasonForEnvironmentalInvestment_UMWKZ,
  ANLA.LRVDAT AS DateOfLastRevaluation_LRVDAT,
  ANLA.ACT_CHANGE_PM AS ChangeAssetMasterRecordFromEquipmentMaster_ACT_CHANGE_PM,
  ANLA.HAS_TDDP AS AssetHasTimeDependentValuationParametersInAnlbza_HAS_TDDP,
  ANLA.LAST_REORG_DATE AS DateOfLastReorganization_LAST_REORG_DATE,
  ANLA.INTERNAL_CODE AS InternalCode_INTERNAL_CODE,
  ANLA.APPROVAL_NUMBER AS ApprovalDocumentNumber_APPROVAL_NUMBER,
  ANLA.APPROVAL_VERSION AS ApprovalVersion_APPROVAL_VERSION,
  ANLA.BOGUS_ANLN1 AS BogusAssetNumber_BOGUS_ANLN1,
  ANLA.ASSET_VERSION AS AssetVersion_ASSET_VERSION,
  ANKT.SPRAS AS Language_SPRAS, ANKT.TXK20 AS ShortTextForAssetClassName_TXK20,
  ANKT.TXK50 AS AssetClassDescription_TXK50, ANKT.TXT50 AS AssetDescription_TXT50,
  ANKT.TXA50 AS AssetDescription_TXA50
FROM `{{ project_id_src }}.{{ dataset_cdc_processed }}.anla` AS anla INNER JOIN `{{ project_id_src }}.{{ dataset_cdc_processed }}.ankt` AS ankt
  ON anla.mandt = ankt.mandt AND anla.anlkl = ankt.anlkl


text:
/**
 * La clase CD representa a un objeto CD. La información sobre
 * el CD se almacena y puede ser extraída.
 */
public class CD extends Articulo
{
    private String artista;
    private int numeroDePistas;

    /**
     * Constructor de los objetos de la clase CD
     */
    public CD(String elTitulo, String elArtista, int pistas, int duracion)
    {
        super(elTitulo, duracion);
        artista = elArtista;
        numeroDePistas = pistas;
    }

    /**
     * Devuelve el artista del CD
     */
    public String getArtista()
    {
        return artista;
    }

    /**
     * Devuelve el numero de pistas del CD
     */
    public int getNumeroDePistas()
    {
        return numeroDePistas;
    }

}


text:
title: Sepia Effect
layout: usermanual-page.hbs
position: 5
---

The Sepia effect makes the image look like an old photograph.

Here is an image without the effect:

and the same image with the effect applied:

The built-in sepia effect has the following attributes:

* **Amount**: Controls the intensity of the effect. Ranges from 0 to 1.


text:
package nl.xillio.exiftool;

import nl.xillio.exiftool.query.TagNameConvention;

/**
 * This TagNameConvention will not convert the tags, because the default output of Exiftool is already Capital Word formatted.
 *
 * @author Thomas Biesaart
 */
public class CapitalWordNameConvention implements TagNameConvention {
    @Override
    public String toConvention(String originalTagName) {
        return originalTagName;
    }
}


text:
var Inline = module.exports = function (func) {
  this._func = func;
};

Inline.prototype.handle = function (activity) {
  try {
    this._func.call(activity);
  } catch (err) {
    activity.error(err.message);
  }
};


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Castle.Windsor;

namespace Cronos.Infrastructure.Mvc
{
	public class WindsorDependencyResolver : IDependencyResolver
	{
		private readonly IWindsorContainer container;

		public WindsorDependencyResolver(IWindsorContainer container)
		{
			this.container = container;
		}

		public object GetService(Type serviceType)
		{
			return container.Kernel.HasComponent(serviceType) ? container.Resolve(serviceType) : null;
		}

		public IEnumerable<object> GetServices(Type serviceType)
		{
			return container.Kernel.HasComponent(serviceType) ? container.ResolveAll(serviceType).Cast<object>() : new object[] { };
		}
	}
}


text:
"""
Copyright 2015-2020 Knights Lab, Regents of the University of Minnesota.

This software is released under the GNU Affero General Public License (AGPL) v3.0 License.
"""

from shogun.aligners.bowtie2_aligner import BowtieAligner
from shogun.aligners.burst_aligner import BurstAligner
from shogun.aligners.utree_aligner import UtreeAligner
from shogun.aligners.burst_aligner_best import BurstAlignerBest

__all__ = ["BowtieAligner", "UtreeAligner", "BurstAligner", "BurstAlignerBest"]


text:
package com.kyub.beatport.tests;

import java.io.Serializable;

import com.kyub.beatport.api.BeatportService;
import com.kyub.beatport.api.RequestManager;

public class BeatportServiceAccessor extends BeatportService {

	public BeatportServiceAccessor(Serializable token,RequestManager manager) throws Exception {
		super(token);
		this.requestManager = manager;
	}

}


text:
#ifndef _VocabMap_h_
#define _VocabMap_h_

#include "Boolean.h"
#include "Prob.h"
#include "Vocab.h"
#include "Map2.h"

class VocabMap
{
    friend class VocabMapIter;

public:
    VocabMap(Vocab &v1, Vocab &v2, Boolean logmap = false);
    virtual ~VocabMap() {};

    Prob get(VocabIndex w1, VocabIndex w2);
    void put(VocabIndex w1, VocabIndex w2, Prob prob);
    void remove(VocabIndex w1, VocabIndex w2);
    void remove(VocabIndex w1);

    virtual Boolean read(File &file);
    virtual Boolean readClasses(File &file);
    virtual Boolean write(File &file);
    virtual Boolean writeBigrams(File &file);

    Vocab &vocab1;
    Vocab &vocab2;

protected:
    /*
     * The map is implemented by a two-level map where the first index is
     * from vocab1 and the second from vocab2
     */
    Map2<VocabIndex,VocabIndex,Prob> map;

    Boolean logmap;			/* treat probabilities as log probs */
};

/*
 * Map from an integer (`position') to a Vocab
 */
class PosVocabMap: public VocabMap
{
public:
    PosVocabMap(Vocab &vocab, Boolean logmap = false)
        : VocabMap(vocab, vocab, logmap)
	{ map.clear(); };

    /*
     * not implemented yet (or ever)
     */
    Boolean read(File &file) { return false; };
    Boolean write(File &file) { return false; };
};

/*
 * Iteration over the mappings of a word
 */
class VocabMapIter
{
public:
    VocabMapIter(VocabMap &vmap, VocabIndex w);

    void init();
    Boolean next(VocabIndex &w, Prob &prob);

private:
    Map2Iter2<VocabIndex,VocabIndex,Prob> mapIter;
};

#endif /* _VocabMap_h_ */