text:
package interaction_test

import (
	gomock "github.com/golang/mock/gomock"
	authenticator "github.com/skygeario/skygear-server/pkg/auth/dependency/authenticator"
	oob "github.com/skygeario/skygear-server/pkg/auth/dependency/authenticator/oob"
	identity "github.com/skygeario/skygear-server/pkg/auth/dependency/identity"
	interaction "github.com/skygeario/skygear-server/pkg/auth/dependency/interaction"
	model "github.com/skygeario/skygear-server/pkg/auth/model"
	authn "github.com/skygeario/skygear-server/pkg/core/authn"
	reflect "reflect"
)

// MockStore is a mock of Store interface
type MockStore struct {
	ctrl     *gomock.Controller
	recorder *MockStoreMockRecorder
}

// MockStoreMockRecorder is the mock recorder for MockStore
type MockStoreMockRecorder struct {
	mock *MockStore
}

// NewMockStore creates a new mock instance
func NewMockStore(ctrl *gomock.Controller) *MockStore {
	mock := &MockStore{ctrl: ctrl}
	mock.recorder = &MockStoreMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockStore) EXPECT() *MockStoreMockRecorder {
	return m.recorder
}

// Create mocks base method
func (m *MockStore) Create(i *interaction.Interaction) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Create", i)
	ret0, _ := ret[0].(error)
	return ret0
}

// Create indicates an expected call of Create
func (mr *MockStoreMockRecorder) Create(i interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockStore)(nil).Create), i)
}

// Get mocks base method
func (m *MockStore) Get(token string) (*interaction.Interaction, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Get", token)
	ret0, _ := ret[0].(*interaction.Interaction)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// Get indicates an expected call of Get
func (mr *MockStoreMockRecorder) Get(token interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockStore)(nil).Get), token)
}

// Update mocks base method
func (m *MockStore) Update(i *interaction.Interaction) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Update", i)
	ret0, _ := ret[0].(error)
	return ret0
}

// Update indicates an expected call of Update
func (mr *MockStoreMockRecorder) Update(i interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockStore)(nil).Update), i)
}

// Delete mocks base method
func (m *MockStore) Delete(i *interaction.Interaction) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Delete", i)
	ret0, _ := ret[0].(error)
	return ret0
}

// Delete indicates an expected call of Delete
func (mr *MockStoreMockRecorder) Delete(i interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockStore)(nil).Delete), i)
}

// MockIdentityProvider is a mock of IdentityProvider interface
type MockIdentityProvider struct {
	ctrl     *gomock.Controller
	recorder *MockIdentityProviderMockRecorder
}

// MockIdentityProviderMockRecorder is the mock recorder for MockIdentityProvider
type MockIdentityProviderMockRecorder struct {
	mock *MockIdentityProvider
}

// NewMockIdentityProvider creates a new mock instance
func NewMockIdentityProvider(ctrl *gomock.Controller) *MockIdentityProvider {
	mock := &MockIdentityProvider{ctrl: ctrl}
	mock.recorder = &MockIdentityProviderMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockIdentityProvider) EXPECT() *MockIdentityProviderMockRecorder {
	return m.recorder
}

// Get mocks base method
func (m *MockIdentityProvider) Get(userID string, typ authn.IdentityType, id string) (*identity.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Get", userID, typ, id)
	ret0, _ := ret[0].(*identity.Info)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// Get indicates an expected call of Get
func (mr *MockIdentityProviderMockRecorder) Get(userID, typ, id interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockIdentityProvider)(nil).Get), userID, typ, id)
}

// GetByClaims mocks base method
func (m *MockIdentityProvider) GetByClaims(typ authn.IdentityType, claims map[string]interface{}) (string, *identity.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetByClaims", typ, claims)
	ret0, _ := ret[0].(string)
	ret1, _ := ret[1].(*identity.Info)
	ret2, _ := ret[2].(error)
	return ret0, ret1, ret2
}

// GetByClaims indicates an expected call of GetByClaims
func (mr *MockIdentityProviderMockRecorder) GetByClaims(typ, claims interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetByClaims", reflect.TypeOf((*MockIdentityProvider)(nil).GetByClaims), typ, claims)
}

// GetByUserAndClaims mocks base method
func (m *MockIdentityProvider) GetByUserAndClaims(typ authn.IdentityType, userID string, claims map[string]interface{}) (*identity.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetByUserAndClaims", typ, userID, claims)
	ret0, _ := ret[0].(*identity.Info)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// GetByUserAndClaims indicates an expected call of GetByUserAndClaims
func (mr *MockIdentityProviderMockRecorder) GetByUserAndClaims(typ, userID, claims interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetByUserAndClaims", reflect.TypeOf((*MockIdentityProvider)(nil).GetByUserAndClaims), typ, userID, claims)
}

// ListByClaims mocks base method
func (m *MockIdentityProvider) ListByClaims(claims map[string]string) ([]*identity.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "ListByClaims", claims)
	ret0, _ := ret[0].([]*identity.Info)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// ListByClaims indicates an expected call of ListByClaims
func (mr *MockIdentityProviderMockRecorder) ListByClaims(claims interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByClaims", reflect.TypeOf((*MockIdentityProvider)(nil).ListByClaims), claims)
}

// ListByUser mocks base method
func (m *MockIdentityProvider) ListByUser(userID string) ([]*identity.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "ListByUser", userID)
	ret0, _ := ret[0].([]*identity.Info)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// ListByUser indicates an expected call of ListByUser
func (mr *MockIdentityProviderMockRecorder) ListByUser(userID interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByUser", reflect.TypeOf((*MockIdentityProvider)(nil).ListByUser), userID)
}

// New mocks base method
func (m *MockIdentityProvider) New(userID string, typ authn.IdentityType, claims map[string]interface{}) (*identity.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "New", userID, typ, claims)
	ret0, _ := ret[0].(*identity.Info)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// New indicates an expected call of New
func (mr *MockIdentityProviderMockRecorder) New(userID, typ, claims interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "New", reflect.TypeOf((*MockIdentityProvider)(nil).New), userID, typ, claims)
}

// WithClaims mocks base method
func (m *MockIdentityProvider) WithClaims(userID string, ii *identity.Info, claims map[string]interface{}) (*identity.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "WithClaims", userID, ii, claims)
	ret0, _ := ret[0].(*identity.Info)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// WithClaims indicates an expected call of WithClaims
func (mr *MockIdentityProviderMockRecorder) WithClaims(userID, ii, claims interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithClaims", reflect.TypeOf((*MockIdentityProvider)(nil).WithClaims), userID, ii, claims)
}

// CreateAll mocks base method
func (m *MockIdentityProvider) CreateAll(userID string, is []*identity.Info) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "CreateAll", userID, is)
	ret0, _ := ret[0].(error)
	return ret0
}

// CreateAll indicates an expected call of CreateAll
func (mr *MockIdentityProviderMockRecorder) CreateAll(userID, is interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAll", reflect.TypeOf((*MockIdentityProvider)(nil).CreateAll), userID, is)
}

// UpdateAll mocks base method
func (m *MockIdentityProvider) UpdateAll(userID string, is []*identity.Info) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "UpdateAll", userID, is)
	ret0, _ := ret[0].(error)
	return ret0
}

// UpdateAll indicates an expected call of UpdateAll
func (mr *MockIdentityProviderMockRecorder) UpdateAll(userID, is interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAll", reflect.TypeOf((*MockIdentityProvider)(nil).UpdateAll), userID, is)
}

// DeleteAll mocks base method
func (m *MockIdentityProvider) DeleteAll(userID string, is []*identity.Info) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "DeleteAll", userID, is)
	ret0, _ := ret[0].(error)
	return ret0
}

// DeleteAll indicates an expected call of DeleteAll
func (mr *MockIdentityProviderMockRecorder) DeleteAll(userID, is interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAll", reflect.TypeOf((*MockIdentityProvider)(nil).DeleteAll), userID, is)
}

// Validate mocks base method
func (m *MockIdentityProvider) Validate(is []*identity.Info) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Validate", is)
	ret0, _ := ret[0].(error)
	return ret0
}

// Validate indicates an expected call of Validate
func (mr *MockIdentityProviderMockRecorder) Validate(is interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validate", reflect.TypeOf((*MockIdentityProvider)(nil).Validate), is)
}

// RelateIdentityToAuthenticator mocks base method
func (m *MockIdentityProvider) RelateIdentityToAuthenticator(identitySpec identity.Spec, authenticatorSpec *authenticator.Spec) *authenticator.Spec {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "RelateIdentityToAuthenticator", identitySpec, authenticatorSpec)
	ret0, _ := ret[0].(*authenticator.Spec)
	return ret0
}

// RelateIdentityToAuthenticator indicates an expected call of RelateIdentityToAuthenticator
func (mr *MockIdentityProviderMockRecorder) RelateIdentityToAuthenticator(identitySpec, authenticatorSpec interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RelateIdentityToAuthenticator", reflect.TypeOf((*MockIdentityProvider)(nil).RelateIdentityToAuthenticator), identitySpec, authenticatorSpec)
}

// CheckIdentityDuplicated mocks base method
func (m *MockIdentityProvider) CheckIdentityDuplicated(is *identity.Info, userID string) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "CheckIdentityDuplicated", is, userID)
	ret0, _ := ret[0].(error)
	return ret0
}

// CheckIdentityDuplicated indicates an expected call of CheckIdentityDuplicated
func (mr *MockIdentityProviderMockRecorder) CheckIdentityDuplicated(is, userID interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckIdentityDuplicated", reflect.TypeOf((*MockIdentityProvider)(nil).CheckIdentityDuplicated), is, userID)
}

// MockAuthenticatorProvider is a mock of AuthenticatorProvider interface
type MockAuthenticatorProvider struct {
	ctrl     *gomock.Controller
	recorder *MockAuthenticatorProviderMockRecorder
}

// MockAuthenticatorProviderMockRecorder is the mock recorder for MockAuthenticatorProvider
type MockAuthenticatorProviderMockRecorder struct {
	mock *MockAuthenticatorProvider
}

// NewMockAuthenticatorProvider creates a new mock instance
func NewMockAuthenticatorProvider(ctrl *gomock.Controller) *MockAuthenticatorProvider {
	mock := &MockAuthenticatorProvider{ctrl: ctrl}
	mock.recorder = &MockAuthenticatorProviderMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockAuthenticatorProvider) EXPECT() *MockAuthenticatorProviderMockRecorder {
	return m.recorder
}

// Get mocks base method
func (m *MockAuthenticatorProvider) Get(userID string, typ authn.AuthenticatorType, id string) (*authenticator.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Get", userID, typ, id)
	ret0, _ := ret[0].(*authenticator.Info)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// Get indicates an expected call of Get
func (mr *MockAuthenticatorProviderMockRecorder) Get(userID, typ, id interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockAuthenticatorProvider)(nil).Get), userID, typ, id)
}

// List mocks base method
func (m *MockAuthenticatorProvider) List(userID string, typ authn.AuthenticatorType) ([]*authenticator.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "List", userID, typ)
	ret0, _ := ret[0].([]*authenticator.Info)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// List indicates an expected call of List
func (mr *MockAuthenticatorProviderMockRecorder) List(userID, typ interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAuthenticatorProvider)(nil).List), userID, typ)
}

// ListByIdentity mocks base method
func (m *MockAuthenticatorProvider) ListByIdentity(userID string, ii *identity.Info) ([]*authenticator.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "ListByIdentity", userID, ii)
	ret0, _ := ret[0].([]*authenticator.Info)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// ListByIdentity indicates an expected call of ListByIdentity
func (mr *MockAuthenticatorProviderMockRecorder) ListByIdentity(userID, ii interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByIdentity", reflect.TypeOf((*MockAuthenticatorProvider)(nil).ListByIdentity), userID, ii)
}

// New mocks base method
func (m *MockAuthenticatorProvider) New(userID string, spec authenticator.Spec, secret string) ([]*authenticator.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "New", userID, spec, secret)
	ret0, _ := ret[0].([]*authenticator.Info)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// New indicates an expected call of New
func (mr *MockAuthenticatorProviderMockRecorder) New(userID, spec, secret interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "New", reflect.TypeOf((*MockAuthenticatorProvider)(nil).New), userID, spec, secret)
}

// WithSecret mocks base method
func (m *MockAuthenticatorProvider) WithSecret(userID string, a *authenticator.Info, secret string) (bool, *authenticator.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "WithSecret", userID, a, secret)
	ret0, _ := ret[0].(bool)
	ret1, _ := ret[1].(*authenticator.Info)
	ret2, _ := ret[2].(error)
	return ret0, ret1, ret2
}

// WithSecret indicates an expected call of WithSecret
func (mr *MockAuthenticatorProviderMockRecorder) WithSecret(userID, a, secret interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithSecret", reflect.TypeOf((*MockAuthenticatorProvider)(nil).WithSecret), userID, a, secret)
}

// CreateAll mocks base method
func (m *MockAuthenticatorProvider) CreateAll(userID string, ais []*authenticator.Info) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "CreateAll", userID, ais)
	ret0, _ := ret[0].(error)
	return ret0
}

// CreateAll indicates an expected call of CreateAll
func (mr *MockAuthenticatorProviderMockRecorder) CreateAll(userID, ais interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAll", reflect.TypeOf((*MockAuthenticatorProvider)(nil).CreateAll), userID, ais)
}

// UpdateAll mocks base method
func (m *MockAuthenticatorProvider) UpdateAll(userID string, ais []*authenticator.Info) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "UpdateAll", userID, ais)
	ret0, _ := ret[0].(error)
	return ret0
}

// UpdateAll indicates an expected call of UpdateAll
func (mr *MockAuthenticatorProviderMockRecorder) UpdateAll(userID, ais interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAll", reflect.TypeOf((*MockAuthenticatorProvider)(nil).UpdateAll), userID, ais)
}

// DeleteAll mocks base method
func (m *MockAuthenticatorProvider) DeleteAll(userID string, ais []*authenticator.Info) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "DeleteAll", userID, ais)
	ret0, _ := ret[0].(error)
	return ret0
}

// DeleteAll indicates an expected call of DeleteAll
func (mr *MockAuthenticatorProviderMockRecorder) DeleteAll(userID, ais interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAll", reflect.TypeOf((*MockAuthenticatorProvider)(nil).DeleteAll), userID, ais)
}

// Authenticate mocks base method
func (m *MockAuthenticatorProvider) Authenticate(userID string, spec authenticator.Spec, state *map[string]string, secret string) (*authenticator.Info, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Authenticate", userID, spec, state, secret)
	ret0, _ := ret[0].(*authenticator.Info)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// Authenticate indicates an expected call of Authenticate
func (mr *MockAuthenticatorProviderMockRecorder) Authenticate(userID, spec, state, secret interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Authenticate", reflect.TypeOf((*MockAuthenticatorProvider)(nil).Authenticate), userID, spec, state, secret)
}

// VerifySecret mocks base method
func (m *MockAuthenticatorProvider) VerifySecret(userID string, a *authenticator.Info, secret string) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "VerifySecret", userID, a, secret)
	ret0, _ := ret[0].(error)
	return ret0
}

// VerifySecret indicates an expected call of VerifySecret
func (mr *MockAuthenticatorProviderMockRecorder) VerifySecret(userID, a, secret interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifySecret", reflect.TypeOf((*MockAuthenticatorProvider)(nil).VerifySecret), userID, a, secret)
}

// MockUserProvider is a mock of UserProvider interface
type MockUserProvider struct {
	ctrl     *gomock.Controller
	recorder *MockUserProviderMockRecorder
}

// MockUserProviderMockRecorder is the mock recorder for MockUserProvider
type MockUserProviderMockRecorder struct {
	mock *MockUserProvider
}

// NewMockUserProvider creates a new mock instance
func NewMockUserProvider(ctrl *gomock.Controller) *MockUserProvider {
	mock := &MockUserProvider{ctrl: ctrl}
	mock.recorder = &MockUserProviderMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockUserProvider) EXPECT() *MockUserProviderMockRecorder {
	return m.recorder
}

// Create mocks base method
func (m *MockUserProvider) Create(userID string, metadata map[string]interface{}, identities []*identity.Info) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Create", userID, metadata, identities)
	ret0, _ := ret[0].(error)
	return ret0
}

// Create indicates an expected call of Create
func (mr *MockUserProviderMockRecorder) Create(userID, metadata, identities interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockUserProvider)(nil).Create), userID, metadata, identities)
}

// Get mocks base method
func (m *MockUserProvider) Get(userID string) (*model.User, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "Get", userID)
	ret0, _ := ret[0].(*model.User)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// Get indicates an expected call of Get
func (mr *MockUserProviderMockRecorder) Get(userID interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockUserProvider)(nil).Get), userID)
}

// MockOOBProvider is a mock of OOBProvider interface
type MockOOBProvider struct {
	ctrl     *gomock.Controller
	recorder *MockOOBProviderMockRecorder
}

// MockOOBProviderMockRecorder is the mock recorder for MockOOBProvider
type MockOOBProviderMockRecorder struct {
	mock *MockOOBProvider
}

// NewMockOOBProvider creates a new mock instance
func NewMockOOBProvider(ctrl *gomock.Controller) *MockOOBProvider {
	mock := &MockOOBProvider{ctrl: ctrl}
	mock.recorder = &MockOOBProviderMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockOOBProvider) EXPECT() *MockOOBProviderMockRecorder {
	return m.recorder
}

// GenerateCode mocks base method
func (m *MockOOBProvider) GenerateCode() string {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GenerateCode")
	ret0, _ := ret[0].(string)
	return ret0
}

// GenerateCode indicates an expected call of GenerateCode
func (mr *MockOOBProviderMockRecorder) GenerateCode() *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenerateCode", reflect.TypeOf((*MockOOBProvider)(nil).GenerateCode))
}

// SendCode mocks base method
func (m *MockOOBProvider) SendCode(opts oob.SendCodeOptions) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "SendCode", opts)
	ret0, _ := ret[0].(error)
	return ret0
}

// SendCode indicates an expected call of SendCode
func (mr *MockOOBProviderMockRecorder) SendCode(opts interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCode", reflect.TypeOf((*MockOOBProvider)(nil).SendCode), opts)
}


text:
{{ modal.texts.title }}

    {{ modal.texts.body }}

    <button class="btn btn-primary" ng-click="modal.actions.close()">{{ modal.texts.closeButton }}</button>
    <button class="btn btn-danger" ng-click="modal.actions.dismiss()" ng-hide="modal.texts.noDismiss">{{ modal.texts.dismissButton }}</button>

redpajama_set_name: RedPajamaGithub


text:
import os
import sys

reload(sys)
sys.setdefaultencoding('utf8')

# import django env
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.views.decorators.csrf import csrf_exempt
from third_part.alipay_send.alipay_api import *

def index(request):
    template_name = 'templates/send_zhifu.html'
    return render_to_response(template_name)

@csrf_exempt
def submit(request):
    if request.method == 'POST':
        trade_no = request.POST.get('trade_no', '')
        logistics_name = request.POST.get('logistics_name', '')
        invoice_no = request.POST.get('invoice_no', '')
        transport_type = request.POST.get('transport_type', '')

        html = ''
        submit = Alipay_API()
        html = submit.alipay_submit(trade_no, logistics_name, invoice_no, transport_type)

        # here, just for testing
        # XML DATA like this:
        # <?xml version="1.0" encoding="utf-8"?>
        # <alipay><is_success>F</is_success><error>ILLEGAL_PARTNER_EXTERFACE</error></alipay>

        print html
        logResult('============= 商家发货确认 日志 ================')
        logResult(html)
        logResult('===============================================')

        # 注意: 这里的 html 为支付宝官方返回的 XML 文本数据,需要解析 XML,
        #        获取 XML 节点中的 'alipay' 第一个value
        # 请在这里加上商户的业务逻辑程序代码
        # 请根据业务逻辑来编写程序(以下代码仅作参考
        # 获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表

        alipay_node_value = ''  # 解析xml数据, todo ...

    return HttpResponse(alipay_node_value)

def logResult(msg):  # 写日志,方便测试(看网站需求,也可以改成把记录存入数据库)
    log = 'third_part/alipay_send/log.txt'
    fi = open(log, 'a')
    fi.write(msg + "\n")
    fi.close()


text:
/*
This code is written by kerukuro and released into public domain.
*/

#ifndef DIGESTPP_ALGORITHM_SHA3_HPP
#define DIGESTPP_ALGORITHM_SHA3_HPP

#include "../hasher.hpp"
#include "detail/sha3_provider.hpp"

namespace digestpp
{

/**
 * @brief SHA-3 hash function
 *
 * @hash
 *
 * @outputsize 224 / 256 / 384 / 512 bits
 *
 * @defaultsize none
 *
 * @throw std::runtime_error if the requested digest size is not supported
 *
 * @par Example:\n
 * @code // Output a 256-bit SHA-3 digest of a string
 * digestpp::sha3 hasher(256);
 * hasher.absorb("The quick brown fox jumps over the lazy dog");
 * std::cout << hasher.hexdigest() << '\n';
 * @endcode
 *
 * @par Example output:\n
 * @code 69070dda01975c8c120c3aada1b282394e7f032fa9cf32f4cb2259a0897dfc04
 * @endcode
 *
 * @sa hasher
 */
typedef hasher<detail::sha3_provider> sha3;

} // namespace digestpp

#endif // DIGESTPP_ALGORITHM_SHA3_HPP


text:
#include "application_manager/commands/mobile/delete_file_response.h"
#include "application_manager/application_manager_impl.h"
#include "application_manager/application_impl.h"

namespace application_manager {

namespace commands {

DeleteFileResponse::DeleteFileResponse(const MessageSharedPtr& message)
    : CommandResponseImpl(message) {
}

DeleteFileResponse::~DeleteFileResponse() {
}

void DeleteFileResponse::Run() {
  LOG4CXX_AUTO_TRACE(logger_);
  uint32_t app_id = (*message_)[strings::params][strings::connection_key]
      .asUInt();
  ApplicationSharedPtr app =
      ApplicationManagerImpl::instance()->application(app_id);
  if (!app) {
    LOG4CXX_ERROR(logger_, "Application not registered");
    SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
    return;
  }

  (*message_)[strings::msg_params][strings::space_available] =
      static_cast<uint32_t>(
          ApplicationManagerImpl::instance()->
              GetAvailableSpaceForApp(app->folder_name()));
  SendResponse((*message_)[strings::msg_params][strings::success].asBool());
}

}  // namespace commands

}  // namespace application_manager


text:
package com.richardnorthen.uktidalinfo.json;

public class Station {
    public Item[] items;
    public Station() {}

    public class Item {
        public String dateTime;
        public double value;
        public Item() {}
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#88000000"
    android:id="@+id/absence.bg"
    >

    <android.support.v7.widget.CardView
        android:id="@+id/absence.card"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:background="@android:color/holo_red_dark"
        android:layout_marginLeft="6dp"
        android:layout_marginRight="6dp"
        android:layout_marginTop="70dp"
        android:layout_marginBottom="70dp"
        android:layout_centerInParent="true"
        android:clickable="true"
        app:cardCornerRadius="4dp"
        app:cardElevation="10dp"
        android:transitionName="@string/transition_card"
        >

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            >

            <TextView
                android:id="@+id/absence.name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="6dp"
                android:layout_marginBottom="6dp"
                android:layout_centerHorizontal="true"
                android:gravity="center"
                android:text="Nome da Disciplina"
                android:textColor="@color/text_secondary_light"
                android:textAllCaps="true"
                android:singleLine="true"
                android:textSize="20dp"
                />

            <View
                android:id="@+id/absence.divider"
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_below="@+id/absence.name"
                android:background="@color/divider"
                />

            <android.support.v7.widget.RecyclerView
                android:id="@+id/absence.recyclerview"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="16dp"
                android:layout_below="@+id/absence.divider"
                android:layout_above="@+id/absence.ll_add"
                />

            <LinearLayout
                android:id="@+id/absence.ll_add"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:clickable="true"
                >

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="16dp"
                    android:gravity="center"
                    android:text="Adicionar Falta"
                    android:textSize="19dp"
                    android:textColor="@color/text_secondary_light"
                    />

            </LinearLayout>

        </RelativeLayout>
    </android.support.v7.widget.CardView>
</RelativeLayout>


text:
package org.tuxdude.yani.fragment.mobile;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import org.tuxdude.yani.R;
import org.tuxdude.yani.fragment.common.BaseSectionFragment;
import org.tuxdude.yani.fragment.common.SectionFragmentType;

public class MobileSectionFragment extends BaseSectionFragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.section_mobile, container, false);
        return rootView;
    }

    @Override
    public SectionFragmentType getFragmentType() {
        return SectionFragmentType.SECTION_MOBILE;
    }
}


text: This AddWaterMarkToImage PHP class allows you to add a watermark to an image using PHP.


text:
package org.gradoop.flink.model.impl.operators.matching.single.cypher.planning.estimation;

import org.gradoop.flink.model.impl.operators.matching.common.query.QueryHandler;
import org.gradoop.flink.model.impl.operators.matching.common.query.predicates.CNF;
import org.gradoop.flink.model.impl.operators.matching.common.statistics.GraphStatistics;
import org.gradoop.flink.model.impl.operators.matching.single.cypher.planning.queryplan.FilterNode;
import org.gradoop.flink.model.impl.operators.matching.single.cypher.planning.queryplan.leaf.FilterAndProjectEdgesNode;
import org.gradoop.flink.model.impl.operators.matching.single.cypher.planning.queryplan.leaf.FilterAndProjectVerticesNode;
import org.gradoop.flink.model.impl.operators.matching.single.cypher.planning.queryplan.unary.FilterEmbeddingsNode;

/**
 * Keeps track of the leaf nodes in a query plan and computes a final selectivity factor resulting
 * from the applied predicates.
 */
class FilterEstimator extends Estimator {
  /**
   * The non-filtered cardinality of the leaf node.
   */
  private long cardinality;
  /**
   * The resulting selectivity factor of all leaf predicates
   */
  private double selectivity;

  /**
   * Creates a new estimator.
   *
   * @param queryHandler query handler
   * @param graphStatistics graph statistics
   */
  FilterEstimator(QueryHandler queryHandler, GraphStatistics graphStatistics) {
    super(queryHandler, graphStatistics);
    this.selectivity = 1f;
  }

  /**
   * Updates the selectivity factor according to the given node.
   *
   * @param node leaf node
   */
  void visit(FilterNode node) {
    if (node instanceof FilterAndProjectVerticesNode) {
      FilterAndProjectVerticesNode vertexNode = (FilterAndProjectVerticesNode) node;
      setCardinality(vertexNode.getEmbeddingMetaData().getVertexVariables().get(0), true);
      updateSelectivity(vertexNode.getFilterPredicate());
    } else if (node instanceof FilterAndProjectEdgesNode) {
      FilterAndProjectEdgesNode edgeNode = (FilterAndProjectEdgesNode) node;
      setCardinality(edgeNode.getEmbeddingMetaData().getEdgeVariables().get(0), false);
      updateSelectivity(edgeNode.getFilterPredicate());
    } else if (node instanceof FilterEmbeddingsNode) {
      updateSelectivity(((FilterEmbeddingsNode) node).getFilterPredicate());
    }
  }

  /**
   * Returns the non-filtered cardinality of the leaf node output.
   *
   * @return estimated cardinality
   */
  long getCardinality() {
    return cardinality;
  }

  /**
   * Returns the combined selectivity of all leaf nodes.
   *
   * @return combined selectivity factor
   */
  double getSelectivity() {
    return selectivity;
  }

  /**
   * Updates the cardinality of the leaf node output.
   *
   * @param variable query variable
   * @param isVertex true, iff the variable maps to a vertex
   */
  private void setCardinality(String variable, boolean isVertex) {
    cardinality = getCardinality(getLabel(variable, isVertex), isVertex);
  }

  /**
   * Updates the selectivity based on the given predicates.
   *
   * @param predicates query predicates
   */
  private void updateSelectivity(CNF predicates) {
    // TODO
  }
}


text:
using System.Collections.Generic;
using Orchard.Environment.Extensions.Models;
using Orchard.Security.Permissions;

namespace NGM.Forum {
    public class Permissions : IPermissionProvider {
        public static readonly Permission ManageForums = new Permission { Description = "Manage forums", Name = "ManageForums" };
        public static readonly Permission ViewForum = new Permission { Description = "View forum", Name = "ViewForum" };

        public static readonly Permission CreatePost = new Permission { Description = "Create a post", Name = "CreatePost" };
        public static readonly Permission ReplyPost = new Permission { Description = "Reply to a post", Name = "ReplyPost" };
        public static readonly Permission ViewPost = new Permission { Description = "View post", Name = "ViewPost" };

        public static readonly Permission DeleteOwnPost = new Permission { Description = "Delete your own post", Name = "DeleteOwnPost" };
        public static readonly Permission DeletePost = new Permission { Description = "Delete any post", Name = "DeletePost" };

        public static readonly Permission EditOwnPost = new Permission { Description = "Edit your own post", Name = "EditOwnPost" };
        public static readonly Permission EditPost = new Permission { Description = "Edit any post", Name = "EditPost" };

        public static readonly Permission MoveThread = new Permission { Description = "Move thread to another forum", Name = "MoveThread" };

        //public static readonly Permission MoveAnyPost = new Permission { Description = "Move any post", Name = "MoveAnyPost" };

        public static readonly Permission ManageOpenCloseThread = new Permission { Description = "Can open/close a thread", Name = "ManageOpenCloseThread" };
        public static readonly Permission ManageStickyThread = new Permission { Description = "Can create a thread that is sticky", Name = "ManageStickyThread" };

        public static readonly Permission MarkPostInOwnThreadAsAnswer = new Permission { Description = "Can mark your a post in your own thread as an answer", Name = "MarkPostInOwnThreadAsAnswer" };
        public static readonly Permission MarkPostAsAnswer = new Permission { Description = "Can mark any post as an answer", Name = "MarkPostAsAnswer" };

        public virtual Feature Feature { get; set; }

        public IEnumerable<Permission> GetPermissions() {
            return new[] {
                ManageForums,
                ViewForum,

                CreatePost,
                ReplyPost,
                ViewPost,

                DeleteOwnPost,
                DeletePost,

                EditOwnPost,
                EditPost,

                MoveThread,
                //MoveAnyPost,

                ManageOpenCloseThread,
                ManageStickyThread,

                MarkPostInOwnThreadAsAnswer,
                MarkPostAsAnswer
            };
        }

        public IEnumerable<PermissionStereotype> GetDefaultStereotypes() {

            return new[] {
                new PermissionStereotype {
                    Name = "Administrator",
                    Permissions = new[] {ManageForums}
                },
                new PermissionStereotype {
                    Name = "Anonymous",
                    Permissions = new[] {ViewForum, ViewPost},
                },
                new PermissionStereotype {
                    Name = "Authenticated",
                    Permissions = new[] {ViewForum, ViewPost},
                },
                new PermissionStereotype {
                    Name = "Editor",
                    Permissions = new[] {ViewForum, ViewPost},
                },
                new PermissionStereotype {
                    Name = "Moderator",
                    Permissions = new[] {ViewForum, ViewPost},
                },
                new PermissionStereotype {
                    Name = "Author",
                    Permissions = new[] {ViewForum, ViewPost},
                },
                new PermissionStereotype {
                    Name = "Contributor",
                    Permissions = new[] {ViewForum, ViewPost, CreatePost, ReplyPost},
                },
            };
        }
    }
}


text:
require File.expand_path('../../test_helper.rb', File.dirname(__FILE__))

class AdobeConnectGroupTest < AdobeConnectTestCase

  include AdobeConnectBaseTests

  AdobeConnect::Config.declare do
    username 'test@example.com'
    password 'pwd'
    domain   'http://example.com'
  end

  def test_attrs_does_not_contain_principal_id_when_unpersisted
    attrs = @connect_group.attrs

    assert !attrs.has_key?(:principal_id)
  end

  def test_attrs_contain_principal_id_when_persisted
    @connect_group.instance_variable_set(:@id, '54321')

    attrs = @connect_group.attrs

    assert attrs.has_key?(:principal_id)
    assert_equal '54321', attrs[:principal_id]
  end

  def test_add_member_to_group
    response = mock_ac_response(responses[:generic_success])

    @connect_group.service.
      expects(:group_membership_update).
      returns(response)

    user_stub = mock
    user_stub.expects(:id).returns(12345)

    assert @connect_group.add_member(user_stub)
  end

  def test_user_is_member_of_group
    response = mock_ac_response(responses[:is_member])

    @connect_group.id = 12345

    @connect_group.service.
      expects(:principal_list).
      returns(response)

    assert @connect_group.is_member?('testuser@example.com')
  end

  def test_user_is_not_member_of_group
    response = mock_ac_response(responses[:is_not_member])

    @connect_group.id = 12345

    @connect_group.service.
      expects(:principal_list).
      returns(response)

    refute @connect_group.is_member?('testuser@example.com')
  end

  private
  def obj_attrs
    { name: 'Test group', description: 'This is for testing' }
  end

  def obj_attrs_posted
    { name: 'Test group', description: 'This is for testing', :type => 'group', :has_children => 1 }
  end

  def responses
    super.merge(load_responses([:is_member, :is_not_member]))
  end
end


text:
layout: post
title: End of final qualifying 2016
header_image: eucsc.png
---
<!-- preview_img -->
International Hacker Competition: Europe is preparing against cyber threats

Last night, the national qualification phase of this year's "European Cyber Security Challenge" ended. The 20
best young hackers in Switzerland have been identified and are competing for entry into the European finale
in Dusseldorf. The annual hacker competition is an important instrument for youth development and is
encountering growing interest: For the first time, ten countries are participating in the international
competition.

Please have a look at the full [press release](/res/press/SCS_MM_Ende_Qualifikation_EN.pdf) ([German press release](/res/press/SCS_MM_Ende_Qualifikation_DE.pdf), [Frensh press release](/res/press/SCS_MM_Ende_Qualifikation_FR.pdf)).

Stay tuned for more information about this years conference and watch out for news about the Cyber Security Challenges!


text:
package org.elasticsearch.hadoop.serialization.bulk;

import java.util.List;

import org.elasticsearch.hadoop.EsHadoopIllegalStateException;
import org.elasticsearch.hadoop.cfg.ConfigurationOptions;
import org.elasticsearch.hadoop.cfg.Settings;
import org.elasticsearch.hadoop.serialization.bulk.MetadataExtractor.Metadata;
import org.elasticsearch.hadoop.util.Assert;
import org.elasticsearch.hadoop.util.EsMajorVersion;
import org.elasticsearch.hadoop.util.StringUtils;

class UpdateBulkFactory extends AbstractBulkFactory {

    private final int RETRY_ON_FAILURE;
    private final String RETRY_HEADER;

    private final String SCRIPT_2X;

    private final String SCRIPT_5X;
    private final String SCRIPT_LANG_5X;

    private final String SCRIPT_1X;
    private final String SCRIPT_LANG_1X;

    private final boolean HAS_SCRIPT, HAS_LANG;
    private final boolean UPSERT;

    private final EsMajorVersion esMajorVersion;

    public UpdateBulkFactory(Settings settings, MetadataExtractor metaExtractor, EsMajorVersion esMajorVersion) {
        this(settings, false, metaExtractor, esMajorVersion);
    }

    public UpdateBulkFactory(Settings settings, boolean upsert, MetadataExtractor metaExtractor, EsMajorVersion esMajorVersion) {
        super(settings, metaExtractor);

        this.esMajorVersion = esMajorVersion;

        UPSERT = upsert;
        RETRY_ON_FAILURE = settings.getUpdateRetryOnConflict();
        RETRY_HEADER = "\"_retry_on_conflict\":" + RETRY_ON_FAILURE + "";

        HAS_SCRIPT = settings.hasUpdateScript();
        HAS_LANG = StringUtils.hasText(settings.getUpdateScriptLang());

        SCRIPT_LANG_5X = ",\"lang\":\"" + settings.getUpdateScriptLang() + "\"";
        SCRIPT_LANG_1X = "\"lang\":\"" + settings.getUpdateScriptLang() + "\",";

        if (HAS_SCRIPT) {
            if (StringUtils.hasText(settings.getUpdateScriptInline())) {
                // INLINE
                String source = "inline";
                if (esMajorVersion.onOrAfter(EsMajorVersion.V_6_X)) {
                    source = "source";
                }
                SCRIPT_5X = "{\"script\":{\"" + source + "\":\"" + settings.getUpdateScriptInline() + "\"";
                SCRIPT_2X = SCRIPT_5X;
                SCRIPT_1X = "\"script\":\"" + settings.getUpdateScriptInline() + "\"";
            } else if (StringUtils.hasText(settings.getUpdateScriptFile())) {
                // FILE
                SCRIPT_5X = "{\"script\":{\"file\":\"" + settings.getUpdateScriptFile() + "\"";
                SCRIPT_2X = SCRIPT_5X;
                SCRIPT_1X = "\"script_file\":\"" + settings.getUpdateScriptFile() + "\"";
            } else if (StringUtils.hasText(settings.getUpdateScriptStored())) {
                // STORED
                SCRIPT_5X = "{\"script\":{\"stored\":\"" + settings.getUpdateScriptStored() + "\"";
                SCRIPT_2X = "{\"script\":{\"id\":\"" + settings.getUpdateScriptStored() + "\"";
                SCRIPT_1X = "\"script_id\":\"" + settings.getUpdateScriptStored() + "\"";
            } else {
                throw new EsHadoopIllegalStateException("No update script found...");
            }
        } else {
            SCRIPT_5X = null;
            SCRIPT_2X = null;
            SCRIPT_1X = null;
        }
    }

    @Override
    protected String getOperation() {
        return ConfigurationOptions.ES_OPERATION_UPDATE;
    }

    @Override
    protected void otherHeader(List<Object> list, boolean commaMightBeNeeded) {
        if (RETRY_ON_FAILURE > 0) {
            if (commaMightBeNeeded) {
                list.add(",");
            }
            list.add(RETRY_HEADER);
        }
    }

    @Override
    protected void writeObjectHeader(List<Object> list) {
        super.writeObjectHeader(list);

        Object paramExtractor = getMetadataExtractorOrFallback(Metadata.PARAMS, getParamExtractor());

        if (esMajorVersion.on(EsMajorVersion.V_1_X)) {
            writeLegacyFormatting(list, paramExtractor);
        } else if (esMajorVersion.on(EsMajorVersion.V_2_X)) {
            writeStrictFormatting(list, paramExtractor, SCRIPT_2X);
        } else {
            writeStrictFormatting(list, paramExtractor, SCRIPT_5X);
        }
    }

    /**
     * Script format meant for versions 1.x to 2.x. Required format for 1.x and below.
     * @param list Consumer of snippets
     * @param paramExtractor Extracts parameters from documents or constants
     */
    private void writeLegacyFormatting(List<Object> list, Object paramExtractor) {
        if (paramExtractor != null) {
            list.add("{\"params\":");
            list.add(paramExtractor);
            list.add(",");
        }
        else {
            list.add("{");
        }

        if (HAS_SCRIPT) {
            /*
             * {
             *   "params": ...,
             *   "lang": "...",
             *   "script": "...",
             *   "upsert": {...}
             * }
             */
            if (HAS_LANG) {
                list.add(SCRIPT_LANG_1X);
            }
            list.add(SCRIPT_1X);
            if (UPSERT) {
                list.add(",\"upsert\":");
            }
        }
        else {
            /*
             * {
             *   "doc_as_upsert": true,
             *   "doc": {...}
             * }
             */
            if (UPSERT) {
                list.add("\"doc_as_upsert\":true,");
            }
            list.add("\"doc\":");
        }
    }

    /**
     * Script format meant for versions 2.x to 5.x. Required format for 5.x and above.
     * @param list Consumer of snippets
     * @param paramExtractor Extracts parameters from documents or constants
     */
    private void writeStrictFormatting(List<Object> list, Object paramExtractor, String scriptToUse) {
        if (HAS_SCRIPT) {
            /*
             * {
             *   "script":{
             *     "inline": "...",
             *     "lang": "...",
             *     "params": ...,
             *   },
             *   "upsert": {...}
             * }
             */
            list.add(scriptToUse);
            if (HAS_LANG) {
                list.add(SCRIPT_LANG_5X);
            }
            if (paramExtractor != null) {
                list.add(",\"params\":");
                list.add(paramExtractor);
            }
            list.add("}");
            if (UPSERT) {
                list.add(",\"upsert\":");
            }
        } else {
            /*
             * {
             *   "doc_as_upsert": true,
             *   "doc": {...}
             * }
             */
            list.add("{");
            if (UPSERT) {
                list.add("\"doc_as_upsert\":true,");
            }
            list.add("\"doc\":");
        }
    }

    @Override
    protected void writeObjectEnd(List<Object> after) {
        after.add("}");
        super.writeObjectEnd(after);
    }

    @Override
    protected boolean id(List<Object> list, boolean commaMightBeNeeded) {
        boolean added = super.id(list, commaMightBeNeeded);
        Assert.isTrue(added, String.format("Operation [%s] requires an id but none was given/found", getOperation()));
        return added;
    }
}


text:
#include <cstdint>

#include <string>
#include <tuple>
#include <utility>

#include "../tests/testbench.h"

// investigate strongly typed field names and how they could be used as named parameters.
// check https://github.com/edouarda/brigand

namespace xp {
	using std::string;
	using std::wstring;
	using std::size_t;

	template<size_t N>
	struct constant {
		static const size_t value = N;
	};

	template <class T, size_t N, class... Types>
	struct index_of {
		static const size_t value = N;
	};

	template <class T, size_t N, class F, class... Types>
	struct index_of<T, N, F, Types...> {
		static const size_t value = std::conditional<std::is_same<T, typename F::tag>::value
			, constant<N>
			, index_of<T, N + 1, Types... >>::type::value;
	};
	//template <class T, class... Types>
	//struct index_of<T, Types...> {
	//	static const size_t value = index_of<T, 0, Types...>::value;
	//};

	template<class T, class... Types>
	typename std::tuple_element<index_of<T, 0, Types...>::value, std::tuple<Types...>>::type& get(std::tuple<Types...>& t) {
		return std::get<index_of<T, 0, Types...>::value>(t);
	}
	template<class T, class... Types>
	const typename std::tuple_element<index_of<T, 0, Types...>::value, std::tuple<Types...>>::type& get(const std::tuple<Types...>& t) {
		return std::get<index_of<T, 0, Types...>::value>(t);
	}

	template<class T, class... Types>
	size_t get_index(const std::tuple<Types...>&) {
		return index_of<T, 0, Types...>::value;
	}

	template <typename Tag, typename T> struct field_tag {
		typedef std::string value_type;

		template<typename U>
		std::pair<Tag, T> operator=(const U& x) {
			return std::make_pair(Tag{}, T(x));
		}
	};

	template <typename Tag>
	struct field {
		typedef Tag tag;
		typedef typename Tag::value_type value_type;

		field() : val() {}
		field(const value_type& x) : val(x) {}
		field(const field& x) : val(x.val) {}
		field(field&& x) : val(std::move(x.val)) {}

		template<typename U>
		field(U&& x) : val(std::forward<U>(x)) {}

		value_type val;

		field operator=(const field& x) {
			return *this;
		}
		tag operator=(const tag& x) {
			return *this;
		}
	};

	template <typename... Tags>
	struct record {
		//template<typename F>
		//using index_type = typename index_of<F, 0, Fields...>;

		typedef std::tuple<field<Tags>...> storage;
		storage fields;

		//template<typename F>
		//using field_type = typename std::tuple_element<index_type<F>::value, storage>::type;

		typedef record base;

		record(const record& x) : fields(x.fields) { }

		template<typename... Args>
		record(Args&&... values) : fields(std::forward_as_tuple(values...)) {
		}

		template<typename F>
		typename field<F>::value_type& operator[](F) {
			return std::get<field<F>>(fields).val;
		}
		template<typename F>
		typename field<F>::value_type& operator[](F) const {
			return std::get<field<F>>(fields).val;
		}

		template<typename... Args>
		void update(Args&&... values) {
			int count[] = { 0, (set(values), 1)... };
		}

		template<typename F, typename V>
		void set(const std::pair<F, V>& arg) {
			std::get<field<F>>(fields).val = arg.second;
		}
	};

	struct name_tag : field_tag<name_tag, std::string> { using field_tag::operator=; };
	struct phone_number_tag : field_tag<phone_number_tag, std::string> { using field_tag::operator=; };
	struct email_tag : field_tag<email_tag, std::string> { using field_tag::operator=; };
	struct rank_tag : field_tag<rank_tag, int> { using field_tag::operator=; };

	//struct Name : field < string, Name > { using field::field;/*using field<string, Name>::operator =;*/ } fullname;
	//struct PhoneNumber : field < string, PhoneNumber > { /*using field<string, PhoneNumber>::operator =;*/ } phone_number;

	struct Person : record<
		name_tag,
		email_tag,
		phone_number_tag
	> {
		Person(string name, string email, string phone_number)
			: base(std::move(name), std::move(email), std::move(phone_number)) {
		}
	};

} // namespace xp

xp::name_tag fullname;
xp::phone_number_tag phone_number;
xp::email_tag email;
xp::rank_tag rank;

TESTBENCH()

TEST(can_create_record) {
	using namespace xp;
	Person vjacquet{ "vjacquet", "vjacquet@example.com", "+1 555 033 1234" };

	VERIFY_EQ(0U, get_index<name_tag>(vjacquet.fields));
	VERIFY_EQ(1U, get_index<email_tag>(vjacquet.fields));
	VERIFY_EQ(2U, get_index<phone_number_tag>(vjacquet.fields));
	VERIFY_EQ(3 * sizeof(std::string), sizeof(Person));

	VERIFY_EQ("vjacquet", vjacquet[fullname]);
	VERIFY_EQ("+1 555 033 1234", vjacquet[phone_number]);
	VERIFY_EQ("vjacquet@example.com", vjacquet[email]);
}

TEST(can_update_record) {
	using namespace xp;
	Person vjacquet{ "vjacquet", "jacquet@example.com", "+1 555 033 9871" };

	VERIFY_EQ("+1 555 033 9871", vjacquet[phone_number]);
	VERIFY_EQ("jacquet@example.com", vjacquet[email]);

	// Is is possible to enforce that the same parameter is not used twice?
	vjacquet.update(phone_number = "+1 555 033 1234", email = "vjacquet@example.com");
	//vjacquet.update(rank = 1);

	VERIFY_EQ("vjacquet", vjacquet[fullname]);
	VERIFY_EQ("+1 555 033 1234", vjacquet[phone_number]);
	VERIFY_EQ("vjacquet@example.com", vjacquet[email]);
}

TESTFIXTURE(record)


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Year = void 0;

var _react = _interopRequireDefault(require("react"));

var _GroupInput = require("../../../GroupInput");

var Year = function Year(_ref) {
  var _ref$item = _ref.item,
      id = _ref$item.id,
      year = _ref$item.year,
      onChange = _ref.onChange;

  var valueChange = function valueChange(e) {
    onChange(id, {
      year: e.target.value
    });
  };

  return _react["default"].createElement(_GroupInput.GroupInput, {
    onChange: valueChange,
    value: year,
    placement: "right"
  });
};

exports.Year = Year;
//# sourceMappingURL=Year.js.map


text:
$category@: presentation
formats:
  - websites
teaser:
  text: The amp-date-display component displays time data that you can render in your AMP page.
experiental: true
bento: true
---

# amp-date-display

## Usage

The `amp-date-display` component displays time data that you can render in your
AMP page. By providing specific [attributes](#attributes) in the
`amp-date-display` tag, the `amp-date-display` extension returns a list of time
parameters, which you can pass to
[an amp-mustache template](../amp-mustache/amp-mustache.md)
for rendering. Refer to the
[list below for each returned time parameter](#returned-time-parameters).

```html
<!-- Displays "Wednesday 2 August 2017, 15:05:05" -->
<amp-date-display
  datetime="2017-08-02T15:05:05.000"
  layout="fixed"
  width="360"
  height="20"
>
  <template type="amp-mustache">
    <div>
      {{dayName}} {{day}} {{monthName}} {{year}}
      {{hourTwoDigit}}:{{minuteTwoDigit}}:{{secondTwoDigit}}
    </div>
  </template>
</amp-date-display>
```

### Returned time parameters

This table lists the format you can specify in your Mustache template:

| Format            | Meaning                                                       |
| ----------------- | ------------------------------------------------------------- |
| day               | 1, 2, ...12, 13, etc.                                         |
| dayName           | string,                                                       |
| dayNameShort      | string,                                                       |
| dayPeriod         | string,                                                       |
| dayTwoDigit       | 01, 02, 03, ..., 12, 13, etc.                                 |
| hour              | 0, 1, 2, 3, ..., 12, 13, ..., 22, 23                          |
| hour12            | 1, 2, 3, ..., 12, 1, 2, ..., 11, 12                           |
| hour12TwoDigit    | 01, 02, ..., 12, 01, 02, ..., 11, 12                          |
| hourTwoDigit      | 00, 01, 02, ..., 12, 13, ..., 22, 23                          |
| iso               | A standard ISO8601 date string e.g. 2019-01-23T15:31:21.213Z, |
| localeString      | A string with a language sensitive representation.            |
| minute            | 0, 1, 2, ..., 58, 59                                          |
| minuteTwoDigit    | 00, 01, 02, ..., 58, 59                                       |
| month             | 1, 2, 3, ..., 12                                              |
| monthName         | Internationalized month name string.                          |
| monthNameShort    | Internationalized abbreviated month name string.,             |
| monthTwoDigit     | 01, 02, ..., 11, 12                                           |
| second            | 0, 1, 2, ..., 58, 59                                          |
| secondTwoDigit    | 00, 01, 02, ..., 58, 59                                       |
| timeZoneName      | Internationalized timezone, like `Pacific Daylight Time`      |
| timeZoneNameShort | Internationalized timezone, abbreviated, like `PST`           |
| year              | 0, 1, 2, ..., 1999, 2000, 2001, etc.                          |
| yearTwoDigit      | 00, 01, 02, ..., 17, 18, 19, ..., 98, 99                      |

### Standalone use outside valid AMP documents

Bento AMP allows you to use AMP components in non-AMP pages without needing to commit to fully valid AMP. You can take these components and place them in implementations with frameworks and CMSs that don't support AMP. Read more in our guide [Use AMP components in non-AMP pages](https://amp.dev/documentation/guides-and-tutorials/start/bento_guide/).

#### Example

The example below demonstrates `amp-date-display` component in standalone use.

[example preview="top-frame" playground="false"]

```
<head>
  <script async src="https://cdn.ampproject.org/v0.js"></script>
  <link rel="stylesheet" type="text/css" href="https://cdn.ampproject.org/v0/amp-date-display-1.0.css">
  <script async custom-element="amp-date-display" src="https://cdn.ampproject.org/v0/amp-date-display-1.0.js"></script>
   <script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-latest.js"></script>
  <style>
    amp-date-display {
      display: block;
      height: 20px;
    }
  </style>
</head>
<amp-date-display
  id="my-date-display"
  datetime="2017-08-02T15:05:05.000"
  locale="en"
>
  <template type="amp-mustache">
    <div>
      {{dayName}} {{day}} {{monthName}} {{year}}
      {{hourTwoDigit}}:{{minuteTwoDigit}}:{{secondTwoDigit}}
    </div>
  </template>
</amp-date-display>
<div class="buttons" style="margin-top: 8px;">
  <button id="ar-button">Change locale to Arabic</button>
  <button id="en-button">Change locale to English</button>
  <button id="now-button">Change time to now</button>
</div>

<script>
  (async () => {
    const dateDisplay = document.querySelector('#my-date-display');
    await customElements.whenDefined('amp-date-display');

    // set up button actions
    document.querySelector('#ar-button').onclick = () => dateDisplay.setAttribute('locale', 'ar');
    document.querySelector('#en-button').onclick = () => dateDisplay.setAttribute('locale', 'en');
    document.querySelector('#now-button').onclick = () => dateDisplay.setAttribute('datetime', 'now');
  })();
</script>
```

[/example]

#### Layout and style

Each Bento component has a small CSS library you must include to guarantee proper loading without [content shifts](https://web.dev/cls/). Because of order-based specificity, you must manually ensure that stylesheets are included before any custom styles.

```
<link rel="stylesheet" type="text/css" href="https://cdn.ampproject.org/v0/amp-date-display-1.0.css">
```

Fully valid AMP pages use the AMP layout system to infer sizing of elements to create a page structure before downloading any remote resources. However, Bento use imports components into less controlled environments and AMP's layout system is inaccessible.

**Container type**

The `amp-date-display` component has a defined layout size type. To ensure the component renders correctly, apply the following styles:

```css
amp-date-display {
  display: block;
  height: 20px;
}
```

## Attributes

You must specify at least one of these required attributes: `datetime`,
`timestamp-ms`, or `timestamp-seconds`.

### datetime

The `datetime` attribute specifies the date and time in a standard ISO 8601 date
string (e.g. 2017-08-02T15:05:05.000Z) or the string `now`. If set to `now`,
`amp-date-display` will use the time the page loaded to render its template.

### timestamp-ms

The `timestamp-ms` attribute specifies the date and time using the number of
milliseconds since 1970-01-01T0:00:00.000Z

### timestamp-seconds

The `timestamp-seconds` attribute specifies the date and time using the number
of seconds since 1970-01-01T0:00:00.000Z

### locale (optional)

An internationalization language string for each timer unit. The default value
is `en` (for English). This attribute supports all values that are supported by
the user's browser.

### display-in (optional)

If set to the value `utc`, the `display-in` attribute will convert the given
date to UTC.

### offset-seconds (optional)

The `offset-seconds` attribute specifies an integer number of seconds to shift
the given date.

### data-options-\* (optional)

The `data-options-*` supports all the options under [Intl.DateTimeFormat.options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#parameters)
parameter that specifies the formatting style to use for `localeString` format.
Valid attributes include: `data-options-date-style`, `data-options-time-style`, etc.

Note that if `display-in` attrubute is set to `utc`, the value of
`data-options-time-zone` will automatically be converted to `UTC`.


text:
https://docs.microsoft.com/en-us/virtualization/index#pivot=main&panel=server

https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/hyper-v-on-windows-server

https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/plan/should-i-create-a-generation-1-or-2-virtual-machine-in-hyper-v

https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/deploy/export-and-import-virtual-machines

https://docs.microsoft.com/en-us/windows-server/administration/performance-tuning/role/hyper-v-server/

# PowerShell

https://technet.microsoft.com/library/hh848559.aspx

# Command

## Enable Hyper-V

https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v#enable-hyper-v-using-powershell

```powershell
Enable-WindowsOptionalFeature -Online -FeatureName:Microsoft-Hyper-V -All
```

## Create virtual switch

https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/connect-to-network
https://docs.microsoft.com/en-us/powershell/module/hyper-v/new-vmswitch?view=win10-ps

```powershell
$NetNetAdapter = (Get-NetAdapter)[0]
New-VMSwitch -Name 'External Virtual Network Switch' -NetAdapterName $NetNetAdapter.Name -AllowManagementOS $TRUE
```

## Create virtual hard disk

https://docs.microsoft.com/en-us/powershell/module/hyper-v/new-vhd?view=win10-ps

```powershell
$VHDFilePath = 'd:\test.vhdx'
New-VHD -Path $VHDFilePath -Dynamic -SizeBytes 32GB
```

## Create virtual machine

```powershell
$VMName = 'test_vm'
$VMPath = "d:\$VMName"
$VMSwitch = 'External Virtual Network Switch'
$InstallMedia = 'd:\en_windows_server_2016_x64_dvd_9718492.iso'
$VHDFilePath = 'd:\test.vhdx'

# Create New Virtual Machine
New-VM -Name $VMName -Generation 2 -VHDPath $VHDFilePath -SwitchName $VMSwitch -MemoryStartupBytes 2147483648 -Path $VMPath

# Add DVD Drive to Virtual Machine
Add-VMScsiController -VMName $VMName
Add-VMDvdDrive -VMName $VMName -ControllerNumber 1 -ControllerLocation 0 -Path $InstallMedia

# Mount Installation Media
$DVDDrive = Get-VMDvdDrive -VMName $VMName

# Configure Virtual Machine to Boot from DVD
Set-VMFirmware -VMName $VMName -FirstBootDevice $DVDDrive
```


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

  <title>Index of /images/service_icons/services</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Index of /images/service_icons/services

 Parent Directory

 advertising_icon.png

 branding_icon.png

 cms_icon.png

 logo_icon.png

 mobile_icon.png

 service_icon_featured.png

 webdesign_icon.png


text:
package org.kelly_ann;

import net.webservicex.GeoIP;
import net.webservicex.GeoIPService;
import net.webservicex.GeoIPServiceSoap;

public class IPLocationFinder
{
	public static void main(String[] args)
	{
		if (args.length != 1)
		{
			System.out.println("Please pass in an IP address.");
		}
		else
		{
			// WSDL Endpoint URL: http://www.webservicex.net/geoipservice.asmx?WSDL
			// GeoIPService is in the <wsdl:service> in the wsdl's XML.
			// GeoIPServiceSoap is in the <wsdl:port> within the <wsdl:service> XML tags in the wsdl.
			// GeoIP is the actual IP object with the information about the IP.
			// sample IP's to pass in as an arg:  bbc.com = 70.126.135.19 OR google.com = 74.125.239.142
			String ipAddress = args[0];
			GeoIPService ipService = new GeoIPService();
			GeoIPServiceSoap geoIPServiceSoap = ipService.getGeoIPServiceSoap();
			GeoIP geoIP = geoIPServiceSoap.getGeoIP(ipAddress);
			System.out.println(geoIP.getCountryName());

		}

	}

}


text:
package ca.mcgill.networkdynamics.geoinference;

import org.json.JSONObject;

import java.util.List;

/**
 * The interface for interacting with a trained geoinference model.  Models are
 * first produced through a training procedure with a {@link
 * GeoinferenceMethod}.  After training has been completed, the model can be
 * used to infer locations.
 */
public interface GeoinferenceModel {

    /**
     * Infers the location of the post or returns {@code null} if no location can be inferred.
     *
     * @param post a JSON post in the Twitter format
     */
    LatLon inferLocation(JSONObject post);

    /**
     * Infers the location of all posts belonging to this user and returns a
     * list of where each post was located.  Location inferences may be {@code
     * null} if no location can be inferred but the returned {@code List} should
     * not be {@code null}.
     *
     * @param id the ID of the user for which the posts are being inferred
     * @param posts a list of JSON posts in the Twitter format
     */
    List<LatLon> inferPostLocationsByUser(long id, List<JSONObject> posts);

}


text:
/*
 * This program is used to generate definitions needed by
 * assembly language modules.
 *
 * We use the technique used in the OSF Mach kernel code:
 * generate asm statements containing #defines,
 * compile this file to assembler, and then extract the
 * #defines from the assembly-language output.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */

#include <linux/config.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/mman.h>
#include <linux/mm.h>
#ifdef CONFIG_PPC64
#include <linux/time.h>
#include <linux/hardirq.h>
#else
#include <linux/ptrace.h>
#include <linux/suspend.h>
#endif

#include <asm/io.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/processor.h>
#include <asm/cputable.h>
#include <asm/thread_info.h>
#include <asm/rtas.h>
#include <asm/vdso_datapage.h>
#ifdef CONFIG_PPC64
#include <asm/paca.h>
#include <asm/lppaca.h>
#include <asm/iseries/hv_lp_event.h>
#include <asm/cache.h>
#include <asm/compat.h>
#endif

#define DEFINE(sym, val) \
	asm volatile("\n->" #sym " %0 " #val : : "i" (val))

#define BLANK() asm volatile("\n->" : : )

int main(void)
{
	DEFINE(THREAD, offsetof(struct task_struct, thread));
	DEFINE(MM, offsetof(struct task_struct, mm));
#ifdef CONFIG_PPC64
	DEFINE(AUDITCONTEXT, offsetof(struct task_struct, audit_context));
#else
	DEFINE(THREAD_INFO, offsetof(struct task_struct, thread_info));
	DEFINE(PTRACE, offsetof(struct task_struct, ptrace));
#endif /* CONFIG_PPC64 */

	DEFINE(KSP, offsetof(struct thread_struct, ksp));
	DEFINE(PT_REGS, offsetof(struct thread_struct, regs));
	DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode));
	DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0]));
	DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr));
#ifdef CONFIG_ALTIVEC
	DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0]));
	DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave));
	DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr));
	DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr));
#endif /* CONFIG_ALTIVEC */
#ifdef CONFIG_PPC64
	DEFINE(KSP_VSID, offsetof(struct thread_struct, ksp_vsid));
#else /* CONFIG_PPC64 */
	DEFINE(PGDIR, offsetof(struct thread_struct, pgdir));
	DEFINE(LAST_SYSCALL, offsetof(struct thread_struct, last_syscall));
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
	DEFINE(THREAD_DBCR0, offsetof(struct thread_struct, dbcr0));
	DEFINE(PT_PTRACED, PT_PTRACED);
#endif
#ifdef CONFIG_SPE
	DEFINE(THREAD_EVR0, offsetof(struct thread_struct, evr[0]));
	DEFINE(THREAD_ACC, offsetof(struct thread_struct, acc));
	DEFINE(THREAD_SPEFSCR, offsetof(struct thread_struct, spefscr));
	DEFINE(THREAD_USED_SPE, offsetof(struct thread_struct, used_spe));
#endif /* CONFIG_SPE */
#endif /* CONFIG_PPC64 */

	DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
	DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
	DEFINE(TI_TASK, offsetof(struct thread_info, task));
#ifdef CONFIG_PPC32
	DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
	DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
#endif /* CONFIG_PPC32 */

#ifdef CONFIG_PPC64
	DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size));
	DEFINE(DCACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_dline_size));
	DEFINE(DCACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, dlines_per_page));
	DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size));
	DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size));
	DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page));
	DEFINE(PLATFORM_LPAR, PLATFORM_LPAR);

	/* paca */
	DEFINE(PACA_SIZE, sizeof(struct paca_struct));
	DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index));
	DEFINE(PACAPROCSTART, offsetof(struct paca_struct, cpu_start));
	DEFINE(PACAKSAVE, offsetof(struct paca_struct, kstack));
	DEFINE(PACACURRENT, offsetof(struct paca_struct, __current));
	DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, saved_msr));
	DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real));
	DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr));
	DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr));
	DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1));
	DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc));
	DEFINE(PACAPROCENABLED, offsetof(struct paca_struct, proc_enabled));
	DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
	DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
	DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
#ifdef CONFIG_PPC_64K_PAGES
	DEFINE(PACAPGDIR, offsetof(struct paca_struct, pgdir));
#endif
#ifdef CONFIG_HUGETLB_PAGE
	DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas));
	DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas));
#endif /* CONFIG_HUGETLB_PAGE */
	DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen));
	DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc));
	DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb));
	DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp));
	DEFINE(PACALPPACAPTR, offsetof(struct paca_struct, lppaca_ptr));
	DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));

	DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0));
	DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1));
	DEFINE(LPPACAANYINT, offsetof(struct lppaca, int_dword.any_int));
	DEFINE(LPPACADECRINT, offsetof(struct lppaca, int_dword.fields.decr_int));
#endif /* CONFIG_PPC64 */

	/* RTAS */
	DEFINE(RTASBASE, offsetof(struct rtas_t, base));
	DEFINE(RTASENTRY, offsetof(struct rtas_t, entry));

	/* Interrupt register frame */
	DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD);
#ifndef CONFIG_PPC64
	DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs));
#else /* CONFIG_PPC64 */
	DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs));
	/* 288 = # of volatile regs, int & fp, for leaf routines */
	/* which do not stack a frame.  See the PPC64 ABI.       */
	DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 288);
	/* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */
	DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
	DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
#endif /* CONFIG_PPC64 */
	DEFINE(GPR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[0]));
	DEFINE(GPR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[1]));
	DEFINE(GPR2, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[2]));
	DEFINE(GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[3]));
	DEFINE(GPR4, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[4]));
	DEFINE(GPR5, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[5]));
	DEFINE(GPR6, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[6]));
	DEFINE(GPR7, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[7]));
	DEFINE(GPR8, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[8]));
	DEFINE(GPR9, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[9]));
	DEFINE(GPR10, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[10]));
	DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11]));
	DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12]));
	DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13]));
#ifndef CONFIG_PPC64
	DEFINE(GPR14, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[14]));
	DEFINE(GPR15, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[15]));
	DEFINE(GPR16, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[16]));
	DEFINE(GPR17, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[17]));
	DEFINE(GPR18, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[18]));
	DEFINE(GPR19, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[19]));
	DEFINE(GPR20, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[20]));
	DEFINE(GPR21, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[21]));
	DEFINE(GPR22, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[22]));
	DEFINE(GPR23, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[23]));
	DEFINE(GPR24, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[24]));
	DEFINE(GPR25, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[25]));
	DEFINE(GPR26, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[26]));
	DEFINE(GPR27, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[27]));
	DEFINE(GPR28, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[28]));
	DEFINE(GPR29, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[29]));
	DEFINE(GPR30, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[30]));
	DEFINE(GPR31, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[31]));
#endif /* CONFIG_PPC64 */
	/*
	 * Note: these symbols include _ because they overlap with special
	 * register names
	 */
	DEFINE(_NIP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, nip));
	DEFINE(_MSR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, msr));
	DEFINE(_CTR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ctr));
	DEFINE(_LINK, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, link));
	DEFINE(_CCR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, ccr));
	DEFINE(_XER, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, xer));
	DEFINE(_DAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar));
	DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr));
	DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3));
	DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result));
	DEFINE(_TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
#ifndef CONFIG_PPC64
	DEFINE(_MQ, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, mq));
	/*
	 * The PowerPC 400-class & Book-E processors have neither the DAR
	 * nor the DSISR SPRs. Hence, we overload them to hold the similar
	 * DEAR and ESR SPRs for such processors.  For critical interrupts
	 * we use them to hold SRR0 and SRR1.
	 */
	DEFINE(_DEAR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dar));
	DEFINE(_ESR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr));
#else /* CONFIG_PPC64 */
	DEFINE(SOFTE, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, softe));

	/* These _only_ to be used with {PROM,RTAS}_FRAME_SIZE!!! */
	DEFINE(_SRR0, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs));
	DEFINE(_SRR1, STACK_FRAME_OVERHEAD+sizeof(struct pt_regs)+8);
#endif /* CONFIG_PPC64 */

	DEFINE(CLONE_VM, CLONE_VM);
	DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);

#ifndef CONFIG_PPC64
	DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
#endif /* ! CONFIG_PPC64 */

	/* About the CPU features table */
	DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec));
	DEFINE(CPU_SPEC_PVR_MASK, offsetof(struct cpu_spec, pvr_mask));
	DEFINE(CPU_SPEC_PVR_VALUE, offsetof(struct cpu_spec, pvr_value));
	DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features));
	DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup));

#ifndef CONFIG_PPC64
	DEFINE(pbe_address, offsetof(struct pbe, address));
	DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
	DEFINE(pbe_next, offsetof(struct pbe, next));

	DEFINE(TASK_SIZE, TASK_SIZE);
	DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28);
#endif /* ! CONFIG_PPC64 */

	/* datapage offsets for use by vdso */
	DEFINE(CFG_TB_ORIG_STAMP, offsetof(struct vdso_data, tb_orig_stamp));
	DEFINE(CFG_TB_TICKS_PER_SEC, offsetof(struct vdso_data, tb_ticks_per_sec));
	DEFINE(CFG_TB_TO_XS, offsetof(struct vdso_data, tb_to_xs));
	DEFINE(CFG_STAMP_XSEC, offsetof(struct vdso_data, stamp_xsec));
	DEFINE(CFG_TB_UPDATE_COUNT, offsetof(struct vdso_data, tb_update_count));
	DEFINE(CFG_TZ_MINUTEWEST, offsetof(struct vdso_data, tz_minuteswest));
	DEFINE(CFG_TZ_DSTTIME, offsetof(struct vdso_data, tz_dsttime));
	DEFINE(CFG_SYSCALL_MAP32, offsetof(struct vdso_data, syscall_map_32));
	DEFINE(WTOM_CLOCK_SEC, offsetof(struct vdso_data, wtom_clock_sec));
	DEFINE(WTOM_CLOCK_NSEC, offsetof(struct vdso_data, wtom_clock_nsec));
#ifdef CONFIG_PPC64
	DEFINE(CFG_SYSCALL_MAP64, offsetof(struct vdso_data, syscall_map_64));
	DEFINE(TVAL64_TV_SEC, offsetof(struct timeval, tv_sec));
	DEFINE(TVAL64_TV_USEC, offsetof(struct timeval, tv_usec));
	DEFINE(TVAL32_TV_SEC, offsetof(struct compat_timeval, tv_sec));
	DEFINE(TVAL32_TV_USEC, offsetof(struct compat_timeval, tv_usec));
	DEFINE(TSPC64_TV_SEC, offsetof(struct timespec, tv_sec));
	DEFINE(TSPC64_TV_NSEC, offsetof(struct timespec, tv_nsec));
	DEFINE(TSPC32_TV_SEC, offsetof(struct compat_timespec, tv_sec));
	DEFINE(TSPC32_TV_NSEC, offsetof(struct compat_timespec, tv_nsec));
#else
	DEFINE(TVAL32_TV_SEC, offsetof(struct timeval, tv_sec));
	DEFINE(TVAL32_TV_USEC, offsetof(struct timeval, tv_usec));
	DEFINE(TSPC32_TV_SEC, offsetof(struct timespec, tv_sec));
	DEFINE(TSPC32_TV_NSEC, offsetof(struct timespec, tv_nsec));
#endif
	/* timeval/timezone offsets for use by vdso */
	DEFINE(TZONE_TZ_MINWEST, offsetof(struct timezone, tz_minuteswest));
	DEFINE(TZONE_TZ_DSTTIME, offsetof(struct timezone, tz_dsttime));

	/* Other bits used by the vdso */
	DEFINE(CLOCK_REALTIME, CLOCK_REALTIME);
	DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC);
	DEFINE(NSEC_PER_SEC, NSEC_PER_SEC);
	DEFINE(CLOCK_REALTIME_RES, TICK_NSEC);

	return 0;
}


text:
import os
from setuptools import setup, find_packages

# ----------------------------------------------------------------------------
# Building
#
# Create source distribution:
# ./setup.py sdist
#
#
# Create binary distribution (non-univeral, python 3 only):
# ./setup.py bdist_wheel --python-tag=py3
#
# Register on PyPI:
# twine register dist/mypkg.whl
#
#
# Upload to PyPI:
# twine upload dist/*
#
# ----------------------------------------------------------------------------

# project version
version = '0.0.8'

# development status
# dev_status = '1 - Planning'
# dev_status = '2 - Pre-Alpha'
dev_status = '3 - Alpha'
# dev_status = '4 - Beta'
# dev_status = '5 - Production/Stable'
# dev_status = '6 - Mature'
# dev_status = '7 - Inactive'

# github repository url
repo = 'https://github.com/projectshift/shift-memory'
license_type = 'MIT License'

# monkey patch os for vagrant hardlinks
del os.link

# run setup
setup(**dict(

    # author
    author='Dmitry Belyakov',
    author_email='dmitrybelyakov@gmail.com',

    # project meta
    name='shiftmemory',
    version=version,
    url=repo,
    download_url=repo + '/archive/v' + version + '.tar.gz',
    description='Python3 cache library',
    keywords=[
        'python3',
        'cache',
        'redis',
    ],

    # classifiers
    # see: https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[

        # maturity
        'Development Status :: ' + dev_status,

        # license
        'License :: OSI Approved :: ' + license_type,

        # audience
        'Intended Audience :: Developers',
        'Intended Audience :: Information Technology',

        # pythons
        'Programming Language :: Python :: 3',

        # categories
        'Environment :: Console',
        'Environment :: Web Environment',
        'Topic :: Software Development :: Libraries',
        'Topic :: Utilities'
    ],

    # project packages
    packages=find_packages(exclude=['tests*']),

    # include none-code data files from manifest.in (http://goo.gl/Uf0Yxc)
    include_package_data=True,

    # project dependencies
    install_requires=[
        'click>=7.0,<8.0',
        'redis>=3.2.1,<4.0.0',
        'hiredis>=1.0.0,<2.0.0',
        'arrow>=0.13.1,<1.0.0'
    ],

    # entry points
    entry_points=dict(
        console_scripts=[
            'shiftmemory = shiftmemory.cli.console:cli'
        ]
    ),

    # project license
    license=license_type
))


text:
package org.conqat.engine.graph.nodes;

import org.conqat.engine.commons.ConQATParamDoc;
import org.conqat.engine.commons.ConQATPipelineProcessorBase;
import org.conqat.engine.commons.node.IConQATNode;
import org.conqat.engine.commons.node.NodeUtils;
import org.conqat.engine.commons.traversal.TraversalUtils;
import org.conqat.engine.commons.util.ValueCopier;
import org.conqat.engine.core.core.AConQATAttribute;
import org.conqat.engine.core.core.AConQATParameter;
import org.conqat.engine.core.core.AConQATProcessor;

/**
 * Copies values from a source tree into a graph.
 * <p>
 * This class works similar to the {@link ValueCopier}, but copies values into
 * {@link ConQATGraph} nodes instead of arbitrary {@link IConQATNode}s.
 *
 * @author Elmar Juergens
 * @author juergens
 * @author $Author: deissenb $
 * @version $Rev: 35147 $
 * @ConQAT.Rating GREEN Hash: 24923D1575B1F2B776D3F869BCA7B24B
 */
@AConQATProcessor(description = "Copies values from a source tree into a graph.")
public class GraphTargetingValueCopier extends
		ConQATPipelineProcessorBase<ConQATGraph> {

	/** Source tree from which values are read */
	private IConQATNode source;

	/** Key that holds target vertex id */
	private String targetNodeIdKey;

	/** Key that gets copied */
	private String copyKey;

	/** ConQAT Parameter */
	@AConQATParameter(name = "source", description = "ConQAT nodes from which values are read", minOccurrences = 1, maxOccurrences = 1)
	public void setInput(
			@AConQATAttribute(name = ConQATParamDoc.INPUT_REF_NAME, description = ConQATParamDoc.INPUT_REF_DESC)
			IConQATNode source) {
		this.source = source;
	}

	/** ConQAT Parameter */
	@AConQATParameter(name = "target", description = "Key that holds the id of the node into which value gets copied", minOccurrences = 1, maxOccurrences = 1)
	public void setTargetNodeIdKey(
			@AConQATAttribute(name = "key", description = "Key that holds the id of the node into which value gets copied")
			String targetNodeIdKey) {
		this.targetNodeIdKey = targetNodeIdKey;
	}

	/** ConQAT Parameter */
	@AConQATParameter(name = "copy", description = "Key that gets copied from source node to target vertex", minOccurrences = 1, maxOccurrences = 1)
	public void setCopyKey(
			@AConQATAttribute(name = "key", description = "Key that gets copied from source node to target vertex")
			String copyKey) {
		this.copyKey = copyKey;
	}

	/** Copy values from source tree into graph */
	@Override
	protected void processInput(ConQATGraph graph) {
		NodeUtils.addToDisplayList(graph, copyKey);

		for (IConQATNode node : TraversalUtils.listAllDepthFirst(source)) {
			Object targetNodeId = node.getValue(targetNodeIdKey);
			if (targetNodeId != null) {
				ConQATVertex targetVertex = graph.getVertexByID(targetNodeId
						.toString());

				if (targetVertex == null) {
					getLogger()
							.warn("Vertex '" + targetNodeId + "' not found!");
				} else {
					targetVertex.setUserDatum(copyKey, node.getValue(copyKey),
							DeepCloneCopyAction.getInstance());
				}
			}
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="onCreateDB">create table preferences (_id integer primary key autoincrement, val text not null);</string>
</resources>