text:
package testdata

import (
	. "goa.design/goa/v3/dsl"
)

var UnaryRPCsDSL = func() {
	var PayloadA = Type("PayloadA", func() {
		Field(1, "Int", Int)
		Field(2, "String", String)
	})
	var PayloadB = Type("PayloadB", func() {
		Field(1, "UInt", UInt)
		Field(2, "Float32", Float32)
	})
	var ResultT = ResultType("application/vnd.goa.resultt", func() {
		TypeName("ResultT")
		Attributes(func() {
			Field(1, "ArrayField", ArrayOf(Boolean))
			Field(2, "MapField", MapOf(String, Float64))
		})
	})
	Service("ServiceUnaryRPCs", func() {
		Method("MethodUnaryRPCA", func() {
			Payload(PayloadA)
			Result(ResultT)
			GRPC(func() {})
		})
		Method("MethodUnaryRPCB", func() {
			Payload(PayloadB)
			Result(ResultT)
			GRPC(func() {})
		})
	})
}

var UnaryRPCNoPayloadDSL = func() {
	Service("ServiceUnaryRPCNoPayload", func() {
		Method("MethodUnaryRPCNoPayload", func() {
			Result(String)
			GRPC(func() {})
		})
	})
}

var UnaryRPCNoResultDSL = func() {
	Service("ServiceUnaryRPCNoResult", func() {
		Method("MethodUnaryRPCNoResult", func() {
			Payload(ArrayOf(String))
			GRPC(func() {})
		})
	})
}

var UnaryRPCWithErrorsDSL = func() {
	var ErrorType = Type("ErrorType", func() {
		Attribute("a", String)
	})
	var AnotherError = ResultType("application/vnd.goa.another_error", func() {
		TypeName("AnotherError")
		Attributes(func() {
			Attribute("name", String, func() {
				Meta("struct:error:name")
				Enum("this", "that")
			})
			Attribute("description", String)
			Required("name")
		})
	})
	Service("ServiceUnaryRPCWithErrors", func() {
		Method("MethodUnaryRPCWithErrors", func() {
			Payload(String)
			Result(String)
			Error("timeout")
			Error("internal", AnotherError)
			Error("bad_request", AnotherError)
			Error("custom_error", ErrorType)
			GRPC(func() {
				Response("timeout", CodeCanceled)
				Response("internal", CodeUnknown)
				Response("bad_request", CodeInvalidArgument)
				Response("custom_error", CodeUnknown)
			})
		})
	})
}

var UnaryRPCWithOverridingErrorsDSL = func() {
	Service("ServiceUnaryRPCWithOverridingErrors", func() {
		Error("overridden")
		GRPC(func() {
			Response("overridden", CodeCanceled)
		})
		Method("MethodUnaryRPCWithOverridingErrors", func() {
			Payload(String)
			Result(String)
			Error("internal")
			GRPC(func() {
				Response("overridden", CodeUnknown)
				Response("internal", CodeUnknown)
			})
		})
	})
}

var ServerStreamingRPCDSL = func() {
	Service("ServiceServerStreamingRPC", func() {
		Method("MethodServerStreamingRPC", func() {
			Payload(Int)
			StreamingResult(String)
			GRPC(func() {})
		})
	})
}

var ServerStreamingUserTypeDSL = func() {
	var UT = Type("UserType", func() {
		Field(1, "IntField", Int)
	})
	Service("ServiceServerStreamingUserTypeRPC", func() {
		Method("MethodServerStreamingUserTypeRPC", func() {
			StreamingResult(UT)
			GRPC(func() {})
		})
	})
}

var ServerStreamingArrayDSL = func() {
	Service("ServiceServerStreamingArray", func() {
		Method("MethodServerStreamingArray", func() {
			StreamingResult(ArrayOf(Int))
			GRPC(func() {})
		})
	})
}

var ServerStreamingMapDSL = func() {
	var UT = Type("UserType", func() {
		Field(1, "IntField", Int)
	})
	Service("ServiceServerStreamingMap", func() {
		Method("MethodServerStreamingMap", func() {
			StreamingResult(MapOf(String, UT))
			GRPC(func() {})
		})
	})
}

var ServerStreamingResultWithViewsDSL = func() {
	var RT = ResultType("application/vnd.result", func() {
		TypeName("ResultType")
		Attributes(func() {
			Field(1, "IntField", Int)
			Field(2, "DoubleField", Float64)
		})
		View("default", func() {
			Attribute("IntField")
			Attribute("DoubleField")
		})
		View("tiny", func() {
			Attribute("IntField")
		})
	})
	Service("ServiceServerStreamingUserTypeRPC", func() {
		Method("MethodServerStreamingUserTypeRPC", func() {
			StreamingResult(RT)
			GRPC(func() {})
		})
	})
}

var ServerStreamingResultCollectionWithExplicitViewDSL = func() {
	var RT = ResultType("application/vnd.result", func() {
		TypeName("ResultType")
		Attributes(func() {
			Attribute("IntField", Int)
			Attribute("DoubleField", Float64)
		})
		View("default", func() {
			Attribute("IntField")
			Attribute("DoubleField")
		})
		View("tiny", func() {
			Attribute("IntField")
		})
	})
	Service("ServiceServerStreamingResultTypeCollectionWithExplicitView", func() {
		Method("MethodServerStreamingResultTypeCollectionWithExplicitView", func() {
			StreamingResult(CollectionOf(RT), func() {
				View("tiny")
			})
			GRPC(func() {})
		})
	})
}

var ClientStreamingRPCDSL = func() {
	Service("ServiceClientStreamingRPC", func() {
		Method("MethodClientStreamingRPC", func() {
			StreamingPayload(Int)
			Result(String)
			GRPC(func() {})
		})
	})
}

var ClientStreamingRPCWithPayloadDSL = func() {
	Service("ServiceClientStreamingRPCWithPayload", func() {
		Method("MethodClientStreamingRPCWithPayload", func() {
			Payload(Int)
			StreamingPayload(Int)
			Result(String)
			GRPC(func() {})
		})
	})
}

var ClientStreamingNoResultDSL = func() {
	Service("ServiceClientStreamingNoResult", func() {
		Method("MethodClientStreamingNoResult", func() {
			StreamingPayload(Int)
			GRPC(func() {})
		})
	})
}

var BidirectionalStreamingRPCDSL = func() {
	var RT = ResultType("id", func() {
		Attributes(func() {
			Field(1, "a", Int)
			Field(2, "b", String)
		})
	})
	Service("ServiceBidirectionalStreamingRPC", func() {
		Method("MethodBidirectionalStreamingRPC", func() {
			StreamingPayload(Int)
			StreamingResult(RT)
			GRPC(func() {})
		})
	})
}

var BidirectionalStreamingRPCWithPayloadDSL = func() {
	var PT = Type("Payload", func() {
		Field(1, "a", Int)
		Field(2, "b", String)
	})
	Service("ServiceBidirectionalStreamingRPCWithPayload", func() {
		Method("MethodBidirectionalStreamingRPCWithPayload", func() {
			Payload(PT)
			StreamingPayload(Int)
			StreamingResult(UInt)
			GRPC(func() {})
		})
	})
}

var BidirectionalStreamingRPCWithErrorsDSL = func() {
	Service("ServiceBidirectionalStreamingRPCWithErrors", func() {
		Method("MethodBidirectionalStreamingRPCWithErrors", func() {
			StreamingPayload(Int)
			StreamingResult(Int)
			Error("timeout")
			Error("internal")
			Error("bad_request")
			GRPC(func() {
				Response("timeout", CodeCanceled)
				Response("internal", CodeUnknown)
				Response("bad_request", CodeInvalidArgument)
			})
		})
	})
}

var MessageUserTypeWithPrimitivesDSL = func() {
	var PayloadT = Type("PayloadT", func() {
		Field(1, "BooleanField", Boolean)
		Field(2, "IntField", Int)
		Field(3, "Int32Field", Int32)
		Field(4, "Int64Field", Int64)
		Field(5, "UIntField", UInt)
		Field(6, "UInt32Field", UInt32)
		Field(7, "UInt64Field", UInt64)
	})
	var ResultT = ResultType("application/vnd.goa.resultt", func() {
		TypeName("ResultT")
		Attributes(func() {
			Attribute("Float32Field", Float32, func() {
				Meta("rpc:tag", "1")
			})
			Attribute("Float64Field", Float64, func() {
				Meta("rpc:tag", "2")
			})
			Attribute("StringField", String, func() {
				Meta("rpc:tag", "3")
			})
			Attribute("BytesField", Bytes, func() {
				Meta("rpc:tag", "4")
			})
		})
	})
	Service("ServiceMessageUserTypeWithPrimitives", func() {
		Method("MethodMessageUserTypeWithPrimitives", func() {
			Payload(PayloadT)
			Result(ResultT)
			GRPC(func() {})
		})
	})
}

var MessageUserTypeWithNestedUserTypesDSL = func() {
	var UTLevel2 = Type("UTLevel2", func() {
		Field(2, "Int64Field", Int64)
	})
	var UTLevel1 = Type("UTLevel1", func() {
		Field(1, "Int32Field", Int32)
		Field(2, "Int64Field", Int64)
		Field(3, "UTLevel2", UTLevel2)
	})
	var UT = Type("UT", func() {
		Field(1, "BooleanField", Boolean)
		Field(2, "IntField", Int)
		Field(3, "UTLevel1", UTLevel1)
	})
	var RecursiveT = ResultType("application/vnd.goa.recursivet", func() {
		TypeName("RecursiveT")
		Attributes(func() {
			Field(1, "Recursive", "RecursiveT")
		})
	})
	Service("ServiceMessageUserTypeWithNestedUserTypes", func() {
		Method("MethodMessageUserTypeWithNestedUserTypes", func() {
			Payload(UT)
			Result(RecursiveT)
			GRPC(func() {})
		})
	})
}

var MessageResultTypeWithViewsDSL = func() {
	var RT = ResultType("application/vnd.goa.rt", func() {
		TypeName("RT")
		Attributes(func() {
			Field(1, "IntField", Int)
			Field(2, "StringField", String)
		})
		View("default", func() {
			Attribute("IntField")
			Attribute("StringField")
		})
		View("tiny", func() {
			Attribute("IntField")
		})
	})
	Service("ServiceMessageResultTypeWithViews", func() {
		Method("MethodMessageResultTypeWithViews", func() {
			Result(RT)
			GRPC(func() {})
		})
	})
}

var MessageResultTypeWithExplicitViewDSL = func() {
	var RT = ResultType("application/vnd.goa.rt", func() {
		TypeName("RT")
		Attributes(func() {
			Field(1, "IntField", Int)
			Field(2, "StringField", String)
		})
		View("default", func() {
			Attribute("IntField")
			Attribute("StringField")
		})
		View("tiny", func() {
			Attribute("IntField")
		})
	})
	Service("ServiceMessageResultTypeWithExplicitView", func() {
		Method("MethodMessageResultTypeWithExplicitView", func() {
			Result(RT, func() {
				View("tiny")
			})
			GRPC(func() {})
		})
	})
}

var MessageResultTypeCollectionDSL = func() {
	var RT = ResultType("application/vnd.goa.rt", func() {
		TypeName("RT")
		Attributes(func() {
			Field(1, "IntField", Int)
			Field(2, "StringField", String)
		})
		View("default", func() {
			Attribute("IntField")
			Attribute("StringField")
		})
		View("tiny", func() {
			Attribute("IntField")
		})
	})
	Service("ServiceMessageUserTypeWithNestedUserTypes", func() {
		Method("MethodMessageUserTypeWithNestedUserTypes", func() {
			Result(CollectionOf(RT))
			GRPC(func() {})
		})
	})
}

var MessageUserTypeWithCollectionDSL = func() {
	var RT = ResultType("application/vnd.goa.rt", func() {
		TypeName("RT")
		Attributes(func() {
			Attribute("IntField", Int, func() {
				Meta("rpc:tag", "1")
			})
		})
	})
	var ResultT = ResultType("application/vnd.goa.resultt", func() {
		TypeName("ResultT")
		Attributes(func() {
			Attribute("CollectionField", CollectionOf(RT), func() {
				Meta("rpc:tag", "1")
			})
		})
	})
	Service("ServiceMessageUserTypeWithPrimitives", func() {
		Method("MethodMessageUserTypeWithPrimitives", func() {
			Result(ResultT)
			GRPC(func() {})
		})
	})
}

var ResultWithCollectionDSL = func() {
	var RT = ResultType("application/vnd.goa.rt", func() {
		TypeName("RT")
		Attributes(func() {
			Attribute("IntField", Int, func() {
				Meta("rpc:tag", "1")
			})
		})
	})
	var ResultT = ResultType("application/vnd.goa.resultt", func() {
		TypeName("ResultT")
		Attributes(func() {
			Attribute("CollectionField", CollectionOf(RT), func() {
				Meta("rpc:tag", "1")
			})
		})
	})
	Service("ServiceResultWithCollection", func() {
		Method("MethodResultWithCollection", func() {
			Result(func() {
				Field(1, "result", ResultT)
			})
			GRPC(func() {})
		})
	})
}

var PayloadWithNestedTypesDSL = func() {
	var AParams = Type("AParams", func() {
		Field(1, "a", MapOf(String, ArrayOf(String)))
	})
	var BParams = Type("BParams", func() {
		Field(1, "b", MapOf(String, String))
	})
	var APayload = Type("APayload", func() {
		Field(1, "a_params", AParams)
		Field(2, "b_params", BParams)
	})
	Service("ServicePayloadWithNestedTypes", func() {
		Method("MethodPayloadWithNestedTypes", func() {
			Payload(func() {
				Extend(APayload)
			})
			GRPC(func() {
				Response(CodeOK)
			})
		})
	})
}

var MessageArrayDSL = func() {
	var UT = Type("UT", func() {
		Field(1, "ArrayOfPrimitives", ArrayOf(UInt))
		Field(2, "TwoDArray", ArrayOf(ArrayOf(Bytes)))
		Field(3, "ThreeDArray", ArrayOf(ArrayOf(ArrayOf(Bytes))))
		Field(4, "ArrayOfMaps", ArrayOf(MapOf(String, Float64)))
	})
	Service("ServiceMessageArray", func() {
		Method("MethodMessageArray", func() {
			Payload(UT)
			Result(ArrayOf(UT))
			GRPC(func() {})
		})
	})
}

var MessageMapDSL = func() {
	var UTLevel1 = Type("UTLevel1", func() {
		Field(1, "MapOfMapOfPrimitives", MapOf(String, MapOf(Int, UInt)))
	})
	var UT = Type("UT", func() {
		Field(1, "MapOfPrimitives", MapOf(UInt, Boolean))
		Field(2, "MapOfPrimitiveUTArray", MapOf(Int32, ArrayOf(UTLevel1)))
	})
	Service("ServiceMessageMap", func() {
		Method("MethodMessageMap", func() {
			Payload(MapOf(Int, UT))
			Result(UT)
			GRPC(func() {})
		})
	})
}

var MessagePrimitiveDSL = func() {
	Service("ServiceMessagePrimitive", func() {
		Method("MethodMessagePrimitive", func() {
			Payload(UInt)
			Result(Int)
			GRPC(func() {})
		})
	})
}

var MessageWithMetadataDSL = func() {
	var UTLevel1 = Type("UTLevel1", func() {
		Field(1, "Int32Field", Int32)
		Field(2, "Int64Field", Int64)
	})
	var RequestUT = Type("RequestUT", func() {
		Field(1, "BooleanField", Boolean)
		Field(2, "InMetadata", Int)
		Field(3, "UTLevel1", UTLevel1)
	})
	var ResponseUT = Type("ResponseUT", func() {
		Field(1, "InTrailer", Boolean)
		Field(2, "InHeader", Int)
		Field(3, "UTLevel1", UTLevel1)
	})
	Service("ServiceMessageWithMetadata", func() {
		Method("MethodMessageWithMetadata", func() {
			Payload(RequestUT)
			Result(ResponseUT)
			GRPC(func() {
				Metadata(func() {
					Attribute("InMetadata:Authorization")
				})
				Response(CodeOK, func() {
					Headers(func() {
						Attribute("InHeader:Location")
					})
					Trailers(func() {
						Attribute("InTrailer")
					})
				})
			})
		})
	})
}

var MessageWithValidateDSL = func() {
	var UTLevel1 = Type("UTLevel1", func() {
		Field(1, "Int32Field", Int32)
		Field(2, "Int64Field", Int64)
		Required("Int32Field", "Int64Field")
	})
	var RequestUT = Type("RequestUT", func() {
		Field(1, "BooleanField", Boolean)
		Field(2, "InMetadata", Int, func() {
			Maximum(100)
		})
		Field(3, "UTLevel1", UTLevel1)
		Required("UTLevel1")
	})
	var ResponseUT = Type("ResponseUT", func() {
		Field(1, "InTrailer", Boolean, func() {
			Enum(true)
		})
		Field(2, "InHeader", Int, func() {
			Minimum(1)
		})
		Field(3, "UTLevel1", UTLevel1)
		Required("UTLevel1")
	})
	Service("ServiceMessageWithValidate", func() {
		Method("MethodMessageWithValidate", func() {
			Payload(RequestUT)
			Result(ResponseUT)
			GRPC(func() {
				Metadata(func() {
					Attribute("InMetadata:Authorization")
				})
				Response(CodeOK, func() {
					Headers(func() {
						Attribute("InHeader:Location")
					})
					Trailers(func() {
						Attribute("InTrailer")
					})
				})
			})
		})
	})
}

var MessageWithSecurityAttrsDSL = func() {
	var JWTAuth = JWTSecurity("jwt", func() {
		Scope("api:read", "Read-only access")
	})
	var APIKeyAuth = APIKeySecurity("api_key", func() {})
	var BasicAuth = BasicAuthSecurity("basic", func() {})
	var OAuth2Auth = OAuth2Security("oauth2", func() {
		Scope("api:write", "Read and write access")
	})
	var RequestUT = Type("RequestUT", func() {
		Field(1, "BooleanField", Boolean)
		TokenField(2, "token", String)
		AccessTokenField(3, "oauth_token", String)
		APIKey("api_key", "key", String)
		Username("username", String)
		Password("password", String)
	})
	Service("ServiceMessageWithSecurity", func() {
		Method("MethodMessageWithSecurity", func() {
			Security(JWTAuth, OAuth2Auth, APIKeyAuth, BasicAuth)
			Payload(RequestUT)
			GRPC(func() {
				Message(func() {
					Attribute("oauth_token")
				})
			})
		})
	})
}

var MessageWithServiceNameDSL = func() {
	var UT = Type("MyNameConflicts", func() {
		Field(1, "BooleanField", Boolean)
	})
	var Request = Type("Request", func() {
		Field(1, "conflict", UT)
	})
	Service("MyNameConflicts", func() {
		Method("MyNameConflictsMethod", func() {
			Payload(Request)
			GRPC(func() {})
		})
	})
}

var MethodWithReservedNameDSL = func() {
	Service("MethodWithReservedName", func() {
		Method("string", func() {
			GRPC(func() {})
		})
	})
}

var MultipleMethodsSameResultCollectionDSL = func() {
	var ResultT = ResultType("application/vnd.goa.result", func() {
		TypeName("ResultT")
		Field(1, "BooleanField", Boolean)
	})
	Service("MultipleMethodsSameResultCollection", func() {
		Method("method_a", func() {
			Result(CollectionOf(ResultT))
			GRPC(func() {})
		})
		Method("method_b", func() {
			Result(CollectionOf(ResultT))
			GRPC(func() {})
		})
	})
}


text:
package org.kde9.cpu;

import org.kde9.alu.ALU;
import org.kde9.control.Control;
import org.kde9.exceptions.AlreadyExist;
import org.kde9.memory.Cache;
import org.kde9.memory.MemInterface;
import org.kde9.memory.Memory;
import org.kde9.others.ChoALU1;
import org.kde9.others.ChoALU2;
import org.kde9.others.ChoPCCtrl;
import org.kde9.others.ChoRegWVal;
import org.kde9.others.Stop2Period;
import org.kde9.others.Transfer;
import org.kde9.others.TransferChoPCVal;
import org.kde9.pcunit.PCUnit;
import org.kde9.register.EXE2MEMReg;
import org.kde9.register.ID2EXEReg;
import org.kde9.register.IF2IDReg;
import org.kde9.register.MEM2WBReg;
import org.kde9.register.RegisterHeap;
import org.kde9.register.Registers;

public class UnitPool {
	static PCUnit pc = new PCUnit();
	static MemInterface memInterface = new MemInterface();
	static Memory memory;
	static Cache insCache;
	static Cache dataCache;
	static Registers registers;
	static ALU alu = new ALU();
	static Control control = new Control();
	static ChoALU1 choALU1 = new ChoALU1();
	static ChoALU2 choALU2 = new ChoALU2();
	static ChoPCCtrl choPCCtrl = new ChoPCCtrl();
	static ChoRegWVal choRegWVal = new ChoRegWVal();
	static Stop2Period stop2Period = new Stop2Period();
	static Transfer transfer = new Transfer();
	static TransferChoPCVal transferChoPCVal = new TransferChoPCVal();
	static IF2IDReg if2id = new IF2IDReg();
	static ID2EXEReg id2exe = new ID2EXEReg();
	static EXE2MEMReg exe2mem = new EXE2MEMReg();
	static RegisterHeap reg = new RegisterHeap();
	static MEM2WBReg mem2wb = new MEM2WBReg();
	static FPGA fpga = new FPGA();

	public static FPGA getFpga() {
		return fpga;
	}

	public static RegisterHeap getReg() {
		return reg;
	}

	public static void setMemory(Memory memory) {
		UnitPool.memory = memory;
	}

	public static void setInsCache(Cache insCache) {
		UnitPool.insCache = insCache;
	}

	public static void setDataCache(Cache dataCache) {
		UnitPool.dataCache = dataCache;
	}

	public static void setRegisters(Registers registers) {
		UnitPool.registers = registers;
	}

	public static Memory getMemory() {
		return memory;
	}

	public static Cache getInsCache() {
		return insCache;
	}

	public static Cache getDataCache() {
		return dataCache;
	}

	public static Registers getRegisters() {
		return registers;
	}

	public static IF2IDReg getIf2id() {
		return if2id;
	}

	public static ID2EXEReg getId2exe() {
		return id2exe;
	}

	public static EXE2MEMReg getExe2mem() {
		return exe2mem;
	}

//	public static RegisterHeap getReg() {
//		return reg;
//	}

	public static MEM2WBReg getMem2wb() {
		return mem2wb;
	}

	public static PCUnit getPc() {
		return pc;
	}

	public static MemInterface getMemInterface() {
		return memInterface;
	}
	public static ALU getAlu() {
		return alu;
	}
	public static Control getControl() {
		return control;
	}
	public static ChoALU1 getChoALU1() {
		return choALU1;
	}
	public static ChoALU2 getChoALU2() {
		return choALU2;
	}
	public static ChoPCCtrl getChoPCCtrl() {
		return choPCCtrl;
	}
	public static ChoRegWVal getChoRegWVal() {
		return choRegWVal;
	}
	public static Stop2Period getStop2Period() {
		return stop2Period;
	}
	public static Transfer getTransfer() {
		return transfer;
	}
	public static TransferChoPCVal getTransferChoPCVal() {
		return transferChoPCVal;
	}

}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

var socketio = require('socket.io'),
    gumClient = require('../../lib/client/gum-client'),
    expect = require('chai').expect;

describe('Gum client', function() {

    it('connects to the configured gum-server', function(done) {
        var io = socketio.listen(19262, function() {
            gumClient.start({
                host: 'localhost',
                id: 'abc123',
                port: 19262
            });
        });

        io.sockets.on('connection', function(socket) {
            socket.on('checkin', function(data) {
                expect(data.id).to.equal('abc123');
                done();
            });
        });
    });

});


text:
package org.docksidestage.dockside.dbflute.vendor;

import java.util.List;

import org.dbflute.cbean.result.ListResultBean;
import org.dbflute.util.Srl;
import org.docksidestage.dockside.dbflute.exbhv.Vendor$DollarBhv;
import org.docksidestage.dockside.dbflute.exbhv.VendorCheckBhv;
import org.docksidestage.dockside.dbflute.exbhv.VendorTheLongAndWindingTableAndColumnBhv;
import org.docksidestage.dockside.dbflute.exbhv.VendorTheLongAndWindingTableAndColumnRefBhv;
import org.docksidestage.dockside.dbflute.exentity.Vendor$Dollar;
import org.docksidestage.dockside.dbflute.exentity.VendorCheck;
import org.docksidestage.dockside.dbflute.exentity.VendorTheLongAndWindingTableAndColumn;
import org.docksidestage.dockside.dbflute.exentity.VendorTheLongAndWindingTableAndColumnRef;
import org.docksidestage.dockside.unit.UnitContainerTestCase;

/**
 * @author jflute
 * @since 0.9.7.2 (2010/06/15 Tuesday)
 */
public class VendorTrickyNamingTest extends UnitContainerTestCase {

    // ===================================================================================
    //                                                                           Attribute
    //                                                                           =========
    private VendorCheckBhv vendorCheckBhv;
    private VendorTheLongAndWindingTableAndColumnBhv vendorTheLongAndWindingTableAndColumnBhv;
    private VendorTheLongAndWindingTableAndColumnRefBhv vendorTheLongAndWindingTableAndColumnRefBhv;
    private Vendor$DollarBhv vendorDollarBhv; // a component name does not contain a dollar mark

    // ===================================================================================
    //                                                                  JavaBeans Property
    //                                                                  ==================
    public void test_JavaBeansPropertySpecialNaming() {
        // ## Arrange ##
        VendorCheck vendorCheck = new VendorCheck();
        vendorCheck.setVendorCheckId(99999L);
        vendorCheck.setJAVABeansProperty("foo");
        vendorCheck.setJPopBeansProperty("bar");
        vendorCheckBhv.insert(vendorCheck);

        VendorCheck actual = vendorCheckBhv.selectEntityWithDeletedCheck(cb -> {
            /* ## Act ## */
            cb.query().setJAVABeansProperty_Equal("foo");
            cb.query().setJPopBeansProperty_Equal("bar");
            pushCB(cb);
        });

        // ## Assert ##
        assertEquals("foo", actual.getJAVABeansProperty());
        assertEquals("bar", actual.getJPopBeansProperty());
    }

    // ===================================================================================
    //                                                                           Long Name
    //                                                                           =========
    public void test_LongName_basic() throws Exception {
        // ## Arrange ##
        registerTheLongAndWindingData();
        ListResultBean<VendorTheLongAndWindingTableAndColumnRef> refList = vendorTheLongAndWindingTableAndColumnRefBhv.selectList(cb -> {
            cb.setupSelect_VendorTheLongAndWindingTableAndColumn();
            cb.query().addOrderBy_TheLongAndWindingTableAndColumnRefDate_Asc();
            pushCB(cb);
        });

        // ## Assert ##
        assertHasAnyElement(refList);
        for (VendorTheLongAndWindingTableAndColumnRef ref : refList) {
            log(ref);
            assertNotNull(ref.getTheLongAndWindingTableAndColumnRefId());
            assertNotNull(ref.getTheLongAndWindingTableAndColumnRefDate());
            assertNotNull(ref.getShortDate());
            assertEquals("2011/10", toString(ref.getTheLongAndWindingTableAndColumnRefDate(), "yyyy/MM"));
            assertEquals("2000/01", toString(ref.getShortDate(), "yyyy/MM"));
            ref.getVendorTheLongAndWindingTableAndColumn().alwaysPresent(main -> {
                assertNotNull(main.getTheLongAndWindingTableAndColumnId());
                assertEquals("longName", main.getTheLongAndWindingTableAndColumnName());
                assertEquals("shortName", main.getShortName());
                assertEquals(3, main.getShortSize());
            });
        }
        String sql = popCB().toDisplaySql();
        log(ln() + sql);
        assertTrue(Srl.containsAny(sql, "_REF_ID as THE_LONG_AND", "_c1"));
        assertTrue(Srl.containsAny(sql, ".SHORT_DATE as SHORT_DATE"));
        assertTrue(Srl.containsAny(sql, "_COLUMN_NAME as as THE_LONG_AND", "_c6"));
        assertTrue(Srl.containsAny(sql, ".SHORT_SIZE as SHORT_SIZE_0"));
    }

    public void test_LongName_union() throws Exception {
        // ## Arrange ##
        registerTheLongAndWindingData();
        ListResultBean<VendorTheLongAndWindingTableAndColumnRef> refList = vendorTheLongAndWindingTableAndColumnRefBhv.selectList(cb -> {
            cb.setupSelect_VendorTheLongAndWindingTableAndColumn();
            cb.union(unionCB -> {});
            cb.query().addOrderBy_TheLongAndWindingTableAndColumnRefDate_Asc();
            cb.query().addOrderBy_TheLongAndWindingTableAndColumnRefId_Asc();
        });

        // ## Assert ##
        assertHasAnyElement(refList);
        for (VendorTheLongAndWindingTableAndColumnRef ref : refList) {
            log(ref);
            assertNotNull(ref.getTheLongAndWindingTableAndColumnRefId());
            assertNotNull(ref.getTheLongAndWindingTableAndColumnRefDate());
            assertNotNull(ref.getShortDate());
            assertEquals("2011/10", toString(ref.getTheLongAndWindingTableAndColumnRefDate(), "yyyy/MM"));
            assertEquals("2000/01", toString(ref.getShortDate(), "yyyy/MM"));
            ref.getVendorTheLongAndWindingTableAndColumn().alwaysPresent(main -> {
                assertNotNull(main.getTheLongAndWindingTableAndColumnId());
                assertEquals("longName", main.getTheLongAndWindingTableAndColumnName());
                assertEquals("shortName", main.getShortName());
                assertEquals(3, main.getShortSize());
            });
        }
    }

    protected VendorTheLongAndWindingTableAndColumn registerTheLongAndWindingData() {
        VendorTheLongAndWindingTableAndColumn main = new VendorTheLongAndWindingTableAndColumn();
        main.setTheLongAndWindingTableAndColumnId(1L);
        main.setTheLongAndWindingTableAndColumnName("longName");
        main.setShortName("shortName");
        main.setShortSize(3);
        vendorTheLongAndWindingTableAndColumnBhv.insert(main);

        List<VendorTheLongAndWindingTableAndColumnRef> refList = newArrayList();
        {
            VendorTheLongAndWindingTableAndColumnRef ref = new VendorTheLongAndWindingTableAndColumnRef();
            ref.setTheLongAndWindingTableAndColumnRefId(3L);
            ref.setTheLongAndWindingTableAndColumnId(1L);
            ref.setTheLongAndWindingTableAndColumnRefDate(toLocalDate("2011/10/17"));
            ref.setShortDate(toLocalDate("2000/01/01"));
            vendorTheLongAndWindingTableAndColumnRefBhv.insert(ref);
            refList.add(ref);
        }
        {
            VendorTheLongAndWindingTableAndColumnRef ref = new VendorTheLongAndWindingTableAndColumnRef();
            ref.setTheLongAndWindingTableAndColumnRefId(4L);
            ref.setTheLongAndWindingTableAndColumnId(1L);
            ref.setTheLongAndWindingTableAndColumnRefDate(toLocalDate("2011/10/18"));
            ref.setShortDate(toLocalDate("2000/01/02"));
            vendorTheLongAndWindingTableAndColumnRefBhv.insert(ref);
            refList.add(ref);
        }

        main.setVendorTheLongAndWindingTableAndColumnRefList(refList);
        return main;
    }

    // ===================================================================================
    //                                                                              Dollar
    //                                                                              ======
    public void test_Dollar_insert_select() throws Exception {
        // ## Arrange ##
        Vendor$Dollar dollar = new Vendor$Dollar();
        dollar.setVendor$DollarId(99999);
        dollar.setVendor$DollarName("Pixy");
        vendorDollarBhv.insert(dollar);
        Vendor$Dollar actual = vendorDollarBhv.selectEntityWithDeletedCheck(cb -> {
            cb.query().setVendor$DollarId_Equal(dollar.getVendor$DollarId());
        });

        // ## Assert ##
        assertNotNull(actual);
        assertEquals("Pixy", actual.getVendor$DollarName());
    }
}


text:
package liquibase.structure.core;

import liquibase.structure.AbstractDatabaseObject;
import liquibase.structure.DatabaseObject;
import liquibase.util.StringUtils;

import javax.swing.text.TableView;
import java.util.ArrayList;
import java.util.List;

public class PrimaryKey extends AbstractDatabaseObject {

    public PrimaryKey() {
        setAttribute("columnNames", new ArrayList());
    }

    public DatabaseObject[] getContainingObjects() {
        return new DatabaseObject[] {
                getTable()
        };
    }

    public String getName() {
        return getAttribute("name", String.class);
    }

    public PrimaryKey setName(String name) {
        this.setAttribute("name", name);
        return this;
    }

    public Schema getSchema() {
        if (getTable() == null) {
            return null;
        }
        return getTable().getSchema();
    }

    public String getColumnNames() {
        return StringUtils.join(getColumnNamesAsList(), ", ");
    }

    public PrimaryKey addColumnName(int position, String columnName) {
        if (position >= getColumnNamesAsList().size()) {
            for (int i = getColumnNamesAsList().size()-1; i < position; i++) {
                this.getColumnNamesAsList().add(null);
            }
        }
        this.getColumnNamesAsList().set(position, columnName);
        return this;
    }

    public Table getTable() {
        return getAttribute("table", Table.class);
    }

    public PrimaryKey setTable(Table table) {
        this.setAttribute("table", table);
        return this;
    }

    @Override
    public int compareTo(Object other) {
        PrimaryKey o = (PrimaryKey) other;
        int returnValue = this.getTable().getName().compareTo(o.getTable().getName());
        if (returnValue == 0) {
            returnValue = this.getColumnNames().compareTo(o.getColumnNames());
        }
//        if (returnValue == 0) {
//            returnValue = this.getName().compareTo(o.getName());
//        }

        return returnValue;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PrimaryKey that = (PrimaryKey) o;

        return !(getColumnNames() != null ? !getColumnNames().equals(that.getColumnNames()) : that.getColumnNames() != null) && !(getTable().getName() != null ? !getTable().getName().equals(that.getTable().getName()) : that.getTable().getName() != null);

    }

    @Override
    public int hashCode() {
        int result;
        result = (getColumnNames() != null ? getColumnNames().hashCode() : 0);
        result = 31 * result + (getTable().getName() != null ? getTable().getName().hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return getName() + " on " + getTable().getName() + "(" + getColumnNames() + ")";
    }

    public List<String> getColumnNamesAsList() {
        return getAttribute("columnNames", List.class);
    }

    public boolean isCertainName() {
        return getAttribute("certainName", Boolean.class);
    }

    public PrimaryKey setCertainName(boolean certainName) {
        setAttribute("certainName", certainName);
        return this;
    }

	public String getTablespace() {
		return getAttribute("tablespace",String.class);
	}

	public PrimaryKey setTablespace(String tablespace) {
        setAttribute("tablespace", tablespace);
        return this;
	}

    public Index getBackingIndex() {
        return getAttribute("backingIndex", Index.class);
    }

    public PrimaryKey setBackingIndex(Index backingIndex) {
        setAttribute("backingIndex", backingIndex);
        return this;
    }
}


text:
'use strict';

var Benchmark = require('benchmark'),
    fs = require('fs'),
    path = require('path'),
    protocolBuffers = require('protocol-buffers'),
    protobufjs = require('protobufjs'),
    vt = require('./vector_tile'),
    Pbf = require('../');

var pbfReadTile = vt.Tile.read,
    pbfWriteTile = vt.Tile.write,
    data = fs.readFileSync(path.resolve(__dirname, '../test/fixtures/12665.vector.pbf')),
    suite = new Benchmark.Suite(),
    ProtocolBuffersTile = protocolBuffers(fs.readFileSync(path.resolve(__dirname, 'vector_tile.proto'))).Tile,
    ProtobufjsTile = protobufjs.loadSync(path.resolve(__dirname, 'vector_tile.proto'))
        .lookup('vector_tile.Tile');

var pbfTile = pbfReadTile(new Pbf(data)),
    tileJSON = JSON.stringify(pbfTile),
    protocolBuffersTile = ProtocolBuffersTile.decode(data),
    protobufjsTile = ProtobufjsTile.decode(data);

suite
    .add('decode vector tile with pbf', function() {
        pbfReadTile(new Pbf(data));
    })
    .add('encode vector tile with pbf', function() {
        var pbf = new Pbf();
        pbfWriteTile(pbfTile, pbf);
        pbf.finish();
    })
    .add('decode vector tile with protocol-buffers', function() {
        ProtocolBuffersTile.decode(data);
    })
    .add('encode vector tile with protocol-buffers', function() {
        ProtocolBuffersTile.encode(protocolBuffersTile);
    })
    .add('decode vector tile with protobuf.js', function() {
        ProtobufjsTile.decode(data);
    })
    .add('encode vector tile with protobuf.js', function() {
        ProtobufjsTile.encode(protobufjsTile);
    })
    .add('JSON.parse vector tile', function() {
        JSON.parse(tileJSON);
    })
    .add('JSON.stringify vector tile', function() {
        JSON.stringify(pbfTile);
    })
    .on('cycle', function(event) {
        console.log(String(event.target));
    })
    .run();


text:
from setuptools import setup

setup(
    name='javiergr',
    version='1.0',
    description='javier.gr site',
    author='Javier Gonel',
    author_email='bolibic@gmail.com',
    url='http://javier.gr/',
    install_requires = [
        'Flask',
        'Flask-Assets',
        'Flask-FlatPages',
        'Frozen-Flask',
        'Pygments'
    ],
    dependency_links = [
        'https://github.com/miracle2k/webassets/tarball/master#egg=webassets-0.12.2'
    ]
)


text:
package org.apache.nifi.cluster.protocol.jaxb.message;

import javax.xml.bind.annotation.adapters.XmlAdapter;
import org.apache.nifi.cluster.protocol.NodeIdentifier;

/**
 */
public class NodeIdentifierAdapter extends XmlAdapter<AdaptedNodeIdentifier, NodeIdentifier> {

    @Override
    public AdaptedNodeIdentifier marshal(final NodeIdentifier ni) {
        if (ni == null) {
            return null;
        } else {
            final AdaptedNodeIdentifier aNi = new AdaptedNodeIdentifier();
            aNi.setId(ni.getId());
            aNi.setApiAddress(ni.getApiAddress());
            aNi.setApiPort(ni.getApiPort());
            aNi.setSocketAddress(ni.getSocketAddress());
            aNi.setSocketPort(ni.getSocketPort());
            aNi.setSiteToSiteAddress(ni.getSiteToSiteAddress());
            aNi.setSiteToSitePort(ni.getSiteToSitePort());
            aNi.setSiteToSiteHttpApiPort(ni.getSiteToSiteHttpApiPort());
            aNi.setSiteToSiteSecure(ni.isSiteToSiteSecure());
            return aNi;
        }
    }

    @Override
    public NodeIdentifier unmarshal(final AdaptedNodeIdentifier aNi) {
        if (aNi == null) {
            return null;
        } else {
            return new NodeIdentifier(aNi.getId(), aNi.getApiAddress(), aNi.getApiPort(), aNi.getSocketAddress(), aNi.getSocketPort(),
                aNi.getSiteToSiteAddress(), aNi.getSiteToSitePort(),aNi.getSiteToSiteHttpApiPort(), aNi.isSiteToSiteSecure());
        }
    }

}


text:
package local

import (
	"context"
	"time"

	"github.com/gravitational/trace"

	"github.com/gravitational/teleport/api/types"
	"github.com/gravitational/teleport/lib/backend"
	"github.com/gravitational/teleport/lib/defaults"
	"github.com/gravitational/teleport/lib/services"
)

// ProvisioningService governs adding new nodes to the cluster
type ProvisioningService struct {
	backend.Backend
}

// NewProvisioningService returns a new instance of provisioning service
func NewProvisioningService(backend backend.Backend) *ProvisioningService {
	return &ProvisioningService{Backend: backend}
}

// UpsertToken adds provisioning tokens for the auth server
func (s *ProvisioningService) UpsertToken(ctx context.Context, p types.ProvisionToken) error {
	item, err := s.tokenToItem(p)
	if err != nil {
		return trace.Wrap(err)
	}

	_, err = s.Put(ctx, *item)
	if err != nil {
		return trace.Wrap(err)
	}
	return nil
}

// CreateToken creates a new token for the auth server
func (s *ProvisioningService) CreateToken(ctx context.Context, p types.ProvisionToken) error {
	item, err := s.tokenToItem(p)
	if err != nil {
		return trace.Wrap(err)
	}

	_, err = s.Create(ctx, *item)
	if err != nil {
		return trace.Wrap(err)
	}

	return nil
}

func (s *ProvisioningService) tokenToItem(p types.ProvisionToken) (*backend.Item, error) {
	if err := p.CheckAndSetDefaults(); err != nil {
		return nil, trace.Wrap(err)
	}
	if p.Expiry().IsZero() || p.Expiry().Sub(s.Clock().Now().UTC()) < time.Second {
		p.SetExpiry(s.Clock().Now().UTC().Add(defaults.ProvisioningTokenTTL))
	}
	data, err := services.MarshalProvisionToken(p)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	item := &backend.Item{
		Key:     backend.Key(tokensPrefix, p.GetName()),
		Value:   data,
		Expires: p.Expiry(),
		ID:      p.GetResourceID(),
	}
	return item, nil
}

// DeleteAllTokens deletes all provisioning tokens
func (s *ProvisioningService) DeleteAllTokens() error {
	startKey := backend.Key(tokensPrefix)
	return s.DeleteRange(context.TODO(), startKey, backend.RangeEnd(startKey))
}

// GetToken finds and returns token by ID
func (s *ProvisioningService) GetToken(ctx context.Context, token string) (types.ProvisionToken, error) {
	if token == "" {
		return nil, trace.BadParameter("missing parameter token")
	}
	item, err := s.Get(ctx, backend.Key(tokensPrefix, token))
	if trace.IsNotFound(err) {
		return nil, trace.NotFound("provisioning token(%s) not found", backend.MaskKeyName(token))
	} else if err != nil {
		return nil, trace.Wrap(err)
	}

	return services.UnmarshalProvisionToken(item.Value, services.WithResourceID(item.ID), services.WithExpires(item.Expires))
}

// DeleteToken deletes a token by ID
func (s *ProvisioningService) DeleteToken(ctx context.Context, token string) error {
	if token == "" {
		return trace.BadParameter("missing parameter token")
	}
	err := s.Delete(ctx, backend.Key(tokensPrefix, token))
	if trace.IsNotFound(err) {
		return trace.NotFound("provisioning token(%s) not found", backend.MaskKeyName(token))
	}
	return trace.Wrap(err)
}

// GetTokens returns all active (non-expired) provisioning tokens
func (s *ProvisioningService) GetTokens(ctx context.Context) ([]types.ProvisionToken, error) {
	startKey := backend.Key(tokensPrefix)
	result, err := s.GetRange(ctx, startKey, backend.RangeEnd(startKey), backend.NoLimit)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	tokens := make([]types.ProvisionToken, len(result.Items))
	for i, item := range result.Items {
		t, err := services.UnmarshalProvisionToken(
			item.Value,
			services.WithResourceID(item.ID),
			services.WithExpires(item.Expires),
		)
		if err != nil {
			return nil, trace.Wrap(err)
		}
		tokens[i] = t
	}
	return tokens, nil
}

const tokensPrefix = "tokens"


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Owin;

namespace SelfHostAndCef
{
    public class Startup
    {
        // This code configures Web API. The Startup class is specified as a type
        // parameter in the WebApp.Start method.
        public void Configuration(IAppBuilder appBuilder)
        {
            // Configure Web API for self-host.
            HttpConfiguration config = new HttpConfiguration();

            DefaultConnectWebApiConfig.Register(config);

            appBuilder.UseWebApi(config);
        }
    }

    public static class DefaultConnectWebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: "ApiV1",
                routeTemplate: "api/v1/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );
        }
    }

}


text:
package org.apache.ojb.broker.metadata;

import java.io.Serializable;

/**
 * This interface defines methods that are required for an object
 * to support the nested "attribute" tag in the repository file.
 * @author		Ron Gallagher
 */
public interface AttributeContainer extends Serializable
{
	/**
     * Store the specified attribute and it's value.
     * @param attributeName the name of the attribute to retrieve
     * @param attributeValue the attribute's value
     */
    public void addAttribute(String attributeName, String attributeValue);

    /**
     * Get the value of an attribute
     * @param attributeName the attribute to retrieve
     * @param defaultValue the value to return if the attribute is not present
     * @return the attribute value
     */
    public String getAttribute(String attributeName, String defaultValue);
    /**
     * Get the value of an attribute
     * @param attributeName the attribute to retrieve
     * @return the attribute value
     */
    public String getAttribute(String attributeName);
}


text:
helpers
=======

A collection of helper scripts.


text:
<?xml version="1.0" ?>
<Qualities>
  <Quality Name="Shoddy" LevelAdjustment="-2" Description="The flaws in craftsmanship are obvious to even the most unobservant.">
    <Attributes>
      <DamageModifier>-60</DamageModifier>
      <SpeedModifier>10</SpeedModifier>
      <ArmorStaminaModifier>-75</ArmorStaminaModifier>
      <ArmorHeavier/>
    </Attributes>
  </Quality>
  <Quality Name="Inferior" LevelAdjustment="-1" Description="Either mass produced in large quantities or by a novice craftsman, the craftsmanship is less than ideal.">
    <Attributes>
      <DamageModifier>-35</DamageModifier>
      <ArmorStaminaModifier>-35</ArmorStaminaModifier>
    </Attributes>
  </Quality>
  <Quality Name="Average" LevelAdjustment="0" Description="">
  </Quality>
  <Quality Name="Well Made" LevelAdjustment="1" Description="Slightly better made than the average.">
    <Attributes>
      <DamageModifier>35</DamageModifier>
      <ArmorStaminaModifier>35</ArmorStaminaModifier>
    </Attributes>
  </Quality>
  <Quality Name="Superior" LevelAdjustment="2" Description="Produced by experienced craftsman who valued their work.">
    <Attributes>
      <DamageModifier>70</DamageModifier>
      <ArmorStaminaModifier>70</ArmorStaminaModifier>
    </Attributes>
  </Quality>
  <Quality Name="Masterwork" LevelAdjustment="3" Description="Produced by a guild master.">
    <Attributes>
      <DamageModifier>90</DamageModifier>
      <SpeedModifier>-10</SpeedModifier>
      <ArmorStaminaModifier>95</ArmorStaminaModifier>
    </Attributes>
  </Quality>
  <Quality Name="Perfect" LevelAdjustment="4" Description="Only a few goods every generation are made to this level of quality. A masterpiece.">
    <Attributes>
      <DamageModifier>115</DamageModifier>
      <SpeedModifier>-25</SpeedModifier>
      <ArmorStaminaModifier>150</ArmorStaminaModifier>
      <ArmorLighter/>
    </Attributes>
  </Quality>
</Qualities>


text:
package configure

import (
	"bytes"
	"errors"
	"fmt"
	"io/ioutil"
	"net"
	"os"
	"path"
	"runtime"

	"github.com/pborman/uuid"
	log "github.com/sirupsen/logrus"
	"github.com/uber/tchannel-go"
	"gopkg.in/validator.v2"
	"gopkg.in/yaml.v2"
)

//Possible environment
const (
	EnvProduction  = "production"
	EnvDevelopment = "development"
	EnvTest        = "test"
)

const (
	configDir = "config"
	baseFile  = "base"
)

const (
	// InputServiceName refers to the name of the cherami in service
	InputServiceName = "cherami-inputhost"
	// OutputServiceName refers to the name of the cherami out service
	OutputServiceName = "cherami-outputhost"
	// FrontendServiceName refers to the name of the cherami frontend service
	FrontendServiceName = "cherami-frontendhost"
	// ControllerServiceName refers to the name of the cherami controller service
	ControllerServiceName = "cherami-controllerhost"
	// StoreServiceName refers to the name of the cherami store service
	StoreServiceName = "cherami-storehost"
	// ReplicatorServiceName refers to the name of the cherami replicator service
	ReplicatorServiceName = "cherami-replicator"
)

// ErrNoFilesToLoad is return when you attemp to call LoadFiles with no file paths
var ErrNoFilesToLoad = errors.New("attempt to load configuration with no files")

// ValidationError is the returned when a configuration fails to pass validation
type ValidationError struct {
	errorMap validator.ErrorMap
}

// ErrForField returns the validation error for the given field
func (e ValidationError) ErrForField(name string) error {
	return e.errorMap[name]
}

func (e ValidationError) Error() string {
	var w bytes.Buffer

	fmt.Fprintf(&w, "validation failed")
	for f, err := range e.errorMap {
		fmt.Fprintf(&w, "   %s: %v\n", f, err)
	}

	return w.String()
}

//CommonConfigure is the config implementation with yaml parse
type CommonConfigure struct {
	environmentKey string
	datacenterKey  string
	configDirKey   string
}

//NewCommonConfigure return an configure for common open source use
func NewCommonConfigure() Configure {
	return &CommonConfigure{
		//environmentKey: "UBER_ENVIRONMENT",
		//datacenterKey:  "UBER_CENTER",
		//configDirKey:   "UBER_CONFIG_DIR",
		environmentKey: "CHERAMI_ENVIRONMENT",
		datacenterKey:  "CHERAMI_CENTER",
		configDirKey:   "CHERAMI_CONFIG_DIR",
	}
}

// GetHostname returns the hostname
func (r *CommonConfigure) GetHostname() string {
	host, err := os.Hostname()
	if err != nil {
		return "unknown"
	}
	return host
}

// GetEnvironment returns the environment
func (r *CommonConfigure) GetEnvironment() string {
	env := os.Getenv(r.environmentKey)
	if env == "" {
		env = EnvDevelopment
	}
	return env
}

//getDefaultConfigFiles get the default config file locations
func (r *CommonConfigure) getDefaultConfigFiles() []string {
	env := r.GetEnvironment()
	dc := r.GetDatacenter()

	candidates := []string{
		baseFile,
		env,
		fmt.Sprintf("%s-%s", env, dc),
	}

	realConfigDir := configDir
	// Allow overriding the directory config is loaded from, useful for tests
	// inside subdirectories when the config/ dir is in the top-level of a project.
	if configRoot := os.Getenv(r.configDirKey); configRoot != "" {
		realConfigDir = configRoot
	}
	paths := make([]string, 0, len(candidates))
	for _, candidate := range candidates {
		configFile := path.Join(realConfigDir, fmt.Sprintf("%s.yaml", candidate))
		if _, err := os.Stat(configFile); err == nil {
			paths = append(paths, configFile)
		}
	}
	return paths
}

// GetDatacenter returns the datacenter
func (r *CommonConfigure) GetDatacenter() string {
	return os.Getenv(r.datacenterKey)
}

// Load loads configuration based on environment variables
func (r *CommonConfigure) Load(config interface{}) error {
	return r.LoadFiles(config, r.getDefaultConfigFiles()...)
}

// LoadFile loads and validates a configuration object contained in a file
func (r *CommonConfigure) LoadFile(config interface{}, fname string) error {
	return r.LoadFiles(config, fname)
}

// LoadFiles loads a list of files, deep-merging values.
func (r *CommonConfigure) LoadFiles(config interface{}, fnames ...string) error {
	if len(fnames) == 0 {
		return ErrNoFilesToLoad
	}
	for _, fname := range fnames {
		data, err := ioutil.ReadFile(fname)
		if err != nil {
			return err
		}

		if err = yaml.Unmarshal(data, config); err != nil {
			return err
		}

	}

	// Validate on the merged config at the end.
	if err := validator.Validate(config); err != nil {
		return ValidationError{
			errorMap: err.(validator.ErrorMap),
		}
	}
	return nil
}

// SetupServerConfig sets up the server config
func (r *CommonConfigure) SetupServerConfig() CommonAppConfig {
	// instantiate a common config object
	cfg := NewCommonAppConfig()
	var services = []string{InputServiceName, OutputServiceName, StoreServiceName, ControllerServiceName, FrontendServiceName, ReplicatorServiceName}
	runtime.GOMAXPROCS(runtime.NumCPU())

	if err := r.Load(cfg); err != nil {
		log.Fatalf("Error initializing configuration: %v", err)
	} else {
		lCfg := cfg.GetLoggingConfig().(*LogConfiguration)
		lCfg.Configure(cfg)
	}

	if cfg.GetMetadataConfig().GetCassandraHosts() == `` {
		if cfg.GetDefaultServiceConfig().GetListenAddress().IsLoopback() {
			cfg.GetMetadataConfig().SetCassandraHosts(cfg.GetDefaultServiceConfig().GetListenAddress().String())
		} else {
			cfg.GetMetadataConfig().SetCassandraHosts(`127.0.0.1`)
		}
	}

	if id := uuid.Parse(cfg.GetStorageConfig().GetHostUUID()); id == nil {
		// only generate a new uuid if the uuid from the
		// config is empty or malformed
		cfg.GetStorageConfig().SetHostUUID(uuid.New())
	}

	for _, k := range services {
		sCfg := cfg.GetServiceConfig(k)
		if sCfg.GetHyperbahnBootstrapFile() == "" {
			sCfg.SetHyperbahnBootstrapFile(cfg.GetDefaultServiceConfig().GetHyperbahnBootstrapFile())
		}

		if sCfg.GetListenAddress() == nil {
			// service-specific ListenAddress is not configured, try DefaultServiceConfig
			listenAddress := cfg.GetDefaultServiceConfig().GetListenAddress().String()
			if net.ParseIP(listenAddress) == nil {
				// default ListenAddress is not set, try obtain from TChannel
				ip, _ := tchannel.ListenIP()
				log.Infof(`No listen address specified; setting %v instead`, ip)
				if ip == nil {
					log.Panic(`Could not get listen address`)
				}

				listenAddress = ip.String()
			}

			sCfg.SetListenAddress(listenAddress)
		}

		if sCfg.GetRingHosts() == `` {
			sCfg.SetRingHosts(cfg.GetDefaultServiceConfig().GetRingHosts())
		}

		sCfg.SetLimitsEnabled(cfg.GetDefaultServiceConfig().GetLimitsEnabled())
		cfg.SetServiceConfig(k, sCfg)
	}

	return cfg
}


text:
package main

import (
	"log"
	"time"
)

type TimerProcess struct {
	cameraCommandChannel chan CameraCommand
	running              bool
	stopChannel          chan bool
}

func NewTimerProcess(cameraCommandChannel chan CameraCommand) *TimerProcess {
	return &TimerProcess{cameraCommandChannel: cameraCommandChannel, stopChannel: make(chan bool)}
}

func (t *TimerProcess) Run(sleepInterval int) {
	t.running = true

	t.cameraCommandChannel <- TAKE_PICTURE
	for {
		select {
		case t.running = <-t.stopChannel:
			log.Println("Timer Process returning")
			return
		case <-time.After(time.Duration(sleepInterval) * time.Second):
			t.cameraCommandChannel <- TAKE_PICTURE
		}
	}
}

func (t *TimerProcess) Stop() {
	t.stopChannel <- true
}

func (t *TimerProcess) IsRunning() bool {
	return t.running
}


text:
import React from 'react';

import FilterByText from '../../../../client/components/FilterByText';
import GenericTable from '../../../../client/components/GenericTable';
import { useTranslation } from '../../../../client/contexts/TranslationContext';
import { useResizeInlineBreakpoint } from '../../../../client/hooks/useResizeInlineBreakpoint';
import MonitorsRow from './MonitorsRow';

function MonitorsTable({
	monitors,
	totalMonitors,
	params,
	sort,
	onHeaderClick,
	onChangeParams,
	onDelete,
}) {
	const t = useTranslation();

	const [ref, onMediumBreakpoint] = useResizeInlineBreakpoint([600], 200);

	return (
		<GenericTable
			ref={ref}
			header={
				<>
					<GenericTable.HeaderCell
						key={'name'}
						sort='name'
						active={sort[0] === 'name'}
						direction={sort[1]}
						onClick={onHeaderClick}
					>
						{t('Name')}
					</GenericTable.HeaderCell>
					<GenericTable.HeaderCell>{t('Username')}</GenericTable.HeaderCell>
					<GenericTable.HeaderCell>{t('Email')}</GenericTable.HeaderCell>
					<GenericTable.HeaderCell width='x60'>{t('Remove')}</GenericTable.HeaderCell>
				</>
			}
			results={monitors}
			total={totalMonitors}
			params={params}
			setParams={onChangeParams}
			renderFilter={({ onChange, ...props }) => <FilterByText onChange={onChange} {...props} />}
		>
			{(props) => (
				<MonitorsRow key={props._id} medium={onMediumBreakpoint} onDelete={onDelete} {...props} />
			)}
		</GenericTable>
	);
}

export default MonitorsTable;


text:
package com.clevertap.apns;

/**
 * An interface for handling responses to notification requests.
 */
public interface NotificationResponseListener {
    /**
     * Signals a successful notification.
     * <p>
     * Note: For a successful request, the response body is empty.
     *
     * @param notification The notification that succeeded
     */
    void onSuccess(Notification notification);

    /**
     * Signals a failed notification.
     *
     * @param notification The notification that failed
     * @param response     The notification response
     */
    void onFailure(Notification notification, NotificationResponse response);
}


text:
(function ( window, module ) {

	if ( window.define && window.define.amd ) {
		define(module)
	} else {

		var current_scripts, this_script, module_name

		current_scripts     = document.getElementsByTagName("script")
		this_script         = current_scripts[current_scripts.length-1]
		module_name         = this_script.getAttribute("data-module-name") || "nebula"
		window[module_name] = module
	}
})(
	window,
	{
		make    : function () {
			var self
			self = this
			return {
				modules   : [],
				load_path : {
					module : [],
					style  : []
				},
				loading_done        : [],
				load_completion_map : {
					path : [],
					load : []
				},
				loading_done_method : {},
				loading_module      : function ( module ) {

					this.load_completion_map = self.create_load_completion_map({
						module: this.modules.slice(0),
						added : module.path,
						from  : this.load_completion_map
					})

					this.modules             = this.modules.concat( module.path )
				},
				loaded_module       : function ( module ) {

					var all_modules_have_loaded
					this.load_path.module    = this.load_path.module.concat( module.returned.module || [] )
					this.load_path.style     = this.load_path.style.concat( module.returned.style   || [] )
					this.load_completion_map = self.create_updated_load_completion_map({
						map  : this.load_completion_map,
						path : module.path
					})

					all_modules_have_loaded  = self.do_all_members_of_an_array_equal({
						value : true,
						array : this.load_completion_map.load
					})

					if ( all_modules_have_loaded ) {
						this.loading_done = this.loading_done.concat( true )
						this.loading_done_method.call({}, {
							path : this.load_path
						})
					}
				},
				call_this_method_on_load_completion : function ( method ) {
					this.loading_done_method = method
				},

				is_module_loading_done    : self.is_module_loading_done,
				get_module_name_from_path : self.get_module_name_from_path
			}
		},

		get_module_name_from_path : function ( path ) {
			var split
			split = path.split("/")
			return split[split.length-1]
		},

		get_indexes_of_every_occurance_in_array : function ( get ) {
			get.at   = ( get.at === undefined ? get.from.length-1 : get.at )
			get.into = get.into || []
			if ( get.at < 0 ) {
				return get.into.reverse()
			} else {
				return this.get_indexes_of_every_occurance_in_array({
					into : ( get.what === get.from[get.at] ? get.into.concat(get.at) : get.into ),
					at   : get.at - 1,
					from : get.from.slice(0),
					what : get.what
				})
			}
		},

		get_common_values_of_two_arrays : function ( get ) {

			if ( get.at === undefined  ) {
				if ( get.from[0].length > get.from[1].length )  {
					get.array = {
						counting  : get.from[0].slice(0),
						comparing : get.from[1].slice(0)
					}
				} else {
					get.array = {
						counting  : get.from[1].slice(0),
						comparing : get.from[0].slice(0)
					}
				}
				get.at   = get.array.counting.length-1
				get.into = []
			}

			if ( get.at < 0 ) {
				return get.into
			} else {

				var arrays_have_value_in_common, value_is_already_noted
				arrays_have_value_in_common = ( get.array.comparing.indexOf( get.array.counting[get.at] ) > -1 )
				value_is_already_noted      = ( get.into.indexOf( get.array.counting[get.at] ) > -1 )

				return this.get_common_values_of_two_arrays({
					at    : get.at - 1,
					array : get.array,
					into  : (
						arrays_have_value_in_common && !value_is_already_noted ?
							get.into.concat( get.array.counting[get.at] ) :
							get.into
					)
				})
			}
		},

		do_all_members_of_an_array_equal : function ( equal ) {

			equal.ammount = equal.ammount || 0
			equal.at      = equal.at      || 0

			if ( equal.at >= equal.array.length ) {
				return ( equal.ammount === equal.array.length )
			} else {
				return this.do_all_members_of_an_array_equal({
					at      : equal.at + 1,
					array   : equal.array,
					value   : equal.value,
					ammount : ( equal.array[equal.at] === equal.value ? equal.ammount + 1 : equal.ammount )
				})
			}
		},

		create_updated_load_completion_map : function ( create ) {

			var path_index, index_is_true, indentical_false_indexes

			path_index               = create.map.path.indexOf( create.path )
			index_is_true            = create.map.load[path_index]
			indentical_false_indexes = this.get_common_values_of_two_arrays({
				from : [
					this.get_indexes_of_every_occurance_in_array({
						from : create.map.path,
						what : create.path
					}),
					this.get_indexes_of_every_occurance_in_array({
						from : create.map.load,
						what : false
					})
				]
			})

			if ( index_is_true && indentical_false_indexes.length > 0 ) {
				create.map.load[indentical_false_indexes[0]] = true
			} else {
				create.map.load[path_index] = true
			}

			return {
				path : create.map.path.slice(0),
				load : create.map.load.slice(0)
			}
		},

		create_load_completion_map : function ( create ) {

			create.at     = create.at     || 0
			create.into   = create.into   || create.from || { path : [], load : [] }
			create.module = create.module || []
			if ( create.added ) {
				create.module = create.module.concat( create.added )
			}
			if ( create.from ) {
				create.at = create.module.length-1
			}
			if ( create.at >= create.module.length ) {
				return create.into
			} else {
				return this.create_load_completion_map({
					at     : create.at + 1,
					module : create.module,
					into   : {
						path : create.into.path.concat( create.module[create.at] ),
						load : create.into.load.concat( false )
					}
				})
			}
		}
	}
)


text:
package com.jcwhatever.pvs.scripting;

import com.jcwhatever.nucleus.mixins.IDisposable;
import com.jcwhatever.pvs.api.PVStarAPI;
import com.jcwhatever.pvs.api.arena.IArena;
import com.jcwhatever.pvs.api.points.IPointsHandler;
import com.jcwhatever.pvs.api.points.PointsType;

/**
 * Points API object
 */
public class ArenaPointsApiObject implements IDisposable {

    private final IArena _arena;

    private boolean _isDisposed;

    public ArenaPointsApiObject(IArena arena) {
        _arena = arena;
    }

    public void increment(int amount) {

        PointsType type = PVStarAPI.getPointsManager().getType("Points");
        assert type != null;

        type.add(_arena);

        IPointsHandler handler = type.getHandler(_arena);
        assert handler != null;

        handler.setPoints(handler.getPoints() + amount);
    }

    @Override
    public boolean isDisposed() {
        return _isDisposed;
    }

    @Override
    public void dispose() {
        _isDisposed = true;
    }
}


text:
package ezbake.groups.graph;

import ezbake.configuration.EzConfigurationLoaderException;
import org.junit.Assert;
import org.junit.Test;

import java.util.Properties;

/**
 * User: jhastings
 * Date: 6/23/14
 * Time: 12:38 PM
 */
public class TitanGraphConfigurationTest {
    @Test
    public void testStorageProperties() throws EzConfigurationLoaderException {
        Properties p = new Properties();
        p.setProperty("storage.backend", "berkeleyje");
        p.setProperty("storage.directory", "/tmp/ezgroups-test");
        p.setProperty("nottitan.directory", "/tmp/ezgroups-test");

        TitanGraphConfiguration gc = new TitanGraphConfiguration(p);
        Assert.assertTrue(gc.containsKey("storage.backend"));
        Assert.assertTrue(gc.containsKey("storage.directory"));
        Assert.assertTrue(!gc.containsKey("nottitan.directory"));
    }
}


text:
package org.codehaus.griffon.types;

public enum LanguageTypes {
    Java, Groovy;
}


text:
```
Module Name: RockYou Bidder Adapter
Module Type: Bidder Adapter
Maintainer: prebid.adapter@rockyou.com
```

# Description

Connects to the RockYou exchange for bids.

The RockYou bid adapter supports Banner and Video.

For publishers who wish to be set up on the RockYou Ad Network, please contact
publishers@rockyou.com.

RockYou user syncing requires the `userSync.iframeEnabled` property be set to `true`.

# Test PARAMETERS
```
var adUnits = [

  // Banner adUnit
  {
    code: 'banner-div',
    mediaTypes: {
      banner: {
        sizes: [[720, 480]]
      }
    },

    bids: [{
          bidder: 'rockyou',
          params: {
            placementId: '4954'
          }
        }]
  },

  // Video (outstream)
  {
    code: 'video-outstream',
    mediaTypes: {
      video: {
        context: 'outstream',
        playerSize: [720, 480]
      }
    },
    bids: [{
      bidder: 'rockyou',
      params: {
        placementId: '4957'
      }
    }]
  }
]
```


text:
/*
 * This example demonstrates how to set the value of a resource on the client
 * using the SET operation.
 */

#include <stdlib.h>
#include <stdio.h>

#include <awa/common.h>
#include <awa/client.h>

#define IPC_PORT (12345)
#define IPC_ADDRESS "127.0.0.1"
#define OPERATION_PERFORM_TIMEOUT 1000

int main(void)
{
    /* Create and initialise client session */
    AwaClientSession * session = AwaClientSession_New();

    /* Use default IPC configuration */
    AwaClientSession_Connect(session);

    /* Create SET operation */
    AwaClientSetOperation * operation = AwaClientSetOperation_New(session);

    /*
     * This example uses resource /3/0/0 which is the Manufacturer
     * resource in the standard Device object. It is a string.
     */

    /* Provide a path and value for the resource */
    AwaClientSetOperation_AddValueAsCString(operation, "/3/0/0", "HotAir Systems Inc");

    /* Perform the SET operation */
    AwaClientSetOperation_Perform(operation, OPERATION_PERFORM_TIMEOUT);

    /* Operations must be freed after use */
    AwaClientSetOperation_Free(&operation);

    AwaClientSession_Disconnect(session);
    AwaClientSession_Free(&session);
    return 0;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RedoxExtensions.Location
{
    public struct Town
    {
        public readonly string Name;

        public Town(string name)
        {
            Name = name;
        }

        public override string ToString()
        {
            return Name;
        }

        public override int GetHashCode()
        {
            return ToString().GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;
            var other = (Town) obj;
            return Name == other.Name;
        }

        public static bool operator ==(Town a, Town b)
        {
            return a.Equals(b);
        }

        public static bool operator !=(Town a, Town b)
        {
            return !(a == b);
        }

        public static bool TryParse(string value, out Town town)
        {
            town = default(Town);
            if (string.IsNullOrEmpty(value))
                return false;

            var sanitizedName = LookupTown(value);
            if (string.IsNullOrEmpty(sanitizedName))
                return false;

            town = new Town(sanitizedName);
            return true;
        }

        private static string LookupTown(string userValue)
        {
            switch (userValue.Trim().ToLower())
            {
                // Aluvian
                case "holtburg": // official name
                case "holt":
                    return "Holtburg";
                case "cragstone": // official name
                case "crag":
                    return "Cragstone";
                case "arwic": // official name
                    return "Arwic";
                case "dryreach": // official name
                    return "Dryreach";
                case "eastham": // official name
                    return "Eastham";
                case "fort tethana": // official name
                case "teth":
                    return "Fort Tethana";
                case "glenden wood": // official name
                case "glenden":
                    return "Glenden Wood";
                case "lytelthorpe": // official name
                    return "Lytelthorpe";
                case "plateau village": // official name
                case "plateau":
                    return "Plateau Village";
                case "rithwic": // official name
                    return "Rithwic";
                case "stonehold": // official name
                    return "Stonehold";
                case "underground city": // official name
                    return "Underground City";

                // Sho
                case "shoushi": // official name
                    return "Shoushi";
                case "hebian-to": // official name
                case "heb":
                    return "Hebian-To";
                case "baishi": // official name
                    return "Baishi";
                case "kara": // official name
                    return "Kara";
                case "kryst": // official name
                    return "Kryst";
                case "lin": // official name
                    return "Lin";
                case "mayoi": // official name
                    return "Mayoi";
                case "nanto": // official name
                    return "Nanto";
                case "sawato": // official name
                    return "Sawato";
                case "tou-tou": // official name
                case "tou tou":
                    return "Tou-Tou";
                case "wai jhou": // official name
                case "bh":
                    return "Wai Jhou";
                case "yanshi": // official name
                    return "Yanshi";

                // Gharu'ndim
                case "yaraq": // official name
                    return "Yaraq";
                case "zaikhal": // official name
                    return "Zaikhal";
                case "al-arqas": // official name
                    return "Al-Arqas";
                case "al-jalima": // official name
                    return "Al-Jalima";
                case "ayan baqur": // official name
                case "ayan":
                case "ab":
                    return "Ayan Baqur";
                case "khayyaban": // official name
                    return "Khayyaban";
                case "qalaba'r": // official name
                case "qal":
                    return "Qalaba'r";
                case "samsur": // official name
                    return "Samsur";
                case "tufa": // official name
                    return "Tufa";
                case "uziz": // official name
                    return "Uziz";
                case "xarabydun": // official name
                    return "Xarabydun";

                // New Viamont
                case "sanamar": // official name
                    return "Sanamar";
                case "bluespire": // official name
                    return "Bluespire";
                case "eastwatch": // official name
                    return "Eastwatch";
                case "greenspire": // official name
                    return "Greenspire";
                case "redspire": // official name
                    return "Redspire";
                case "silyun": // official name
                    return "Silyun";
                case "westwatch": // official name
                    return "Westwatch";

                // Independent/Other Towns
                case "ahurenga": // official name
                    return "Ahurenga";
                case "bandit Castle": // official name
                    return "Bandit Castle";
                case "beach Fort": // official name
                    return "Beach Fort";
                case "candeth keep": // official name
                case "candeth":
                case "ck":
                    return "Candeth Keep";
                case "crater lake village": // official name
                case "crater":
                    return "Crater Lake Village";
                case "danby's outpost": // official name
                    return "Danby's Outpost";
                case "fiun outpost": // official name
                    return "Fiun Outpost";
                case "kor-gursha": // official name
                    return "Kor-Gursha";
                case "linvak tukal": // official name
                case "linvak":
                    return "Linvak Tukal";
                case "macniall's freehold": // official name
                case "freehold":
                    return "MacNiall's Freehold";
                case "mar'uun": // official name
                    return "Mar'uun";
                case "merwart village": // official name
                case "merwart":
                    return "Merwart Village";
                case "neydisa castle": // official name
                case "neydisa":
                    // This is the pretty name, but for now we need to return the name phatac teletown wants
                    //return "Neydisa Castle";
                    return "neydisa";
                case "oolatanga's refuge": // official name
                    return "Oolatanga's Refuge";
                case "timaru": // official name
                    return "Timaru";
                default:
                    return null;
            }
    }
    }
}


text:
package org.ensembl.healthcheck.testcase.compara;

import java.util.HashMap;
import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.ensembl.healthcheck.DatabaseRegistryEntry;
import org.ensembl.healthcheck.ReportManager;
import org.ensembl.healthcheck.testcase.compara.AbstractMLSSTagStats;

public class MLSSTagStatsPairwiseAlignment extends AbstractMLSSTagStats {

	protected HashMap<String,String[]> getMandatoryTags() {
		HashMap<String,String[]> mandatoryTags = new HashMap<String,String[]>();
		String[] tags_pairwise = {
			"non_ref_coding_exon_length", "non_ref_genome_coverage","non_ref_genome_length",
			"non_ref_insertions", "non_ref_matches", "non_ref_mis_matches", "non_ref_uncovered",
			"ref_coding_exon_length", "ref_genome_coverage", "ref_genome_length", "ref_insertions",
			"ref_matches", "ref_mis_matches", "ref_uncovered"
		};
		mandatoryTags.put("BLASTZ_NET", tags_pairwise);
		mandatoryTags.put("LASTZ_NET", tags_pairwise);
		mandatoryTags.put("TRANSLATED_BLAT_NET", tags_pairwise);
		return mandatoryTags;
	}

	protected boolean runTest(DatabaseRegistryEntry dbre) {
		boolean result = super.runTest(dbre);
		// Every genome must have some coding genes
		String query_wrong_stats = "SELECT method_link_species_set_id FROM method_link_species_set_tag WHERE tag = 'non_ref_coding_exon_length' AND value = '0'";
		List<String> mlsss = getTemplate(dbre).queryForDefaultObjectList(query_wrong_stats, String.class);
		if (mlsss.size() > 0) {
			ReportManager.problem( this, dbre.getConnection(), "MLSSs found with wrong statistics: " + StringUtils.join(mlsss, ","));
			ReportManager.problem( this, dbre.getConnection(), "USEFUL SQL: " + query_wrong_stats);
			result = false;
		} else {
			ReportManager.correct(this, dbre.getConnection(), "PASSED ");
		}
		return result;
	}
}


text:
class PlumSchema < ActiveTriples::Schema
  property :sort_title, predicate: ::OpaqueMods.titleForSort
  property :portion_note, predicate: ::RDF::Vocab::SKOS.scopeNote
  property :abstract, predicate: ::RDF::Vocab::DC.abstract
  property :alternative, predicate: ::RDF::Vocab::DC.alternative
  property :identifier, predicate: ::RDF::Vocab::DC.identifier
  property :local_identifier, predicate: ::RDF::Vocab::DC11.identifier
  property :replaces, predicate: ::RDF::Vocab::DC.replaces
  property :contents, predicate: ::RDF::Vocab::DC.tableOfContents
  property :rights_statement, predicate: ::RDF::Vocab::EDM.rights
  property :rights_note, predicate: ::RDF::Vocab::DC11.rights
  property :source_metadata_identifier, predicate: ::PULTerms.metadata_id
  property :source_metadata, predicate: ::PULTerms.source_metadata
  property :source_jsonld, predicate: ::PULTerms.source_jsonld
  property :holding_location, predicate: ::RDF::Vocab::Bibframe.heldBy
  property :ocr_language, predicate: ::PULTerms.ocr_language
  property :nav_date, predicate: ::RDF::URI("http://iiif.io/api/presentation/2#navDate")
  property :pdf_type, predicate: ::PULTerms.pdf_type
  property :start_canvas, predicate: ::RDF::Vocab::IIIF.hasStartCanvas
  property :container, predicate: ::PULTerms.container

  # Generated from Context
  property :coverage, predicate: RDF::Vocab::DC11.coverage
  property :created, predicate: RDF::Vocab::DC.created
  property :date, predicate: RDF::Vocab::DC11.date
  property :format, predicate: RDF::Vocab::DC11.format
  property :source, predicate: RDF::Vocab::DC11.source
  property :extent, predicate: RDF::Vocab::DC.extent
  property :edition, predicate: RDF::URI("http://id.loc.gov/ontologies/bibframe/editionStatement")
  property :cartographic_scale, predicate: RDF::Vocab::Bibframe.cartographicScale
  property :call_number, predicate: PULTerms.call_number
  property :abridger, predicate: RDF::Vocab::MARCRelators.abr
  property :actor, predicate: RDF::Vocab::MARCRelators.act
  property :adapter, predicate: RDF::Vocab::MARCRelators.adp
  property :addressee, predicate: RDF::Vocab::MARCRelators.rcp
  property :analyst, predicate: RDF::Vocab::MARCRelators.anl
  property :animator, predicate: RDF::Vocab::MARCRelators.anm
  property :annotator, predicate: RDF::Vocab::MARCRelators.ann
  property :appellant, predicate: RDF::Vocab::MARCRelators.apl
  property :appellee, predicate: RDF::Vocab::MARCRelators.ape
  property :applicant, predicate: RDF::Vocab::MARCRelators.app
  property :architect, predicate: RDF::Vocab::MARCRelators.arc
  property :arranger, predicate: RDF::Vocab::MARCRelators.arr
  property :art_copyist, predicate: RDF::Vocab::MARCRelators.acp
  property :art_director, predicate: RDF::Vocab::MARCRelators.adi
  property :artist, predicate: RDF::Vocab::MARCRelators.art
  property :artistic_director, predicate: RDF::Vocab::MARCRelators.ard
  property :assignee, predicate: RDF::Vocab::MARCRelators.asg
  property :associated_name, predicate: RDF::Vocab::MARCRelators.asn
  property :attributed_name, predicate: RDF::Vocab::MARCRelators.att
  property :auctioneer, predicate: RDF::Vocab::MARCRelators.auc
  property :author, predicate: RDF::Vocab::MARCRelators.aut
  property :author_in_quotations_or_text_abstracts, predicate: RDF::Vocab::MARCRelators.aqt
  property :author_of_afterword_colophon_etc, predicate: RDF::Vocab::MARCRelators.aft
  property :author_of_dialog, predicate: RDF::Vocab::MARCRelators.aud
  property :author_of_introduction_etc, predicate: RDF::Vocab::MARCRelators.aui
  property :autographer, predicate: RDF::Vocab::MARCRelators.ato
  property :bibliographic_antecedent, predicate: RDF::Vocab::MARCRelators.ant
  property :binder, predicate: RDF::Vocab::MARCRelators.bnd
  property :binding_designer, predicate: RDF::Vocab::MARCRelators.bdd
  property :blurb_writer, predicate: RDF::Vocab::MARCRelators.blw
  property :book_designer, predicate: RDF::Vocab::MARCRelators.bkd
  property :book_producer, predicate: RDF::Vocab::MARCRelators.bkp
  property :bookjacket_designer, predicate: RDF::Vocab::MARCRelators.bjd
  property :bookplate_designer, predicate: RDF::Vocab::MARCRelators.bpd
  property :bookseller, predicate: RDF::Vocab::MARCRelators.bsl
  property :braille_embosser, predicate: RDF::Vocab::MARCRelators.brl
  property :broadcaster, predicate: RDF::Vocab::MARCRelators.brd
  property :calligrapher, predicate: RDF::Vocab::MARCRelators.cll
  property :cartographer, predicate: RDF::Vocab::MARCRelators.ctg
  property :caster, predicate: RDF::Vocab::MARCRelators.cas
  property :censor, predicate: RDF::Vocab::MARCRelators.cns
  property :choreographer, predicate: RDF::Vocab::MARCRelators.chr
  property :cinematographer, predicate: RDF::Vocab::MARCRelators.cng
  property :client, predicate: RDF::Vocab::MARCRelators.cli
  property :collection_registrar, predicate: RDF::Vocab::MARCRelators.cor
  property :collector, predicate: RDF::Vocab::MARCRelators.col
  property :collotyper, predicate: RDF::Vocab::MARCRelators.clt
  property :colorist, predicate: RDF::Vocab::MARCRelators.clr
  property :commentator, predicate: RDF::Vocab::MARCRelators.cmm
  property :commentator_for_written_text, predicate: RDF::Vocab::MARCRelators.cwt
  property :compiler, predicate: RDF::Vocab::MARCRelators.com
  property :complainant, predicate: RDF::Vocab::MARCRelators.cpl
  property :complainant_appellant, predicate: RDF::Vocab::MARCRelators.cpt
  property :complainant_appellee, predicate: RDF::Vocab::MARCRelators.cpe
  property :composer, predicate: RDF::Vocab::MARCRelators.cmp
  property :compositor, predicate: RDF::Vocab::MARCRelators.cmt
  property :conceptor, predicate: RDF::Vocab::MARCRelators.ccp
  property :conductor, predicate: RDF::Vocab::MARCRelators.cnd
  property :conservator, predicate: RDF::Vocab::MARCRelators.con
  property :consultant, predicate: RDF::Vocab::MARCRelators.csl
  property :consultant_to_a_project, predicate: RDF::Vocab::MARCRelators.csp
  property :contestant, predicate: RDF::Vocab::MARCRelators.cos
  property :contestant_appellant, predicate: RDF::Vocab::MARCRelators.cot
  property :contestant_appellee, predicate: RDF::Vocab::MARCRelators.coe
  property :contestee, predicate: RDF::Vocab::MARCRelators.cts
  property :contestee_appellant, predicate: RDF::Vocab::MARCRelators.ctt
  property :contestee_appellee, predicate: RDF::Vocab::MARCRelators.cte
  property :contractor, predicate: RDF::Vocab::MARCRelators.ctr
  property :copyright_claimant, predicate: RDF::Vocab::MARCRelators.cpc
  property :copyright_holder, predicate: RDF::Vocab::MARCRelators.cph
  property :corrector, predicate: RDF::Vocab::MARCRelators.crr
  property :correspondent, predicate: RDF::Vocab::MARCRelators.crp
  property :costume_designer, predicate: RDF::Vocab::MARCRelators.cst
  property :court_governed, predicate: RDF::Vocab::MARCRelators.cou
  property :court_reporter, predicate: RDF::Vocab::MARCRelators.crt
  property :cover_designer, predicate: RDF::Vocab::MARCRelators.cov
  property :curator, predicate: RDF::Vocab::MARCRelators.cur
  property :dancer, predicate: RDF::Vocab::MARCRelators.dnc
  property :data_contributor, predicate: RDF::Vocab::MARCRelators.dtc
  property :data_manager, predicate: RDF::Vocab::MARCRelators.dtm
  property :dedicatee, predicate: RDF::Vocab::MARCRelators.dte
  property :dedicator, predicate: RDF::Vocab::MARCRelators.dto
  property :defendant, predicate: RDF::Vocab::MARCRelators.dfd
  property :defendant_appellant, predicate: RDF::Vocab::MARCRelators.dft
  property :defendant_appellee, predicate: RDF::Vocab::MARCRelators.dfe
  property :degree_granting_institution, predicate: RDF::Vocab::MARCRelators.dgg
  property :degree_supervisor, predicate: RDF::Vocab::MARCRelators.dgs
  property :delineator, predicate: RDF::Vocab::MARCRelators.dln
  property :depicted, predicate: RDF::Vocab::MARCRelators.dpc
  property :designer, predicate: RDF::Vocab::MARCRelators.dsr
  property :director, predicate: RDF::Vocab::MARCRelators.drt
  property :dissertant, predicate: RDF::Vocab::MARCRelators.dis
  property :distribution_place, predicate: RDF::Vocab::MARCRelators.dbp
  property :distributor, predicate: RDF::Vocab::MARCRelators.dst
  property :donor, predicate: RDF::Vocab::MARCRelators.dnr
  property :draftsman, predicate: RDF::Vocab::MARCRelators.drm
  property :dubious_author, predicate: RDF::Vocab::MARCRelators.dub
  property :editor, predicate: RDF::Vocab::MARCRelators.edt
  property :editor_of_compilation, predicate: RDF::Vocab::MARCRelators.edc
  property :editor_of_moving_image_work, predicate: RDF::Vocab::MARCRelators.edm
  property :electrician, predicate: RDF::Vocab::MARCRelators.elg
  property :electrotyper, predicate: RDF::Vocab::MARCRelators.elt
  property :enacting_jurisdiction, predicate: RDF::Vocab::MARCRelators.enj
  property :engineer, predicate: RDF::Vocab::MARCRelators.eng
  property :engraver, predicate: RDF::Vocab::MARCRelators.egr
  property :etcher, predicate: RDF::Vocab::MARCRelators.etr
  property :event_place, predicate: RDF::Vocab::MARCRelators.evp
  property :expert, predicate: RDF::Vocab::MARCRelators.exp
  property :facsimilist, predicate: RDF::Vocab::MARCRelators.fac
  property :field_director, predicate: RDF::Vocab::MARCRelators.fld
  property :film_distributor, predicate: RDF::Vocab::MARCRelators.fds
  property :film_director, predicate: RDF::Vocab::MARCRelators.fmd
  property :film_editor, predicate: RDF::Vocab::MARCRelators.flm
  property :film_producer, predicate: RDF::Vocab::MARCRelators.fmp
  property :filmmaker, predicate: RDF::Vocab::MARCRelators.fmk
  property :first_party, predicate: RDF::Vocab::MARCRelators.fpy
  property :forger, predicate: RDF::Vocab::MARCRelators.frg
  property :former_owner, predicate: RDF::Vocab::MARCRelators.fmo
  property :funder, predicate: RDF::Vocab::MARCRelators.fnd
  property :geographic_information_specialist, predicate: RDF::Vocab::MARCRelators.gis
  property :honoree, predicate: RDF::Vocab::MARCRelators.hnr
  property :host, predicate: RDF::Vocab::MARCRelators.hst
  property :host_institution, predicate: RDF::Vocab::MARCRelators.his
  property :illuminator, predicate: RDF::Vocab::MARCRelators.ilu
  property :illustrator, predicate: RDF::Vocab::MARCRelators.ill
  property :inscriber, predicate: RDF::Vocab::MARCRelators.ins
  property :instrumentalist, predicate: RDF::Vocab::MARCRelators.itr
  property :interviewee, predicate: RDF::Vocab::MARCRelators.ive
  property :interviewer, predicate: RDF::Vocab::MARCRelators.ivr
  property :inventor, predicate: RDF::Vocab::MARCRelators.inv
  property :issuing_body, predicate: RDF::Vocab::MARCRelators.isb
  property :judge, predicate: RDF::Vocab::MARCRelators.jud
  property :jurisdiction_governed, predicate: RDF::Vocab::MARCRelators.jug
  property :laboratory, predicate: RDF::Vocab::MARCRelators.lbr
  property :laboratory_director, predicate: RDF::Vocab::MARCRelators.ldr
  property :landscape_architect, predicate: RDF::Vocab::MARCRelators.lsa
  property :lead, predicate: RDF::Vocab::MARCRelators.led
  property :lender, predicate: RDF::Vocab::MARCRelators.len
  property :libelant, predicate: RDF::Vocab::MARCRelators.lil
  property :libelant_appellant, predicate: RDF::Vocab::MARCRelators.lit
  property :libelant_appellee, predicate: RDF::Vocab::MARCRelators.lie
  property :libelee, predicate: RDF::Vocab::MARCRelators.lel
  property :libelee_appellant, predicate: RDF::Vocab::MARCRelators.let
  property :libelee_appellee, predicate: RDF::Vocab::MARCRelators.lee
  property :librettist, predicate: RDF::Vocab::MARCRelators.lbt
  property :licensee, predicate: RDF::Vocab::MARCRelators.lse
  property :licensor, predicate: RDF::Vocab::MARCRelators.lso
  property :lighting_designer, predicate: RDF::Vocab::MARCRelators.lgd
  property :lithographer, predicate: RDF::Vocab::MARCRelators.ltg
  property :lyricist, predicate: RDF::Vocab::MARCRelators.lyr
  property :manufacture_place, predicate: RDF::Vocab::MARCRelators.mfp
  property :manufacturer, predicate: RDF::Vocab::MARCRelators.mfr
  property :marbler, predicate: RDF::Vocab::MARCRelators.mrb
  property :markup_editor, predicate: RDF::Vocab::MARCRelators.mrk
  property :medium, predicate: RDF::Vocab::MARCRelators.med
  property :metadata_contact, predicate: RDF::Vocab::MARCRelators.mdc
  property :metal_engraver, predicate: RDF::Vocab::MARCRelators.mte
  property :minute_taker, predicate: RDF::Vocab::MARCRelators.mtk
  property :moderator, predicate: RDF::Vocab::MARCRelators.mod
  property :monitor, predicate: RDF::Vocab::MARCRelators.mon
  property :music_copyist, predicate: RDF::Vocab::MARCRelators.mcp
  property :musical_director, predicate: RDF::Vocab::MARCRelators.msd
  property :musician, predicate: RDF::Vocab::MARCRelators.mus
  property :narrator, predicate: RDF::Vocab::MARCRelators.nrt
  property :onscreen_presenter, predicate: RDF::Vocab::MARCRelators.osp
  property :opponent, predicate: RDF::Vocab::MARCRelators.opn
  property :organizer, predicate: RDF::Vocab::MARCRelators.orm
  property :originator, predicate: RDF::Vocab::MARCRelators.org
  property :other, predicate: RDF::Vocab::MARCRelators.oth
  property :owner, predicate: RDF::Vocab::MARCRelators.own
  property :panelist, predicate: RDF::Vocab::MARCRelators.pan
  property :papermaker, predicate: RDF::Vocab::MARCRelators.ppm
  property :patent_applicant, predicate: RDF::Vocab::MARCRelators.pta
  property :patent_holder, predicate: RDF::Vocab::MARCRelators.pth
  property :patron, predicate: RDF::Vocab::MARCRelators.pat
  property :performer, predicate: RDF::Vocab::MARCRelators.prf
  property :permitting_agency, predicate: RDF::Vocab::MARCRelators.pma
  property :photographer, predicate: RDF::Vocab::MARCRelators.pht
  property :plaintiff, predicate: RDF::Vocab::MARCRelators.ptf
  property :plaintiff_appellant, predicate: RDF::Vocab::MARCRelators.ptt
  property :plaintiff_appellee, predicate: RDF::Vocab::MARCRelators.pte
  property :platemaker, predicate: RDF::Vocab::MARCRelators.plt
  property :praeses, predicate: RDF::Vocab::MARCRelators.pra
  property :presenter, predicate: RDF::Vocab::MARCRelators.pre
  property :printer, predicate: RDF::Vocab::MARCRelators.prt
  property :printer_of_plates, predicate: RDF::Vocab::MARCRelators.pop
  property :printmaker, predicate: RDF::Vocab::MARCRelators.prm
  property :process_contact, predicate: RDF::Vocab::MARCRelators.prc
  property :producer, predicate: RDF::Vocab::MARCRelators.pro
  property :production_company, predicate: RDF::Vocab::MARCRelators.prn
  property :production_designer, predicate: RDF::Vocab::MARCRelators.prs
  property :production_manager, predicate: RDF::Vocab::MARCRelators.pmn
  property :production_personnel, predicate: RDF::Vocab::MARCRelators.prd
  property :production_place, predicate: RDF::Vocab::MARCRelators.prp
  property :programmer, predicate: RDF::Vocab::MARCRelators.prg
  property :project_director, predicate: RDF::Vocab::MARCRelators.pdr
  property :proofreader, predicate: RDF::Vocab::MARCRelators.pfr
  property :provider, predicate: RDF::Vocab::MARCRelators.prv
  property :publication_place, predicate: RDF::Vocab::MARCRelators.pup
  property :publishing_director, predicate: RDF::Vocab::MARCRelators.pbd
  property :puppeteer, predicate: RDF::Vocab::MARCRelators.ppt
  property :radio_director, predicate: RDF::Vocab::MARCRelators.rdd
  property :radio_producer, predicate: RDF::Vocab::MARCRelators.rpc
  property :recording_engineer, predicate: RDF::Vocab::MARCRelators.rce
  property :recordist, predicate: RDF::Vocab::MARCRelators.rcd
  property :redaktor, predicate: RDF::Vocab::MARCRelators.red
  property :renderer, predicate: RDF::Vocab::MARCRelators.ren
  property :reporter, predicate: RDF::Vocab::MARCRelators.rpt
  property :marc_repository, predicate: RDF::Vocab::MARCRelators.rps
  property :research_team_head, predicate: RDF::Vocab::MARCRelators.rth
  property :research_team_member, predicate: RDF::Vocab::MARCRelators.rtm
  property :researcher, predicate: RDF::Vocab::MARCRelators.res
  property :respondent, predicate: RDF::Vocab::MARCRelators.rsp
  property :respondent_appellant, predicate: RDF::Vocab::MARCRelators.rst
  property :respondent_appellee, predicate: RDF::Vocab::MARCRelators.rse
  property :responsible_party, predicate: RDF::Vocab::MARCRelators.rpy
  property :restager, predicate: RDF::Vocab::MARCRelators.rsg
  property :restorationist, predicate: RDF::Vocab::MARCRelators.rsr
  property :reviewer, predicate: RDF::Vocab::MARCRelators.rev
  property :rubricator, predicate: RDF::Vocab::MARCRelators.rbr
  property :scenarist, predicate: RDF::Vocab::MARCRelators.sce
  property :scientific_advisor, predicate: RDF::Vocab::MARCRelators.sad
  property :screenwriter, predicate: RDF::Vocab::MARCRelators.aus
  property :scribe, predicate: RDF::Vocab::MARCRelators.scr
  property :sculptor, predicate: RDF::Vocab::MARCRelators.scl
  property :second_party, predicate: RDF::Vocab::MARCRelators.spy
  property :secretary, predicate: RDF::Vocab::MARCRelators.sec
  property :seller, predicate: RDF::Vocab::MARCRelators.sll
  property :set_designer, predicate: RDF::Vocab::MARCRelators.std
  property :setting, predicate: RDF::Vocab::MARCRelators.stg
  property :signer, predicate: RDF::Vocab::MARCRelators.sgn
  property :singer, predicate: RDF::Vocab::MARCRelators.sng
  property :sound_designer, predicate: RDF::Vocab::MARCRelators.sds
  property :speaker, predicate: RDF::Vocab::MARCRelators.spk
  property :sponsor, predicate: RDF::Vocab::MARCRelators.spn
  property :stage_director, predicate: RDF::Vocab::MARCRelators.sgd
  property :stage_manager, predicate: RDF::Vocab::MARCRelators.stm
  property :standards_body, predicate: RDF::Vocab::MARCRelators.stn
  property :stereotyper, predicate: RDF::Vocab::MARCRelators.str
  property :storyteller, predicate: RDF::Vocab::MARCRelators.stl
  property :supporting_host, predicate: RDF::Vocab::MARCRelators.sht
  property :surveyor, predicate: RDF::Vocab::MARCRelators.srv
  property :teacher, predicate: RDF::Vocab::MARCRelators.tch
  property :technical_director, predicate: RDF::Vocab::MARCRelators.tcd
  property :television_director, predicate: RDF::Vocab::MARCRelators.tld
  property :television_producer, predicate: RDF::Vocab::MARCRelators.tlp
  property :thesis_advisor, predicate: RDF::Vocab::MARCRelators.ths
  property :transcriber, predicate: RDF::Vocab::MARCRelators.trc
  property :translator, predicate: RDF::Vocab::MARCRelators.trl
  property :type_designer, predicate: RDF::Vocab::MARCRelators.tyd
  property :typographer, predicate: RDF::Vocab::MARCRelators.tyg
  property :university_place, predicate: RDF::Vocab::MARCRelators.uvp
  property :videographer, predicate: RDF::Vocab::MARCRelators.vdg
  property :voice_actor, predicate: RDF::Vocab::MARCRelators.vac
  property :witness, predicate: RDF::Vocab::MARCRelators.wit
  property :wood_engraver, predicate: RDF::Vocab::MARCRelators.wde
  property :woodcutter, predicate: RDF::Vocab::MARCRelators.wdc
  property :writer_of_accompanying_material, predicate: RDF::Vocab::MARCRelators.wam
  property :writer_of_added_commentary, predicate: RDF::Vocab::MARCRelators.wac
  property :writer_of_added_text, predicate: RDF::Vocab::MARCRelators.wat
  property :writer_of_added_lyrics, predicate: RDF::Vocab::MARCRelators.wal
  property :writer_of_supplementary_textual_content, predicate: RDF::Vocab::MARCRelators.wst
  property :writer_of_introduction, predicate: RDF::Vocab::MARCRelators.win
  property :writer_of_preface, predicate: RDF::Vocab::MARCRelators.wpr

  # All of the fields to display when looping through Plum's schema.
  # Ignore things like admin data (workflow note), title, description, etc, as
  # those have custom display logic.
  def self.display_fields
    ScannedResource.properties.values.map(&:term) - [:description, :state, :rights_statement, :holding_location, :title, :depositor, :source_metadata_identifier, :source_metadata, :date_modified, :date_uploaded, :nav_date, :pdf_type, :ocr_language, :keyword, :create_date, :modified_date, :head, :tail, :source_jsonld, :sort_title] - IIIFBookSchema.properties.map(&:name) + EphemeraSchema.properties.map(&:name) - [:sort_title]
  end
end
# rubocop:enable Metrics/ClassLength


text:
namespace WinAppDriver.Handlers
{
    using System.Collections.Generic;
    using WinAppDriver.UI;

    [Route("POST", "/session/:sessionId/doubleclick")]
    internal class DoubleClickHandler : IHandler
    {
        private IMouse mouse;

        public DoubleClickHandler(IMouse mouse)
        {
            this.mouse = mouse;
        }

        public object Handle(Dictionary<string, string> urlParams, string body, ref ISession session)
        {
            this.mouse.DoubleClick();
            return null;
        }
    }
}


text:
// Copyright 2021 Google LLC
//
// 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
//
//     https://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.

using System;
using Xunit;

namespace Google.Api.Generator.Rest.Tests
{
    public class PackageEnumStorageTest
    {
        [Fact]
        public void SimulatedOrderingChange()
        {
            string key = Guid.NewGuid().ToString();

            // First run: values [ "zero", "one", "two" ]
            var storage = PackageEnumStorage.FromJson("{}");
            Assert.Equal(0, storage.GetOrAddEnumValue(key, "zero"));
            Assert.Equal(1, storage.GetOrAddEnumValue(key, "one"));
            Assert.Equal(2, storage.GetOrAddEnumValue(key, "two"));
            string json = storage.ToJson();

            // Second run: values [ "two", "zero", "one", "three" ]
            storage = PackageEnumStorage.FromJson(json);
            Assert.Equal(2, storage.GetOrAddEnumValue(key, "two"));
            Assert.Equal(0, storage.GetOrAddEnumValue(key, "zero"));
            Assert.Equal(1, storage.GetOrAddEnumValue(key, "one"));
            Assert.Equal(3, storage.GetOrAddEnumValue(key, "three"));
        }

        [Fact]
        public void KeysAreIndependent()
        {
            string key1 = Guid.NewGuid().ToString();
            string key2 = Guid.NewGuid().ToString();

            var storage = PackageEnumStorage.FromJson("{}");
            Assert.Equal(0, storage.GetOrAddEnumValue(key1, "x"));
            Assert.Equal(1, storage.GetOrAddEnumValue(key1, "y"));

            // The "y" value from key 1 shouldn't affect key 2
            Assert.Equal(0, storage.GetOrAddEnumValue(key2, "y"));
            Assert.Equal(1, storage.GetOrAddEnumValue(key2, "z"));

            // Back to key 1, where the "z" value from key 2 shouldn't
            // affect it
            Assert.Equal(2, storage.GetOrAddEnumValue(key1, "z"));
        }
    }
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace BlueConcord.IdentityServer.EntityFrameworkCore {
    using System;
    using System.Reflection;

    /// <summary>
    ///    A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    public class Resources {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        internal Resources() {
        }

        /// <summary>
        ///    Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BlueConcord.IdentityServer.EntityFrameworkCore.Resources", typeof(Resources).GetTypeInfo().Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///    Overrides the current thread's CurrentUICulture property for all
        ///    resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        public static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///    Looks up a localized string similar to Object '{0}' has empty claims..
        /// </summary>
        public static string EmptyClaims {
            get {
                return ResourceManager.GetString("EmptyClaims", resourceCulture);
            }
        }

        /// <summary>
        ///    Looks up a localized string similar to Object '{0}' has a null parameter..
        /// </summary>
        public static string Null {
            get {
                return ResourceManager.GetString("Null", resourceCulture);
            }
        }

        /// <summary>
        ///    Looks up a localized string similar to Object '{0}' has a null or empty parameter..
        /// </summary>
        public static string NullOrEmpty {
            get {
                return ResourceManager.GetString("NullOrEmpty", resourceCulture);
            }
        }

        /// <summary>
        ///    Looks up a localized string similar to Object '{0}' has a null user..
        /// </summary>
        public static string NullUser {
            get {
                return ResourceManager.GetString("NullUser", resourceCulture);
            }
        }

        /// <summary>
        ///    Looks up a localized string similar to Object '{0}' has a null user login info..
        /// </summary>
        public static string NullUserLoginInfo {
            get {
                return ResourceManager.GetString("NullUserLoginInfo", resourceCulture);
            }
        }
    }
}