text:
// Package mqtt provides an mqtt broker
package mqtt

/*
	MQTT is a go-micro Broker for the MQTT protocol.
	This can be integrated with any broker that supports MQTT,
	including Mosquito and AWS IoT.

	Note: Because of the way the MQTT library works, when you
	unsubscribe from a topic it will unsubscribe all subscribers.
	TODO: Perhaps create a unique client per subscription.
	Becomes slightly more difficult to track a disconnect.

*/

import (
	"errors"
	"fmt"
	"log"
	"math/rand"
	"strconv"
	"strings"
	"time"

	"github.com/eclipse/paho.mqtt.golang"
	"github.com/micro/go-micro/broker"
	"github.com/micro/go-micro/broker/codec/json"
	"github.com/micro/go-micro/cmd"
)

type mqttBroker struct {
	addrs  []string
	opts   broker.Options
	client mqtt.Client
}

func init() {
	cmd.DefaultBrokers["mqtt"] = NewBroker
	rand.Seed(time.Now().UnixNano())
}

func setAddrs(addrs []string) []string {
	var cAddrs []string

	for _, addr := range addrs {
		if len(addr) == 0 {
			continue
		}

		var scheme string
		var host string
		var port int

		// split on scheme
		parts := strings.Split(addr, "://")

		// no scheme
		if len(parts) < 2 {
			// default tcp scheme
			scheme = "tcp"
			parts = strings.Split(parts[0], ":")
			// got scheme
		} else {
			scheme = parts[0]
			parts = strings.Split(parts[1], ":")
		}

		// no parts
		if len(parts) == 0 {
			continue
		}

		// check scheme
		switch scheme {
		case "tcp", "ssl", "ws":
		default:
			continue
		}

		if len(parts) < 2 {
			// no port
			host = parts[0]

			switch scheme {
			case "tcp":
				port = 1883
			case "ssl":
				port = 8883
			case "ws":
				// support secure port
				port = 80
			default:
				port = 1883
			}
			// got host port
		} else {
			host = parts[0]
			port, _ = strconv.Atoi(parts[1])
		}

		addr = fmt.Sprintf("%s://%s:%d", scheme, host, port)
		cAddrs = append(cAddrs, addr)

	}

	// default an address if we have none
	if len(cAddrs) == 0 {
		cAddrs = []string{"tcp://127.0.0.1:1883"}
	}

	return cAddrs
}

func newClient(addrs []string, opts broker.Options) mqtt.Client {
	// create opts
	cOpts := mqtt.NewClientOptions()
	cOpts.SetClientID(fmt.Sprintf("%d%d", time.Now().UnixNano(), rand.Intn(10)))
	cOpts.SetCleanSession(false)

	// setup tls
	if opts.TLSConfig != nil {
		cOpts.SetTLSConfig(opts.TLSConfig)
	}

	// add brokers
	for _, addr := range addrs {
		cOpts.AddBroker(addr)
	}

	return mqtt.NewClient(cOpts)
}

func newBroker(opts ...broker.Option) broker.Broker {
	options := broker.Options{
		// Default codec
		Codec: json.NewCodec(),
	}

	for _, o := range opts {
		o(&options)
	}

	addrs := setAddrs(options.Addrs)
	client := newClient(addrs, options)

	return &mqttBroker{
		opts:   options,
		client: client,
		addrs:  addrs,
	}
}

func (m *mqttBroker) Options() broker.Options {
	return m.opts
}

func (m *mqttBroker) Address() string {
	return strings.Join(m.addrs, ",")
}

func (m *mqttBroker) Connect() error {
	if m.client.IsConnected() {
		return nil
	}

	if t := m.client.Connect(); t.Wait() && t.Error() != nil {
		return t.Error()
	}

	return nil
}

func (m *mqttBroker) Disconnect() error {
	if !m.client.IsConnected() {
		return nil
	}
	m.client.Disconnect(0)
	return nil
}

func (m *mqttBroker) Init(opts ...broker.Option) error {
	if m.client.IsConnected() {
		return errors.New("cannot init while connected")
	}

	for _, o := range opts {
		o(&m.opts)
	}

	m.addrs = setAddrs(m.opts.Addrs)
	m.client = newClient(m.addrs, m.opts)
	return nil
}

func (m *mqttBroker) Publish(topic string, msg *broker.Message, opts ...broker.PublishOption) error {
	if !m.client.IsConnected() {
		return errors.New("not connected")
	}

	b, err := m.opts.Codec.Marshal(msg)
	if err != nil {
		return err
	}

	t := m.client.Publish(topic, 1, false, b)
	return t.Error()
}

func (m *mqttBroker) Subscribe(topic string, h broker.Handler, opts ...broker.SubscribeOption) (broker.Subscriber, error) {
	if !m.client.IsConnected() {
		return nil, errors.New("not connected")
	}

	var options broker.SubscribeOptions
	for _, o := range opts {
		o(&options)
	}

	t := m.client.Subscribe(topic, 1, func(c mqtt.Client, mq mqtt.Message) {
		var msg broker.Message
		if err := m.opts.Codec.Unmarshal(mq.Payload(), &msg); err != nil {
			log.Println(err)
			return
		}

		if err := h(&mqttPub{topic: topic, msg: &msg}); err != nil {
			log.Println(err)
		}
	})

	if t.Wait() && t.Error() != nil {
		return nil, t.Error()
	}

	return &mqttSub{
		opts:   options,
		client: m.client,
		topic:  topic,
	}, nil
}

func (m *mqttBroker) String() string {
	return "mqtt"
}

func NewBroker(opts ...broker.Option) broker.Broker {
	return newBroker(opts...)
}


text:
from Tkinter import *

master = Tk()
f = open('diary log.txt','a+')
log = StringVar()
log.set(f.read())
w = Message(master, textvariable=log) # Message Widget displays the log txt file
w.pack()

f.close()
mainloop()

redpajama_set_name: RedPajamaGithub


text:
package apple.coredata.enums;

import org.moe.natj.general.ann.Generated;
import org.moe.natj.general.ann.NInt;

@Generated
public final class NSPersistentCloudKitContainerEventType {
    @Generated
    private NSPersistentCloudKitContainerEventType() {
    }

    @Generated @NInt public static final long Setup = 0x0000000000000000L;
    @Generated @NInt public static final long Import = 0x0000000000000001L;
    @Generated @NInt public static final long Export = 0x0000000000000002L;
}


text:
class CountingAllEventsHandler
{
    public:
        typedef void result_type;
    public:
        CountingAllEventsHandler(unsigned expectedCalls) :
            _counter(0), _expectedCalls(expectedCalls)
        {}

        void operator()(sevent::socket::Facade_ptr facade,
                sevent::socket::Session_ptr session, sevent::event::Event_ptr event)
        {
            doSomething(facade, session, event);
            boost::lock_guard<boost::mutex> lock(counter_lock);
            _counter ++;
            if (_counter == _expectedCalls)
            {
                facade->service()->stop();
            }
        }

        virtual void doSomething(
                sevent::socket::Facade_ptr facade,
                sevent::socket::Session_ptr session,
                sevent::event::Event_ptr event) {}

        unsigned counter() const
        {
            return _counter;
        }

    private:
        unsigned _counter;
        unsigned _expectedCalls;
        boost::mutex counter_lock;
};

enum Sizes { OneKiloByte=1024, HalfMegaByte=524288, OneMegaByte=1048576 };

struct BasicFixture {
    sevent::socket::Facade_ptr facade;
    sevent::socket::Session_ptr session;
    sevent::socket::Address_ptr listenAddr;
    sevent::socket::Address_ptr sessionAddr;
    BasicFixture()
    {
        facade = sevent::socket::Facade::make();
        listenAddr = sevent::socket::Address::make("127.0.0.1", 9091);
        facade->listen(listenAddr);
        session = facade->connect(listenAddr);
    }

    ~BasicFixture ()
    {
        facade->removeListener(sevent::socket::Address("127.0.0.1", 9091));
    }
};

#ifdef SEVENT_USE_INT_ID
    uint32_t eventid1(1010);
    uint32_t eventid2(2020);
    uint32_t eventid3(3030);
    uint32_t eventid4(4040);
    uint32_t eventid5(5050);
#else
    std::string eventid1("sevent::test::EventOne");
    std::string eventid2("sevent::test::EventTwo");
    std::string eventid3("sevent::test::EventThree");
    std::string eventid4("sevent::test::EventFour");
    std::string eventid5("sevent::test::EventFive");
#endif


text:
module.exports = Cmds.addCommand({
    cmds: [";username "],

    requires: {
        guild: false,
        loud: false
    },

    desc: "Set VaeBot's username",

    args: "[username]",

    example: "VaeBot9000",

    ///////////////////////////////////////////////////////////////////////////////////////////

    func: (cmd, args, msgObj, speaker, channel, guild) => {
        client.user.setUsername(args)
            .catch(console.error);
        Util.print(channel, "Set username to " + args);
    }
});


text:
/*jslint browser:true*/
/*global Node*/

self.FastClick = (function() {
	'use strict';

	var

		scrollBoundary = navigator.userAgent.indexOf('PlayBook') === -1 ? 5 : 20;

	/**
	 * Determine whether a given element requires a native click.
	 *
	 * @param {Element} target DOM element
	 * @returns {boolean} Returns true if the element needs a native click
	 */
	function needsClick(target) {
		return (/\bneedsclick\b/).test(target.className) || ({
			'select': true,
			'input' : true,
			'label' : true,
			'video' : true
		})[target.nodeName.toLowerCase()];
	}

	/**
	 * Instantiate fast-clicking listeners on the specificed layer.
	 *
	 * @constructor
	 * @param {Element} layer The layer to listen on
	 */
	function FastClick(layer) {
		var

			/**
			 * The position and page scroll amount when click had started to be tracked.
			 *
			 * @type Object
			 */
			clickStart = { x: 0, y: 0,  scrollX: 0, scrollY: 0 },

			/**
			 * Whether a click is currently being tracked.
			 *
			 * @type boolean
			 */
			trackingClick = false,

			/**
			 * Maximum distance (37 pixels) to the power of two.
			 *
			 * @type number
			 */
			bound = Math.pow(37, 2),

			/**
			 * On touch start, record the position and scroll offset.
			 *
			 * @param {Event} event
			 * @returns {boolean}
			 */
			onTouchStart = function(event) {
				trackingClick = true;

				clickStart.x = event.targetTouches[0].pageX;
				clickStart.y = event.targetTouches[0].pageY;
				if (clickStart.x === event.targetTouches[0].clientX) {
					clickStart.x += window.pageXOffset;
				}
				if (clickStart.y === event.targetTouches[0].clientY) {
					clickStart.y += window.pageYOffset;
				}
				clickStart.scrollX = window.pageXOffset;
				clickStart.scrollY = window.pageYOffset;

				return true;
			},

			/**
			 * Update the last position.
			 *
			 * @param {Event} event
			 * @returns {boolean}
			 */
			onTouchMove = function(event) {
				if (!trackingClick) {
					return true;
				}

				// Detect whether a click has left the bounds of would be defined as a click, defined as a circle of radius sqrt(bound) around the start point.
				if ((Math.pow(event.targetTouches[0].pageX - clickStart.x, 2) + Math.pow(event.targetTouches[0].pageY - clickStart.y, 2)) > bound) {
					trackingClick = false;
				}

				// If the touch has moved, cancel the click tracking
				if (Math.abs(window.pageXOffset - clickStart.scrollX) > scrollBoundary || Math.abs(window.pageYOffset - clickStart.scrollY) > scrollBoundary) {
					trackingClick = false;
				}

				return true;
			},

			/**
			 * On touch end, determine whether to send a click event at once.
			 *
			 * @param {Event} event
			 * @returns {boolean}
			 */
			onTouchEnd = function(event) {
				var targetElement, targetCoordinates, clickEvent;

				if (!trackingClick) {
					return true;
				}

				trackingClick = false;

				// Set up the coordinates to match
				targetCoordinates = {
					x: clickStart.x - clickStart.scrollX,
					y: clickStart.y	- clickStart.scrollY
				};

				// Derive the element to click as a result of the touch.
				targetElement = document.elementFromPoint(targetCoordinates.x, targetCoordinates.y);

				// If we're not clicking anything exit early
				if (!targetElement) {
					return false;
				}

				// If the targetted node is a text node, target the parent instead
				if (targetElement.nodeType === Node.TEXT_NODE) {
					targetElement = targetElement.parentElement;
				}

				// Prevent the actual click from going though - unless the target node is marked as requiring
				// real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted
				// to open the options list and so the original event is required.
				if (needsClick(targetElement)) {
					return false;
				}

				// Synthesise a click event, with an extra attribute so it can be tracked
				clickEvent = document.createEvent('MouseEvents');
				clickEvent.initMouseEvent('click', true, true, window, 1, 0, 0, targetCoordinates.x, targetCoordinates.y, false, false, false, false, 0, null);
				clickEvent.forwardedTouchEvent = true;
				targetElement.dispatchEvent(clickEvent);

				event.preventDefault();
				return false;
			},

			/**
			 * On touch cancel, stop tracking the click.
			 */
			onTouchCancel = function() {
				trackingClick = false;
			},

			/**
			 * On actual clicks, determine whether this is a touch-generated click, a click action occurring
			 * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
			 * an actual click which should be permitted.
			 *
			 * @param {Event} event
			 * @returns {boolean}
			 */
			onClick = function(event) {
				var targetElement;

				if (event.forwardedTouchEvent) {
					return true;
				}

				// Programmatically generated events targeting a specific element should be permitted
				if (!event.cancelable) {
					return true;
				}

				targetElement = document.elementFromPoint(clickStart.x - clickStart.scrollX, clickStart.y - clickStart.scrollY);

				// Derive and check the target element to see whether the
				// click needs to be permitted; unless explicitly enabled, prevent non-touch click events
				// from triggering actions, to prevent ghost/doubleclicks.
				if (!targetElement || !needsClick(targetElement)) {

					// Cancel the event
					event.stopPropagation();
					event.preventDefault();

					// Prevent any user-added listeners declared on FastClick element from being fired.
					if (event.stopImmediatePropagation) {
						event.stopImmediatePropagation();
					}

					return false;
				}

				// If clicks are permitted, return true for the action to go through.
				return true;
			};

		if (!layer || !layer.nodeType) {
			throw new TypeError('Layer must be a document node');
		}

		// Devices that don't support touch don't need FastClick
		if (typeof window.ontouchstart === 'undefined') {
			return;
		}

		// Set up event handlers as required
		layer.addEventListener('click', onClick, true);
		layer.addEventListener('touchstart', onTouchStart, true);
		layer.addEventListener('touchmove', onTouchMove, true);
		layer.addEventListener('touchend', onTouchEnd, true);
		layer.addEventListener('touchcancel', onTouchCancel, true);

		// If a handler is already declared in the element's onclick attribute, it will be fired before
		// FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
		// adding it as listener.
		if (typeof layer.onclick === 'function') {
			layer.addEventListener('click', layer.onclick, false);
			layer.onclick = null;
		}
	}

	return FastClick;

}());


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <FrameLayout
        android:layout_width="fill_parent"
        android:layout_height="50.0dip"
        android:layout_gravity="center" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_gravity="center_vertical"
            android:orientation="horizontal" >

            <RelativeLayout
                android:id="@+id/pwd_warp1"
                android:layout_width="0.0dip"
                android:layout_height="50.0dip"
                android:layout_weight="1.0"
                android:background="@drawable/wallet_base_six_no_bg_left" >

                <ImageView
                    android:id="@+id/pwd_iv_1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:background="@drawable/wallet_base_black_point_in_pwd"
                    android:contentDescription="@string/ebpay_img" />
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/pwd_warp2"
                android:layout_width="0.0dip"
                android:layout_height="50.0dip"
                android:layout_weight="1.0"
                android:background="@drawable/wallet_base_six_no_bg_midle" >

                <ImageView
                    android:id="@+id/pwd_iv_2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:background="@drawable/wallet_base_black_point_in_pwd"
                    android:contentDescription="@string/ebpay_img" />
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/pwd_warp3"
                android:layout_width="0.0dip"
                android:layout_height="50.0dip"
                android:layout_weight="1.0"
                android:background="@drawable/wallet_base_six_no_bg_midle" >

                <ImageView
                    android:id="@+id/pwd_iv_3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:background="@drawable/wallet_base_black_point_in_pwd"
                    android:contentDescription="@string/ebpay_img" />
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/pwd_warp4"
                android:layout_width="0.0dip"
                android:layout_height="50.0dip"
                android:layout_weight="1.0"
                android:background="@drawable/wallet_base_six_no_bg_midle" >

                <ImageView
                    android:id="@+id/pwd_iv_4"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:background="@drawable/wallet_base_black_point_in_pwd"
                    android:contentDescription="@string/ebpay_img" />
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/pwd_warp5"
                android:layout_width="0.0dip"
                android:layout_height="50.0dip"
                android:layout_weight="1.0"
                android:background="@drawable/wallet_base_six_no_bg_midle" >

                <ImageView
                    android:id="@+id/pwd_iv_5"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:background="@drawable/wallet_base_black_point_in_pwd"
                    android:contentDescription="@string/ebpay_img" />
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/pwd_warp6"
                android:layout_width="0.0dip"
                android:layout_height="50.0dip"
                android:layout_weight="1.0"
                android:background="@drawable/wallet_base_six_no_bg_right" >

                <ImageView
                    android:id="@+id/pwd_iv_6"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerInParent="true"
                    android:background="@drawable/wallet_base_black_point_in_pwd"
                    android:contentDescription="@string/ebpay_img" />
            </RelativeLayout>
        </LinearLayout>

        <com.baidu.wallet.base.widget.PluginEditText
            android:id="@+id/pwd_input"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@null"
            android:cursorVisible="false"
            android:inputType="number"
            android:maxLength="6"
            android:textSize="1sp"
            android:textColor="#000000ff" />
    </FrameLayout>

</LinearLayout>


text:
package net.liftweb
package mapper
package view

import net.liftweb.http.{ Paginator, PaginatorSnippet, SortedPaginator, SortedPaginatorSnippet }

/**
 * Helper for when using paginators with a ModelSnippet.
 * Adds a dispatch that delegates the "paginate" snippet to the paginator member.
 * @author nafg and Timothy Perrett
 */
trait PaginatedModelSnippet[T <: Mapper[T]] extends ModelSnippet[T] {
  abstract override def dispatch: DispatchIt = super.dispatch orElse Map("paginate" -> paginator.paginate)
  /**
   * The paginator to delegate to
   */
  val paginator: PaginatorSnippet[T]
}

/**
 * Paginate mapper instances by supplying the model you
 * wish to paginate and Paginator will run your query for you etc.
 *
 * @param meta The singleton of the Mapper class you're paginating
 * @author nafg and Timothy Perrett
 */
class MapperPaginator[T <: Mapper[T]](val meta: MetaMapper[T]) extends Paginator[T] {
  /**
   * QueryParams to use always
   */
  var constantParams: Seq[QueryParam[T]] = Nil

  def count: Long = meta.count(constantParams: _*)
  def page: Seq[T] = meta.findAll(constantParams ++ Seq[QueryParam[T]](MaxRows(itemsPerPage), StartAt(first)): _*)
}

/**
 * Convenience class that combines MapperPaginator with PaginatorSnippet
 * @param meta The singleton of the Mapper class you're paginating
 */
class MapperPaginatorSnippet[T <: Mapper[T]](meta: MetaMapper[T])
  extends MapperPaginator[T](meta) with PaginatorSnippet[T]

/**
 * Implements MapperPaginator and SortedPaginator.
 * @param meta The singleton of the Mapper class you're paginating
 * @param initialSort The field to sort by initially
 * @param _headers Pairs of column labels and MappedFields.
 */
class SortedMapperPaginator[T <: Mapper[T]](meta: MetaMapper[T],
                                initialSort: net.liftweb.mapper.MappedField[_, T],
                                _headers: (String, MappedField[_, T])*)
    extends MapperPaginator[T](meta) with SortedPaginator[T, MappedField[_, T]] {

    val headers = _headers.toList
    sort = (headers.indexWhere{case (_,`initialSort`)=>true; case _ => false}, true)

    override def page: Seq[T] = meta.findAll(constantParams ++ Seq[QueryParam[T]](mapperSort, MaxRows(itemsPerPage), StartAt(first)): _*)
    private def mapperSort = sort match {
      case (fieldIndex, ascending) =>
        OrderBy(
          headers(fieldIndex) match {case (_,f)=>f},
          if(ascending) Ascending else Descending
        )
    }
}

/**
 * Convenience class that combines SortedMapperPaginator and SortedPaginatorSnippet.
 * @param meta The singleton of the Mapper class you're paginating
 * @param initialSort The field to sort by initially
 * @param headers Pairs of column labels and MappedFields.
 */
class SortedMapperPaginatorSnippet[T <: Mapper[T]](
  meta: MetaMapper[T],
  initialSort: net.liftweb.mapper.MappedField[_, T],
  headers: (String, MappedField[_, T])*
) extends SortedMapperPaginator[T](meta, initialSort, headers: _*)
  with SortedPaginatorSnippet[T, MappedField[_, T]]


text:
require 'spec_helper'

describe DrawCloud::SecurityGroup do
  subject { DrawCloud::SecurityGroup.new(:test, "Test Security Group") }

  it "should be a SecurityGroup" do
    expect(subject).to be_an_instance_of DrawCloud::SecurityGroup
  end

  it "returns itself when asked for the security group" do
    expect(subject).to respond_to :security_group
    expect(subject.security_group).to equal subject
  end

  describe "allow_security_group_in" do
    before :each do
      subject.ingress_rules = []
    end

    let(:protocol) { :tcp }
    let(:security_group_id) { { "Ref" => "AppSecurityGroup" } }
    let(:from_port) { 80 }
    let(:to_port) { 443 }

    it "should add an appropriate ingress rule" do
      subject.allow_security_group_in(protocol, security_group_id, from_port, to_port)
      expect(subject.ingress_rules).to_not be_empty
      expect(subject.ingress_rules.first).to eq({"IpProtocol"=>"tcp",
                                                  "SourceSecurityGroupId"=>{"Ref"=>"AppSecurityGroup"},
                                                  "FromPort"=>"80",
                                                  "ToPort"=>"443"})
    end

  end

  describe "allow_cidr_in" do
    before :each do
      subject.ingress_rules = []
    end

    let(:protocol) { :tcp }
    let(:cidr) { "0.0.0.0/0" }
    let(:from_port) { 80 }
    let(:to_port) { 443 }

    it "should add an appropriate ingress rule" do
      subject.allow_cidr_in(protocol, cidr, from_port, to_port)
      expect(subject.ingress_rules).to_not be_empty
      expect(subject.ingress_rules.first).to eq({"IpProtocol"=>"tcp",
                                                  "CidrIp"=>"0.0.0.0/0",
                                                  "FromPort"=>"80",
                                                  "ToPort"=>"443"})
    end

  end

  describe "provides"
  describe "consumes"

  describe "resource_name" do
    it "returns a styled name with SecurityGroup appended" do
      expect(subject.resource_name).to match(/TestSecurityGroup/)
    end
  end

  describe "check_validity" do
    before :each do
      subject.description = "Test Security Group"
    end

    it "should check validity" do
      subject.description = '~`&&&%'
      expect { subject.to_h }.to raise_error ArgumentError
    end
  end

  describe "to_h" do
    it "should turn itself into a hash" do
      expect(subject.to_h).to be_an_instance_of Hash
    end

    it "should have a type key matching AWS::EC2::SecurityGroup" do
      expect(subject.to_h['Type']).to match(/AWS::EC2::SecurityGroup/)
    end
  end
end


text:
from __future__ import absolute_import
import inspect
from state_machine.models import Event, State, InvalidStateTransition

class BaseAdaptor(object):

    def __init__(self, original_class):
        self.original_class = original_class

    def get_potential_state_machine_attributes(self, clazz):
        return inspect.getmembers(clazz)

    def process_states(self, original_class):
        initial_state = None
        is_method_dict = dict()
        for member, value in self.get_potential_state_machine_attributes(original_class):

            if isinstance(value, State):
                if value.initial:
                    if initial_state is not None:
                        raise ValueError("multiple initial states!")
                    initial_state = value

                #add its name to itself:
                setattr(value, 'name', member)

                is_method_string = "is_" + member

                def is_method_builder(member):
                    def f(self):
                        return self.aasm_state == str(member)

                    return property(f)

                is_method_dict[is_method_string] = is_method_builder(member)

        return is_method_dict, initial_state

    def process_events(self, original_class):
        _adaptor = self
        event_method_dict = dict()
        for member, value in self.get_potential_state_machine_attributes(original_class):
            if isinstance(value, Event):
                # Create event methods

                def event_meta_method(event_name, event_description):
                    def f(self):
                        #assert current state
                        if self.current_state not in event_description.from_states:
                            raise InvalidStateTransition

                        # fire before_change
                        failed = False
                        if self.__class__.callback_cache and \
                                event_name in self.__class__.callback_cache[_adaptor.original_class.__name__]['before']:
                            for callback in self.__class__.callback_cache[_adaptor.original_class.__name__]['before'][event_name]:
                                result = callback(self)
                                if result is False:
                                    print("One of the 'before' callbacks returned false, breaking")
                                    failed = True
                                    break

                        #change state
                        if not failed:
                            _adaptor.update(self, event_description.to_state.name)

                            #fire after_change
                            if self.__class__.callback_cache and \
                                    event_name in self.__class__.callback_cache[_adaptor.original_class.__name__]['after']:
                                for callback in self.__class__.callback_cache[_adaptor.original_class.__name__]['after'][event_name]:
                                    callback(self)

                    return f

                event_method_dict[member] = event_meta_method(member, value)
        return event_method_dict

    def modifed_class(self, original_class, callback_cache):

        class_name = original_class.__name__
        class_dict = dict()

        class_dict['callback_cache'] = callback_cache

        def current_state_method():
            def f(self):
                return self.aasm_state
            return property(f)

        class_dict['current_state'] = current_state_method()

        class_dict.update(original_class.__dict__)

        # Get states
        state_method_dict, initial_state = self.process_states(original_class)
        class_dict.update(self.extra_class_members(initial_state))
        class_dict.update(state_method_dict)

        # Get events
        event_method_dict = self.process_events(original_class)
        class_dict.update(event_method_dict)

        clazz = type(class_name, original_class.__bases__, class_dict)
        return clazz

    def extra_class_members(self, initial_state):
        raise NotImplementedError

    def update(self, document, state_name):
        raise NotImplementedError


text:
using System;

namespace Adaptive.Arp.Api
{

     /**
        Interface for Managing the OAuth operations

        @author Carlos Lozano Diez
        @since v2.0
        @version 1.0
     */
     public interface IOAuth : IBaseSecurity
     {

     }
}

/**
------------------------------------| Engineered with ♥ in Barcelona, Catalonia |--------------------------------------
*/


text:
import os
import shutil

from wmt.config import site
from wmt.models.submissions import prepend_to_path
from wmt.utils.hook import find_simulation_input_file

file_list = [] # 'rti_file']

def _set_input_file(env, file_base_name):
    option = 'use_' + file_base_name + 's'
    file_name = file_base_name + '_file'

    if env[file_name] == 'off':
        env[option] = 'No'
    else:
        env[option] = 'Yes'
        file_list.append(file_name)

def execute(env):
    """Perform pre-stage tasks for running a component.

    Parameters
    ----------
    env : dict
      A dict of component parameter values from WMT.

    """
    #env['n_steps'] = int(round(float(env['_run_duration']) / float(env['dt'])))
    #env['save_grid_dt'] = float(env['dt'])
    #env['save_pixels_dt'] = float(env['dt'])

    # TopoFlow needs site_prefix and case_prefix.
    # env['site_prefix'] = os.path.splitext(env['rti_file'])[0]
    # env['case_prefix'] = 'WMT'

    # If no pixel_file is given, let TopoFlow make one.
    # if env['pixel_file'] == 'off':
    #     file_list.remove('pixel_file')
    #     env['pixel_file'] = env['case_prefix'] + '_outlets.txt'

    _set_input_file(env, 'source')
    _set_input_file(env, 'sink')
    _set_input_file(env, 'canal')

    # Default files common to all TopoFlow components are stored with the
    # topoflow component metadata.
    # prepend_to_path('WMT_INPUT_FILE_PATH',
    #                 os.path.join(site['db'], 'components', 'topoflow', 'files'))
    for fname in file_list:
        src = find_simulation_input_file(env[fname])
        shutil.copy(src, os.curdir)
    src = find_simulation_input_file(env['site_prefix'] + '.rti')
    shutil.copy(src, os.path.join(os.curdir, env['site_prefix'] + '.rti'))


text:
vendor source code
==================

external resources and libraries.

file
----

*   **PHPMarkdown**:
    *   [License.text](PHPMarkdownExtra/License.text)
    *   [markdown.php](PHPMarkdownExtra/markdown.php/_src)
    *   [PHP Markdown Readme.text](PHPMarkdownExtra/PHP%20Markdown%20Extra%20Readme.text)
        sorry, this link does not work (AmidaMVC's limitation...)

*   **SimpleDiff**:
    *   from [A simple diff algorithm in PHP](http://paulbutler.org/archives/a-simple-diff-algorithm-in-php/)
    *   [source code at gitHub](https://github.com/paulgb/simplediff)

JavaScripts
-----------

*   **bootstrap by Twitter**

*   **jhtmlarea**
    * http://pietschsoft.com/post/2009/07/21/jHtmlArea-The-all-NEW-HTML-WYSIWYG-Editor-for-jQuery.aspx
    * http://jhtmlarea.codeplex.com/

*   **jsMarkdownExtra**
    * https://github.com/tanakahisateru/js-markdown-extra


text:
#region License

#endregion License

using ArcReactor.Models;
using ArcReactor.Services;
using System;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Template10.Mvvm;
using Windows.Devices.Enumeration;
using Windows.UI.Popups;

namespace ArcReactor.ViewModels
{
    /// <summary>
    /// ViewModel for the MainPage
    /// </summary>
    public class MainPageViewModel : ViewModelBase
    {
        private const int LEDCOUNTER = 25;

        private ArcReactorService reactor;

        /// <summary>
        /// The collection of Arc Reactor devices to connect with
        /// </summary>
        public ObservableCollection<DeviceInformation> ArcReactorDevices { get; set; }

        /// <summary>
        /// The collection of RGB LEDs available at the Arc Reactor device
        /// </summary>
        public ObservableCollection<ColoredLed> RgbLeds { get; set; }

        private DeviceInformation selectedDevice;

        /// <summary>
        /// Selected device to connect to
        /// </summary>
        public DeviceInformation SelectedDevice
        {
            get
            {
                return selectedDevice;
            }

            set
            {
                if (this.selectedDevice != value)
                {
                    selectedDevice = value;
                    RaisePropertyChanged();
                }
            }
        }

        private float batteryLevel;

        /// <summary>
        /// Battery level of the connected device
        /// </summary>
        public float BatteryLevel
        {
            get
            {
                return batteryLevel;
            }

            set
            {
                if (this.batteryLevel != value)
                {
                    batteryLevel = value;
                    RaisePropertyChanged();
                }
            }
        }

        private bool isConnected;

        /// <summary>
        /// Is the device connected or not
        /// </summary>
        public bool IsConnected
        {
            get
            {
                return isConnected;
            }

            set
            {
                if (this.isConnected != value)
                {
                    isConnected = value;
                    ConnectButtonDescription = isConnected ? "Disconnect" : "Connect";

                    RaisePropertyChanged(nameof(IsConnected));
                }
            }
        }

        /// <summary>
        /// Connects with a selected device
        /// </summary>
        public async void Connect()
        {
            if (reactor.IsConnected)
            {
                reactor.Disconnect();
            }
            else
            {
                Views.Busy.SetBusy(true, "Connecting...");
                var result = await reactor.ConnectAsync(SelectedDevice);
                reactor.RequestBatteryLevel();
                Views.Busy.SetBusy(false);
                if (!result)
                {
                    await MessageBox("Connection failed");
                }
                else
                {
                }
            }

            IsConnected = reactor.IsConnected;
        }

        /// <summary>
        /// Copy color from the first LED to every another
        /// </summary>
        public void CopyFirstLed()
        {
            for (int i = 1; i < LEDCOUNTER; i++)
            {
                RgbLeds[i].SetRgb(RgbLeds[0].R, RgbLeds[0].G, RgbLeds[0].B);
            }
        }

        /// <summary>
        /// Asks the device about the battery level
        /// </summary>
        public void GetBatteryLevel()
        {
            reactor.RequestBatteryLevel();
        }

        private async Task MessageBox(string text)
        {
            var m = new MessageDialog(text);
            await m.ShowAsync();
        }

        private string connectButtonDescription = "Connect";

        /// <summary>
        /// Description of the connect/disconnect button
        /// </summary>
        public string ConnectButtonDescription
        {
            get
            {
                return connectButtonDescription;
            }

            set
            {
                if (this.connectButtonDescription != value)
                {
                    connectButtonDescription = value;
                    RaisePropertyChanged(nameof(ConnectButtonDescription));
                }
            }
        }

        /// <summary>
        /// Initializes a new instance of MainPageViewModel, and starts
        /// searching for Arc Reactor devices
        /// </summary>
        public MainPageViewModel()
        {
            if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
                return;

            reactor = new ArcReactorService();
            RefreshDevicesList();

            CreateLedList();

            reactor.BatteryLevelChanged += Reactor_BatteryLevelChanged;
            reactor.Disconnected += Reactor_Disconnected;
        }

        private void Reactor_Disconnected()
        {
            IsConnected = reactor.IsConnected;
        }

        private void Reactor_BatteryLevelChanged(float value)
        {
            BatteryLevel = value;
        }

        /// <summary>
        /// Changes device mode to pulsing
        /// </summary>
        public void SendPulse()
        {
            reactor.SetPulseSequence();
        }

        /// <summary>
        /// Turns off all device LEDs
        /// </summary>
        public void SendBlack()
        {
            reactor.SetAllBlack();
        }

        /// <summary>
        /// Turns on "startup" mode for device
        /// </summary>
        public void SendStartup()
        {
            reactor.SetStartupSequence();
        }

        /// <summary>
        /// Sends to the device desired LEDs color for every diode
        /// </summary>
        public void SendLeds()
        {
            reactor.SetLedsBatchAsync(RgbLeds);
        }

        private DelegateCommand<ColoredLed> _applyColorCommand;

        /// <summary>
        /// Sends to the device desired LED color for a single diode
        /// </summary>
        public DelegateCommand<ColoredLed> ApplyColor
            => _applyColorCommand ?? (_applyColorCommand = new DelegateCommand<ColoredLed>(ApplyColorCommandExecute, ApplyColorCommandCanExecute));

        private bool ApplyColorCommandCanExecute(ColoredLed param) => true;

        private void ApplyColorCommandExecute(ColoredLed param)
        {
            reactor.SetSingleLedAsync(param);
        }

        private void CreateLedList()
        {
            RgbLeds = new ObservableCollection<ColoredLed>();
            for (int i = 0; i < LEDCOUNTER; i++)
            {
                RgbLeds.Add(new ColoredLed { Index = i, R = 0, G = 0, B = 0 });
            }
        }

        /// <summary>
        /// Refreshes the list of devices available for connection
        /// </summary>
        public async void RefreshDevicesList()
        {
            ArcReactorDevices = new ObservableCollection<DeviceInformation>();

            var pairedDevices = await reactor.FindPairedDevicesAsync();
            foreach (var item in pairedDevices)
            {
                ArcReactorDevices.Add(item);
            }
        }

        /// <summary>
        /// Navigates to About page
        /// </summary>
        public void GotoAbout() =>
            NavigationService.Navigate(typeof(Views.AboutPage));
    }
}


text:
export default () => (

Environment variable process.env.TEST is "{process.env.TEST}"

      Custom environment variables process.env.BACKEND_URL is "
      {process.env.BACKEND_URL}"

)


text:
package org.apache.cassandra.cql3.statements;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.cassandra.exceptions.InvalidRequestException;
import org.apache.cassandra.db.IndexExpression;
import org.apache.cassandra.cql3.*;

/**
 * A restriction/clause on a column.
 * The goal of this class being to group all conditions for a column in a SELECT.
 */
public interface Restriction
{
    public boolean isOnToken();

    public boolean isSlice();
    public boolean isEQ();
    public boolean isIN();

    // Only supported for EQ and IN, but it's convenient to have here
    public List<ByteBuffer> values(List<ByteBuffer> variables) throws InvalidRequestException;

    public static class EQ implements Restriction
    {
        private final Term value;
        private final boolean onToken;

        public EQ(Term value, boolean onToken)
        {
            this.value = value;
            this.onToken = onToken;
        }

        public List<ByteBuffer> values(List<ByteBuffer> variables) throws InvalidRequestException
        {
            return Collections.singletonList(value.bindAndGet(variables));
        }

        public boolean isSlice()
        {
            return false;
        }

        public boolean isEQ()
        {
            return true;
        }

        public boolean isIN()
        {
            return false;
        }

        public boolean isOnToken()
        {
            return onToken;
        }

        @Override
        public String toString()
        {
            return String.format("EQ(%s)%s", value, onToken ? "*" : "");
        }
    }

    public static abstract class IN implements Restriction
    {
        public static IN create(List<Term> values)
        {
            return new WithValues(values);
        }

        public static IN create(Term value) throws InvalidRequestException
        {
            assert value instanceof Lists.Marker; // we shouldn't have got there otherwise
            return new WithMarker((Lists.Marker)value);
        }

        public boolean isSlice()
        {
            return false;
        }

        public boolean isEQ()
        {
            return false;
        }

        public boolean isIN()
        {
            return true;
        }

        // Used when we need to know if it's a IN with just one value before we have
        // the bind variables. This is ugly and only there for backward compatiblity
        // because we used to treate IN with 1 value like an EQ and need to preserve
        // this behavior.
        public abstract boolean canHaveOnlyOneValue();

        public boolean isOnToken()
        {
            return false;
        }

        private static class WithValues extends IN
        {
            private final List<Term> values;

            private WithValues(List<Term> values)
            {
                this.values = values;
            }

            public List<ByteBuffer> values(List<ByteBuffer> variables) throws InvalidRequestException
            {
                List<ByteBuffer> buffers = new ArrayList<ByteBuffer>(values.size());
                for (Term value : values)
                    buffers.add(value.bindAndGet(variables));
                return buffers;
            }

            public boolean canHaveOnlyOneValue()
            {
                return values.size() == 1;
            }

            @Override
            public String toString()
            {
                return String.format("IN(%s)", values);
            }
        }

        private static class WithMarker extends IN
        {
            private final Lists.Marker marker;

            private WithMarker(Lists.Marker marker)
            {
                this.marker = marker;
            }

            public List<ByteBuffer> values(List<ByteBuffer> variables) throws InvalidRequestException
            {
                Lists.Value lval = marker.bind(variables);
                if (lval == null)
                    throw new InvalidRequestException("Invalid null value for IN restriction");
                return lval.elements;
            }

            public boolean canHaveOnlyOneValue()
            {
                return false;
            }

            @Override
            public String toString()
            {
                return "IN ?";
            }
        }
    }

    public static class Slice implements Restriction
    {
        private final Term[] bounds;
        private final boolean[] boundInclusive;
        private final boolean onToken;

        public Slice(boolean onToken)
        {
            this.bounds = new Term[2];
            this.boundInclusive = new boolean[2];
            this.onToken = onToken;
        }

        public boolean isSlice()
        {
            return true;
        }

        public boolean isEQ()
        {
            return false;
        }

        public boolean isIN()
        {
            return false;
        }

        public List<ByteBuffer> values(List<ByteBuffer> variables) throws InvalidRequestException
        {
            throw new UnsupportedOperationException();
        }

        public boolean isOnToken()
        {
            return onToken;
        }

        public boolean hasBound(Bound b)
        {
            return bounds[b.idx] != null;
        }

        public ByteBuffer bound(Bound b, List<ByteBuffer> variables) throws InvalidRequestException
        {
            return bounds[b.idx].bindAndGet(variables);
        }

        public boolean isInclusive(Bound b)
        {
            return bounds[b.idx] == null || boundInclusive[b.idx];
        }

        public Relation.Type getRelation(Bound eocBound, Bound inclusiveBound)
        {
            switch (eocBound)
            {
                case START:
                    return boundInclusive[inclusiveBound.idx] ? Relation.Type.GTE : Relation.Type.GT;
                case END:
                    return boundInclusive[inclusiveBound.idx] ? Relation.Type.LTE : Relation.Type.LT;
            }
            throw new AssertionError();
        }

        public IndexExpression.Operator getIndexOperator(Bound b)
        {
            switch (b)
            {
                case START:
                    return boundInclusive[b.idx] ? IndexExpression.Operator.GTE : IndexExpression.Operator.GT;
                case END:
                    return boundInclusive[b.idx] ? IndexExpression.Operator.LTE : IndexExpression.Operator.LT;
            }
            throw new AssertionError();
        }

        public void setBound(ColumnIdentifier name, Relation.Type type, Term t) throws InvalidRequestException
        {
            Bound b;
            boolean inclusive;
            switch (type)
            {
                case GT:
                    b = Bound.START;
                    inclusive = false;
                    break;
                case GTE:
                    b = Bound.START;
                    inclusive = true;
                    break;
                case LT:
                    b = Bound.END;
                    inclusive = false;
                    break;
                case LTE:
                    b = Bound.END;
                    inclusive = true;
                    break;
                default:
                    throw new AssertionError();
            }

            if (bounds[b.idx] != null)
                throw new InvalidRequestException(String.format("Invalid restrictions found on %s", name));

            bounds[b.idx] = t;
            boundInclusive[b.idx] = inclusive;
        }

        @Override
        public String toString()
        {
            return String.format("SLICE(%s %s, %s %s)%s", boundInclusive[0] ? ">=" : ">",
                                                          bounds[0],
                                                          boundInclusive[1] ? "<=" : "<",
                                                          bounds[1],
                                                          onToken ? "*" : "");
        }
    }
}


text:
package org.kaazing.gateway.management.jmx;

import javax.management.ObjectName;

public interface NicListMXBean {

    ObjectName getObjectName();

    String getNetInterfaceNames();

    String getSummaryDataFields();

    String getSummaryData();

    int getSummaryDataGatherInterval();

    void setSummaryDataGatherInterval(int interval);
}


text:
package HaskellFun.behavior;

/*Generated by MPS */

import jetbrains.mps.lang.core.behavior.BaseConcept_BehaviorDescriptor;

public abstract class Form_BehaviorDescriptor extends BaseConcept_BehaviorDescriptor {
  public Form_BehaviorDescriptor() {
  }
  @Override
  public String getConceptFqName() {
    return "HaskellFun.structure.Form";
  }
}


text:
import { Injectable } from '@angular/core';
import { AppConsts } from 'shared/AppConsts';
import { AppSessionService } from '../session/app-session.service';

@Injectable()
export class AppUrlService {

    static tenancyNamePlaceHolder = '{TENANCY_NAME}';

    constructor(
        private readonly _appSessionService: AppSessionService
    ) {

    }

    get appRootUrl(): string {
        if (this._appSessionService.tenant) {
            return this.getAppRootUrlOfTenant(this._appSessionService.tenant.tenancyName);
        } else {
            return this.getAppRootUrlOfTenant(null);
        }
    }

    /**
     * Returning url ends with '/'.
     */
    getAppRootUrlOfTenant(tenancyName?: string): string {
        let baseUrl = this.ensureEndsWith(AppConsts.appBaseUrl, '/');

        if (baseUrl.indexOf(AppUrlService.tenancyNamePlaceHolder) < 0) {
            return baseUrl;
        }

        if (baseUrl.indexOf(AppUrlService.tenancyNamePlaceHolder + '.') >= 0) {
            baseUrl = baseUrl.replace(AppUrlService.tenancyNamePlaceHolder + '.', AppUrlService.tenancyNamePlaceHolder);
            if (tenancyName) {
                tenancyName = tenancyName + '.';
            }
        }

        if (!tenancyName) {
            return baseUrl.replace(AppUrlService.tenancyNamePlaceHolder, '');
        }

        return baseUrl.replace(AppUrlService.tenancyNamePlaceHolder, tenancyName);
    }

    private ensureEndsWith(str: string, c: string) {
        if (str.charAt(str.length - 1) !== c) {
            str = str + c;
        }

        return str;
    }

    private removeFromEnd(str: string, c: string) {
        if (str.charAt(str.length - 1) === c) {
            str = str.substr(0, str.length - 1);
        }

        return str;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         id="refimpl"
         name="Reference Implementation"
         point="org.eclipse.core.resources.natures">
      <runtime>
         <run
               class="com.gerken.xaa.nature.RefImplNature">
         </run>
      </runtime>
   </extension>
   <extension
         id="xform"
         name="Xform"
         point="org.eclipse.core.resources.natures">
      <runtime>
         <run
               class="com.gerken.xaa.nature.XformNature">
         </run>
      </runtime>
   </extension>

</plugin>


text:
@if( Auth::user() && count( array_intersect(array_pluck(Auth::user()->roles,'id'), array_pluck($item->roles, 'id') ) ) )
    @if(!$item->action)
        @if(count($item->children) && $item->menu_id)

             {{$item->name}}
        @else

             {{$item->name}}
        @endif

    @else

        action}}">
            class}}">
            {{$item->name}}

    @endif
    @if (count($item['children']) > 0)

            @foreach($item['children'] as $item)
                @include('laravel-menus::layouts._menu_item', $items)
            @endforeach

    @endif

@endif


text:
package com.radex392.temporalrelativity.entity;

import com.radex392.temporalrelativity.reference.Reference;
import com.radex392.temporalrelativity.reference.Textures;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;

/**
 * Created by OEM on 25/02/2015.
 */
@SideOnly(Side.CLIENT)
public class RenderTimeChicken extends RenderLiving {

    private static final ResourceLocation chickenTextures = new ResourceLocation( Textures.RESOURCE_PREFIX + "textures/entity/TimeChicken.png");

    public RenderTimeChicken( ModelBase modelBase, float par2 ){
        super(modelBase, par2);
    }

    /**
     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
     * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
     */
    public void doRender(TimeChicken p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
    {
        super.doRender((EntityLiving)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
    }

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
    protected ResourceLocation getEntityTexture(TimeChicken p_110775_1_)
    {
        return chickenTextures;
    }

    /**
     * Defines what float the third param in setRotationAngles of ModelBase is
     */
    protected float handleRotationFloat(TimeChicken p_77044_1_, float p_77044_2_)
    {
        float f1 = p_77044_1_.field_70888_h + (p_77044_1_.field_70886_e - p_77044_1_.field_70888_h) * p_77044_2_;
        float f2 = p_77044_1_.field_70884_g + (p_77044_1_.destPos - p_77044_1_.field_70884_g) * p_77044_2_;
        return (MathHelper.sin(f1) + 1.0F) * f2;
    }

    /**
     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
     * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
     */
    public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
    {
        this.doRender((TimeChicken)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
    }

    /**
     * Defines what float the third param in setRotationAngles of ModelBase is
     */
    protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_)
    {
        return this.handleRotationFloat((TimeChicken)p_77044_1_, p_77044_2_);
    }

    /**
     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
     * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
     */
    public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
    {
        this.doRender((TimeChicken)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
    }

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
    protected ResourceLocation getEntityTexture(Entity p_110775_1_)
    {
        return this.getEntityTexture((TimeChicken)p_110775_1_);
    }

    /**
     * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
     * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
     * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
     * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
     */
    public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
    {
        this.doRender((TimeChicken)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
    }
}


text:
package io.shockah.dunlin.factoids;

import io.shockah.dunlin.commands.CommandCall;
import io.shockah.dunlin.commands.CommandParseException;
import io.shockah.dunlin.commands.CommandResult;
import io.shockah.dunlin.commands.ErrorCommandResult;
import io.shockah.dunlin.commands.NamedCommand;
import io.shockah.dunlin.commands.ValueCommandResult;
import io.shockah.dunlin.factoids.ForgetCommand.Input;
import io.shockah.dunlin.factoids.db.Factoid;
import net.dv8tion.jda.core.events.message.GenericMessageEvent;
import pl.shockah.util.UnexpectedException;

public class ForgetCommand extends NamedCommand<Input, Factoid> {
	private final FactoidsPlugin plugin;

	public ForgetCommand(FactoidsPlugin plugin) {
		super("forget", "f");
		this.plugin = plugin;
	}

	@Override
	public Input convertToInput(GenericMessageEvent e, Object input) throws CommandParseException {
		if (input instanceof Input)
			return (Input)input;
		return super.convertToInput(e, input);
	}

	@Override
	public Input parseInput(GenericMessageEvent e, String input) throws CommandParseException {
		if (input.isEmpty())
			throw new CommandParseException("Not enough arguments.", true);
		String[] split = input.split("\\s");

		Factoid.Context context = plugin.getDefaultContext();
		String name = null;

		if (split[0].charAt(0) == '@') {
			String contextName = split[0].substring(1);
			context = Factoid.Context.valueOf(contextName);
			if (context == null)
				throw new CommandParseException(String.format("Invalid factoid context: %s", contextName), true);

			name = split[1];
		} else {
			name = split[0];
		}

		return new Input(context, name);
	}

	@Override
	public CommandResult<Factoid> call(CommandCall call, Input input) {
		if (input.context == Factoid.Context.Global && !plugin.hasGlobalFactoidPermission(call.event.getAuthor()))
			return new ErrorCommandResult<>("Permission required.");

		Factoid factoid = plugin.findActiveFactoid(call.event, input.name, input.context);
		if (factoid != null) {
			try {
				factoid.active = false;
				factoid.update();
			} catch (Exception e) {
				throw new UnexpectedException(e);
			}
		}

		//if (call.outputMedium == null)
		//	call.outputMedium = Medium.Notice;
		return new ValueCommandResult<>(factoid, factoid == null ? "Factoid doesn't exist." : "Forgot: " + factoid.raw);
	}

	public static final class Input {
		public final Factoid.Context context;
		public final String name;

		public Input(Factoid.Context context, String name) {
			this.context = context;
			this.name = name;
		}
	}
}


text:
#include "llvmgen.h"

/*
 * gen_conditional
 *
 * Generates code for a conditional (IF-THEN-ELSE)
 * expression.
 */
static LLVMValueRef
gen_conditional (gencodectx_t gctx, expr_node_t *exp, LLVMTypeRef neededtype)
{
    LLVMBuilderRef builder = gctx->curfn->builder;
    LLVMBasicBlockRef exitblk = llvmgen_exitblock_create(gctx, llvmgen_label(gctx));
    llvm_btrack_t *bt = llvmgen_btrack_create(gctx, exitblk);
    int hasval = expr_has_value(exp);
    LLVMBasicBlockRef consblk, altblk;
    LLVMValueRef consval, altval, test, result;
    LLVMTypeRef resulttype;

    test = llvmgen_expression(gctx, expr_cond_test(exp), gctx->int1type);
    if (expr_cond_alternative(exp) != 0) {
        altblk = LLVMInsertBasicBlockInContext(gctx->llvmctx, exitblk, llvmgen_label(gctx));
    } else {
        altblk = 0;
    }
    consblk = LLVMInsertBasicBlockInContext(gctx->llvmctx, (altblk == 0 ? exitblk : altblk),
                                            llvmgen_label(gctx));
    LLVMBuildCondBr(builder, test, consblk, (altblk == 0 ? exitblk : altblk));
    if (altblk == 0) llvmgen_btrack_update_brcount(gctx, bt);
    LLVMPositionBuilderAtEnd(builder, consblk);
    resulttype = (hasval ? neededtype : 0);
    consval = llvmgen_expression(gctx, expr_cond_consequent(exp), resulttype);
    if (hasval && resulttype == 0 && consval != 0) {
        resulttype = LLVMTypeOf(consval);
    }
    llvmgen_btrack_update(gctx, bt, (hasval ? consval : 0));
    if (altblk != 0) {
        LLVMPositionBuilderAtEnd(builder, altblk);
        altval = llvmgen_expression(gctx, expr_cond_alternative(exp), resulttype);
        llvmgen_btrack_update(gctx, bt, altval);
    }
    result = llvmgen_btrack_finalize(gctx, bt, resulttype);
    if (neededtype != 0 && result == 0) {
        log_signal(expr_logctx(gctx->ectx), expr_textpos(exp), STC__EXPRVALRQ);
        result = LLVMConstNull(neededtype);
    }

    return result;

} /* gen_conditional */

/*
 * gen_case
 *
 * Generates a CASE expression.
 */
static LLVMValueRef
gen_case (gencodectx_t gctx, expr_node_t *exp, LLVMTypeRef neededtype)
{
    LLVMBasicBlockRef exitblk = llvmgen_exitblock_create(gctx, llvmgen_label(gctx));
    llvm_btrack_t *bt = llvmgen_btrack_create(gctx, exitblk);
    expr_node_t **actions = expr_case_actions(exp);
    unsigned int lo = (unsigned int) expr_case_lowbound(exp);
    unsigned int hi = (unsigned int) expr_case_highbound(exp);
    long *cases = expr_case_cases(exp);
    unsigned int casecount = (hi-lo+1);
    unsigned int actioncount = (unsigned int) expr_case_actioncount(exp);
    LLVMBuilderRef builder = gctx->curfn->builder;
    int hasval = expr_has_value(exp);
    int outrange = (int) expr_case_outrange(exp);
    LLVMBasicBlockRef curblk, *bbvec, localvec[256];
    LLVMValueRef idxval, actval, swval, result;
    unsigned int i;

    // If we have a reasonable number of case actions,
    // just use the local buffer to hold them.
    if (actioncount <= 256) {
        bbvec = localvec;
    } else {
        bbvec = malloc(actioncount * sizeof(LLVMBasicBlockRef));
    }
    memset(bbvec, 0, actioncount * sizeof(LLVMBasicBlockRef));
    idxval = llvmgen_expression(gctx, expr_case_index(exp), gctx->fullwordtype);
    idxval = LLVMBuildSub(builder, idxval, LLVMConstInt(gctx->fullwordtype, lo, 1),
                          llvmgen_temp(gctx));
    curblk = LLVMGetInsertBlock(builder);
    for (i = 0; i < actioncount; i++) {
        bbvec[i] = LLVMInsertBasicBlockInContext(gctx->llvmctx, exitblk, llvmgen_label(gctx));
        LLVMPositionBuilderAtEnd(builder, bbvec[i]);
        actval = llvmgen_expression(gctx, actions[i], (hasval ? gctx->fullwordtype : 0));
        llvmgen_btrack_update(gctx, bt, (hasval ? actval : 0));
    }
    LLVMPositionBuilderAtEnd(builder, curblk);
    swval = LLVMBuildSwitch(builder, idxval, (outrange < 0 ? exitblk : bbvec[outrange]), casecount);
    if (outrange < 0) {
        llvmgen_btrack_update_brcount(gctx, bt);
        if (hasval) {
            llvmgen_btrack_update_phi(gctx, bt, curblk, LLVMConstAllOnes(gctx->fullwordtype));
        }
    }
    for (i = 0; i < casecount; i++) {
        LLVMAddCase(swval, LLVMConstInt(gctx->fullwordtype, i, 0), bbvec[cases[i]]);
    }
    result = llvmgen_btrack_finalize(gctx, bt, gctx->fullwordtype);

    if (bbvec != localvec) {
        free(bbvec);
    }

    if (result == 0) {
        if (neededtype != 0) {
            log_signal(expr_logctx(gctx->ectx), expr_textpos(exp), STC__EXPRVALRQ);
            return LLVMConstNull(neededtype);
        }
        return 0;
    }

    return llvmgen_adjustval(gctx, result, neededtype, 1);

} /* gen_case */

/*
 * gen_loop_or_block_exit
 *
 * Generates code for LEAVE and EXITLOOP exit expresions.
 */
static LLVMValueRef
gen_loop_or_block_exit (gencodectx_t gctx, expr_node_t *exp, LLVMTypeRef neededtype)
{
    name_t *np = expr_exit_label(exp);
    llvm_btrack_t *bt = (np == 0 ? gctx->curfn->btrack[LLVMGEN_K_BT_LOOP] : llvmgen_label_btrack(np));
    expr_node_t *exitexp = expr_exit_value(exp);
    LLVMValueRef exitval = (exitexp == 0 ? 0 : llvmgen_expression(gctx, exitexp, neededtype));

    llvmgen_btrack_update(gctx, bt, exitval);

    return exitval;

} /* gen_loop_or_block_exit */

/*
 * gen_return
 *
 * Generates code for RETURN expressions.
 */
static LLVMValueRef
gen_return (gencodectx_t gctx, expr_node_t *exp, LLVMTypeRef neededtype)
{
    expr_node_t *retexp = expr_exit_value(exp);
    LLVMValueRef retval = (retexp == 0 ? 0 : llvmgen_expression(gctx, retexp, gctx->fullwordtype));

    llvmgen_btrack_update(gctx, gctx->curfn->btrack[LLVMGEN_K_BT_FUNC], retval);

    if (retval != 0) retval = llvmgen_adjustval(gctx, retval, neededtype, 0);
    return retval;

} /* gen_return */

/*
 * gen_select
 *
 * Generates code for SELECT/SELECTONE expressions.
 */
static LLVMValueRef
gen_select (gencodectx_t gctx, expr_node_t *exp, LLVMTypeRef neededtype)
{
    LLVMBasicBlockRef exitblk = llvmgen_exitblock_create(gctx, llvmgen_label(gctx));
    llvm_btrack_t *bt = llvmgen_btrack_create(gctx, exitblk);
    LLVMBuilderRef builder = gctx->curfn->builder;
    optype_t op = expr_sel_cmptype(exp);
    exprseq_t *selseq = expr_sel_selectors(exp);
    unsigned int numtests = exprseq_length(selseq);
    int is_selectone = expr_sel_oneonly(exp);
    int hasval = expr_has_value(exp);
    expr_node_t *sel, *otherwexp;
    LLVMIntPredicate eqlpred, geqpred, leqpred;
    LLVMBasicBlockRef curblk, otherwise, always, insertpoint, testinspoint;
    LLVMValueRef idxval, v, result;
    LLVMTypeRef actiontype = (hasval ? gctx->fullwordtype : 0);
    struct seltrack_s {
        LLVMValueRef testval, matchval;
        LLVMBasicBlockRef testblk, testend;
        LLVMBasicBlockRef matchdest, matchdestend;
    } *st, stlocal[32];
    unsigned int i;

    if (op == OPER_CMP_EQLA) {
        op = (machine_addr_signed(gctx->mach) ? OPER_CMP_EQL : OPER_CMP_EQLU);
    }
    eqlpred = LLVMIntEQ;
    if (op == OPER_CMP_EQL) {
        leqpred = LLVMIntSLE;
        geqpred = LLVMIntSGE;
    } else {
        leqpred = LLVMIntULE;
        geqpred = LLVMIntUGE;
    }
    insertpoint = exitblk;
    idxval = llvmgen_expression(gctx, expr_sel_index(exp), gctx->fullwordtype);
    curblk = LLVMGetInsertBlock(builder);
    if (expr_sel_alwaysaction(exp) != 0) {
        always = LLVMInsertBasicBlockInContext(gctx->llvmctx, exitblk, llvmgen_label(gctx));
        LLVMPositionBuilderAtEnd(builder, always);
        v = llvmgen_expression(gctx, expr_sel_alwaysaction(exp), actiontype);
        llvmgen_btrack_update(gctx, bt, v);
        insertpoint = always;
    } else {
        always = 0;
    }

    otherwexp = expr_sel_otherwiseaction(exp);
    if (otherwexp != 0) {
        otherwise = LLVMInsertBasicBlockInContext(gctx->llvmctx, insertpoint,
                                                  llvmgen_label(gctx));
        LLVMPositionBuilderAtEnd(builder, otherwise);
        v = llvmgen_expression(gctx, otherwexp, actiontype);
        if (always == 0) {
            llvmgen_btrack_update(gctx, bt, v);
        } else {
            LLVMBuildBr(builder, always);
        }
        insertpoint = otherwise;
    } else {
        otherwise = 0;
    }

    if (numtests == 0) {
        LLVMPositionBuilderAtEnd(builder, curblk);
        if (otherwise == 0) {
            if (always == 0) {
                llvmgen_btrack_update(gctx, bt,
                                      (hasval ? LLVMConstAllOnes(gctx->fullwordtype) : 0));
            } else {
                LLVMBuildBr(builder, always);
            }
        } else {
            LLVMBuildBr(builder, otherwise);
        }
        result = llvmgen_btrack_finalize(gctx, bt, (hasval ? actiontype : 0));
        return llvmgen_adjustval(gctx, result, neededtype, 1);
    }

    if (numtests > 32) {
        st = malloc(numtests * sizeof(struct seltrack_s));
    } else {
        st = stlocal;
    }
    memset(st, 0, numtests * sizeof(struct seltrack_s));
    testinspoint = insertpoint;
    for (i = 0, sel = exprseq_head(selseq); sel != 0; i++, sel = sel->tq_next) {
        expr_node_t *subsel;
        if (otherwexp != 0 && expr_selector_action(sel) == otherwexp) {
            st[i].matchdest = otherwise;
        } else {
            st[i].matchdest = LLVMInsertBasicBlockInContext(gctx->llvmctx, insertpoint,
                                                            llvmgen_label(gctx));
            LLVMPositionBuilderAtEnd(builder, st[i].matchdest);
            st[i].matchval = llvmgen_expression(gctx, expr_selector_action(sel),
                                                actiontype);
            st[i].matchdestend = LLVMGetInsertBlock(builder);
            if (testinspoint == insertpoint) {
                testinspoint = st[i].matchdest;
            }
        }
        st[i].testblk = (i == 0 ? curblk
                         : LLVMInsertBasicBlockInContext(gctx->llvmctx, testinspoint,
                                                         llvmgen_label(gctx)));
        LLVMPositionBuilderAtEnd(builder, st[i].testblk);
        for (subsel = sel; subsel != 0; subsel = expr_selector_next(subsel)) {
            LLVMValueRef loval, hival;
            loval = llvmgen_expression(gctx, expr_selector_low(subsel), gctx->fullwordtype);
            if (expr_selector_high(subsel) == 0) {
                hival = 0;
            } else {
                hival = llvmgen_expression(gctx, expr_selector_high(subsel), gctx->fullwordtype);
            }
            v = LLVMBuildICmp(builder, (hival == 0 ? eqlpred : geqpred),
                              idxval, loval, llvmgen_temp(gctx));
            if (hival != 0) {
                LLVMValueRef hitest;
                hitest = LLVMBuildICmp(builder, leqpred, idxval, hival, llvmgen_temp(gctx));
                v = LLVMBuildAnd(builder, v, hitest, llvmgen_temp(gctx));
            }
            if (st[i].testval == 0) {
                st[i].testval = v;
            } else {
                st[i].testval = LLVMBuildOr(builder, st[i].testval, v, llvmgen_temp(gctx));
            }
        }
        st[i].testend = LLVMGetInsertBlock(builder);
    }

    for (i = 0, sel = exprseq_head(selseq); sel != 0; i++, sel = sel->tq_next) {
        LLVMBasicBlockRef nextifnomatch, nextaftermatchaction;
        LLVMPositionBuilderAtEnd(builder, st[i].testend);
        if (sel->tq_next == 0) {
            if (otherwise == 0) {
                if (always == 0) {
                    if (hasval) {
                        llvmgen_btrack_update_phi(gctx, bt, 0,
                                                  LLVMConstAllOnes(gctx->fullwordtype));
                    }
                    nextifnomatch = exitblk;
                } else {
                    nextifnomatch = always;
                }
            } else {
                nextifnomatch = otherwise;
            }
            nextaftermatchaction = (always == 0 ? exitblk : always);
        } else {
            nextifnomatch = st[i+1].testblk;
            nextaftermatchaction = (is_selectone ? exitblk : nextifnomatch);
        }
        LLVMBuildCondBr(builder, st[i].testval, st[i].matchdest, nextifnomatch);
        if (nextifnomatch == exitblk) {
            llvmgen_btrack_update_brcount(gctx, bt);
        }
        if (otherwise == 0 || st[i].matchdest != otherwise) {
            LLVMPositionBuilderAtEnd(builder, st[i].matchdestend);
            if (nextaftermatchaction == exitblk) {
                llvmgen_btrack_update(gctx, bt, st[i].matchval);
            } else if (LLVMGetBasicBlockTerminator(st[i].matchdestend) == 0) {
                LLVMBuildBr(builder, nextaftermatchaction);
            }
        }
    }

    result = llvmgen_btrack_finalize(gctx, bt, actiontype);

    if (st != stlocal) {
        free(st);
    }

    return llvmgen_adjustval(gctx, result, neededtype, 1);

} /* gen_select */

/*
 * gen_while_until_loop
 *
 * Generates code for WHILE/UNTIL loops.
 */
static LLVMValueRef
gen_while_until_loop (gencodectx_t gctx, expr_node_t *exp, LLVMTypeRef neededtype)
{
    LLVMBasicBlockRef exitblk = llvmgen_exitblock_create(gctx, llvmgen_label(gctx));
    llvm_btrack_t *bt = llvmgen_btrack_create(gctx, exitblk);
    LLVMBuilderRef builder = gctx->curfn->builder;
    LLVMBasicBlockRef loopblk, testblk;
    LLVMValueRef result, val;

    if (expr_wuloop_type(exp) == LOOP_PRETEST_WHILE ||
        expr_wuloop_type(exp) == LOOP_PRETEST_UNTIL) {
        loopblk = LLVMInsertBasicBlockInContext(gctx->llvmctx, exitblk, llvmgen_label(gctx));
        testblk = LLVMInsertBasicBlockInContext(gctx->llvmctx, loopblk, llvmgen_label(gctx));
        LLVMBuildBr(builder, testblk);
    } else {
        testblk = LLVMInsertBasicBlockInContext(gctx->llvmctx, exitblk, llvmgen_label(gctx));
        loopblk = LLVMInsertBasicBlockInContext(gctx->llvmctx, testblk, llvmgen_label(gctx));
        LLVMBuildBr(builder, loopblk);
    }
    LLVMPositionBuilderAtEnd(builder, testblk);
    val = llvmgen_expression(gctx, expr_wuloop_test(exp), gctx->int1type);
    if (expr_wuloop_type(exp) == LOOP_PRETEST_WHILE ||
        expr_wuloop_type(exp) == LOOP_POSTTEST_WHILE) {
        LLVMBuildCondBr(builder, val, loopblk, exitblk);
    } else {
        LLVMBuildCondBr(builder, val, exitblk, loopblk);
    }
    llvmgen_btrack_update_brcount(gctx, bt);
    llvmgen_btrack_update_phi(gctx, bt, LLVMGetInsertBlock(builder),
                              LLVMConstAllOnes(gctx->fullwordtype));
    LLVMPositionBuilderAtEnd(builder, loopblk);
    bt->next = gctx->curfn->btrack[LLVMGEN_K_BT_LOOP];
    gctx->curfn->btrack[LLVMGEN_K_BT_LOOP] = bt;
    llvmgen_expression(gctx, expr_wuloop_body(exp), 0);
    if (LLVMGetBasicBlockTerminator(LLVMGetInsertBlock(builder)) == 0) {
        LLVMBuildBr(builder, testblk);
    }
    gctx->curfn->btrack[LLVMGEN_K_BT_LOOP] = bt->next;
    bt->next = 0;
    result = llvmgen_btrack_finalize(gctx, bt, gctx->fullwordtype);

    return llvmgen_adjustval(gctx, result, neededtype, 1);

} /* gen_while_until_loop */

/*
 * gen_incr_decr_loop
 *
 * Generates code for INCR and DECR loops.
 */
static LLVMValueRef
gen_incr_decr_loop (gencodectx_t gctx, expr_node_t *exp, LLVMTypeRef neededtype)
{
    LLVMBasicBlockRef exitblk = llvmgen_exitblock_create(gctx, llvmgen_label(gctx));
    llvm_btrack_t *bt = llvmgen_btrack_create(gctx, exitblk);
    LLVMBuilderRef builder = gctx->curfn->builder;
    optype_t compareop = expr_idloop_cmptype(exp);
    LLVMValueRef neg1 = LLVMConstAllOnes(gctx->fullwordtype);
    LLVMValueRef zero = LLVMConstNull(gctx->fullwordtype);
    LLVMValueRef loopidx = llvmgen_segaddress(gctx, expr_idloop_index(exp), 0, 0);
    int addrsigned = machine_addr_signed(gctx->mach);
    LLVMValueRef initval, endval, stepval, testphi, cmpval, result;
    LLVMBasicBlockRef loopblk, testblk, curblk;
    LLVMIntPredicate pred;
    int is_decr;

    is_decr = (compareop == OPER_CMP_GEQ || compareop == OPER_CMP_GEQU
               || compareop == OPER_CMP_GEQA);
    loopblk = LLVMInsertBasicBlockInContext(gctx->llvmctx, exitblk, llvmgen_label(gctx));
    testblk = LLVMInsertBasicBlockInContext(gctx->llvmctx, loopblk, llvmgen_label(gctx));
    if (expr_idloop_init(exp) != 0) {
        initval = llvmgen_expression(gctx, expr_idloop_init(exp), gctx->fullwordtype);
    } else {
        initval = (is_decr ? neg1 : zero); // -1 (unsigned) is +Infinity
    }
    if (expr_idloop_term(exp) != 0) {
        endval = llvmgen_expression(gctx, expr_idloop_term(exp), gctx->fullwordtype);
    } else {
        endval = (is_decr ? zero : neg1);
    }
    if (expr_idloop_step(exp) != 0) {
        stepval = llvmgen_expression(gctx, expr_idloop_step(exp), gctx->fullwordtype);
    } else {
        stepval = LLVMConstInt(gctx->fullwordtype, 1, 0);  // subtracted for DECR
    }
    curblk = LLVMGetInsertBlock(builder);
    LLVMBuildBr(builder, testblk);

    LLVMPositionBuilderAtEnd(builder, testblk);
    testphi = LLVMBuildPhi(builder, gctx->fullwordtype, llvmgen_temp(gctx));
    LLVMAddIncoming(testphi, &initval, &curblk, 1);
    LLVMBuildStore(builder, testphi, loopidx);
    if (!llvmgen_predfromop(compareop, addrsigned, &pred)) {
        log_signal(expr_logctx(gctx->ectx), expr_textpos(exp), STC__INTCMPERR, __func__);
    }
    cmpval = LLVMBuildICmp(builder, pred, testphi, endval, llvmgen_temp(gctx));
    LLVMBuildCondBr(builder, cmpval, loopblk, exitblk);
    llvmgen_btrack_update_phi(gctx, bt, LLVMGetInsertBlock(builder), neg1);
    llvmgen_btrack_update_brcount(gctx, bt);

    bt->next = gctx->curfn->btrack[LLVMGEN_K_BT_LOOP];
    gctx->curfn->btrack[LLVMGEN_K_BT_LOOP] = bt;
    LLVMPositionBuilderAtEnd(builder, loopblk);
    llvmgen_expression(gctx, expr_idloop_body(exp), 0);
    if (LLVMGetBasicBlockTerminator(LLVMGetInsertBlock(builder)) == 0) {
        LLVMValueRef v;
        v = LLVMBuildLoad(builder, loopidx, llvmgen_temp(gctx));
        if (is_decr) {
            v = LLVMBuildSub(builder, v, stepval, llvmgen_temp(gctx));
        } else {
            v = LLVMBuildAdd(builder, v, stepval, llvmgen_temp(gctx));
        }
        LLVMBuildBr(builder, testblk);
        curblk = LLVMGetInsertBlock(builder);
        LLVMAddIncoming(testphi, &v, &curblk, 1);
    }
    gctx->curfn->btrack[LLVMGEN_K_BT_LOOP] = bt->next;
    bt->next = 0;
    result = llvmgen_btrack_finalize(gctx, bt, gctx->fullwordtype);

    return llvmgen_adjustval(gctx, result, neededtype, 1);

} /* gen_incr_decr_loop */

/*
 * llvmgen_ctrlexpgen_init
 *
 * Initialization routine.  Installs the hooks into the
 * dispatcher for the expression types handled in this
 * module.
 */
void
llvmgen_ctrlexpgen_init (gencodectx_t gctx)
{

    llvmgen_expgen_register(gctx, EXPTYPE_CTRL_COND, gen_conditional);
    llvmgen_expgen_register(gctx, EXPTYPE_CTRL_CASE, gen_case);
    llvmgen_expgen_register(gctx, EXPTYPE_CTRL_EXIT, gen_loop_or_block_exit);
    llvmgen_expgen_register(gctx, EXPTYPE_CTRL_RET, gen_return);
    llvmgen_expgen_register(gctx, EXPTYPE_CTRL_SELECT, gen_select);
    llvmgen_expgen_register(gctx, EXPTYPE_CTRL_LOOPWU, gen_while_until_loop);
    llvmgen_expgen_register(gctx, EXPTYPE_CTRL_LOOPID, gen_incr_decr_loop);

} /* llvmgen_ctrlexpgen_init */


text:
class C {
    get "foo"() { return 0; }
}

//// [quotedAccessorName1.js]
var C = (function () {
    function C() {
    }
    Object.defineProperty(C.prototype, "foo", {
        get: function () { return 0; },
        enumerable: true,
        configurable: true
    });
    return C;
})();


text:
module Fog
  module Compute
    class OpenStack
      class Real
        def list_snapshots(detailed=true)
          path = detailed ? 'os-snapshots/detail' : 'os-snapshots'
          request(
            :expects  => 200,
            :method   => 'GET',
            :path     => path
          )
        end
      end

      class Mock
        def list_snapshots(detailed=true)
          response = Excon::Response.new
          response.status = 200
          response.body = {
            'snapshots' => [get_snapshot_details.body["snapshot"]]
          }
          response
        end
      end
    end
  end
end


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NSubstitute;
using FluentAssertions;
using Owin;
using Microsoft.Owin;

namespace Kentor.OwinCookieSaver.Tests
{
    [TestClass]
    public class KentorOwinCookieSaverExtensionsTests
    {
        [TestMethod]
        public void KentorOwinCookieSaverExtensions_Use_RegistersMiddleware()
        {
            var app = Substitute.For<IAppBuilder>();

            app.UseKentorOwinCookieSaver();

            app.Received().Use(typeof(KentorOwinCookieSaverMiddleware));
        }

        [TestMethod]
        public void KentorOwinCookieSaverExtensions_Use_With_Stage_RegistersMiddleware()
        {
            var app = Substitute.For<IAppBuilder>();

            app.UseKentorOwinCookieSaver(PipelineStage.Authenticate);

            app.Received().Use(typeof(KentorOwinCookieSaverMiddleware));
        }
    }
}


text:
package com.github.chrisblutz.trinity.files;

/**
 * @author Christopher Lutz
 */
public enum FilePrivilege {

    WRITE, READ
}


text:
"""Scoring module"""

import constants

class Score(object):
    def __init__(self):
        self.player1 = 0
        self.player2 = 0
        self.winner = 0

    def check_score(self, ball):
        if ball.position['x'] < 0:
            if self.player2 < 10: self.player2 += 1
            self._update_score(ball)
            if self.player2 == 10: self.winner = 2
        if ball.position['x'] > constants.SCREEN_WIDTH:
            if self.player1 < 10: self.player1 += 1
            self._update_score(ball)
            if self.player1 == 10: self.winner = 1

    def _update_score(self, ball):
        ball.reset_position()

    def reset(self):
        self.__init__()


text:
@extends('frontend.layouts.master')

@section('content')

{{ trans('labels.frontend.user.profile.update_information') }}

                    {!! Form::model($user, ['route' => 'member.user.profile.update', 'class' => 'form-horizontal', 'method' => 'PATCH']) !!}

                            {!! Form::label('name', trans('validation.attributes.frontend.name'), ['class' => 'col-md-4 control-label']) !!}

                                {!! Form::input('text', 'name', null, ['class' => 'form-control', 'placeholder' => trans('validation.attributes.frontend.name')]) !!}

                        @if ($user->canChangeEmail())

                                {!! Form::label('email', trans('validation.attributes.frontend.email'), ['class' => 'col-md-4 control-label']) !!}

                                    {!! Form::input('email', 'email', null, ['class' => 'form-control', 'placeholder' => trans('validation.attributes.frontend.email')]) !!}

                        @endif

                                {!! Form::submit(trans('labels.general.buttons.save'), ['class' => 'btn btn-primary']) !!}

                    {!! Form::close() !!}

@endsection


text:
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

            </button>
            {{ site.title }}

                {% for page in site.pages %} {% if page.title %} {% if page.url != '/404.html' %} {% if page.title != site.index_title %} {% if page.url contains "/page" or page.url contains "/tags/" or page.url contains "/search" %} {% else %}
                {% assign tmp = page.url | split:"." | size %}
                {% if tmp == 1 %}

                    {{ page.title }}

                {% endif %} {% endif %} {% endif %} {% endif %} {% endif %} {% endfor %}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="title_dialog_map_create_item">創解新</string>
    <string name="title_dialog_map_create_item_unauthorized">您不能創建新教堂或培訓。</string>
    <string name="btn_dialog_map_create_church">教堂</string>
    <string name="btn_dialog_map_create_training">培訓</string>
    <string name="label_marker_map_no_name">(沒有姓名)</string>
    <plurals name="text_marker_map_church_snippet">
        <item quantity="other">%1$d 成員</item>
    </plurals>
    <string name="menu_map_search">搜尋</string>
</resources>


text:
anyode
======

.. image:: http://hera.physchem.kth.se:9090/api/badges/bjodah/anyode/status.svg
   :target: http://hera.physchem.kth.se:9090/bjodah/anyode
   :alt: Build status

anyode provides C++ headers used by:

- `pyodesys <https://github.com/bjodah/pyodesys>`_
- `pycvodes <https://github.com/bjodah/pycvodes>`_
- `pyodeint <https://github.com/bjodah/pyodeint>`_
- `pygslodeiv2 <https://github.com/bjodah/pygslodeiv2>`_

Notes
-----
When compiled with ``-DNDEBUG`` then ``AnyODE::buffer_factory`` will return a ``std::unique_ptr`` to an (unitizialized)
array. When compiled without ``NDEBUG`` it will instead return a ``std::vector`` initizlied with signaling NaN.

By default, AnyODE uses BLAS/LAPACK for preconditioning operations on the Jacobian matrix. If you do not have
(or do not wish to compile with) BLAS/LAPACK, ``-DANYODE_NO_LAPACK=1`` should be set, in which case built-in
linear algebra routines will be substituted.

License
-------
The source code is Open Source and is released under the simplified 2-clause BSD license. See `LICENSE <LICENSE>`_ for further details.
Contributors are welcome to suggest improvements at https://github.com/bjodah/pyodesys

Author
------
Björn I. Dahlgren, contact:

- gmail address: bjodah