identifier
stringlengths
42
383
collection
stringclasses
1 value
open_type
stringclasses
1 value
license
stringlengths
0
1.81k
date
float64
1.99k
2.02k
title
stringlengths
0
100
creator
stringlengths
1
39
language
stringclasses
157 values
language_type
stringclasses
2 values
word_count
int64
1
20k
token_count
int64
4
1.32M
text
stringlengths
5
1.53M
__index_level_0__
int64
0
57.5k
https://github.com/ebrocamora/rizlife/blob/master/public/js/resources_js_Pages_Luzon_Rizal-Park_vue.js
Github Open Source
Open Source
MIT
null
rizlife
ebrocamora
JavaScript
Code
570
3,262
(self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_Pages_Luzon_Rizal-Park_vue"],{ /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=script&lang=js&": /*!******************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=script&lang=js& ***! \******************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({}); /***/ }), /***/ "./resources/js/Pages/Luzon/Rizal-Park.vue": /*!*************************************************!*\ !*** ./resources/js/Pages/Luzon/Rizal-Park.vue ***! \*************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Rizal_Park_vue_vue_type_template_id_90bc2d1e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Rizal-Park.vue?vue&type=template&id=90bc2d1e& */ "./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=template&id=90bc2d1e&"); /* harmony import */ var _Rizal_Park_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Rizal-Park.vue?vue&type=script&lang=js& */ "./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=script&lang=js&"); /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); /* normalize component */ ; var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__.default)( _Rizal_Park_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__.default, _Rizal_Park_vue_vue_type_template_id_90bc2d1e___WEBPACK_IMPORTED_MODULE_0__.render, _Rizal_Park_vue_vue_type_template_id_90bc2d1e___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns, false, null, null, null ) /* hot reload */ if (false) { var api; } component.options.__file = "resources/js/Pages/Luzon/Rizal-Park.vue" /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports); /***/ }), /***/ "./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=script&lang=js&": /*!**************************************************************************!*\ !*** ./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=script&lang=js& ***! \**************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Rizal_Park_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Rizal-Park.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=script&lang=js&"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_clonedRuleSet_5_0_rules_0_use_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Rizal_Park_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__.default); /***/ }), /***/ "./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=template&id=90bc2d1e&": /*!********************************************************************************!*\ !*** ./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=template&id=90bc2d1e& ***! \********************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Rizal_Park_vue_vue_type_template_id_90bc2d1e___WEBPACK_IMPORTED_MODULE_0__.render), /* harmony export */ "staticRenderFns": () => (/* reexport safe */ _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Rizal_Park_vue_vue_type_template_id_90bc2d1e___WEBPACK_IMPORTED_MODULE_0__.staticRenderFns) /* harmony export */ }); /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Rizal_Park_vue_vue_type_template_id_90bc2d1e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Rizal-Park.vue?vue&type=template&id=90bc2d1e& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=template&id=90bc2d1e&"); /***/ }), /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=template&id=90bc2d1e&": /*!***********************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options!./resources/js/Pages/Luzon/Rizal-Park.vue?vue&type=template&id=90bc2d1e& ***! \***********************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "render": () => (/* binding */ render), /* harmony export */ "staticRenderFns": () => (/* binding */ staticRenderFns) /* harmony export */ }); var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c("div", { staticClass: "relative" }, [ _c( "div", { staticClass: "fixed h-full w-full top-0 left-0 select-none z-10" }, [ _c("div", { staticClass: "absolute z-20 w-full h-full bg-black bg-opacity-50" }), _vm._v(" "), _c("img", { staticClass: "w-full h-full object-cover", attrs: { src: "/images/luzon/background/Rizal%20Park.jpg" } }) ] ), _vm._v(" "), _c( "div", { staticClass: "relative md:absolute top-0 z-20 md:h-screen w-full md:-my-20 flex flex-col md:flex-row justify-center items-center gap-4" }, [ _c("div", { staticClass: "flex-1" }, [ _c("img", { staticClass: "w-full h-auto shadow-xl mx-auto", attrs: { src: "/images/luzon/Rizal%20Park.jpg" } }) ]), _vm._v(" "), _vm._m(0) ] ) ]) } var staticRenderFns = [ function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h return _c("div", { staticClass: "flex-1 px-4" }, [ _c("h1", { staticClass: "text-3xl font-bold text-yellow-500 mb-8" }, [ _vm._v("\n \t\t\t\tRizal Park\n \t\t\t") ]), _vm._v(" "), _c("p", { staticClass: "text-white" }, [ _vm._v( "\n \t\t\t\tRizal Park also known as Luneta Park or simply Luneta, is a historical urban park in the Philippines. Located along Roxas Boulevard, Manila, adjacent to the old walled city of Intramuros, it is one of the largest urban parks in Asia.\n \t\t\t" ) ]) ]) } ] render._withStripped = true /***/ }) }]);
4,650
https://github.com/Game-Designing/Custom-Football-Game/blob/master/sources/com/fasterxml/jackson/databind/deser/impl/ObjectIdReferenceProperty.java
Github Open Source
Open Source
MIT
2,019
Custom-Football-Game
Game-Designing
Java
Code
331
1,224
package com.fasterxml.jackson.databind.deser.impl; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationConfig; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.PropertyName; import com.fasterxml.jackson.databind.deser.NullValueProvider; import com.fasterxml.jackson.databind.deser.SettableBeanProperty; import com.fasterxml.jackson.databind.deser.UnresolvedForwardReference; import com.fasterxml.jackson.databind.deser.impl.ReadableObjectId.Referring; import com.fasterxml.jackson.databind.introspect.AnnotatedMember; import com.fasterxml.jackson.databind.introspect.ObjectIdInfo; import java.io.IOException; public class ObjectIdReferenceProperty extends SettableBeanProperty { private final SettableBeanProperty _forward; public static final class PropertyReferring extends Referring { private final ObjectIdReferenceProperty _parent; public final Object _pojo; public PropertyReferring(ObjectIdReferenceProperty parent, UnresolvedForwardReference ref, Class<?> type, Object ob) { super(ref, type); this._parent = parent; this._pojo = ob; } public void handleResolvedForwardReference(Object id, Object value) throws IOException { if (hasId(id)) { this._parent.set(this._pojo, value); return; } StringBuilder sb = new StringBuilder(); sb.append("Trying to resolve a forward reference with id ["); sb.append(id); sb.append("] that wasn't previously seen as unresolved."); throw new IllegalArgumentException(sb.toString()); } } public ObjectIdReferenceProperty(SettableBeanProperty forward, ObjectIdInfo objectIdInfo) { super(forward); this._forward = forward; this._objectIdInfo = objectIdInfo; } public ObjectIdReferenceProperty(ObjectIdReferenceProperty src, JsonDeserializer<?> deser, NullValueProvider nva) { super(src, deser, nva); this._forward = src._forward; this._objectIdInfo = src._objectIdInfo; } public ObjectIdReferenceProperty(ObjectIdReferenceProperty src, PropertyName newName) { super(src, newName); this._forward = src._forward; this._objectIdInfo = src._objectIdInfo; } public SettableBeanProperty withName(PropertyName newName) { return new ObjectIdReferenceProperty(this, newName); } public SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser) { if (this._valueDeserializer == deser) { return this; } return new ObjectIdReferenceProperty(this, deser, this._nullProvider); } public SettableBeanProperty withNullProvider(NullValueProvider nva) { return new ObjectIdReferenceProperty(this, this._valueDeserializer, nva); } public void fixAccess(DeserializationConfig config) { SettableBeanProperty settableBeanProperty = this._forward; if (settableBeanProperty != null) { settableBeanProperty.fixAccess(config); } } public AnnotatedMember getMember() { return this._forward.getMember(); } public int getCreatorIndex() { return this._forward.getCreatorIndex(); } public void deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException { deserializeSetAndReturn(p, ctxt, instance); } public Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException { try { return setAndReturn(instance, deserialize(p, ctxt)); } catch (UnresolvedForwardReference reference) { if ((this._objectIdInfo == null && this._valueDeserializer.getObjectIdReader() == null) ? false : true) { reference.getRoid().appendReferring(new PropertyReferring(this, reference, this._type.getRawClass(), instance)); return null; } throw JsonMappingException.from(p, "Unresolved forward reference but no identity info", (Throwable) reference); } } public void set(Object instance, Object value) throws IOException { this._forward.set(instance, value); } public Object setAndReturn(Object instance, Object value) throws IOException { return this._forward.setAndReturn(instance, value); } }
33,276
https://github.com/leonard-henriquez/SuricatExtension/blob/master/src/js/modules/scrapper.js
Github Open Source
Open Source
Unlicense
2,018
SuricatExtension
leonard-henriquez
JavaScript
Code
176
608
import $ from 'jquery'; const basisSelector = '.job-offer-container'; const scrapContent = (url, stars) => { if ($(basisSelector).length === 0) { console.log('No opportunity found on the page'); return false; } const data = { url, stars }; let title; let content; const cssSelectors = { title: '.job-offer-top--title', company_name: '.job-offer-top--company-name', contract_type: '.job-offer-top--infos span:nth-child(1)', location: '.job-offer-top--infos span:nth-child(2)', job_description: '.job-offer-container--text', }; $.each(cssSelectors, (k, v) => { content = $(`${basisSelector} ${v}`); if (content) { data[k] = content.html(); } }); $(`${basisSelector} .job-offer-details > ul > li`).each((i, e) => { title = $(e).children('h6').text(); content = $(e).children('p').text(); if (title === 'Start date') { data.start_date = content; } else if (title === 'Related jobs') { data.job_name = content; } else if (title === 'Business type') { data.company_structure = content; } else if (title === 'Industries') { data.sector_name = content; } }); data.logo = $('meta[property="og:image"]').attr('content'); const regexes = { salary: /\d[ \d]{1,5}(?:,\d{2})?[€$£]|[$£][ ,\d]{2,6}(?:.\d{2})?/, email: /\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}/ }; $.each(regexes, (k, v) => { content = v.exec(data.job_description); if (content) { data[k] = content[0]; } }); console.log(data); return data; }; const scrapper = { scrapContent, basisSelector }; export default scrapper;
25,688
https://github.com/hutuxian/Paddle/blob/master/paddle/scripts/build_docker_images.sh
Github Open Source
Open Source
Apache-2.0
2,020
Paddle
hutuxian
Shell
Code
80
824
#!/bin/sh set -xe REPO="${REPO:-paddlepaddle}" cp -f ../../python/requirements.txt . sed 's#FROM nvidia/cuda:8.0-cudnn7-devel-ubuntu16.04#FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04#g' ../../Dockerfile | sed 's#TensorRT-4.0.1.6-ubuntu14.04.x86_64-gnu.cuda.8.0.cudnn7.0.tar.gz#TensorRT-6.0.1.5.Ubuntu-16.04.x86_64-gnu.cuda-9.0.cudnn7.6.tar.gz#g' | sed 's#/usr/local/TensorRT#/usr/local/TensorRT-6.0.1.5#g' | sed 's#libnccl2=2.1.2-1+cuda8.0 libnccl-dev=2.1.2-1+cuda8.0#libnccl2=2.4.7-1+cuda9.0 libnccl-dev=2.4.7-1+cuda9.0#g' | sed 's#COPY ./paddle/scripts/docker/root/#COPY ./docker/root/#g' | sed 's#COPY ./python/requirements.txt#COPY ./requirements.txt#' > Dockerfile.cuda9.0-cudnn7 # docker build -t ${REPO}/paddle:cuda9.0-cudnn7-devel-ubuntu16.04 -f Dockerfile.cuda9.0-cudnn7 . sed 's#FROM nvidia/cuda:8.0-cudnn7-devel-ubuntu16.04#FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04#g' ../../Dockerfile | sed 's#TensorRT-4.0.1.6-ubuntu14.04.x86_64-gnu.cuda.8.0.cudnn7.0.tar.gz#TensorRT_5.1_ga_cuda10_cudnnv7.5.tar.gz#g' | sed 's#/usr/local/TensorRT#/usr/local/TensorRT_5.1_ga_cuda10_cudnnv7.5#g' | sed 's#libnccl2=2.1.2-1+cuda8.0 libnccl-dev=2.1.2-1+cuda8.0#libnccl2=2.4.7-1+cuda10.0 libnccl-dev=2.4.7-1+cuda10.0#g' | sed 's#COPY ./paddle/scripts/docker/root/#COPY ./docker/root/#g' | sed 's#COPY ./python/requirements.txt#COPY ./requirements.txt#' > Dockerfile.cuda10.0-cudnn7 # docker build -t ${REPO}/paddle:cuda10.0-cudnn7-devel-ubuntu16.04 -f Dockerfile.cuda10.0-cudnn7 .
50,233
https://github.com/Art31/pytorch-seq2seq/blob/master/2 - Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation.py
Github Open Source
Open Source
MIT
null
pytorch-seq2seq
Art31
Python
Code
1,028
3,239
import torch import torch.nn as nn import torch.optim as optim from torch import Tensor from torchtext.datasets import TranslationDataset, Multi30k from torchtext.data import Field, BucketIterator import spacy import random import math import time SEED = 1234 random.seed(SEED) torch.manual_seed(SEED) torch.backends.cudnn.deterministic = True spacy_de = spacy.load('de_core_news_md') spacy_en = spacy.load('en_core_web_md') def tokenize_de(text): """ Tokenizes German text from a string into a list of strings """ return [tok.text for tok in spacy_de.tokenizer(text)] def tokenize_en(text): """ Tokenizes English text from a string into a list of strings """ return [tok.text for tok in spacy_en.tokenizer(text)] SRC = Field(tokenize=tokenize_de, init_token='<sos>', eos_token='<eos>', lower=True) TRG = Field(tokenize = tokenize_en, init_token='<sos>', eos_token='<eos>', lower=True) train_data, valid_data, test_data = Multi30k.splits(exts = ('.de', '.en'), fields = (SRC, TRG)) print(vars(train_data.examples[0])) SRC.build_vocab(train_data, min_freq = 2) TRG.build_vocab(train_data, min_freq = 2) device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') # BATCH_SIZE = 128 BATCH_SIZE = 8 train_iterator, valid_iterator, test_iterator = BucketIterator.splits( (train_data, valid_data, test_data), batch_size = BATCH_SIZE, device = device) class Encoder(nn.Module): def __init__(self, input_dim: int, emb_dim: int, hid_dim: int, dropout: float): super().__init__() self.input_dim = input_dim self.emb_dim = emb_dim self.hid_dim = hid_dim self.dropout = dropout self.embedding = nn.Embedding(input_dim, emb_dim) #no dropout as only one layer! self.rnn = nn.GRU(emb_dim, hid_dim) self.dropout = nn.Dropout(dropout) def forward(self, src): #src = [src sent len, batch size] embedded = self.dropout(self.embedding(src)) #embedded = [src sent len, batch size, emb dim] outputs, hidden = self.rnn(embedded) #no cell state! #outputs = [src sent len, batch size, hid dim * n directions] #hidden = [n layers * n directions, batch size, hid dim] #outputs are always from the top hidden layer return hidden class Decoder(nn.Module): def __init__(self, output_dim: int, emb_dim: int, hid_dim: int, dropout: float): super().__init__() self.emb_dim = emb_dim self.hid_dim = hid_dim self.output_dim = output_dim self.dropout = dropout self.embedding = nn.Embedding(output_dim, emb_dim) self.rnn = nn.GRU(emb_dim + hid_dim, hid_dim) self.out = nn.Linear(emb_dim + hid_dim * 2, output_dim) self.dropout = nn.Dropout(dropout) def forward(self, input: Tensor, hidden: Tensor, context: Tensor): #input = [batch size] #hidden = [n layers * n directions, batch size, hid dim] #context = [n layers * n directions, batch size, hid dim] #n layers and n directions in the decoder will both always be 1, therefore: #hidden = [1, batch size, hid dim] #context = [1, batch size, hid dim] input = input.unsqueeze(0) #input = [1, batch size] embedded = self.dropout(self.embedding(input)) #embedded = [1, batch size, emb dim] emb_con = torch.cat((embedded, context), dim = 2) #emb_con = [1, batch size, emb dim + hid dim] output, hidden = self.rnn(emb_con, hidden) #output = [sent len, batch size, hid dim * n directions] #hidden = [n layers * n directions, batch size, hid dim] #sent len, n layers and n directions will always be 1 in the decoder, therefore: #output = [1, batch size, hid dim] #hidden = [1, batch size, hid dim] output = torch.cat((embedded.squeeze(0), hidden.squeeze(0), context.squeeze(0)), dim = 1) #output = [batch size, emb dim + hid dim * 2] prediction = self.out(output) #prediction = [batch size, output dim] return prediction, hidden class Seq2Seq(nn.Module): def __init__(self, encoder: nn.Module, decoder: nn.Module, device: torch.device): super().__init__() self.encoder = encoder self.decoder = decoder self.device = device assert encoder.hid_dim == decoder.hid_dim, \ "Hidden dimensions of encoder and decoder must be equal!" def forward(self, src: Tensor, trg: Tensor, teacher_forcing_ratio = 0.5): #src = [src sent len, batch size] #trg = [trg sent len, batch size] #teacher_forcing_ratio is probability to use teacher forcing #e.g. if teacher_forcing_ratio is 0.75 we use ground-truth inputs 75% of the time batch_size = trg.shape[1] max_len = trg.shape[0] trg_vocab_size = self.decoder.output_dim #tensor to store decoder outputs outputs = torch.zeros(max_len, batch_size, trg_vocab_size).to(self.device) #last hidden state of the encoder is the context context = self.encoder(src) #context also used as the initial hidden state of the decoder hidden = context #first input to the decoder is the <sos> tokens input = trg[0,:] for t in range(1, max_len): output, hidden = self.decoder(input, hidden, context) # input and hidden are new, context is fixed outputs[t] = output teacher_force = random.random() < teacher_forcing_ratio top1 = output.max(1)[1] input = (trg[t] if teacher_force else top1) return outputs INPUT_DIM = len(SRC.vocab) OUTPUT_DIM = len(TRG.vocab) ENC_EMB_DIM = 256 DEC_EMB_DIM = 256 HID_DIM = 512 ENC_DROPOUT = 0.5 DEC_DROPOUT = 0.5 enc = Encoder(INPUT_DIM, ENC_EMB_DIM, HID_DIM, ENC_DROPOUT) dec = Decoder(OUTPUT_DIM, DEC_EMB_DIM, HID_DIM, DEC_DROPOUT) device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') model = Seq2Seq(enc, dec, device).to(device) def init_weights(m): for name, param in m.named_parameters(): nn.init.normal_(param.data, mean=0, std=0.01) model.apply(init_weights) def count_parameters(model): return sum(p.numel() for p in model.parameters() if p.requires_grad) print(f'The model has {count_parameters(model):,} trainable parameters') optimizer = optim.Adam(model.parameters()) PAD_IDX = TRG.vocab.stoi['<pad>'] criterion = nn.CrossEntropyLoss(ignore_index = PAD_IDX) def train(model: nn.Module, iterator: BucketIterator, optimizer: optim.Adam, criterion: nn.modules.loss.CrossEntropyLoss, clip: float): model.train() epoch_loss = 0 for i, batch in enumerate(iterator): src = batch.src trg = batch.trg optimizer.zero_grad() output = model(src, trg) #trg = [trg sent len, batch size] #output = [trg sent len, batch size, output dim] output = output[1:].view(-1, output.shape[-1]) trg = trg[1:].view(-1) #trg = [(trg sent len - 1) * batch size] #output = [(trg sent len - 1) * batch size, output dim] loss = criterion(output, trg) loss.backward() torch.nn.utils.clip_grad_norm_(model.parameters(), clip) optimizer.step() epoch_loss += loss.item() return epoch_loss / len(iterator) def evaluate(model: nn.Module, iterator: BucketIterator, criterion: nn.modules.loss.CrossEntropyLoss): model.eval() epoch_loss = 0 with torch.no_grad(): for i, batch in enumerate(iterator): src = batch.src trg = batch.trg output = model(src, trg, 0) #turn off teacher forcing #trg = [trg sent len, batch size] #output = [trg sent len, batch size, output dim] output = output[1:].view(-1, output.shape[-1]) trg = trg[1:].view(-1) #trg = [(trg sent len - 1) * batch size] #output = [(trg sent len - 1) * batch size, output dim] loss = criterion(output, trg) epoch_loss += loss.item() return epoch_loss / len(iterator) def epoch_time(start_time: int, end_time: int): elapsed_time = end_time - start_time elapsed_mins = int(elapsed_time / 60) elapsed_secs = int(elapsed_time - (elapsed_mins * 60)) return elapsed_mins, elapsed_secs N_EPOCHS = 10 CLIP = 1 best_valid_loss = float('inf') for epoch in range(N_EPOCHS): start_time = time.time() train_loss = train(model, train_iterator, optimizer, criterion, CLIP) valid_loss = evaluate(model, valid_iterator, criterion) end_time = time.time() epoch_mins, epoch_secs = epoch_time(start_time, end_time) if valid_loss < best_valid_loss: best_valid_loss = valid_loss torch.save(model.state_dict(), 'tut2-model.pt') print(f'Epoch: {epoch+1:02} | Time: {epoch_mins}m {epoch_secs}s') print(f'\tTrain Loss: {train_loss:.3f} | Train PPL: {math.exp(train_loss):7.3f}') print(f'\t Val. Loss: {valid_loss:.3f} | Val. PPL: {math.exp(valid_loss):7.3f}') model.load_state_dict(torch.load('tut2-model.pt')) test_loss = evaluate(model, test_iterator, criterion) print(f'| Test Loss: {test_loss:.3f} | Test PPL: {math.exp(test_loss):7.3f} |')
41,035
https://github.com/mellistibco/cli/blob/master/util/engine.go
Github Open Source
Open Source
BSD-3-Clause
null
cli
mellistibco
Go
Code
490
1,383
package util import ( "encoding/json" "fmt" "io/ioutil" "os" "strings" ) // PartialEngineDescriptor is the descriptor for a Flogo application type PartialEngineDescriptor struct { Imports []string `json:"imports"` Services []*EngineServiceDetails `json:"services"` } type EngineServiceDetails struct { Ref string } type EngineImportDetails struct { Imp Import TopLevel bool // a toplevel import i.e. from imports section ServiceRef bool // imports is used by a service HasAliasRef bool // imports alias is used by a contrib reference HasDirectRef bool // a direct reference exists for this import } type EngineImports struct { imports map[string]*EngineImportDetails orphanedRef map[string]void depManager DepManager } func (ai *EngineImports) addImports(imports []string) error { for _, anImport := range imports { flogoImport, err := ParseImport(anImport) if err != nil { return err } if _, exists := ai.imports[flogoImport.GoImportPath()]; exists { //todo warn about duplicate import? continue } details := &EngineImportDetails{Imp: flogoImport, TopLevel:true} ai.imports[flogoImport.GoImportPath()] = details } return nil } func (ai *EngineImports) addReference(ref string, isService bool) error { cleanedRef := strings.TrimSpace(ref) if cleanedRef[0] == '#' { alias := cleanedRef[1:] found := false for _, importDetails := range ai.imports { if importDetails.TopLevel { // alias refs can only be to toplevel imports if importDetails.Imp.CanonicalAlias() == alias { importDetails.HasAliasRef = true importDetails.ServiceRef = isService found = true break } } } if !found { ai.orphanedRef[cleanedRef] = void{} } } else { flogoImport, err := ParseImport(ref) if err != nil { return err } if imp, exists := ai.imports[flogoImport.GoImportPath()]; exists { if !imp.TopLevel { //already accounted for return nil } imp.HasDirectRef = true imp.ServiceRef = true return nil } //doesn't exists so add new import details := &EngineImportDetails{Imp: flogoImport, ServiceRef:isService} ai.imports[flogoImport.GoImportPath()] = details } return nil } func (ai *EngineImports) GetOrphanedReferences() []string { var refs []string for ref := range ai.orphanedRef { refs = append(refs, ref) } return refs } func (ai *EngineImports) GetAllImports() []Import { var allImports []Import for _, details := range ai.imports { allImports = append(allImports, details.Imp) } return allImports } func (ai *EngineImports) GetAllImportDetails() []*EngineImportDetails { var allImports []*EngineImportDetails for _, details := range ai.imports { allImports = append(allImports, details) } return allImports } func GetEngineImports(engJsonFile string, depManager DepManager) (*EngineImports, error) { engJson, err := os.Open(engJsonFile) if err != nil { return nil, err } bytes, err := ioutil.ReadAll(engJson) if err != nil { return nil, err } engDesc := &PartialEngineDescriptor{} err = json.Unmarshal(bytes, engDesc) if err != nil { fmt.Fprintf(os.Stderr, "Unable to unmarshal flogo engine json: %s", engJsonFile) return nil, err } imports := make(map[string]void) if len(engDesc.Imports) > 0 { for _, imp := range engDesc.Imports { imports[imp] = void{} } } if len(engDesc.Services) > 0 { for _, service := range engDesc.Services { imports[service.Ref] = void{} } } ai := &EngineImports{depManager: depManager} ai.imports = make(map[string]*EngineImportDetails) ai.orphanedRef = make(map[string]void) err = ai.addImports(engDesc.Imports) if err != nil { return nil, err } // add service refs/imports for _, serviceDetails := range engDesc.Services { err := ai.addReference(serviceDetails.Ref, true) if err != nil { return nil, err } } return ai, err }
38,105
https://github.com/asultan123/ADP/blob/master/train_cifar.py
Github Open Source
Open Source
Apache-2.0
null
ADP
asultan123
Python
Code
782
2,604
from __future__ import print_function from enum import Flag import tensorflow as tf from tensorflow.keras.layers import Dense, Conv2D, BatchNormalization, Activation from tensorflow.keras.layers import AveragePooling2D, Input, Flatten from tensorflow.keras.optimizers import Adam, SGD from tensorflow.keras.callbacks import ModelCheckpoint, LearningRateScheduler from tensorflow.keras.callbacks import ReduceLROnPlateau from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.regularizers import l2 from tensorflow.keras import backend as K from tensorflow.keras.models import Model from tensorflow.keras.datasets import cifar10, cifar100 from tensorflow.keras.models import load_model import numpy as np import os from model import resnet_v1 from utils import * import random random.seed(FLAGS.seed) np.random.seed(FLAGS.seed) tf.random.set_seed(FLAGS.seed) # Training parameters epochs = 200 # Subtracting pixel mean improves accuracy subtract_pixel_mean = True # Computed depth from supplied model parameter n n = 5 depth = n * 6 + 2 version = 1 # Model name, depth and version model_type = "ResNet%dv%d" % (depth, version) # Load the data. if FLAGS.dataset == "cifar10": (x_train, y_train), (x_test, y_test) = cifar10.load_data() elif FLAGS.dataset == "cifar100": (x_train, y_train), (x_test, y_test) = cifar100.load_data(label_mode="fine") # Input image dimensions. input_shape = x_train.shape[1:] # Normalize data. x_train = x_train.astype("float32") / 255 x_test = x_test.astype("float32") / 255 # If subtract pixel mean is enabled if subtract_pixel_mean: x_train_mean = np.mean(x_train, axis=0) x_train -= x_train_mean x_test -= x_train_mean print("x_train shape:", x_train.shape) print(x_train.shape[0], "train samples") print(x_test.shape[0], "test samples") print("y_train shape:", y_train.shape) # Convert class vectors to binary class matrices. y_train = tf.keras.utils.to_categorical(y_train, num_classes) y_test = tf.keras.utils.to_categorical(y_test, num_classes) def lr_schedule(epoch): """Learning Rate Schedule Learning rate is scheduled to be reduced after 80, 120, 160, 180 epochs. Called automatically every epoch as part of callbacks during training. # Arguments epoch (int): The number of epochs # Returns lr (float32): learning rate """ lr = 1e-3 if epoch > 150: lr *= 1e-2 elif epoch > 100: lr *= 1e-1 print("Learning rate: ", lr) return lr def create_model(): model_input = Input(shape=input_shape) model_dic = {} model_out = [] for i in range(FLAGS.num_models): model_dic[str(i)] = resnet_v1( input=model_input, depth=depth, num_classes=num_classes, dataset=FLAGS.dataset, ) model_out.append(model_dic[str(i)][2]) model_output = tf.keras.layers.concatenate(model_out) model = Model(inputs=model_input, outputs=model_output) initial_epoch = 0 return model, initial_epoch def load_last_model(): import re if FLAGS.model_dir == "": raise Exception( "Invalid args, need to know model directory to load model from last checkpoint" ) load_dir = os.path.join( FLAGS.model_dir, "seed_" + str(FLAGS.seed), ) load_dir = os.path.join( load_dir, FLAGS.dataset + "_EE_LED_saved_models" + str(FLAGS.num_models) + "_lamda" + str(FLAGS.lamda) + "_logdetlamda" + str(FLAGS.log_det_lamda) + "_" + str(FLAGS.augmentation), ) model_names = os.listdir(load_dir) last_epoch = max( [int(re.match("model+\.([0-9]+)", name).groups()[0]) for name in model_names] ) last_checkpointed_model_name = f"model.{last_epoch}.h5" load_path = os.path.join( load_dir, last_checkpointed_model_name, ) model = load_model(load_path, compile=False) return model, last_epoch model, initial_epoch = ( create_model() if not FLAGS.load_from_checkpoint else load_last_model() ) # Prepare model model saving directory. save_dir = os.path.join( os.getcwd() if FLAGS.model_dir == "" else FLAGS.model_dir, "seed_" + str(FLAGS.seed), ) save_dir = os.path.join( save_dir, FLAGS.dataset + "_EE_LED_saved_models" + str(FLAGS.num_models) + "_lamda" + str(FLAGS.lamda) + "_logdetlamda" + str(FLAGS.log_det_lamda) + "_" + str(FLAGS.augmentation), ) model_name = "model.{epoch:03d}.h5" if not os.path.isdir(save_dir): os.makedirs(save_dir) filepath = os.path.join(save_dir, model_name) model.compile( loss=Loss_withEE_DPP, optimizer=Adam(lr=lr_schedule(0)), metrics=[acc_metric, Ensemble_Entropy_metric, log_det_metric], ) model.summary() print(model_type) # Prepare callbacks for model saving and for learning rate adjustment. checkpoint = ModelCheckpoint( filepath=filepath, monitor="val_acc_metric", mode="max", verbose=2, save_best_only=True, ) lr_scheduler = LearningRateScheduler(lr_schedule) callbacks = [checkpoint, lr_scheduler] # Augment labels y_train_2 = [] y_test_2 = [] for _ in range(FLAGS.num_models): y_train_2.append(y_train) y_test_2.append(y_test) y_train_2 = np.concatenate(y_train_2, axis=-1) y_test_2 = np.concatenate(y_test_2, axis=-1) # Run training, with or without data augmentation. if not FLAGS.augmentation: print("Not using data augmentation.") model.fit( x_train, y_train_2, batch_size=FLAGS.batch_size, epochs=epochs, validation_data=(x_test, y_test_2), shuffle=True, verbose=1, callbacks=callbacks, initial_epoch=initial_epoch, ) else: print("Using real-time data augmentation.") # This will do preprocessing and realtime data augmentation: datagen = ImageDataGenerator( # set input mean to 0 over the dataset featurewise_center=False, # set each sample mean to 0 samplewise_center=False, # divide inputs by std of dataset featurewise_std_normalization=False, # divide each input by its std samplewise_std_normalization=False, # apply ZCA whitening zca_whitening=False, # epsilon for ZCA whitening zca_epsilon=1e-06, # randomly rotate images in the range (deg 0 to 180) rotation_range=0, # randomly shift images horizontally width_shift_range=0.1, # randomly shift images vertically height_shift_range=0.1, # set range for random shear shear_range=0.0, # set range for random zoom zoom_range=0.0, # set range for random channel shifts channel_shift_range=0.0, # set mode for filling points outside the input boundaries fill_mode="nearest", # value used for fill_mode = "constant" cval=0.0, # randomly flip images horizontal_flip=True, # randomly flip images vertical_flip=False, # set rescaling factor (applied before any other transformation) rescale=None, # set function that will be applied on each input preprocessing_function=None, # image data format, either "channels_first" or "channels_last" data_format=None, # fraction of images reserved for validation (strictly between 0 and 1) validation_split=0.0, ) # Compute quantities required for featurewise normalization # (std, mean, and principal components if ZCA whitening is applied). datagen.fit(x_train) # Fit the model on the batches generated by datagen.flow(). model.fit_generator( datagen.flow(x_train, y_train_2, batch_size=FLAGS.batch_size), validation_data=(x_test, y_test_2), epochs=epochs, initial_epoch=initial_epoch, verbose=1, workers=32, callbacks=callbacks, )
7,655
https://github.com/searayeah/sublime-snippets/blob/master/Courses/HSEPython/3 week/5.py
Github Open Source
Open Source
MIT
null
sublime-snippets
searayeah
Python
Code
12
28
a = float(input()) print(int(a) + int(2 * a - 2 * int(a)))
35,782
https://github.com/ymm-tech/easy-byte-coder/blob/master/client/runtime-common-api/src/main/java/io/manbang/easybytecoder/runtimecommonapi/log/EasyByteCoderLogger.java
Github Open Source
Open Source
MIT
2,022
easy-byte-coder
ymm-tech
Java
Code
56
175
package io.manbang.easybytecoder.runtimecommonapi.log; /** * @author GaoYang * 2018/12/23 */ public interface EasyByteCoderLogger { void debug(String var1); void debug(String format, Object arg); void debug(String format, Object arg1, Object arg2); void debug(String format, Object... arguments); void info(String var1); void warn(String var1); void error(String var1); void error(String var1, Throwable e); void error(String format, Object... arguments); void trace(String var1); }
18,956
https://github.com/iOS-NSC/My-iOS-Programme/blob/master/虎牙直播1.1 5/虎牙直播1.1/GOViewController.h
Github Open Source
Open Source
Apache-2.0
2,016
My-iOS-Programme
iOS-NSC
Objective-C
Code
36
116
// // GOViewController.h // 虎牙直播1.1 // // Created by tarena04 on 16/5/18. // Copyright © 2016年 tarena. All rights reserved. // #import <UIKit/UIKit.h> @interface GOViewController : UIViewController + (UIButton *) setLeftNavigationBarButton; + (UIButton *) setRightNavigationBarButton; @end
25,482
https://github.com/shogo82148/schemalex-deploy/blob/master/model/table.go
Github Open Source
Open Source
MIT
2,022
schemalex-deploy
shogo82148
Go
Code
540
1,381
package model import "strings" // Table describes a table model type Table struct { Name Ident Temporary bool IfNotExists bool LikeTable MaybeIdent Columns []*TableColumn Indexes []*Index Options []*TableOption } // NewTable create a new table with the given name func NewTable(name Ident) *Table { return &Table{ Name: name, } } func (t *Table) ID() string { return "table#" + strings.ToLower(string(t.Name)) } func (t *Table) LookupColumn(id string) (*TableColumn, bool) { for _, col := range t.Columns { if col.ID() == id { return col, true } } return nil, false } func (t *Table) LookupColumnOrder(id string) (int, bool) { for i, col := range t.Columns { if col.ID() == id { return i, true } } return 0, false } func (t *Table) LookupColumnBefore(id string) (*TableColumn, bool) { for i, col := range t.Columns { if col.ID() == id { if i > 0 { return t.Columns[i-1], true } return nil, false } } return nil, false } func (t *Table) LookupIndex(id string) (*Index, bool) { for _, idx := range t.Indexes { if idx.ID() == id { return idx, true } } return nil, false } func (t *Table) Normalize() *Table { var additionalIndexes []*Index var columns []*TableColumn for _, col := range t.Columns { ncol := col.Normalize() // column_definition [UNIQUE [KEY] | [PRIMARY] KEY] // they mean same as INDEX or CONSTRAINT switch { case ncol.Primary: // we have to move off the index declaration from the // primary key column to an index associated with the table index := NewIndex(IndexKindPrimaryKey, t.ID()) index.Type = IndexTypeNone idxCol := NewIndexColumn(ncol.Name) index.Columns = append(index.Columns, idxCol) additionalIndexes = append(additionalIndexes, index) ncol.Primary = false case ncol.Unique: index := NewIndex(IndexKindUnique, t.ID()) // if you do not assign a name, the index is assigned the same name as the first indexed column index.Name.Valid = true index.Name.Ident = ncol.Name index.Type = IndexTypeNone idxCol := NewIndexColumn(ncol.Name) index.Columns = append(index.Columns, idxCol) additionalIndexes = append(additionalIndexes, index) ncol.Unique = false } columns = append(columns, ncol) } var indexes []*Index var seen = make(map[Ident]struct{}) for _, idx := range t.Indexes { nidx := idx.Normalize() // if Not defined CONSTRAINT symbol, then resolve // implicitly created INDEX too difficult. // (lestrrat) this comment is confusing. Please add // actual examples somewhere if nidx.Kind == IndexKindForeignKey && nidx.Symbol.Valid { // There's a chance the user has already explicitly declared the // index for this constraint. Only add this implicit index if we // haven't seen it before if _, ok := seen[nidx.Symbol.Ident]; !ok { // add implicitly created INDEX index := NewIndex(IndexKindNormal, t.ID()) index.Name = nidx.Symbol index.Type = nidx.Type index.Columns = make([]*IndexColumn, len(nidx.Columns)) copy(index.Columns, nidx.Columns) indexes = append(indexes, index) } } indexes = append(indexes, nidx) seen[nidx.Name.Ident] = struct{}{} } tbl := *t tbl.IfNotExists = t.IfNotExists tbl.Temporary = t.Temporary tbl.Indexes = append(additionalIndexes, indexes...) tbl.Columns = columns tbl.Options = make([]*TableOption, len(t.Options)) copy(tbl.Options, t.Options) return &tbl } // TableOption describes a possible table option, such as `ENGINE=InnoDB` type TableOption struct { Key string Value string NeedQuotes bool } // NewTableOption creates a new table option with the given name, value, and a flag indicating if quoting is necessary func NewTableOption(k, v string, q bool) *TableOption { return &TableOption{ Key: k, Value: v, NeedQuotes: q, } } func (opt *TableOption) ID() string { return "tableopt#" + strings.ToLower(opt.Key) }
6,785
https://github.com/wzpRoc/entitylinking/blob/master/Project/web/js/modules/subjectDefine.js
Github Open Source
Open Source
Apache-2.0
2,016
entitylinking
wzpRoc
JavaScript
Code
1,580
6,143
var cnt_basicRule = 0; var cnt_compositeRule = 0; // id到规则的映射 var map_id_to_basicRule = new Object(); var map_id_to_compositeRule = new Object(); // id到规则扩展数据的映射 var map_id_to_ruleExtData = new Object(); // 顶层规则计数 var cnt_topRule = 0; // 基本规则所占行数 var NR_ROWS_OF_BASIC_RULE = 3; /** * 基本规则的构造函数 */ function BasicRule(idInRuleSet, type, valueChar, valueInt, valueString) { this.idInRuleSet = idInRuleSet; this.type = type; this.valueChar = valueChar; this.valueInt = valueInt; this.valueString = valueString; this.checkBeforeSave = _checkBeforeSave; cnt_topRule++; } /** * 是否可保存 */ function _checkBeforeSave() { if(this.type == undefined || this.type == "" || this.type == 0) { alert("请选择规则类别!"); return false; } if(this.type == "languageId") { if(this.valueInt == undefined || this.valueInt == "" || this.valueInt == 0) { alert("请选择语种!"); return false; } } else if(this.type == "entityTypeId") { if(this.valueInt == undefined || this.valueInt == "" || this.valueInt == 0) { alert("请选择实体!"); return false; } } else if(this.type == "keyword") { if(this.valueString == undefined || this.valueString == "") { alert("请填写关键词!"); return false; } } return true; } /** * 创建空的基本规则 */ function createEmptyBasicRule(idInRuleSet) { return new BasicRule(idInRuleSet, "", " ", 0, ""); } /** * 复合规则的构造函数 */ function CompositeRule(idInRuleSet, operator, subRuleIdList) { this.idInRuleSet = idInRuleSet; this.operator = operator; this.subRuleIdList = subRuleIdList; cnt_topRule++; cnt_topRule-=subRuleIdList.length; } /** * 与 */ function andRules() { combin('and'); } /** * 或 */ function orRules() { combin('or'); } /** * 增加基本规则 */ function addBasicRule() { // 分配ID var idInRuleSet = "br_" + cnt_basicRule; // 加入规则库 map_id_to_basicRule[idInRuleSet] = createEmptyBasicRule(idInRuleSet); // 计算行数 var rowIdxStart = cnt_basicRule * NR_ROWS_OF_BASIC_RULE + 1; // 规则id写入checkbox var checkbox = getBasicRuleCheckbox(rowIdxStart); checkbox.attributes["ruleIdInRuleSet"].value = idInRuleSet; // 规则id写入基本规则类别下拉框 var select_basicRuleType= getSelect_basicRuleType(rowIdxStart); select_basicRuleType.attributes["ruleIdInRuleSet"].value = idInRuleSet; // 显示隐藏的表格行 for (var rowIdx = rowIdxStart; rowIdx < rowIdxStart + NR_ROWS_OF_BASIC_RULE; rowIdx++) { var tr = getElementById("tr_" + rowIdx); tr.style.display = ""; // tr.attributes["ruleIdInRuleSet"].value = ruleIdInRuleSet; } // 计数增加 cnt_basicRule++; } /** * 删除多条规则 */ function deleteRules() { // 找到所有的checkbox var inputList = document.getElementsByTagName("input"); var selectedCheckboxList = new Array(); // 找到选中的checkbox for (var i = 0; i < inputList.length; i++) { var input = inputList[i]; if (input.type == "checkbox" && input.checked) { selectedCheckboxList[selectedCheckboxList.length] = input; } } // 检查数量 if (selectedCheckboxList.length == 0) { alert("请选择一条或多条规则"); } // 逐个删除 for(var i = 0; i<selectedCheckboxList.length; i++) { var checkbox = selectedCheckboxList[i]; deleteRule(checkbox); } } /** * 删除多条规则 */ function deleteRule(checkbox) { var isBasicRule = checkbox.attributes["isBasicRule"]; if(isBasicRule) { deleteBasicRule(checkbox); } else { deleteCompositeRule(checkbox); } } /** * 删除基本规则 */ function deleteBasicRule(checkbox) { // 不再勾选 checkbox.checked = false; // 获得ID var ruleIdInRuleSet = checkbox.attributes["ruleIdInRuleSet"].value; // 从规则库中删除 removeKeyFromMap(ruleIdInRuleSet, map_id_to_basicRule); removeKeyFromMap(ruleIdInRuleSet, map_id_to_ruleExtData); // 清空表格行 var rowIdxStart = parseInt(checkbox.attributes["rowIdx"].value); var td_br_type = getElementById("td_br_type_" + rowIdxStart); td_br_type.innerHTML = ""; var td_br_value = getElementById("td_br_value_" + rowIdxStart); td_br_value.innerHTML = ""; // 隐藏表格行 for (var rowIdx = rowIdxStart; rowIdx < rowIdxStart + NR_ROWS_OF_BASIC_RULE; rowIdx++) { var tr = getElementById("tr_" + rowIdx); tr.style.display = "none"; // tr.attributes["ruleIdInRuleSet"].value = ""; } } /** * 组合条件 * @param operator */ function combin(operator) { // 找到选中的checkbox var inputList = document.getElementsByTagName("input"); var subCheckboxList = new Array(); var subRuleIdList = new Array(); for (var i = 0; i < inputList.length; i++) { var input = inputList[i]; if (input.type == "checkbox" && input.checked) { subCheckboxList.push(input); subRuleIdList.push(input.attributes.ruleIdInRuleSet.value); } } // 检查数量 if (subCheckboxList.length <= 1) { alert("请选择两条或多条规则"); return; } // 分配ID var ruleIdInRuleSet = "cr_" + cnt_compositeRule; // 创建规则 var rule = new CompositeRule(ruleIdInRuleSet, operator, subRuleIdList); map_id_to_compositeRule[ruleIdInRuleSet] = rule; // 保存规则扩展数据 var ruleExtData = new Object(); map_id_to_ruleExtData[ruleIdInRuleSet] = ruleExtData; ruleExtData.subCheckboxList = subCheckboxList; // 处理数据 var maxSubOpDepth = 0; var minSubRowIdx = 1000000; var maxSubRowIdx = 0; for (var i = 0; i < subCheckboxList.length; i++) { var cb = subCheckboxList[i]; var subRowIdx_i = parseInt(cb.attributes["rowIdx"].value); var subOpDepth_i = parseInt(cb.attributes["opDepth"].value); // 计算opDepth if (maxSubOpDepth < subOpDepth_i) { maxSubOpDepth = subOpDepth_i; } // 计算rowIdx if (maxSubRowIdx < subRowIdx_i) { maxSubRowIdx = subRowIdx_i; } if (minSubRowIdx > subRowIdx_i) { minSubRowIdx = subRowIdx_i; } } var parentRowIdx = parseInt((maxSubRowIdx + minSubRowIdx) / 2); var parentOpDepth = maxSubOpDepth + 1; // 线条涉及的单元格 ruleExtData.lineTdList = new Array(); for (var i = 0; i < subCheckboxList.length; i++) { var subCheckbox = subCheckboxList[i]; var subRowIdx_i = parseInt(subCheckbox.attributes["rowIdx"].value); var subOpDepth_i = parseInt(subCheckbox.attributes["opDepth"].value); // 消除选中 subCheckbox.checked = false; subCheckbox.style.display = "none"; // 显示横分线 var td = getElementById("td_op_subLine_" + subRowIdx_i + "_" + (subOpDepth_i + 1)); ruleExtData.lineTdList.push(td); setLine(td, "bottom"); // 显示穿越线 for (var subOpDepth_i_j = subOpDepth_i + 1; subOpDepth_i_j < parentOpDepth; subOpDepth_i_j++) { td = "td_op_parentLine_" + subRowIdx_i + "_" + subOpDepth_i_j; ruleExtData.lineTdList.push(td); setLine(td, "bottom"); td = "td_op_op_" + subRowIdx_i + "_" + subOpDepth_i_j; ruleExtData.lineTdList.push(td); setLine(td, "bottom"); td = "td_op_checkbox_" + subRowIdx_i + "_" + subOpDepth_i_j; ruleExtData.lineTdList.push(td); setLine(td, "bottom"); td = "td_op_subLine_" + subRowIdx_i + "_" + (subOpDepth_i_j + 1); ruleExtData.lineTdList.push(td); setLine(td, "bottom"); } } // 创建新的组合条件 // getElementById("td_op_leftLine_"+rowIdx+"_"+opDepth) // getElementById("td_op_leftLine_"+rowIdx+"_"+(opDepth+1)) // 组合方式 // 操作符合并单元格 ruleExtData.td_op_op = getElementById("td_op_op_" + parentRowIdx + "_" + parentOpDepth); ruleExtData.td_op_op.rowSpan = 2; ruleExtData.td_op_op_under = getElementById("td_op_op_" + (parentRowIdx + 1) + "_" + parentOpDepth); ruleExtData.td_op_op_under.style.display = "none"; // 画边框 ruleExtData.td_op_op.className = "td_left_box"; ruleExtData.td_op_op.innerHTML = getOperatorText(operator); // 线 td = "td_op_parentLine_" + parentRowIdx + "_" + parentOpDepth; ruleExtData.lineTdList.push(td); setLine(td, "bottom"); // 复选框 // 合并单元格 ruleExtData.td_op_cb = getElementById("td_op_checkbox_" + parentRowIdx + "_" + parentOpDepth); ruleExtData.td_op_cb.rowSpan = 2; ruleExtData.td_op_cb_under = getElementById("td_op_checkbox_" + (parentRowIdx + 1) + "_" + parentOpDepth); ruleExtData.td_op_cb_under.style.display = "none"; // 画边框 ruleExtData.td_op_cb.className = "td_right_box"; // 写复选框HTML ruleExtData.td_op_cb.innerHTML = "<input class='checkbox' type='checkbox' id='cb_" + parentRowIdx + "_" + parentOpDepth + "' ruleIdInRuleSet='" + ruleIdInRuleSet + "' rowIdx='" + parentRowIdx + "' opDepth='" + parentOpDepth + "' />"; // 竖线 for (var rowIdx_i = minSubRowIdx + 1; rowIdx_i <= maxSubRowIdx; rowIdx_i++) { var td_op_parentLine = getElementById("td_op_parentLine_" + rowIdx_i + "_" + parentOpDepth); ruleExtData.lineTdList.push(td_op_parentLine); setLine(td_op_parentLine, "left"); } // 计数增加 cnt_compositeRule++; } /** * 删除复合规则 */ function deleteCompositeRule(checkbox) { // 不再勾选 checkbox.checked = false; // 获得ID var ruleIdInRuleSet = checkbox.attributes["ruleIdInRuleSet"].value; // 获得规则 var rule = map_id_to_compositeRule[ruleIdInRuleSet]; var ruleExtData = map_id_to_ruleExtData[ruleIdInRuleSet]; // 从规则库中删除 removeKeyFromMap(ruleIdInRuleSet, map_id_to_compositeRule); removeKeyFromMap(ruleIdInRuleSet, map_id_to_ruleExtData); // 恢复显示子规则复选框 for(var i=0; i<ruleExtData.subCheckboxList.length; i++){ ruleExtData.subCheckboxList[i].style.display = ""; } // 操作符 // 拆分单元格 ruleExtData.td_op_op.rowSpan = 1; // 恢复显示下方单元格 ruleExtData.td_op_op_under.style.display = ""; // 清空组合规则表格 ruleExtData.td_op_op.className = ""; ruleExtData.td_op_op.innerHTML = ""; // 复选框 // 拆分单元格 ruleExtData.td_op_cb.rowSpan = 1; // 恢复显示下方单元格 ruleExtData.td_op_cb_under.style.display = ""; // 清空组合规则表格 ruleExtData.td_op_cb.className = ""; ruleExtData.td_op_cb.innerHTML = ""; // 清空各种线 for(var i=0; i<ruleExtData.lineTdList.length; i++) { var lineTd = ruleExtData.lineTdList[i]; clearLine(lineTd); } } /** * 基本规则类别变化后,要修改基本基本规则值 * @param select_basicRuleType */ function onchange_basicRuleType(select_basicRuleType) { var rowIdx = select_basicRuleType.attributes["rowIdx"].value; var basicRuleType = getSelectedValue(select_basicRuleType); var td_basicRuleValue = getElementById("td_br_value_"+rowIdx); var tr = td_basicRuleValue.parentNode; var ruleIdInRuleSet = select_basicRuleType.attributes["ruleIdInRuleSet"].value; var rule = map_id_to_basicRule[ruleIdInRuleSet]; if (basicRuleType == "") { // 清空 rule.type = ""; td_basicRuleValue.innerHTML = ""; } else { // 设置基本规则类别 rule.type = basicRuleType; if (basicRuleType == "languageId") { // 语种 td_basicRuleValue.innerHTML = "<select onchange=\"onchange_basicRuleValue('"+ruleIdInRuleSet+"', ' ', getSelectedValue(this), '')\">" + " <option value=''>请选择</option>" + " <option value='1'>中简</option>" + " <option value='2'>中繁</option>" + " <option value='3'>英</option>" + " <option value='4'>俄</option>" + " <option value='5'>日</option>" + "</select>"; } else if (basicRuleType == "entityTypeId") { // 实体 var ctrlIdOfEntityType = ruleIdInRuleSet+"_entityType"; var ctrlIdOfEntityId = ruleIdInRuleSet+"_entityId"; var ctrlIdOfEntityName = ruleIdInRuleSet+"_entityName"; td_basicRuleValue.innerHTML = "<input type='hidden' id='"+ctrlIdOfEntityType+"'/>" + "<input type='hidden' id='"+ctrlIdOfEntityId+"'/>" + "<input " + " readonly" + " id='"+ctrlIdOfEntityName+"'" + " style='cursor: pointer'" + " title='请点击选择'" + " onclick=\"showQueryEntityFrameCommon(" + " this, " + " '', " + " '"+ctrlIdOfEntityType+"', " + " '"+ctrlIdOfEntityId+"', " + " '"+ctrlIdOfEntityName+"', " + " 'onchange_basicRuleValue(\\'"+ruleIdInRuleSet+"\\', entityType, entityId, entityName)'" + " )\" " + "/>"; } else if (basicRuleType == "keyword") { // 关键词 td_basicRuleValue.innerHTML = "<input onchange=\"onchange_basicRuleValue('"+ruleIdInRuleSet+"', ' ', 0, this.value)\"/>"; } else { alert("Unknown basicRuleType:" + basicRuleType); return; } } } /** * 基本规则值发生变化后,要更新规则数据 * @param ruleIdInRuleSet */ function onchange_basicRuleValue(ruleIdInRuleSet, valueChar, valueInt, valueString) { var rule = map_id_to_basicRule[ruleIdInRuleSet]; // var td = ctrl.getParent(); // var tr = td.getParent(); rule.valueChar = valueChar; rule.valueInt = valueInt; rule.valueString = valueString; } function getOperatorText(operator) { if (operator == "and") { return "与"; } else if (operator == "or") { return "或"; } else { return operator; } } function getElementById(id) { obj = document.getElementById(id); if (obj == null) { alert("obj = null, id=" + id); } return obj; } function setLine(idOrObj, position) { var obj; if (typeof(idOrObj) == "string") { obj = getElementById(idOrObj); if (obj == null) { alert("obj = null, id=" + idOrObj); } } else { obj = idOrObj; } var cssText = "1px solid #aaccff"; if (position == "bottom") { obj.style.borderBottom = cssText; } else if (position == "top") { obj.style.borderTop = cssText; } else if (position == "left") { obj.style.borderLeft = cssText; } else if (position == "right") { obj.style.borderRight = cssText; } else { obj.style.border = cssText; } } function clearLine(idOrObj, position) { var obj; if (typeof(idOrObj) == "string") { obj = getElementById(idOrObj); if (obj == null) { alert("obj = null, id=" + idOrObj); } } else { obj = idOrObj; } var cssText = "0"; if (position == "bottom") { obj.style.borderBottom = cssText; } else if (position == "top") { obj.style.borderTop = cssText; } else if (position == "left") { obj.style.borderLeft = cssText; } else if (position == "right") { obj.style.borderRight = cssText; } else { obj.style.border = cssText; } } /** * 根据行索引得到基本规则的checkbox * @param rowIdx */ function getBasicRuleCheckbox(rowIdx) { return getElementById("checkbox_" + rowIdx + "_0"); } /** * 根据行索引得到基本规则的checkbox * @param rowIdx */ function getSelect_basicRuleType(rowIdx) { return getElementById("basicRuleType_" + rowIdx); } /** * 保存之前先检查 */ function checkBeforeSave() { // 检查是否有没有合并的规则 if (cnt_topRule == 0) { alert("请创建规则后保存"); return false; } else if (cnt_topRule > 1) { alert("尚有未合并的规则"); return false; } // 检查基本规则是否都已经有值 for(var ruleIdInRuleSet in map_id_to_basicRule) { var rule = map_id_to_basicRule[ruleIdInRuleSet]; if(!rule.checkBeforeSave()) { return false; } } return true; } /** * 保存规则 */ function saveRules() { // 检查 if(!checkBeforeSave()){ return; } // 保存 AjaxInterface.saveRules(map_id_to_basicRule, map_id_to_compositeRule, callback_saveRules) } /** * 保存规则后的回调函数 */ function callback_saveRules(blMessage) { if(blMessage.success) { alert("保存成功!"); } else { alert(blMessage.message); } }
5,272
https://github.com/Rhoana/rh_aligner/blob/master/old/match_sift_features.py
Github Open Source
Open Source
MIT
2,016
rh_aligner
Rhoana
Python
Code
352
1,234
import sys import os import glob import argparse from subprocess import call from bounding_box import BoundingBox import json import itertools import utils # common functions def match_multiple_sift_features(tiles_file, features_file, index_pairs, jar, out_fname, conf_args): tiles_url = utils.path2url(os.path.abspath(tiles_file)) java_cmd = 'java -Xmx4g -Djava.awt.headless=true -cp "{0}" org.janelia.alignment.MatchSiftFeatures --tilespecfile {1} --featurefile {2} {3} --targetPath {4} {5}'.format( jar, tiles_url, features_file, " ".join("--indices {}:{}".format(a, b) for a, b in index_pairs), out_fname, conf_args) utils.execute_shell_command(java_cmd) def load_data_files(tile_file, features_file): tile_file = tile_file.replace('file://', '') with open(tile_file, 'r') as data_file: tilespecs = json.load(data_file) features_file = features_file.replace('file://', '') with open(features_file) as data_file: features = json.load(data_file) return tilespecs, {ft["mipmapLevels"]["0"]["imageUrl"] : idx for idx, ft in enumerate(features)} def match_sift_features(tiles_file, features_file, out_fname, jar_file, conf=None): tilespecs, feature_indices = load_data_files(tiles_file, features_file) for k, v in feature_indices.iteritems(): print k, v # TODO: add all tiles to a kd-tree so it will be faster to find overlap between tiles # TODO: limit searches for matches to overlap area of bounding boxes # iterate over the tiles, and for each tile, find intersecting tiles that overlap, # and match their features # Nested loop: # for each tile_i in range[0..N): # for each tile_j in range[tile_i..N)] indices = [] for pair in itertools.combinations(tilespecs, 2): # if the two tiles intersect, match them bbox1 = BoundingBox.fromList(pair[0]["bbox"]) bbox2 = BoundingBox.fromList(pair[1]["bbox"]) if bbox1.overlap(bbox2): imageUrl1 = pair[0]["mipmapLevels"]["0"]["imageUrl"] imageUrl2 = pair[1]["mipmapLevels"]["0"]["imageUrl"] print "Matching sift of tiles: {0} and {1}".format(imageUrl1, imageUrl2) idx1 = feature_indices[imageUrl1] idx2 = feature_indices[imageUrl2] indices.append((idx1, idx2)) conf_args = utils.conf_args(conf, 'MatchSiftFeatures') match_multiple_sift_features(tiles_file, features_file, indices, jar_file, out_fname, conf_args) def main(): # Command line parser parser = argparse.ArgumentParser(description='Iterates over the tilespecs in a file, computing matches for each overlapping tile.') parser.add_argument('tiles_file', metavar='tiles_file', type=str, help='the json file of tilespecs') parser.add_argument('features_file', metavar='features_file', type=str, help='the json file of features') parser.add_argument('-o', '--output_file', type=str, help='an output correspondent_spec file, that will include the sift features for each tile (default: ./matches.json)', default='./matches.json') parser.add_argument('-j', '--jar_file', type=str, help='the jar file that includes the render (default: ../target/render-0.0.1-SNAPSHOT.jar)', default='../target/render-0.0.1-SNAPSHOT.jar') parser.add_argument('-c', '--conf_file_name', type=str, help='the configuration file with the parameters for each step of the alignment process in json format (uses default parameters, if not supplied)', default=None) args = parser.parse_args() match_sift_features(args.tiles_file, args.features_file, args.output_file, args.jar_file, \ conf=utils.conf_args_from_file(args.conf_file_name, "MatchSiftFeatures")) if __name__ == '__main__': main()
42,393
https://github.com/Muzammil-khan/Aspose.Email-for-.NET/blob/master/Examples/CSharp/IMAP/DeletingAndRenamingFolders.cs
Github Open Source
Open Source
MIT
2,022
Aspose.Email-for-.NET
Muzammil-khan
C#
Code
164
459
using Aspose.Email.Clients; using Aspose.Email.Clients.Imap; using System; using System.Collections.Generic; using System.Linq; using System.Text; /* This project uses Automatic Package Restore feature of NuGet to resolve Aspose.Email for .NET API reference when the project is build. Please check https://Docs.nuget.org/consume/nuget-faq for more information. If you do not wish to use NuGet, you can manually download Aspose.Email for .NET API from https://www.nuget.org/packages/Aspose.Email/, install it and then add its reference to this project. For any issues, questions or suggestions please feel free to contact us using https://forum.aspose.com/c/email */ namespace Aspose.Email.Examples.CSharp.Email.IMAP { class DeletingAndRenamingFolders { public static void Run() { // Create an instance of the ImapClient class ImapClient client = new ImapClient(); // Specify host, username and password, and set port for your client client.Host = "imap.gmail.com"; client.Username = "your.username@gmail.com"; client.Password = "your.password"; client.Port = 993; client.SecurityOptions = SecurityOptions.Auto; try { // ExStart:DeletingAndRenamingFolders // Delete a folder and Rename a folder client.DeleteFolder("foldername"); client.RenameFolder("foldername", "newfoldername"); // ExEnd:DeletingAndRenamingFolders client.Dispose(); } catch (Exception ex) { Console.Write(Environment.NewLine + ex); } } } }
29,016
https://github.com/wgzzgw/liveapp/blob/master/app/src/main/java/com/study/model/RoomInfo.java
Github Open Source
Open Source
Apache-2.0
2,018
liveapp
wgzzgw
Java
Code
39
97
package com.study.model; /** * Created by yy on 2018/4/21. */ /* 房间信息bean */ public class RoomInfo { public int roomId; public String userId; public String userName; public String userAvatar; public String liveCover; public String liveTitle; public int watcherNums; }
47,915
https://github.com/iamrampukar/Wellness-Lab-Core/blob/master/resources/views/statement/index.blade.php
Github Open Source
Open Source
MIT
null
Wellness-Lab-Core
iamrampukar
PHP
Code
307
1,449
@extends('layouts.master') @section('content') <!-- Content Header (Page header) --> <div class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1 class="m-0 text-dark">Report Statement</h1> </div> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </div> <!-- /.content-header --> <!-- Main content --> <div class="content"> <div class="container-fluid"> <div class="row"> <!-- /.col-md-6 --> <div class="col-lg-12"> <div class="card"> <div class="card-body"> <div class="col-md-7"> <div class="row"> <div class="col"> <div class="form-group"> <label for="firstName">From Date</label> <input type="text" id="from_date" class="form-control form-control-sm" placeholder="From Date" value=""> </div> </div> <div class="col"> <div class="form-group"> <label for="firstName">To Date</label> <input type="text" id="to_date" class="form-control form-control-sm" placeholder="To Date" value=""> </div> </div> </div> </div> </div> </div> <!-- /.card --> </div> <div class="col-lg-12"> <div class="card"> <div class="card-header border-0"> <div class="d-flex justify-content-between"> <h3 class="card-title"> <b>From Date:</b> <span id="show_from_date"></span> <b>To Date:</b> <span id="show_to_date"></span> </h3> <span id="total_amount"></span> </div> </div> <div class="card-body"> <!-- /.d-flex --> <div class="position-relative mb-4"> <table class="table table-bordered table-sm"> <thead> <tr> <th>S.NO</th> <th>DESCRIPTION</th> <th>DATE</th> <th>AMOUNT</th> </tr> </thead> <tbody id="tbl_statement"> </tbody> </table> </div> </div> </div> <!-- /.card --> </div> <!-- /.col-md-6 --> </div> <!-- /.row --> </div> <!-- /.container-fluid --> </div> <!-- /.content --> @endsection @push('scripts') <script src="{{ asset('/plugins/daterangepicker/daterangepicker.js') }}"></script> <script src="{{ asset('/js/datepickers.js') }}"></script> @endpush @push('scripts') <script> function dateDiff(fromDate,toDate) { return moment(fromDate).format("YYYY-MM-DD") < moment(toDate).format("YYYY-MM-DD"); } function fetchStatementData(fromDate,toDate) { $('#show_from_date').html(fromDate); $('#show_to_date').html(toDate); $.ajax({ url: 'http://127.0.0.1:8000/statement/statement-data', type: 'GET', dataType: 'json', data: {fromDate: fromDate, toDate:toDate}, }) .done(function(res) { var resData = res.data; var htmlTable = ""; var index = 0; for (const dayItem of resData.days) { var tableRow = ` <tr> <td>${++index}</td> <td>${dayItem.sample_no}</td> <td>${dayItem.date}</td> <td>${parseFloat(dayItem.amount).toFixed(2)}</td> </tr>`; htmlTable+=tableRow; } var tableRow = ` <tr> <td></td> <td><b>Total Amount:</b></td> <td></td> <td><b>${parseFloat(resData.total_amt.total_amt).toFixed(2)}</b></td> </tr>`; htmlTable+=tableRow; $('#total_amount').html('<b>Total Amount:</b> ' + parseFloat(resData.total_amt.total_amt).toFixed(2)); $('body #tbl_statement').html(htmlTable); }) .fail(function() { console.log("error"); }); } $(function () { 'use strict' $('#from_date').change(function(){ var fromDate = $('#from_date').val(); var toDate = $('#to_date').val(); var diff =dateDiff(fromDate,toDate); if(diff) { fetchStatementData(fromDate,toDate); } }); $('#to_date').change(function(){ var fromDate = $('#from_date').val(); var toDate = $('#to_date').val(); var diff =dateDiff(fromDate,toDate); if(diff) { fetchStatementData(fromDate,toDate); } }); }) </script> @endpush
21,258
https://github.com/huntlabs/hunt-pool/blob/master/source/hunt/pool/impl/DefaultEvictionPolicy.d
Github Open Source
Open Source
Apache-2.0
2,021
hunt-pool
huntlabs
D
Code
262
578
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ module hunt.pool.impl.DefaultEvictionPolicy; import hunt.pool.PooledObject; /** * Provides the default implementation of {@link EvictionPolicy} used by the * pools. Objects will be evicted if the following conditions are met: * <ul> * <li>the object has been idle longer than * {@link GenericObjectPool#getMinEvictableIdleTimeMillis()} / * {@link GenericKeyedObjectPool#getMinEvictableIdleTimeMillis()}</li> * <li>there are more than {@link GenericObjectPool#getMinIdle()} / * {@link GenericKeyedObjectPoolConfig#getMinIdlePerKey()} idle objects in * the pool and the object has been idle for longer than * {@link GenericObjectPool#getSoftMinEvictableIdleTimeMillis()} / * {@link GenericKeyedObjectPool#getSoftMinEvictableIdleTimeMillis()} * </ul> * This class is immutable and thread-safe. * * @param <T> the type of objects in the pool * */ class DefaultEvictionPolicy(T) : EvictionPolicy!(T) { override bool evict(EvictionConfig config, PooledObject!(T) underTest, int idleCount) { if ((config.getIdleSoftEvictTime() < underTest.getIdleTimeMillis() && config.getMinIdle() < idleCount) || config.getIdleEvictTime() < underTest.getIdleTimeMillis()) { return true; } return false; } }
34,159
https://github.com/kjappelbaum/aiida-cp2k/blob/master/aiida_cp2k/calculations/__init__.py
Github Open Source
Open Source
MIT
2,019
aiida-cp2k
kjappelbaum
Python
Code
938
3,148
# -*- coding: utf-8 -*- ############################################################################### # Copyright (c), The AiiDA-CP2K authors. # # SPDX-License-Identifier: MIT # # AiiDA-CP2K is hosted on GitHub at https://github.com/cp2k/aiida-cp2k # # For further information on the license, see the LICENSE.txt file. # ############################################################################### from aiida.orm.calculation.job import JobCalculation from aiida.common.utils import classproperty from aiida.orm.data.structure import StructureData from aiida.orm.data.parameter import ParameterData from aiida.orm.data.singlefile import SinglefileData from aiida.orm.data.remote import RemoteData from aiida.common.datastructures import CalcInfo, CodeInfo from aiida.common.exceptions import InputValidationError class Cp2kCalculation(JobCalculation): """ This is a Cp2kCalculation, subclass of JobCalculation, to prepare input for an ab-inition Cp2kCalculation. For information on CP2K, refer to: https://www.cp2k.org """ # -------------------------------------------------------------------------- def _init_internal_params(self): """ Set parameters of instance """ super(Cp2kCalculation, self)._init_internal_params() self._INPUT_FILE_NAME = 'aiida.inp' self._OUTPUT_FILE_NAME = 'aiida.out' self._DEFAULT_INPUT_FILE = self._INPUT_FILE_NAME self._DEFAULT_OUTPUT_FILE = self._OUTPUT_FILE_NAME self._PROJECT_NAME = 'aiida' self._RESTART_FILE_NAME = self._PROJECT_NAME + '-1.restart' self._PARENT_CALC_FOLDER_NAME = 'parent_calc/' self._COORDS_FILE_NAME = 'aiida.coords.xyz' self._default_parser = 'cp2k' # -------------------------------------------------------------------------- @classproperty def _use_methods(cls): """ Extend the parent _use_methods with further keys. This will be manually added to the _use_methods in each subclass """ retdict = JobCalculation._use_methods retdict.update({ "structure": { 'valid_types': StructureData, 'additional_parameter': None, 'linkname': 'structure', 'docstring': "Choose the input structure to use", }, "settings": { 'valid_types': ParameterData, 'additional_parameter': None, 'linkname': 'settings', 'docstring': "Use an additional node for special settings", }, "parameters": { 'valid_types': ParameterData, 'additional_parameter': None, 'linkname': 'parameters', 'docstring': "Use a node that specifies the " "input parameters for the namelists", }, "parent_folder": { 'valid_types': RemoteData, 'additional_parameter': None, 'linkname': 'parent_calc_folder', 'docstring': "Use a remote folder as parent folder " "(for restarts and similar)", }, "file": { 'valid_types': SinglefileData, 'additional_parameter': "linkname", 'linkname': cls._get_linkname_file, 'docstring': "Use files to provide additional parameters", }, }) return retdict # -------------------------------------------------------------------------- @classmethod def _get_linkname_file(cls, linkname): return(linkname) # -------------------------------------------------------------------------- def _prepare_for_submission(self, tempfolder, inputdict): """ This is the routine to be called when you want to create the input files and related stuff with a plugin. :param tempfolder: a aiida.common.folders.Folder subclass where the plugin should put all its files. :param inputdict: a dictionary with the input nodes, as they would be returned by get_inputdata_dict (without the Code!) """ in_nodes = self._verify_inlinks(inputdict) params, structure, code, settings, local_copy_list, \ parent_calc_folder = in_nodes # write cp2k input file inp = Cp2kInput(params) inp.add_keyword("GLOBAL/PROJECT", self._PROJECT_NAME) if structure is not None: struct_fn = tempfolder.get_abs_path(self._COORDS_FILE_NAME) structure.export(struct_fn, fileformat="xyz") for i, a in enumerate('ABC'): val = '{:<15} {:<15} {:<15}'.format(*structure.cell[i]) inp.add_keyword('FORCE_EVAL/SUBSYS/CELL/'+a, val) topo = "FORCE_EVAL/SUBSYS/TOPOLOGY" inp.add_keyword(topo + "/COORD_FILE_NAME", self._COORDS_FILE_NAME) inp.add_keyword(topo + "/COORD_FILE_FORMAT", "XYZ") inp_fn = tempfolder.get_abs_path(self._INPUT_FILE_NAME) with open(inp_fn, "w") as f: f.write(inp.render()) # create code info codeinfo = CodeInfo() cmdline = settings.pop('cmdline', []) cmdline += ["-i", self._INPUT_FILE_NAME] codeinfo.cmdline_params = cmdline codeinfo.stdout_name = self._OUTPUT_FILE_NAME codeinfo.join_files = True codeinfo.code_uuid = code.uuid # create calc info calcinfo = CalcInfo() calcinfo.stdin_name = self._INPUT_FILE_NAME calcinfo.uuid = self.uuid calcinfo.cmdline_params = codeinfo.cmdline_params calcinfo.stdin_name = self._INPUT_FILE_NAME calcinfo.stdout_name = self._OUTPUT_FILE_NAME calcinfo.codes_info = [codeinfo] # file lists calcinfo.remote_symlink_list = [] calcinfo.local_copy_list = local_copy_list calcinfo.remote_copy_list = [] calcinfo.retrieve_list = [self._OUTPUT_FILE_NAME, self._RESTART_FILE_NAME, ['*dcd', '.', 0]] calcinfo.retrieve_list += settings.pop('additional_retrieve_list', []) # symlinks if parent_calc_folder is not None: comp_uuid = parent_calc_folder.get_computer().uuid remote_path = parent_calc_folder.get_remote_path() symlink = (comp_uuid, remote_path, self._PARENT_CALC_FOLDER_NAME) calcinfo.remote_symlink_list.append(symlink) # check for left over settings if settings: msg = "The following keys have been found " msg += "in the settings input node {}, ".format(self.pk) msg += "but were not understood: " + ",".join(settings.keys()) raise InputValidationError(msg) return calcinfo # -------------------------------------------------------------------------- def _verify_inlinks(self, inputdict): # parameters params_node = inputdict.pop('parameters', None) if params_node is None: raise InputValidationError("No parameters specified") if not isinstance(params_node, ParameterData): raise InputValidationError("parameters type not ParameterData") params = params_node.get_dict() # structure structure = inputdict.pop('structure', None) if structure is not None: if not isinstance(structure, StructureData): raise InputValidationError("structure type not StructureData") # code code = inputdict.pop(self.get_linkname('code'), None) if code is None: raise InputValidationError("No code specified") # settings # ... if not provided fall back to empty dict settings_node = inputdict.pop('settings', ParameterData()) if not isinstance(settings_node, ParameterData): raise InputValidationError("settings type not ParameterData") settings = settings_node.get_dict() # parent calc folder parent_calc_folder = inputdict.pop('parent_calc_folder', None) if parent_calc_folder is not None: if not isinstance(parent_calc_folder, RemoteData): msg = "parent_calc_folder type not RemoteData" raise InputValidationError(msg) # handle additional parameter files local_copy_list = [] for k, v in inputdict.items(): if isinstance(v, SinglefileData): inputdict.pop(k) local_copy_list.append((v.get_file_abs_path(), v.filename)) if inputdict: msg = "unrecognized input nodes: " + str(inputdict.keys()) raise InputValidationError(msg) return(params, structure, code, settings, local_copy_list, parent_calc_folder) # ============================================================================== class Cp2kInput(object): def __init__(self, params): self.params = params # -------------------------------------------------------------------------- def add_keyword(self, kwpath, value, params=None): self._add_keyword_low(kwpath.split("/"), value, self.params) # -------------------------------------------------------------------------- def _add_keyword_low(self, kwpath, value, params): if len(kwpath) == 1: params[kwpath[0]] = value elif kwpath[0] not in params.keys(): new_subsection = {} params[kwpath[0]] = new_subsection self._add_keyword_low(kwpath[1:], value, new_subsection) else: self._add_keyword_low(kwpath[1:], value, params[kwpath[0]]) # -------------------------------------------------------------------------- def render(self): output = ["!!! Generated by AiiDA !!!"] self._render_section(output, self.params) return "\n".join(output) # -------------------------------------------------------------------------- def _render_section(self, output, params, indent=0): """ It takes a dictionary and recurses through. For key-value pair it checks whether the value is a dictionary and prepends the key with & It passes the valued to the same function, increasing the indentation If the value is a list, I assume that this is something the user wants to store repetitively eg: dict['KEY'] = ['val1', 'val2'] ===> KEY val1 KEY val2 or dict['KIND'] = [{'_': 'Ba', 'ELEMENT':'Ba'}, {'_': 'Ti', 'ELEMENT':'Ti'}, {'_': 'O', 'ELEMENT':'O'}] ====> &KIND Ba ELEMENT Ba &END KIND &KIND Ti ELEMENT Ti &END KIND &KIND O ELEMENT O &END KIND """ for key, val in sorted(params.items()): if key.upper() != key: raise InputValidationError("keyword '%s' not upper case" % key) if key.startswith('@') or key.startswith('$'): raise InputValidationError("CP2K preprocessor not supported") if isinstance(val, dict): output.append('%s&%s %s' % (' '*indent, key, val.pop('_', ''))) self._render_section(output, val, indent + 3) output.append('%s&END %s' % (' '*indent, key)) elif isinstance(val, list): for listitem in val: self._render_section(output, {key: listitem}, indent) elif isinstance(val, bool): val_str = '.true.' if val else '.false.' output.append('%s%s %s' % (' '*indent, key, val_str)) else: output.append('%s%s %s' % (' '*indent, key, val)) # EOF
38,519
https://github.com/pneuman/fdkaac/blob/master/src/main.c
Github Open Source
Open Source
Zlib
2,018
fdkaac
pneuman
C
Code
3,133
10,927
/* * Copyright (C) 2013 nu774 * For conditions of distribution and use, see copyright notice in COPYING */ #if HAVE_CONFIG_H # include "config.h" #endif #if HAVE_STDINT_H # include <stdint.h> #endif #if HAVE_INTTYPES_H # include <inttypes.h> #elif defined(_MSC_VER) # define SCNd64 "I64d" #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <locale.h> #include <errno.h> #include <sys/stat.h> #include <getopt.h> #if HAVE_UNISTD_H #include <unistd.h> #endif #if HAVE_SIGACTION #include <signal.h> #endif #ifdef _WIN32 #include <io.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> #endif #include "compat.h" #include "wav_reader.h" #include "aacenc.h" #include "m4af.h" #include "progress.h" #include "version.h" #include "metadata.h" #ifdef USE_LIBSNDFILE #include "sndfile.h" #endif #ifdef USE_LIBSAMPLERATE #include "samplerate.h" #endif #define PROGNAME "fdkaac" static volatile int g_interrupted = 0; #if HAVE_SIGACTION static void signal_handler(int signum) { g_interrupted = 1; } static void handle_signals(void) { int i, sigs[] = { SIGINT, SIGHUP, SIGTERM }; for (i = 0; i < sizeof(sigs)/sizeof(sigs[0]); ++i) { struct sigaction sa = { 0 }; sa.sa_handler = signal_handler; sa.sa_flags |= SA_RESTART; sigaction(sigs[i], &sa, 0); } } #elif defined(_WIN32) static BOOL WINAPI signal_handler(DWORD type) { g_interrupted = 1; return TRUE; } static void handle_signals(void) { SetConsoleCtrlHandler(signal_handler, TRUE); } #else static void handle_signals(void) { } #endif static int read_callback(void *cookie, void *data, uint32_t size) { size_t rc = fread(data, 1, size, (FILE*)cookie); return ferror((FILE*)cookie) ? -1 : (int)rc; } static int write_callback(void *cookie, const void *data, uint32_t size) { size_t rc = fwrite(data, 1, size, (FILE*)cookie); return ferror((FILE*)cookie) ? -1 : (int)rc; } static int seek_callback(void *cookie, int64_t off, int whence) { return fseeko((FILE*)cookie, off, whence); } static int64_t tell_callback(void *cookie) { return ftello((FILE*)cookie); } static void usage(void) { printf( PROGNAME " %s\n" "Usage: " PROGNAME " [options] input_file\n" "Options:\n" " -h, --help Print this help message\n" " -p, --profile <n> Profile (audio object type)\n" " 2: MPEG-4 AAC LC (default)\n" " 5: MPEG-4 HE-AAC (SBR)\n" " 29: MPEG-4 HE-AAC v2 (SBR+PS)\n" " 23: MPEG-4 AAC LD\n" " 39: MPEG-4 AAC ELD\n" " 129: MPEG-2 AAC LC\n" " 132: MPEG-2 HE-AAC (SBR)\n" " 156: MPEG-2 HE-AAC v2 (SBR+PS)\n" " -b, --bitrate <n> Bitrate in bits per seconds (for CBR)\n" " -m, --bitrate-mode <n> Bitrate configuration\n" " 0: CBR (default)\n" " 1-5: VBR\n" " (VBR mode is not officially supported, and\n" " works only on a certain combination of\n" " parameter settings, sample rate, and\n" " channel configuration)\n" " -w, --bandwidth <n> Frequency bandwidth in Hz (AAC LC only)\n" " -a, --afterburner <n> Afterburner\n" " 0: Off\n" " 1: On(default)\n" " -L, --lowdelay-sbr Enable ELD-SBR (AAC ELD only)\n" " -s, --sbr-signaling <n> SBR signaling mode\n" " 0: Implicit, backward compatible(default)\n" " 1: Explicit SBR and implicit PS\n" " 2: Explicit hierarchical signaling\n" " -f, --transport-format <n> Transport format\n" " 0: RAW (default, muxed into M4A)\n" " 1: ADIF\n" " 2: ADTS\n" " 6: LATM MCP=1\n" " 7: LATM MCP=0\n" " 10: LOAS/LATM (LATM within LOAS)\n" " -C, --adts-crc-check Add CRC protection on ADTS header\n" " -h, --header-period <n> StreamMuxConfig/PCE repetition period in\n" " transport layer\n" "\n" " -o <filename> Output filename\n" " -G, --gapless-mode <n> Encoder delay signaling for gapless playback\n" " 0: iTunSMPB (default)\n" " 1: ISO standard (edts + sgpd)\n" " 2: Both\n" " --ignorelength Ignore length of WAV header\n" " -S, --silent Don't print progress messages\n" " --moov-before-mdat Place moov box before mdat box on m4a output\n" #ifdef USE_LIBSAMPLERATE " --resample <rate> Resample audio to specified rate before encoding\n" #endif "\n" "Options for raw (headerless) input:\n" " -R, --raw Treat input as raw (by default WAV is\n" " assumed)\n" " --raw-channels <n> Number of channels (default: 2)\n" " --raw-rate <n> Sample rate (default: 44100)\n" " --raw-format <spec> Sample format, default is \"S16L\".\n" " Spec is as follows:\n" " 1st char: S(igned)|U(nsigned)|F(loat)\n" " 2nd part: bits per channel\n" " Last char: L(ittle)|B(ig)\n" " Last char can be omitted, in which case L is\n" " assumed. Spec is case insensitive, therefore\n" " \"u16b\" is same as \"U16B\".\n" "\n" "Tagging options:\n" " --title <string>\n" " --artist <string>\n" " --album <string>\n" " --genre <string>\n" " --date <string>\n" " --composer <string>\n" " --grouping <string>\n" " --comment <string>\n" " --album-artist <string>\n" " --track <number[/total]>\n" " --disk <number[/total]>\n" " --tempo <n>\n" " --tag <fcc>:<value> Set iTunes predefined tag with four char code.\n" " --tag-from-file <fcc>:<filename>\n" " Same as above, but value is read from file.\n" " --long-tag <name>:<value> Set arbitrary tag as iTunes custom metadata.\n" " --tag-from-json <filename[?dot_notation]>\n" " Read tags from JSON. By default, tags are\n" " assumed to be direct children of the root\n" " object(dictionary).\n" " Optionally, position of the dictionary\n" " that contains tags can be specified with\n" " dotted notation.\n" " Example:\n" " --tag-from-json /path/to/json?format.tags\n" , fdkaac_version); } typedef struct aacenc_param_ex_t { AACENC_PARAMS char *input_filename; char *output_filename; unsigned gapless_mode; unsigned ignore_length; int silent; int moov_before_mdat; unsigned int resample; int is_raw; unsigned raw_channels; unsigned raw_rate; const char *raw_format; aacenc_tag_param_t tags; char *json_filename; } aacenc_param_ex_t; static int parse_options(int argc, char **argv, aacenc_param_ex_t *params) { int ch; unsigned n; #define OPT_MOOV_BEFORE_MDAT M4AF_FOURCC('m','o','o','v') #define OPT_RAW_CHANNELS M4AF_FOURCC('r','c','h','n') #define OPT_RAW_RATE M4AF_FOURCC('r','r','a','t') #define OPT_RAW_FORMAT M4AF_FOURCC('r','f','m','t') #define OPT_SHORT_TAG M4AF_FOURCC('s','t','a','g') #define OPT_SHORT_TAG_FILE M4AF_FOURCC('s','t','g','f') #define OPT_LONG_TAG M4AF_FOURCC('l','t','a','g') #define OPT_TAG_FROM_JSON M4AF_FOURCC('t','f','j','s') static struct option long_options[] = { { "help", no_argument, 0, 'h' }, { "profile", required_argument, 0, 'p' }, { "bitrate", required_argument, 0, 'b' }, { "bitrate-mode", required_argument, 0, 'm' }, { "bandwidth", required_argument, 0, 'w' }, { "afterburner", required_argument, 0, 'a' }, { "lowdelay-sbr", no_argument, 0, 'L' }, { "sbr-signaling", required_argument, 0, 's' }, { "transport-format", required_argument, 0, 'f' }, { "adts-crc-check", no_argument, 0, 'C' }, { "header-period", required_argument, 0, 'P' }, { "gapless-mode", required_argument, 0, 'G' }, { "ignorelength", no_argument, 0, 'I' }, { "silent", no_argument, 0, 'S' }, { "moov-before-mdat", no_argument, 0, OPT_MOOV_BEFORE_MDAT }, #ifdef USE_LIBSAMPLERATE { "resample", required_argument, 0, 'X' }, #endif { "raw", no_argument, 0, 'R' }, { "raw-channels", required_argument, 0, OPT_RAW_CHANNELS }, { "raw-rate", required_argument, 0, OPT_RAW_RATE }, { "raw-format", required_argument, 0, OPT_RAW_FORMAT }, { "title", required_argument, 0, M4AF_TAG_TITLE }, { "artist", required_argument, 0, M4AF_TAG_ARTIST }, { "album", required_argument, 0, M4AF_TAG_ALBUM }, { "genre", required_argument, 0, M4AF_TAG_GENRE }, { "date", required_argument, 0, M4AF_TAG_DATE }, { "composer", required_argument, 0, M4AF_TAG_COMPOSER }, { "grouping", required_argument, 0, M4AF_TAG_GROUPING }, { "comment", required_argument, 0, M4AF_TAG_COMMENT }, { "album-artist", required_argument, 0, M4AF_TAG_ALBUM_ARTIST }, { "track", required_argument, 0, M4AF_TAG_TRACK }, { "disk", required_argument, 0, M4AF_TAG_DISK }, { "tempo", required_argument, 0, M4AF_TAG_TEMPO }, { "tag", required_argument, 0, OPT_SHORT_TAG }, { "tag-from-file", required_argument, 0, OPT_SHORT_TAG_FILE }, { "long-tag", required_argument, 0, OPT_LONG_TAG }, { "tag-from-json", required_argument, 0, OPT_TAG_FROM_JSON }, { 0, 0, 0, 0 }, }; params->afterburner = 1; aacenc_getmainargs(&argc, &argv); while ((ch = getopt_long(argc, argv, "hp:b:m:w:a:Ls:f:CP:G:Io:SRX:", long_options, 0)) != EOF) { switch (ch) { case 'h': return usage(), -1; case 'p': if (sscanf(optarg, "%u", &n) != 1) { fprintf(stderr, "invalid arg for profile\n"); return -1; } params->profile = n; break; case 'b': if (sscanf(optarg, "%u", &n) != 1) { fprintf(stderr, "invalid arg for bitrate\n"); return -1; } params->bitrate = n; break; case 'm': if (sscanf(optarg, "%u", &n) != 1 || n > 5) { fprintf(stderr, "invalid arg for bitrate-mode\n"); return -1; } params->bitrate_mode = n; break; case 'w': if (sscanf(optarg, "%u", &n) != 1) { fprintf(stderr, "invalid arg for bandwidth\n"); return -1; } params->bandwidth = n; break; case 'a': if (sscanf(optarg, "%u", &n) != 1 || n > 1) { fprintf(stderr, "invalid arg for afterburner\n"); return -1; } params->afterburner = n; break; case 'L': params->lowdelay_sbr = 1; break; case 's': if (sscanf(optarg, "%u", &n) != 1 || n > 2) { fprintf(stderr, "invalid arg for sbr-signaling\n"); return -1; } params->sbr_signaling = n; break; case 'f': if (sscanf(optarg, "%u", &n) != 1) { fprintf(stderr, "invalid arg for transport-format\n"); return -1; } params->transport_format = n; break; case 'C': params->adts_crc_check = 1; break; case 'P': if (sscanf(optarg, "%u", &n) != 1) { fprintf(stderr, "invalid arg for header-period\n"); return -1; } params->header_period = n; break; case 'o': params->output_filename = optarg; break; case 'G': if (sscanf(optarg, "%u", &n) != 1 || n > 2) { fprintf(stderr, "invalid arg for gapless-mode\n"); return -1; } params->gapless_mode = n; break; case 'I': params->ignore_length = 1; break; case 'S': params->silent = 1; break; case OPT_MOOV_BEFORE_MDAT: params->moov_before_mdat = 1; break; case 'R': params->is_raw = 1; break; case 'X': if (sscanf(optarg, "%u", &n) != 1) { fprintf(stderr, "invalid arg for resample\n"); return -1; } params->resample = n; break; case OPT_RAW_CHANNELS: if (sscanf(optarg, "%u", &n) != 1) { fprintf(stderr, "invalid arg for raw-channels\n"); return -1; } params->raw_channels = n; break; case OPT_RAW_RATE: if (sscanf(optarg, "%u", &n) != 1) { fprintf(stderr, "invalid arg for raw-rate\n"); return -1; } params->raw_rate = n; break; case OPT_RAW_FORMAT: params->raw_format = optarg; break; case M4AF_TAG_TITLE: case M4AF_TAG_ARTIST: case M4AF_TAG_ALBUM: case M4AF_TAG_GENRE: case M4AF_TAG_DATE: case M4AF_TAG_COMPOSER: case M4AF_TAG_GROUPING: case M4AF_TAG_COMMENT: case M4AF_TAG_ALBUM_ARTIST: case M4AF_TAG_TRACK: case M4AF_TAG_DISK: case M4AF_TAG_TEMPO: aacenc_param_add_itmf_entry(&params->tags, ch, 0, optarg, strlen(optarg), 0); break; case OPT_SHORT_TAG: case OPT_SHORT_TAG_FILE: case OPT_LONG_TAG: { char *val; size_t klen; unsigned fcc = M4AF_FOURCC('-','-','-','-'); if ((val = strchr(optarg, ':')) == 0) { fprintf(stderr, "invalid arg for tag\n"); return -1; } *val++ = '\0'; if (ch == OPT_SHORT_TAG || ch == OPT_SHORT_TAG_FILE) { /* * take care of U+00A9(COPYRIGHT SIGN). * 1) if length of fcc is 3, we prepend '\xa9'. * 2) U+00A9 becomes "\xc2\xa9" in UTF-8. Therefore * we remove first '\xc2'. */ if (optarg[0] == '\xc2') ++optarg; if ((klen = strlen(optarg))== 3) fcc = 0xa9; else if (klen != 4) { fprintf(stderr, "invalid arg for tag\n"); return -1; } for (; *optarg; ++optarg) fcc = ((fcc << 8) | (*optarg & 0xff)); } aacenc_param_add_itmf_entry(&params->tags, fcc, optarg, val, strlen(val), ch == OPT_SHORT_TAG_FILE); } break; case OPT_TAG_FROM_JSON: params->json_filename = optarg; break; default: return usage(), -1; } } if (argc == optind) return usage(), -1; if (!params->bitrate && !params->bitrate_mode) { fprintf(stderr, "bitrate or bitrate-mode is mandatory\n"); return -1; } if (params->output_filename && !strcmp(params->output_filename, "-") && !params->transport_format) { fprintf(stderr, "stdout streaming is not available on M4A output\n"); return -1; } if (params->bitrate && params->bitrate < 10000) params->bitrate *= 1000; if (params->is_raw) { if (!params->raw_channels) params->raw_channels = 2; if (!params->raw_rate) params->raw_rate = 44100; if (!params->raw_format) params->raw_format = "S16L"; } params->input_filename = argv[optind]; return 0; }; static int write_sample(FILE *ofp, m4af_ctx_t *m4af, const void *data, uint32_t size, uint32_t duration) { if (!m4af) { fwrite(data, 1, size, ofp); if (ferror(ofp)) { fprintf(stderr, "ERROR: fwrite(): %s\n", strerror(errno)); return -1; } } else if (m4af_write_sample(m4af, 0, data, size, duration) < 0) { fprintf(stderr, "ERROR: failed to write m4a sample\n"); return -1; } return 0; } #ifdef USE_LIBSNDFILE static int encode_sndfile(SNDFILE* snd, SF_INFO* info, pcm_sample_description_t* format, HANDLE_AACENCODER encoder, uint32_t frame_length, FILE *ofp, m4af_ctx_t *m4af, int show_progress) { #ifdef USE_LIBSAMPLERATE //short *resamplebuf = 0; SRC_STATE* srcstate = NULL; SRC_DATA srcdata; int srcerror = 0; float *ibuf = 0; #else short *ibuf = 0; #endif int16_t *pcmbuf = 0; uint32_t pcmsize = 0; uint8_t *obuf = 0; uint32_t olen; uint32_t osize = 0; int nread = 1; int consumed, written; int rc = -1; int frames_written = 0; aacenc_progress_t progress = { 0 }; ibuf = malloc(frame_length * format->bytes_per_frame); #ifdef USE_LIBSAMPLERATE if(format->sample_rate != info->samplerate) { /* set up resampler */ srcstate = src_new(SRC_SINC_MEDIUM_QUALITY, info->channels, &srcerror); srcdata.src_ratio = format->sample_rate; srcdata.src_ratio /= info->samplerate; srcdata.data_in = ibuf; srcdata.data_out = malloc(frame_length * format->bytes_per_frame * srcdata.src_ratio); srcdata.end_of_input = 0; } #endif aacenc_progress_init(&progress, info->frames, info->samplerate); do { if (g_interrupted) nread = 0; else if (nread) { #ifdef USE_LIBSAMPLERATE if ((nread = sf_readf_float(snd, ibuf, frame_length)) < 0) { #else if ((nread = sf_readf_short(snd, ibuf, frame_length)) < 0) { #endif fprintf(stderr, "ERROR: read failed\n"); goto END; } else if (nread > 0) { float* in_buf = ibuf; #ifdef USE_LIBSAMPLERATE if(srcstate) { /* run converstion */ srcdata.input_frames = nread; srcdata.output_frames = frame_length; if(srcerror = src_process(srcstate, &srcdata)) { fprintf(stderr, "resample error: %s\n", src_strerror(srcerror)); goto END; } //printf("resampled %d samples to %d samples\n", srcdata.input_frames_used, srcdata.output_frames_gen); in_buf = srcdata.data_out; nread = srcdata.output_frames_gen; } #endif if (pcm_convert_to_native_sint16(format, in_buf, nread, &pcmbuf, &pcmsize) < 0) { fprintf(stderr, "ERROR: unsupported sample format\n"); goto END; } } if (show_progress) aacenc_progress_update(&progress, sf_seek(snd, 0, SEEK_CUR), info->samplerate * 2); } written = nread; do { if ((consumed = aac_encode_frame(encoder, format, pcmbuf + (nread-written)*info->channels, written, &obuf, &olen, &osize)) < 0) goto END; //printf("nread: %d consumed: %d olen: %d\n", nread, consumed, olen); written -= (consumed / info->channels); if (olen > 0) { if (write_sample(ofp, m4af, obuf, olen, frame_length) < 0) goto END; ++frames_written; //printf("wrote frame %d\n", frames_written); } } while (written > 0); } while (nread > 0 || olen > 0); if (show_progress) aacenc_progress_finish(&progress, sf_seek(snd, 0, SEEK_CUR)); rc = frames_written; END: if (ibuf) free(ibuf); if (pcmbuf) free(pcmbuf); if (obuf) free(obuf); #ifdef USE_SAMPLERATE if (srcstate) { free(srcdata.data_out); src_delete(srcstate); } #endif return rc; } #endif static int encode(wav_reader_t *wavf, HANDLE_AACENCODER encoder, uint32_t frame_length, FILE *ofp, m4af_ctx_t *m4af, int show_progress) { uint8_t *ibuf = 0; int16_t *pcmbuf = 0; uint32_t pcmsize = 0; uint8_t *obuf = 0; uint32_t olen; uint32_t osize = 0; int nread = 1; int consumed; int rc = -1; int frames_written = 0; aacenc_progress_t progress = { 0 }; const pcm_sample_description_t *format = wav_get_format(wavf); ibuf = malloc(frame_length * format->bytes_per_frame); aacenc_progress_init(&progress, wav_get_length(wavf), format->sample_rate); do { if (g_interrupted) nread = 0; else if (nread) { if ((nread = wav_read_frames(wavf, ibuf, frame_length)) < 0) { fprintf(stderr, "ERROR: read failed\n"); goto END; } else if (nread > 0) { if (pcm_convert_to_native_sint16(format, ibuf, nread, &pcmbuf, &pcmsize) < 0) { fprintf(stderr, "ERROR: unsupported sample format\n"); goto END; } } if (show_progress) aacenc_progress_update(&progress, wav_get_position(wavf), format->sample_rate * 2); } if ((consumed = aac_encode_frame(encoder, format, pcmbuf, nread, &obuf, &olen, &osize)) < 0) goto END; if (olen > 0) { if (write_sample(ofp, m4af, obuf, olen, frame_length) < 0) goto END; ++frames_written; } } while (nread > 0 || olen > 0); if (show_progress) aacenc_progress_finish(&progress, wav_get_position(wavf)); rc = frames_written; END: if (ibuf) free(ibuf); if (pcmbuf) free(pcmbuf); if (obuf) free(obuf); return rc; } static void put_tool_tag(m4af_ctx_t *m4af, const aacenc_param_ex_t *params, HANDLE_AACENCODER encoder) { char tool_info[256]; char *p = tool_info; LIB_INFO *lib_info = 0; p += sprintf(p, PROGNAME " %s, ", fdkaac_version); lib_info = calloc(FDK_MODULE_LAST, sizeof(LIB_INFO)); if (aacEncGetLibInfo(lib_info) == AACENC_OK) { int i; for (i = 0; i < FDK_MODULE_LAST; ++i) if (lib_info[i].module_id == FDK_AACENC) break; p += sprintf(p, "libfdk-aac %s, ", lib_info[i].versionStr); } free(lib_info); if (params->bitrate_mode) sprintf(p, "VBR mode %d", params->bitrate_mode); else sprintf(p, "CBR %dkbps", aacEncoder_GetParam(encoder, AACENC_BITRATE) / 1000); m4af_add_itmf_string_tag(m4af, M4AF_TAG_TOOL, tool_info); } static int finalize_m4a(m4af_ctx_t *m4af, const aacenc_param_ex_t *params, HANDLE_AACENCODER encoder) { unsigned i; aacenc_tag_entry_t *tag = params->tags.tag_table; if (params->json_filename) aacenc_put_tags_from_json(m4af, params->json_filename); for (i = 0; i < params->tags.tag_count; ++i, ++tag) aacenc_put_tag_entry(m4af, tag); put_tool_tag(m4af, params, encoder); if (m4af_finalize(m4af, params->moov_before_mdat) < 0) { fprintf(stderr, "ERROR: failed to finalize m4a\n"); return -1; } return 0; } static char *generate_output_filename(const char *filename, const char *ext) { char *p = 0; size_t ext_len = strlen(ext); if (strcmp(filename, "-") == 0) { p = malloc(ext_len + 6); sprintf(p, "stdin%s", ext); } else { const char *base = aacenc_basename(filename); size_t ilen = strlen(base); const char *ext_org = strrchr(base, '.'); if (ext_org) ilen = ext_org - base; p = malloc(ilen + ext_len + 1); sprintf(p, "%.*s%s", ilen, base, ext); } return p; } static int parse_raw_spec(const char *spec, pcm_sample_description_t *desc) { unsigned bits; unsigned char c_type, c_endian = 'L'; int type; if (sscanf(spec, "%c%u%c", &c_type, &bits, &c_endian) < 2) return -1; c_type = toupper(c_type); c_endian = toupper(c_endian); if (c_type == 'S') type = 1; else if (c_type == 'U') type = 2; else if (c_type == 'F') type = 4; else return -1; if (c_endian == 'B') type |= 8; else if (c_endian != 'L') return -1; if (c_type == 'F' && bits != 32 && bits != 64) return -1; if (c_type != 'F' && (bits < 8 || bits > 32)) return -1; desc->sample_type = type; desc->bits_per_channel = bits; return 0; } #ifdef USE_LIBSNDFILE static int parse_sndfile_spec_blah(SF_INFO* info, pcm_sample_description_t *desc) { int type,bits; if(info->format & SF_FORMAT_FLOAT) { type = PCM_TYPE_FLOAT; } desc->sample_type = type; desc->bits_per_channel = bits; return 0; } #endif int main(int argc, char **argv) { wav_io_context_t wav_io = { read_callback, seek_callback, tell_callback }; m4af_io_callbacks_t m4af_io = { read_callback, write_callback, seek_callback, tell_callback }; aacenc_param_ex_t params = { 0 }; int result = 2; FILE *ifp = 0; FILE *ofp = 0; char *output_filename = 0; #ifdef USE_LIBSNDFILE SNDFILE* snd = NULL; SF_INFO snd_info; pcm_sample_description_t snd_desc = { 0 }; #else wav_reader_t *wavf = 0; #endif HANDLE_AACENCODER encoder = 0; AACENC_InfoStruct aacinfo = { 0 }; m4af_ctx_t *m4af = 0; const pcm_sample_description_t *sample_format; int downsampled_timescale = 0; int frame_count = 0; struct stat stb = { 0 }; setlocale(LC_CTYPE, ""); setbuf(stderr, 0); if (parse_options(argc, argv, &params) < 0) return 1; #ifdef USE_LIBSNDFILE if ((snd = sf_open (params.input_filename, SFM_READ, &snd_info)) == NULL) { fprintf(stderr, "ERROR: broken / unsupported input file\n"); goto END; } #ifdef USE_LIBSAMPLERATE if(params.resample) { snd_desc.sample_rate = params.resample; printf("resampling to %dhz\n", snd_desc.sample_rate); } else { snd_desc.sample_rate = snd_info.samplerate; } snd_desc.sample_type = PCM_TYPE_FLOAT; // always -- libsndfile does the conversion for us snd_desc.bits_per_channel = sizeof(float)*8; #else snd_desc.sample_rate = snd_info.samplerate; snd_desc.sample_type = PCM_TYPE_SINT; // always -- libsndfile does the conversion for us snd_desc.bits_per_channel = sizeof(short)*8; #endif snd_desc.channels_per_frame = snd_info.channels; snd_desc.bytes_per_frame = snd_info.channels * (snd_desc.bits_per_channel / 8); snd_desc.channel_mask = 0; sample_format = &snd_desc; #else if ((ifp = aacenc_fopen(params.input_filename, "rb")) == 0) { aacenc_fprintf(stderr, "ERROR: %s: %s\n", params.input_filename, strerror(errno)); goto END; } if (fstat(fileno(ifp), &stb) == 0 && (stb.st_mode & S_IFMT) != S_IFREG) { wav_io.seek = 0; wav_io.tell = 0; } if (!params.is_raw) { if ((wavf = wav_open(&wav_io, ifp, params.ignore_length)) == 0) { fprintf(stderr, "ERROR: broken / unsupported input file\n"); goto END; } } else { int bytes_per_channel; pcm_sample_description_t desc = { 0 }; if (parse_raw_spec(params.raw_format, &desc) < 0) { fprintf(stderr, "ERROR: invalid raw-format spec\n"); goto END; } desc.sample_rate = params.raw_rate; desc.channels_per_frame = params.raw_channels; bytes_per_channel = (desc.bits_per_channel + 7) / 8; desc.bytes_per_frame = params.raw_channels * bytes_per_channel; if ((wavf = raw_open(&wav_io, ifp, &desc)) == 0) { fprintf(stderr, "ERROR: failed to open raw input\n"); goto END; } } sample_format = wav_get_format(wavf); #endif if (aacenc_init(&encoder, (aacenc_param_t*)&params, sample_format, &aacinfo) < 0) goto END; if (!params.output_filename) { const char *ext = params.transport_format ? ".aac" : ".m4a"; output_filename = generate_output_filename(params.input_filename, ext); params.output_filename = output_filename; } if ((ofp = aacenc_fopen(params.output_filename, "wb+")) == 0) { aacenc_fprintf(stderr, "ERROR: %s: %s\n", params.output_filename, strerror(errno)); goto END; } handle_signals(); if (!params.transport_format) { uint32_t scale; unsigned framelen = aacinfo.frameLength; int sbr_mode = aacenc_is_sbr_active((aacenc_param_t*)&params); int sig_mode = aacEncoder_GetParam(encoder, AACENC_SIGNALING_MODE); if (sbr_mode && !sig_mode) downsampled_timescale = 1; scale = sample_format->sample_rate >> downsampled_timescale; if ((m4af = m4af_create(M4AF_CODEC_MP4A, scale, &m4af_io, ofp)) < 0) goto END; m4af_set_decoder_specific_info(m4af, 0, aacinfo.confBuf, aacinfo.confSize); m4af_set_fixed_frame_duration(m4af, 0, framelen >> downsampled_timescale); m4af_set_priming_mode(m4af, params.gapless_mode + 1); m4af_begin_write(m4af); } #ifdef USE_LIBSNDFILE frame_count = encode_sndfile(snd, &snd_info, &snd_desc, encoder, aacinfo.frameLength, ofp, m4af, !params.silent); #else frame_count = encode(wavf, encoder, aacinfo.frameLength, ofp, m4af, !params.silent); #endif if (frame_count < 0) goto END; if (m4af) { uint32_t delay = aacinfo.nDelay; #ifdef USE_LIBSNDFILE int64_t frames_read = sf_seek(snd, 0, SEEK_CUR); #else int64_t frames_read = wav_get_position(wavf); #endif uint32_t padding = frame_count * aacinfo.frameLength - frames_read - delay; m4af_set_priming(m4af, 0, delay >> downsampled_timescale, padding >> downsampled_timescale); if (finalize_m4a(m4af, &params, encoder) < 0) goto END; } result = 0; END: #ifdef USE_LIBSNDFILE if (snd) sf_close(snd); #else if (wavf) wav_teardown(&wavf); if (ifp) fclose(ifp); #endif if (m4af) m4af_teardown(&m4af); if (ofp) fclose(ofp); if (encoder) aacEncClose(&encoder); if (output_filename) free(output_filename); if (params.tags.tag_table) free(params.tags.tag_table); return result; }
30,703
https://github.com/kollerfuzzi/KollerVaro/blob/master/src/at/kollerfuzzi/varo/Varo.java
Github Open Source
Open Source
MIT
null
KollerVaro
kollerfuzzi
Java
Code
383
1,400
package at.kollerfuzzi.varo; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.UUID; import java.util.logging.Level; import java.util.stream.Collectors; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class Varo implements Serializable { private List<Team> teams; private static String dir; public Varo() { teams = new ArrayList<>(); } public void addTeam(Team toAdd, CommandSender sender) { boolean doAdd = true; for (Team tm: teams) { if(tm.getTeamName().equalsIgnoreCase(toAdd.getTeamName())) { sender.sendMessage("Teamname \"" + tm.getTeamName() + "\" is already used!"); doAdd = false; } for(int i = 0; i < tm.getPlayers().size(); ++i) { for(int j = 0; j < toAdd.getPlayers().size(); ++j) { if(tm.getPlayers().get(i).equals(toAdd.getPlayers().get(j))){ sender.sendMessage("Player \"" + tm.getPlayers().get(i) + "\" is already in a team"); doAdd = false; } } } } if(doAdd) { teams.add(toAdd); serialize(); sender.sendMessage("Added team \"" + toAdd.getTeamName() + "\" with members: " + toAdd.getPlayers().stream().collect(Collectors.joining(", "))); } } public void removeTeam(String toRemoveName, CommandSender sender) { Optional<Team> foundTeam = teams.stream().filter(t -> t.getTeamName().equalsIgnoreCase(toRemoveName)).findAny(); if(foundTeam.isPresent()) { teams.remove(foundTeam.get()); serialize(); sender.sendMessage("Team \"" + toRemoveName + "\" deleted"); } else { sender.sendMessage("Team \"" + toRemoveName + "\" not found!"); } } public void sendTeamList(CommandSender sender) { if(teams.size() != 0) { StringBuilder str = new StringBuilder("===TEAMS==="); teams.stream().sorted((a, b) -> a.getTeamName().compareTo(b.getTeamName())).forEach(tm -> { str.append("\n" + tm.getTeamName().toUpperCase() + ": "); str.append(tm.getPlayers().stream().sorted().collect(Collectors.joining(", "))); }); sender.sendMessage(str.toString()); } else { sender.sendMessage("No teams created."); } } public List<Team> getTeams() { return teams; } public Team getTeam(String name) { Optional<Team> tm = teams.stream().filter(t -> t.getTeamName().equalsIgnoreCase(name)).findAny(); if(tm.isPresent()) { return tm.get(); } else { return null; } } public Team getPlayerTeam(String playerName) { Optional<Team> tm = teams.stream().filter(t -> t.getPlayers().contains(playerName)).findAny(); if(tm.isPresent()) { return tm.get(); } else { return null; } } public boolean areInSameTeam(String p1, String p2) { Team p1team = getPlayerTeam(p1); Team p2team = getPlayerTeam(p2); if(p1team != null && p2team != null) { return p1team == p2team; } else { return false; } } public void serialize() { try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(dir+File.separator+"teams.kv"))){ oos.writeObject(this); } catch (IOException e) { Bukkit.getLogger().log(Level.WARNING, "There was an error while saving!", e); } } public static Varo deserialize() { Varo v = null; try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(dir + File.separator + "teams.kv"))){ v = (Varo)ois.readObject(); } catch (ClassNotFoundException | IOException e) { Bukkit.getLogger().log(Level.WARNING, "There was an error while loading!"); } return v; } public static void setDir(String dir) { Varo.dir = dir; } }
858
https://github.com/jan--f/grafana/blob/master/scripts/benchmarks/ab/ab_test.sh
Github Open Source
Open Source
Apache-2.0
2,022
grafana
jan--f
Shell
Code
12
94
#!/bin/bash ab -n 20000 -c 100 -H "Authorization: Bearer vEustw23NSOZ27y3zlj28ZL3B7BpBk5kqR85DOfT5AwiS3nCi33dnsk6nhvXhZdn" \ http://localhost:3000/api/dashboards/db/dash1
28,124
https://github.com/cq-pandora/projects/blob/master/services/parser/bin/CQSpritesDecompiler/Assets/TK2DROOT/tk2dUI/Code/Controls.meta
Github Open Source
Open Source
MIT
2,023
projects
cq-pandora
Unity3D Asset
Code
4
28
fileFormatVersion: 2 guid: 84543cf2ceb2f374281fcc14dff64798
9,185
https://github.com/Kevincavender/The-Ends/blob/master/the_ends/functions.py
Github Open Source
Open Source
BSD-3-Clause
2,018
The-Ends
Kevincavender
Python
Code
631
1,430
import re ''' Write function to identify functions being called example syntax:? separate "function(" from: "x=2*5+function(x=x, 5, 12^(2-1))" example output (Updated 10/26/2018): return {'function_name': 'function', 1:"x", 2: "5", 3: "12^(2-1)"} write as a python function with a single line string as the input Include a test case at bottom: 2018-10-22 Kevin Cavender Instructions for Sev on requested python function # TODO .... Maybe..... -determine if a variable of a function is a unlisted function??? >>> yes, but first is adding a single function SQRT? and integrating it into everything else -create a full program break for the related syntax errors >>>This will be pushed more to the future -replace .append method with marginally faster numpy.zeros() method >>>staying with python standard library wherever possible (re is included in this) -run the_ends_test >>> FunctionsUnitTest.py >>> This will help us refine the functionality of this as we progress. Makes is a pass/fail condition for whether things are as we both expect them to act. Functions initially to be integrated: SQRT() square root (obvious function) ABS() absolute value (again, obvious) 2018-10-26 Kevin added Notes ''' def function_finder(equ, debug=False): """ Finds all functions and how many within a single string Define name for each function and create a returnable list of names """ fun_list1 = re.findall(r'\w+\(', equ, flags=0) number_of_functions = len(fun_list1) if number_of_functions == 0: return [], [] # might want to change this depending on other functions fun_list = [] for i in range(number_of_functions): fun_list.append(fun_list1[i][:-1]) # figure out index of each open and close parentheses # start of variable space start_list = [] for j in range(number_of_functions): start_list.append(re.search(re.escape(fun_list[j]), equ).end()) # TODO can these be combine to limit the number of looping sections? # figures out indexes of all parentheses parentheses_ranges = {} # soon to be filled dictionary of ranges # ................................................................. # TODO Replace this section with EquationErrorCheck.EquationErrorCheck() # Should be good practice dealing with multiple files # ____________________________________________________________ hold = [] # for i, c in enumerate(equ): if c == '(': hold.append(i) if c == ')': try: parentheses_ranges[hold.pop()] = i except IndexError: print('Syntax Error: Too many closing parentheses') raise if hold: # check if stack is empty afterwards # print('Syntax Error: Too many opening parentheses') raise SyntaxError # .................................................................. function_ranges = [] # indices of only the functions for k in range(number_of_functions): function_ranges.append((start_list[k], parentheses_ranges[start_list[k]])) # extract string, parse and return a dictionary of variables for each function variable_dictionary_list = [] # returned list of dictionaries for n in range(number_of_functions): extracted_string = equ[function_ranges[n][0] + 1:function_ranges[n][1]] # extracts string # removes spaces. might be obsolete # will already be done # TODO remove this, it should be done before the string gets to this function # extracted_string = og_string.replace(' ', '') # if statement about functions inside functions. remove to make good program # why are you looping to find errors? for m in range(number_of_functions): if fun_list[m] in extracted_string: print('Syntax Error: Nested Function') raise SyntaxError # add something to kill everything # raise SyntaxError will kill everything and tell the user there is a syntax error pass extracted_strings = re.split(r"[=\\,]", extracted_string) # will be problem if you want nested functions # deals with x=x issue if extracted_strings[0] == extracted_strings[1]: extracted_strings.pop(0) # creates a dictionary out of the extracted string var_dictionary = {} for b in range(len(extracted_strings)): var_dictionary[b + 1] = extracted_strings[b] variable_dictionary_list.append(var_dictionary) if debug is True: # TODO Make debug here much more detailed printout print("DEBUG: Functions.py") print("Input string: " + equ) print(function_ranges) print(fun_list) print(fun_list1) print("\nOutput: \n") # return values return fun_list, variable_dictionary_list if __name__ == "__main__": print("\nTesting Functions.py.......\n") # I jumped down the rabbit hole of test cases but I want to # be sure on what you are looking for before going crazy # so I just did something simple equ = 'x=2*5+function1(( x=x, 5/4, 12^(2-1)), 8) * function2(y, 7, 11*(y-3))' print(function_finder(equ, debug=True))
48,097
https://github.com/Parichaymandal/ProjectManager/blob/master/app/Http/Controllers/EmployeeController.php
Github Open Source
Open Source
MIT
null
ProjectManager
Parichaymandal
PHP
Code
255
867
<?php namespace App\Http\Controllers; use App\Employee; use App\User; use Illuminate\Http\Request; use App\Http\Requests; use Illuminate\Support\Facades\Auth; class EmployeeController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $user = Auth::user(); return view('create_employee', compact('user')); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $input = $request->all(); $emp = Employee::create($input); $user = Auth::user(); $user->employee()->save($emp); if($user->isCompany == 1) return redirect('company'); return redirect('main_dashboard'); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $u = User::find($id); // dd($user->employee); $auth_user = Auth::user(); $pp = 'files/'.$u->employee->profile_picture; $auth_pp = 'files/'.$auth_user->employee->profile_picture; return view('member_profile_new', compact(['u','pp','auth_pp'])); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $employee = Employee::find($id); $employee->update([ 'name' => $request->name, 'email' => $request->email, ]); //file $filename = null; if($request->hasFile('file')) { $destinationPath="files"; $file = $request->file('file'); $filename=$file->getClientOriginalName(); $request->file('file')->move($destinationPath,$filename); // $job->update(['file'=> $filename]); } $employee->update(['profile_picture'=> $filename]); $user = $employee->auth; $pp = 'files/'.$employee->profile_picture; return view('member_profile_new', compact(['user','pp'])); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } }
44,078
https://github.com/dolittle-samples/eCommerce/blob/master/Source/Shop/Web/styles/Components/all.scss
Github Open Source
Open Source
MIT
null
eCommerce
dolittle-samples
SCSS
Code
2
8
@import "option-list";
10,289
https://github.com/gistia/covalent/blob/master/src/app/components/echarts/getting-started/getting-started.component.ts
Github Open Source
Open Source
MIT
2,019
covalent
gistia
TypeScript
Code
23
103
import { Component, ChangeDetectionStrategy } from '@angular/core'; @Component({ selector: 'getting-started', templateUrl: './getting-started.component.html', styleUrls: ['./getting-started.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: true, }) export class GettingStartedComponent {}
41,515
https://github.com/code4a/JLibraryDemo/blob/master/app/src/main/java/com/code4a/jlibrarydemo/splash/SplashPresenterImpl.java
Github Open Source
Open Source
Apache-2.0
2,016
JLibraryDemo
code4a
Java
Code
86
412
package com.code4a.jlibrarydemo.splash; import com.code4a.jlibrarydemo.JLibraryApp; import com.code4a.jlibrarydemo.commoninteractor.GankCommonInteractor; import com.code4a.jlibrarydemo.commoninteractor.GankCommonInteractorImpl; import com.code4a.jlibrarydemo.data.GirlsBean; import com.code4a.jlibrarydemo.utils.Constants; /** * Created by code4a on 2017/1/12. */ public class SplashPresenterImpl extends SplashPresenter { private GankCommonInteractor gankCommonInteractor; protected SplashPresenterImpl(SplashView view) { super(view); this.gankCommonInteractor = new GankCommonInteractorImpl(); } @Override public void start() { gankCommonInteractor.getRes(Constants.FULI, new GankCommonInteractor.LoadSplashResListener() { @Override public void onResLoaded(GirlsBean girlsBean) { getView().showGirl(girlsBean.getResults().get(0).getUrl()); JLibraryApp.currentGirl = girlsBean.getResults().get(0).getUrl(); } @Override public void onDataNotAvailable() { getView().showGirl(); } }); } @Override public void cancel() { gankCommonInteractor.cancel(); } @Override public void releaseRes() { release(); gankCommonInteractor = null; } }
11,613
https://github.com/jvanderbiest/global-azure-bootcamp-2019/blob/master/snippets/06-OnTurnAsync-ComputerVision.snippet
Github Open Source
Open Source
MIT
2,019
global-azure-bootcamp-2019
jvanderbiest
Vim Snippet
Code
35
208
<?xml version="1.0" encoding="utf-8"?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>06-OnTurnAsync-ComputerVision</Title> </Header> <Snippet> <Code Language="csharp"> <![CDATA[ var attachment = messageActivity.Attachments?.FirstOrDefault(); if (string.IsNullOrEmpty(messageActivity.Text) && attachment != null) { await HandleComputerVision(turnContext, attachment, cancellationToken); } ]]> </Code> </Snippet> </CodeSnippet> </CodeSnippets>
30,374
https://github.com/Vukelic/WindGenerator-backend/blob/master/WindGeneratorService/DtoServiceDAL/Interfaces/WindGeneratorDevice_History/IDtoWindGeneratorDevice_HistoryDAL.cs
Github Open Source
Open Source
MIT
null
WindGenerator-backend
Vukelic
C#
Code
26
152
using DtoModel.DtoModels.Implementations.WindGeneratorDevice_History; using DtoModel.DtoResponseObjectModels.WindGeneratorDevice_History; using DtoServiceDAL.Interfaces.Common; using System; using System.Collections.Generic; using System.Text; namespace DtoServiceDAL.Interfaces.WindGeneratorDevice_History { public interface IDtoWindGeneratorDevice_HistoryDAL : IDtoObjectBaseDAL<long, DtoWindGeneratorDevice_History, DtoWindGeneratorDevice_HistoryResponse, DtoWindGeneratorDevice_HistoryListResponse> { } }
10,127
https://github.com/1688KAI/InternetArchitect/blob/master/24 JVM/JVM/src/com/mashibing/jvm/Hello.java
Github Open Source
Open Source
Apache-2.0
null
InternetArchitect
1688KAI
Java
Code
14
45
package com.mashibing.jvm; public class Hello { public void m() { System.out.println("Hello JVM!"); } }
48,107
https://github.com/bhuppal/golang-project/blob/master/go.mod
Github Open Source
Open Source
MIT
2,021
golang-project
bhuppal
Go Module
Code
4
23
module github.com/bhuppal/golang-project go 1.16
29,837
https://github.com/fereeh/ezEngine/blob/master/Code/Engine/Foundation/Memory/Policies/AlignedHeapAllocation.h
Github Open Source
Open Source
MIT
2,021
ezEngine
fereeh
C
Code
69
331
#pragma once #include <Foundation/Basics.h> namespace ezMemoryPolicies { /// \brief Aligned Heap memory allocation policy. /// /// \see ezAllocator class ezAlignedHeapAllocation { public: EZ_ALWAYS_INLINE ezAlignedHeapAllocation(ezAllocatorBase* pParent) {} EZ_ALWAYS_INLINE ~ezAlignedHeapAllocation() {} void* Allocate(size_t uiSize, size_t uiAlign); void Deallocate(void* ptr); EZ_ALWAYS_INLINE ezAllocatorBase* GetParent() const { return nullptr; } }; #if EZ_ENABLED(EZ_PLATFORM_WINDOWS) #include <Foundation/Memory/Policies/Win/AlignedHeapAllocation_win.h> #elif EZ_ENABLED(EZ_PLATFORM_OSX) || EZ_ENABLED(EZ_PLATFORM_LINUX) || EZ_ENABLED(EZ_PLATFORM_ANDROID) #include <Foundation/Memory/Policies/Posix/AlignedHeapAllocation_posix.h> #else #error "ezAlignedHeapAllocation is not implemented on current platform" #endif }
39,853
https://github.com/hampus4git/notes/blob/master/src/test/java/com/example/documentApp/resources/HTTPHelper.java
Github Open Source
Open Source
Apache-2.0
null
notes
hampus4git
Java
Code
128
481
package com.example.documentApp.resources; import com.example.documentApp.core.Response; import com.fasterxml.jackson.databind.ObjectMapper; import io.dropwizard.testing.junit.ResourceTestRule; import javax.ws.rs.client.Entity; import java.util.Base64; public class HTTPHelper { private static ObjectMapper objectMapper = new ObjectMapper(); public static Response post(ResourceTestRule resource, String url, Entity json) throws Exception{ javax.ws.rs.core.Response httpResponse = resource.target(url).request().post(json); String jsonString = httpResponse.readEntity(String.class); return objectMapper.readValue(jsonString, Response.class); } public static Response post(ResourceTestRule resource, String url, Entity json, String username, String password) throws Exception{ String encodedUsernamePassword = base64Encode(username+":"+password); javax.ws.rs.core.Response httpResponse = resource.target(url).request().header("Authorization", "Basic " + encodedUsernamePassword).post(json); String jsonString = httpResponse.readEntity(String.class); return objectMapper.readValue(jsonString, Response.class); } public static Response get(ResourceTestRule resource, String url, String username, String password) throws Exception{ String encodedUsernamePassword = base64Encode(username+":"+password); javax.ws.rs.core.Response httpResponse = resource.target(url).request().header("Authorization", "Basic " + encodedUsernamePassword).get(); String jsonString = httpResponse.readEntity(String.class); return objectMapper.readValue(jsonString, Response.class); } private static String base64Encode(String s){ byte[] bytesEncoded = Base64.getEncoder().encode(s.getBytes()); return new String(bytesEncoded); } }
26,959
https://github.com/duangsuse/Share/blob/master/HTMLs/school/animjs/equery.rect.js
Github Open Source
Open Source
MIT
2,022
Share
duangsuse
JavaScript
Code
105
678
Object.assign(["equery","ext","rect"].reduce((o,k)=>(o[k]=o[k]||{}),this), (ref=>({ Point: _.defineOps(class Point { plus_(p1){let p=this; p.x+=p1.x,p.y+=p1.y;} neg_(){let p=this; p.x=-p.x,p.y=-p.y;} minus_(p1){this.plus_(p1.neg())} times_(p1){let p=this; p.x*=p1.x,p.y*=p1.y;} div_(p1){let p=this; p.x/=p1.x,p.y/=p1.y;} cmp(p1)/*[isAtLeft,isUpper]*/{let g=Math.sign; return new Point(g(p.x-p1.x), g(p1.y-p.y))} }, "p +-*/~ p1 x y"), Rect:ref.Rect, Area: class extends ref.Rect { constructor(x,y,w,h){ if(x instanceof Image){this.setXY(0,0); return super(x)} this.setXY(x,y);this.setWH(w,h); } contains(p){} randPoint(){} *chunked(dx,dy){ for(let y of range(0,this.h,dy)) for(let x of range(0,this.w,dx)) yield new Area(x,y,dx,dy) } chunkedN(nx,ny){let m=this; return m.chunked(div(m.w,nx), div(m.h,ny))} nineSplit(x,y,xw,yh) {} nineSplitOf(kind,pad){} fourSplit(ord,x,y,xw,yh){} fourSplitOf(kind,pad){} clipSpirit(e) {let m=this; r.style.cssText+=`width:${m.w}px;height:${m.h}px;background-position:${m.x}px ${m.y}px;`;} static calign(is_horz, boxs, pad=0) {} static anchor(kind, box0, box) {} //product("l c r".strs, "t c b".strs) }, posited(r,x,y){} }) )({ Rect: class { constructor(w,h){if(w instanceof Image)this.setWH(x.naturalWidth,x.naturalHeight);} area(){return this.w*this.h} } }))
42,098
https://github.com/amirdaly/zarela-WebApp/blob/master/src/theme.js
Github Open Source
Open Source
MIT
null
zarela-WebApp
amirdaly
JavaScript
Code
95
380
export const theme = { maxWidth: '1255px', // colors primary: '#7246D0', primaryFaded: '#7246d029', secondary: 'rgba(126, 162, 253, 0.4)', success: '#3ADEA3', navLinkColor: '#8B72DE', navLinkDisabled: '#E3DDFA', notificationColor: '#2EECA8', textPrimary: '#121213', textSecondary: '#6DA5BF', textToken: '#3C87AA', // spacing spacing: (val) => { const BASE = 10; return BASE * val + 'px'; }, // typography title: '28px', body: '14px', bod2: '16px', badge: '12px', bold: 700, semiBold: 500, regular: 400, light: 300, // breakpoints desktop_md_breakpoint: '1440px', desktop_sm_breakpoint: '1170px', tablet_sm_breakpoint: '768px', mobile_sm_breakpoint: '450px', mobile_xs_breakpoint: '320px', // elevation levels z_mobileSlideMenu: 70, z_header: 60, z_bottomNav: 50, z_modal: 55, z_tooltip: 20, z_spinner: 30, };
6,060
https://github.com/tchenkov/JavaScript-Advanced/blob/master/L03. Exercise - DOM Manipulations/04. Sections/04. Sections.js
Github Open Source
Open Source
MIT
null
JavaScript-Advanced
tchenkov
JavaScript
Code
46
155
function create(sentences) { let contentDiv = document.getElementById('content'); contentDiv.setAttribute('id', 'content'); for (let text of sentences) { let div = document.createElement('div'); let p = document.createElement('p'); p.style.display = 'none'; p.textContent = text; div.appendChild(p); div.addEventListener('click', toggleText); contentDiv.appendChild(div); } function toggleText() { let p = this.children[0]; p.style.display = ''; } }
8,589
https://github.com/Neuheit/DSharpPlus/blob/master/DSharpPlus/EventArgs/GuildUpdateEventArgs.cs
Github Open Source
Open Source
MIT
2,021
DSharpPlus
Neuheit
C#
Code
70
170
using DSharpPlus.Entities; namespace DSharpPlus.EventArgs { /// <summary> /// Represents arguments for <see cref="DiscordClient.GuildUpdated"/> event. /// </summary> public class GuildUpdateEventArgs : DiscordEventArgs { /// <summary> /// Gets the guild before it was updated. /// </summary> public DiscordGuild GuildBefore { get; internal set; } /// <summary> /// Gets the guild after it was updated. /// </summary> public DiscordGuild GuildAfter { get; internal set; } internal GuildUpdateEventArgs() : base() { } } }
32,830
https://github.com/michaelwang/study/blob/master/avalon/practice/avalon-test-ui/vendor/avalon.oniui/pages/index/styles/_apis.scss
Github Open Source
Open Source
BSD-3-Clause
2,017
study
michaelwang
SCSS
Code
248
913
@import "global"; .api-content-wrap{ height: 100%; overflow: auto; background-color: #fff; .api-content{ position: relative; padding: 40px 60px; &:before { content: ""; position: absolute; top: 0; left: 0; border-width: 12px; border-color: $color-theme-blue transparent transparent $color-theme-blue; border-style: solid; } p, fieldset{ position: relative; max-width: 100%; margin: 80px 0 0; padding: 30px; background-color: #f9fafe; border: 1px $color-border-grey solid; >legend{ position: absolute; top: -50px; left: 0; padding: 0 0 0 10px; font-size: 18px; border-left: 4px $color-theme-blue solid; } } p{ margin: 10px 0; } .table-doc{ width: 100%; margin: 0 0 30px; border: 1px $color-border-grey solid; border-collapse: collapse; background-color: #fff; th,td{ padding: 20px; border: 1px $color-border-grey solid; word-break: break-all; } th{ font-weight: normal; background-color: #2c2f34; color: #fff } td{ border-width: 1px 0; vertical-align: top; } } dt{ margin: 40px 0 0; padding: 0 0 0 10px; font-size: 18px; border-left: 4px $color-theme-blue solid; } dd, blockquote{ margin: 10px 0; padding: 30px; background-color: #f9fafe; border: 1px $color-border-grey solid; } ul, ol{ >li{ background-color: #fff; border: 1px $color-border-grey solid; padding: 5px; margin: 5px 0; } } a{ color: $color-theme-blue; } button{ @include inline-block; height: 32px; line-height: 30px; padding: 0px 15px; border: 1px #aaa solid; font-size: 14px; border-radius: 3px; color: #555; background-color: #fff; outline: none; cursor: pointer; &:hover{ color: #111; border-color: #666; } } input{ @include inline-block; height: 32px; padding: 0 5px; line-height: 30px; border: 1px #aaa solid; font-size: 14px; outline: none; border-radius: 3px; color: #555; background-color: #fff; &[disabled], &[readonly]{ background-color: #ccc; } &[type="submit"]{ padding: 0px 15px; cursor: pointer; &:hover{ color: #111; border-color: #666; } } } } }
44,060
https://github.com/richard-ma/Gondwana/blob/master/tests/test_channel.py
Github Open Source
Open Source
MIT
2,021
Gondwana
richard-ma
Python
Code
136
497
#!/usr/bin/env python # encoding: utf-8 def test_empty_database(client): response = client.get('/channel/index') assert response.status_code == 200 # confirm message assert b'No channels here.' in response.data # confirm Create Channel Button assert b'Create Channel</a>' in response.data def test_channel_create_form(client): response = client.get('/channel/create') assert response.status_code == 200 # confirm form assert b'inputName' in response.data assert b'inputWebsite' in response.data assert b'inputEmail' in response.data assert b'inputApikey' in response.data assert b'<button type="submit" class="btn btn-primary">Save</button>' in response.data def test_create_channel(client): # test channel test_channel_data = dict( inputName='test_channel_name', inputWebsite='http://test_channel_website.com', inputEmail='test@test_channel.com', inputApikey='test_channel_api_key', ) response = client.post( '/channel/create', data=test_channel_data, follow_redirects=True ) # confirm flash message assert b'<strong>SUCCESS:</strong> <span>Channel has been created!</span>' in response.data # confirm channel information assert bytes(test_channel_data['inputName'], encoding='utf8') in response.data assert bytes(test_channel_data['inputWebsite'], encoding='utf8') in response.data assert bytes(test_channel_data['inputEmail'], encoding='utf8') in response.data assert bytes(test_channel_data['inputApikey'], encoding='utf8') in response.data # confirm operation button assert b'Edit</a>' in response.data assert b'Delete</a>' in response.data
12,532
https://github.com/fabiel-leon/shlink-web-client/blob/master/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx
Github Open Source
Open Source
MIT
2,020
shlink-web-client
fabiel-leon
TSX
Code
230
848
import { shallow, ShallowWrapper } from 'enzyme'; import { ButtonDropdown, DropdownItem } from 'reactstrap'; import { Mock } from 'ts-mockery'; import createShortUrlsRowMenu from '../../../src/short-urls/helpers/ShortUrlsRowMenu'; import PreviewModal from '../../../src/short-urls/helpers/PreviewModal'; import QrCodeModal from '../../../src/short-urls/helpers/QrCodeModal'; import { ReachableServer } from '../../../src/servers/data'; import { ShortUrl } from '../../../src/short-urls/data'; describe('<ShortUrlsRowMenu />', () => { let wrapper: ShallowWrapper; const DeleteShortUrlModal = () => null; const EditTagsModal = () => null; const EditMetaModal = () => null; const EditShortUrlModal = () => null; const selectedServer = Mock.of<ReachableServer>({ id: 'abc123' }); const shortUrl = Mock.of<ShortUrl>({ shortCode: 'abc123', shortUrl: 'https://doma.in/abc123', }); const createWrapper = () => { const ShortUrlsRowMenu = createShortUrlsRowMenu( DeleteShortUrlModal, EditTagsModal, EditMetaModal, EditShortUrlModal, () => null, ); wrapper = shallow(<ShortUrlsRowMenu selectedServer={selectedServer} shortUrl={shortUrl} />); return wrapper; }; afterEach(() => wrapper?.unmount()); it('renders modal windows', () => { const wrapper = createWrapper(); const deleteShortUrlModal = wrapper.find(DeleteShortUrlModal); const editTagsModal = wrapper.find(EditTagsModal); const previewModal = wrapper.find(PreviewModal); const qrCodeModal = wrapper.find(QrCodeModal); const editModal = wrapper.find(EditShortUrlModal); expect(deleteShortUrlModal).toHaveLength(1); expect(editTagsModal).toHaveLength(1); expect(previewModal).toHaveLength(1); expect(qrCodeModal).toHaveLength(1); expect(editModal).toHaveLength(1); }); it('renders correct amount of menu items', () => { const wrapper = createWrapper(); const items = wrapper.find(DropdownItem); expect(items).toHaveLength(8); expect(items.find('[divider]')).toHaveLength(1); }); describe('toggles state when toggling modals or the dropdown', () => { const assert = (modalComponent: Function) => { const wrapper = createWrapper(); expect(wrapper.find(modalComponent).prop('isOpen')).toEqual(false); wrapper.find(modalComponent).prop('toggle')(); expect(wrapper.find(modalComponent).prop('isOpen')).toEqual(true); }; it('DeleteShortUrlModal', () => assert(DeleteShortUrlModal)); it('EditTagsModal', () => assert(EditTagsModal)); it('PreviewModal', () => assert(PreviewModal)); it('QrCodeModal', () => assert(QrCodeModal)); it('EditShortUrlModal', () => assert(EditShortUrlModal)); it('EditShortUrlModal', () => assert(ButtonDropdown)); }); });
10,723
https://github.com/glopesdev/bonsai/blob/master/Bonsai.Vision.Design/IplImageInputRectangleEditor.cs
Github Open Source
Open Source
MIT
null
bonsai
glopesdev
C#
Code
54
138
namespace Bonsai.Vision.Design { /// <summary> /// Provides a user interface for visually editing a rectangular region on top /// of the input image sequence. /// </summary> public class IplImageInputRectangleEditor : IplImageRectangleEditor { /// <summary> /// Initializes a new instance of the <see cref="IplImageInputRectangleEditor"/> class. /// </summary> public IplImageInputRectangleEditor() : base(DataSource.Input) { } } }
23,919
https://github.com/xzccfzy/servicecomb-service-center/blob/master/datasource/etcd/event/instance_event_handler.go
Github Open Source
Open Source
Apache-2.0
null
servicecomb-service-center
xzccfzy
Go
Code
493
1,710
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package event import ( "context" "github.com/apache/servicecomb-service-center/datasource/etcd/cache" "github.com/apache/servicecomb-service-center/datasource/etcd/kv" "github.com/apache/servicecomb-service-center/datasource/etcd/path" "github.com/apache/servicecomb-service-center/datasource/etcd/sd" serviceUtil "github.com/apache/servicecomb-service-center/datasource/etcd/util" "github.com/apache/servicecomb-service-center/pkg/log" "github.com/apache/servicecomb-service-center/pkg/util" "github.com/apache/servicecomb-service-center/server/core" "github.com/apache/servicecomb-service-center/server/metrics" "github.com/apache/servicecomb-service-center/server/notify" pb "github.com/go-chassis/cari/discovery" "strings" ) const ( increaseOne = 1 decreaseOne = -1 ) // InstanceEventHandler is the handler to handle: // 1. report instance metrics // 2. recover the instance quota // 3. publish the instance events to the subscribers // 4. reset the find instance cache type InstanceEventHandler struct { } func (h *InstanceEventHandler) Type() sd.Type { return kv.INSTANCE } func (h *InstanceEventHandler) OnEvent(evt sd.KvEvent) { action := evt.Type instance := evt.KV.Value.(*pb.MicroServiceInstance) providerID, providerInstanceID, domainProject := path.GetInfoFromInstKV(evt.KV.Key) idx := strings.Index(domainProject, "/") domainName := domainProject[:idx] projectName := domainProject[idx+1:] var count float64 = increaseOne switch action { case pb.EVT_INIT: metrics.ReportInstances(domainName, count) ms := serviceUtil.GetServiceFromCache(domainProject, providerID) if ms == nil { log.Warnf("caught [%s] instance[%s/%s] event, endpoints %v, get cached provider's file failed", action, providerID, providerInstanceID, instance.Endpoints) return } frameworkName, frameworkVersion := getFramework(ms) metrics.ReportFramework(domainName, projectName, frameworkName, frameworkVersion, count) return case pb.EVT_CREATE: metrics.ReportInstances(domainName, count) case pb.EVT_DELETE: count = decreaseOne metrics.ReportInstances(domainName, count) if !core.IsDefaultDomainProject(domainProject) { projectName := domainProject[idx+1:] serviceUtil.RemandInstanceQuota( util.SetDomainProject(context.Background(), domainName, projectName)) } } if notify.Center().Closed() { log.Warnf("caught [%s] instance[%s/%s] event, endpoints %v, but notify service is closed", action, providerID, providerInstanceID, instance.Endpoints) return } // 查询服务版本信息 ctx := context.WithValue(context.WithValue(context.Background(), util.CtxCacheOnly, "1"), util.CtxGlobal, "1") ms, err := serviceUtil.GetService(ctx, domainProject, providerID) if ms == nil { log.Errorf(err, "caught [%s] instance[%s/%s] event, endpoints %v, get cached provider's file failed", action, providerID, providerInstanceID, instance.Endpoints) return } frameworkName, frameworkVersion := getFramework(ms) metrics.ReportFramework(domainName, projectName, frameworkName, frameworkVersion, count) log.Infof("caught [%s] service[%s][%s/%s/%s/%s] instance[%s] event, endpoints %v", action, providerID, ms.Environment, ms.AppId, ms.ServiceName, ms.Version, providerInstanceID, instance.Endpoints) // 查询所有consumer consumerIDs, _, err := serviceUtil.GetAllConsumerIds(ctx, domainProject, ms) if err != nil { log.Errorf(err, "get service[%s][%s/%s/%s/%s]'s consumerIDs failed", providerID, ms.Environment, ms.AppId, ms.ServiceName, ms.Version) return } PublishInstanceEvent(evt, domainProject, pb.MicroServiceToKey(domainProject, ms), consumerIDs) } func NewInstanceEventHandler() *InstanceEventHandler { return &InstanceEventHandler{} } func PublishInstanceEvent(evt sd.KvEvent, domainProject string, serviceKey *pb.MicroServiceKey, subscribers []string) { defer cache.FindInstances.Remove(serviceKey) if len(subscribers) == 0 { return } response := &pb.WatchInstanceResponse{ Response: pb.CreateResponse(pb.ResponseSuccess, "Watch instance successfully."), Action: string(evt.Type), Key: serviceKey, Instance: evt.KV.Value.(*pb.MicroServiceInstance), } for _, consumerID := range subscribers { // TODO add超时怎么处理? evt := notify.NewInstanceEventWithTime(consumerID, domainProject, evt.Revision, evt.CreateAt, response) err := notify.Center().Publish(evt) if err != nil { log.Errorf(err, "publish event[%v] into channel failed", evt) } } }
14,535
https://github.com/ntrajic/hubble-ui/blob/master/client/src/components/Clusters/state/types.ts
Github Open Source
Open Source
Apache-2.0
2,020
hubble-ui
ntrajic
TypeScript
Code
136
239
// Copyright 2019 Authors of Hubble // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import { Cluster, DiscoverClusterResult } from "../../../graphqlTypes"; export interface ClusterWithSelected { readonly selected: boolean; readonly cluster: Cluster; } export interface State { readonly fetching: boolean; readonly clusters: Cluster[]; readonly fetchedOkAtLeastOnce: boolean; readonly discoveryResult: DiscoverClusterResult | null; readonly discovering: boolean; }
48,090
https://github.com/jatowler/simple_webserver/blob/master/client3.py
Github Open Source
Open Source
MIT
null
simple_webserver
jatowler
Python
Code
103
389
#!/usr/bin/env python """Load a server with lots of requests.""" import argparse import os import socket SERVER_ADDRESS = 'localhost', 8888 REQUEST = b'''\ GET /hello HTTP/1.1 Host: localhost:8888 ''' def main(max_clients, max_conns): socks = [] print 'Connecting {} clients {} times'.format(max_clients, max_conns) for client_num in range(max_clients): pid = os.fork() if pid == 0: # we're a child for connection_num in range(max_conns): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(SERVER_ADDRESS) sock.sendall(REQUEST) socks.append(sock) print connection_num os._exit(0) if __name__ == "__main__": parser = argparse.ArgumentParser( description='Test client for LSBAWS', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--max-conns', type=int, default=1024, help='Maximum number of connections per client.') parser.add_argument('--max-clients', type=int, default=1, help='Maximum number of clients.') args = parser.parse_args() main(args.max_clients, args.max_conns)
38,689
https://github.com/lianwentao/huachengshequhuishenghuo/blob/master/Model/zhangdanlishijilu/fukuanjilumodel.m
Github Open Source
Open Source
Apache-2.0
2,019
huachengshequhuishenghuo
lianwentao
Objective-C
Code
26
101
// // fukuanjilumodel.m // HuiShengHuo2.0 // // Created by 晋中华晟 on 2018/3/23. // Copyright © 2018年 晋中华晟. All rights reserved. // #import "fukuanjilumodel.h" @implementation fukuanjilumodel @end
46,635
https://github.com/unity-game-framework/ugf-jsonnet-bson/blob/master/Packages/UGF.JsonNet.Bson/Plugins/Newtonsoft.JsonNet.Bson/Utilities/CollectionUtils.cs
Github Open Source
Open Source
MIT
null
ugf-jsonnet-bson
unity-game-framework
C#
Code
185
396
#define HAVE_METHOD_IMPL_ATTRIBUTE using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; namespace Newtonsoft.Json.Bson.Utilities { internal static class CollectionUtils { // 4.6 has Array.Empty<T> to return a cached empty array. Lacking that in other // frameworks, Enumerable.Empty<T> happens to be implemented as a cached empty // array in all versions (in .NET Core the same instance as Array.Empty<T>). // This includes the internal Linq bridge for 2.0. // Since this method is simple and only 11 bytes long in a release build it's // pretty much guaranteed to be inlined, giving us fast access of that cached // array. With 4.5 and up we use AggressiveInlining just to be sure, so it's // effectively the same as calling Array.Empty<T> even when not available. #if HAVE_METHOD_IMPL_ATTRIBUTE [MethodImpl(MethodImplOptions.AggressiveInlining)] #endif public static T[] ArrayEmpty<T>() { T[] array = Enumerable.Empty<T>() as T[]; Debug.Assert(array != null); // Defensively guard against a version of Linq where Enumerable.Empty<T> doesn't // return an array, but throw in debug versions so a better strategy can be // used if that ever happens. return array ?? new T[0]; } } }
33,264
https://github.com/jisjoe/MLH-Local-Hack-Day/blob/master/MLHHackday/app/src/main/java/onebyzero/club/mlhhackday/facedetection/FaceContourGraphic.java
Github Open Source
Open Source
Apache-2.0
2,018
MLH-Local-Hack-Day
jisjoe
Java
Code
398
1,601
package onebyzero.club.mlhhackday.facedetection; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import com.google.firebase.ml.vision.face.FirebaseVisionFace; import com.google.firebase.ml.vision.face.FirebaseVisionFaceContour; import com.google.firebase.ml.vision.face.FirebaseVisionFaceLandmark; import com.google.firebase.samples.apps.mlkit.common.GraphicOverlay; import com.google.firebase.samples.apps.mlkit.common.GraphicOverlay.Graphic; /** Graphic instance for rendering face contours graphic overlay view. */ public class FaceContourGraphic extends Graphic { private static final float FACE_POSITION_RADIUS = 4.0f; private static final float ID_TEXT_SIZE = 30.0f; private static final float ID_Y_OFFSET = 80.0f; private static final float ID_X_OFFSET = -70.0f; private static final float BOX_STROKE_WIDTH = 5.0f; private final Paint facePositionPaint; private final Paint idPaint; private final Paint boxPaint; private volatile FirebaseVisionFace firebaseVisionFace; public FaceContourGraphic(GraphicOverlay overlay, FirebaseVisionFace face) { super(overlay); this.firebaseVisionFace = face; final int selectedColor = Color.WHITE; facePositionPaint = new Paint(); facePositionPaint.setColor(selectedColor); idPaint = new Paint(); idPaint.setColor(selectedColor); idPaint.setTextSize(ID_TEXT_SIZE); boxPaint = new Paint(); boxPaint.setColor(selectedColor); boxPaint.setStyle(Paint.Style.STROKE); boxPaint.setStrokeWidth(BOX_STROKE_WIDTH); } /** Draws the face annotations for position on the supplied canvas. */ @Override public void draw(Canvas canvas) { FirebaseVisionFace face = firebaseVisionFace; if (face == null) { return; } // Draws a circle at the position of the detected face, with the face's track id below. float x = translateX(face.getBoundingBox().centerX()); float y = translateY(face.getBoundingBox().centerY()); canvas.drawCircle(x, y, FACE_POSITION_RADIUS, facePositionPaint); canvas.drawText("id: " + face.getTrackingId(), x + ID_X_OFFSET, y + ID_Y_OFFSET, idPaint); // Draws a bounding box around the face. float xOffset = scaleX(face.getBoundingBox().width() / 2.0f); float yOffset = scaleY(face.getBoundingBox().height() / 2.0f); float left = x - xOffset; float top = y - yOffset; float right = x + xOffset; float bottom = y + yOffset; canvas.drawRect(left, top, right, bottom, boxPaint); FirebaseVisionFaceContour contour = face.getContour(FirebaseVisionFaceContour.ALL_POINTS); for (com.google.firebase.ml.vision.common.FirebaseVisionPoint point : contour.getPoints()) { float px = translateX(point.getX()); float py = translateY(point.getY()); canvas.drawCircle(px, py, FACE_POSITION_RADIUS, facePositionPaint); } if (face.getSmilingProbability() >= 0) { canvas.drawText( "happiness: " + String.format("%.2f", face.getSmilingProbability()), x + ID_X_OFFSET * 3, y - ID_Y_OFFSET, idPaint); } if (face.getRightEyeOpenProbability() >= 0) { canvas.drawText( "right eye: " + String.format("%.2f", face.getRightEyeOpenProbability()), x - ID_X_OFFSET, y, idPaint); } if (face.getLeftEyeOpenProbability() >= 0) { canvas.drawText( "left eye: " + String.format("%.2f", face.getLeftEyeOpenProbability()), x + ID_X_OFFSET * 6, y, idPaint); } FirebaseVisionFaceLandmark leftEye = face.getLandmark(FirebaseVisionFaceLandmark.LEFT_EYE); if (leftEye != null && leftEye.getPosition() != null) { canvas.drawCircle( translateX(leftEye.getPosition().getX()), translateY(leftEye.getPosition().getY()), FACE_POSITION_RADIUS, facePositionPaint); } FirebaseVisionFaceLandmark rightEye = face.getLandmark(FirebaseVisionFaceLandmark.RIGHT_EYE); if (rightEye != null && rightEye.getPosition() != null) { canvas.drawCircle( translateX(rightEye.getPosition().getX()), translateY(rightEye.getPosition().getY()), FACE_POSITION_RADIUS, facePositionPaint); } FirebaseVisionFaceLandmark leftCheek = face.getLandmark(FirebaseVisionFaceLandmark.LEFT_CHEEK); if (leftCheek != null && leftCheek.getPosition() != null) { canvas.drawCircle( translateX(leftCheek.getPosition().getX()), translateY(leftCheek.getPosition().getY()), FACE_POSITION_RADIUS, facePositionPaint); } FirebaseVisionFaceLandmark rightCheek = face.getLandmark(FirebaseVisionFaceLandmark.RIGHT_CHEEK); if (rightCheek != null && rightCheek.getPosition() != null) { canvas.drawCircle( translateX(rightCheek.getPosition().getX()), translateY(rightCheek.getPosition().getY()), FACE_POSITION_RADIUS, facePositionPaint); } } }
51,151
https://github.com/Guutong/chapter4/blob/master/src/main/java/com/guutong/chapter4/YesNo.java
Github Open Source
Open Source
Apache-2.0
null
chapter4
Guutong
Java
Code
65
137
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.guutong.chapter4; /** * * @author GuutonG */ public enum YesNo { YES(1), NO(0); private int score; private YesNo(int score) { this.score = score; } public int getScore() { return score; } }
39,941
https://github.com/Hamed-kshiem/CE-IoT/blob/master/src/main/java/iotpanel/CE/CeApplication.java
Github Open Source
Open Source
MIT
null
CE-IoT
Hamed-kshiem
Java
Code
23
96
package iotpanel.CE; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication public class CeApplication { public static void main(String[] args) { SpringApplication.run(CeApplication.class, args); } }
46,408
https://github.com/ddla12/Chevere/blob/master/src/chevere/index.ts
Github Open Source
Open Source
MIT
2,021
Chevere
ddla12
TypeScript
Code
12
35
export * from "./ChevereAttached.js"; export * from "./ChevereNode.js"; export * from "./ChevereInline.js";
33,527
https://github.com/rschwenn/Rstyx.Utilities/blob/master/Utilities/source/Domain/TopologyNode.vb
Github Open Source
Open Source
MIT
null
Rstyx.Utilities
rschwenn
Visual Basic
Code
85
189
 Namespace Domain ''' <summary> A Node of a topology (node-edge model). </summary> Public Class TopologyNode ''' <summary> Code (or shortcut title) of the node. </summary> Public Property Code As String = String.Empty ''' <summary> Title of the node. </summary> Public Property Title As String = String.Empty ''' <summary> Description of the node. </summary> Public Property Description As String = String.Empty ''' <summary> Operation point the node belogs to. </summary> Public Property OperationPoint As String = String.Empty End Class End Namespace ' for jEdit: :collapseFolds=3::tabSize=4::tabSize=4:
41,630
https://github.com/nick10811/BLEManager/blob/master/BTLE/ViewController.h
Github Open Source
Open Source
MIT
2,016
BLEManager
nick10811
C
Code
68
314
// // ViewController.h // BTLE // // Created by Nick Yang on 9/16/15. // Copyright (c) 2015 Nick Yang. All rights reserved. // #import <UIKit/UIKit.h> #import <CoreBluetooth/CoreBluetooth.h> #import "BLEManager.h" @interface ViewController : UIViewController<BLEManagerDelegate,UIActionSheetDelegate> { IBOutlet UILabel *bleDeviceName; IBOutlet UILabel *rssi; IBOutlet UITextField *serviceUUID; IBOutlet UITextField *characteristicUUID; IBOutlet UITextField *sendData; IBOutlet UILabel *receivedData; } @property (strong,nonatomic) NSMutableArray *peripherals; @property (strong,nonatomic) CBPeripheral *connctedPeripheral; -(IBAction)dismissKeyboard:(id)sender; -(IBAction)scanDevice:(id)sender; -(IBAction)disconnection:(id)sender; -(IBAction)readRSSI:(id)sender; -(IBAction)sendData:(id)sender; -(IBAction)readData:(id)sender; @end
34,014
https://github.com/lpchg1992/png2ico/blob/master/src/png2ico/app.py
Github Open Source
Open Source
BSD-3-Clause
2,020
png2ico
lpchg1992
Python
Code
205
984
""" Png to Ico """ import toga from toga.style import Pack from toga.style.pack import COLUMN, ROW from PIL import Image import random import os class Png2Ico(toga.App): def startup(self): self.msg = '请开始操作' main_box = toga.Box(style=Pack(direction=COLUMN)) img_path_box = toga.Box(style=Pack(direction=ROW)) labelPath = toga.Label( '请选择文件', style=Pack(padding=(5, 5)) ) self.labelMsg = toga.Label( self.msg, style=Pack(padding=(5, 5)) ) buttonDir = toga.Button( '选择图像', on_press=self.select_png, style=Pack(padding=5) ) buttonExec = toga.Button( '执行转换', on_press=self.png_to_ico, style=Pack(padding=5) ) self.dirInput = toga.TextInput(style=Pack(flex=1), readonly=True) img_path_box.add(labelPath) img_path_box.add(buttonDir) img_path_box.add(self.dirInput) main_box.add(img_path_box) main_box.add(self.labelMsg) main_box.add(buttonExec) self.main_window = toga.MainWindow(title=self.formal_name) self.main_window.content = main_box self.main_window.show() def select_png(self, widget): try: pngPath_ = self.main_window.open_file_dialog( '请选择png图片', file_types="(*.png)|*.png") if pngPath_: if pngPath_.split('.').pop() == 'png': self.pngPath = pngPath_ self.msg = '已成功选择图片!转换后将保存到相同目录!' else: self.msg = '请选择png格式的图片!' self.pngPath = '' except Exception as e: self.pngPath = '' self.labelMsg.text = self.msg self.dirInput.value = self.pngPath def png_to_ico(self, widget): try: self.pngPath goOn = 1 if self.dirInput.value == self.pngPath: goOn = 1 else: goOn = 0 except Exception: goOn = 0 if goOn and os.path.exists(self.pngPath): if self.pngPath: preList_ = self.pngPath.split('\\') preList_.pop() self.saveDir = '\\'.join(preList_)+'\\' self.msg = '成功选择存储路径,转换中...' goOn = 1 else: self.msg = '存储路径不存在' goOn = 0 self.labelMsg.text = self.msg if goOn == 1: toIco = Image.open(self.pngPath) toIco.save(self.saveDir+'transfromed' + str(random.randint(10000, 99999)) + '.ico') self.msg = '转换成功!' else: pass else: self.msg = '操作路径不存在,请重新选择!' self.labelMsg.text = self.msg def main(): return Png2Ico()
28,579
https://github.com/sigmoidanalytics/zeppelin/blob/master/zeppelin-zengine/src/main/java/com/nflabs/zeppelin/zengine/ZPlan.java
Github Open Source
Open Source
Apache-2.0
2,015
zeppelin
sigmoidanalytics
Java
Code
139
591
package com.nflabs.zeppelin.zengine; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import com.nflabs.zeppelin.driver.LazyConnection; import com.nflabs.zeppelin.driver.ZeppelinConnection; import com.nflabs.zeppelin.driver.ZeppelinDriverFactory; import com.nflabs.zeppelin.result.Result; import com.nflabs.zeppelin.zengine.stmt.Z; public class ZPlan extends LinkedList<Z>{ public ZPlan(){ } public LinkedList<Result> execute(Zengine zengine) throws Exception{ return execute(zengine, null); } public LinkedList<Result> execute(Zengine zengine, List<Map<String, Object>> params) throws Exception{ LinkedList<Result> results = new LinkedList<Result>(); ZeppelinDriverFactory driverFactory = zengine.getDriverFactory(); for (int i=0; i<this.size(); i++) { Z zz = this.get(i); Map<String, Object> p = new HashMap<String, Object>(); if(params!=null && params.size()>=i+1){ p = params.get(i); } try { zz.withParams(p); ZeppelinConnection conn = zz.getConnection(); if (conn instanceof LazyConnection) { ((LazyConnection)conn).initialize(driverFactory); } zz.execute(conn); results.add(zz.result()); zz.release(); } catch (Exception e) { closeAllConnections(); throw e; } } closeAllConnections(); return results; } private void closeAllConnections(){ for (int i=0; i<this.size(); i++) { Z zz = this.get(i); ZeppelinConnection conn = zz.getConnection(); if (conn!=null) { if (conn.isConnected()){ conn.close(); } } } } }
44,618
https://github.com/Antholoj/netbeans/blob/master/webcommon/web.inspect/src/org/netbeans/modules/web/inspect/webkit/ui/MatchedPropertyNode.java
Github Open Source
Open Source
Apache-2.0
2,022
netbeans
Antholoj
Java
Code
586
1,563
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.netbeans.modules.web.inspect.webkit.ui; import java.lang.reflect.InvocationTargetException; import javax.swing.Action; import org.netbeans.modules.web.inspect.CSSUtils; import org.netbeans.modules.web.inspect.actions.Resource; import org.netbeans.modules.web.inspect.webkit.Utilities; import org.netbeans.modules.web.inspect.webkit.actions.GoToPropertySourceAction; import org.netbeans.modules.web.webkit.debugging.api.css.Rule; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import org.openide.nodes.Sheet; import org.openide.util.NbBundle; import org.openide.util.lookup.Lookups; /** * Node that represents a property of a rule that matches a node. * * @author Jan Stola */ public class MatchedPropertyNode extends AbstractNode { /** Name of the "value" property. */ public static final String PROPERTY_VALUE = "value"; // NOI18N /** Name of an attribute that determines whether the matched property determines some color. */ static final String COLOR_PROPERTY = "color"; // NOI18N /** Property sets of this node. */ private PropertySet[] propertySets; /** Property represented by this node. */ org.netbeans.modules.web.webkit.debugging.api.css.Property property; /** Preferred action. */ private Action preferredAction; /** * Creates a new {@code MatchedPropertyNode}. * * @param rule owning rule of the property to represent. * @param ruleOrigin origin of the rule. * @param property property to represent. */ MatchedPropertyNode(Rule rule, Resource ruleOrigin, org.netbeans.modules.web.webkit.debugging.api.css.Property property) { super(Children.LEAF, Lookups.fixed(rule, ruleOrigin, property)); this.property = property; setDisplayName(property.getName()); RuleInfo ruleInfo = new RuleInfo(); ruleInfo.fillMetaSourceInfo(rule, ruleOrigin.getProject()); String sourceURL = ruleInfo.getMetaSourceFile(); if (sourceURL != null && ruleInfo.getMetaSourceLine() != -1) { if (sourceURL.startsWith("file://") && !sourceURL.startsWith("file:///")) { // NOI18N // file://C:/file is understood as file on host C, should be file:///C:/file sourceURL = "file:/" + sourceURL.substring(5); // NOI18N } } else { sourceURL = rule.getSourceURL(); } String stylesheet = Utilities.relativeResourceName(sourceURL, ruleOrigin.getProject()); if (stylesheet != null) { if (stylesheet.isEmpty()) { stylesheet = Bundle.CSSStylesSelectionPanel_generatedStylesheet(); } String description = NbBundle.getMessage(MatchedPropertyNode.class, "MatchedPropertyNode.description", rule.getSelector(), stylesheet); // NOI18N setShortDescription(description); } } /** * Adds a sub-node to this node. This method is called on nodes that * represent a short-hand property only. * * @param subNode sub-node that represents a property that belongs under * a short-hand property represented by this node. */ void addSubNode(MatchedPropertyNode subNode) { if (isLeaf()) { setChildren(new Children.Array()); } Children.Array children = (Children.Array)getChildren(); children.add(new Node[] { subNode }); } @Override public synchronized PropertySet[] getPropertySets() { if (propertySets == null) { propertySets = createPropertySets(); } return propertySets; } /** * Creates property sets of this node. * * @return property sets of this node. */ private PropertySet[] createPropertySets() { String displayName = NbBundle.getMessage(MatchedPropertyNode.class, "MatchedPropertyNode.displayName"); // NOI18N PropertySet set = new PropertySet(Sheet.PROPERTIES, displayName, null) { private final Property<?> valueProperty = new PropertySupport.ReadOnly<String>( PROPERTY_VALUE, String.class, null, null) { { setValue(COLOR_PROPERTY, CSSUtils.isColorProperty(property.getName())); } @Override public String getValue() throws IllegalAccessException, InvocationTargetException { return property.getValue(); } @Override public String getShortDescription() { return MatchedPropertyNode.this.getShortDescription(); } }; @Override public Property<?>[] getProperties() { return new Property[] { valueProperty }; } }; return new PropertySet[] { set }; } @Override public synchronized Action getPreferredAction() { if (preferredAction == null) { preferredAction = new GoToPropertySourceAction(this); } return preferredAction; } @Override public Action[] getActions(boolean context) { return new Action[] { getPreferredAction() }; } }
6,758
https://github.com/erjan/coding_exercises/blob/master/maximum_product_of_splitted_binary_tree.py
Github Open Source
Open Source
Apache-2.0
2,023
coding_exercises
erjan
Python
Code
251
508
''' Given the root of a binary tree, split the binary tree into two subtrees by removing one edge such that the product of the sums of the subtrees is maximized. Return the maximum product of the sums of the two subtrees. Since the answer may be too large, return it modulo 109 + 7. Note that you need to maximize the answer before taking the mod and not after taking it. ''' ''' Firstly we will find sum of both subtree for each node. 👉 Then we will store the sum of both (left & right) subtree with the node value. 👉 Now find the maximum which will be the sum of all nodes (mainly the value of sum at root node). 👉 Here we will use the stored value "res" , for each sum in res we can get the product of two subtree . 👉 At last return the maximum product after removing one edge. ''' class Solution: def maxProduct(self, root: Optional[TreeNode]) -> int: def dfs(root): if root is None: return 0 ans = dfs(root.left)+dfs(root.right)+root.val res.append(ans) return ans res=[] dfs(root) total,m = max(res),float('-inf') for s in res: m=max(m,s*(total-s)) return m%(10**9+7) ---------------------------------------------------------------------------------------------------------- class Solution: def maxProduct(self, root: Optional[TreeNode]) -> int: sums = [] def dfs(node): if node is None: return 0 subtree_sum = dfs(node.left) + dfs(node.right) + node.val sums.append(subtree_sum) return subtree_sum m = -inf total = dfs(root) for i in sums: prod = i * (total-i) if prod > m: m = prod return m % (10**9 + 7)
9,640
https://github.com/highlands/exchequer-example/blob/master/app/controllers/offers_controller.rb
Github Open Source
Open Source
MIT
2,018
exchequer-example
highlands
Ruby
Code
15
60
class OffersController < ApplicationController def index @offers = ExchequerClient::OfferClient.new( api_key: @api_key, public_token: @manager_public_token).all end end
7,686
https://github.com/myk1477/bishe-ershoufang/blob/master/LianjiaSpider/LianjiaSpider/items.py
Github Open Source
Open Source
MIT
null
bishe-ershoufang
myk1477
Python
Code
61
215
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # https://doc.scrapy.org/en/latest/topics/items.html import scrapy class LianjiaspiderItem(scrapy.Item): # define the fields for your item here like: # 定义爬取的信息 # 爬取房屋的所在城市 city = scrapy.Field() # 街道的名字 street = scrapy.Field() # 街道的url地址 street_page_url = scrapy.Field() # 房屋的url地址 detail_url = scrapy.Field() # 房屋的详细信息 house_info_dict = scrapy.Field()
49,918
https://github.com/Cici-Zhang-1/jiuqian-mobile/blob/master/application/config/validation/workflow/workflow_order_product_fitting_msg_validation.php
Github Open Source
Open Source
MIT
2,021
jiuqian-mobile
Cici-Zhang-1
PHP
Code
210
901
<?php defined('BASEPATH') OR exit('No direct script access allowed'); $config['workflow/workflow_order_product_fitting_msg/add'] = array( array ( 'field' => 'order_product_fitting_id', 'label' => '配件id', 'rules' => 'trim|required|numeric|max_length[10]' ), array ( 'field' => 'msg', 'label' => 'Message', 'rules' => 'trim|max_length[128]' ), array ( 'field' => 'workflow_order_product_fitting_id', 'label' => '工作流', 'rules' => 'trim|numeric|max_length[4]' ), array ( 'field' => 'previous', 'label' => '前置节点', 'rules' => 'trim|numeric|max_length[4]' ), array ( 'field' => 'target', 'label' => '操作对象', 'rules' => 'trim|max_length[128]' ), array ( 'field' => 'timestamp', 'label' => '排序', 'rules' => 'trim|decimal|min_length[1]|max_length[20]' ), array ( 'field' => 'status', 'label' => '是否有效', 'rules' => 'trim|numeric|max_length[1]' ) ); $config['workflow/workflow_order_product_fitting_msg/edit'] = array( array( 'field' => 'v', 'label' => '编号', 'rules' => 'trim|required|numeric|min_length[1]|max_length[10]' ), array ( 'field' => 'order_product_fitting_id', 'label' => '配件id', 'rules' => 'trim|required|numeric|max_length[10]' ), array ( 'field' => 'msg', 'label' => 'Message', 'rules' => 'trim|max_length[128]' ), array ( 'field' => 'workflow_order_product_fitting_id', 'label' => '工作流', 'rules' => 'trim|numeric|max_length[4]' ), array ( 'field' => 'previous', 'label' => '前置节点', 'rules' => 'trim|numeric|max_length[4]' ), array ( 'field' => 'target', 'label' => '操作对象', 'rules' => 'trim|max_length[128]' ), array ( 'field' => 'timestamp', 'label' => '排序', 'rules' => 'trim|decimal|min_length[1]|max_length[20]' ), array ( 'field' => 'status', 'label' => '是否有效', 'rules' => 'trim|numeric|max_length[1]' ) ); $config['workflow/workflow_order_product_fitting_msg/remove'] = array( array( 'field' => 'v[]', 'label' => '选择项', 'rules' => 'trim|required|numeric|min_length[1]|max_length[10]' ) );
50,465
https://github.com/nickwanninger/serenity/blob/master/Userland/Libraries/LibSyntax/Highlighter.cpp
Github Open Source
Open Source
BSD-2-Clause
2,021
serenity
nickwanninger
C++
Code
530
1,618
/* * Copyright (c) 2020-2021, the SerenityOS developers. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <LibGUI/TextEditor.h> #include <LibGfx/Color.h> #include <LibSyntax/Highlighter.h> namespace Syntax { Highlighter::~Highlighter() { } void Highlighter::highlight_matching_token_pair() { auto& document = m_client->get_document(); enum class Direction { Forward, Backward, }; auto find_span_of_type = [&](auto i, void* type, void* not_type, Direction direction) -> Optional<size_t> { size_t nesting_level = 0; bool forward = direction == Direction::Forward; if (forward) { ++i; if (i >= document.spans().size()) return {}; } else { if (i == 0) return {}; --i; } for (;;) { auto& span = document.spans().at(i); auto span_token_type = span.data; if (token_types_equal(span_token_type, not_type)) { ++nesting_level; } else if (token_types_equal(span_token_type, type)) { if (nesting_level-- <= 0) return i; } if (forward) { ++i; if (i >= document.spans().size()) return {}; } else { if (i == 0) return {}; --i; } } return {}; }; auto make_buddies = [&](int index0, int index1) { auto& buddy0 = document.spans()[index0]; auto& buddy1 = document.spans()[index1]; m_has_brace_buddies = true; m_brace_buddies[0].index = index0; m_brace_buddies[1].index = index1; m_brace_buddies[0].span_backup = buddy0; m_brace_buddies[1].span_backup = buddy1; buddy0.attributes.background_color = Color::DarkCyan; buddy1.attributes.background_color = Color::DarkCyan; buddy0.attributes.color = Color::White; buddy1.attributes.color = Color::White; m_client->do_update(); }; auto pairs = matching_token_pairs(); for (size_t i = 0; i < document.spans().size(); ++i) { auto& span = const_cast<GUI::TextDocumentSpan&>(document.spans().at(i)); auto token_type = span.data; for (auto& pair : pairs) { if (token_types_equal(token_type, pair.open) && span.range.start() == m_client->get_cursor()) { auto buddy = find_span_of_type(i, pair.close, pair.open, Direction::Forward); if (buddy.has_value()) make_buddies(i, buddy.value()); return; } } auto right_of_end = span.range.end(); right_of_end.set_column(right_of_end.column() + 1); for (auto& pair : pairs) { if (token_types_equal(token_type, pair.close) && right_of_end == m_client->get_cursor()) { auto buddy = find_span_of_type(i, pair.open, pair.close, Direction::Backward); if (buddy.has_value()) make_buddies(i, buddy.value()); return; } } } } void Highlighter::attach(HighlighterClient& client) { VERIFY(!m_client); m_client = &client; } void Highlighter::detach() { m_client = nullptr; } void Highlighter::cursor_did_change() { auto& document = m_client->get_document(); if (m_has_brace_buddies) { if (m_brace_buddies[0].index >= 0 && m_brace_buddies[0].index < static_cast<int>(document.spans().size())) document.set_span_at_index(m_brace_buddies[0].index, m_brace_buddies[0].span_backup); if (m_brace_buddies[1].index >= 0 && m_brace_buddies[1].index < static_cast<int>(document.spans().size())) document.set_span_at_index(m_brace_buddies[1].index, m_brace_buddies[1].span_backup); m_has_brace_buddies = false; m_client->do_update(); } highlight_matching_token_pair(); } }
45,179
https://github.com/carsol/dotfiles/blob/master/ruby/aliases.zsh
Github Open Source
Open Source
MIT
2,018
dotfiles
carsol
Shell
Code
26
76
alias sc='script/console' alias sg='script/generate' alias sd='script/destroy' alias rs='spring stop && bin/rails serve' alias rc='spring stop && bin/rails console' alias rake="noglob rake" alias b="bundle" alias be="bundle exec"
25,988
https://github.com/magik6k/LogicDraw/blob/master/core/src/me/wieku/circuits/save/SaveManagers.kt
Github Open Source
Open Source
MIT
null
LogicDraw
magik6k
Kotlin
Code
239
976
package me.wieku.circuits.save import me.wieku.circuits.save.managers.SaveManagerVer01 import me.wieku.circuits.save.managers.SaveManagerVer02 import me.wieku.circuits.world.ClassicWorld import sun.plugin.dom.exception.InvalidStateException import java.io.* import java.util.zip.GZIPInputStream import java.util.zip.GZIPOutputStream object SaveManagers { val latest = 2 fun loadMap(file: File) : ClassicWorld { if(file.exists() && file.extension == "ldmap") { var inputStream = DataInputStream(GZIPInputStream(FileInputStream(file))) if(inputStream.readUTF() == "LogicDraw Map") { println("Loading ${file.name} started...") var world = getSaveManager(inputStream.readInt()).loadMap(inputStream) inputStream.close() println(("Loading ${file.name} finished!")) return world } } throw IOException("Invaild file") } fun loadBlueprint(file: File) : ClassicWorld { if(file.exists() && file.extension == "ldbp") { var inputStream = DataInputStream(GZIPInputStream(FileInputStream(file))) if(inputStream.readUTF() == "LogicDraw Blueprint") { println("Loading ${file.name} started...") var version = inputStream.readInt() println(version) var world = getSaveManager(version).loadMap(inputStream) inputStream.close() println(("Loading ${file.name} finished!")) return world } } throw IOException("Invaild file") } fun getHeader(file: File) : Array<String>? { if(file.exists() && file.extension == "ldmap") { var inputStream = DataInputStream(GZIPInputStream(FileInputStream(file))) if(inputStream.readUTF() == "LogicDraw Map") { var version = inputStream.readInt() val array = getSaveManager(version).loadHeader(inputStream) if(version < latest) array[0] = array[0] + " (old)" inputStream.close() return array } } println("[ERROR] Invaild file: ${file.name}") return null } fun saveMap(world: ClassicWorld, file: File) { if(file.exists()) file.delete() println("Saving map ${file.name}...") var outputStream = DataOutputStream(GZIPOutputStream(FileOutputStream(file))) outputStream.writeUTF("LogicDraw Map") outputStream.writeInt(latest) getSaveManager(latest).saveMap(world, outputStream) outputStream.close() println("Saved!") } fun saveBlueprint(world: ClassicWorld, file: File) { if(file.exists()) file.delete() println("Saving blueprint ${file.name}...") var outputStream = DataOutputStream(GZIPOutputStream(FileOutputStream(file))) outputStream.writeUTF("LogicDraw Blueprint") outputStream.writeInt(latest) getSaveManager(latest).saveMap(world, outputStream) outputStream.close() println("Saved!") } fun getSaveManager(version: Int): SaveManager { if(version == 1) { return SaveManagerVer01() } else if(version == 2) { return SaveManagerVer02() } else throw InvalidStateException("You have too old version of LogicDraw to open that world") } }
38,516
https://github.com/iromu/pool-stack/blob/master/Gulpfile.js
Github Open Source
Open Source
MIT
2,017
pool-stack
iromu
JavaScript
Code
45
173
// Gulpfile.js var gulp = require('gulp'); var nodemon = require('gulp-nodemon'); var jshint = require('gulp-jshint'); gulp.task('lint', function () { gulp.src('./**/*.js') .pipe(jshint()); }); gulp.task('develop', function () { nodemon({ script: 'server.js', ext: 'js', env: {'NODE_ENV': 'development'}, ignore: ['test/**'], tasks: ['lint'] }) .on('restart', function () { console.log('restarted!') }); });
13,843
https://github.com/vidspl/WordPressBP/blob/master/config/scripts/build-lang.js
Github Open Source
Open Source
MIT, LicenseRef-scancode-unknown-license-reference
2,017
WordPressBP
vidspl
JavaScript
Code
32
109
const path = require('path') const sh = require('shelljs') sh.find(path.resolve('./web/app')).filter((file) => file.match(/\.po$/)).forEach((lang) => { var name = lang.substr(0, lang.length - 3) sh.exec([ 'msgfmt -o', name + '.mo', name + '.po' ].join(' ')) })
1,225
https://github.com/ra4/reportingapp/blob/master/resources/views/auth/login.blade.php
Github Open Source
Open Source
MIT
null
reportingapp
ra4
PHP
Code
97
449
@extends('app') @section('content') @if($errors->any()) <div class="container"> <ul class='alert alert-danger col-lg-8 col-lg-push-2'> @foreach($errors->all() as $error) <li>{{ $error }}</li> @endforeach </ul> </div> @endif <div class="container-inner" style="margin-top:100px"> <div class="col-md-push-4 col-md-4"> <div class="login-panel panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Sign In</h3> </div> <div class="panel-body"> <form role="form" action="/auth/login" method="post"> {!! csrf_field() !!} <fieldset> <div class="form-group"> <input class="form-control" placeholder="E-mail" name="email" type="email" autofocus="" value="{{ old('email') }}"> </div> <div class="form-group"> <input class="form-control" placeholder="Password" name="password" type="password" value=""> </div> <div class="checkbox"> <label> <input name="remember" type="checkbox" value="Remember Me">Remember Me </label> </div> <button class="btn btn-lg btn-success" name="submit" type="submit">Login</button><br><br> {!! link_to('password/email', 'Forgot Your Password?') !!} </fieldset> </form> </div> </div> </div> </div> @stop
36,435
https://github.com/PrimusStudios/sotsera.blazor.oidc/blob/master/samples/ClientSide/Components/LoginDisplay.razor
Github Open Source
Open Source
Apache-2.0
2,020
sotsera.blazor.oidc
PrimusStudios
HTML+Razor
Code
92
355
@inject Sotsera.Blazor.Oidc.IUserManager UserManager <AuthorizeView> <Authorized> <span class="login-display-name mr-3"> Hello, @context.User.Identity.Name! </span> <button type="button" class="btn btn-primary btn-sm mr-1" @onclick="LogoutPopup"> Log out (popup) </button> <button type="button" class="btn btn-primary btn-sm" @onclick="LogoutRedirect"> Log out (redirect) </button> </Authorized> <NotAuthorized> <button type="button" class="btn btn-primary mr-1 btn-sm" @onclick="LoginPopup"> Log in (popup) </button> <button type="button" class="btn btn-primary btn-sm" @onclick="LoginRedirect"> Log in (redirect) </button> </NotAuthorized> </AuthorizeView> @code { public async void LoginPopup() => await UserManager.BeginAuthenticationAsync(); public async void LoginRedirect() => await UserManager.BeginAuthenticationAsync(p => p.WithRedirect()); public async void LogoutPopup() => await UserManager.BeginLogoutAsync(); public async void LogoutRedirect() => await UserManager.BeginLogoutAsync(p => p.WithRedirect()); }
11,335
https://github.com/jaysonS77/my_test/blob/master/vendor/composer/autoload_static.php
Github Open Source
Open Source
MIT
2,020
my_test
jaysonS77
PHP
Code
765
2,936
<?php // autoload_static.php @generated by Composer namespace Composer\Autoload; class ComposerStaticInit8b0dfa91a3d8635e18bd13a7e299e31a { public static $files = array ( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '253c157292f75eb38082b5acb06f3f01' => __DIR__ . '/..' . '/nikic/fast-route/src/functions.php', '2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php', 'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php', 'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php', '72579e7bd17821bb1321b87411366eae' => __DIR__ . '/..' . '/illuminate/support/helpers.php', '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', '0ccdf99b8f62f02c52cba55802e0c2e7' => __DIR__ . '/..' . '/zircote/swagger-php/src/functions.php', 'b916e8aece8ff1266b4abc7a9947324c' => __DIR__ . '/../..' . '/tools/include.php', ); public static $prefixLengthsPsr4 = array ( 'p' => array ( 'phpseclib\\' => 10, ), 'T' => array ( 'Twig\\' => 5, ), 'S' => array ( 'Symfony\\Polyfill\\Util\\' => 22, 'Symfony\\Polyfill\\Php56\\' => 23, 'Symfony\\Polyfill\\Mbstring\\' => 26, 'Symfony\\Component\\Translation\\' => 30, 'Symfony\\Component\\Finder\\' => 25, 'Swagger\\' => 8, 'Slim\\Views\\' => 11, 'Slim\\Flash\\' => 11, 'Slim\\' => 5, ), 'P' => array ( 'Psr\\SimpleCache\\' => 16, 'Psr\\Log\\' => 8, 'Psr\\Http\\Message\\' => 17, 'Psr\\Container\\' => 14, ), 'N' => array ( 'Namshi\\JOSE\\' => 12, ), 'M' => array ( 'Mpdf\\' => 5, 'Monolog\\' => 8, 'Module\\' => 7, 'Medoo\\' => 6, ), 'I' => array ( 'Interop\\Container\\' => 18, 'Illuminate\\Support\\' => 19, 'Illuminate\\Database\\' => 20, 'Illuminate\\Contracts\\' => 21, 'Illuminate\\Container\\' => 21, ), 'F' => array ( 'FastRoute\\' => 10, ), 'E' => array ( 'ElephantIO\\' => 11, ), 'D' => array ( 'Doctrine\\Common\\Inflector\\' => 26, 'Doctrine\\Common\\Annotations\\' => 28, 'DeepCopy\\' => 9, ), 'C' => array ( 'Carbon\\' => 7, ), ); public static $prefixDirsPsr4 = array ( 'phpseclib\\' => array ( 0 => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib', ), 'Twig\\' => array ( 0 => __DIR__ . '/..' . '/twig/twig/src', ), 'Symfony\\Polyfill\\Util\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-util', ), 'Symfony\\Polyfill\\Php56\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-php56', ), 'Symfony\\Polyfill\\Mbstring\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', ), 'Symfony\\Component\\Translation\\' => array ( 0 => __DIR__ . '/..' . '/symfony/translation', ), 'Symfony\\Component\\Finder\\' => array ( 0 => __DIR__ . '/..' . '/symfony/finder', ), 'Swagger\\' => array ( 0 => __DIR__ . '/..' . '/zircote/swagger-php/src', ), 'Slim\\Views\\' => array ( 0 => __DIR__ . '/..' . '/slim/twig-view/src', ), 'Slim\\Flash\\' => array ( 0 => __DIR__ . '/..' . '/slim/flash/src', ), 'Slim\\' => array ( 0 => __DIR__ . '/..' . '/slim/slim/Slim', ), 'Psr\\SimpleCache\\' => array ( 0 => __DIR__ . '/..' . '/psr/simple-cache/src', ), 'Psr\\Log\\' => array ( 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', ), 'Psr\\Http\\Message\\' => array ( 0 => __DIR__ . '/..' . '/psr/http-message/src', ), 'Psr\\Container\\' => array ( 0 => __DIR__ . '/..' . '/psr/container/src', ), 'Namshi\\JOSE\\' => array ( 0 => __DIR__ . '/..' . '/namshi/jose/src/Namshi/JOSE', ), 'Mpdf\\' => array ( 0 => __DIR__ . '/..' . '/mpdf/mpdf/src', ), 'Monolog\\' => array ( 0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog', ), 'Module\\' => array ( 0 => __DIR__ . '/../..' . '/module', ), 'Medoo\\' => array ( 0 => __DIR__ . '/..' . '/catfan/medoo/src', ), 'Interop\\Container\\' => array ( 0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container', ), 'Illuminate\\Support\\' => array ( 0 => __DIR__ . '/..' . '/illuminate/support', ), 'Illuminate\\Database\\' => array ( 0 => __DIR__ . '/..' . '/illuminate/database', ), 'Illuminate\\Contracts\\' => array ( 0 => __DIR__ . '/..' . '/illuminate/contracts', ), 'Illuminate\\Container\\' => array ( 0 => __DIR__ . '/..' . '/illuminate/container', ), 'FastRoute\\' => array ( 0 => __DIR__ . '/..' . '/nikic/fast-route/src', ), 'ElephantIO\\' => array ( 0 => __DIR__ . '/..' . '/wisembly/elephant.io/src', 1 => __DIR__ . '/..' . '/wisembly/elephant.io/test', ), 'Doctrine\\Common\\Inflector\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Common/Inflector', ), 'Doctrine\\Common\\Annotations\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/annotations/lib/Doctrine/Common/Annotations', ), 'DeepCopy\\' => array ( 0 => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy', ), 'Carbon\\' => array ( 0 => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon', ), ); public static $prefixesPsr0 = array ( 'T' => array ( 'Twig_' => array ( 0 => __DIR__ . '/..' . '/twig/twig/lib', ), ), 'P' => array ( 'Pimple' => array ( 0 => __DIR__ . '/..' . '/pimple/pimple/src', ), ), 'D' => array ( 'Doctrine\\Common\\Lexer\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/lexer/lib', ), ), ); public static $classMap = array ( 'FPDF_TPL' => __DIR__ . '/..' . '/setasign/fpdi/fpdf_tpl.php', 'FPDI' => __DIR__ . '/..' . '/setasign/fpdi/fpdi.php', 'FilterASCII85' => __DIR__ . '/..' . '/setasign/fpdi/filters/FilterASCII85.php', 'FilterASCIIHexDecode' => __DIR__ . '/..' . '/setasign/fpdi/filters/FilterASCIIHexDecode.php', 'FilterLZW' => __DIR__ . '/..' . '/setasign/fpdi/filters/FilterLZW.php', 'fpdi_pdf_parser' => __DIR__ . '/..' . '/setasign/fpdi/fpdi_pdf_parser.php', 'pdf_context' => __DIR__ . '/..' . '/setasign/fpdi/pdf_context.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInit8b0dfa91a3d8635e18bd13a7e299e31a::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit8b0dfa91a3d8635e18bd13a7e299e31a::$prefixDirsPsr4; $loader->prefixesPsr0 = ComposerStaticInit8b0dfa91a3d8635e18bd13a7e299e31a::$prefixesPsr0; $loader->classMap = ComposerStaticInit8b0dfa91a3d8635e18bd13a7e299e31a::$classMap; }, null, ClassLoader::class); } }
16,297
https://github.com/opendoor-labs/cognito/blob/master/lib/cognito/client/response.rb
Github Open Source
Open Source
MIT
2,021
cognito
opendoor-labs
Ruby
Code
38
116
# frozen_string_literal: true class Cognito class Client class Response include Anima.new(:status, :headers, :data, :json, :connection) def self.build(response, connection) new(Builder.call(response).merge(connection: connection)) end class Status include Anima.new(:code, :reason) end # Status end # Response end # Client end # Cognito
24,475
https://github.com/YanCastle/Tsy/blob/master/TsyExample/Runtime/Temp/bcd4deba9fafdca36ab51b52178af0b8.php
Github Open Source
Open Source
Apache-2.0
2,017
Tsy
YanCastle
PHP
Code
3
98
<?php //000000000000a:6:{s:10:"UnitLinkID";s:10:"unitlinkid";s:7:"GoodsID";s:7:"goodsid";s:4:"Rate";s:4:"rate";s:6:"UnitID";s:6:"unitid";s:8:"Standard";s:8:"standard";s:7:"IsBasic";s:7:"isbasic";} ?>
1,941
https://github.com/Eli-Gustilo-Software/Hermez-iOS/blob/master/HermezTesterDelegate/HermezTestVC.swift
Github Open Source
Open Source
MIT
null
Hermez-iOS
Eli-Gustilo-Software
Swift
Code
400
1,253
// HermezTextVC.swift // Created by Nicholas Gustilo on 2/26/21. import UIKit import Foundation import Hermez class HermezTestVC: UIViewController { @IBOutlet weak var tableView: UITableView! @IBOutlet weak var inputTF: UITextField! @IBOutlet weak var nameLabel: UILabel! private var data: [HermezMessage] = [] private var devices: [HermezDevice] = [] private var savedName: String? override func viewDidLoad() { super.viewDidLoad() Hermez.shared.addDataDelegate(delegate: self) } override func viewDidAppear(_ animated: Bool) { self.checkForSavedName() if let deviceName = self.checkForSavedName() { self.nameLabel.text = deviceName } } @IBAction func sendMessage(sender: UIButton) { print("sendMessage") //ZeroConfigService.shared.publishService() if let message = inputTF.text { let identifier = UUID().uuidString Hermez.shared.sendMessageToDevices(message: message, json: nil, devices: self.devices, messageID: identifier) inputTF.text = nil inputTF.endEditing(true) } } private func checkForSavedName() -> String? { if let name = UserDefaults.standard.string(forKey: "saved_device_name") { return name } else { let alert = UIAlertController(title: "Name", message: "Enter name", preferredStyle: .alert) //2. Add the text field. You can configure it however you need. alert.addTextField { (textField) in textField.placeholder = "your name" } // 3. Grab the value from the text field, and print it when the user clicks OK. alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [weak alert] (_) in let textField = alert?.textFields![0] // Force unwrapping because we know it exists. print("Text field: \(textField?.text)") if let name = textField?.text { UserDefaults.standard.set(name, forKey: "saved_device_name") UserDefaults.standard.synchronize() self.nameLabel.text = name if !Hermez.shared.setServiceAndDeviceName(serviceName: "blah", deviceName: name, deviceJson: nil) { print("ERROR setServiceAndDeviceName FAILED!!!!") } else { Hermez.shared.findAvailableDevices() } } })) // 4. Present the alert. self.present(alert, animated: true, completion: nil) } return nil } } extension HermezTestVC: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return self.data.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let message = self.data[indexPath.row] if let cell : UITableViewCell = tableView.dequeueReusableCell(withIdentifier: "cell") { cell.textLabel?.text = message.sendingDevice.name cell.detailTextLabel?.text = message.message return cell } else { let cell = UITableViewCell(style: UITableViewCell.CellStyle.subtitle, reuseIdentifier: "cell") cell.textLabel?.text = message.sendingDevice.name cell.detailTextLabel?.text = message.message return cell } //return cell } } extension HermezTestVC: HermezDataProtocol { func serviceStarted(serviceType: String, serviceName: String) { print("serviceStarted type = \(serviceType), name: \(serviceName)") Hermez.shared.findAvailableDevices() } func serviceStopped(serviceType: String, serviceName: String) { print("serviceStopped type = \(serviceType), name: \(serviceName)") } func availableDevices(devices: [HermezDevice]) { for device in devices { print("availableDevice = \(device.name)") if isNewDevice(device: device) { self.devices.append(device) } } } func messageReceived(message: HermezMessage) { self.data.insert(message, at: 0) self.tableView.reloadData() } private func isNewDevice(device: HermezDevice) -> Bool { for currentDevice in devices { if currentDevice.name == device.name { return false } } return true } }
45,195
https://github.com/bilalucar/tic-tac-toe/blob/master/src/app/routes/routes-routing.module.ts
Github Open Source
Open Source
MIT
2,021
tic-tac-toe
bilalucar
TypeScript
Code
100
260
import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; // COMPONENTS import { LayoutDefaultComponent } from '../layout/default/default.component'; import { HomeComponent } from './home/home.component'; import { GameComponent } from './game/game.component'; import { AboutComponent } from './about/about.component'; const routes: Routes = [ { path: '', component: LayoutDefaultComponent, children: [ { path: '', redirectTo: 'home', pathMatch: 'full' }, { path: 'home', component: HomeComponent }, { path: 'about', component: AboutComponent }, { path: ':id', component: GameComponent }, ] }, { path: '**', redirectTo: '' } ]; @NgModule({ imports: [RouterModule.forRoot(routes, { scrollPositionRestoration: 'top' })], exports: [RouterModule] }) export class RoutesRoutingModule {}
34,433
https://github.com/electricit1/htdocs/blob/master/app/Views/knowledge/wiedzaWyborJezyka.php
Github Open Source
Open Source
MIT
null
htdocs
electricit1
PHP
Code
214
1,137
<?php use \helpers\form, \core\error; ?> <style> .form-signin { max-width: 420px; padding: 30px 38px 66px; margin: 0 auto; background-color: #eee; border: 3px dotted rgba(0,0,0,0.1); } .form-heading { text-align:center; margin-bottom: 30px; } .input-group{ margin-bottom: 15px; } label input[type=radio] { opacity: 0; } .input-group-custom{padding-bottom: 85px;height: 50px;} </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <?php echo Form::open(array('method' => 'post', 'class' => 'form-signin'));?> <h3 class="form-heading">Wybier jezyk w jakim maja byc slowka do przetlumaczenia</h3> <div class="input-group input-group-custom"> <span class="input-group-addon input-group-custom2">Jezyk</span> <div class="radio col-xs-12 btn-group btn-group-justified"> <label class=" btn-primary btn btn-group" id="l1"> <input type="radio" name="radios1" class="track-order-change" id="firstRadio1" value="0"> <?php echo $data[jezyki][0]->jez1;?> </label> <label class=" btn-primary btn btn-group" id="l2"> <input type="radio" name="radios1" class="track-order-change" id="secondRadio1" value="1"> <?php echo $data[jezyki][0]->jez2;?> </label> </div> </div> <div class="input-group input-group-custom"> <span class="input-group-addon input-group-custom2">Tryb nauki</span> <div class="radio col-xs-12 btn-group btn-group-justified"> <label class=" btn-primary btn btn-group" id="t1"> <input type="radio" name="radios2" class="track-order-change" id="firstRadio2" value="0"> Jedna proba </label> <label class=" btn-primary btn btn-group" id="t2"> <input type="radio" name="radios2" class="track-order-change" id="secondRadio2" value="1"> Wielkorotne proby </label> </div> </div> <script> $('input[name="radios1"]').change(function() { if($(this).val() == "0"){ $("[id=l1]").removeClass("btn-primary").addClass("btn-success"); $("[id=l2]").removeClass("btn-success").addClass("btn-primary"); }else if($(this).val() == "1"){ $("[id=l1]").removeClass("btn-success").addClass("btn-primary"); $("[id=l2]").removeClass("btn-primary").addClass("btn-success"); } }); $('input[name="radios2"]').change(function() { if($(this).val() == "0"){ $("[id=t1]").removeClass("btn-primary").addClass("btn-success"); $("[id=t2]").removeClass("btn-success").addClass("btn-primary"); }else if($(this).val() == "1"){ $("[id=t1]").removeClass("btn-success").addClass("btn-primary"); $("[id=t2]").removeClass("btn-primary").addClass("btn-success"); } }); </script> <div class="btn-group btn-group-justified"> <?php echo "<div class=\"btn-group\">".Form::input(array('type' => 'submit', 'name' => 'submit', 'value' => 'Gotowy !' , 'class' => 'btn btn-lg btn-primary' ))."</div>";?> </div> <?php echo Form::close();?>
34,607
https://github.com/BulkGate/magesms/blob/master/Extensions/SettingsInterface.php
Github Open Source
Open Source
BSD-3-Clause
2,019
magesms
BulkGate
PHP
Code
90
235
<?php namespace BulkGate\Magesms\Extensions; /** * Interface SettingsInterface * @package BulkGate\Magesms\Extensions */ interface SettingsInterface { /** * @param string $settings_key * @param bool $default * @return mixed */ public function load($settings_key, $default = false); /** * @param string $settings_key * @param mixed|$value * @param array $meta */ public function set($settings_key, $value, array $meta = []); /** * @param string|null $settings_key */ public function delete($settings_key = null); /** * @return array */ public function synchronize(); /** * @return void */ public function install(); /** * @return void */ public function uninstall(); }
11,694
https://github.com/Milos1983/Test-/blob/master/js/main.js
Github Open Source
Open Source
MIT
2,019
Test-
Milos1983
JavaScript
Code
263
876
function myFunction() { var popup = document.getElementById("myPopup"); popup.classList.toggle("show"); } function myFunction2() { var popup = document.getElementById("myPopup2"); popup.classList.toggle("show"); } function myFunction3() { var popup = document.getElementById("myPopup3"); popup.classList.toggle("show"); } function myFunction4() { var popup = document.getElementById("myPopup4"); popup.classList.toggle("show"); } function myFunction5() { var popup = document.getElementById("myPopup5"); popup.classList.toggle("show"); } function myFunction6() { var popup = document.getElementById("myPopup6"); popup.classList.toggle("show"); } function myFunction7() { var popup = document.getElementById("myPopup7"); popup.classList.toggle("show"); } var image_tracker = 'h'; function like() { var image = document.getElementById('like'); if(image_tracker == 'h') { image.src = 'icons/heart.png'; image_tracker = 'h2'; } else { image.src = 'icons/heart.svg'; image_tracker = 'h'; } } function like2() { var image = document.getElementById('like2'); if(image_tracker == 'h') { image.src = 'icons/heart.png'; image_tracker = 'h2'; } else { image.src = 'icons/heart.svg'; image_tracker = 'h'; } } function like3() { var image = document.getElementById('like3'); if(image_tracker == 'h') { image.src = 'icons/heart.png'; image_tracker = 'h2'; } else { image.src = 'icons/heart.svg'; image_tracker = 'h'; } } function like4() { var image = document.getElementById('like4'); if(image_tracker == 'h') { image.src = 'icons/heart.png'; image_tracker = 'h2'; } else { image.src = 'icons/heart.svg'; image_tracker = 'h'; } } function like5() { var image = document.getElementById('like5'); if(image_tracker == 'h') { image.src = 'icons/heart.png'; image_tracker = 'h2'; } else { image.src = 'icons/heart.svg'; image_tracker = 'h'; } } function like6() { var image = document.getElementById('like6'); if(image_tracker == 'h') { image.src = 'icons/heart.png'; image_tracker = 'h2'; } else { image.src = 'icons/heart.svg'; image_tracker = 'h'; } } function like7() { var image = document.getElementById('like7'); if(image_tracker == 'h') { image.src = 'icons/heart.png'; image_tracker = 'h2'; } else { image.src = 'icons/heart.svg'; image_tracker = 'h'; } }
26,163
https://github.com/JetBrains/teamcity-docker-images/blob/master/tool/automation/framework/app/src/main/kotlin/com/jetbrains/teamcity/Automation.kt
Github Open Source
Open Source
Apache-2.0
2,023
teamcity-docker-images
JetBrains
Kotlin
Code
382
1,058
/* * This Kotlin source file was generated by the Gradle 'init' task. */ package com.jetbrains.teamcity import com.jetbrains.teamcity.common.constants.ValidationConstants import com.jetbrains.teamcity.docker.exceptions.DockerImageValidationException import com.jetbrains.teamcity.docker.hub.auth.DockerhubCredentials import com.jetbrains.teamcity.docker.validation.DockerImageValidationUtilities import kotlinx.cli.* /** * Subcommand for image validation. Will be consumed by .. * ... argument parser. */ @OptIn(ExperimentalCli::class) class ValidateImage : Subcommand("validate", "Validate Docker Image with (optionally) provided credentials.") { private val validationArgs by argument( ArgType.String, description = "Image, (optional) Username, (optional) Token" ).vararg() /** * Execute image validation option specified via CLI. */ override fun execute() { // 1. Capture current image size val originalImageName = validationArgs[0] val username = if (validationArgs.size > 1) validationArgs[1] else null val token = if (validationArgs.size > 2) validationArgs[2] else null val credentials: DockerhubCredentials = getDockerhubCredentials(username, token) val percentageChangeThreshold = ValidationConstants.ALLOWED_IMAGE_SIZE_INCREASE_THRESHOLD_PERCENT val imagesFailedValidation = DockerImageValidationUtilities.validateImageSize( originalImageName, "https://hub.docker.com/v2", percentageChangeThreshold, credentials ) if (imagesFailedValidation.isNotEmpty()) { imagesFailedValidation.forEach { println("Validation failed for ${originalImageName}, OS: ${it.os}, OS version: ${it.osVersion}, architecture: ${it.architecture}") } // throw exception in order to handle it within upstream DSL throw DockerImageValidationException("Validation had failed for $originalImageName") } } } /** * Print out the trend for image sizes. */ class PrintImageSizeTrend : Subcommand("get-size-trend", "Print out the trend for the size of given Docker image.") { private val imageName by argument( ArgType.String, description = "Image, (optional) logic, (optional) access token" ).vararg() override fun execute() { val image = imageName[0] val registryUri = "https://hub.docker.com/v2" val username = if (imageName.size > 1) imageName[1] else null val token = if (imageName.size > 2) imageName[2] else null val credentials: DockerhubCredentials = getDockerhubCredentials(username, token) DockerImageValidationUtilities.printImageSizeTrend(image, registryUri, credentials) } } /** * Constructs provided arguments into DockerhubCredentials instance. * Purpose: unify null-handling within arguments parsing. */ fun getDockerhubCredentials(username: String?, token: String?): DockerhubCredentials { if (username.isNullOrEmpty() != token.isNullOrEmpty()) { // we could tolerate when credentials were not provided at all, but not vise-versa throw IllegalArgumentException("If credentials should be used, both username and token must be provided.") } return DockerhubCredentials(username, token) } @OptIn(ExperimentalCli::class) fun main(args: Array<String>) { val parser = ArgParser("automation") // -- add subcommands parser.subcommands(ValidateImage()) parser.subcommands(PrintImageSizeTrend()) // Splitting arguments into a list as the "--args" options might be treated as a ... // ... single string in non-interactive terminals, thus the parsing could be done incorrectly. ... // ... "\\s" is used to also cover non-unicode whitespaces. val argsList: Array<String> = if (args.size > 1) args else args[0].split("\\s+".toRegex()).toTypedArray() parser.parse(argsList) }
676
https://github.com/Moferor/laravel-linebot-lottery/blob/master/src/Services/CrawlersService/TaiwanLottery/TaiwanLotteryInterface.php
Github Open Source
Open Source
MIT
null
laravel-linebot-lottery
Moferor
PHP
Code
16
72
<?php namespace Jose13\LaravelLineBotLottery\Services\CrawlersService\TaiwanLottery; interface TaiwanLotteryInterface { function heardParam(): array; function bodyParam(): string; function footerParam(): array; }
23,790
https://github.com/SkyXR/onyx/blob/master/src/components/ItemDisplayList.vue
Github Open Source
Open Source
MIT
null
onyx
SkyXR
Vue
Code
63
194
<template> <div class="flex flex-col items-center"> <!-- <p class="text-xs text-gray-500 font-mono mb-4">wadi</p> --> <div class="inline-flex justify-center items-center text-center" > <ul id="example-1"> <li v-for="item in items"> • {{ item }} </li> </ul> </div> </div> </template> <script lang="ts"> import { defineComponent } from 'vue'; import useItem from '../hooks/runItem'; export default defineComponent({ setup() { const { state } = useItem(); return { ...state }; }, }); </script>
21,874
https://github.com/karki786/advance-inventory/blob/master/app/CodedCell/Repository/Message/MessageEntity.php
Github Open Source
Open Source
MIT
2,020
advance-inventory
karki786
PHP
Code
396
1,224
<?php namespace CodedCell\Repository\Message; use App\Message; use App\User; use Auth; use Carbon\Carbon; use Mail; class MessageEntity implements MessageInterface { /** * Saves email/notification in database * @param $message * @param $userRole * @return mixed */ public function createMessage($message, $userRole) { $emailMessages = array(); $users = User::with('setting')->whereRoleId($userRole)->get(); foreach ($users as $user) { $emailMessage = array( 'name' => $user->name, 'emailTo' => $user->email, 'itemId' => $message['itemId'], 'userId' => $user->id ); if ($user->setting) { $response = $this->sendMessage($emailMessage, $user->setting->printersDowntime); if ($response == true) { $message['sent'] = 1; $message['userId'] = $user->id; $Tomessage = Message::create($message); array_push($emailMessages, $Tomessage->toArray()); } } } return $emailMessages; } /** * Used to send emails * @param array $message * @return mixed */ public function sendEmails($message) { $superUsers = User::whereRoleId(1)->get(); $x = array(); foreach ($message as $single) { foreach ($single as $s) { array_push($x, $s); } } $message = $x; foreach ($superUsers as $user) { $id = $user->id; $email = $user->email; $superUserNotifications = array_where($message, function ($key, $value) use ($id) { if ($value['userId'] == $id) { return $value; } }); if (count($superUserNotifications) > 0) { Mail::send('emails.printers', array('messages' => $superUserNotifications), function ($message) use ($email) { $message->to($email)->subject('Hi I could not get the status for the following printers'); }); } } } /** * Sends message through email, If message was sent within * the specified period it is not sent. * @param array $message * @param $period * @return mixed */ public function sendMessage(array $message, $period) { $count = Message::where( 'created_at', '>', Carbon::now()->subHours($period) ) ->whereItemidAndUserid($message['itemId'], $message['userId'])->count(); if ($count == 0) { Message::whereItemidAndUserid($message['itemId'], $message['userId'])->delete(); return true; } return false; } /** * Set Specified Message as read * @param $id * @return mixed */ public function setMessageAsRead($id) { return Message::whereId($id)->update(array('isRead' => 1)); } /** * Used to get unread Messages * @return mixed */ public function getUnreadNotifications() { return Message::whereIsreadAndUserid(0, Auth::user()->id)->get(); } /** * Gets Read Messages * @return mixed */ public function getReadNotifications() { return Message::whereIsreadAndUserid(1, Auth::user()->id)->get(); } /** * Gets all sent emails * @return mixed */ public function getSentEmails() { if (Auth::user()) { return Message::whereSentAndMessagetypeAndUserid(1, 1, Auth::user()->id)->get(); } } /** * Set Specified Message as sent * @param $id * @return mixed */ public function setMessageAsSent($id) { return Message::whereId($id)->update(array('sent' => 1)); } /** * Get All Emails * @return mixed */ public function getAllEmails() { return Message::paginate(env('RECORDS_VIEW'))->setPath(''); } /** * Deletes Message based on item Id. * @param $itemId * @return mixed */ public function deletePrinterMessage($itemId) { return Message::whereItemid($itemId)->delete(); } }
33,386
https://github.com/larroy/Crowfoot/blob/master/benchmarking_stack/homedir/bin/git-addremove
Github Open Source
Open Source
NCSA, BSD-2-Clause-Views, BSD-3-Clause, LicenseRef-scancode-generic-cla, Zlib, BSL-1.0, Apache-2.0, BSD-2-Clause, Intel, MIT, LicenseRef-scancode-unknown-license-reference, Unlicense
2,020
Crowfoot
larroy
Shell
Code
14
33
#!/usr/bin/env bash # git-addremove git add . git ls-files --deleted | xargs git rm
28,356
https://github.com/ionic-team/ionic-framework/blob/master/packages/react-router/test/base/tests/e2e/specs/refs.cy.js
Github Open Source
Open Source
MIT
2,023
ionic-framework
ionic-team
JavaScript
Code
68
180
const port = 3000; describe("Refs", () => { /* This spec tests that refs and props get correctly set on ionic components */ it("/refs, when ref is used on an FC, className should be added to ionic component", () => { cy.visit(`http://localhost:${port}/refs`); cy.ionPageVisible("refs-fc"); cy.get(".ref-test"); }); it("/refs/class, when ref is used on a Class, className should be added to ionic component", () => { cy.visit(`http://localhost:${port}/refs/class`); cy.ionPageVisible("refs-class"); cy.get(".ref-test"); }); });
4,863
https://github.com/electron-utils/electron-menu-plus/blob/master/test/basic.spec.js
Github Open Source
Open Source
MIT
2,020
electron-menu-plus
electron-utils
JavaScript
Code
648
2,406
'use strict'; const {Menu} = require('../index'); suite(tap, 'menu', {timeout: 2000}, t => { let template = [ { label: 'foo', submenu: [ ], }, { label: 'bar', submenu: [ { label: 'bar.01', }, { label: 'bar.02', }, ], }, ]; t.test('it should be built from template', t => { let testMenu = new Menu(template); t.equal( testMenu.electronMenu.items.length, 2); t.equal( testMenu.electronMenu.items[0].label, 'foo'); t.end(); }); t.test('it should be able to add menu item through template', t => { let testMenu = new Menu(); testMenu.add('foo/bar', template); t.equal( testMenu.electronMenu.items[0].label, 'foo'); t.equal( testMenu.electronMenu.items[0].submenu.items[0].label, 'bar'); t.end(); }); t.test('should be able to add menu item by path', t => { let testMenu = new Menu(); testMenu.add('tar/zom', {message: 'hint'}); t.equal( testMenu.electronMenu.items[0].label, 'tar'); t.equal( testMenu.electronMenu.items[0].submenu.items[0].label, 'zom'); t.end(); }); t.test('it should be able to add menu template array as submenu by path', t => { let testMenu = new Menu(); testMenu.add('foo/bar', [ { label: 'a', message: 'a' }, { label: 'b', message: 'b' }, { label: 'c', message: 'c' }, ]); let items = testMenu.electronMenu.items[0].submenu.items[0].submenu.items; t.equal(items.length, 3); t.equal(items[0].label, 'a'); t.equal(items[1].label, 'b'); t.equal(items[2].label, 'c'); t.end(); }); t.test('it should be able to expand menu template if it contains path field', t => { let testMenu = new Menu(); testMenu.add('foo/bar', [ { path: 'foobar/a', message: 'a' }, { path: 'foobar/b', message: 'b' }, { path: 'foobar/c', message: 'c' }, ]); let foobarItem = testMenu.electronMenu .items[0].submenu .items[0].submenu .items[0] ; t.equal(foobarItem.label, 'foobar'); t.equal(foobarItem.submenu.items[0].label, 'a'); t.equal(foobarItem.submenu.items[1].label, 'b'); t.equal(foobarItem.submenu.items[2].label, 'c'); t.end(); }); t.test('it should be able to remove menu item by path', t => { let testMenu = new Menu(template); t.equal(testMenu.electronMenu.items[1].submenu.items.length, 2); testMenu.remove('bar/bar.01'); t.equal(testMenu.electronMenu.items[1].submenu.items.length, 1); t.end(); }); t.test('it should be able to update exists sub-menu at root', t => { let tmpl = [ { label: 'foo', submenu: [ { label: 'foo.01', }, { label: 'foo.02', }, ], }, { label: 'bar', submenu: [ { label: 'bar.01', }, { label: 'bar.02', }, ], }, ]; let testMenu = new Menu(tmpl); testMenu.update( 'foo', [ { label: 'foo.01.new', }, { label: 'foo.02.new', }, { label: 'foo.03.new', }, ]); t.equal(testMenu.electronMenu.items[0].submenu.items[0].label, 'foo.01.new'); t.equal(testMenu.electronMenu.items[0].submenu.items[1].label, 'foo.02.new'); t.equal(testMenu.electronMenu.items[0].submenu.items[2].label, 'foo.03.new'); t.equal(testMenu.electronMenu.items[1].label, 'bar'); t.end(); }); t.test('it should be able to update exists sub-menu at path', t => { let tmpl = [ { label: 'foo', submenu: [ { label: 'foo.01', submenu: [ { label: 'foo.01.a', }, { label: 'foo.01.b', }, ] }, { label: 'foo.02', }, ], }, { label: 'bar', submenu: [ { label: 'bar.01', }, { label: 'bar.02', }, ], }, ]; let testMenu = new Menu(tmpl); testMenu.update( 'foo/foo.01', [ { label: 'foo.01.a.new', }, { label: 'foo.01.b.new', }, { label: 'foo.01.c.new', }, ]); let fooFoo01 = testMenu.electronMenu.items[0].submenu.items[0]; t.equal(fooFoo01.submenu.items[0].label, 'foo.01.a.new'); t.equal(fooFoo01.submenu.items[1].label, 'foo.01.b.new'); t.equal(fooFoo01.submenu.items[2].label, 'foo.01.c.new'); t.equal(testMenu.electronMenu.items[0].submenu.items[1].label, 'foo.02'); t.end(); }); t.test('it should not add dev template in release mode', t => { let oldDev = Menu.showDev; Menu.showDev = false; let tmpl = [ { label: 'foo', submenu: [ ], dev: true, }, { label: 'bar', submenu: [ { label: 'bar.01', dev: true, }, { label: 'bar.02', }, ], }, ]; let testMenu = new Menu(tmpl); t.equal(testMenu.electronMenu.items.length, 1); t.equal(testMenu.electronMenu.items[0].submenu.items[0].label, 'bar.02'); Menu.showDev = oldDev; t.end(); }); t.test('should be able to parse template with path', t => { let tmpl = [ { label: 'foo', type: 'submenu', submenu: [] }, { label: 'bar', type: 'submenu', submenu: [] }, { path: 'foo/foo.01', }, { path: 'bar/bar.01', }, { path: 'bar/bar.02', type: 'submenu', submenu: [] }, { path: 'foobar/say hello', click: () => { console.log('hello world'); } }, { label: 'a menu item', click: () => { console.log('a menu item'); } }, { path: 'bar/bar.02/bar.02.01' }, { path: 'a menu path item', click: () => { console.log('a menu item'); } }, ]; let testMenu = new Menu(tmpl); // basic t.equal(testMenu.electronMenu.items[0].submenu.items[0].label, 'foo.01'); t.equal(testMenu.electronMenu.items[1].submenu.items[0].label, 'bar.01'); t.equal(testMenu.electronMenu.items[1].submenu.items[1].label, 'bar.02'); // test if path can add in order t.equal(testMenu.electronMenu.items[2].label, 'foobar'); t.equal(testMenu.electronMenu.items[3].label, 'a menu item'); // test if first level path can be add correctly t.equal(testMenu.electronMenu.items[4].label, 'a menu path item'); // test if second level path can be add correctly t.equal( testMenu.electronMenu.items[1].submenu.items[1].submenu.items[0].label, 'bar.02.01' ); t.end(); }); });
47,527
https://github.com/kaniini/libucontext/blob/master/arch/ppc64/startcontext.S
Github Open Source
Open Source
LicenseRef-scancode-mit-taylor-variant
2,022
libucontext
kaniini
Unix Assembly
Code
163
354
/* * Copyright (c) 2018 Ariadne Conill <ariadne@dereferenced.org> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * This software is provided 'as is' and without any warranty, express or * implied. In no event shall the authors be liable for any damages arising * from the use of this software. */ #include "common-defs.h" .hidden libucontext_trampoline FUNC(libucontext_trampoline) cmpdi 31,0 /* test if ucontext link pointer is null */ beq no_linked_context /* if it is, exit */ /* now, call SYS_swapcontext */ mr 4,31 /* ucp is in r31 */ li 3,0 /* don't care about restoring, set oucp to NULL */ li 5,1696 /* sizeof(ucontext_t) */ li 0,249 /* SYS_swapcontext */ sc /* we should not wind back up here, if we do, exit with -1 */ li 3,-1 no_linked_context: b exit@GOT nop END(libucontext_trampoline)
39,925
https://github.com/peds/py-earth/blob/master/pyearth/_record.c
Github Open Source
Open Source
BSD-3-Clause
2,022
py-earth
peds
C
Code
20,000
94,701
/* Generated by Cython 0.29.32 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "/home/pedram/.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h", "/home/pedram/.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h", "/home/pedram/.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h", "/home/pedram/.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h", "/home/pedram/.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h" ], "include_dirs": [ "/home/pedram/.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/core/include" ], "language": "c", "name": "pyearth._record", "sources": [ "pyearth/_record.pyx" ] }, "module_name": "pyearth._record" } END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_29_32" #define CYTHON_HEX_VERSION 0x001D20F0 #define CYTHON_FUTURE_DIVISION 0 #include <stddef.h> #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900) #endif #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #elif defined(PY_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #elif !defined(CYTHON_FAST_THREAD_STATE) #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000) #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif #if PY_VERSION_HEX >= 0x030B00A4 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include <stdint.h> #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if PY_VERSION_HEX >= 0x030B00A1 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL; PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL; const char *fn_cstr=NULL; const char *name_cstr=NULL; PyCodeObject* co=NULL; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); if (!(kwds=PyDict_New())) goto end; if (!(argcount=PyLong_FromLong(a))) goto end; if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end; if (!(posonlyargcount=PyLong_FromLong(0))) goto end; if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end; if (!(kwonlyargcount=PyLong_FromLong(k))) goto end; if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end; if (!(nlocals=PyLong_FromLong(l))) goto end; if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end; if (!(stacksize=PyLong_FromLong(s))) goto end; if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end; if (!(flags=PyLong_FromLong(f))) goto end; if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end; if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end; if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end; if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end; if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end; if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end; if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end; if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end; if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end; if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end; if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end; if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too; if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too; Py_XDECREF((PyObject*)co); co = (PyCodeObject*)call_result; call_result = NULL; if (0) { cleanup_code_too: Py_XDECREF((PyObject*)co); co = NULL; } end: Py_XDECREF(kwds); Py_XDECREF(argcount); Py_XDECREF(posonlyargcount); Py_XDECREF(kwonlyargcount); Py_XDECREF(nlocals); Py_XDECREF(stacksize); Py_XDECREF(replace); Py_XDECREF(call_result); Py_XDECREF(empty); if (type) { PyErr_Restore(type, value, traceback); } return co; } #else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 #define PyMem_RawMalloc(n) PyMem_Malloc(n) #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) #define PyMem_RawFree(p) PyMem_Free(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) #else #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if defined(PyUnicode_IS_READY) #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #else #define __Pyx_PyUnicode_READY(op) (0) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include <math.h> #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pyearth___record #define __PYX_HAVE_API__pyearth___record /* Early includes */ #include <string.h> #include <stdio.h> #include "numpy/arrayobject.h" #include "numpy/ndarrayobject.h" #include "numpy/ndarraytypes.h" #include "numpy/arrayscalars.h" #include "numpy/ufuncobject.h" /* NumPy API declarations from "numpy/__init__.pxd" */ #include "pythread.h" #ifdef _OPENMP #include <omp.h> #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include <cstdlib> #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; /* Header.proto */ #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 #elif defined(_Complex_I) #define CYTHON_CCOMPLEX 1 #else #define CYTHON_CCOMPLEX 0 #endif #endif #if CYTHON_CCOMPLEX #ifdef __cplusplus #include <complex> #else #include <complex.h> #endif #endif #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) #undef _Complex_I #define _Complex_I 1.0fj #endif static const char *__pyx_f[] = { "pyearth/_record.pyx", "stringsource", "pyearth/_record.pxd", "__init__.pxd", "type.pxd", "bool.pxd", "complex.pxd", "pyearth/_basis.pxd", }; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":689 * # in Cython to enable them only on the right systems. * * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t */ typedef npy_int8 __pyx_t_5numpy_int8_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":690 * * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t */ typedef npy_int16 __pyx_t_5numpy_int16_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":691 * ctypedef npy_int8 int8_t * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< * ctypedef npy_int64 int64_t * #ctypedef npy_int96 int96_t */ typedef npy_int32 __pyx_t_5numpy_int32_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":692 * ctypedef npy_int16 int16_t * ctypedef npy_int32 int32_t * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< * #ctypedef npy_int96 int96_t * #ctypedef npy_int128 int128_t */ typedef npy_int64 __pyx_t_5numpy_int64_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":696 * #ctypedef npy_int128 int128_t * * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t */ typedef npy_uint8 __pyx_t_5numpy_uint8_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":697 * * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t */ typedef npy_uint16 __pyx_t_5numpy_uint16_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":698 * ctypedef npy_uint8 uint8_t * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< * ctypedef npy_uint64 uint64_t * #ctypedef npy_uint96 uint96_t */ typedef npy_uint32 __pyx_t_5numpy_uint32_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":699 * ctypedef npy_uint16 uint16_t * ctypedef npy_uint32 uint32_t * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< * #ctypedef npy_uint96 uint96_t * #ctypedef npy_uint128 uint128_t */ typedef npy_uint64 __pyx_t_5numpy_uint64_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":703 * #ctypedef npy_uint128 uint128_t * * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< * ctypedef npy_float64 float64_t * #ctypedef npy_float80 float80_t */ typedef npy_float32 __pyx_t_5numpy_float32_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":704 * * ctypedef npy_float32 float32_t * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< * #ctypedef npy_float80 float80_t * #ctypedef npy_float128 float128_t */ typedef npy_float64 __pyx_t_5numpy_float64_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":713 * # The int types are mapped a bit surprising -- * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t # <<<<<<<<<<<<<< * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t */ typedef npy_long __pyx_t_5numpy_int_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":714 * # numpy.int corresponds to 'l' and numpy.long to 'q' * ctypedef npy_long int_t * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< * ctypedef npy_longlong longlong_t * */ typedef npy_longlong __pyx_t_5numpy_long_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":715 * ctypedef npy_long int_t * ctypedef npy_longlong long_t * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< * * ctypedef npy_ulong uint_t */ typedef npy_longlong __pyx_t_5numpy_longlong_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":717 * ctypedef npy_longlong longlong_t * * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t */ typedef npy_ulong __pyx_t_5numpy_uint_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":718 * * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< * ctypedef npy_ulonglong ulonglong_t * */ typedef npy_ulonglong __pyx_t_5numpy_ulong_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":719 * ctypedef npy_ulong uint_t * ctypedef npy_ulonglong ulong_t * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< * * ctypedef npy_intp intp_t */ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":721 * ctypedef npy_ulonglong ulonglong_t * * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< * ctypedef npy_uintp uintp_t * */ typedef npy_intp __pyx_t_5numpy_intp_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":722 * * ctypedef npy_intp intp_t * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< * * ctypedef npy_double float_t */ typedef npy_uintp __pyx_t_5numpy_uintp_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":724 * ctypedef npy_uintp uintp_t * * ctypedef npy_double float_t # <<<<<<<<<<<<<< * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t */ typedef npy_double __pyx_t_5numpy_float_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":725 * * ctypedef npy_double float_t * ctypedef npy_double double_t # <<<<<<<<<<<<<< * ctypedef npy_longdouble longdouble_t * */ typedef npy_double __pyx_t_5numpy_double_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":726 * ctypedef npy_double float_t * ctypedef npy_double double_t * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< * * ctypedef npy_cfloat cfloat_t */ typedef npy_longdouble __pyx_t_5numpy_longdouble_t; /* "_types.pxd":2 * cimport numpy as cnp * ctypedef cnp.float64_t FLOAT_t # <<<<<<<<<<<<<< * ctypedef cnp.int_t INT_t * ctypedef cnp.intp_t INDEX_t */ typedef __pyx_t_5numpy_float64_t __pyx_t_7pyearth_6_types_FLOAT_t; /* "_types.pxd":3 * cimport numpy as cnp * ctypedef cnp.float64_t FLOAT_t * ctypedef cnp.int_t INT_t # <<<<<<<<<<<<<< * ctypedef cnp.intp_t INDEX_t * ctypedef cnp.uint8_t BOOL_t */ typedef __pyx_t_5numpy_int_t __pyx_t_7pyearth_6_types_INT_t; /* "_types.pxd":4 * ctypedef cnp.float64_t FLOAT_t * ctypedef cnp.int_t INT_t * ctypedef cnp.intp_t INDEX_t # <<<<<<<<<<<<<< * ctypedef cnp.uint8_t BOOL_t */ typedef __pyx_t_5numpy_intp_t __pyx_t_7pyearth_6_types_INDEX_t; /* "_types.pxd":5 * ctypedef cnp.int_t INT_t * ctypedef cnp.intp_t INDEX_t * ctypedef cnp.uint8_t BOOL_t # <<<<<<<<<<<<<< */ typedef __pyx_t_5numpy_uint8_t __pyx_t_7pyearth_6_types_BOOL_t; /* Declarations.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus typedef ::std::complex< float > __pyx_t_float_complex; #else typedef float _Complex __pyx_t_float_complex; #endif #else typedef struct { float real, imag; } __pyx_t_float_complex; #endif static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); /* Declarations.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus typedef ::std::complex< double > __pyx_t_double_complex; #else typedef double _Complex __pyx_t_double_complex; #endif #else typedef struct { double real, imag; } __pyx_t_double_complex; #endif static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); /*--- Type declarations ---*/ struct __pyx_obj_7pyearth_6_basis_BasisFunction; struct __pyx_obj_7pyearth_6_basis_RootBasisFunction; struct __pyx_obj_7pyearth_6_basis_ConstantBasisFunction; struct __pyx_obj_7pyearth_6_basis_VariableBasisFunction; struct __pyx_obj_7pyearth_6_basis_DataVariableBasisFunction; struct __pyx_obj_7pyearth_6_basis_MissingnessBasisFunction; struct __pyx_obj_7pyearth_6_basis_HingeBasisFunctionBase; struct __pyx_obj_7pyearth_6_basis_SmoothedHingeBasisFunction; struct __pyx_obj_7pyearth_6_basis_HingeBasisFunction; struct __pyx_obj_7pyearth_6_basis_LinearBasisFunction; struct __pyx_obj_7pyearth_6_basis_Basis; struct __pyx_obj_7pyearth_7_record_Record; struct __pyx_obj_7pyearth_7_record_PruningPassRecord; struct __pyx_obj_7pyearth_7_record_ForwardPassRecord; struct __pyx_obj_7pyearth_7_record_Iteration; struct __pyx_obj_7pyearth_7_record_PruningPassIteration; struct __pyx_obj_7pyearth_7_record_FirstPruningPassIteration; struct __pyx_obj_7pyearth_7_record_ForwardPassIteration; struct __pyx_obj_7pyearth_7_record_FirstForwardPassIteration; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":728 * ctypedef npy_longdouble longdouble_t * * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t */ typedef npy_cfloat __pyx_t_5numpy_cfloat_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":729 * * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< * ctypedef npy_clongdouble clongdouble_t * */ typedef npy_cdouble __pyx_t_5numpy_cdouble_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":730 * ctypedef npy_cfloat cfloat_t * ctypedef npy_cdouble cdouble_t * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< * * ctypedef npy_cdouble complex_t */ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; /* "../../.pyenv/versions/3.8.10/envs/pyearth-test/lib/python3.8/site-packages/numpy/__init__.pxd":732 * ctypedef npy_clongdouble clongdouble_t * * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< * * cdef inline object PyArray_MultiIterNew1(a): */ typedef npy_cdouble __pyx_t_5numpy_complex_t; struct __pyx_opt_args_7pyearth_6_basis_13BasisFunction_apply; struct __pyx_opt_args_7pyearth_6_basis_17RootBasisFunction_apply; struct __pyx_opt_args_7pyearth_6_basis_25DataVariableBasisFunction_apply; struct __pyx_opt_args_7pyearth_6_basis_24MissingnessBasisFunction_apply; struct __pyx_opt_args_7pyearth_6_basis_5Basis_transform_deriv; /* "_basis.pxd":51 * cpdef INDEX_t effective_degree(BasisFunction self) * * cpdef apply(BasisFunction self, cnp.ndarray[FLOAT_t, ndim=2] X, # <<<<<<<<<<<<<< * cnp.ndarray[BOOL_t, ndim=2] missing, * cnp.ndarray[FLOAT_t, ndim=1] b, bint recurse= ?) */ struct __pyx_opt_args_7pyearth_6_basis_13BasisFunction_apply { int __pyx_n; int recurse; }; /* "_basis.pxd":81 * cpdef BasisFunction get_parent(RootBasisFunction self) * * cpdef apply(RootBasisFunction self, cnp.ndarray[FLOAT_t, ndim=2] X, # <<<<<<<<<<<<<< * cnp.ndarray[BOOL_t, ndim=2] missing, * cnp.ndarray[FLOAT_t, ndim=1] b, bint recurse=?) */ struct __pyx_opt_args_7pyearth_6_basis_17RootBasisFunction_apply { int __pyx_n; int recurse; }; /* "_basis.pxd":113 * cpdef bint eligible(DataVariableBasisFunction self, INDEX_t variable) * * cpdef apply(DataVariableBasisFunction self, cnp.ndarray[FLOAT_t, ndim=2] X, # <<<<<<<<<<<<<< * cnp.ndarray[BOOL_t, ndim=2] missing, * cnp.ndarray[FLOAT_t, ndim=1] b, bint recurse=?) */ struct __pyx_opt_args_7pyearth_6_basis_25DataVariableBasisFunction_apply { int __pyx_n; int recurse; }; /* "_basis.pxd":136 * cpdef bint eligible(MissingnessBasisFunction self, INDEX_t variable) * * cpdef apply(MissingnessBasisFunction self, cnp.ndarray[FLOAT_t, ndim=2] X, # <<<<<<<<<<<<<< * cnp.ndarray[BOOL_t, ndim=2] missing, * cnp.ndarray[FLOAT_t, ndim=1] b, bint recurse=?) */ struct __pyx_opt_args_7pyearth_6_basis_24MissingnessBasisFunction_apply { int __pyx_n; int recurse; }; /* "_basis.pxd":233 * cnp.ndarray[FLOAT_t, ndim=1] weights) * * cpdef transform_deriv(Basis self, cnp.ndarray[FLOAT_t, ndim=2] X, # <<<<<<<<<<<<<< * cnp.ndarray[BOOL_t, ndim=2] missing, * cnp.ndarray[FLOAT_t, ndim=1] b, */ struct __pyx_opt_args_7pyearth_6_basis_5Basis_transform_deriv { int __pyx_n; PyBoolObject *prezeroed_j; }; struct __pyx_opt_args_7pyearth_5_util_ascii_table; /* "_util.pxd":23 * cpdef str_pad(string, length) * * cpdef ascii_table(header, data, print_header=?, print_footer=?) # <<<<<<<<<<<<<< */ struct __pyx_opt_args_7pyearth_5_util_ascii_table { int __pyx_n; PyObject *print_header; PyObject *print_footer; }; /* "_basis.pxd":5 * from _types cimport FLOAT_t, INT_t, INDEX_t, BOOL_t * * cdef class BasisFunction: # <<<<<<<<<<<<<< * '''Abstract. Subclasses must implement the apply and __init__ methods.''' * */ struct __pyx_obj_7pyearth_6_basis_BasisFunction { PyObject_HEAD struct __pyx_vtabstruct_7pyearth_6_basis_BasisFunction *__pyx_vtab; struct __pyx_obj_7pyearth_6_basis_BasisFunction *parent; PyObject *child_map; PyObject *children; int pruned; int prunable; int splittable; }; /* "_basis.pxd":63 * cnp.ndarray[INT_t, ndim=1] workspace) * * cdef class RootBasisFunction(BasisFunction): # <<<<<<<<<<<<<< * cpdef bint covered(RootBasisFunction self, INDEX_t variable) * */ struct __pyx_obj_7pyearth_6_basis_RootBasisFunction { struct __pyx_obj_7pyearth_6_basis_BasisFunction __pyx_base; }; /* "_basis.pxd":90 * cnp.ndarray[FLOAT_t, ndim=1] j, INDEX_t var) * * cdef class ConstantBasisFunction(RootBasisFunction): # <<<<<<<<<<<<<< * * cpdef inline FLOAT_t eval(ConstantBasisFunction self) */ struct __pyx_obj_7pyearth_6_basis_ConstantBasisFunction { struct __pyx_obj_7pyearth_6_basis_RootBasisFunction __pyx_base; }; /* "_basis.pxd":96 * cpdef inline FLOAT_t eval_deriv(ConstantBasisFunction self) * * cdef class VariableBasisFunction(BasisFunction): # <<<<<<<<<<<<<< * cdef INDEX_t variable * cdef readonly label */ struct __pyx_obj_7pyearth_6_basis_VariableBasisFunction { struct __pyx_obj_7pyearth_6_basis_BasisFunction __pyx_base; __pyx_t_7pyearth_6_types_INDEX_t variable; PyObject *label; }; /* "_basis.pxd":106 * cpdef INDEX_t get_variable(VariableBasisFunction self) * * cdef class DataVariableBasisFunction(VariableBasisFunction): # <<<<<<<<<<<<<< * cpdef _effective_degree(DataVariableBasisFunction self, dict data_dict, dict missing_dict) * */ struct __pyx_obj_7pyearth_6_basis_DataVariableBasisFunction { struct __pyx_obj_7pyearth_6_basis_VariableBasisFunction __pyx_base; }; /* "_basis.pxd":123 * cnp.ndarray[FLOAT_t, ndim=1] j, INDEX_t var) * * cdef class MissingnessBasisFunction(VariableBasisFunction): # <<<<<<<<<<<<<< * cdef readonly bint complement * */ struct __pyx_obj_7pyearth_6_basis_MissingnessBasisFunction { struct __pyx_obj_7pyearth_6_basis_VariableBasisFunction __pyx_base; int complement; }; /* "_basis.pxd":149 * dict knot_dict, dict translation) * * cdef class HingeBasisFunctionBase(DataVariableBasisFunction): # <<<<<<<<<<<<<< * cdef FLOAT_t knot * cdef INDEX_t knot_idx */ struct __pyx_obj_7pyearth_6_basis_HingeBasisFunctionBase { struct __pyx_obj_7pyearth_6_basis_DataVariableBasisFunction __pyx_base; __pyx_t_7pyearth_6_types_FLOAT_t knot; __pyx_t_7pyearth_6_types_INDEX_t knot_idx; int reverse; }; /* "_basis.pxd":164 * cpdef INDEX_t get_knot_idx(HingeBasisFunctionBase self) * * cdef class SmoothedHingeBasisFunction(HingeBasisFunctionBase): # <<<<<<<<<<<<<< * cdef FLOAT_t p * cdef FLOAT_t r */ struct __pyx_obj_7pyearth_6_basis_SmoothedHingeBasisFunction { struct __pyx_obj_7pyearth_6_basis_HingeBasisFunctionBase __pyx_base; __pyx_t_7pyearth_6_types_FLOAT_t p; __pyx_t_7pyearth_6_types_FLOAT_t r; __pyx_t_7pyearth_6_types_FLOAT_t knot_minus; __pyx_t_7pyearth_6_types_FLOAT_t knot_plus; }; /* "_basis.pxd":184 * cpdef get_r(SmoothedHingeBasisFunction self) * * cdef class HingeBasisFunction(HingeBasisFunctionBase): # <<<<<<<<<<<<<< * * cpdef _smoothed_version(HingeBasisFunction self, */ struct __pyx_obj_7pyearth_6_basis_HingeBasisFunction { struct __pyx_obj_7pyearth_6_basis_HingeBasisFunctionBase __pyx_base; }; /* "_basis.pxd":190 * dict knot_dict, dict translation) * * cdef class LinearBasisFunction(DataVariableBasisFunction): # <<<<<<<<<<<<<< * cpdef bool linear_in(LinearBasisFunction self, INDEX_t variable) * */ struct __pyx_obj_7pyearth_6_basis_LinearBasisFunction { struct __pyx_obj_7pyearth_6_basis_DataVariableBasisFunction __pyx_base; }; /* "_basis.pxd":196 * dict knot_dict, dict translation) * * cdef class Basis: # <<<<<<<<<<<<<< * '''A wrapper that provides functionality related to a set of BasisFunctions * with a common RootBasisFunction ancestor. Retains the order in which */ struct __pyx_obj_7pyearth_6_basis_Basis { PyObject_HEAD struct __pyx_vtabstruct_7pyearth_6_basis_Basis *__pyx_vtab; PyObject *order; __pyx_t_7pyearth_6_types_INDEX_t num_variables; }; /* "pyearth/_record.pxd":5 * from _basis cimport Basis * * cdef class Record: # <<<<<<<<<<<<<< * cdef list iterations * cdef int num_samples */ struct __pyx_obj_7pyearth_7_record_Record { PyObject_HEAD struct __pyx_vtabstruct_7pyearth_7_record_Record *__pyx_vtab; PyObject *iterations; int num_samples; int num_variables; __pyx_t_7pyearth_6_types_FLOAT_t penalty; __pyx_t_7pyearth_6_types_FLOAT_t sst; }; /* "pyearth/_record.pxd":22 * cpdef FLOAT_t grsq(Record self, INDEX_t iteration) * * cdef class PruningPassRecord(Record): # <<<<<<<<<<<<<< * cdef readonly INDEX_t selected * */ struct __pyx_obj_7pyearth_7_record_PruningPassRecord { struct __pyx_obj_7pyearth_7_record_Record __pyx_base; __pyx_t_7pyearth_6_types_INDEX_t selected; }; /* "pyearth/_record.pxd":31 * cpdef roll_back(PruningPassRecord self, Basis basis) * * cdef class ForwardPassRecord(Record): # <<<<<<<<<<<<<< * cdef readonly int stopping_condition * */ struct __pyx_obj_7pyearth_7_record_ForwardPassRecord { struct __pyx_obj_7pyearth_7_record_Record __pyx_base; int stopping_condition; PyObject *xlabels; }; /* "pyearth/_record.pxd":38 * cpdef set_stopping_condition(ForwardPassRecord self, int stopping_condition) * * cdef class Iteration: # <<<<<<<<<<<<<< * cdef FLOAT_t mse * cdef INDEX_t size */ struct __pyx_obj_7pyearth_7_record_Iteration { PyObject_HEAD struct __pyx_vtabstruct_7pyearth_7_record_Iteration *__pyx_vtab; __pyx_t_7pyearth_6_types_FLOAT_t mse; __pyx_t_7pyearth_6_types_INDEX_t size; }; /* "pyearth/_record.pxd":46 * cpdef INDEX_t get_size(Iteration self) * * cdef class PruningPassIteration(Iteration): # <<<<<<<<<<<<<< * cdef INDEX_t pruned * */ struct __pyx_obj_7pyearth_7_record_PruningPassIteration { struct __pyx_obj_7pyearth_7_record_Iteration __pyx_base; __pyx_t_7pyearth_6_types_INDEX_t pruned; }; /* "pyearth/_record.pxd":51 * cpdef INDEX_t get_pruned(PruningPassIteration self) * * cdef class FirstPruningPassIteration(PruningPassIteration): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7pyearth_7_record_FirstPruningPassIteration { struct __pyx_obj_7pyearth_7_record_PruningPassIteration __pyx_base; }; /* "pyearth/_record.pxd":54 * pass * * cdef class ForwardPassIteration(Iteration): # <<<<<<<<<<<<<< * cdef INDEX_t parent * cdef INDEX_t variable */ struct __pyx_obj_7pyearth_7_record_ForwardPassIteration { struct __pyx_obj_7pyearth_7_record_Iteration __pyx_base; __pyx_t_7pyearth_6_types_INDEX_t parent; __pyx_t_7pyearth_6_types_INDEX_t variable; __pyx_t_7pyearth_6_types_FLOAT_t knot; int code; int no_candidates; }; /* "pyearth/_record.pxd":65 * cpdef no_further_candidates(ForwardPassIteration self) * * cdef class FirstForwardPassIteration(ForwardPassIteration): # <<<<<<<<<<<<<< * cpdef INDEX_t get_size(FirstForwardPassIteration self) */ struct __pyx_obj_7pyearth_7_record_FirstForwardPassIteration { struct __pyx_obj_7pyearth_7_record_ForwardPassIteration __pyx_base; }; /* "_basis.pxd":5 * from _types cimport FLOAT_t, INT_t, INDEX_t, BOOL_t * * cdef class BasisFunction: # <<<<<<<<<<<<<< * '''Abstract. Subclasses must implement the apply and __init__ methods.''' * */ struct __pyx_vtabstruct_7pyearth_6_basis_BasisFunction { PyObject *(*smooth)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, PyObject *, PyObject *, int __pyx_skip_dispatch); int (*has_knot)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); int (*is_prunable)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); int (*is_pruned)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); int (*is_splittable)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); int (*make_splittable)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); int (*make_unsplittable)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); PyObject *(*get_children)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); struct __pyx_obj_7pyearth_6_basis_BasisFunction *(*get_coverage)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); PyBoolObject *(*has_linear)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); PyBoolObject *(*linear_in)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); PyObject *(*_set_parent)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); PyObject *(*_add_child)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); struct __pyx_obj_7pyearth_6_basis_BasisFunction *(*get_parent)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); PyObject *(*prune)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); PyObject *(*unprune)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); PyObject *(*knots)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_INDEX_t (*effective_degree)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); PyObject *(*apply)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, PyArrayObject *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7pyearth_6_basis_13BasisFunction_apply *__pyx_optional_args); PyArrayObject *(*valid_knots)(struct __pyx_obj_7pyearth_6_basis_BasisFunction *, PyArrayObject *, PyArrayObject *, int, __pyx_t_7pyearth_6_types_INDEX_t, int, int, __pyx_t_7pyearth_6_types_FLOAT_t, __pyx_t_7pyearth_6_types_INDEX_t, PyArrayObject *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_6_basis_BasisFunction *__pyx_vtabptr_7pyearth_6_basis_BasisFunction; /* "_basis.pxd":63 * cnp.ndarray[INT_t, ndim=1] workspace) * * cdef class RootBasisFunction(BasisFunction): # <<<<<<<<<<<<<< * cpdef bint covered(RootBasisFunction self, INDEX_t variable) * */ struct __pyx_vtabstruct_7pyearth_6_basis_RootBasisFunction { struct __pyx_vtabstruct_7pyearth_6_basis_BasisFunction __pyx_base; int (*covered)(struct __pyx_obj_7pyearth_6_basis_RootBasisFunction *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); int (*eligible)(struct __pyx_obj_7pyearth_6_basis_RootBasisFunction *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); PyObject *(*variables)(struct __pyx_obj_7pyearth_6_basis_RootBasisFunction *, int __pyx_skip_dispatch); PyObject *(*_smoothed_version)(struct __pyx_obj_7pyearth_6_basis_RootBasisFunction *, struct __pyx_obj_7pyearth_6_basis_BasisFunction *, PyObject *, PyObject *, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_INDEX_t (*degree)(struct __pyx_obj_7pyearth_6_basis_RootBasisFunction *, int __pyx_skip_dispatch); PyObject *(*_effective_degree)(struct __pyx_obj_7pyearth_6_basis_RootBasisFunction *, PyObject *, PyObject *, int __pyx_skip_dispatch); PyObject *(*apply_deriv)(struct __pyx_obj_7pyearth_6_basis_RootBasisFunction *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_6_basis_RootBasisFunction *__pyx_vtabptr_7pyearth_6_basis_RootBasisFunction; /* "_basis.pxd":90 * cnp.ndarray[FLOAT_t, ndim=1] j, INDEX_t var) * * cdef class ConstantBasisFunction(RootBasisFunction): # <<<<<<<<<<<<<< * * cpdef inline FLOAT_t eval(ConstantBasisFunction self) */ struct __pyx_vtabstruct_7pyearth_6_basis_ConstantBasisFunction { struct __pyx_vtabstruct_7pyearth_6_basis_RootBasisFunction __pyx_base; __pyx_t_7pyearth_6_types_FLOAT_t (*eval)(struct __pyx_obj_7pyearth_6_basis_ConstantBasisFunction *, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_FLOAT_t (*eval_deriv)(struct __pyx_obj_7pyearth_6_basis_ConstantBasisFunction *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_6_basis_ConstantBasisFunction *__pyx_vtabptr_7pyearth_6_basis_ConstantBasisFunction; /* "_basis.pxd":96 * cpdef inline FLOAT_t eval_deriv(ConstantBasisFunction self) * * cdef class VariableBasisFunction(BasisFunction): # <<<<<<<<<<<<<< * cdef INDEX_t variable * cdef readonly label */ struct __pyx_vtabstruct_7pyearth_6_basis_VariableBasisFunction { struct __pyx_vtabstruct_7pyearth_6_basis_BasisFunction __pyx_base; __pyx_t_7pyearth_6_types_INDEX_t (*degree)(struct __pyx_obj_7pyearth_6_basis_VariableBasisFunction *, int __pyx_skip_dispatch); PyObject *(*variables)(struct __pyx_obj_7pyearth_6_basis_VariableBasisFunction *, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_INDEX_t (*get_variable)(struct __pyx_obj_7pyearth_6_basis_VariableBasisFunction *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_6_basis_VariableBasisFunction *__pyx_vtabptr_7pyearth_6_basis_VariableBasisFunction; /* "_basis.pxd":106 * cpdef INDEX_t get_variable(VariableBasisFunction self) * * cdef class DataVariableBasisFunction(VariableBasisFunction): # <<<<<<<<<<<<<< * cpdef _effective_degree(DataVariableBasisFunction self, dict data_dict, dict missing_dict) * */ struct __pyx_vtabstruct_7pyearth_6_basis_DataVariableBasisFunction { struct __pyx_vtabstruct_7pyearth_6_basis_VariableBasisFunction __pyx_base; PyObject *(*_effective_degree)(struct __pyx_obj_7pyearth_6_basis_DataVariableBasisFunction *, PyObject *, PyObject *, int __pyx_skip_dispatch); int (*covered)(struct __pyx_obj_7pyearth_6_basis_DataVariableBasisFunction *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); int (*eligible)(struct __pyx_obj_7pyearth_6_basis_DataVariableBasisFunction *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); PyObject *(*apply_deriv)(struct __pyx_obj_7pyearth_6_basis_DataVariableBasisFunction *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_6_basis_DataVariableBasisFunction *__pyx_vtabptr_7pyearth_6_basis_DataVariableBasisFunction; /* "_basis.pxd":123 * cnp.ndarray[FLOAT_t, ndim=1] j, INDEX_t var) * * cdef class MissingnessBasisFunction(VariableBasisFunction): # <<<<<<<<<<<<<< * cdef readonly bint complement * */ struct __pyx_vtabstruct_7pyearth_6_basis_MissingnessBasisFunction { struct __pyx_vtabstruct_7pyearth_6_basis_VariableBasisFunction __pyx_base; PyObject *(*_effective_degree)(struct __pyx_obj_7pyearth_6_basis_MissingnessBasisFunction *, PyObject *, PyObject *, int __pyx_skip_dispatch); int (*covered)(struct __pyx_obj_7pyearth_6_basis_MissingnessBasisFunction *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); int (*eligible)(struct __pyx_obj_7pyearth_6_basis_MissingnessBasisFunction *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); PyObject *(*apply_deriv)(struct __pyx_obj_7pyearth_6_basis_MissingnessBasisFunction *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); PyObject *(*_smoothed_version)(struct __pyx_obj_7pyearth_6_basis_MissingnessBasisFunction *, struct __pyx_obj_7pyearth_6_basis_BasisFunction *, PyObject *, PyObject *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_6_basis_MissingnessBasisFunction *__pyx_vtabptr_7pyearth_6_basis_MissingnessBasisFunction; /* "_basis.pxd":149 * dict knot_dict, dict translation) * * cdef class HingeBasisFunctionBase(DataVariableBasisFunction): # <<<<<<<<<<<<<< * cdef FLOAT_t knot * cdef INDEX_t knot_idx */ struct __pyx_vtabstruct_7pyearth_6_basis_HingeBasisFunctionBase { struct __pyx_vtabstruct_7pyearth_6_basis_DataVariableBasisFunction __pyx_base; __pyx_t_7pyearth_6_types_FLOAT_t (*get_knot)(struct __pyx_obj_7pyearth_6_basis_HingeBasisFunctionBase *, int __pyx_skip_dispatch); int (*get_reverse)(struct __pyx_obj_7pyearth_6_basis_HingeBasisFunctionBase *, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_INDEX_t (*get_knot_idx)(struct __pyx_obj_7pyearth_6_basis_HingeBasisFunctionBase *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_6_basis_HingeBasisFunctionBase *__pyx_vtabptr_7pyearth_6_basis_HingeBasisFunctionBase; /* "_basis.pxd":164 * cpdef INDEX_t get_knot_idx(HingeBasisFunctionBase self) * * cdef class SmoothedHingeBasisFunction(HingeBasisFunctionBase): # <<<<<<<<<<<<<< * cdef FLOAT_t p * cdef FLOAT_t r */ struct __pyx_vtabstruct_7pyearth_6_basis_SmoothedHingeBasisFunction { struct __pyx_vtabstruct_7pyearth_6_basis_HingeBasisFunctionBase __pyx_base; PyObject *(*_smoothed_version)(struct __pyx_obj_7pyearth_6_basis_SmoothedHingeBasisFunction *, struct __pyx_obj_7pyearth_6_basis_BasisFunction *, PyObject *, PyObject *, int __pyx_skip_dispatch); PyObject *(*get_knot_minus)(struct __pyx_obj_7pyearth_6_basis_SmoothedHingeBasisFunction *, int __pyx_skip_dispatch); PyObject *(*get_knot_plus)(struct __pyx_obj_7pyearth_6_basis_SmoothedHingeBasisFunction *, int __pyx_skip_dispatch); PyObject *(*_init_p_r)(struct __pyx_obj_7pyearth_6_basis_SmoothedHingeBasisFunction *, int __pyx_skip_dispatch); PyObject *(*get_p)(struct __pyx_obj_7pyearth_6_basis_SmoothedHingeBasisFunction *, int __pyx_skip_dispatch); PyObject *(*get_r)(struct __pyx_obj_7pyearth_6_basis_SmoothedHingeBasisFunction *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_6_basis_SmoothedHingeBasisFunction *__pyx_vtabptr_7pyearth_6_basis_SmoothedHingeBasisFunction; /* "_basis.pxd":184 * cpdef get_r(SmoothedHingeBasisFunction self) * * cdef class HingeBasisFunction(HingeBasisFunctionBase): # <<<<<<<<<<<<<< * * cpdef _smoothed_version(HingeBasisFunction self, */ struct __pyx_vtabstruct_7pyearth_6_basis_HingeBasisFunction { struct __pyx_vtabstruct_7pyearth_6_basis_HingeBasisFunctionBase __pyx_base; PyObject *(*_smoothed_version)(struct __pyx_obj_7pyearth_6_basis_HingeBasisFunction *, struct __pyx_obj_7pyearth_6_basis_BasisFunction *, PyObject *, PyObject *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_6_basis_HingeBasisFunction *__pyx_vtabptr_7pyearth_6_basis_HingeBasisFunction; /* "_basis.pxd":190 * dict knot_dict, dict translation) * * cdef class LinearBasisFunction(DataVariableBasisFunction): # <<<<<<<<<<<<<< * cpdef bool linear_in(LinearBasisFunction self, INDEX_t variable) * */ struct __pyx_vtabstruct_7pyearth_6_basis_LinearBasisFunction { struct __pyx_vtabstruct_7pyearth_6_basis_DataVariableBasisFunction __pyx_base; PyObject *(*_smoothed_version)(struct __pyx_obj_7pyearth_6_basis_LinearBasisFunction *, struct __pyx_obj_7pyearth_6_basis_BasisFunction *, PyObject *, PyObject *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_6_basis_LinearBasisFunction *__pyx_vtabptr_7pyearth_6_basis_LinearBasisFunction; /* "_basis.pxd":196 * dict knot_dict, dict translation) * * cdef class Basis: # <<<<<<<<<<<<<< * '''A wrapper that provides functionality related to a set of BasisFunctions * with a common RootBasisFunction ancestor. Retains the order in which */ struct __pyx_vtabstruct_7pyearth_6_basis_Basis { int (*get_num_variables)(struct __pyx_obj_7pyearth_6_basis_Basis *, int __pyx_skip_dispatch); PyObject *(*anova_decomp)(struct __pyx_obj_7pyearth_6_basis_Basis *, int __pyx_skip_dispatch); PyObject *(*smooth)(struct __pyx_obj_7pyearth_6_basis_Basis *, PyArrayObject *, int __pyx_skip_dispatch); PyObject *(*append)(struct __pyx_obj_7pyearth_6_basis_Basis *, struct __pyx_obj_7pyearth_6_basis_BasisFunction *, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_INDEX_t (*plen)(struct __pyx_obj_7pyearth_6_basis_Basis *, int __pyx_skip_dispatch); struct __pyx_obj_7pyearth_6_basis_BasisFunction *(*get)(struct __pyx_obj_7pyearth_6_basis_Basis *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); PyObject *(*transform)(struct __pyx_obj_7pyearth_6_basis_Basis *, PyArrayObject *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch); PyObject *(*weighted_transform)(struct __pyx_obj_7pyearth_6_basis_Basis *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch); PyObject *(*transform_deriv)(struct __pyx_obj_7pyearth_6_basis_Basis *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7pyearth_6_basis_5Basis_transform_deriv *__pyx_optional_args); }; static struct __pyx_vtabstruct_7pyearth_6_basis_Basis *__pyx_vtabptr_7pyearth_6_basis_Basis; /* "pyearth/_record.pyx":23 * } * * cdef class Record: # <<<<<<<<<<<<<< * * def __richcmp__(self, other, method): */ struct __pyx_vtabstruct_7pyearth_7_record_Record { PyObject *(*append)(struct __pyx_obj_7pyearth_7_record_Record *, struct __pyx_obj_7pyearth_7_record_Iteration *, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_FLOAT_t (*mse)(struct __pyx_obj_7pyearth_7_record_Record *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_FLOAT_t (*rsq)(struct __pyx_obj_7pyearth_7_record_Record *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_FLOAT_t (*gcv)(struct __pyx_obj_7pyearth_7_record_Record *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_FLOAT_t (*grsq)(struct __pyx_obj_7pyearth_7_record_Record *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_7_record_Record *__pyx_vtabptr_7pyearth_7_record_Record; /* "pyearth/_record.pyx":67 * return 1 - (gcv_ / gcv0) * * cdef class PruningPassRecord(Record): # <<<<<<<<<<<<<< * def __init__(PruningPassRecord self, INDEX_t num_samples, * INDEX_t num_variables, FLOAT_t penalty, */ struct __pyx_vtabstruct_7pyearth_7_record_PruningPassRecord { struct __pyx_vtabstruct_7pyearth_7_record_Record __pyx_base; PyObject *(*set_selected)(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *, __pyx_t_7pyearth_6_types_INDEX_t, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_INDEX_t (*get_selected)(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *, int __pyx_skip_dispatch); PyObject *(*roll_back)(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *, struct __pyx_obj_7pyearth_6_basis_Basis *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_7_record_PruningPassRecord *__pyx_vtabptr_7pyearth_7_record_PruningPassRecord; /* "pyearth/_record.pyx":129 * return 'Selected iteration: ' + str(self.selected) * * cdef class ForwardPassRecord(Record): # <<<<<<<<<<<<<< * def __init__(ForwardPassRecord self, * INDEX_t num_samples, INDEX_t num_variables, */ struct __pyx_vtabstruct_7pyearth_7_record_ForwardPassRecord { struct __pyx_vtabstruct_7pyearth_7_record_Record __pyx_base; PyObject *(*set_stopping_condition)(struct __pyx_obj_7pyearth_7_record_ForwardPassRecord *, int, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_7_record_ForwardPassRecord *__pyx_vtabptr_7pyearth_7_record_ForwardPassRecord; /* "pyearth/_record.pyx":205 * stopping_conditions[self.stopping_condition]) * * cdef class Iteration: # <<<<<<<<<<<<<< * * def __richcmp__(self, other, method): */ struct __pyx_vtabstruct_7pyearth_7_record_Iteration { __pyx_t_7pyearth_6_types_FLOAT_t (*get_mse)(struct __pyx_obj_7pyearth_7_record_Iteration *, int __pyx_skip_dispatch); __pyx_t_7pyearth_6_types_INDEX_t (*get_size)(struct __pyx_obj_7pyearth_7_record_Iteration *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_7_record_Iteration *__pyx_vtabptr_7pyearth_7_record_Iteration; /* "pyearth/_record.pyx":225 * return self.size * * cdef class PruningPassIteration(Iteration): # <<<<<<<<<<<<<< * def __init__(PruningPassIteration self, * INDEX_t pruned, INDEX_t size, */ struct __pyx_vtabstruct_7pyearth_7_record_PruningPassIteration { struct __pyx_vtabstruct_7pyearth_7_record_Iteration __pyx_base; __pyx_t_7pyearth_6_types_INDEX_t (*get_pruned)(struct __pyx_obj_7pyearth_7_record_PruningPassIteration *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_7_record_PruningPassIteration *__pyx_vtabptr_7pyearth_7_record_PruningPassIteration; /* "pyearth/_record.pyx":254 * return result * * cdef class FirstPruningPassIteration(PruningPassIteration): # <<<<<<<<<<<<<< * def __init__(PruningPassIteration self, INDEX_t size, FLOAT_t mse): * self.size = size */ struct __pyx_vtabstruct_7pyearth_7_record_FirstPruningPassIteration { struct __pyx_vtabstruct_7pyearth_7_record_PruningPassIteration __pyx_base; }; static struct __pyx_vtabstruct_7pyearth_7_record_FirstPruningPassIteration *__pyx_vtabptr_7pyearth_7_record_FirstPruningPassIteration; /* "pyearth/_record.pyx":275 * return result * * cdef class ForwardPassIteration(Iteration): # <<<<<<<<<<<<<< * def __init__(ForwardPassIteration self, * INDEX_t parent, INDEX_t variable, */ struct __pyx_vtabstruct_7pyearth_7_record_ForwardPassIteration { struct __pyx_vtabstruct_7pyearth_7_record_Iteration __pyx_base; PyObject *(*set_no_candidates)(struct __pyx_obj_7pyearth_7_record_ForwardPassIteration *, int, int __pyx_skip_dispatch); PyObject *(*no_further_candidates)(struct __pyx_obj_7pyearth_7_record_ForwardPassIteration *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_7pyearth_7_record_ForwardPassIteration *__pyx_vtabptr_7pyearth_7_record_ForwardPassIteration; /* "pyearth/_record.pyx":314 * return self.no_candidates * * cdef class FirstForwardPassIteration(ForwardPassIteration): # <<<<<<<<<<<<<< * def __init__(FirstForwardPassIteration self, FLOAT_t mse): * self.mse = mse */ struct __pyx_vtabstruct_7pyearth_7_record_FirstForwardPassIteration { struct __pyx_vtabstruct_7pyearth_7_record_ForwardPassIteration __pyx_base; }; static struct __pyx_vtabstruct_7pyearth_7_record_FirstForwardPassIteration *__pyx_vtabptr_7pyearth_7_record_FirstForwardPassIteration; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* PyIntCompare.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if CYTHON_FAST_PYCALL static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif // CYTHON_FAST_PYCALL #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCall2Args.proto */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto #define __PYX_HAVE_RT_ImportType_proto enum __Pyx_ImportType_CheckSize { __Pyx_ImportType_CheckSize_Error = 0, __Pyx_ImportType_CheckSize_Warn = 1, __Pyx_ImportType_CheckSize_Ignore = 2 }; static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* RealImag.proto */ #if CYTHON_CCOMPLEX #ifdef __cplusplus #define __Pyx_CREAL(z) ((z).real()) #define __Pyx_CIMAG(z) ((z).imag()) #else #define __Pyx_CREAL(z) (__real__(z)) #define __Pyx_CIMAG(z) (__imag__(z)) #endif #else #define __Pyx_CREAL(z) ((z).real) #define __Pyx_CIMAG(z) ((z).imag) #endif #if defined(__cplusplus) && CYTHON_CCOMPLEX\ && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) #define __Pyx_SET_CREAL(z,x) ((z).real(x)) #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) #else #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) #endif /* Arithmetic.proto */ #if CYTHON_CCOMPLEX #define __Pyx_c_eq_float(a, b) ((a)==(b)) #define __Pyx_c_sum_float(a, b) ((a)+(b)) #define __Pyx_c_diff_float(a, b) ((a)-(b)) #define __Pyx_c_prod_float(a, b) ((a)*(b)) #define __Pyx_c_quot_float(a, b) ((a)/(b)) #define __Pyx_c_neg_float(a) (-(a)) #ifdef __cplusplus #define __Pyx_c_is_zero_float(z) ((z)==(float)0) #define __Pyx_c_conj_float(z) (::std::conj(z)) #if 1 #define __Pyx_c_abs_float(z) (::std::abs(z)) #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) #endif #else #define __Pyx_c_is_zero_float(z) ((z)==0) #define __Pyx_c_conj_float(z) (conjf(z)) #if 1 #define __Pyx_c_abs_float(z) (cabsf(z)) #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) #endif #endif #else static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex); static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex); #if 1 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex); static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex); #endif #endif /* Arithmetic.proto */ #if CYTHON_CCOMPLEX #define __Pyx_c_eq_double(a, b) ((a)==(b)) #define __Pyx_c_sum_double(a, b) ((a)+(b)) #define __Pyx_c_diff_double(a, b) ((a)-(b)) #define __Pyx_c_prod_double(a, b) ((a)*(b)) #define __Pyx_c_quot_double(a, b) ((a)/(b)) #define __Pyx_c_neg_double(a) (-(a)) #ifdef __cplusplus #define __Pyx_c_is_zero_double(z) ((z)==(double)0) #define __Pyx_c_conj_double(z) (::std::conj(z)) #if 1 #define __Pyx_c_abs_double(z) (::std::abs(z)) #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) #endif #else #define __Pyx_c_is_zero_double(z) ((z)==0) #define __Pyx_c_conj_double(z) (conj(z)) #if 1 #define __Pyx_c_abs_double(z) (cabs(z)) #define __Pyx_c_pow_double(a, b) (cpow(a, b)) #endif #endif #else static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex); static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex); #if 1 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex); static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex); #endif #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); /* CIntFromPy.proto */ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionImport.proto */ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_7pyearth_7_record_6Record_append(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_iteration, int __pyx_skip_dispatch); /* proto*/ static __pyx_t_7pyearth_6_types_FLOAT_t __pyx_f_7pyearth_7_record_6Record_mse(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration, int __pyx_skip_dispatch); /* proto*/ static __pyx_t_7pyearth_6_types_FLOAT_t __pyx_f_7pyearth_7_record_6Record_gcv(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration, int __pyx_skip_dispatch); /* proto*/ static __pyx_t_7pyearth_6_types_FLOAT_t __pyx_f_7pyearth_7_record_6Record_rsq(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration, int __pyx_skip_dispatch); /* proto*/ static __pyx_t_7pyearth_6_types_FLOAT_t __pyx_f_7pyearth_7_record_6Record_grsq(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_7pyearth_7_record_17PruningPassRecord_set_selected(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_selected, int __pyx_skip_dispatch); /* proto*/ static __pyx_t_7pyearth_6_types_INDEX_t __pyx_f_7pyearth_7_record_17PruningPassRecord_get_selected(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_7pyearth_7_record_17PruningPassRecord_roll_back(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, struct __pyx_obj_7pyearth_6_basis_Basis *__pyx_v_basis, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_7pyearth_7_record_17ForwardPassRecord_set_stopping_condition(struct __pyx_obj_7pyearth_7_record_ForwardPassRecord *__pyx_v_self, int __pyx_v_stopping_condition, int __pyx_skip_dispatch); /* proto*/ static __pyx_t_7pyearth_6_types_FLOAT_t __pyx_f_7pyearth_7_record_9Iteration_get_mse(struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ static __pyx_t_7pyearth_6_types_INDEX_t __pyx_f_7pyearth_7_record_9Iteration_get_size(struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ static __pyx_t_7pyearth_6_types_INDEX_t __pyx_f_7pyearth_7_record_20PruningPassIteration_get_pruned(struct __pyx_obj_7pyearth_7_record_PruningPassIteration *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_7pyearth_7_record_20ForwardPassIteration_set_no_candidates(struct __pyx_obj_7pyearth_7_record_ForwardPassIteration *__pyx_v_self, int __pyx_v_value, int __pyx_skip_dispatch); /* proto*/ static PyObject *__pyx_f_7pyearth_7_record_20ForwardPassIteration_no_further_candidates(struct __pyx_obj_7pyearth_7_record_ForwardPassIteration *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ static __pyx_t_7pyearth_6_types_INDEX_t __pyx_f_7pyearth_7_record_25FirstForwardPassIteration_get_size(CYTHON_UNUSED struct __pyx_obj_7pyearth_7_record_FirstForwardPassIteration *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ /* Module declarations from 'cpython.buffer' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'cpython.version' */ /* Module declarations from 'cpython.exc' */ /* Module declarations from 'cpython.module' */ /* Module declarations from 'cpython.mem' */ /* Module declarations from 'cpython.tuple' */ /* Module declarations from 'cpython.list' */ /* Module declarations from 'cpython.sequence' */ /* Module declarations from 'cpython.mapping' */ /* Module declarations from 'cpython.iterator' */ /* Module declarations from 'cpython.number' */ /* Module declarations from 'cpython.int' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.bool' */ static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; /* Module declarations from 'cpython.long' */ /* Module declarations from 'cpython.float' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.complex' */ static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; /* Module declarations from 'cpython.string' */ /* Module declarations from 'cpython.unicode' */ /* Module declarations from 'cpython.dict' */ /* Module declarations from 'cpython.instance' */ /* Module declarations from 'cpython.function' */ /* Module declarations from 'cpython.method' */ /* Module declarations from 'cpython.weakref' */ /* Module declarations from 'cpython.getargs' */ /* Module declarations from 'cpython.pythread' */ /* Module declarations from 'cpython.pystate' */ /* Module declarations from 'cpython.cobject' */ /* Module declarations from 'cpython.oldbuffer' */ /* Module declarations from 'cpython.set' */ /* Module declarations from 'cpython.bytes' */ /* Module declarations from 'cpython.pycapsule' */ /* Module declarations from 'cpython' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.ref' */ /* Module declarations from 'numpy' */ /* Module declarations from 'numpy' */ static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; static PyTypeObject *__pyx_ptype_5numpy_generic = 0; static PyTypeObject *__pyx_ptype_5numpy_number = 0; static PyTypeObject *__pyx_ptype_5numpy_integer = 0; static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0; static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0; static PyTypeObject *__pyx_ptype_5numpy_inexact = 0; static PyTypeObject *__pyx_ptype_5numpy_floating = 0; static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0; static PyTypeObject *__pyx_ptype_5numpy_flexible = 0; static PyTypeObject *__pyx_ptype_5numpy_character = 0; static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; /* Module declarations from 'pyearth._types' */ /* Module declarations from 'pyearth._basis' */ static PyTypeObject *__pyx_ptype_7pyearth_6_basis_BasisFunction = 0; static PyTypeObject *__pyx_ptype_7pyearth_6_basis_RootBasisFunction = 0; static PyTypeObject *__pyx_ptype_7pyearth_6_basis_ConstantBasisFunction = 0; static PyTypeObject *__pyx_ptype_7pyearth_6_basis_VariableBasisFunction = 0; static PyTypeObject *__pyx_ptype_7pyearth_6_basis_DataVariableBasisFunction = 0; static PyTypeObject *__pyx_ptype_7pyearth_6_basis_MissingnessBasisFunction = 0; static PyTypeObject *__pyx_ptype_7pyearth_6_basis_HingeBasisFunctionBase = 0; static PyTypeObject *__pyx_ptype_7pyearth_6_basis_SmoothedHingeBasisFunction = 0; static PyTypeObject *__pyx_ptype_7pyearth_6_basis_HingeBasisFunction = 0; static PyTypeObject *__pyx_ptype_7pyearth_6_basis_LinearBasisFunction = 0; static PyTypeObject *__pyx_ptype_7pyearth_6_basis_Basis = 0; /* Module declarations from 'pyearth._util' */ static __pyx_t_7pyearth_6_types_FLOAT_t (*__pyx_f_7pyearth_5_util_gcv)(__pyx_t_7pyearth_6_types_FLOAT_t, __pyx_t_7pyearth_6_types_FLOAT_t, __pyx_t_7pyearth_6_types_FLOAT_t, __pyx_t_7pyearth_6_types_FLOAT_t, int __pyx_skip_dispatch); /*proto*/ static PyObject *(*__pyx_f_7pyearth_5_util_ascii_table)(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7pyearth_5_util_ascii_table *__pyx_optional_args); /*proto*/ /* Module declarations from 'pyearth._record' */ static PyTypeObject *__pyx_ptype_7pyearth_7_record_Record = 0; static PyTypeObject *__pyx_ptype_7pyearth_7_record_PruningPassRecord = 0; static PyTypeObject *__pyx_ptype_7pyearth_7_record_ForwardPassRecord = 0; static PyTypeObject *__pyx_ptype_7pyearth_7_record_Iteration = 0; static PyTypeObject *__pyx_ptype_7pyearth_7_record_PruningPassIteration = 0; static PyTypeObject *__pyx_ptype_7pyearth_7_record_FirstPruningPassIteration = 0; static PyTypeObject *__pyx_ptype_7pyearth_7_record_ForwardPassIteration = 0; static PyTypeObject *__pyx_ptype_7pyearth_7_record_FirstForwardPassIteration = 0; static PyObject *__pyx_f_7pyearth_7_record___pyx_unpickle_Record__set_state(struct __pyx_obj_7pyearth_7_record_Record *, PyObject *); /*proto*/ static PyObject *__pyx_f_7pyearth_7_record___pyx_unpickle_Iteration__set_state(struct __pyx_obj_7pyearth_7_record_Iteration *, PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "pyearth._record" extern int __pyx_module_is_main_pyearth___record; int __pyx_module_is_main_pyearth___record = 0; /* Implementation of 'pyearth._record' */ static PyObject *__pyx_builtin_NotImplemented; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_ImportError; static const char __pyx_k_2f[] = "%.2f"; static const char __pyx_k__3[] = ""; static const char __pyx_k__4[] = "\t"; static const char __pyx_k__7[] = "-"; static const char __pyx_k_eq[] = "_eq"; static const char __pyx_k_gcv[] = "gcv"; static const char __pyx_k_mse[] = "mse"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_rsq[] = "rsq"; static const char __pyx_k_sst[] = "sst"; static const char __pyx_k_var[] = "var"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_grsq[] = "grsq"; static const char __pyx_k_iter[] = "iter"; static const char __pyx_k_knot[] = "knot"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_rows[] = "rows"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_class[] = "__class__"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_s_s_s[] = "%s\t%s\t%s"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_terms[] = "terms"; static const char __pyx_k_MAXRSQ[] = "MAXRSQ"; static const char __pyx_k_NOCAND[] = "NOCAND"; static const char __pyx_k_Record[] = "Record"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_parent[] = "parent"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_pruned[] = "pruned"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_LOWGRSQ[] = "LOWGRSQ"; static const char __pyx_k_NOIMPRV[] = "NOIMPRV"; static const char __pyx_k_get_mse[] = "get_mse"; static const char __pyx_k_indices[] = "indices"; static const char __pyx_k_penalty[] = "penalty"; static const char __pyx_k_unprune[] = "unprune"; static const char __pyx_k_xlabels[] = "xlabels"; static const char __pyx_k_3f_3f_3f[] = "\t%.3f\t%.3f\t%.3f"; static const char __pyx_k_MAXTERMS[] = "MAXTERMS"; static const char __pyx_k_get_size[] = "get_size"; static const char __pyx_k_getstate[] = "_getstate"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_selected[] = "selected"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_variable[] = "variable"; static const char __pyx_k_Iteration[] = "Iteration"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_roll_back[] = "roll_back"; static const char __pyx_k_3f_3f_3f_2[] = "%.3f\t%.3f\t%.3f"; static const char __pyx_k_d_d_d_4f_d[] = "%d\t%d\t%d\t%4f\t%d"; static const char __pyx_k_get_pruned[] = "get_pruned"; static const char __pyx_k_getstate_2[] = "__getstate__"; static const char __pyx_k_iterations[] = "iterations"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_s_s_s_4f_s[] = "%s\t%s\t%s\t%4f\t%s"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_num_samples[] = "num_samples"; static const char __pyx_k_partial_str[] = "partial_str"; static const char __pyx_k_GRSQ_too_low[] = "GRSQ too low"; static const char __pyx_k_get_selected[] = "get_selected"; static const char __pyx_k_print_footer[] = "print_footer"; static const char __pyx_k_print_header[] = "print_header"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_set_selected[] = "set_selected"; static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_num_variables[] = "num_variables"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_NotImplemented[] = "NotImplemented"; static const char __pyx_k_pyearth__record[] = "pyearth._record"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_ForwardPassRecord[] = "ForwardPassRecord"; static const char __pyx_k_PruningPassRecord[] = "PruningPassRecord"; static const char __pyx_k_set_no_candidates[] = "set_no_candidates"; static const char __pyx_k_Selected_iteration[] = "Selected iteration: "; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_pyx_unpickle_Record[] = "__pyx_unpickle_Record"; static const char __pyx_k_stopping_conditions[] = "stopping_conditions"; static const char __pyx_k_ForwardPassIteration[] = "ForwardPassIteration"; static const char __pyx_k_PruningPassIteration[] = "PruningPassIteration"; static const char __pyx_k_no_further_candidates[] = "no_further_candidates"; static const char __pyx_k_Stopping_Condition_d_s[] = "Stopping Condition %d: %s"; static const char __pyx_k_pyx_unpickle_Iteration[] = "__pyx_unpickle_Iteration"; static const char __pyx_k_set_stopping_condition[] = "set_stopping_condition"; static const char __pyx_k_FirstForwardPassIteration[] = "FirstForwardPassIteration"; static const char __pyx_k_FirstPruningPassIteration[] = "FirstPruningPassIteration"; static const char __pyx_k_Improvement_below_threshold[] = "Improvement below threshold"; static const char __pyx_k_iter_bf_terms_mse_gcv_rsq_grsq[] = "iter\tbf\tterms\tmse\tgcv\trsq\tgrsq"; static const char __pyx_k_Reached_maximum_number_of_terms[] = "Reached maximum number of terms"; static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import"; static const char __pyx_k_Achieved_RSQ_value_within_thresh[] = "Achieved RSQ value within threshold of 1"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb19d968, 0xb1c18cc, 0x260ed39) = (iterations, num_samples, num_variables, penalty, sst))"; static const char __pyx_k_No_remaining_candidate_knot_loca[] = "No remaining candidate knot locations"; static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import"; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_2[] = "Incompatible checksums (0x%x vs (0x56d9c5a, 0x5fed321, 0x3e01730) = (mse, size))"; static PyObject *__pyx_kp_s_2f; static PyObject *__pyx_kp_s_3f_3f_3f; static PyObject *__pyx_kp_s_3f_3f_3f_2; static PyObject *__pyx_kp_s_Achieved_RSQ_value_within_thresh; static PyObject *__pyx_n_s_FirstForwardPassIteration; static PyObject *__pyx_n_s_FirstPruningPassIteration; static PyObject *__pyx_n_s_ForwardPassIteration; static PyObject *__pyx_n_s_ForwardPassRecord; static PyObject *__pyx_kp_s_GRSQ_too_low; static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_kp_s_Improvement_below_threshold; static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2; static PyObject *__pyx_n_s_Iteration; static PyObject *__pyx_n_s_LOWGRSQ; static PyObject *__pyx_n_s_MAXRSQ; static PyObject *__pyx_n_s_MAXTERMS; static PyObject *__pyx_n_s_NOCAND; static PyObject *__pyx_n_s_NOIMPRV; static PyObject *__pyx_kp_s_No_remaining_candidate_knot_loca; static PyObject *__pyx_n_s_NotImplemented; static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_PruningPassIteration; static PyObject *__pyx_n_s_PruningPassRecord; static PyObject *__pyx_kp_s_Reached_maximum_number_of_terms; static PyObject *__pyx_n_s_Record; static PyObject *__pyx_kp_s_Selected_iteration; static PyObject *__pyx_kp_s_Stopping_Condition_d_s; static PyObject *__pyx_kp_s__3; static PyObject *__pyx_kp_s__4; static PyObject *__pyx_kp_s__7; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_kp_s_d_d_d_4f_d; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_eq; static PyObject *__pyx_n_s_gcv; static PyObject *__pyx_n_s_get_mse; static PyObject *__pyx_n_s_get_pruned; static PyObject *__pyx_n_s_get_selected; static PyObject *__pyx_n_s_get_size; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_getstate_2; static PyObject *__pyx_n_s_grsq; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_indices; static PyObject *__pyx_n_s_iter; static PyObject *__pyx_kp_s_iter_bf_terms_mse_gcv_rsq_grsq; static PyObject *__pyx_n_s_iterations; static PyObject *__pyx_n_s_knot; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_mse; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_new; static PyObject *__pyx_n_s_no_further_candidates; static PyObject *__pyx_n_s_num_samples; static PyObject *__pyx_n_s_num_variables; static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to; static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor; static PyObject *__pyx_n_s_parent; static PyObject *__pyx_n_s_partial_str; static PyObject *__pyx_n_s_penalty; static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_print_footer; static PyObject *__pyx_n_s_print_header; static PyObject *__pyx_n_s_pruned; static PyObject *__pyx_n_s_pyearth__record; static PyObject *__pyx_n_s_pyx_PickleError; static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_result; static PyObject *__pyx_n_s_pyx_state; static PyObject *__pyx_n_s_pyx_type; static PyObject *__pyx_n_s_pyx_unpickle_Iteration; static PyObject *__pyx_n_s_pyx_unpickle_Record; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; static PyObject *__pyx_n_s_roll_back; static PyObject *__pyx_n_s_rows; static PyObject *__pyx_n_s_rsq; static PyObject *__pyx_kp_s_s_s_s; static PyObject *__pyx_kp_s_s_s_s_4f_s; static PyObject *__pyx_n_s_selected; static PyObject *__pyx_n_s_set_no_candidates; static PyObject *__pyx_n_s_set_selected; static PyObject *__pyx_n_s_set_stopping_condition; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_size; static PyObject *__pyx_n_s_split; static PyObject *__pyx_n_s_sst; static PyObject *__pyx_n_s_stopping_conditions; static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_terms; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_unprune; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_var; static PyObject *__pyx_n_s_variable; static PyObject *__pyx_n_s_xlabels; static PyObject *__pyx_pf_7pyearth_7_record_6Record___richcmp__(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_method); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_6Record_2_eq(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_6Record_4__getitem__(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, int __pyx_v_idx); /* proto */ static Py_ssize_t __pyx_pf_7pyearth_7_record_6Record_6__len__(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_6Record_8append(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_iteration); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_6Record_10mse(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_6Record_12gcv(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_6Record_14rsq(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_6Record_16grsq(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_6Record_18__reduce_cython__(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_6Record_20__setstate_cython__(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7pyearth_7_record_17PruningPassRecord___init__(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_num_samples, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_num_variables, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_penalty, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_sst, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_size, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_mse); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_2__reduce__(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_4_getstate(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_6__setstate__(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_8set_selected(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_selected); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_10get_selected(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_12roll_back(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, struct __pyx_obj_7pyearth_6_basis_Basis *__pyx_v_basis); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_14__str__(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_16partial_str(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_print_header, PyObject *__pyx_v_print_footer); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_18final_str(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_8selected___get__(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self); /* proto */ static int __pyx_pf_7pyearth_7_record_17ForwardPassRecord___init__(struct __pyx_obj_7pyearth_7_record_ForwardPassRecord *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_num_samples, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_num_variables, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_penalty, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_sst, PyObject *__pyx_v_xlabels); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17ForwardPassRecord_2__reduce__(struct __pyx_obj_7pyearth_7_record_ForwardPassRecord *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17ForwardPassRecord_4_getstate(struct __pyx_obj_7pyearth_7_record_ForwardPassRecord *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17ForwardPassRecord_6__setstate__(struct __pyx_obj_7pyearth_7_record_ForwardPassRecord *__pyx_v_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17ForwardPassRecord_8set_stopping_condition(struct __pyx_obj_7pyearth_7_record_ForwardPassRecord *__pyx_v_self, int __pyx_v_stopping_condition); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17ForwardPassRecord_10__str__(struct __pyx_obj_7pyearth_7_record_ForwardPassRecord *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17ForwardPassRecord_12partial_str(struct __pyx_obj_7pyearth_7_record_ForwardPassRecord *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_print_header, PyObject *__pyx_v_print_footer); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17ForwardPassRecord_14final_str(struct __pyx_obj_7pyearth_7_record_ForwardPassRecord *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_17ForwardPassRecord_18stopping_condition___get__(struct __pyx_obj_7pyearth_7_record_ForwardPassRecord *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_9Iteration___richcmp__(struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_method); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_9Iteration_2_eq(struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_9Iteration_4get_mse(struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_9Iteration_6get_size(struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_9Iteration_8__reduce_cython__(struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_9Iteration_10__setstate_cython__(struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7pyearth_7_record_20PruningPassIteration___init__(struct __pyx_obj_7pyearth_7_record_PruningPassIteration *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_pruned, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_size, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_mse); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_20PruningPassIteration_2__reduce__(struct __pyx_obj_7pyearth_7_record_PruningPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_20PruningPassIteration_4_getstate(struct __pyx_obj_7pyearth_7_record_PruningPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_20PruningPassIteration_6__setstate__(struct __pyx_obj_7pyearth_7_record_PruningPassIteration *__pyx_v_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_20PruningPassIteration_8get_pruned(struct __pyx_obj_7pyearth_7_record_PruningPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_20PruningPassIteration_10__str__(struct __pyx_obj_7pyearth_7_record_PruningPassIteration *__pyx_v_self); /* proto */ static int __pyx_pf_7pyearth_7_record_25FirstPruningPassIteration___init__(struct __pyx_obj_7pyearth_7_record_FirstPruningPassIteration *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_size, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_mse); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_25FirstPruningPassIteration_2__reduce__(struct __pyx_obj_7pyearth_7_record_FirstPruningPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_25FirstPruningPassIteration_4_getstate(struct __pyx_obj_7pyearth_7_record_FirstPruningPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_25FirstPruningPassIteration_6__setstate__(struct __pyx_obj_7pyearth_7_record_FirstPruningPassIteration *__pyx_v_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_25FirstPruningPassIteration_8__str__(struct __pyx_obj_7pyearth_7_record_FirstPruningPassIteration *__pyx_v_self); /* proto */ static int __pyx_pf_7pyearth_7_record_20ForwardPassIteration___init__(struct __pyx_obj_7pyearth_7_record_ForwardPassIteration *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_parent, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_variable, int __pyx_v_knot, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_mse, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_size); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_20ForwardPassIteration_2__reduce__(struct __pyx_obj_7pyearth_7_record_ForwardPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_20ForwardPassIteration_4_getstate(struct __pyx_obj_7pyearth_7_record_ForwardPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_20ForwardPassIteration_6__setstate__(struct __pyx_obj_7pyearth_7_record_ForwardPassIteration *__pyx_v_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_20ForwardPassIteration_8__str__(struct __pyx_obj_7pyearth_7_record_ForwardPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_20ForwardPassIteration_10set_no_candidates(struct __pyx_obj_7pyearth_7_record_ForwardPassIteration *__pyx_v_self, int __pyx_v_value); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_20ForwardPassIteration_12no_further_candidates(struct __pyx_obj_7pyearth_7_record_ForwardPassIteration *__pyx_v_self); /* proto */ static int __pyx_pf_7pyearth_7_record_25FirstForwardPassIteration___init__(struct __pyx_obj_7pyearth_7_record_FirstForwardPassIteration *__pyx_v_self, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_mse); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_25FirstForwardPassIteration_2__reduce__(struct __pyx_obj_7pyearth_7_record_FirstForwardPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_25FirstForwardPassIteration_4_getstate(struct __pyx_obj_7pyearth_7_record_FirstForwardPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_25FirstForwardPassIteration_6__setstate__(struct __pyx_obj_7pyearth_7_record_FirstForwardPassIteration *__pyx_v_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_25FirstForwardPassIteration_8get_size(struct __pyx_obj_7pyearth_7_record_FirstForwardPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_25FirstForwardPassIteration_10__str__(struct __pyx_obj_7pyearth_7_record_FirstForwardPassIteration *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record___pyx_unpickle_Record(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7pyearth_7_record_2__pyx_unpickle_Iteration(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_7pyearth_7_record_Record(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyearth_7_record_PruningPassRecord(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyearth_7_record_ForwardPassRecord(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyearth_7_record_Iteration(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyearth_7_record_PruningPassIteration(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyearth_7_record_FirstPruningPassIteration(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyearth_7_record_ForwardPassIteration(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyearth_7_record_FirstForwardPassIteration(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_float_1_0; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_4; static PyObject *__pyx_int_39906617; static PyObject *__pyx_int_65017648; static PyObject *__pyx_int_91069530; static PyObject *__pyx_int_100586273; static PyObject *__pyx_int_186243432; static PyObject *__pyx_int_186390732; static PyObject *__pyx_tuple_; static PyObject *__pyx_slice__2; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__16; static PyObject *__pyx_codeobj__15; static PyObject *__pyx_codeobj__17; /* Late includes */ /* "pyearth/_record.pyx":25 * cdef class Record: * * def __richcmp__(self, other, method): # <<<<<<<<<<<<<< * if method == 2: * return self._eq(other) */ /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_1__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_method); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_6Record_1__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_arg_method) { PyObject *__pyx_v_method = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); __pyx_v_method = __Pyx_PyInt_From_int(__pyx_arg_method); if (unlikely(!__pyx_v_method)) __PYX_ERR(0, 25, __pyx_L3_error) __Pyx_GOTREF(__pyx_v_method); goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pyearth._record.Record.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyearth_7_record_6Record___richcmp__(((struct __pyx_obj_7pyearth_7_record_Record *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_method)); /* function exit code */ __Pyx_XDECREF(__pyx_v_method); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_6Record___richcmp__(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_method) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); /* "pyearth/_record.pyx":26 * * def __richcmp__(self, other, method): * if method == 2: # <<<<<<<<<<<<<< * return self._eq(other) * elif method == 3: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_method, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pyearth/_record.pyx":27 * def __richcmp__(self, other, method): * if method == 2: * return self._eq(other) # <<<<<<<<<<<<<< * elif method == 3: * return not self._eq(other) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eq); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyearth/_record.pyx":26 * * def __richcmp__(self, other, method): * if method == 2: # <<<<<<<<<<<<<< * return self._eq(other) * elif method == 3: */ } /* "pyearth/_record.pyx":28 * if method == 2: * return self._eq(other) * elif method == 3: # <<<<<<<<<<<<<< * return not self._eq(other) * else: */ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_method, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pyearth/_record.pyx":29 * return self._eq(other) * elif method == 3: * return not self._eq(other) # <<<<<<<<<<<<<< * else: * return NotImplemented */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eq); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyearth/_record.pyx":28 * if method == 2: * return self._eq(other) * elif method == 3: # <<<<<<<<<<<<<< * return not self._eq(other) * else: */ } /* "pyearth/_record.pyx":31 * return not self._eq(other) * else: * return NotImplemented # <<<<<<<<<<<<<< * * def _eq(self, other): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; } /* "pyearth/_record.pyx":25 * cdef class Record: * * def __richcmp__(self, other, method): # <<<<<<<<<<<<<< * if method == 2: * return self._eq(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pyearth._record.Record.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":33 * return NotImplemented * * def _eq(self, other): # <<<<<<<<<<<<<< * return (self.__class__ is other.__class__ and * self._getstate() == other._getstate()) */ /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_3_eq(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_6Record_3_eq(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_eq (wrapper)", 0); __pyx_r = __pyx_pf_7pyearth_7_record_6Record_2_eq(((struct __pyx_obj_7pyearth_7_record_Record *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_6Record_2_eq(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_eq", 0); /* "pyearth/_record.pyx":34 * * def _eq(self, other): * return (self.__class__ is other.__class__ and # <<<<<<<<<<<<<< * self._getstate() == other._getstate()) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_class); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = (__pyx_t_2 == __pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L3_bool_binop_done; } /* "pyearth/_record.pyx":35 * def _eq(self, other): * return (self.__class__ is other.__class__ and * self._getstate() == other._getstate()) # <<<<<<<<<<<<<< * * def __getitem__(Record self, int idx): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_getstate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_L3_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyearth/_record.pyx":33 * return NotImplemented * * def _eq(self, other): # <<<<<<<<<<<<<< * return (self.__class__ is other.__class__ and * self._getstate() == other._getstate()) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pyearth._record.Record._eq", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":37 * self._getstate() == other._getstate()) * * def __getitem__(Record self, int idx): # <<<<<<<<<<<<<< * return self.iterations[idx] * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_idx); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_6Record_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_idx) { int __pyx_v_idx; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); assert(__pyx_arg_idx); { __pyx_v_idx = __Pyx_PyInt_As_int(__pyx_arg_idx); if (unlikely((__pyx_v_idx == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pyearth._record.Record.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyearth_7_record_6Record_4__getitem__(((struct __pyx_obj_7pyearth_7_record_Record *)__pyx_v_self), ((int)__pyx_v_idx)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_6Record_4__getitem__(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, int __pyx_v_idx) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "pyearth/_record.pyx":38 * * def __getitem__(Record self, int idx): * return self.iterations[idx] # <<<<<<<<<<<<<< * * def __len__(Record self): */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_self->iterations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 38, __pyx_L1_error) } __Pyx_INCREF(PyList_GET_ITEM(__pyx_v_self->iterations, __pyx_v_idx)); __pyx_r = PyList_GET_ITEM(__pyx_v_self->iterations, __pyx_v_idx); goto __pyx_L0; /* "pyearth/_record.pyx":37 * self._getstate() == other._getstate()) * * def __getitem__(Record self, int idx): # <<<<<<<<<<<<<< * return self.iterations[idx] * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("pyearth._record.Record.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":40 * return self.iterations[idx] * * def __len__(Record self): # <<<<<<<<<<<<<< * return len(self.iterations) * */ /* Python wrapper */ static Py_ssize_t __pyx_pw_7pyearth_7_record_6Record_7__len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_pw_7pyearth_7_record_6Record_7__len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyearth_7_record_6Record_6__len__(((struct __pyx_obj_7pyearth_7_record_Record *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_pf_7pyearth_7_record_6Record_6__len__(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); /* "pyearth/_record.pyx":41 * * def __len__(Record self): * return len(self.iterations) # <<<<<<<<<<<<<< * * cpdef append(Record self, Iteration iteration): */ __pyx_t_1 = __pyx_v_self->iterations; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 41, __pyx_L1_error) } __pyx_t_2 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; goto __pyx_L0; /* "pyearth/_record.pyx":40 * return self.iterations[idx] * * def __len__(Record self): # <<<<<<<<<<<<<< * return len(self.iterations) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyearth._record.Record.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":43 * return len(self.iterations) * * cpdef append(Record self, Iteration iteration): # <<<<<<<<<<<<<< * self.iterations.append(iteration) * */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_9append(PyObject *__pyx_v_self, PyObject *__pyx_v_iteration); /*proto*/ static PyObject *__pyx_f_7pyearth_7_record_6Record_append(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_iteration, int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("append", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_append); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyearth_7_record_6Record_9append)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_iteration)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_iteration)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "pyearth/_record.pyx":44 * * cpdef append(Record self, Iteration iteration): * self.iterations.append(iteration) # <<<<<<<<<<<<<< * * cpdef FLOAT_t mse(Record self, INDEX_t iteration): */ if (unlikely(__pyx_v_self->iterations == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append"); __PYX_ERR(0, 44, __pyx_L1_error) } __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_self->iterations, ((PyObject *)__pyx_v_iteration)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 44, __pyx_L1_error) /* "pyearth/_record.pyx":43 * return len(self.iterations) * * cpdef append(Record self, Iteration iteration): # <<<<<<<<<<<<<< * self.iterations.append(iteration) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pyearth._record.Record.append", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_9append(PyObject *__pyx_v_self, PyObject *__pyx_v_iteration); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_6Record_9append(PyObject *__pyx_v_self, PyObject *__pyx_v_iteration) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("append (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iteration), __pyx_ptype_7pyearth_7_record_Iteration, 1, "iteration", 0))) __PYX_ERR(0, 43, __pyx_L1_error) __pyx_r = __pyx_pf_7pyearth_7_record_6Record_8append(((struct __pyx_obj_7pyearth_7_record_Record *)__pyx_v_self), ((struct __pyx_obj_7pyearth_7_record_Iteration *)__pyx_v_iteration)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_6Record_8append(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_iteration) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("append", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7pyearth_7_record_6Record_append(__pyx_v_self, __pyx_v_iteration, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyearth._record.Record.append", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":46 * self.iterations.append(iteration) * * cpdef FLOAT_t mse(Record self, INDEX_t iteration): # <<<<<<<<<<<<<< * return self.iterations[iteration].get_mse() * */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_11mse(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration); /*proto*/ static __pyx_t_7pyearth_6_types_FLOAT_t __pyx_f_7pyearth_7_record_6Record_mse(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration, int __pyx_skip_dispatch) { __pyx_t_7pyearth_6_types_FLOAT_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mse", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyearth_7_record_6Record_11mse)) { __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_iteration); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "pyearth/_record.pyx":47 * * cpdef FLOAT_t mse(Record self, INDEX_t iteration): * return self.iterations[iteration].get_mse() # <<<<<<<<<<<<<< * * cpdef FLOAT_t gcv(Record self, INDEX_t iteration): */ if (unlikely(__pyx_v_self->iterations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 47, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(PyList_GET_ITEM(__pyx_v_self->iterations, __pyx_v_iteration), __pyx_n_s_get_mse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_6; goto __pyx_L0; /* "pyearth/_record.pyx":46 * self.iterations.append(iteration) * * cpdef FLOAT_t mse(Record self, INDEX_t iteration): # <<<<<<<<<<<<<< * return self.iterations[iteration].get_mse() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("pyearth._record.Record.mse", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_11mse(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_6Record_11mse(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration) { __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mse (wrapper)", 0); assert(__pyx_arg_iteration); { __pyx_v_iteration = __Pyx_PyInt_As_Py_intptr_t(__pyx_arg_iteration); if (unlikely((__pyx_v_iteration == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pyearth._record.Record.mse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyearth_7_record_6Record_10mse(((struct __pyx_obj_7pyearth_7_record_Record *)__pyx_v_self), ((__pyx_t_7pyearth_6_types_INDEX_t)__pyx_v_iteration)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_6Record_10mse(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mse", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_f_7pyearth_7_record_6Record_mse(__pyx_v_self, __pyx_v_iteration, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyearth._record.Record.mse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":49 * return self.iterations[iteration].get_mse() * * cpdef FLOAT_t gcv(Record self, INDEX_t iteration): # <<<<<<<<<<<<<< * cdef Iteration it = self.iterations[iteration] * cdef FLOAT_t mse = it.mse */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_13gcv(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration); /*proto*/ static __pyx_t_7pyearth_6_types_FLOAT_t __pyx_f_7pyearth_7_record_6Record_gcv(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration, int __pyx_skip_dispatch) { struct __pyx_obj_7pyearth_7_record_Iteration *__pyx_v_it = 0; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_mse; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gcv", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_gcv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyearth_7_record_6Record_13gcv)) { __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_iteration); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "pyearth/_record.pyx":50 * * cpdef FLOAT_t gcv(Record self, INDEX_t iteration): * cdef Iteration it = self.iterations[iteration] # <<<<<<<<<<<<<< * cdef FLOAT_t mse = it.mse * return gcv(mse, it.get_size(), self.num_samples, self.penalty) */ if (unlikely(__pyx_v_self->iterations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 50, __pyx_L1_error) } if (!(likely(((PyList_GET_ITEM(__pyx_v_self->iterations, __pyx_v_iteration)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_self->iterations, __pyx_v_iteration), __pyx_ptype_7pyearth_7_record_Iteration))))) __PYX_ERR(0, 50, __pyx_L1_error) __pyx_t_1 = PyList_GET_ITEM(__pyx_v_self->iterations, __pyx_v_iteration); __Pyx_INCREF(__pyx_t_1); __pyx_v_it = ((struct __pyx_obj_7pyearth_7_record_Iteration *)__pyx_t_1); __pyx_t_1 = 0; /* "pyearth/_record.pyx":51 * cpdef FLOAT_t gcv(Record self, INDEX_t iteration): * cdef Iteration it = self.iterations[iteration] * cdef FLOAT_t mse = it.mse # <<<<<<<<<<<<<< * return gcv(mse, it.get_size(), self.num_samples, self.penalty) * */ __pyx_t_6 = __pyx_v_it->mse; __pyx_v_mse = __pyx_t_6; /* "pyearth/_record.pyx":52 * cdef Iteration it = self.iterations[iteration] * cdef FLOAT_t mse = it.mse * return gcv(mse, it.get_size(), self.num_samples, self.penalty) # <<<<<<<<<<<<<< * * cpdef FLOAT_t rsq(Record self, INDEX_t iteration): */ __pyx_r = __pyx_f_7pyearth_5_util_gcv(__pyx_v_mse, ((struct __pyx_vtabstruct_7pyearth_7_record_Iteration *)__pyx_v_it->__pyx_vtab)->get_size(__pyx_v_it, 0), __pyx_v_self->num_samples, __pyx_v_self->penalty, 0); goto __pyx_L0; /* "pyearth/_record.pyx":49 * return self.iterations[iteration].get_mse() * * cpdef FLOAT_t gcv(Record self, INDEX_t iteration): # <<<<<<<<<<<<<< * cdef Iteration it = self.iterations[iteration] * cdef FLOAT_t mse = it.mse */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("pyearth._record.Record.gcv", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_it); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_13gcv(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_6Record_13gcv(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration) { __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gcv (wrapper)", 0); assert(__pyx_arg_iteration); { __pyx_v_iteration = __Pyx_PyInt_As_Py_intptr_t(__pyx_arg_iteration); if (unlikely((__pyx_v_iteration == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pyearth._record.Record.gcv", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyearth_7_record_6Record_12gcv(((struct __pyx_obj_7pyearth_7_record_Record *)__pyx_v_self), ((__pyx_t_7pyearth_6_types_INDEX_t)__pyx_v_iteration)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_6Record_12gcv(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gcv", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_f_7pyearth_7_record_6Record_gcv(__pyx_v_self, __pyx_v_iteration, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyearth._record.Record.gcv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":54 * return gcv(mse, it.get_size(), self.num_samples, self.penalty) * * cpdef FLOAT_t rsq(Record self, INDEX_t iteration): # <<<<<<<<<<<<<< * # gcv(self.sst,1,self.num_samples,self.penalty) * cdef FLOAT_t mse0 = self.sst */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_15rsq(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration); /*proto*/ static __pyx_t_7pyearth_6_types_FLOAT_t __pyx_f_7pyearth_7_record_6Record_rsq(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration, int __pyx_skip_dispatch) { __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_mse0; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_mse; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rsq", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rsq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyearth_7_record_6Record_15rsq)) { __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_iteration); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "pyearth/_record.pyx":56 * cpdef FLOAT_t rsq(Record self, INDEX_t iteration): * # gcv(self.sst,1,self.num_samples,self.penalty) * cdef FLOAT_t mse0 = self.sst # <<<<<<<<<<<<<< * # gcv(self.mse(iteration):,self.iterations[iteration].get_size(), * # self.num_samples,self.penalty)#self.gcv(iteration) */ __pyx_t_6 = __pyx_v_self->sst; __pyx_v_mse0 = __pyx_t_6; /* "pyearth/_record.pyx":59 * # gcv(self.mse(iteration):,self.iterations[iteration].get_size(), * # self.num_samples,self.penalty)#self.gcv(iteration) * cdef FLOAT_t mse = self.mse(iteration) # <<<<<<<<<<<<<< * return 1 - (mse / mse0) * */ __pyx_v_mse = ((struct __pyx_vtabstruct_7pyearth_7_record_Record *)__pyx_v_self->__pyx_vtab)->mse(__pyx_v_self, __pyx_v_iteration, 0); /* "pyearth/_record.pyx":60 * # self.num_samples,self.penalty)#self.gcv(iteration) * cdef FLOAT_t mse = self.mse(iteration) * return 1 - (mse / mse0) # <<<<<<<<<<<<<< * * cpdef FLOAT_t grsq(Record self, INDEX_t iteration): */ __pyx_r = (1.0 - (__pyx_v_mse / __pyx_v_mse0)); goto __pyx_L0; /* "pyearth/_record.pyx":54 * return gcv(mse, it.get_size(), self.num_samples, self.penalty) * * cpdef FLOAT_t rsq(Record self, INDEX_t iteration): # <<<<<<<<<<<<<< * # gcv(self.sst,1,self.num_samples,self.penalty) * cdef FLOAT_t mse0 = self.sst */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("pyearth._record.Record.rsq", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_15rsq(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_6Record_15rsq(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration) { __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rsq (wrapper)", 0); assert(__pyx_arg_iteration); { __pyx_v_iteration = __Pyx_PyInt_As_Py_intptr_t(__pyx_arg_iteration); if (unlikely((__pyx_v_iteration == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pyearth._record.Record.rsq", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyearth_7_record_6Record_14rsq(((struct __pyx_obj_7pyearth_7_record_Record *)__pyx_v_self), ((__pyx_t_7pyearth_6_types_INDEX_t)__pyx_v_iteration)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_6Record_14rsq(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rsq", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_f_7pyearth_7_record_6Record_rsq(__pyx_v_self, __pyx_v_iteration, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyearth._record.Record.rsq", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":62 * return 1 - (mse / mse0) * * cpdef FLOAT_t grsq(Record self, INDEX_t iteration): # <<<<<<<<<<<<<< * cdef FLOAT_t gcv0 = gcv(self.sst, 1, self.num_samples, self.penalty) * cdef FLOAT_t gcv_ = self.gcv(iteration) */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_17grsq(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration); /*proto*/ static __pyx_t_7pyearth_6_types_FLOAT_t __pyx_f_7pyearth_7_record_6Record_grsq(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration, int __pyx_skip_dispatch) { __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_gcv0; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_gcv_; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("grsq", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_grsq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyearth_7_record_6Record_17grsq)) { __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_iteration); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "pyearth/_record.pyx":63 * * cpdef FLOAT_t grsq(Record self, INDEX_t iteration): * cdef FLOAT_t gcv0 = gcv(self.sst, 1, self.num_samples, self.penalty) # <<<<<<<<<<<<<< * cdef FLOAT_t gcv_ = self.gcv(iteration) * return 1 - (gcv_ / gcv0) */ __pyx_v_gcv0 = __pyx_f_7pyearth_5_util_gcv(__pyx_v_self->sst, 1.0, __pyx_v_self->num_samples, __pyx_v_self->penalty, 0); /* "pyearth/_record.pyx":64 * cpdef FLOAT_t grsq(Record self, INDEX_t iteration): * cdef FLOAT_t gcv0 = gcv(self.sst, 1, self.num_samples, self.penalty) * cdef FLOAT_t gcv_ = self.gcv(iteration) # <<<<<<<<<<<<<< * return 1 - (gcv_ / gcv0) * */ __pyx_v_gcv_ = ((struct __pyx_vtabstruct_7pyearth_7_record_Record *)__pyx_v_self->__pyx_vtab)->gcv(__pyx_v_self, __pyx_v_iteration, 0); /* "pyearth/_record.pyx":65 * cdef FLOAT_t gcv0 = gcv(self.sst, 1, self.num_samples, self.penalty) * cdef FLOAT_t gcv_ = self.gcv(iteration) * return 1 - (gcv_ / gcv0) # <<<<<<<<<<<<<< * * cdef class PruningPassRecord(Record): */ __pyx_r = (1.0 - (__pyx_v_gcv_ / __pyx_v_gcv0)); goto __pyx_L0; /* "pyearth/_record.pyx":62 * return 1 - (mse / mse0) * * cpdef FLOAT_t grsq(Record self, INDEX_t iteration): # <<<<<<<<<<<<<< * cdef FLOAT_t gcv0 = gcv(self.sst, 1, self.num_samples, self.penalty) * cdef FLOAT_t gcv_ = self.gcv(iteration) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("pyearth._record.Record.grsq", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_17grsq(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_6Record_17grsq(PyObject *__pyx_v_self, PyObject *__pyx_arg_iteration) { __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("grsq (wrapper)", 0); assert(__pyx_arg_iteration); { __pyx_v_iteration = __Pyx_PyInt_As_Py_intptr_t(__pyx_arg_iteration); if (unlikely((__pyx_v_iteration == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pyearth._record.Record.grsq", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyearth_7_record_6Record_16grsq(((struct __pyx_obj_7pyearth_7_record_Record *)__pyx_v_self), ((__pyx_t_7pyearth_6_types_INDEX_t)__pyx_v_iteration)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_6Record_16grsq(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_iteration) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("grsq", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_f_7pyearth_7_record_6Record_grsq(__pyx_v_self, __pyx_v_iteration, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyearth._record.Record.grsq", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_6Record_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyearth_7_record_6Record_18__reduce_cython__(((struct __pyx_obj_7pyearth_7_record_Record *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_6Record_18__reduce_cython__(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self.iterations, self.num_samples, self.num_variables, self.penalty, self.sst) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->num_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->penalty); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->sst); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_self->iterations); __Pyx_GIVEREF(__pyx_v_self->iterations); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->iterations); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_v_state = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self.iterations, self.num_samples, self.num_variables, self.penalty, self.sst) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v__dict = __pyx_t_5; __pyx_t_5 = 0; /* "(tree fragment)":7 * state = (self.iterations, self.num_samples, self.num_variables, self.penalty, self.sst) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_6 = (__pyx_v__dict != Py_None); __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self.iterations is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self.iterations, self.num_samples, self.num_variables, self.penalty, self.sst) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self.iterations is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_Record, (type(self), 0xb19d968, None), state */ /*else*/ { __pyx_t_7 = (__pyx_v_self->iterations != ((PyObject*)Py_None)); __pyx_v_use_setstate = __pyx_t_7; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self.iterations is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Record, (type(self), 0xb19d968, None), state * else: */ __pyx_t_7 = (__pyx_v_use_setstate != 0); if (__pyx_t_7) { /* "(tree fragment)":13 * use_setstate = self.iterations is not None * if use_setstate: * return __pyx_unpickle_Record, (type(self), 0xb19d968, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_Record, (type(self), 0xb19d968, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Record); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_186243432); __Pyx_GIVEREF(__pyx_int_186243432); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_186243432); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self.iterations is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Record, (type(self), 0xb19d968, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_Record, (type(self), 0xb19d968, None), state * else: * return __pyx_unpickle_Record, (type(self), 0xb19d968, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Record__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Record); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_186243432); __Pyx_GIVEREF(__pyx_int_186243432); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_186243432); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pyearth._record.Record.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_Record, (type(self), 0xb19d968, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Record__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_6Record_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_6Record_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyearth_7_record_6Record_20__setstate_cython__(((struct __pyx_obj_7pyearth_7_record_Record *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_6Record_20__setstate_cython__(struct __pyx_obj_7pyearth_7_record_Record *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":17 * return __pyx_unpickle_Record, (type(self), 0xb19d968, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Record__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_7pyearth_7_record___pyx_unpickle_Record__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_Record, (type(self), 0xb19d968, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Record__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyearth._record.Record.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":68 * * cdef class PruningPassRecord(Record): * def __init__(PruningPassRecord self, INDEX_t num_samples, # <<<<<<<<<<<<<< * INDEX_t num_variables, FLOAT_t penalty, * FLOAT_t sst, INDEX_t size, FLOAT_t mse): */ /* Python wrapper */ static int __pyx_pw_7pyearth_7_record_17PruningPassRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7pyearth_7_record_17PruningPassRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_num_samples; __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_num_variables; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_penalty; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_sst; __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_size; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_mse; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_num_samples,&__pyx_n_s_num_variables,&__pyx_n_s_penalty,&__pyx_n_s_sst,&__pyx_n_s_size,&__pyx_n_s_mse,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_samples)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_variables)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 1); __PYX_ERR(0, 68, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_penalty)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 2); __PYX_ERR(0, 68, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sst)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 3); __PYX_ERR(0, 68, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 4); __PYX_ERR(0, 68, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mse)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, 5); __PYX_ERR(0, 68, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 68, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_num_samples = __Pyx_PyInt_As_Py_intptr_t(values[0]); if (unlikely((__pyx_v_num_samples == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L3_error) __pyx_v_num_variables = __Pyx_PyInt_As_Py_intptr_t(values[1]); if (unlikely((__pyx_v_num_variables == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) __pyx_v_penalty = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_penalty == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 69, __pyx_L3_error) __pyx_v_sst = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_sst == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) __pyx_v_size = __Pyx_PyInt_As_Py_intptr_t(values[4]); if (unlikely((__pyx_v_size == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) __pyx_v_mse = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_mse == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyearth._record.PruningPassRecord.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyearth_7_record_17PruningPassRecord___init__(((struct __pyx_obj_7pyearth_7_record_PruningPassRecord *)__pyx_v_self), __pyx_v_num_samples, __pyx_v_num_variables, __pyx_v_penalty, __pyx_v_sst, __pyx_v_size, __pyx_v_mse); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7pyearth_7_record_17PruningPassRecord___init__(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_num_samples, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_num_variables, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_penalty, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_sst, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_size, __pyx_t_7pyearth_6_types_FLOAT_t __pyx_v_mse) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "pyearth/_record.pyx":71 * INDEX_t num_variables, FLOAT_t penalty, * FLOAT_t sst, INDEX_t size, FLOAT_t mse): * self.num_samples = num_samples # <<<<<<<<<<<<<< * self.num_variables = num_variables * self.penalty = penalty */ __pyx_v_self->__pyx_base.num_samples = __pyx_v_num_samples; /* "pyearth/_record.pyx":72 * FLOAT_t sst, INDEX_t size, FLOAT_t mse): * self.num_samples = num_samples * self.num_variables = num_variables # <<<<<<<<<<<<<< * self.penalty = penalty * self.sst = sst */ __pyx_v_self->__pyx_base.num_variables = __pyx_v_num_variables; /* "pyearth/_record.pyx":73 * self.num_samples = num_samples * self.num_variables = num_variables * self.penalty = penalty # <<<<<<<<<<<<<< * self.sst = sst * self.iterations = [FirstPruningPassIteration(size, mse)] */ __pyx_v_self->__pyx_base.penalty = __pyx_v_penalty; /* "pyearth/_record.pyx":74 * self.num_variables = num_variables * self.penalty = penalty * self.sst = sst # <<<<<<<<<<<<<< * self.iterations = [FirstPruningPassIteration(size, mse)] * */ __pyx_v_self->__pyx_base.sst = __pyx_v_sst; /* "pyearth/_record.pyx":75 * self.penalty = penalty * self.sst = sst * self.iterations = [FirstPruningPassIteration(size, mse)] # <<<<<<<<<<<<<< * * def __reduce__(PruningPassRecord self): */ __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_mse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7pyearth_7_record_FirstPruningPassIteration), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->__pyx_base.iterations); __Pyx_DECREF(__pyx_v_self->__pyx_base.iterations); __pyx_v_self->__pyx_base.iterations = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pyearth/_record.pyx":68 * * cdef class PruningPassRecord(Record): * def __init__(PruningPassRecord self, INDEX_t num_samples, # <<<<<<<<<<<<<< * INDEX_t num_variables, FLOAT_t penalty, * FLOAT_t sst, INDEX_t size, FLOAT_t mse): */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyearth._record.PruningPassRecord.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":77 * self.iterations = [FirstPruningPassIteration(size, mse)] * * def __reduce__(PruningPassRecord self): # <<<<<<<<<<<<<< * return (PruningPassRecord, (1, 1, 1.0, 1.0, 1, 1.0), self._getstate()) * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyearth_7_record_17PruningPassRecord_2__reduce__(((struct __pyx_obj_7pyearth_7_record_PruningPassRecord *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_2__reduce__(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce__", 0); /* "pyearth/_record.pyx":78 * * def __reduce__(PruningPassRecord self): * return (PruningPassRecord, (1, 1, 1.0, 1.0, 1, 1.0), self._getstate()) # <<<<<<<<<<<<<< * * def _getstate(PruningPassRecord self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_7pyearth_7_record_PruningPassRecord)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7pyearth_7_record_PruningPassRecord)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7pyearth_7_record_PruningPassRecord)); __Pyx_INCREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_tuple_); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pyearth/_record.pyx":77 * self.iterations = [FirstPruningPassIteration(size, mse)] * * def __reduce__(PruningPassRecord self): # <<<<<<<<<<<<<< * return (PruningPassRecord, (1, 1, 1.0, 1.0, 1, 1.0), self._getstate()) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyearth._record.PruningPassRecord.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":80 * return (PruningPassRecord, (1, 1, 1.0, 1.0, 1, 1.0), self._getstate()) * * def _getstate(PruningPassRecord self): # <<<<<<<<<<<<<< * result = {'num_samples': self.num_samples, * 'num_variables': self.num_variables, */ /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_5_getstate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_5_getstate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_getstate (wrapper)", 0); __pyx_r = __pyx_pf_7pyearth_7_record_17PruningPassRecord_4_getstate(((struct __pyx_obj_7pyearth_7_record_PruningPassRecord *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_4_getstate(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self) { PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_getstate", 0); /* "pyearth/_record.pyx":81 * * def _getstate(PruningPassRecord self): * result = {'num_samples': self.num_samples, # <<<<<<<<<<<<<< * 'num_variables': self.num_variables, * 'penalty': self.penalty, */ __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.num_samples); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_num_samples, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyearth/_record.pyx":82 * def _getstate(PruningPassRecord self): * result = {'num_samples': self.num_samples, * 'num_variables': self.num_variables, # <<<<<<<<<<<<<< * 'penalty': self.penalty, * 'sst': self.sst, */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.num_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_num_variables, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyearth/_record.pyx":83 * result = {'num_samples': self.num_samples, * 'num_variables': self.num_variables, * 'penalty': self.penalty, # <<<<<<<<<<<<<< * 'sst': self.sst, * 'iterations': self.iterations, */ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.penalty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_penalty, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyearth/_record.pyx":84 * 'num_variables': self.num_variables, * 'penalty': self.penalty, * 'sst': self.sst, # <<<<<<<<<<<<<< * 'iterations': self.iterations, * 'selected': self.selected} */ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base.sst); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_sst, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyearth/_record.pyx":85 * 'penalty': self.penalty, * 'sst': self.sst, * 'iterations': self.iterations, # <<<<<<<<<<<<<< * 'selected': self.selected} * return result */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_iterations, __pyx_v_self->__pyx_base.iterations) < 0) __PYX_ERR(0, 81, __pyx_L1_error) /* "pyearth/_record.pyx":86 * 'sst': self.sst, * 'iterations': self.iterations, * 'selected': self.selected} # <<<<<<<<<<<<<< * return result * */ __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_self->selected); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_selected, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pyearth/_record.pyx":87 * 'iterations': self.iterations, * 'selected': self.selected} * return result # <<<<<<<<<<<<<< * * def __setstate__(PruningPassRecord self, dict state): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "pyearth/_record.pyx":80 * return (PruningPassRecord, (1, 1, 1.0, 1.0, 1, 1.0), self._getstate()) * * def _getstate(PruningPassRecord self): # <<<<<<<<<<<<<< * result = {'num_samples': self.num_samples, * 'num_variables': self.num_variables, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pyearth._record.PruningPassRecord._getstate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":89 * return result * * def __setstate__(PruningPassRecord self, dict state): # <<<<<<<<<<<<<< * self.num_samples = state['num_samples'] * self.num_variables = state['num_variables'] */ /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), (&PyDict_Type), 1, "state", 1))) __PYX_ERR(0, 89, __pyx_L1_error) __pyx_r = __pyx_pf_7pyearth_7_record_17PruningPassRecord_6__setstate__(((struct __pyx_obj_7pyearth_7_record_PruningPassRecord *)__pyx_v_self), ((PyObject*)__pyx_v_state)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_6__setstate__(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; __pyx_t_7pyearth_6_types_FLOAT_t __pyx_t_3; __pyx_t_7pyearth_6_types_INDEX_t __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate__", 0); /* "pyearth/_record.pyx":90 * * def __setstate__(PruningPassRecord self, dict state): * self.num_samples = state['num_samples'] # <<<<<<<<<<<<<< * self.num_variables = state['num_variables'] * self.penalty = state['penalty'] */ if (unlikely(__pyx_v_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 90, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_num_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->__pyx_base.num_samples = __pyx_t_2; /* "pyearth/_record.pyx":91 * def __setstate__(PruningPassRecord self, dict state): * self.num_samples = state['num_samples'] * self.num_variables = state['num_variables'] # <<<<<<<<<<<<<< * self.penalty = state['penalty'] * self.sst = state['sst'] */ if (unlikely(__pyx_v_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 91, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_num_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->__pyx_base.num_variables = __pyx_t_2; /* "pyearth/_record.pyx":92 * self.num_samples = state['num_samples'] * self.num_variables = state['num_variables'] * self.penalty = state['penalty'] # <<<<<<<<<<<<<< * self.sst = state['sst'] * self.iterations = state['iterations'] */ if (unlikely(__pyx_v_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 92, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_penalty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->__pyx_base.penalty = __pyx_t_3; /* "pyearth/_record.pyx":93 * self.num_variables = state['num_variables'] * self.penalty = state['penalty'] * self.sst = state['sst'] # <<<<<<<<<<<<<< * self.iterations = state['iterations'] * self.selected = state['selected'] */ if (unlikely(__pyx_v_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 93, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_sst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->__pyx_base.sst = __pyx_t_3; /* "pyearth/_record.pyx":94 * self.penalty = state['penalty'] * self.sst = state['sst'] * self.iterations = state['iterations'] # <<<<<<<<<<<<<< * self.selected = state['selected'] * */ if (unlikely(__pyx_v_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 94, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_iterations); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->__pyx_base.iterations); __Pyx_DECREF(__pyx_v_self->__pyx_base.iterations); __pyx_v_self->__pyx_base.iterations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pyearth/_record.pyx":95 * self.sst = state['sst'] * self.iterations = state['iterations'] * self.selected = state['selected'] # <<<<<<<<<<<<<< * * cpdef set_selected(PruningPassRecord self, INDEX_t selected): */ if (unlikely(__pyx_v_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 95, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_selected); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_self->selected = __pyx_t_4; /* "pyearth/_record.pyx":89 * return result * * def __setstate__(PruningPassRecord self, dict state): # <<<<<<<<<<<<<< * self.num_samples = state['num_samples'] * self.num_variables = state['num_variables'] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyearth._record.PruningPassRecord.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":97 * self.selected = state['selected'] * * cpdef set_selected(PruningPassRecord self, INDEX_t selected): # <<<<<<<<<<<<<< * self.selected = selected * */ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_9set_selected(PyObject *__pyx_v_self, PyObject *__pyx_arg_selected); /*proto*/ static PyObject *__pyx_f_7pyearth_7_record_17PruningPassRecord_set_selected(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_selected, int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_selected", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_selected); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyearth_7_record_17PruningPassRecord_9set_selected)) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_selected); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "pyearth/_record.pyx":98 * * cpdef set_selected(PruningPassRecord self, INDEX_t selected): * self.selected = selected # <<<<<<<<<<<<<< * * cpdef INDEX_t get_selected(PruningPassRecord self): */ __pyx_v_self->selected = __pyx_v_selected; /* "pyearth/_record.pyx":97 * self.selected = state['selected'] * * cpdef set_selected(PruningPassRecord self, INDEX_t selected): # <<<<<<<<<<<<<< * self.selected = selected * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pyearth._record.PruningPassRecord.set_selected", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_9set_selected(PyObject *__pyx_v_self, PyObject *__pyx_arg_selected); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_9set_selected(PyObject *__pyx_v_self, PyObject *__pyx_arg_selected) { __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_selected; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_selected (wrapper)", 0); assert(__pyx_arg_selected); { __pyx_v_selected = __Pyx_PyInt_As_Py_intptr_t(__pyx_arg_selected); if (unlikely((__pyx_v_selected == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("pyearth._record.PruningPassRecord.set_selected", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyearth_7_record_17PruningPassRecord_8set_selected(((struct __pyx_obj_7pyearth_7_record_PruningPassRecord *)__pyx_v_self), ((__pyx_t_7pyearth_6_types_INDEX_t)__pyx_v_selected)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_8set_selected(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_selected) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_selected", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7pyearth_7_record_17PruningPassRecord_set_selected(__pyx_v_self, __pyx_v_selected, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyearth._record.PruningPassRecord.set_selected", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":100 * self.selected = selected * * cpdef INDEX_t get_selected(PruningPassRecord self): # <<<<<<<<<<<<<< * return self.selected * */ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_11get_selected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static __pyx_t_7pyearth_6_types_INDEX_t __pyx_f_7pyearth_7_record_17PruningPassRecord_get_selected(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, int __pyx_skip_dispatch) { __pyx_t_7pyearth_6_types_INDEX_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __pyx_t_7pyearth_6_types_INDEX_t __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_selected", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_selected); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyearth_7_record_17PruningPassRecord_11get_selected)) { __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "pyearth/_record.pyx":101 * * cpdef INDEX_t get_selected(PruningPassRecord self): * return self.selected # <<<<<<<<<<<<<< * * cpdef roll_back(PruningPassRecord self, Basis basis): */ __pyx_r = __pyx_v_self->selected; goto __pyx_L0; /* "pyearth/_record.pyx":100 * self.selected = selected * * cpdef INDEX_t get_selected(PruningPassRecord self): # <<<<<<<<<<<<<< * return self.selected * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_WriteUnraisable("pyearth._record.PruningPassRecord.get_selected", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_11get_selected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_11get_selected(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_selected (wrapper)", 0); __pyx_r = __pyx_pf_7pyearth_7_record_17PruningPassRecord_10get_selected(((struct __pyx_obj_7pyearth_7_record_PruningPassRecord *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_10get_selected(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_selected", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t(__pyx_f_7pyearth_7_record_17PruningPassRecord_get_selected(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyearth._record.PruningPassRecord.get_selected", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":103 * return self.selected * * cpdef roll_back(PruningPassRecord self, Basis basis): # <<<<<<<<<<<<<< * cdef INDEX_t n = len(self.iterations) * cdef INDEX_t i */ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_13roll_back(PyObject *__pyx_v_self, PyObject *__pyx_v_basis); /*proto*/ static PyObject *__pyx_f_7pyearth_7_record_17PruningPassRecord_roll_back(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, struct __pyx_obj_7pyearth_6_basis_Basis *__pyx_v_basis, int __pyx_skip_dispatch) { __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_n; __pyx_t_7pyearth_6_types_INDEX_t __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; long __pyx_t_6; long __pyx_t_7; __pyx_t_7pyearth_6_types_INDEX_t __pyx_t_8; long __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("roll_back", 0); /* Check if called by wrapper */ if (unlikely(__pyx_skip_dispatch)) ; /* Check if overridden in Python */ else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) { #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_roll_back); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7pyearth_7_record_17PruningPassRecord_13roll_back)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_basis)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_basis)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; } #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) { __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT; } #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS } #endif } /* "pyearth/_record.pyx":104 * * cpdef roll_back(PruningPassRecord self, Basis basis): * cdef INDEX_t n = len(self.iterations) # <<<<<<<<<<<<<< * cdef INDEX_t i * for i in range(n - self.selected - 1): */ __pyx_t_1 = __pyx_v_self->__pyx_base.iterations; __Pyx_INCREF(__pyx_t_1); if (unlikely(__pyx_t_1 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 104, __pyx_L1_error) } __pyx_t_5 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n = __pyx_t_5; /* "pyearth/_record.pyx":106 * cdef INDEX_t n = len(self.iterations) * cdef INDEX_t i * for i in range(n - self.selected - 1): # <<<<<<<<<<<<<< * basis[self.iterations[n - i - 1].get_pruned()].unprune() * */ __pyx_t_6 = ((__pyx_v_n - __pyx_v_self->selected) - 1); __pyx_t_7 = __pyx_t_6; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "pyearth/_record.pyx":107 * cdef INDEX_t i * for i in range(n - self.selected - 1): * basis[self.iterations[n - i - 1].get_pruned()].unprune() # <<<<<<<<<<<<<< * * def __str__(PruningPassRecord self): */ if (unlikely(__pyx_v_self->__pyx_base.iterations == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 107, __pyx_L1_error) } __pyx_t_9 = ((__pyx_v_n - __pyx_v_i) - 1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(PyList_GET_ITEM(__pyx_v_self->__pyx_base.iterations, __pyx_t_9), __pyx_n_s_get_pruned); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_basis), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_unprune); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "pyearth/_record.pyx":103 * return self.selected * * cpdef roll_back(PruningPassRecord self, Basis basis): # <<<<<<<<<<<<<< * cdef INDEX_t n = len(self.iterations) * cdef INDEX_t i */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pyearth._record.PruningPassRecord.roll_back", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_13roll_back(PyObject *__pyx_v_self, PyObject *__pyx_v_basis); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_13roll_back(PyObject *__pyx_v_self, PyObject *__pyx_v_basis) { int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("roll_back (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_basis), __pyx_ptype_7pyearth_6_basis_Basis, 1, "basis", 0))) __PYX_ERR(0, 103, __pyx_L1_error) __pyx_r = __pyx_pf_7pyearth_7_record_17PruningPassRecord_12roll_back(((struct __pyx_obj_7pyearth_7_record_PruningPassRecord *)__pyx_v_self), ((struct __pyx_obj_7pyearth_6_basis_Basis *)__pyx_v_basis)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_12roll_back(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self, struct __pyx_obj_7pyearth_6_basis_Basis *__pyx_v_basis) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("roll_back", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7pyearth_7_record_17PruningPassRecord_roll_back(__pyx_v_self, __pyx_v_basis, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyearth._record.PruningPassRecord.roll_back", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyearth/_record.pyx":109 * basis[self.iterations[n - i - 1].get_pruned()].unprune() * * def __str__(PruningPassRecord self): # <<<<<<<<<<<<<< * return self.partial_str(slice(None)) * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_15__str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7pyearth_7_record_17PruningPassRecord_15__str__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyearth_7_record_17PruningPassRecord_14__str__(((struct __pyx_obj_7pyearth_7_record_PruningPassRecord *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyearth_7_record_17PruningPassRecord_14__str__(struct __pyx_obj_7pyearth_7_record_PruningPassRecord *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); /* "pyearth/_record.pyx":110 * * def
42,678
https://github.com/iuiaoin/leetcode/blob/master/leetcode/438.find-all-anagrams-in-a-string.js
Github Open Source
Open Source
MIT
null
leetcode
iuiaoin
JavaScript
Code
117
386
/* * @lc app=leetcode id=438 lang=javascript * * [438] Find All Anagrams in a String */ // @lc code=start /** * @param {string} s * @param {string} p * @return {number[]} */ /** * 思路:使用滑动窗口(双指针),遍历s比较其字母出现频率若相同则推入结果 */ var findAnagrams = function(s, p) { let pArr = new Array(26).fill(0); let sArr = new Array(26).fill(0); if(p.length > s.length) return []; let res = []; for(let i = 0; i < p.length; i++) { pArr[charCode(p[i])]++; sArr[charCode(s[i])]++; } const str = pArr.join(''); for(let l = 0; l <= s.length - p.length; l++) { if(sArr.join('') === str) res.push(l); if(l + p.length === s.length) break; sArr[charCode(s[l])]--; sArr[charCode(s[l + p.length])]++; } return res; }; function charCode(c) { return c.charCodeAt(0) - 'a'.charCodeAt(0); } // @lc code=end
20,206
https://github.com/JasonLiu798/javautil/blob/master/common-logs/common-log-db/src/main/java/com/atjl/logdb/api/annotation/Logable.java
Github Open Source
Open Source
Apache-2.0
null
javautil
JasonLiu798
Java
Code
16
75
package com.atjl.logdb.api.annotation; import java.lang.annotation.*; /** * 需要记日志 */ @Documented @Target({ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Logable { }
21,060
https://github.com/Rich2/openstrat/blob/master/Tiling/src/prid/HVerts.scala
Github Open Source
Open Source
Apache-2.0
2,022
openstrat
Rich2
Scala
Code
326
879
/* Copyright 2018-21 Richard Oliver. Licensed under Apache Licence version 2.0. */ package ostrat; package prid /** Common trait for [[Hverts]] and [[PolygonHC]] */ trait HVertsLike extends Any with DataInt2s[HVert] { override def dataElem(i1: Int, i2: Int): HVert = HVert.apply(i1, i2) override def fElemStr: HVert => String = _.str def vertNum: Int = arrayUnsafe.length / 2 } /** An array[Int] based collection for HVert. */ class HVerts(val arrayUnsafe: Array[Int]) extends AnyVal with HVertsLike with ArrInt2s[HVert] { type ThisT = HVerts override def unsafeFromArray(array: Array[Int]): HVerts = new HVerts(array) override def typeStr: String = "HVerts" + foldLeft("")(_ + "; " + _.rcStr) def toPolygon: PolygonHC = new PolygonHC(arrayUnsafe) /*def filter(f: HVert => Boolean): HVerts = { val tempArr = new Array[Int](array.length) var count = 0 var lengthCounter = 0 while (count < length) { if (f(this.apply(count))) { tempArr(lengthCounter * 2) = array(count * 2) tempArr(lengthCounter * 2 + 1) = array(count * 2 + 1) lengthCounter += 1 } count += 1 } val finalArr = new Array[Int](lengthCounter * 2) count = 0 while (count < lengthCounter * 2){ finalArr(count) = tempArr(count); count += 1 } new HVerts(finalArr) } def flatMapNoDuplicates(f: HVert => HVerts): HVerts = { val buff = new HVertBuff() foreach{ el => val newVals = f(el) newVals.foreach{ newVal => if( ! buff.contains(newVal)) buff.grow(newVal) } } new HVerts(buff.toArray) }*/ } object HVerts extends DataInt2sCompanion[HVert, HVerts] { def fromArray(array: Array[Int]): HVerts = new HVerts(array) implicit object PersistImplicit extends Int2sArrPersist[HVert, HVerts]("HVerts") { override def fromArray(value: Array[Int]): HVerts = new HVerts(value) override def showT(obj: HVerts, way: Show.Way, maxPlaces: Int, minPlaces: Int): String = ??? } implicit val arrArrayImplicit: ArrFlatBuilder[HVerts] = new ArrInt2sFlatBuilder[HVert, HVerts] { type BuffT = HVertBuff override def fromIntArray(array: Array[Int]): HVerts = new HVerts(array) override def fromIntBuffer(inp: Buff[Int]): HVertBuff = new HVertBuff(inp) } } class HVertBuff(val unsafeBuff: Buff[Int] = buffInt()) extends AnyVal with BuffInt2s[HVert] { type ArrT = HVerts override def typeStr: String = "HVertBuff" override def intsToT(i1: Int, i2: Int): HVert = HVert(i1, i2) }
43,977
https://github.com/riesgos/dlr-riesgos-frontend/blob/master/backend/.gitignore
Github Open Source
Open Source
Apache-2.0
2,023
dlr-riesgos-frontend
riesgos
Ignore List
Code
6
17
.env node_modules build data dist test-data
41,717
https://github.com/FirebirdSQL/python3-base/blob/master/firebird/base/types.py
Github Open Source
Open Source
MIT
2,020
python3-base
FirebirdSQL
Python
Code
1,829
4,583
#coding:utf-8 # # PROGRAM/MODULE: firebird-base # FILE: firebird/base/types.py # DESCRIPTION: Types # CREATED: 14.5.2020 # # The contents of this file are subject to the MIT License # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # # Copyright (c) 2020 Firebird Project (www.firebirdsql.org) # All Rights Reserved. # # Contributor(s): Pavel Císař (original code) # ______________________________________ """Firebird Base - Types """ from __future__ import annotations from typing import Any, Dict, Hashable, Callable, AnyStr, cast from abc import ABC, ABCMeta, abstractmethod import sys from importlib import import_module from enum import Enum, IntEnum from weakref import WeakValueDictionary # Exceptions class Error(Exception): """Exception that is intended to be used as a base class of all **application-related** errors. The important difference from `Exception` class is that `Error` accepts keyword arguments, that are stored into instance attributes with the same name. Important: Attribute lookup on this class never fails, as all attributes that are not actually set, have `None` value. Example:: try: if condition: raise Error("Error message", err_code=1) else: raise Error("Unknown error") except Error as e: if e.err_code is None: ... elif e.err_code == 1: ... Note: Warnings are not considered errors and thus should not use this class as base. """ def __init__(self, *args, **kwargs): super().__init__(*args) for name, value in kwargs.items(): setattr(self, name, value) def __getattr__(self, name): return None # Singletons _singletons_ = {} class SingletonMeta(type): """Metaclass for `Singleton` classes. Manages internal cache of class instances. If instance for a class is in cache, it's returned without calling the constructor, otherwise the instance is created normally and stored in cache for later use. """ def __call__(cls: Singleton, *args, **kwargs): name = f"{cls.__module__}.{cls.__qualname__}" obj = _singletons_.get(name) if obj is None: obj = super().__call__(*args, **kwargs) _singletons_[name] = obj return obj class Singleton(metaclass=SingletonMeta): """Base class for singletons. Important: If you create a descendant class that uses constructor arguments, these arguments are meaningful ONLY on first call, because all subsequent calls simply return an instance stored in cache without calling the constructor. """ # Sentinels class SentinelMeta(type): """Metaclass for `Sentinel`. """ def __call__(cls: Sentinel, *args, **kwargs): name = args[0].upper() obj = cls.instances.get(name) if obj is None: obj = super().__call__(*args, **kwargs) cls.instances[name] = obj return obj class Sentinel(metaclass=SentinelMeta): """Simple sentinel object. Important: All sentinels have name, that is **always in capital letters**. Sentinels with the same name are singletons. """ #: Class attribute with defined sentinels. There is no need to access or manipulate it. instances = {} def __init__(self, name: str): """ Arguments: name: Sentinel name. """ #: Sentinel name. self.name = name.upper() def __str__(self): """Returns name. """ return self.name def __repr__(self): """Returns Sentinel('name'). """ return f"Sentinel('{self.name}')" # Useful sentinel objects #: Sentinel that denotes default value DEFAULT: Sentinel = Sentinel('DEFAULT') #: Sentinel that denotes infinity value INFINITY: Sentinel = Sentinel('INFINITY') #: Sentinel that denotes unlimited value UNLIMITED: Sentinel = Sentinel('UNLIMITED') #: Sentinel that denotes unknown value UNKNOWN: Sentinel = Sentinel('UNKNOWN') #: Sentinel that denotes a condition when value was not found NOT_FOUND: Sentinel = Sentinel('NOT_FOUND') #: Sentinel that denotes explicitly undefined value UNDEFINED: Sentinel = Sentinel('UNDEFINED') #: Sentinel that denotes any value ANY: Sentinel = Sentinel('ANY') #: Sentinel that denotes all possible values ALL: Sentinel = Sentinel('ALL') #: Sentinel that denotes suspend request (in message queue) SUSPEND: Sentinel = Sentinel('SUSPEND') #: Sentinel that denotes resume request (in message queue) RESUME: Sentinel = Sentinel('RESUME') #: Sentinel that denotes stop request (in message queue) STOP: Sentinel = Sentinel('STOP') # Distinct objects class Distinct(ABC): """Abstract base class for classes (incl. dataclasses) with distinct instances. """ @abstractmethod def get_key(self) -> Hashable: """Returns instance key. Important: The key is used for instance hash computation that by default uses the `hash` function. If the key is not suitable argument for `hash`, you must provide your own `__hash__` implementation as well! """ __hash__ = lambda self: hash(self.get_key()) class CachedDistinctMeta(ABCMeta): """Metaclass for CachedDistinct. """ def __call__(cls: CachedDistinct, *args, **kwargs): key = cls.extract_key(*args, **kwargs) obj = cls._instances_.get(key) if obj is None: obj = super().__call__(*args, **kwargs) cls._instances_[key] = obj return obj class CachedDistinct(Distinct, metaclass=CachedDistinctMeta): """Abstract `Distinct` descendant that caches instances. All created instances are cached in `~weakref.WeakValueDictionary`. """ def __init_subclass__(cls: Type, /, **kwargs) -> None: super().__init_subclass__(**kwargs) setattr(cls, '_instances_', WeakValueDictionary()) @classmethod @abstractmethod def extract_key(cls, *args, **kwargs) -> Hashable: """Returns key from arguments passed to `__init__()`. Important: The key is used to store instance in cache. It should be the same as key returned by instance `Distinct.get_key()`! """ # Enums class ByteOrder(Enum): """Byte order for storing numbers in binary `.MemoryBuffer`. """ LITTLE = 'little' BIG = 'big' NETWORK = BIG class ZMQTransport(IntEnum): """ZeroMQ transport protocol. """ UNKNOWN = 0 # Not a valid option, defined only to handle undefined values INPROC = 1 IPC = 2 TCP = 3 PGM = 4 EPGM = 5 VMCI = 6 class ZMQDomain(IntEnum): """ZeroMQ address domain. """ UNKNOWN = 0 # Not a valid option, defined only to handle undefined values LOCAL = 1 # Within process (inproc) NODE = 2 # On single node (ipc or tcp loopback) NETWORK = 3 # Network-wide (ip address or domain name) # Enhanced string types class ZMQAddress(str): """ZeroMQ endpoint address. It behaves like `str`, but checks that value is valid ZMQ endpoint address, has additional R/O properties and meaningful `repr()`. Raises: ValueError: When string value passed to constructor is not a valid ZMQ endpoint address. """ def __new__(cls, value: AnyStr): if isinstance(value, bytes): value = cast(bytes, value).decode('utf8') if '://' in value: protocol, _ = value.split('://', 1) if protocol.upper() not in ZMQTransport._member_map_: raise ValueError(f"Unknown protocol '{protocol}'") if protocol.upper() == 'UNKNOWN': raise ValueError("Invalid protocol") else: raise ValueError("Protocol specification required") return str.__new__(cls, value.lower()) def __repr__(self): return f"ZMQAddress('{self}')" @property def protocol(self) -> ZMQTransport: """Transport protocol. """ protocol, _ = self.split('://', 1) return ZMQTransport._member_map_[protocol.upper()] @property def address(self) -> str: """Endpoint address. """ _, address = self.split('://', 1) return address @property def domain(self) -> ZMQDomain: """Endpoint address domain. """ if self.protocol == ZMQTransport.INPROC: return ZMQDomain.LOCAL if self.protocol == ZMQTransport.IPC: return ZMQDomain.NODE if self.protocol == ZMQTransport.TCP: if self.address.startswith('127.0.0.1') or self.address.lower().startswith('localhost'): return ZMQDomain.NODE return ZMQDomain.NETWORK # PGM, EPGM and VMCI return ZMQDomain.NETWORK class MIME(str): """MIME type specification. It behaves like `str`, but checks that value is valid MIME type specification, has additional R/O properties and meaningful `repr()`. """ #: Supported MIME types MIME_TYPES = ['text', 'image', 'audio', 'video', 'application', 'multipart', 'message'] def __new__(cls, value: AnyStr): dfm = [x for x in value.split(';')] mime_type: str = dfm.pop(0) if (i := mime_type.find('/')) == -1: raise ValueError("MIME type specification must be 'type/subtype[;param=value;...]'") if mime_type[:i] not in cls.MIME_TYPES: raise ValueError(f"MIME type '{mime_type[:i]}' not supported") if [i for i in dfm if '=' not in i]: raise ValueError("Wrong specification of MIME type parameters") obj = str.__new__(cls, value) obj._bs_: int = obj.find('/') obj._fp_: int = obj.find(';') return obj def __repr__(self): return f"MIME('{self}')" @property def mime_type(self) -> str: """MIME type specification: <type>/<subtype>. """ if self._fp_ != -1: return self[:self._fp_] return self @property def type(self) -> str: """MIME type. """ return self[:self._bs_] @property def subtype(self) -> str: """MIME subtype. """ if self._fp_ != -1: return self[self._bs_ + 1:self._fp_] return self[self._bs_ + 1:] @property def params(self) -> Dict[str, str]: """MIME parameters. """ if self._fp_ != -1: return {k.strip(): v.strip() for k, v in (x.split('=') for x in self[self._fp_+1:].split(';'))} return {} class PyExpr(str): """Source code for Python expression. It behaves like `str`, but checks that value is a valid Python expression, and provides direct access to compiled code. Raises: SyntaxError: When string value is not a valid Python expression. """ _expr_ = None def __new__(cls, value: str): expr = compile(value, "PyExpr", 'eval') new = str.__new__(cls, value) new._expr_ = expr return new def __repr__(self): return f"PyExpr('{self}')" def get_callable(self, arguments: str='', namespace: Dict[str, Any]=None) -> Callable: """Returns expression as callable function ready for execution. Arguments: arguments: String with arguments (names separated by coma) for returned function. namespace: Dictionary with namespace elements available for expression. """ ns = {} if namespace: ns.update(namespace) code = compile(f"def expr({arguments}):\n return {self}", "PyExpr", 'exec') eval(code, ns) return ns['expr'] @property def expr(self): "Expression code ready to be appased to `eval`." return self._expr_ class PyCode(str): """Python source code. It behaves like `str`, but checks that value is a valid Python code block, and provides direct access to compiled code. Raises: SyntaxError: When string value is not a valid Python code block. """ _code_ = None def __new__(cls, value: str): code = compile(value, "PyCode", 'exec') new = str.__new__(cls, value) new._code_ = code return new @property def code(self): """Python code ready to be appased to `exec`. """ return self._code_ class PyCallable(str): """Source code for Python callable. It behaves like `str`, but checks that value is a valid Python callable (function of class definition), and acts like a callable (i.e. you can directly call the PyCallable value). Raises: ValueError: When string value does not contains the function or class definition. SyntaxError: When string value is not a valid Python callable. """ _callable_ = None #: Name of the callable (function). name: str = None def __new__(cls, value: str): callable_name = None for line in value.split('\n'): if line.lower().startswith('def '): callable_name = line[4:line.find('(')].strip() break if callable_name is None: for line in value.split('\n'): if line.lower().startswith('class '): callable_name = line[6:line.find('(')].strip() break if callable_name is None: raise ValueError("Python function or class definition not found") ns = {} eval(compile(value, "PyCallable", 'exec'), ns) new = str.__new__(cls, value) new._callable_ = ns[callable_name] new.name = callable_name return new def __call__(self, *args, **kwargs): return self._callable_(*args, **kwargs) # Metaclasses def Conjunctive(name, bases, attrs): """Returns a metaclass that is conjunctive descendant of all metaclasses used by parent classes. Example: class A(type): pass class B(type): pass class AA(metaclass=A):pass class BB(metaclass=B):pass class CC(AA, BB, metaclass=Conjunctive): pass """ basemetaclasses = [] for base in bases: metacls = type(base) if isinstance(metacls, type) and metacls is not type and not metacls in basemetaclasses: basemetaclasses.append(metacls) dynamic = type(''.join(b.__name__ for b in basemetaclasses), tuple(basemetaclasses), {}) return dynamic(name, bases, attrs) # Functions def load(spec: str) -> Any: """Return object from module. Module is imported if necessary. Arguments: spec: Object specification in format `module[.submodule...]:object_name[.object_name...]` """ module_spec, name = spec.split(':') if module_spec in sys.modules: module = sys.modules[module_spec] else: module = import_module(module_spec) result = module for item in name.split('.'): result = getattr(result, item) return result
46,393
https://github.com/EdRands/luthier/blob/master/dist/functions/dotCase.js
Github Open Source
Open Source
MIT
2,022
luthier
EdRands
JavaScript
Code
28
87
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.dotCase = void 0; var dotCase = function (str) { return (str.toLowerCase().replace(/[^a-z0-9 ]/g, '').trim().replace(/ +/g, '.')); }; exports.dotCase = dotCase;
18,391
https://github.com/hightouchio/typesuite/blob/master/scripts/generate-types.ts
Github Open Source
Open Source
MIT
2,020
typesuite
hightouchio
TypeScript
Code
58
196
import path from "path"; import TypeGenerator, { FileMappingsLoader, FileWriter } from "../src/type-gen"; const ROOT_DIR = path.dirname(__dirname); const netSuitBasePath = `${ROOT_DIR}/src/netsuite_webservices/2019_2`; const mappingsDir = `${netSuitBasePath}/__mappings/`; const nsGenerator = new TypeGenerator( new FileMappingsLoader(mappingsDir), new FileWriter(netSuitBasePath) ); nsGenerator.generateTypesFromMappings(); // TODO: run the generator for the XML Soap types // const xmlSoapBasePath = `${ROOT_DIR}/src/xmlsoap`; // const soapGenerator = new TypeGenerator(xmlSoapBasePath); // soapGenerator.generateTypesFromMappings();
37,937
https://github.com/ismanong/js/blob/master/dianying/yinghuam/js/cfunction.js
Github Open Source
Open Source
MIT
2,021
js
ismanong
JavaScript
Code
101
520
$(function(){ var cur_status = "less"; var charNumbers = $(".txtDesc").text().length; //总字数 var limit = 50; //显示字数 if (charNumbers > limit) { var orgText = $(".txtDesc").text(); //原始文本 var orgHeight = $(".txtDesc").height(); //原始高度 var showText = orgText.substring(0, limit)+'...'; //最终显示的文本 $(".txtDesc").html(showText); var contentHeight = $(".txtDesc").height(); //截取内容后的高度 $(".openBtn,.txtDesc").click(function() { if (cur_status == "less") { $(".txtDesc").height(contentHeight).text(orgText).animate({ height: orgHeight }); $(".openBtn").html('<i class="am-icon-chevron-up"></i>'); cur_status = "more"; } else { $(".txtDesc").height(orgHeight).text(showText).animate({ height: contentHeight }); $(".openBtn").html('<i class="am-icon-chevron-down"></i>'); cur_status = "less"; } }); } else { $(".openBtn").css("background","#fff").css("height","10px"); } hideinit(); $('.showmore').click(function(){ $('.am-active .mvlist').children("li:gt(18)").show(); $(this).remove(); }); }); function hideinit(){ $('.mvlist').each(function(){ if($(this).find('li').length > 19){ hidelist(this); } //console.log($(this).find('li').length); }) } function hidelist(obj){ $(obj).children("li:gt(18)").hide(); $(obj).append('<li class="showmore">...</li>'); }
5,965
https://github.com/saketkc/pyvirchow/blob/master/tests/test_stats.py
Github Open Source
Open Source
BSD-3-Clause
2,020
pyvirchow
saketkc
Python
Code
108
378
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import pytest from pyvirchow.stats import welford_simulatenous_update import numpy as np import numpy.testing as npt def test_welford(): vector_matrix = [[1, 2, 3], [3, 2, 1], [5, 1, 3], [6, 7, 8]] for idx, vector in enumerate(vector_matrix): count = idx + 1 vector = np.array(vector) if count == 1: avg = vector M2 = np.zeros(len(vector)) avg, M2, new_var, new_samplevar = welford_simulatenous_update( avg, M2, vector, count) if count == 2: M2 = 2 * np.nanvar(np.array(vector_matrix[0:2]), axis=0) npt.assert_almost_equal(avg, np.nanmean(np.array(vector_matrix), axis=0)) npt.assert_almost_equal(new_var, np.nanvar( np.array(vector_matrix), axis=0)) npt.assert_almost_equal(new_samplevar, 4 / 3 * np.nanvar(np.array(vector_matrix), axis=0)) if __name__ == '__main__': pytest.main([__file__])
42,648
https://github.com/Charith424/ToDoApplication/blob/master/UI/BlueLotus.UI/Scripts/HtnScripts/HRIS/SaveFunction.js
Github Open Source
Open Source
Unlicense
null
ToDoApplication
Charith424
JavaScript
Code
1,032
4,198
function SaveBasicDet() { //InsertImgtoServer(); SaveBasicDet_afterUpload(""); } function SaveBasicDet_afterUpload(EmpImgPath) { //InsertImgtoServer(); var nicNo = $('#nicNo').val(); var empName = $('#HdrSec1_InptEmpNm_Val').val(); var empNo = $('#HdrSec1_InptEmpNo_Val').val(); if (empNo == "" || empName == "") { CLOSELoadingCommon(); alert('Employee Name OR Number Can not be blank'); return; } if (nicNo == "") { CLOSELoadingCommon(); alert('NIC Number Can not be blank'); return; } var joinDate = $('#joinDate').val(); if (joinDate == "" || joinDate == null || joinDate == undefined || joinDate == '') { CLOSELoadingCommon(); alert('Join Date Can not be blank'); return; } //else { var EmpKy = $('#EmpKy').val(); if (EmpKy == null || EmpKy == "") { EmpKy = 1; } HiddenEmpKy = EmpKy; var epfNo = $('#HdrSec2_InptEpfNo_Val').val(); var nameInInitial = $('#nameInInitial').val(); var cmbTitle = $("#cmbTitle").data("kendoComboBox").text(); var cmbTitleKy = (!$("#cmbTitle").data("kendoComboBox").value()) ? 1 : $("#cmbTitle").data("kendoComboBox").value(); var dateOfBirth = $('#dateOfBirth').val(); var nicNo = $('#nicNo').val(); var passportNo = $('#passportNo').val(); var CardNo = $('#CardNo').val(); var passportExpDate = $('#passportExpDate').val(); var drivingLicence = $('#drivingLicence').val(); var nationality = $("#cmbNationality").data("kendoComboBox").text(); var nationalityKy = (!$("#cmbNationality").data("kendoComboBox").value()) ? 1 : $("#cmbNationality").data("kendoComboBox").value(); var religion = $("#cmbReligion").data("kendoComboBox").text(); var religionKy = (!$("#cmbReligion").data("kendoComboBox").value()) ? 1 : $("#cmbReligion").data("kendoComboBox").value(); var gender = $("#cmbGender").data("kendoComboBox").text(); var genderKy = (!$("#cmbGender").data("kendoComboBox").value()) ? 1 : $("#cmbGender").data("kendoComboBox").value(); var bloodGroup = $("#cmbBloodGrp").data("kendoComboBox").text(); var bloodGroupKy = (!$("#cmbBloodGrp").data("kendoComboBox").value()) ? 1 : $("#cmbBloodGrp").data("kendoComboBox").value(); var country = $("#cmbCountry").data("kendoComboBox").text(); var countryKy = (!$("#cmbCountry").data("kendoComboBox").value()) ? 1 : $("#cmbCountry").data("kendoComboBox").value(); var civilStatus = $("#cmbCivilStatus").data("kendoComboBox").text(); var civilStatusKy = (!$("#cmbCivilStatus").data("kendoComboBox").value()) ? 1 : $("#cmbCivilStatus").data("kendoComboBox").value(); //var joinDate = $('#joinDate').val(); var EmpImg = "";//$('#HdrSec7_filesImg').val(); // $('input[type=file]').val(); var IsActive = 0; if ($('#IsActive').is(":checked")) { IsActive = 1; } else { IsActive = 0; } var IsAprove = 0; if ($('#IsAprove').is(":checked")) { IsAprove = 1; } else { IsAprove = 0; } var resignDate = $('#resignDate').val(); var HdrDataString = JSON.stringify({ EmpNo: empNo, EmpKy: EmpKy, EmpNm: empName }); var DetDataString = JSON.stringify({ EmpNo: empNo, EmpKy: EmpKy, EmpNm: empName, NameInInitial: nameInInitial, Title: cmbTitle, TitleKy: cmbTitleKy, DateOfBirth: dateOfBirth, NicNo: nicNo, PassportNo: passportNo, PassportExpDate: passportExpDate, DrivingLicence: drivingLicence, Nationality: nationality, NationalityKy: nationalityKy, Religion: religion, ReligionKy: religionKy, Gender: gender, GenderKy: genderKy, BloodGroup: bloodGroup, BloodGroupKy: bloodGroupKy, Country: country, CountryKy: countryKy, CivilStatus: civilStatus, CivilStatusKy: civilStatusKy, EpfNo: epfNo, JoinDate: joinDate, IsActive: IsActive, IsAprove: IsAprove, ResignDate: resignDate, EmpImg: EmpImgPath, CardNo: CardNo }); $.ajax({ url: UrlInsert.BasicDet, data: { HdrDataString: HdrDataString, DetDataString: DetDataString }, contentType: 'application/json; charset=utf-8', dataType: "Json", success: function (data) { //alert('EmpKy' + data[0].EmpKy) CLOSELoadingCommon(); alert('Saved Succesfuly..'); Refresh(); }, error: function (e) { return false; } }); //} } function InsertImgtoServer() { var EmpImgFileNm = $('#HdrSec7_filesImg').val(); var EmpImgFileNm_Old = $('#HdrSec7_filesImgPath').val(); //alert(EmpImg); //var EmpKy = $('#EmpKy').val(); if (typeof FormData == "undefined") { var data = []; var opmlFile = document.getElementById('HdrSec7_filesImg').files[0]; data.push('opmlFile', document.getElementById('HdrSec7_filesImg').files[0]); } else { var data = new FormData(); var opmlFile = document.getElementById('HdrSec7_filesImg').files[0]; data.append("opmlFile", document.getElementById('HdrSec7_filesImg').files[0]); $.ajax({ type: "POST", url: UrlInsert.InsertFileswithpath, data:data, // { // data:data, // EmpKy:EmpKy //}, dataType: "html", contentType: false, processData: false, enctype: "multipart/form-data", success: function (result) { var res1 = result.replace('\"', ''); var res = res1.replace('\"', ''); //alert(res); if (EmpImgFileNm == "") { res = EmpImgFileNm_Old; } //alert(res); SaveBasicDet_afterUpload(res); if (res != "false") { } else { } } }) } } function Refresh() { ChangePage('EmployeeIndex', 'HRIS'); } function SaveContactDet(){ var empNo = $('#HdrSec1_InptEmpNo_Val').val(); var EmpKy = $('#EmpKy').val(); var empName = $('#HdrSec1_InptEmpNm_Val').val(); if (EmpKy == null || EmpKy == "") { EmpKy = 1; } HiddenEmpKy = EmpKy; var Street = $('#Street').val(); var City = $('#City').val(); var State = $('#State').val(); var HiddenAddress = $('#HiddenAddress').val(); var temAdd = $('#CurrentAddress').val(); var cmbDistrict = $("#cmbDistrict").data("kendoComboBox").text(); var cmbDistrictKy = (!$("#cmbDistrict").data("kendoComboBox").value()) ? 1 : $("#cmbDistrict").data("kendoComboBox").value(); var cmbElectorate = $("#cmbElectorate").data("kendoComboBox").text(); var cmbElectorateKy = (!$("#cmbElectorate").data("kendoComboBox").value()) ? 1 : $("#cmbElectorate").data("kendoComboBox").value(); var cmbProvince = $("#cmbProvince").data("kendoComboBox").text(); var cmbProvinceKy = (!$("#cmbProvince").data("kendoComboBox").value()) ? 1 : $("#cmbProvince").data("kendoComboBox").value(); var mobile = $('#mobile').val(); var telephone = $('#telephone').val(); var email = $('#email').val(); var EmrContactName = $('#EmrContactName').val(); var EmAdrKy = $('#EmAdrKy').val(); var cmbRelationship = $("#cmbRelationship").data("kendoComboBox").text(); var cmbRelationshipKy = (!$("#cmbRelationship").data("kendoComboBox").value()) ? 1 : $("#cmbRelationship").data("kendoComboBox").value(); var emrConAddress = $('#emrConAddress').val(); var emrConTelephone = $('#emrConTelephone').val(); var OfficeTelephone = $('#OfficeTelephone').val(); var OfficeEmail = $('#OfficeEmail').val(); var HdrDataString = JSON.stringify({ EmpNo: empNo, EmpKy: EmpKy, EmpNm: empName }); var DetDataString = JSON.stringify({ EmpNo: empNo, EmpKy: EmpKy, EmpNm: empName, Street: Street, City: City, State: State, HiddenAddress: HiddenAddress, CurrentAddress: temAdd, District: cmbDistrict, DistrictKy: cmbDistrictKy, Electorate: cmbElectorate, ElectorateKy: cmbElectorateKy, Province: cmbProvince, ProvinceKy: cmbProvinceKy, Mobile: mobile, Telephone: telephone, Email: email, EmrContactName: EmrContactName, Relationship: cmbRelationship, EmrRelationshipKy: cmbRelationshipKy, EmrConAddress: emrConAddress, EmrConTelephone: emrConTelephone, OfficeTelephone: OfficeTelephone, OfficeEmail: OfficeEmail, EmAdrKy: EmAdrKy }); $.ajax({ url: UrlInsert.ContactDet, data: { HdrDataString: HdrDataString, DetDataString: DetDataString }, contentType: 'application/json; charset=utf-8', dataType: "Json", success: function (data) { CLOSELoadingCommon(); alert('Saved Succesfuly..'); Refresh(); }, error: function (e) { return false; } }); } function SaveEducationDet() { var empNo = $('#HdrSec1_InptEmpNo_Val').val(); var EmpKy = $('#EmpKy').val(); var empName = $('#HdrSec1_InptEmpNm_Val').val(); if (EmpKy == null || EmpKy == "") { EmpKy = 1; } var ALYear = $('#ALYear').val(); var ALInstitute = $('#ALInstitute').val(); var ALGrade = $("#cmbALGrade").data("kendoComboBox").text(); var ALGradeKy = $("#cmbALGrade").data("kendoComboBox").value(); if (ALGradeKy < 1) { ALGradeKy = 1; } var OLYear = $('#OLYear').val(); var OLInstitute = $('#OLInstitute').val(); var OLGrade = $("#cmbOLGrade").data("kendoComboBox").text(); var OLGradeKy = $("#cmbOLGrade").data("kendoComboBox").value(); if (OLGradeKy < 1) { OLGradeKy = 1; } HiddenEmpKy = EmpKy; var HdrDataString = JSON.stringify({ EmpNo: empNo, EmpKy: EmpKy, EmpNm: empName }); var DetDataString = JSON.stringify({ EmpNo: empNo, EmpKy: EmpKy, EmpNm: empName, ALYear: ALYear, ALInstitute: ALInstitute, ALGradeKy: ALGradeKy, ALGrade: ALGrade, OLYear: OLYear, OLInstitute: OLInstitute, OLGradeKy: OLGradeKy, OLGrade: OLGrade }); $.ajax({ url: UrlInsert.InsertDet, data: { HdrDataString: HdrDataString, DetDataString: DetDataString, Form: 'SaveEducationDet' }, contentType: 'application/json; charset=utf-8', dataType: "Json", success: function (data) { CLOSELoadingCommon(); alert('Saved Succesfuly..'); Refresh(); }, error: function (e) { return false; } }); } function SaveFamilyDet() { var grid = $("#familyDetailGrid").data("kendoGrid"); var currentData = grid.dataSource.data(); var GridData = []; for (var i = 0; i < currentData.length; i++) { GridData.push(currentData[i].toJSON()); } var KendoGridData = kendo.stringify(GridData); var empNo = $('#HdrSec1_InptEmpNo_Val').val(); var EmpKy = $('#EmpKy').val(); var empName = $('#HdrSec1_InptEmpNm_Val').val(); if (EmpKy == null || EmpKy == "") { EmpKy = 1; } var HdrDataString = JSON.stringify({ EmpNo: empNo, EmpKy: EmpKy, EmpNm: empName }); var DetDataString = JSON.stringify({ EmpNo: empNo, EmpKy: EmpKy, EmpNm: empName, GridData: KendoGridData }); $.ajax({ url: UrlInsert.InsertDet, data: { HdrDataString: HdrDataString, DetDataString: DetDataString, Form: 'SaveFamilyDet' }, contentType: 'application/json; charset=utf-8', dataType: "Json", success: function (data) { CLOSELoadingCommon(); alert('Saved Succesfuly..'); Refresh(); }, error: function (e) { return false; } }); } function DeleteFamilyDet(AdrKy) { $.ajax({ url: UrlDelete.DeleteFamilyDet, data: { AdrKy :AdrKy }, contentType: 'application/json; charset=utf-8', dataType: "Json", success: function (data) { alert('Deleted Succesfuly..'); Refresh(); }, error: function (e) { return false; } }); }
20,383
https://github.com/lmmx/tap/blob/master/src/tap/preproc/__init__.py
Github Open Source
Open Source
MIT
null
tap
lmmx
Python
Code
12
20
from . import segment from .merge import * from .format_conversion import *
11,953
https://github.com/arpendu11/code-examples/blob/master/core-java/annotation-processing/introduction-to-annotations/src/main/java/com/reflectoring/RepeatedAnnotatedEmployee.java
Github Open Source
Open Source
MIT
2,022
code-examples
arpendu11
Java
Code
14
49
package com.reflectoring; @RepeatableCompany @RepeatableCompany(name = "Name_2", city = "City_2") public class RepeatedAnnotatedEmployee { }
5,574
https://github.com/ambs/Lingua-Identify-CLD/blob/master/t/02-html.t
Github Open Source
Open Source
Unlicense
2,017
Lingua-Identify-CLD
ambs
Perl
Code
70
245
#!perl -T use utf8; use Test::More; use Lingua::Identify::CLD; my %langs = ( PORTUGUESE => q{<poem><line>As <word type="other">armas</word> e os <word>barões</word> assinalados,</line><line> que da <word comment="means occidental">ocidental</word> <word class="something">praia</word> lusitana,</line><line>por mares <div note="This is the same as never">nunca</div> de antes navegados</line><line> passaram ainda além da traprobana</line></poem>}, ); plan tests => scalar(keys %langs); my $cld = Lingua::Identify::CLD->new(); for my $lang (keys %langs) { is $cld->identify($langs{$lang}, isPlainText => 0), $lang, "Identifying $lang"; }
2,707
https://github.com/ResolveStudios/ClubOrbital/blob/master/Assets/_PoiyomiShaders/ModularShader/Poiyomi Pro.shader
Github Open Source
Open Source
Apache-2.0
null
ClubOrbital
ResolveStudios
GLSL
Code
20,000
70,569
Shader ".poiyomi/V8.0/Pro" { Properties { [HideInInspector] shader_master_label ("<color=#E75898ff>Poiyomi Pro V8α</color>", Float) = 0 [HideInInspector] shader_is_using_thry_editor ("", Float) = 0 [HideInInspector] footer_youtube ("{texture:{name:icon-youtube,height:32},action:{type:URL,data:https://www.youtube.com/poiyomi},hover:YOUTUBE}", Float) = 0 [HideInInspector] footer_twitter ("{texture:{name:icon-twitter,height:32},action:{type:URL,data:https://twitter.com/poiyomi},hover:TWITTER}", Float) = 0 [HideInInspector] footer_patreon ("{texture:{name:icon-patreon,height:32},action:{type:URL,data:https://www.patreon.com/poiyomi},hover:PATREON}", Float) = 0 [HideInInspector] footer_discord ("{texture:{name:icon-discord,height:32},action:{type:URL,data:https://discord.gg/Ays52PY},hover:DISCORD}", Float) = 0 [HideInInspector] footer_github ("{texture:{name:icon-github,height:32},action:{type:URL,data:https://github.com/poiyomi/PoiyomiToonShader},hover:GITHUB}", Float) = 0 // Keyword to remind users in the VRChat SDK that this material hasn't been locked. Inelegant but it works. [HideInInspector] _ForgotToLockMaterial (";;YOU_FORGOT_TO_LOCK_THIS_MATERIAL;", Int) = 1 [ThryShaderOptimizerLockButton] _ShaderOptimizerEnabled ("", Int) = 0 [Helpbox(1)] _LockTooltip ("Animations don't work by default when locked in. Right click a property if you want to animate it. The shader will lock in automatically at upload time.", Int) = 0 [ThryWideEnum(Opaque, 0, Cutout, 1, TransClipping, 9, Fade, 2, Transparent, 3, Additive, 4, Soft Additive, 5, Multiplicative, 6, 2x Multiplicative, 7)]_Mode("Rendering Preset--{on_value_actions:[ {value:0,actions:[{type:SET_PROPERTY,data:render_queue=2000}, {type:SET_PROPERTY,data:render_type=Opaque}, {type:SET_PROPERTY,data:_BlendOp=0}, {type:SET_PROPERTY,data:_BlendOpAlpha=0}, {type:SET_PROPERTY,data:_Cutoff=0}, {type:SET_PROPERTY,data:_SrcBlend=1}, {type:SET_PROPERTY,data:_DstBlend=0}, {type:SET_PROPERTY,data:_AlphaToMask=0}, {type:SET_PROPERTY,data:_ZWrite=1}, {type:SET_PROPERTY,data:_ZTest=4}, {type:SET_PROPERTY,data:_AlphaPremultiply=0}]}, {value:1,actions:[{type:SET_PROPERTY,data:render_queue=2450}, {type:SET_PROPERTY,data:render_type=TransparentCutout}, {type:SET_PROPERTY,data:_BlendOp=0}, {type:SET_PROPERTY,data:_BlendOpAlpha=0}, {type:SET_PROPERTY,data:_Cutoff=.5}, {type:SET_PROPERTY,data:_SrcBlend=1}, {type:SET_PROPERTY,data:_DstBlend=0}, {type:SET_PROPERTY,data:_AlphaToMask=1}, {type:SET_PROPERTY,data:_ZWrite=1}, {type:SET_PROPERTY,data:_ZTest=4}, {type:SET_PROPERTY,data:_AlphaPremultiply=0}]}, {value:9,actions:[{type:SET_PROPERTY,data:render_queue=2450}, {type:SET_PROPERTY,data:render_type=TransparentCutout}, {type:SET_PROPERTY,data:_BlendOp=0}, {type:SET_PROPERTY,data:_BlendOpAlpha=0}, {type:SET_PROPERTY,data:_Cutoff=0}, {type:SET_PROPERTY,data:_SrcBlend=5}, {type:SET_PROPERTY,data:_DstBlend=10}, {type:SET_PROPERTY,data:_AlphaToMask=0}, {type:SET_PROPERTY,data:_ZWrite=1}, {type:SET_PROPERTY,data:_ZTest=4}, {type:SET_PROPERTY,data:_AlphaPremultiply=0}]}, {value:2,actions:[{type:SET_PROPERTY,data:render_queue=3000}, {type:SET_PROPERTY,data:render_type=Transparent}, {type:SET_PROPERTY,data:_BlendOp=0}, {type:SET_PROPERTY,data:_BlendOpAlpha=0}, {type:SET_PROPERTY,data:_Cutoff=0}, {type:SET_PROPERTY,data:_SrcBlend=5}, {type:SET_PROPERTY,data:_DstBlend=10}, {type:SET_PROPERTY,data:_AlphaToMask=0}, {type:SET_PROPERTY,data:_ZWrite=0}, {type:SET_PROPERTY,data:_ZTest=4}, {type:SET_PROPERTY,data:_AlphaPremultiply=0}]}, {value:3,actions:[{type:SET_PROPERTY,data:render_queue=3000}, {type:SET_PROPERTY,data:render_type=Transparent}, {type:SET_PROPERTY,data:_BlendOp=0}, {type:SET_PROPERTY,data:_BlendOpAlpha=0}, {type:SET_PROPERTY,data:_Cutoff=0}, {type:SET_PROPERTY,data:_SrcBlend=1}, {type:SET_PROPERTY,data:_DstBlend=10}, {type:SET_PROPERTY,data:_AlphaToMask=0}, {type:SET_PROPERTY,data:_ZWrite=0}, {type:SET_PROPERTY,data:_ZTest=4}, {type:SET_PROPERTY,data:_AlphaPremultiply=1}]}, {value:4,actions:[{type:SET_PROPERTY,data:render_queue=3000}, {type:SET_PROPERTY,data:render_type=Transparent}, {type:SET_PROPERTY,data:_BlendOp=0}, {type:SET_PROPERTY,data:_BlendOpAlpha=0}, {type:SET_PROPERTY,data:_Cutoff=0}, {type:SET_PROPERTY,data:_SrcBlend=1}, {type:SET_PROPERTY,data:_DstBlend=1}, {type:SET_PROPERTY,data:_AlphaToMask=0}, {type:SET_PROPERTY,data:_ZWrite=0}, {type:SET_PROPERTY,data:_ZTest=4}, {type:SET_PROPERTY,data:_AlphaPremultiply=0}]}, {value:5,actions:[{type:SET_PROPERTY,data:render_queue=3000}, {type:SET_PROPERTY,data:RenderType=Transparent}, {type:SET_PROPERTY,data:_BlendOp=0}, {type:SET_PROPERTY,data:_BlendOpAlpha=0}, {type:SET_PROPERTY,data:_Cutoff=0}, {type:SET_PROPERTY,data:_SrcBlend=4}, {type:SET_PROPERTY,data:_DstBlend=1}, {type:SET_PROPERTY,data:_AlphaToMask=0}, {type:SET_PROPERTY,data:_ZWrite=0}, {type:SET_PROPERTY,data:_ZTest=4}, {type:SET_PROPERTY,data:_AlphaPremultiply=0}]}, {value:6,actions:[{type:SET_PROPERTY,data:render_queue=3000}, {type:SET_PROPERTY,data:render_type=Transparent}, {type:SET_PROPERTY,data:_BlendOp=0}, {type:SET_PROPERTY,data:_BlendOpAlpha=0}, {type:SET_PROPERTY,data:_Cutoff=0}, {type:SET_PROPERTY,data:_SrcBlend=2}, {type:SET_PROPERTY,data:_DstBlend=0}, {type:SET_PROPERTY,data:_AlphaToMask=0}, {type:SET_PROPERTY,data:_ZWrite=0}, {type:SET_PROPERTY,data:_ZTest=4}, {type:SET_PROPERTY,data:_AlphaPremultiply=0}]}, {value:7,actions:[{type:SET_PROPERTY,data:render_queue=3000}, {type:SET_PROPERTY,data:render_type=Transparent}, {type:SET_PROPERTY,data:_BlendOp=0}, {type:SET_PROPERTY,data:_BlendOpAlpha=0}, {type:SET_PROPERTY,data:_Cutoff=0}, {type:SET_PROPERTY,data:_SrcBlend=2}, {type:SET_PROPERTY,data:_DstBlend=3}, {type:SET_PROPERTY,data:_AlphaToMask=0}, {type:SET_PROPERTY,data:_ZWrite=0}, {type:SET_PROPERTY,data:_ZTest=4}, {type:SET_PROPERTY,data:_AlphaPremultiply=0}]} }]}]}", Int) = 0 // Main [HideInInspector] m_mainCategory ("Color & Normals", Float) = 0 //Main-main _Color ("Color, Alpha & Normals--{reference_property:_ColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _ColorThemeIndex ("", Int) = 0 _MainTex ("Texture--{reference_properties:[_MainTexPan, _MainTexUV]}", 2D) = "white" { } [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _MainTexUV ("UV", Int) = 0 [HideInInspector][Vector2]_MainTexPan ("Panning", Vector) = (0, 0, 0, 0) [Normal]_BumpMap ("Normal Map--{reference_properties:[_BumpMapPan, _BumpMapUV, _BumpScale]}", 2D) = "bump" { } [HideInInspector][Vector2]_BumpMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _BumpMapUV ("UV", Int) = 0 [HideInInspector]_BumpScale ("Intensity", Range(0, 10)) = 1 _ClippingMask ("Alpha Map--{reference_properties:[_ClippingMaskPan, _ClippingMaskUV, _Inverse_Clipping]}", 2D) = "white" { } [HideInInspector][Vector2]_ClippingMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _ClippingMaskUV ("UV", Int) = 0 [HideInInspector][ToggleUI]_Inverse_Clipping ("Invert", Float) = 0 _Cutoff ("Alpha Cuttoff--{condition_showS:(_Mode==1)}", Range(0, 1.001)) = 0.5 [HideInInspector] m_start_MainHueShift ("Color Adjust--{reference_property:_MainColorAdjustToggle}", Float) = 0 [HideInInspector][ThryToggle(COLOR_GRADING_HDR)] _MainColorAdjustToggle ("Adjust Colors", Float) = 0 _MainColorAdjustTexture ("Mask R(H) G(B) B(S)--{reference_properties:[_MainColorAdjustTexturePan, _MainColorAdjustTextureUV]}", 2D) = "white" { } [HideInInspector][Vector2]_MainColorAdjustTexturePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _MainColorAdjustTextureUV ("UV", Int) = 0 _Saturation ("Saturation", Range(-1, 10)) = 0 _MainBrightness ("Brightness", Range(-1, 1)) = 0 [ThryToggleUI(true)] _MainHueShiftToggle ("<size=13><b> Hue Shift</b></size>", Float) = 0 [ToggleUI]_MainHueShiftReplace ("Hue Replace?--{condition_showS:(_MainHueShiftToggle==1)}", Float) = 1 _MainHueShift ("Hue Shift--{condition_showS:(_MainHueShiftToggle==1)}", Range(0, 1)) = 0 _MainHueShiftSpeed ("Hue Shift Speed--{condition_showS:(_MainHueShiftToggle==1)}", Float) = 0 [Space(4)] [ThryToggleUI(true)]_MainHueALCTEnabled ("<size=13><b> Hue Shift Audio Link</b></size>--{condition_showS:(_MainHueShiftToggle==1 && _EnableAudioLink==1)}", Float) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)]_MainALHueShiftBand ("Band--{condition_showS:(_MainHueShiftToggle==1 && _EnableAudioLink==1 && _MainHueALCTEnabled==1)}", Int) = 0 [ThryWideEnum(Motion increases as intensity of band increases, 0, Above but Smooth, 1, Motion moves back and forth as a function of intensity, 2, Above but Smoooth, 3, Fixed speed increase when the band is dark Stationary when light, 4, Above but Smooooth, 5, Fixed speed increase when the band is dark Fixed speed decrease when light, 6, Above but Smoooooth, 7)]_MainALHueShiftCTIndex ("Motion Type--{condition_showS:(_MainHueShiftToggle==1 && _EnableAudioLink==1 && _MainHueALCTEnabled==1)}", Int) = 0 _MainHueALMotionSpeed ("Motion Speed--{condition_showS:(_MainHueShiftToggle==1 && _EnableAudioLink==1 && _MainHueALCTEnabled==1)}", Float) = 1 [HideInInspector] m_end_MainHueShift ("Hue Shift", Float) = 0 [HideInInspector] m_start_Alpha ("Alpha Options", Float) = 0 [ToggleUI]_AlphaForceOpaque ("Force Opaque", Float) = 0 _AlphaMod ("Alpha Mod", Range(-1, 1)) = 0.0 [Space(4)] [ThryToggleUI(true)] _AlphaToCoverage ("<size=13><b> Alpha To Coverage</b></size>", Float) = 0 [ToggleUI]_AlphaSharpennedA2C ("Sharpenned A2C--{condition_showS:(_AlphaToCoverage==1)}", Float) = 0 _AlphaMipScale ("Mip Level Alpha Scale--{condition_showS:(_AlphaToCoverage==1)}", Range(0, 1)) = 0.25 [ToggleUI]_AlphaPremultiply ("Alpha Premultiply", Float) = 0 [Space(4)] [ThryToggleUI(true)] _AlphaDithering ("<size=13><b> Dithering</b></size>", Float) = 0 _AlphaDitherGradient ("Dither Gradient--{condition_showS:(_AlphaDithering==1)}", Range(0, 1)) = .1 [Space(4)] [ThryToggleUI(true)] _AlphaDistanceFade ("<size=13><b> Distance Alpha</b></size>", Float) = 0 [Enum(Object Position, 0, Pixel Position, 1)] _AlphaDistanceFadeType ("Pos To Use--{condition_showS:(_AlphaDistanceFade==1)}", Int) = 1 _AlphaDistanceFadeMinAlpha ("Min Distance Alpha--{condition_showS:(_AlphaDistanceFade==1)}", Range(0, 1)) = 0 _AlphaDistanceFadeMaxAlpha ("Max Distance Alpha--{condition_showS:(_AlphaDistanceFade==1)}", Range(0, 1)) = 1 _AlphaDistanceFadeMin ("Min Distance--{condition_showS:(_AlphaDistanceFade==1)}", Float) = 0 _AlphaDistanceFadeMax ("Max Distance--{condition_showS:(_AlphaDistanceFade==1)}", Float) = 0 [Space(4)] [ThryToggleUI(true)] _AlphaFresnel ("<size=13><b> Fresnel Alpha</b></size>", Float) = 0 _AlphaFresnelAlpha ("Intensity--{condition_showS:(_AlphaFresnel==1)}", Range(0, 1)) = 0 _AlphaFresnelSharpness ("Sharpness--{condition_showS:(_AlphaFresnel==1)}", Range(0, 1)) = .5 _AlphaFresnelWidth ("Width--{condition_showS:(_AlphaFresnel==1)}", Range(0, 1)) = .5 [ToggleUI]_AlphaFresnelInvert ("Invert--{condition_showS:(_AlphaFresnel==1)}", Float) = 0 [Space(4)] [ThryToggleUI(true)] _AlphaAngular ("<size=13><b> Angular Alpha</b></size>", Float) = 0 [Enum(Camera Face Model, 0, Model Face Camera, 1, Face Each Other, 2)] _AngleType ("Angle Type--{condition_showS:(_AlphaAngular==1)}", Int) = 0 [Enum(Model, 0, Vertex, 1)] _AngleCompareTo ("Model or Vert Positon--{condition_showS:(_AlphaAngular==1)}", Int) = 0 [Vector3]_AngleForwardDirection ("Forward Direction--{condition_showS:(_AlphaAngular==1)}", Vector) = (0, 0, 1) _CameraAngleMin ("Camera Angle Min--{condition_showS:(_AlphaAngular==1)}", Range(0, 180)) = 45 _CameraAngleMax ("Camera Angle Max--{condition_showS:(_AlphaAngular==1)}", Range(0, 180)) = 90 _ModelAngleMin ("Model Angle Min--{condition_showS:(_AlphaAngular==1)}", Range(0, 180)) = 45 _ModelAngleMax ("Model Angle Max--{condition_showS:(_AlphaAngular==1)}", Range(0, 180)) = 90 _AngleMinAlpha ("Min Alpha--{condition_showS:(_AlphaAngular==1)}", Range(0, 1)) = 0 [Space(4)] [ThryToggleUI(true)]_AlphaAudioLinkEnabled ("<size=13><b> Alpha Audio Link</b></size>--{condition_showS:(_EnableAudioLink==1)}", Float) = 0 [Vector2]_AlphaAudioLinkAddRange ("Add Range--{ condition_showS:(_AlphaAudioLinkEnabled==1 && _EnableAudioLink==1)}", Vector) = (0, 0, 0, 0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AlphaAudioLinkAddBand ("Emission Add Band--{ condition_showS:(_AlphaAudioLinkEnabled==1 && _EnableAudioLink==1)}", Int) = 0 [HideInInspector] m_end_Alpha ("Alpha Options", Float) = 0 [HideInInspector] m_start_DetailOptions ("Details--{reference_property:_DetailEnabled}", Float) = 0 [HideInInspector][ThryToggle(FINALPASS)]_DetailEnabled ("Enable", Float) = 0 _DetailMask ("Detail Mask (R:Texture, G:Normal)--{reference_properties:[_DetailMaskPan, _DetailMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_DetailMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DetailMaskUV ("UV", Int) = 0 _DetailTint ("Detail Texture Tint--{reference_property:_DetailTintThemeIndex}", Color) = (1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _DetailTintThemeIndex ("", Int) = 0 _DetailTex ("Detail Texture--{reference_properties:[_DetailTexPan, _DetailTexUV]}", 2D) = "gray" { } [HideInInspector][Vector2]_DetailTexPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DetailTexUV ("UV", Int) = 0 _DetailTexIntensity ("Detail Tex Intensity", Range(0, 10)) = 1 _DetailBrightness ("Detail Brightness:", Range(0, 2)) = 1 [Normal]_DetailNormalMap ("Detail Normal--{reference_properties:[_DetailNormalMapPan, _DetailNormalMapUV, _DetailNormalMapScale]}", 2D) = "bump" { } [HideInInspector]_DetailNormalMapScale ("Detail Normal Intensity", Range(0, 10)) = 1 [HideInInspector][Vector2]_DetailNormalMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DetailNormalMapUV ("UV", Int) = 0 [HideInInspector] m_end_DetailOptions ("Details", Float) = 0 [HideInInspector] m_start_vertexManipulation ("Vertex Options--{reference_property:_VertexManipulationsEnabled, button_help:{text:Tutorial,action:{type:URL,data:https://www.youtube.com/watch?v=x728WN50JeA&list=PL4_Gy3VRJSmbXfQSldzUiChgABQsoBlLw},hover:YouTube}}", Float) = 0 [HideInInspector][ThryToggle(AUTO_EXPOSURE)]_VertexManipulationsEnabled ("Enabled", Float) = 0 [Vector3]_VertexManipulationLocalTranslation ("Local Translation", Vector) = (0, 0, 0, 1) [Vector3]_VertexManipulationLocalRotation ("Local Rotation", Vector) = (0, 0, 0, 1) [Vector3]_VertexManipulationLocalRotationSpeed ("Local Rotation Speed", Vector) = (0, 0, 0, 1) _VertexManipulationLocalScale ("Local Scale", Vector) = (1, 1, 1, 1) [Vector3]_VertexManipulationWorldTranslation ("World Translation", Vector) = (0, 0, 0, 1) _VertexManipulationHeight ("Vertex Height", Float) = 0 _VertexManipulationHeightMask ("Height Map--{reference_properties:[_VertexManipulationHeightMaskPan, _VertexManipulationHeightMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_VertexManipulationHeightMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3)] _VertexManipulationHeightMaskUV ("UV", Int) = 0 _VertexManipulationHeightBias ("Mask Bias", Range(0, 1)) = 0 [ToggleUI]_VertexRoundingEnabled ("Rounding Enabled", Float) = 0 _VertexRoundingDivision ("Division Amount", Float) = 500 [Space(10)] [ThryToggleUI(true)]_VertexAudioLinkEnabled ("<size=13><b> Audio Link</b></size>--{condition_showS:(_EnableAudioLink==1)}", Float) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _VertexLocalTranslationALBand ("Local Translate Band--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [Vector3]_VertexLocalTranslationALMin ("Local Translate Min--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Vector) = (0,0,0) [Vector3]_VertexLocalTranslationALMax ("Local Translate Max--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Vector) = (0,0,0) [Space(10)] [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _VertexLocalRotationALBandX("Rotation Band X--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _VertexLocalRotationALBandY ("Rotation Band Y--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _VertexLocalRotationALBandZ ("Rotation Band Z--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [Vector3]_VertexLocalRotationAL ("Rotation--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Vector) = (0,0,0) [Space(10)] [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _VertexLocalRotationCTALBandX ("Band X--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [ThryWideEnum(Motion increases as intensity of band increases, 0, Above but Smooth, 1, Motion moves back and forth as a function of intensity, 2, Above but Smoooth, 3, Fixed speed increase when the band is dark Stationary when light, 4, Above but Smooooth, 5, Fixed speed increase when the band is dark Fixed speed decrease when light, 6, Above but Smoooooth, 7)]_VertexLocalRotationCTALTypeX ("Motion Type X--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _VertexLocalRotationCTALBandY ("Band Y--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [ThryWideEnum(Motion increases as intensity of band increases, 0, Above but Smooth, 1, Motion moves back and forth as a function of intensity, 2, Above but Smoooth, 3, Fixed speed increase when the band is dark Stationary when light, 4, Above but Smooooth, 5, Fixed speed increase when the band is dark Fixed speed decrease when light, 6, Above but Smoooooth, 7)]_VertexLocalRotationCTALTypeY ("Motion Type Y--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _VertexLocalRotationCTALBandZ ("Band Z--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [ThryWideEnum(Motion increases as intensity of band increases, 0, Above but Smooth, 1, Motion moves back and forth as a function of intensity, 2, Above but Smoooth, 3, Fixed speed increase when the band is dark Stationary when light, 4, Above but Smooooth, 5, Fixed speed increase when the band is dark Fixed speed decrease when light, 6, Above but Smoooooth, 7)]_VertexLocalRotationCTALTypeZ ("Motion Type Z--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [Vector3]_VertexLocalRotationCTALSpeed ("Rotation Speed--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Vector) = (0,0,0) [Space(10)] [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _VertexLocalScaleALBand ("Scale Band--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 _VertexLocalScaleALMin ("Scale Min--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Vector) = (0,0,0,0) _VertexLocalScaleALMax ("Scale Max--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Vector) = (0,0,0,0) [Space(10)] [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _VertexWorldTranslationALBand ("World Translation Band--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [Vector3]_VertexWorldTranslationALMin ("World Translation--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Vector) = (0,0,0) [Vector3]_VertexWorldTranslationALMax ("World Translation--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Vector) = (0,0,0) [Space(10)] [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _VertexManipulationHeightBand ("Vertex Height Band--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [Vector2]_VertexManipulationHeightAL ("Vertex Height--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Vector) = (0,0,0) [Space(10)] [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _VertexRoundingRangeBand ("Rounding Band--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Int) = 0 [Vector2]_VertexRoundingRangeAL ("Rounding Range--{ condition_showS:(_EnableAudioLink==1 && _VertexAudioLinkEnabled==1)}", Vector) = (0,0,0) [HideInInspector] m_end_vertexManipulation ("Vertex Offset", Float) = 0 [HideInInspector] m_start_MainVertexColors ("Vertex Colors", Float) = 0 [ToggleUI]_MainVertexColoringLinearSpace ("Linear Colors", Float) = 1 _MainVertexColoring ("Use Vertex Color", Range(0, 1)) = 0 _MainUseVertexColorAlpha ("Use Vertex Color Alpha", Range(0, 1)) = 0 [HideInInspector] m_end_MainVertexColors ("Vertex Colors", Float) = 0 // Back Face Textures and Emission [HideInInspector] m_start_backFace ("Back Face--{reference_property:_BackFaceEnabled}", Float) = 0 [HideInInspector][ThryToggle(POI_BACKFACE)]_BackFaceEnabled ("Backface Enabled", Float) = 0 _BackFaceColor ("Color--{reference_property:_BackFaceColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _BackFaceColorThemeIndex ("", Int) = 0 _BackFaceEmissionStrength ("Emission Strength", Range(0, 20)) = 0 _BackFaceAlpha ("Alpha", Range(0,1)) = 1 _BackFaceTexture ("Texture--{reference_properties:[_BackFaceTexturePan, _BackFaceTextureUV]}", 2D) = "white" { } [HideInInspector][Vector2]_BackFaceTexturePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_BackFaceTextureUV ("UV#", Int) = 0 _BackFaceMask ("Mask--{reference_properties:[_BackFaceMaskPan, _BackFaceMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_BackFaceMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_BackFaceMaskUV ("UV#", Int) = 0 _BackFaceDetailIntensity ("Detail Intensity", Range(0, 5)) = 1 [ToggleUI]_BackFaceReplaceAlpha ("Replace Alpha", Float) = 0 [Space(10)] [ThryToggleUI(true)]_BackFaceHueShiftEnabled ("<size=13><b> Hue Shift</b></size>", Float) = 0 _BackFaceHueShift ("Hue Shift--{condition_showS:(_BackFaceHueShiftEnabled==1)}", Range(0, 1)) = 0 _BackFaceHueShiftSpeed ("Hue Shift Speed--{condition_showS:(_BackFaceHueShiftEnabled==1)}", Float) = 0 [HideInInspector] m_end_backFace ("Back Face", Float) = 0 // RGBA Masking [HideInInspector] m_start_RGBMask ("RGBA Color Masking--{reference_property:_RGBMaskEnabled}", Float) = 0 [HideInInspector][ThryToggle(VIGNETTE)]_RGBMaskEnabled ("RGB Mask Enabled", Float) = 0 [ToggleUI]_RGBUseVertexColors ("Use Vertex Colors", Float) = 0 [ToggleUI]_RGBBlendMultiplicative ("Multiplicative?", Float) = 0 _RGBMask ("Mask--{reference_properties:[_RGBMaskPan, _RGBMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_RGBMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_RGBMaskUV ("UV", int) = 0 _RedColor ("R Color--{reference_property:_RedColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _RedColorThemeIndex ("", Int) = 0 _RedTexure ("R Texture--{reference_properties:[_RedTexurePan, _RedTexureUV]}", 2D) = "white" { } [HideInInspector][Vector2]_RedTexurePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_RedTexureUV ("UV", int) = 0 _GreenColor ("G Color--{reference_property:_GreenColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _GreenColorThemeIndex ("", Int) = 0 _GreenTexture ("G Texture--{reference_properties:[_GreenTexturePan, _GreenTextureUV]}", 2D) = "white" { } [HideInInspector][Vector2]_GreenTexturePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_GreenTextureUV ("UV", int) = 0 _BlueColor ("B Color--{reference_property:_BlueColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _BlueColorThemeIndex ("", Int) = 0 _BlueTexture ("B Texture--{reference_properties:[_BlueTexturePan, _BlueTextureUV]}", 2D) = "white" { } [HideInInspector][Vector2]_BlueTexturePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_BlueTextureUV ("UV", int) = 0 _AlphaColor ("A Color--{reference_property:_AlphaColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _AlphaColorThemeIndex ("", Int) = 0 _AlphaTexture ("A Texture--{reference_properties:[_AlphaTexturePan, _AlphaTextureUV]}", 2D) = "white" { } [HideInInspector][Vector2]_AlphaTexturePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_AlphaTextureUV ("UV", int) = 0 // RGB MASKED NORMALS [ThryToggle(GEOM_TYPE_MESH)]_RgbNormalsEnabled ("Enable Normals", Float) = 0 [ToggleUI]_RGBNormalBlend ("Blend with Base--{condition_show:{type:PROPERTY_BOOL,data:_RgbNormalsEnabled==1}}", Float) = 0 [Normal]_RgbNormalR ("R Normal--{reference_properties:[_RgbNormalRPan, _RgbNormalRUV],condition_show:{type:PROPERTY_BOOL,data:_RgbNormalsEnabled==1}}", 2D) = "bump" { } [HideInInspector][Vector2]_RgbNormalRPan ("Pan", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_RgbNormalRUV ("UV", int) = 0 _RgbNormalRScale ("Intensity--{condition_show:{type:PROPERTY_BOOL,data:_RgbNormalsEnabled==1}}", Range(0, 10)) = 0 [Normal]_RgbNormalG ("G Normal--{reference_properties:[_RgbNormalGPan, _RgbNormalGUV],condition_show:{type:PROPERTY_BOOL,data:_RgbNormalsEnabled==1}}", 2D) = "bump" { } [HideInInspector][Vector2]_RgbNormalGPan ("Pan", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_RgbNormalGUV ("UV", int) = 0 _RgbNormalGScale ("Intensity--{condition_show:{type:PROPERTY_BOOL,data:_RgbNormalsEnabled==1}}", Range(0, 10)) = 0 [Normal]_RgbNormalB ("B Normal--{reference_properties:[_RgbNormalBPan, _RgbNormalBUV],condition_show:{type:PROPERTY_BOOL,data:_RgbNormalsEnabled==1}}", 2D) = "bump" { } [HideInInspector][Vector2]_RgbNormalBPan ("Pan", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_RgbNormalBUV ("UV", int) = 0 _RgbNormalBScale ("Intensity--{condition_show:{type:PROPERTY_BOOL,data:_RgbNormalsEnabled==1}}", Range(0, 10)) = 0 [Normal]_RgbNormalA ("A Normal--{reference_properties:[_RgbNormalAPan, _RgbNormalAUV],condition_show:{type:PROPERTY_BOOL,data:_RgbNormalsEnabled==1}}", 2D) = "bump" { } [HideInInspector][Vector2]_RgbNormalAPan ("Pan", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_RgbNormalAUV ("UV", int) = 0 _RgbNormalAScale ("Intensity--{condition_show:{type:PROPERTY_BOOL,data:_RgbNormalsEnabled==1}}", Range(0, 10)) = 0 [HideInInspector] m_end_RGBMask ("RGB Color Masking", Float) = 0 // Decal Texture [HideInInspector] m_start_DecalSection ("Decals--{button_help:{text:Tutorial,action:{type:URL,data:https://www.youtube.com/watch?v=xHoQVN_F7JE&list=PL4_Gy3VRJSmbXfQSldzUiChgABQsoBlLw},hover:YouTube},reference_property:_DecalEnabled}", Float) = 0 _DecalMask ("Decal RGBA Mask--{reference_properties:[_DecalMaskPan, _DecalMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_DecalMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DecalMaskUV ("UV", Int) = 0 // Decal 0 [HideInInspector] m_start_Decal0 ("Decal 0", Float) = 0 [HideInInspector][ThryToggle(GEOM_TYPE_BRANCH)]_DecalEnabled ("Enable", Float) = 0 _DecalColor ("Color--{reference_property:_DecalColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _DecalColorThemeIndex ("", Int) = 0 _DecalEmissionStrength ("Emission Strength", Range(0, 20)) = 0 _DecalTexture ("Decal--{reference_properties:[_DecalTexturePan, _DecalTextureUV]}", 2D) = "white" { } [HideInInspector][Vector2]_DecalTexturePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DecalTextureUV ("UV", Int) = 0 [ToggleUI]_DecalTiled ("Tiled?", Float) = 0 _Decal0Depth ("Depth", Float) = 0 [Vector2]_DecalScale ("Scale", Vector) = (1, 1, 0, 0) _DecalSideOffset ("Side Offset ←→↓↑", Vector) = (0, 0, 0, 0) [Vector2]_DecalPosition ("Position", Vector) = (.5, .5, 0, 0) _DecalRotation ("Rotation", Range(0, 360)) = 0 _DecalRotationSpeed ("Rotation Speed", Float) = 0 [ThryWideEnum(Replace, 0, Darken, 1, Multiply, 2, Color Burn, 3, Linear Burn, 4, Lighten, 5, Screen, 6, Color Dodge, 7, Linear Dodge (Add), 8, Overlay, 9, Soft Lighten, 10, Hard Light, 11, Vivid Light, 12, Linear Light, 13, Pin Light, 14, Hard Mix, 15, Difference, 16, Exclusion, 17, Subtract, 18, Divide, 19)]_DecalBlendType ("Blending", Range(0, 1)) = 0 _DecalBlendAlpha ("Alpha", Range(0,1)) = 1 [ToggleUI]_DecalOverideAlpha ("Override Alpha", Float) = 0 [ToggleUI]_DecalHueShiftEnabled ("Hue Shift Enabled", Float) = 0 _DecalHueShiftSpeed ("Shift Speed", Float) = 0 _DecalHueShift ("Hue Shift", Range(0,1)) = 0 _Decal0HueAngleStrength ("Hue Angle Power", Float) = 0 // Decal 0 Audio Link [HideInInspector] m_start_Decal0AudioLink ("Audio Link ♫--{ condition_showS:_EnableAudioLink==1}", Float) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal0ScaleBand ("Scale Band", Int) = 0 _AudioLinkDecal0Scale ("Scale Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal0RotationBand ("Rotation Band", Int) = 0 [Vector2]_AudioLinkDecal0Rotation ("Rotation Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal0AlphaBand ("Alpha Band", Int) = 0 [Vector2]_AudioLinkDecal0Alpha ("Alpha Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal0EmissionBand ("Emission Band", Int) = 0 [Vector2]_AudioLinkDecal0Emission ("Emission Mod", Vector) = (0,0,0,0) [HideInInspector] m_end_Decal0AudioLink ("Audio Link", Float) = 0 [HideInInspector] m_end_Decal0 ("Decal 0", Float) = 0 // Decal 1 //"GEOM_TYPE_FROND" //"DEPTH_OF_FIELD_COC_VIEW" [HideInInspector] m_start_Decal1 ("Decal 1--{reference_property:_DecalEnabled1}", Float) = 0 [HideInInspector][ThryToggle(GEOM_TYPE_BRANCH_DETAIL)]_DecalEnabled1 ("Enable", Float) = 0 _DecalColor1 ("Color--{reference_property:_DecalColor1ThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _DecalColor1ThemeIndex ("", Int) = 0 _DecalEmissionStrength1 ("Emission Strength", Range(0, 20)) = 0 _DecalTexture1 ("Decal--{reference_properties:[_DecalTexture1Pan, _DecalTexture1UV]}", 2D) = "white" { } [HideInInspector][Vector2]_DecalTexture1Pan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DecalTexture1UV ("UV", Int) = 0 [ToggleUI]_DecalTiled1 ("Tiled?", Float) = 0 _Decal1Depth ("Depth", Float) = 0 [Vector2]_DecalScale1 ("Scale", Vector) = (1, 1, 0, 0) _DecalSideOffset1 ("Side Offset ←→↓↑", Vector) = (0, 0, 0, 0) [Vector2]_DecalPosition1 ("Position", Vector) = (.5, .5, 0, 0) _DecalRotation1 ("Rotation", Range(0, 360)) = 0 _DecalRotationSpeed1 ("Rotation Speed", Float) = 0 [ThryWideEnum(Replace, 0, Darken, 1, Multiply, 2, Color Burn, 3, Linear Burn, 4, Lighten, 5, Screen, 6, Color Dodge, 7, Linear Dodge (Add), 8, Overlay, 9, Soft Lighten, 10, Hard Light, 11, Vivid Light, 12, Linear Light, 13, Pin Light, 14, Hard Mix, 15, Difference, 16, Exclusion, 17, Subtract, 18, Divide, 19)]_DecalBlendType1 ("Blending", Range(0, 1)) = 0 _DecalBlendAlpha1 ("Alpha", Range(0,1)) = 1 [ToggleUI]_DecalOverideAlpha1 ("Override Alpha", Float) = 0 [ToggleUI]_DecalHueShiftEnabled1 ("Hue Shift Enabled", Float) = 0 _DecalHueShiftSpeed1 ("Shift Speed", Float) = 0 _DecalHueShift1 ("Hue Shift", Range(0,1)) = 0 _Decal1HueAngleStrength ("Hue Angle Power", Float) = 0 // Decal 1 Audio Link [HideInInspector] m_start_Decal1AudioLink ("Audio Link ♫--{ condition_showS:_EnableAudioLink==1}", Float) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal1ScaleBand ("Scale Band", Int) = 0 _AudioLinkDecal1Scale ("Scale Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal1RotationBand ("Rotation Band", Int) = 0 [Vector2]_AudioLinkDecal1Rotation ("Rotation Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal1AlphaBand ("Alpha Band", Int) = 0 [Vector2]_AudioLinkDecal1Alpha ("Alpha Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal1EmissionBand ("Emission Band", Int) = 0 [Vector2]_AudioLinkDecal1Emission ("Emission Mod", Vector) = (0,0,0,0) [HideInInspector] m_end_Decal1AudioLink ("Audio Link", Float) = 0 [HideInInspector] m_end_Decal1 ("Decal 0", Float) = 0 // Decal 2 [HideInInspector] m_start_Decal2 ("Decal 2--{reference_property:_DecalEnabled2}", Float) = 0 [HideInInspector][ThryToggle(GEOM_TYPE_FROND)]_DecalEnabled2 ("Enable", Float) = 0 _DecalColor2 ("Color--{reference_property:_DecalColor2ThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _DecalColor2ThemeIndex ("", Int) = 0 _DecalEmissionStrength2 ("Emission Strength", Range(0, 20)) = 0 _DecalTexture2 ("Decal--{reference_properties:[_DecalTexture2Pan, _DecalTexture2UV]}", 2D) = "white" { } [HideInInspector][Vector2]_DecalTexture2Pan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DecalTexture2UV ("UV", Int) = 0 [ToggleUI]_DecalTiled2 ("Tiled?", Float) = 0 _Decal2Depth ("Depth", Float) = 0 [Vector2]_DecalScale2 ("Scale", Vector) = (1, 1, 0, 0) _DecalSideOffset2 ("Side Offset ←→↓↑", Vector) = (0, 0, 0, 0) [Vector2]_DecalPosition2 ("Position", Vector) = (.5, .5, 0, 0) _DecalRotation2 ("Rotation", Range(0, 360)) = 0 _DecalRotationSpeed2 ("Rotation Speed", Float) = 0 [ThryWideEnum(Replace, 0, Darken, 1, Multiply, 2, Color Burn, 3, Linear Burn, 4, Lighten, 5, Screen, 6, Color Dodge, 7, Linear Dodge (Add), 8, Overlay, 9, Soft Lighten, 10, Hard Light, 11, Vivid Light, 12, Linear Light, 13, Pin Light, 14, Hard Mix, 15, Difference, 16, Exclusion, 17, Subtract, 18, Divide, 19)]_DecalBlendType2 ("Blending", Range(0, 1)) = 0 _DecalBlendAlpha2 ("Alpha", Range(0,1)) = 1 [ToggleUI]_DecalOverideAlpha2 ("Override Alpha", Float) = 0 [ToggleUI]_DecalHueShiftEnabled2 ("Hue Shift Enabled", Float) = 0 _DecalHueShiftSpeed2 ("Shift Speed", Float) = 0 _DecalHueShift2 ("Hue Shift", Range(0,1)) = 0 _Decal2HueAngleStrength ("Hue Angle Power", Float) = 0 // Decal 2 Audio Link [HideInInspector] m_start_Decal2AudioLink ("Audio Link ♫--{ condition_showS:_EnableAudioLink==1}", Float) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal2ScaleBand ("Scale Band", Int) = 0 _AudioLinkDecal2Scale ("Scale Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal2RotationBand ("Rotation Band", Int) = 0 [Vector2]_AudioLinkDecal2Rotation ("Rotation Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal2AlphaBand ("Alpha Band", Int) = 0 [Vector2]_AudioLinkDecal2Alpha ("Alpha Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal2EmissionBand ("Emission Band", Int) = 0 [Vector2]_AudioLinkDecal2Emission ("Emission Mod", Vector) = (0,0,0,0) [HideInInspector] m_end_Decal2AudioLink ("Audio Link", Float) = 0 [HideInInspector] m_end_Decal2 ("Decal 0", Float) = 0 // Decal 3 [HideInInspector] m_start_Decal3 ("Decal 3--{reference_property:_DecalEnabled3}", Float) = 0 [HideInInspector][ThryToggle(DEPTH_OF_FIELD_COC_VIEW)]_DecalEnabled3 ("Enable", Float) = 0 _DecalColor3 ("Color--{reference_property:_DecalColor3ThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _DecalColor3ThemeIndex ("", Int) = 0 _DecalEmissionStrength3 ("Emission Strength", Range(0, 20)) = 0 _DecalTexture3 ("Decal--{reference_properties:[_DecalTexture3Pan, _DecalTexture3UV]}", 2D) = "white" { } [HideInInspector][Vector2]_DecalTexture3Pan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DecalTexture3UV ("UV", Int) = 0 [ToggleUI]_DecalTiled3 ("Tiled?", Float) = 0 _Decal3Depth ("Depth", Float) = 0 [Vector2]_DecalScale3 ("Scale", Vector) = (1, 1, 0, 0) _DecalSideOffset3 ("Side Offset ←→↓↑", Vector) = (0, 0, 0, 0) [Vector2]_DecalPosition3 ("Position", Vector) = (.5, .5, 0, 0) _DecalRotation3 ("Rotation", Range(0, 360)) = 0 _DecalRotationSpeed3 ("Rotation Speed", Float) = 0 [ThryWideEnum(Replace, 0, Darken, 1, Multiply, 2, Color Burn, 3, Linear Burn, 4, Lighten, 5, Screen, 6, Color Dodge, 7, Linear Dodge (Add), 8, Overlay, 9, Soft Lighten, 10, Hard Light, 11, Vivid Light, 12, Linear Light, 13, Pin Light, 14, Hard Mix, 15, Difference, 16, Exclusion, 17, Subtract, 18, Divide, 19)]_DecalBlendType3 ("Blending", Range(0, 1)) = 0 _DecalBlendAlpha3 ("Alpha", Range(0,1)) = 1 [ToggleUI]_DecalOverideAlpha3 ("Override Alpha", Float) = 0 [ToggleUI]_DecalHueShiftEnabled3 ("Hue Shift Enabled", Float) = 0 _DecalHueShiftSpeed3 ("Shift Speed", Float) = 0 _DecalHueShift3 ("Hue Shift", Range(0,1)) = 0 _Decal3HueAngleStrength ("Hue Angle Power", Float) = 0 // Decal 3 Audio Link [HideInInspector] m_start_Decal3AudioLink ("Audio Link ♫--{ condition_showS:_EnableAudioLink==1}", Float) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal3ScaleBand ("Scale Band", Int) = 0 _AudioLinkDecal3Scale ("Scale Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal3SideBand ("Scale Band", Int) = 0 _AudioLinkDecal3SideMin ("Side Mod Min", Vector) = (0,0,0,0) _AudioLinkDecal3SideMax ("Side Mod Max", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal3RotationBand ("Rotation Band", Int) = 0 [Vector2]_AudioLinkDecal3Rotation ("Rotation Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal3AlphaBand ("Alpha Band", Int) = 0 [Vector2]_AudioLinkDecal3Alpha ("Alpha Mod", Vector) = (0,0,0,0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkDecal3EmissionBand ("Emission Band", Int) = 0 [Vector2]_AudioLinkDecal3Emission ("Emission Mod", Vector) = (0,0,0,0) [ToggleUI]_AudioLinkDecalX("CC Strip X", Float) = 0 [HideInInspector] m_end_Decal3AudioLink ("Audio Link", Float) = 0 [HideInInspector] m_end_Decal3 ("Decal 0", Float) = 0 [HideInInspector] m_end_DecalSection ("Decal", Float) = 0 [HideInInspector] m_start_GlobalThemes ("Global Themes", Float) = 0 _GlobalThemeColor0 ("Color 0", Color) = (1, 1, 1, 1) _GlobalThemeColor1 ("Color 1", Color) = (1, 1, 1, 1) _GlobalThemeColor2 ("Color 2", Color) = (1, 1, 1, 1) _GlobalThemeColor3 ("Color 3", Color) = (1, 1, 1, 1) [HideInInspector] m_end_GlobalThemes ("Global Themes", Float) = 0 // Lighting [HideInInspector] m_lightingCategory ("Shading", Float) = 0 [HideInInspector] m_start_PoiLightData ("Light Data ", Float) = 0 // Lighting Data _LightingAOMaps ("AO Maps (expand)--{reference_properties:[_LightingAOMapsPan, _LightingAOMapsUV,_LightDataAOStrengthR,_LightDataAOStrengthG,_LightDataAOStrengthB,_LightDataAOStrengthA]}", 2D) = "white" { } [HideInInspector][Vector2]_LightingAOMapsPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _LightingAOMapsUV ("UV", Int) = 0 [HideInInspector]_LightDataAOStrengthR ("R Strength", Range(0, 1)) = 1 [HideInInspector]_LightDataAOStrengthG ("G Strength", Range(0, 1)) = 0 [HideInInspector]_LightDataAOStrengthB ("B Strength", Range(0, 1)) = 0 [HideInInspector]_LightDataAOStrengthA ("A Strength", Range(0, 1)) = 0 _LightingDetailShadowMaps ("Detail Shadows (expand)--{reference_properties:[_LightingDetailShadowMapsPan, _LightingDetailShadowMapsUV,_LightingDetailShadowStrengthR,_LightingDetailShadowStrengthG,_LightingDetailShadowStrengthB,_LightingDetailShadowStrengthA]}", 2D) = "white" { } [HideInInspector][Vector2]_LightingDetailShadowMapsPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _LightingDetailShadowMapsUV ("UV", Int) = 0 [HideInInspector]_LightingDetailShadowStrengthR ("R Strength", Range(0, 1)) = 1 [HideInInspector]_LightingDetailShadowStrengthG ("G Strength", Range(0, 1)) = 0 [HideInInspector]_LightingDetailShadowStrengthB ("B Strength", Range(0, 1)) = 0 [HideInInspector]_LightingDetailShadowStrengthA ("A Strength", Range(0, 1)) = 0 _LightingShadowMasks ("Shadow Masks (expand)--{reference_properties:[_LightingShadowMasksPan, _LightingShadowMasksUV,_LightingShadowMaskStrengthR,_LightingShadowMaskStrengthG,_LightingShadowMaskStrengthB,_LightingShadowMaskStrengthA]}", 2D) = "white" { } [HideInInspector][Vector2]_LightingShadowMasksPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _LightingShadowMasksUV ("UV", Int) = 0 [HideInInspector]_LightingShadowMaskStrengthR ("R Strength", Range(0, 1)) = 1 [HideInInspector]_LightingShadowMaskStrengthG ("G Strength", Range(0, 1)) = 0 [HideInInspector]_LightingShadowMaskStrengthB ("B Strength", Range(0, 1)) = 0 [HideInInspector]_LightingShadowMaskStrengthA ("A Strength", Range(0, 1)) = 0 // Base Pass [Space(15)] [ThryHeaderLabel(Base Pass Lighting, 13)] [Space(4)] [Enum(Poi Custom, 0, Standard, 1, UTS2, 2)] _LightingColorMode ("Light Color Mode", Int) = 0 [Enum(Poi Custom, 0, Normalized NDotL, 1, Saturated NDotL, 2)] _LightingMapMode ("Light Map Mode", Int) = 0 [Enum(Poi Custom, 0, Forced Local Direction, 1, Forced World Direction, 2, UTS2, 3)] _LightingDirectionMode ("Light Direction Mode", Int) = 0 [Vector3]_LightngForcedDirection ("Forced Direction--{condition_showS:(_LightingDirectionMode==1)}", Vector) = (0, 0, 0) [ToggleUI]_LightingForceColorEnabled ("Force Light Color", Float) = 0 _LightingForcedColor ("Forced Color--{condition_showS:(_LightingForceColorEnabled==1), reference_property:_LightingForcedColorThemeIndex}", Color) = (1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _LightingForcedColorThemeIndex ("", Int) = 0 _Unlit_Intensity ("Unlit_Intensity--{condition_showS:(_LightingColorMode==2)}", Range(0.001, 4)) = 1 [ToggleUI]_LightingCapEnabled ("Limit Brightness", Float) = 1 _LightingCap ("Max Brightness--{condition_showS:(_LightingCapEnabled==1)}", Range(0, 10)) = 1 _LightingMinLightBrightness ("Min Brightness", Range(0, 1)) = 0 _LightingIndirectUsesNormals ("Indirect Uses Normals--{condition_showS:(_LightingColorMode==0)}", Range(0, 1)) = 0 _LightingCastedShadows ("Receive Casted Shadows", Range(0, 1)) = 0 _LightingMonochromatic ("Monochromatic Lighting?", Range(0, 1)) = 0 // Lighting Additive [Space(15)] [ThryHeaderLabel(Add Pass Lighting, 13)] [Space(4)] [ThryToggle(POI_LIGHT_DATA_ADDITIVE_ENABLE)]_LightingAdditiveEnable ("Enable Additive", Float) = 1 [ThryToggle(POI_LIGHT_DATA_ADDITIVE_DIRECTIONAL_ENABLE)]_DisableDirectionalInAdd ("Ignore Directional--{condition_showS:(_LightingAdditiveEnable==1)}", Float) = 1 [ToggleUI]_LightingAdditiveLimited ("Limit Brightness?--{condition_showS:(_LightingAdditiveEnable==1)}", Float) = 0 _LightingAdditiveLimit ("Max Brightness--{ condition_showS:(_LightingAdditiveLimited==1&&_LightingAdditiveEnable==1)}", Range(0, 10)) = 1 _LightingAdditivePassthrough ("Point Light Passthrough--{condition_showS:(_LightingAdditiveEnable==1)}", Range(0, 1)) = .5 // Vertex Lighting [Space(15)] [ThryHeaderLabel(Vertex Lighting, 13)] [Space(4)] [ThryToggle(POI_VERTEXLIGHT_ON)]_LightingVertexLightingEnabled ("Enabled", Float) = 1 // Lighting Data Debug [Space(15)] [ThryHeaderLabel(Debug Visualization, 13)] [Space(4)] [ThryToggle(POI_LIGHT_DATA_DEBUG)]_LightDataDebugEnabled ("Debug", Float) = 0 [ThryWideEnum(Direct Color, 0, Indirect Color, 1, Light Map, 2, Attenuation, 3, N Dot L, 4, Half Dir, 5, Direction, 6, Add Color, 7, Add Attenuation, 8, Add Shadow, 9, Add N Dot L, 10)] _LightingDebugVisualize ("Visualize--{condition_showS:(_LightDataDebugEnabled==1)}", Int) = 0 [HideInInspector] m_end_PoiLightData ("Light Data", Float) = 0 [HideInInspector] m_start_PoiShading (" Shading--{reference_property:_ShadingEnabled}", Float) = 0 [HideInInspector][ThryToggle(VIGNETTE_MASKED)]_ShadingEnabled ("Enable Shading", Float) = 1 [ThryHeaderLabel(Base Pass Shading, 13)] [Space(4)] [KeywordEnum(TextureRamp, MathRamp, Wrapped, Skin, ShadeMap, Flat, Realistic, )] _LightingMode ("Lighting Type", Float) = 5 _LightingShadowColor ("Shadow Tint--{condition_showS:(_LightingMode!=4)}", Color) = (1, 1, 1) [Gradient]_ToonRamp ("Lighting Ramp--{texture:{width:512,height:4,filterMode:Bilinear,wrapMode:Clamp},force_texture_options:true,condition_showS:(_LightingMode==0)}", 2D) = "white" { } _ShadowOffset ("Ramp Offset--{condition_showS:(_LightingMode==0)}", Range(-1, 1)) = 0 _LightingGradientStart ("Gradient Start--{condition_showS:(_LightingMode==1)}", Range(0, 1)) = 0 _LightingGradientEnd ("Gradient End--{condition_showS:(_LightingMode==1)}", Range(0, 1)) = .5 _LightingGradientStartWrap ("Gradient Start--{condition_showS:(_LightingMode==2)}", Range(0, 1)) = 0 _LightingGradientEndWrap ("Gradient End--{condition_showS:(_LightingMode==2)}", Range(0, 1)) = .5 // Shade Maps _1st_ShadeColor ("1st ShadeColor--{condition_showS:(_LightingMode==4)}", Color) = (1, 1, 1) _1st_ShadeMap ("1st ShadeMap--{reference_properties:[_1st_ShadeMapPan, _1st_ShadeMapUV, _Use_1stShadeMapAlpha_As_ShadowMask, _1stShadeMapMask_Inverse],condition_showS:(_LightingMode==4)}", 2D) = "white" { } [HideInInspector][Vector2]_1st_ShadeMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _1st_ShadeMapUV ("UV", Int) = 0 [HideInInspector][ToggleUI]_Use_1stShadeMapAlpha_As_ShadowMask ("1st ShadeMap.a As ShadowMask", Float) = 0 [HideInInspector][ToggleUI]_1stShadeMapMask_Inverse ("1st ShadeMapMask Inverse", Float) = 0 [ToggleUI] _Use_BaseAs1st ("Use BaseMap as 1st ShadeMap--{condition_showS:(_LightingMode==4)}", Float) = 0 _2nd_ShadeColor ("2nd ShadeColor--{condition_showS:(_LightingMode==4)}", Color) = (1, 1, 1, 1) _2nd_ShadeMap ("2nd ShadeMap--{reference_properties:[_2nd_ShadeMapPan, _2nd_ShadeMapUV, _Use_2ndShadeMapAlpha_As_ShadowMask, _2ndShadeMapMask_Inverse],condition_showS:(_LightingMode==4)}", 2D) = "white" { } [HideInInspector][Vector2]_2nd_ShadeMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _2nd_ShadeMapUV ("UV", Int) = 0 [HideInInspector][ToggleUI]_Use_2ndShadeMapAlpha_As_ShadowMask ("2nd ShadeMap.a As ShadowMask", Float) = 0 [HideInInspector][ToggleUI]_2ndShadeMapMask_Inverse ("2nd ShadeMapMask Inverse", Float) = 0 [ToggleUI] _Use_1stAs2nd ("Use 1st ShadeMap as 2nd_ShadeMap--{condition_showS:(_LightingMode==4)}", Float) = 0 _BaseColor_Step ("BaseColor_Step--{condition_showS:(_LightingMode==4)}", Range(0.01, 1)) = 0.5 _BaseShade_Feather ("Base/Shade_Feather--{condition_showS:(_LightingMode==4)}", Range(0.0001, 1)) = 0.0001 _ShadeColor_Step ("ShadeColor_Step--{condition_showS:(_LightingMode==4)}", Range(0, 1)) = 0 _1st2nd_Shades_Feather ("1st/2nd_Shades_Feather--{condition_showS:(_LightingMode==4)}", Range(0.0001, 1)) = 0.0001 [Enum(Replace, 0, Multiply, 1)]_ShadingShadeMapBlendType ("Blend Mode", Int) = 0 //DJ Wrapped _LightingWrappedWrap ("Wrap--{condition_showS:(_LightingMode==2)}", Range(0, 2)) = 0 _LightingWrappedNormalization ("Normalization--{condition_showS:(_LightingMode==2)}", Range(0, 1)) = 0 // Realistic _LightingStandardSmoothness ("Smoothness--{condition_showS:(_LightingMode==6)}", Range(0, 1)) = 0 // Skin Shading _SkinLUT ("LUT--{condition_showS:(_LightingMode==3)}", 2D) = "white" { } _SssScale ("Scale--{condition_showS:(_LightingMode==3)}", Range(0, 1)) = 1 [HideInInspector]_SssBumpBlur ("Bump Blur--{condition_showS:(_LightingMode==3)}", Range(0, 1)) = 0.7 [HideInInspector][Vector3]_SssTransmissionAbsorption ("Absorption--{condition_showS:(_LightingMode==3)}", Vector) = (-8, -40, -64, 0) [HideInInspector][Vector3]_SssColorBleedAoWeights ("AO Color Bleed--{condition_showS:(_LightingMode==3)}", Vector) = (0.4, 0.15, 0.13, 0) // Generic _ShadowStrength ("Shadow Strength--{condition_showS:(_LightingMode<=3)}", Range(0, 1)) = 1 _LightingIgnoreAmbientColor ("Ignore Ambient Color--{condition_showS:(_LightingMode<=3)}", Range(0, 1)) = 0 // Additive [Space(15)] [ThryHeaderLabel(Add Pass Shading, 13)] [Space(4)] [Enum(Realistic, 0, Toon, 1, Wrapped soon.jpg, 2)] _LightingAdditiveType ("Lighting Type", Int) = 1 _LightingAdditiveGradientStart ("Gradient Start", Range(0, 1)) = 0 _LightingAdditiveGradientEnd ("Gradient End", Range(0, 1)) = .5 //_LightingAdditiveDetailStrength ("Detail Shadow Strength", Range(0, 1)) = 1 //TODO-implement this [ToggleUI]_LightingAdditiveLimitIntensity ("Limit Intensity", Float) = 0 _LightingAdditiveMaxIntensity ("Max Intensity--{condition_show:{type:PROPERTY_BOOL,data:_LightingAdditiveLimitIntensity==1}}", Range(0, 10)) = 1 [HideInInspector] m_end_PoiShading ("Shading", Float) = 0 // First Matcap [HideInInspector] m_start_matcap ("Matcap / Sphere Textures--{reference_property:_MatcapEnable}", Float) = 0 [HideInInspector][ThryToggle(POI_MATCAP0)]_MatcapEnable ("Enable Matcap", Float) = 0 [ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _MatcapUVMode ("UV Mode", Int) = 1 _MatcapColor ("Color--{reference_property:_MatcapColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _MatcapColorThemeIndex ("", Int) = 0 [TextureNoSO]_Matcap ("Matcap", 2D) = "white" { } _MatcapBorder ("Border", Range(0, .5)) = 0.43 _MatcapMask ("Mask--{reference_properties:[_MatcapMaskPan, _MatcapMaskUV, _MatcapMaskInvert]}", 2D) = "white" { } [HideInInspector][Vector2]_MatcapMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _MatcapMaskUV ("UV", Int) = 0 [HideInInspector][ToggleUI]_MatcapMaskInvert ("Invert", Float) = 0 _MatcapEmissionStrength ("Emission Strength", Range(0, 20)) = 0 _MatcapIntensity ("Intensity", Range(0, 5)) = 1 _MatcapLightMask ("Hide in Shadow", Range(0, 1)) = 0 _MatcapReplace ("Replace With Matcap", Range(0, 1)) = 1 _MatcapMultiply ("Multiply Matcap", Range(0, 1)) = 0 _MatcapAdd ("Add Matcap", Range(0, 1)) = 0 _MatcapAlphaOverride ("Override Alpha", Range(0, 1)) = 0 [Enum(Vertex, 0, Pixel, 1)] _MatcapNormal ("Normal to use", Int) = 1 [Space(10)] [ThryHeaderLabel(Custom Normal, 13)] [Space(4)] [ThryToggle(POI_MATCAP0_CUSTOM_NORMAL)]_Matcap0CustomNormal ("Custom Normal", Float) = 0 [Normal]_Matcap0NormalMap ("Normal Map--{reference_properties:[_Matcap0NormalMapPan, _Matcap0NormalMapUV, _Matcap0NormalMapScale]}", 2D) = "bump" { } [HideInInspector][Vector2]_Matcap0NormalMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap0NormalMapUV ("UV", Int) = 0 [HideInInspector]_Matcap0NormalMapScale ("Intensity", Range(0, 10)) = 1 [Space(10)] [ThryHeaderLabel(Hue Shift, 13)] [Space(4)] [ToggleUI]_MatcapHueShiftEnabled ("Enabled", Float) = 0 _MatcapHueShiftSpeed ("Shift Speed", Float) = 0 _MatcapHueShift ("Hue Shift", Range(0, 1)) = 0 [HideInInspector] m_end_matcap ("Matcap", Float) = 0 // Second Matcap [HideInInspector] m_start_Matcap2 ("Matcap 2--{reference_property:_Matcap2Enable}", Float) = 0 [HideInInspector][ThryToggle(COLOR_GRADING_HDR_3D)]_Matcap2Enable ("Enable Matcap 2", Float) = 0 [ThryWideEnum(UTS Style, 0, Top Pinch, 1, Double Sided, 2)] _Matcap2UVMode ("UV Mode", Int) = 1 _Matcap2Color ("Color--{reference_property:_Matcap2ColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _Matcap2ColorThemeIndex ("", Int) = 0 [TextureNoSO]_Matcap2 ("Matcap", 2D) = "white" { } _Matcap2Border ("Border", Range(0, .5)) = 0.43 _Matcap2Mask ("Mask--{reference_properties:[_Matcap2MaskPan, _Matcap2MaskUV, _Matcap2MaskInvert]}", 2D) = "white" { } [HideInInspector][Vector2]_Matcap2MaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap2MaskUV ("UV", Int) = 0 [HideInInspector][ToggleUI]_Matcap2MaskInvert ("Invert", Float) = 0 _Matcap2EmissionStrength ("Emission Strength", Range(0, 20)) = 0 _Matcap2Intensity ("Intensity", Range(0, 5)) = 1 _Matcap2LightMask ("Hide in Shadow", Range(0, 1)) = 0 _Matcap2Replace ("Replace With Matcap", Range(0, 1)) = 0 _Matcap2Multiply ("Multiply Matcap", Range(0, 1)) = 0 _Matcap2Add ("Add Matcap", Range(0, 1)) = 0 _Matcap2AlphaOverride ("Override Alpha", Range(0, 1)) = 0 [Enum(Vertex, 0, Pixel, 1)] _Matcap2Normal ("Normal to use", Int) = 1 [Space(10)] [ThryHeaderLabel(Custom Normal, 13)] [Space(4)] [ThryToggle(POI_MATCAP1_CUSTOM_NORMAL)]_Matcap1CustomNormal ("Custom Normal", Float) = 0 [Normal]_Matcap1NormalMap ("Normal Map--{reference_properties:[_Matcap1NormalMapPan, _Matcap1NormalMapUV, _Matcap1NormalMapScale]}", 2D) = "bump" { } [HideInInspector][Vector2]_Matcap1NormalMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _Matcap1NormalMapUV ("UV", Int) = 0 [HideInInspector]_Matcap1NormalMapScale ("Intensity", Range(0, 10)) = 1 [Space(10)] [ThryHeaderLabel(Hue Shift, 13)] [Space(4)] [ToggleUI]_Matcap2HueShiftEnabled ("Enabled", Float) = 0 _Matcap2HueShiftSpeed ("Shift Speed", Float) = 0 _Matcap2HueShift ("Hue Shift", Range(0, 1)) = 0 [HideInInspector] m_end_Matcap2 ("Matcap 2", Float) = 0 // First CubeMap [HideInInspector] m_start_CubeMap ("CubeMap--{reference_property:_CubeMapEnabled}", Float) = 0 [HideInInspector][ThryToggle(_CUBEMAP)]_CubeMapEnabled ("Enable CubeMap", Float) = 0 [ThryWideEnum(Skybox, 0, Reflection, 1)] _CubeMapUVMode ("UV Mode", Int) = 1 _CubeMapColor ("Color--{reference_property:_CubeMapColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _CubeMapColorThemeIndex ("", Int) = 0 [TextureNoSO]_CubeMap ("CubeMap", Cube) = "" { } _CubeMapMask ("Mask--{reference_properties:[_CubeMapMaskPan, _CubeMapMaskUV, _CubeMapMaskInvert]}", 2D) = "white" { } [HideInInspector][Vector2]_CubeMapMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _CubeMapMaskUV ("UV", Int) = 0 [HideInInspector][ToggleUI]_CubeMapMaskInvert ("Invert", Float) = 0 _CubeMapEmissionStrength ("Emission Strength", Range(0, 20)) = 0 _CubeMapIntensity ("Color Strength", Range(0, 5)) = 1 _CubeMapLightMask ("Hide in Shadow", Range(0, 1)) = 0 _CubeMapReplace ("Replace With CubeMap", Range(0, 1)) = 1 _CubeMapMultiply ("Multiply CubeMap", Range(0, 1)) = 0 _CubeMapAdd ("Add CubeMap", Range(0, 1)) = 0 [Enum(Vertex, 0, Pixel, 1)] _CubeMapNormal ("Normal to use", Int) = 1 [Space(10)] [ThryHeaderLabel(Hue Shift, 13)] [Space(4)] [ToggleUI]_CubeMapHueShiftEnabled ("Enabled", Float) = 0 _CubeMapHueShiftSpeed ("Shift Speed--{condition_showS:(_CubeMapHueShiftEnabled==1)}", Float) = 0 _CubeMapHueShift ("Hue Shift--{condition_showS:(_CubeMapHueShiftEnabled==1)}", Range(0, 1)) = 0 [HideInInspector] m_end_CubeMap ("CubeMap", Float) = 0 // Rim Lighting [HideInInspector] m_start_rimLightOptions ("Rim Lighting--{reference_property:_EnableRimLighting}", Float) = 0 [HideInInspector][ThryToggle(_GLOSSYREFLECTIONS_OFF)]_EnableRimLighting ("Enable Rim Lighting", Float) = 0 [Enum(vertex, 0, pixel, 1)] _RimLightNormal ("Normal Select", Int) = 1 [ToggleUI]_RimLightingInvert ("Invert Rim Lighting", Float) = 0 _RimLightColor ("Rim Color--{reference_property:_RimLightColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _RimLightColorThemeIndex ("", Int) = 0 _RimWidth ("Rim Width", Range(0, 1)) = 0.8 _RimSharpness ("Rim Sharpness", Range(0, 1)) = .25 _RimStrength ("Rim Emission", Range(0, 20)) = 0 _RimBrighten ("Rim Color Brighten", Range(0, 3)) = 0 _RimLightColorBias ("Rim Color Bias", Range(0, 1)) = 1 _RimTex ("Rim Texture--{reference_properties:[_RimTexPan, _RimTexUV]}", 2D) = "white" { } [HideInInspector][Vector2]_RimTexPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _RimTexUV ("UV", Int) = 0 _RimMask ("Rim Mask--{reference_properties:[_RimMaskPan, _RimMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_RimMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _RimMaskUV ("UV", Int) = 0 [Space(10)] [ThryToggleUI(true)] _RimHueShiftEnabled ("<size=13><b> Hue Shift</b></size>", Float) = 0 _RimHueShiftSpeed ("Shift Speed--{condition_showS:(_RimHueShiftEnabled==1)}", Float) = 0 _RimHueShift ("Hue Shift--{condition_showS:(_RimHueShiftEnabled==1)}", Range(0, 1)) = 0 [HideInInspector] m_end_rimLightOptions ("Rim Lighting", Float) = 0 [HideInInspector] m_start_brdf ("Reflections & Specular--{reference_property:_MochieBRDF}", Float) = 0 [HideInInspector][ThryToggle(MOCHIE_PBR)]_MochieBRDF ("Enable", Float) = 0 _MochieReflectionStrength ("Reflections", Range(0, 1)) = 1 _MochieSpecularStrength ("Specular", Range(0, 1)) = 1 _MochieMetallicMultiplier ("Metallic", Range(0, 1)) = 0 _MochieRoughnessMultiplier ("Roughness", Range(0, 1)) = 1 _MochieReflectionTint ("Reflection Tint--{reference_property:_MochieReflectionTintThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _MochieReflectionTintThemeIndex ("", Int) = 0 _MochieSpecularTint ("Specular Tint--{reference_property:_MochieSpecularTintThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _MochieSpecularTintThemeIndex ("", Int) = 0 [Space(8)] [ThryTexture]_MochieMetallicMap ("Metallic Map (B)--{reference_properties:[_MochieMetallicMapPan, _MochieMetallicMapUV, _MochieMetallicMapInvert]}", 2D) = "white" { } [HideInInspector][Vector2]_MochieMetallicMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ToggleUI]_MochieMetallicMapInvert ("Invert", Float) = 0 [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_MochieMetallicMapUV ("UV", Int) = 0 [ThryTexture]_MochieRoughnessMap ("Roughness Map (G)--{reference_properties:[_MochieRoughnessMapPan, _MochieRoughnessMapUV, _MochieRoughnessMapInvert]}", 2D) = "white" { } [HideInInspector][Vector2]_MochieRoughnessMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ToggleUI]_MochieRoughnessMapInvert ("Invert", Float) = 0 [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_MochieRoughnessMapUV ("UV", Int) = 0 [ThryTexture]_MochieReflectionMask ("Reflection Mask (R)--{reference_properties:[_MochieReflectionMaskPan, _MochieReflectionMaskUV, _MochieReflectionMaskInvert]}", 2D) = "white" { } [HideInInspector][Vector2]_MochieReflectionMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ToggleUI]_MochieReflectionMaskInvert ("Invert", Float) = 0 [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_MochieReflectionMaskUV ("UV", Int) = 0 [ThryTexture]_MochieSpecularMask ("Specular Mask (R)--{reference_properties:[_MochieSpecularMaskPan, _MochieSpecularMaskUV, _MochieSpecularMaskInvert]}", 2D) = "white" { } [HideInInspector][Vector2]_MochieSpecularMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ToggleUI]_MochieSpecularMaskInvert ("Invert", Float) = 0 [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_MochieSpecularMaskUV ("UV", Int) = 0 [Space(8)] [ThryTexture][NoScaleOffset]_MochieReflCube ("Fallback Cubemap", Cube) = "" { } [ToggleUI]_MochieForceFallback ("Force Fallback", Int) = 0 [ToggleUI]_MochieLitFallback ("Lit Fallback", Float) = 0 [HideInInspector] m_end_brdf ("", Float) = 0 [HideInInspector] m_start_clearCoat ("Clear Coat--{reference_property:_EnableClearCoat}", Float) = 0 [HideInInspector][ThryToggle(_COLORCOLOR_ON)]_EnableClearCoat ("Enable Clear Coat", Float) = 0 _ClearCoatSmoothnessMap ("Smoothness Map--{reference_properties:[_ClearCoatSmoothnessMapPan, _ClearCoatSmoothnessMapUV, _ClearCoatInvertSmoothness]}", 2D) = "white" { } [HideInInspector][Vector2]_ClearCoatSmoothnessMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_ClearCoatSmoothnessMapUV ("UV", Int) = 0 [HideInInspector][ToggleUI]_ClearCoatInvertSmoothness ("Invert Smoothness", Range(0, 1)) = 0 _ClearCoatMask ("Mask--{reference_properties:[_ClearCoatMaskPan, _ClearCoatMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_ClearCoatMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_ClearCoatMaskUV ("UV", Int) = 0 [NoScaleOffset]_ClearCoatCubeMap ("Fallback Cubemap", Cube) = "" { } [ThryWideEnum(Vertex, 0, Pixel, 1)]_ClearCoatNormal("Normal Select", Int) = 0 _ClearCoatTint ("Reflection Tint--{reference_property:_ClearCoatTintThemeIndex}", Color) = (1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _ClearCoatTintThemeIndex ("", Int) = 0 _ClearCoat ("Clear Coat", Range(0, 1)) = 1 _ClearCoatSmoothness ("Smoothness", Range(0, 1)) = 0 [ToggleUI]_ClearCoatSampleWorld ("World Reflections", Int) = 1 [ToggleUI]_ClearCoatForceLighting ("Force Lighting", Int) = 0 [HideInInspector] m_end_clearCoat ("Clear Coat", Float) = 0 [HideInInspector] m_start_reflectionRim ("Environmental Rim--{reference_property:_EnableEnvironmentalRim}", Float) = 0 [HideInInspector][ThryToggle(POI_ENVIRORIM)]_EnableEnvironmentalRim ("Enable", Float) = 0 _RimEnviroMask ("Mask--{reference_properties:[_RimEnviroMaskPan, _RimEnviroMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_RimEnviroMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_RimEnviroMaskUV ("UV", Int) = 0 _RimEnviroBlur ("Blur", Range(0, 1)) = 0.7 _RimEnviroWidth ("Rim Width", Range(0, 1)) = 0.45 _RimEnviroSharpness ("Rim Sharpness", Range(0, 1)) = 0 _RimEnviroMinBrightness ("Min Brightness Threshold", Range(0, 2)) = 0 _RimEnviroIntensity ("Intensity", Range(0, 1)) = 1 [HideInInspector] m_end_reflectionRim ("", Float) = 0 [HideInInspector] m_start_stylizedSpec (" Stylized Specular--{reference_property:_StylizedSpecular}", Float) = 0 [HideInInspector][ThryToggle(POI_STYLIZED_StylizedSpecular)]_StylizedSpecular ("Enable", Float) = 0 [ThryTexture]_HighColor_Tex ("Specular Map--{reference_properties:[_HighColor_TexPan, _HighColor_TexUV]}", 2D) = "white" { } [HideInInspector][Vector2]_HighColor_TexPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_HighColor_TexUV ("UV", Int) = 0 _HighColor ("Tint--{reference_property:_HighColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _HighColorThemeIndex ("", Int) = 0 _Set_HighColorMask ("Mask--{reference_properties:[_Set_HighColorMaskPan, _Set_HighColorMaskUV, _Tweak_HighColorMaskLevel]}", 2D) = "white" { } [HideInInspector][Vector2]_Set_HighColorMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_Set_HighColorMaskUV ("UV", Int) = 0 [HideInInspector]_Tweak_HighColorMaskLevel ("Mask Level", Range(-1, 1)) = 0 [ThryWideEnum(Toon, 0, Realistic, 1)]_Is_SpecularToHighColor ("Specular Mode", Float) = 0 [ThryWideEnum(Replace, 0, Add, 1)]_Is_BlendAddToHiColor ("Color Blend Mode", Int) = 0 _StylizedSpecularStrength ("Strength", Float) = 1 [ToggleUI] _UseLightColor ("Use Light Color", Float) = 1 [Space(8)] [ThryHeaderLabel(Layer 1, 13)] _HighColor_Power ("Size", Range(0, 1)) = 0.2 _StylizedSpecularFeather ("Feather", Range(0, 1)) = 0 _Layer1Strength ("Strength", Range(0, 1)) = 1 [Space(8)] [ThryHeaderLabel(Layer 2, 13)] _Layer2Size ("Size", Range(0, 1)) = 0 _StylizedSpecular2Feather ("Feather", Range(0, 1)) = 0 _Layer2Strength ("Strength", Range(0, 1)) = 0 [HideInInspector] m_end_stylizedSpec ("", Float) = 0 // Rendering Options [HideInInspector] m_specialFXCategory ("Special FX", Float) = 0 // SPECIALFX_PROPERTIES // UDIM Discard [HideInInspector] m_start_udimdiscardOptions ("UDIM Discard--{reference_property:_EnableUDIMDiscardOptions}", Float) = 0 [HideInInspector][ThryToggle(POI_UDIMDISCARD)]_EnableUDIMDiscardOptions ("Enable UDIM Discard Options", Float) = 0 [ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3)]_UDIMDiscardUV ("Discard UV", Int) = 0 [Enum(Vertex, 0, Pixel, 1)] _UDIMDiscardMode ("Discard Mode", Int) = 1 [Vector4Toggles]_UDIMDiscardRow3 ("y = 3", Vector) = (1,1,1,1) [Vector4Toggles]_UDIMDiscardRow2 ("y = 2", Vector) = (1,1,1,1) [Vector4Toggles]_UDIMDiscardRow1 ("y = 1", Vector) = (1,1,1,1) [Vector4Toggles]_UDIMDiscardRow0 ("y = 0", Vector) = (1,1,1,1) [HideInInspector] m_end_udimdiscardOptions ("UDIM Discard", Float) = 0 // Dissolve [HideInInspector] m_start_dissolve ("Dissolve--{reference_property:_EnableDissolve}", Float) = 0 [HideInInspector][ThryToggle(DISTORT)]_EnableDissolve ("Enable Dissolve", Float) = 0 [Enum(Basic, 1, Point2Point, 2)] _DissolveType ("Dissolve Type", Int) = 1 _DissolveEdgeWidth ("Edge Width", Range(0, .5)) = 0.025 _DissolveEdgeHardness ("Edge Hardness", Range(0, 1)) = 0.5 _DissolveEdgeColor ("Edge Color--{reference_property:_DissolveEdgeColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _DissolveEdgeColorThemeIndex ("", Int) = 0 [Gradient]_DissolveEdgeGradient ("Edge Gradient", 2D) = "white" { } _DissolveEdgeEmission ("Edge Emission", Range(0, 20)) = 0 _DissolveTextureColor ("Dissolved Color--{reference_property:_DissolveTextureColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _DissolveTextureColorThemeIndex ("", Int) = 0 _DissolveToTexture ("Dissolved Texture--{reference_properties:[_DissolveToTexturePan, _DissolveToTextureUV]}", 2D) = "white" { } [HideInInspector][Vector2]_DissolveToTexturePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DissolveToTextureUV ("UV", Int) = 0 _DissolveToEmissionStrength ("Dissolved Emission Strength", Range(0, 20)) = 0 _DissolveNoiseTexture ("Dissolve Gradient--{reference_properties:[_DissolveNoiseTexturePan, _DissolveNoiseTextureUV]}", 2D) = "white" { } [HideInInspector][Vector2]_DissolveNoiseTexturePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DissolveNoiseTextureUV ("UV", Int) = 0 [HideInInspector][ToggleUI]_DissolveInvertNoise ("Invert?", Float) = 0 _DissolveDetailNoise ("Dissolve Noise--{reference_properties:[_DissolveDetailNoisePan, _DissolveDetailNoiseUV]}", 2D) = "black" { } [HideInInspector][Vector2]_DissolveDetailNoisePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DissolveDetailNoiseUV ("UV", Int) = 0 [HideInInspector][ToggleUI]_DissolveInvertDetailNoise ("Invert?", Float) = 0 _DissolveDetailStrength ("Dissolve Detail Strength", Range(0, 1)) = 0.1 _DissolveAlpha ("Dissolve Alpha", Range(0, 1)) = 0 _DissolveMask ("Dissolve Mask--{reference_properties:[_DissolveMaskPan, _DissolveMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_DissolveMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DissolveMaskUV ("UV", Int) = 0 [ToggleUI]_DissolveUseVertexColors ("VertexColor.g Mask", Float) = 0 [HideInInspector][ToggleUI]_DissolveMaskInvert ("Invert?", Float) = 0 _ContinuousDissolve ("Continuous Dissolve Speed", Float) = 0 // Point to Point Dissolve [HideInInspector] m_start_pointToPoint ("point to point--{condition_showS:(_DissolveType==2)}", Float) = 0 [Enum(Local, 0, World, 1, Vertex Colors, 2)] _DissolveP2PWorldLocal ("World/Local", Int) = 0 _DissolveP2PEdgeLength ("Edge Length", Float) = 0.1 [Vector3]_DissolveStartPoint ("Start Point", Vector) = (0, -1, 0, 0) [Vector3]_DissolveEndPoint ("End Point", Vector) = (0, 1, 0, 0) [HideInInspector] m_end_pointToPoint ("Point To Point", Float) = 0 [HideInInspector] m_start_dissolveHueShift ("Hue Shift--{reference_property:_DissolveHueShiftEnabled}", Float) = 0 [HideInInspector][ToggleUI]_DissolveHueShiftEnabled ("Dissolved Enabled", Float) = 0 _DissolveHueShiftSpeed ("Dissolved Speed", Float) = 0 _DissolveHueShift ("Dissolved Shift", Range(0, 1)) = 0 [ToggleUI]_DissolveEdgeHueShiftEnabled ("Edge Enabled", Float) = 0 _DissolveEdgeHueShiftSpeed ("Edge Speed", Float) = 0 _DissolveEdgeHueShift ("Edge Shift", Range(0, 1)) = 0 [HideInInspector] m_end_dissolveHueShift ("Hue Shift", Float) = 0 // Locked in anim sldiers [HideInInspector] m_start_BonusSliders ("Locked In Anim Sliders", Float) = 0 _DissolveAlpha0 ("Dissolve Alpha 0", Range(-1, 1)) = 0 _DissolveAlpha1 ("Dissolve Alpha 1", Range(-1, 1)) = 0 _DissolveAlpha2 ("Dissolve Alpha 2", Range(-1, 1)) = 0 _DissolveAlpha3 ("Dissolve Alpha 3", Range(-1, 1)) = 0 _DissolveAlpha4 ("Dissolve Alpha 4", Range(-1, 1)) = 0 _DissolveAlpha5 ("Dissolve Alpha 5", Range(-1, 1)) = 0 _DissolveAlpha6 ("Dissolve Alpha 6", Range(-1, 1)) = 0 _DissolveAlpha7 ("Dissolve Alpha 7", Range(-1, 1)) = 0 _DissolveAlpha8 ("Dissolve Alpha 8", Range(-1, 1)) = 0 _DissolveAlpha9 ("Dissolve Alpha 9", Range(-1, 1)) = 0 [HideInInspector] m_end_BonusSliders ("Locked In Sliders", Float) = 0 [HideInInspector] m_end_dissolve ("Dissolve", Float) = 0 // Flipbook [HideInInspector] m_start_flipBook ("Flipbook--{reference_property:_EnableFlipbook}", Float) = 0 [HideInInspector][ThryToggle(_SUNDISK_HIGH_QUALITY)]_EnableFlipbook ("Enable Flipbook", Float) = 0 [ToggleUI]_FlipbookAlphaControlsFinalAlpha ("Flipbook Controls Alpha?", Float) = 0 [ToggleUI]_FlipbookIntensityControlsAlpha ("Intensity Controls Alpha?", Float) = 0 [ToggleUI]_FlipbookColorReplaces ("Color Replaces Flipbook", Float) = 0 [TextureArray]_FlipbookTexArray ("Texture Array--{reference_properties:[_FlipbookTexArrayPan, _FlipbookTexArrayUV]}", 2DArray) = "" { } [HideInInspector][Vector2]_FlipbookTexArrayPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _FlipbookTexArrayUV ("UV", Int) = 0 _FlipbookMask ("Mask--{reference_properties:[_FlipbookMaskPan, _FlipbookMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_FlipbookMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _FlipbookMaskUV ("UV", Int) = 0 _FlipbookColor ("Color & alpha--{reference_property:_FlipbookColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _FlipbookColorThemeIndex ("", Int) = 0 _FlipbookTotalFrames ("Total Frames", Float) = 1 _FlipbookFPS ("FPS", Float) = 30.0 _FlipbookScaleOffset ("Scale | Offset", Vector) = (1, 1, 0, 0) _FlipbookSideOffset ("Side Offset ←→↓↑", Vector) = (0, 0, 0, 0) [ToggleUI]_FlipbookTiled ("Tiled?", Float) = 0 _FlipbookEmissionStrength ("Emission Strength", Range(0, 20)) = 0 _FlipbookRotation ("Rotation", Range(0, 360)) = 0 _FlipbookRotationSpeed ("Rotation Speed", Float) = 0 _FlipbookReplace ("Replace", Range(0, 1)) = 1 _FlipbookMultiply ("Multiply", Range(0, 1)) = 0 _FlipbookAdd ("Add", Range(0, 1)) = 0 //Flipbook audio link [HideInInspector] m_start_FlipbookAudioLink ("Audio Link ♫--{ condition_showS:_EnableAudioLink==1}", Float) = 0 [ToggleUI]_FlipbookChronotensityEnabled ("Chronotensity?", Float) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _FlipbookChronotensityBand ("Band", Int) = 0 _FlipbookChronotensitySpeed ("Chrono Speed", Range(0,1)) = 1 [HideInInspector] m_end_FlipbookAudioLink ("Audio Link", Float) = 0 // Flipbook Manual Control [HideInInspector] m_start_manualFlipbookControl ("Manual Control", Float) = 0 _FlipbookCurrentFrame ("Current Frame", Float) = -1 [HideInInspector] m_end_manualFlipbookControl ("Manual Control", Float) = 0 [HideInInspector] m_start_crossfade ("Crossfade", Float) = 0 [ToggleUI]_FlipbookCrossfadeEnabled ("Enable Crossfade?", Float) = 0 [MultiSlider]_FlipbookCrossfadeRange ("Fade Range", Vector) = (0.75, 1, 0, 1) [HideInInspector] m_end_crossfade ("Crossfade", Float) = 0 [HideInInspector] m_start_flipbookHueShift ("Hue Shift", Float) = 0 [ToggleUI]_FlipbookHueShiftEnabled ("Enabled", Float) = 0 _FlipbookHueShiftSpeed ("Shift Speed", Float) = 0 _FlipbookHueShift ("Hue Shift", Range(0, 1)) = 0 [HideInInspector] m_end_flipbookHueShift ("Hue Shift", Float) = 0 [HideInInspector] m_end_flipBook ("Flipbook", Float) = 0 //TODO Add inverts to the masks //Emission 1 [HideInInspector] m_start_emissions ("Emissions", Float) = 0 [HideInInspector] m_start_emissionOptions ("Emission 0--{reference_property:_EnableEmission}", Float) = 0 [HideInInspector][ThryToggle(_EMISSION)]_EnableEmission ("Enable Emission", Float) = 0 [ToggleUI]_EmissionReplace0 ("Replace Base Color", Float) = 0 [HDR]_EmissionColor ("Emission Color--{reference_property:_EmissionColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _EmissionColorThemeIndex ("", Int) = 0 [Gradient]_EmissionMap ("Emission Map--{reference_properties:[_EmissionMapPan, _EmissionMapUV]}", 2D) = "white" { } [HideInInspector][Vector2]_EmissionMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _EmissionMapUV ("UV", Int) = 0 [ToggleUI]_EmissionBaseColorAsMap ("Base Color as Map?", Float) = 0 _EmissionMask ("Emission Mask--{reference_properties:[_EmissionMaskPan, _EmissionMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_EmissionMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _EmissionMaskUV ("UV", Int) = 0 _EmissionStrength ("Emission Strength", Range(0, 20)) = 0 [Space(10)] [ThryToggleUI(true)]_EmissionHueShiftEnabled ("<size=13><b> Hue Shift</b></size>", Float) = 0 _EmissionHueShift ("Hue Shift--{condition_showS:(_EmissionHueShiftEnabled==1)}", Range(0, 1)) = 0 _EmissionHueShiftSpeed ("Hue Shift Speed--{condition_showS:(_EmissionHueShiftEnabled==1)}", Float) = 0 // Center out emission [Space(10)] [ThryToggleUI(true)]_EmissionCenterOutEnabled ("<size=13><b> Center Out</b></size>", Float) = 0 _EmissionCenterOutSpeed ("Flow Speed--{condition_showS:(_EmissionCenterOutEnabled==1)}", Float) = 5 // Glow in the dark Emission [Space(10)] [ThryToggleUI(true)]_EnableGITDEmission ("<size=13><b> Light Based</b></size>", Float) = 0 [Enum(World, 0, Mesh, 1)] _GITDEWorldOrMesh ("Lighting Type--{condition_showS:(_EnableGITDEmission==1)}", Int) = 0 _GITDEMinEmissionMultiplier ("Min Emission Multiplier--{condition_showS:(_EnableGITDEmission==1)}", Range(0, 1)) = 1 _GITDEMaxEmissionMultiplier ("Max Emission Multiplier--{condition_showS:(_EnableGITDEmission==1)}", Range(0, 1)) = 0 _GITDEMinLight ("Min Lighting--{condition_showS:(_EnableGITDEmission==1)}", Range(0, 1)) = 0 _GITDEMaxLight ("Max Lighting--{condition_showS:(_EnableGITDEmission==1)}", Range(0, 1)) = 1 // Blinking Emission [Space(10)] [ThryToggleUI(true)]_EmissionBlinkingEnabled ("<size=13><b> Blinking</b></size>", Float) = 0 _EmissiveBlink_Min ("Emissive Blink Min--{condition_showS:(_EmissionBlinkingEnabled==1)}", Float) = 0 _EmissiveBlink_Max ("Emissive Blink Max--{condition_showS:(_EmissionBlinkingEnabled==1)}", Float) = 1 _EmissiveBlink_Velocity ("Emissive Blink Velocity--{condition_showS:(_EmissionBlinkingEnabled==1)}", Float) = 4 _EmissionBlinkingOffset ("Offset--{condition_showS:(_EmissionBlinkingEnabled==1)}", Float) = 0 // Scrolling Emission [Space(10)] [ThryToggleUI(true)] _ScrollingEmission ("<size=13><b> Scrolling</b></size>", Float) = 0 [ToggleUI]_EmissionScrollingUseCurve ("Use Curve--{condition_showS:(_ScrollingEmission==1)}", float) = 0 [Curve]_EmissionScrollingCurve ("Curve--{condition_showS:(_ScrollingEmission==1&&_EmissionScrollingUseCurve==1)}", 2D) = "white" { } [ToggleUI]_EmissionScrollingVertexColor ("VColor as position--{condition_showS:(_ScrollingEmission==1)}", float) = 0 _EmissiveScroll_Direction ("Direction--{condition_showS:(_ScrollingEmission==1)}", Vector) = (0, -10, 0, 0) _EmissiveScroll_Width ("Width--{condition_showS:(_ScrollingEmission==1)}", Float) = 10 _EmissiveScroll_Velocity ("Velocity--{condition_showS:(_ScrollingEmission==1)}", Float) = 10 _EmissiveScroll_Interval ("Interval--{condition_showS:(_ScrollingEmission==1)}", Float) = 20 _EmissionScrollingOffset ("Offset--{condition_showS:(_ScrollingEmission==1)}", Float) = 0 [Space(10)] [ThryToggleUI(true)] _EmissionAL0Enabled ("<size=13><b> Audio Link</b></size>--{ condition_showS:_EnableAudioLink==1}", Float) = 0 [Vector2]_EmissionAL0StrengthMod ("Emission Strength Add--{ condition_showS:(_EmissionAL0Enabled==1 && _EnableAudioLink==1)}", Vector) = (0, 0, 0, 0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _EmissionAL0StrengthBand ("Emission Add Band--{ condition_showS:(_EmissionAL0Enabled==1 && _EnableAudioLink==1)}", Int) = 0 [Vector2] _AudioLinkEmission0CenterOut ("Center Out--{ condition_showS:(_EmissionAL0Enabled==1 && _EnableAudioLink==1)}", Vector) = (0, 0, 0, 0) _AudioLinkEmission0CenterOutwidth ("Center Out Duration--{ condition_showS:(_EmissionAL0Enabled==1 && _EnableAudioLink==1)}", Range(0, 1)) = 1 _AudioLinkEmission0CenterOutSize ("Wave Size--{ condition_showS:(_EmissionAL0Enabled==1 && _EnableAudioLink==1)}", Range(0, 1)) = 1 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkEmission0CenterOutBand ("Center Out Band--{ condition_showS:(_EmissionAL0Enabled==1 && _EnableAudioLink==1)}", Int) = 0 [HideInInspector] m_end_emissionOptions ("", Float) = 0 // Second Emission [HideInInspector] m_start_emission1Options ("Emission 1--{reference_property:_EnableEmission1}", Float) = 0 [HideInInspector][ThryToggle(POI_EMISSION_1)]_EnableEmission1 ("Enable Emission 2", Float) = 0 [ToggleUI]_EmissionReplace1 ("Replace Base Color", Float) = 0 [HDR]_EmissionColor1 ("Emission Color--{reference_property:_EmissionColor1ThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _EmissionColor1ThemeIndex ("", Int) = 0 [Gradient]_EmissionMap1 ("Emission Map--{reference_properties:[_EmissionMap1Pan, _EmissionMap1UV]}", 2D) = "white" { } [HideInInspector][Vector2]_EmissionMap1Pan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _EmissionMap1UV ("UV", Int) = 0 [ToggleUI]_EmissionBaseColorAsMap1 ("Base Color as Map?", Float) = 0 _EmissionMask1 ("Emission Mask--{reference_properties:[_EmissionMask1Pan, _EmissionMask1UV]}", 2D) = "white" { } [HideInInspector][Vector2]_EmissionMask1Pan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _EmissionMask1UV ("UV", Int) = 0 _EmissionStrength1 ("Emission Strength", Range(0, 20)) = 0 [Space(10)] [ThryToggleUI(true)]_EmissionHueShiftEnabled1 ("<size=13><b> Hue Shift</b></size>", Float) = 0 _EmissionHueShift1 ("Hue Shift--{condition_showS:(_EmissionHueShiftEnabled1==1)}", Range(0, 1)) = 0 _EmissionHueShiftSpeed1 ("Hue Shift Speed--{condition_showS:(_EmissionHueShiftEnabled1==1)}", Float) = 0 // Second Center Out Enission [Space(10)] [HideInInspector][ToggleUI]_EmissionCenterOutEnabled1 ("<size=13><b> Center Out</b></size>", Float) = 0 _EmissionCenterOutSpeed1 ("Flow Speed--{condition_showS:(_EmissionCenterOutEnabled1==1)}", Float) = 5 // Second Glow In The Dark Emission [Space(10)] [ThryToggleUI(true)]_EnableGITDEmission1 ("<size=13><b> Light Based</b></size>", Float) = 0 [Enum(World, 0, Mesh, 1)] _GITDEWorldOrMesh1 ("Lighting Type--{condition_showS:(_EnableGITDEmission1==1)}", Int) = 0 _GITDEMinEmissionMultiplier1 ("Min Emission Multiplier--{condition_showS:(_EnableGITDEmission1==1)}", Range(0, 1)) = 1 _GITDEMaxEmissionMultiplier1 ("Max Emission Multiplier--{condition_showS:(_EnableGITDEmission1==1)}", Range(0, 1)) = 0 _GITDEMinLight1 ("Min Lighting--{condition_showS:(_EnableGITDEmission1==1)}", Range(0, 1)) = 0 _GITDEMaxLight1 ("Max Lighting--{condition_showS:(_EnableGITDEmission1==1)}", Range(0, 1)) = 1 // Second Blinking Emission [Space(10)] [ThryToggleUI(true)]_EmissionBlinkingEnabled1 ("<size=13><b> Blinking</b></size>", Float) = 0 _EmissiveBlink_Min1 ("Emissive Blink Min--{condition_showS:(_EmissionBlinkingEnabled1==1)}", Float) = 0 _EmissiveBlink_Max1 ("Emissive Blink Max--{condition_showS:(_EmissionBlinkingEnabled1==1)}", Float) = 1 _EmissiveBlink_Velocity1 ("Emissive Blink Velocity--{condition_showS:(_EmissionBlinkingEnabled1==1)}", Float) = 4 _EmissionBlinkingOffset1 ("Offset--{condition_showS:(_EmissionBlinkingEnabled1==1)}", Float) = 0 // Second Scrolling Emission [Space(10)] [ThryToggleUI(true)] _ScrollingEmission1 ("<size=13><b> Scrolling</b></size>", Float) = 0 [ToggleUI]_EmissionScrollingUseCurve1 ("Use Curve--{condition_showS:(_ScrollingEmission1==1)}", float) = 0 [Curve]_EmissionScrollingCurve1 ("Curve--{condition_showS:(_ScrollingEmission1==1&&_EmissionScrollingUseCurve1==1)}", 2D) = "white" { } [ToggleUI]_EmissionScrollingVertexColor1 ("VColor as position--{condition_showS:(_ScrollingEmission1==1)}", float) = 0 _EmissiveScroll_Direction1 ("Direction--{condition_showS:(_ScrollingEmission1==1)}", Vector) = (0, -10, 0, 0) _EmissiveScroll_Width1 ("Width--{condition_showS:(_ScrollingEmission1==1)}", Float) = 10 _EmissiveScroll_Velocity1 ("Velocity--{condition_showS:(_ScrollingEmission1==1)}", Float) = 10 _EmissiveScroll_Interval1 ("Interval--{condition_showS:(_ScrollingEmission1==1)}", Float) = 20 _EmissionScrollingOffset1 ("Offset--{condition_showS:(_ScrollingEmission1==1)}", Float) = 0 [Space(10)] [ThryToggleUI(true)] _EmissionAL1Enabled ("<size=13><b> Audio Link</b></size>--{ condition_showS:_EnableAudioLink==1}", Float) = 0 [Vector2]_EmissionAL1StrengthMod ("Emission Strength Add--{ condition_showS:(_EmissionAL1Enabled==1 && _EnableAudioLink==1)}", Vector) = (0, 0, 0, 0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _EmissionAL1StrengthBand ("Emission Add Band--{ condition_showS:(_EmissionAL1Enabled==1 && _EnableAudioLink==1)}", Int) = 0 [Vector2] _AudioLinkEmission1CenterOut ("Center Out--{ condition_showS:(_EmissionAL1Enabled==1 && _EnableAudioLink==1)}", Vector) = (0, 0, 0, 0) _AudioLinkEmission1CenterOutwidth ("Center Out Duration--{ condition_showS:(_EmissionAL1Enabled==1 && _EnableAudioLink==1)}", Range(0, 1)) = 1 _AudioLinkEmission1CenterOutSize ("Wave Size--{ condition_showS:(_EmissionAL1Enabled==1 && _EnableAudioLink==1)}", Range(0, 1)) = 1 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkEmission1CenterOutBand ("Center Out Band--{ condition_showS:(_EmissionAL1Enabled==1 && _EnableAudioLink==1)}", Int) = 0 [HideInInspector] m_end_emission1Options ("", Float) = 0 // Third Emission [HideInInspector] m_start_emission2Options ("Emission 2--{reference_property:_EnableEmission2}", Float) = 0 [HideInInspector][ThryToggle(POI_EMISSION_2)]_EnableEmission2 ("Enable Emission 2", Float) = 0 [ToggleUI]_EmissionReplace2 ("Replace Base Color", Float) = 0 [HDR]_EmissionColor2 ("Emission Color--{reference_property:_EmissionColor2ThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _EmissionColor2ThemeIndex ("", Int) = 0 [Gradient]_EmissionMap2 ("Emission Map--{reference_properties:[_EmissionMap2Pan, _EmissionMap2UV]}", 2D) = "white" { } [HideInInspector][Vector2]_EmissionMap2Pan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _EmissionMap2UV ("UV", Int) = 0 [ToggleUI]_EmissionBaseColorAsMap2 ("Base Color as Map?", Float) = 0 _EmissionMask2 ("Emission Mask--{reference_properties:[_EmissionMask2Pan, _EmissionMask2UV]}", 2D) = "white" { } [HideInInspector][Vector2]_EmissionMask2Pan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _EmissionMask2UV ("UV", Int) = 0 _EmissionStrength2 ("Emission Strength", Range(0, 20)) = 0 [Space(10)] [ThryToggleUI(true)]_EmissionHueShiftEnabled2 ("<size=13><b> Hue Shift</b></size>", Float) = 0 _EmissionHueShift2 ("Hue Shift--{condition_showS:(_EmissionHueShiftEnabled2==1)}", Range(0, 1)) = 0 _EmissionHueShiftSpeed2 ("Hue Shift Speed--{condition_showS:(_EmissionHueShiftEnabled2==1)}", Float) = 0 // Third Center Out Enission [Space(10)] [HideInInspector][ToggleUI]_EmissionCenterOutEnabled2 ("<size=13><b> Center Out</b></size>", Float) = 0 _EmissionCenterOutSpeed2 ("Flow Speed--{condition_showS:(_EmissionCenterOutEnabled2==1)}", Float) = 5 // Third Glow In The Dark Emission [Space(10)] [ThryToggleUI(true)]_EnableGITDEmission2 ("<size=13><b> Light Based</b></size>", Float) = 0 [Enum(World, 0, Mesh, 1)] _GITDEWorldOrMesh2 ("Lighting Type--{condition_showS:(_EnableGITDEmission2==1)}", Int) = 0 _GITDEMinEmissionMultiplier2 ("Min Emission Multiplier--{condition_showS:(_EnableGITDEmission2==1)}", Range(0, 1)) = 1 _GITDEMaxEmissionMultiplier2 ("Max Emission Multiplier--{condition_showS:(_EnableGITDEmission2==1)}", Range(0, 1)) = 0 _GITDEMinLight2 ("Min Lighting--{condition_showS:(_EnableGITDEmission2==1)}", Range(0, 1)) = 0 _GITDEMaxLight2 ("Max Lighting--{condition_showS:(_EnableGITDEmission2==1)}", Range(0, 1)) = 1 // Third Blinking Emission [Space(10)] [ThryToggleUI(true)]_EmissionBlinkingEnabled2 ("<size=13><b> Blinking</b></size>", Float) = 0 _EmissiveBlink_Min2 ("Emissive Blink Min--{condition_showS:(_EmissionBlinkingEnabled2==1)}", Float) = 0 _EmissiveBlink_Max2 ("Emissive Blink Max--{condition_showS:(_EmissionBlinkingEnabled2==1)}", Float) = 1 _EmissiveBlink_Velocity2 ("Emissive Blink Velocity--{condition_showS:(_EmissionBlinkingEnabled2==1)}", Float) = 4 _EmissionBlinkingOffset2 ("Offset--{condition_showS:(_EmissionBlinkingEnabled2==1)}", Float) = 0 // Third Scrolling Emission [Space(10)] [ThryToggleUI(true)] _ScrollingEmission2 ("<size=13><b> Scrolling</b></size>", Float) = 0 [ToggleUI]_EmissionScrollingUseCurve2 ("Use Curve--{condition_showS:(_ScrollingEmission2==1)}", float) = 0 [Curve]_EmissionScrollingCurve2 ("Curve--{condition_showS:(_ScrollingEmission1==1&&_EmissionScrollingUseCurve2==1)}", 2D) = "white" { } [ToggleUI]_EmissionScrollingVertexColor2 ("VColor as position--{condition_showS:(_ScrollingEmission2==1)}", float) = 0 _EmissiveScroll_Direction2 ("Direction--{condition_showS:(_ScrollingEmission2==1)}", Vector) = (0, -10, 0, 0) _EmissiveScroll_Width2 ("Width--{condition_showS:(_ScrollingEmission2==1)}", Float) = 10 _EmissiveScroll_Velocity2 ("Velocity--{condition_showS:(_ScrollingEmission2==1)}", Float) = 10 _EmissiveScroll_Interval2 ("Interval--{condition_showS:(_ScrollingEmission2==1)}", Float) = 20 [Space(10)] [ThryToggleUI(true)] _EmissionAL2Enabled ("<size=13><b> Audio Link</b></size>--{ condition_showS:_EnableAudioLink==1}", Float) = 0 [Vector2]_EmissionAL2StrengthMod ("Emission Strength Add--{ condition_showS:(_EmissionAL2Enabled==1 && _EnableAudioLink==1)}", Vector) = (0, 0, 0, 0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _EmissionAL2StrengthBand ("Emission Add Band--{ condition_showS:(_EmissionAL2Enabled==1 && _EnableAudioLink==1)}", Int) = 0 [Vector2] _AudioLinkEmission2CenterOut ("Center Out--{ condition_showS:(_EmissionAL2Enabled==1 && _EnableAudioLink==1)}", Vector) = (0, 0, 0, 0) _AudioLinkEmission2CenterOutwidth ("Center Out Duration--{ condition_showS:(_EmissionAL2Enabled==1 && _EnableAudioLink==1)}", Range(0, 1)) = 1 _AudioLinkEmission2CenterOutSize ("Wave Size--{ condition_showS:(_EmissionAL2Enabled==1 && _EnableAudioLink==1)}", Range(0, 1)) = 1 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkEmission2CenterOutBand ("Center Out Band--{ condition_showS:(_EmissionAL2Enabled==1 && _EnableAudioLink==1)}", Int) = 0 [HideInInspector] m_end_emission2Options ("", Float) = 0 // Fourth Emission [HideInInspector] m_start_emission3Options ("Emission 3--{reference_property:_EnableEmission3}", Float) = 0 [HideInInspector][ThryToggle(POI_EMISSION_3)]_EnableEmission3 ("Enable Emission 3", Float) = 0 [ToggleUI]_EmissionReplace3 ("Replace Base Color", Float) = 0 [HDR]_EmissionColor3 ("Emission Color--{reference_property:_EmissionColor3ThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _EmissionColor3ThemeIndex ("", Int) = 0 [Gradient]_EmissionMap3 ("Emission Map--{reference_properties:[_EmissionMap3Pan, _EmissionMap3UV]}", 2D) = "white" { } [HideInInspector][Vector2]_EmissionMap3Pan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _EmissionMap3UV ("UV", Int) = 0 [ToggleUI]_EmissionBaseColorAsMap3 ("Base Color as Map?", Float) = 0 _EmissionMask3 ("Emission Mask--{reference_properties:[_EmissionMask3Pan, _EmissionMask3UV]}", 2D) = "white" { } [HideInInspector][Vector2]_EmissionMask3Pan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _EmissionMask3UV ("UV", Int) = 0 _EmissionStrength3 ("Emission Strength", Range(0, 20)) = 0 [Space(10)] [ThryToggleUI(true)]_EmissionHueShiftEnabled3 ("<size=13><b> Hue Shift</b></size>", Float) = 0 _EmissionHueShift3 ("Hue Shift--{condition_showS:(_EmissionHueShiftEnabled3==1)}", Range(0, 1)) = 0 _EmissionHueShiftSpeed3 ("Hue Shift Speed--{condition_showS:(_EmissionHueShiftEnabled3==1)}", Float) = 0 // Fourth Center Out Enission [Space(10)] [HideInInspector][ToggleUI]_EmissionCenterOutEnabled3 ("<size=13><b> Center Out</b></size>", Float) = 0 _EmissionCenterOutSpeed3 ("Flow Speed--{condition_showS:(_EmissionCenterOutEnabled3==1)}", Float) = 5 // Fourth Glow In The Dark Emission [Space(10)] [ThryToggleUI(true)]_EnableGITDEmission3 ("<size=13><b> Light Based</b></size>", Float) = 0 [Enum(World, 0, Mesh, 1)] _GITDEWorldOrMesh3 ("Lighting Type--{condition_showS:(_EnableGITDEmission3==1)}", Int) = 0 _GITDEMinEmissionMultiplier3 ("Min Emission Multiplier--{condition_showS:(_EnableGITDEmission3==1)}", Range(0, 1)) = 1 _GITDEMaxEmissionMultiplier3 ("Max Emission Multiplier--{condition_showS:(_EnableGITDEmission3==1)}", Range(0, 1)) = 0 _GITDEMinLight3 ("Min Lighting--{condition_showS:(_EnableGITDEmission3==1)}", Range(0, 1)) = 0 _GITDEMaxLight3 ("Max Lighting--{condition_showS:(_EnableGITDEmission3==1)}", Range(0, 1)) = 1 // Fourth Blinking Emission [Space(10)] [ThryToggleUI(true)]_EmissionBlinkingEnabled3 ("<size=13><b> Blinking</b></size>", Float) = 0 _EmissiveBlink_Min3 ("Emissive Blink Min--{condition_showS:(_EmissionBlinkingEnabled3==1)}", Float) = 0 _EmissiveBlink_Max3 ("Emissive Blink Max--{condition_showS:(_EmissionBlinkingEnabled3==1)}", Float) = 1 _EmissiveBlink_Velocity3 ("Emissive Blink Velocity--{condition_showS:(_EmissionBlinkingEnabled3==1)}", Float) = 4 _EmissionBlinkingOffset3 ("Offset--{condition_showS:(_EmissionBlinkingEnabled3==1)}", Float) = 0 // Fourth Scrolling Emission [Space(10)] [ThryToggleUI(true)] _ScrollingEmission3 ("<size=13><b> Scrolling</b></size>", Float) = 0 [ToggleUI]_EmissionScrollingUseCurve3 ("Use Curve--{condition_showS:(_ScrollingEmission3==1)}", float) = 0 [Curve]_EmissionScrollingCurve3 ("Curve--{condition_showS:(_ScrollingEmission1==1&&_EmissionScrollingUseCurve3==1)}", 2D) = "white" { } [ToggleUI]_EmissionScrollingVertexColor3 ("VColor as position--{condition_showS:(_ScrollingEmission3==1)}", float) = 0 _EmissiveScroll_Direction3 ("Direction--{condition_showS:(_ScrollingEmission3==1)}", Vector) = (0, -10, 0, 0) _EmissiveScroll_Width3 ("Width--{condition_showS:(_ScrollingEmission3==1)}", Float) = 10 _EmissiveScroll_Velocity3 ("Velocity--{condition_showS:(_ScrollingEmission3==1)}", Float) = 10 _EmissiveScroll_Interval3 ("Interval--{condition_showS:(_ScrollingEmission3==1)}", Float) = 20 [Space(10)] [ThryToggleUI(true)] _EmissionAL3Enabled ("<size=13><b> Audio Link</b></size>--{ condition_showS:_EnableAudioLink==1}", Float) = 0 [Vector2]_EmissionAL3StrengthMod ("Emission Strength Add--{ condition_showS:(_EmissionAL3Enabled==1 && _EnableAudioLink==1)}", Vector) = (0, 0, 0, 0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _EmissionAL3StrengthBand ("Emission Add Band--{ condition_showS:(_EmissionAL3Enabled==1 && _EnableAudioLink==1)}", Int) = 0 [Vector2] _AudioLinkEmission3CenterOut ("Center Out--{ condition_showS:(_EmissionAL3Enabled==1 && _EnableAudioLink==1)}", Vector) = (0, 0, 0, 0) _AudioLinkEmission3CenterOutwidth ("Center Out Duration--{ condition_showS:(_EmissionAL3Enabled==1 && _EnableAudioLink==1)}", Range(0, 1)) = 1 _AudioLinkEmission3CenterOutSize ("Wave Size--{ condition_showS:(_EmissionAL3Enabled==1 && _EnableAudioLink==1)}", Range(0, 1)) = 1 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkEmission3CenterOutBand ("Center Out Band--{ condition_showS:(_EmissionAL3Enabled==1 && _EnableAudioLink==1)}", Int) = 0 [HideInInspector] m_end_emission3Options ("", Float) = 0 [HideInInspector] m_end_emissions ("Emissions", Float) = 0 // Glitter [HideInInspector] m_start_glitter ("Glitter / Sparkle--{reference_property:_GlitterEnable}", Float) = 0 [HideInInspector][ThryToggle(_SUNDISK_SIMPLE)]_GlitterEnable ("Enable Glitter?", Float) = 0 [ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _GlitterUV ("UV", Int) = 0 [Enum(Angle, 0, Linear Emission, 1, Light Reflections, 2)]_GlitterMode ("Mode", Int) = 0 [Enum(Circle, 0, Square, 1)]_GlitterShape ("Shape", Int) = 0 [Enum(Add, 0, Replace, 1)] _GlitterBlendType ("Blend Mode", Int) = 0 [HDR]_GlitterColor ("Color--{reference_property:_GlitterColorThemeIndex}", Color) = (1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _GlitterColorThemeIndex ("", Int) = 0 _GlitterUseSurfaceColor ("Use Surface Color", Range(0, 1)) = 0 _GlitterColorMap ("Glitter Color Map--{reference_properties:[_GlitterColorMapPan, _GlitterColorMapUV]}", 2D) = "white" { } [HideInInspector][Vector2]_GlitterColorMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _GlitterColorMapUV ("UV", Int) = 0 [HideInInspector][Vector2]_GlitterPan ("Panning", Vector) = (0, 0, 0, 0) _GlitterMask ("Glitter Mask--{reference_properties:[_GlitterMaskPan, _GlitterMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_GlitterMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _GlitterMaskUV ("UV", Int) = 0 _GlitterTexture ("Glitter Texture--{reference_properties:[_GlitterTexturePan]}", 2D) = "white" { } [HideInInspector][Vector2]_GlitterTexturePan ("Panning", Vector) = (0, 0, 0, 0) [Vector2]_GlitterUVPanning ("Panning Speed", Vector) = (0, 0, 0, 0) _GlitterTextureRotation ("Rotation Speed", Float) = 0 _GlitterFrequency ("Glitter Density", Float) = 300.0 _GlitterJitter ("Glitter Jitter", Range(0, 1)) = 1.0 _GlitterSpeed ("Glitter Speed", Float) = 10.0 _GlitterSize ("Glitter Size", Range(0, 1)) = .3 _GlitterContrast ("Glitter Contrast--{condition_showS:(_GlitterMode==0||_GlitterMode==2)}", Range(1, 1000)) = 300 _GlitterAngleRange ("Glitter Angle Range--{condition_showS:(_GlitterMode==0||_GlitterMode==2)}", Range(0, 90)) = 90 _GlitterMinBrightness ("Glitter Min Brightness", Range(0, 1)) = 0 _GlitterBrightness ("Glitter Max Brightness", Range(0, 40)) = 3 _GlitterBias ("Glitter Bias--{condition_show:(_GlitterMode==0)}", Range(0, 1)) = .8 _GlitterHideInShadow ("Hide in shadow", Range(0, 1)) = 0 _GlitterCenterSize ("dim light--{condition_show:{type:AND,condition1:{type:PROPERTY_BOOL,data:_GlitterMode==1},condition2:{type:PROPERTY_BOOL,data:_GlitterShape==1}}}", Range(0, 1)) = .08 _glitterFrequencyLinearEmissive ("Frequency--{condition_show:{type:PROPERTY_BOOL,data:_GlitterMode==1}}", Range(0, 100)) = 20 _GlitterJaggyFix ("Jaggy Fix--{condition_show:{type:PROPERTY_BOOL,data:_GlitterShape==1}}", Range(0, .1)) = .0 [Space(10)] [ThryToggleUI(true)]_GlitterHueShiftEnabled ("<size=13><b> Hue Shift</b></size>", Float) = 0 _GlitterHueShiftSpeed ("Shift Speed--{condition_showS:(_GlitterHueShiftEnabled==1)}", Float) = 0 _GlitterHueShift ("Hue Shift--{condition_showS:(_GlitterHueShiftEnabled==1)}", Range(0, 1)) = 0 [Space(10)] [ThryToggleUI(true)]_GlitterRandomColors ("<size=13><b> Random Stuff</b></size>", Float) = 0 [MultiSlider]_GlitterMinMaxSaturation ("Saturation Range--{condition_showS:(_GlitterRandomColors==1)}", Vector) = (0.8, 1, 0, 1) [MultiSlider]_GlitterMinMaxBrightness ("Brightness Range--{condition_showS:(_GlitterRandomColors==1)}", Vector) = (0.8, 1, 0, 1) [ToggleUI]_GlitterRandomSize ("Random Size?--{condition_showS:(_GlitterRandomColors==1)}", Float) = 0 [MultiSlider]_GlitterMinMaxSize ("Size Range--{condition_showS:(_GlitterRandomColors==1)}", Vector) = (0.1, 0.5, 0, 1) [ToggleUI]_GlitterRandomRotation ("Random Tex Rotation--{condition_showS:(_GlitterRandomColors==1)}", Float) = 0 [HideInInspector] m_end_glitter ("Glitter / Sparkle--{condition_showS:(_GlitterRandomColors==1)}", Float) = 0 [HideInInspector] m_start_pathing ("Pathing--{reference_property: _EnablePathing}", Float) = 0 [HideInInspector][ThryToggle(POI_PATHING)] _EnablePathing ("Enable Pathing", Float) = 0 [ThryExternalTextureToolDrawer(Flood Tool,DreadScripts.GradientFlood)]_PathingMap ("RGB Path Map | A Mask--{reference_properties:[_PathingMapPan, _PathingMapUV]}", 2D) = "white" { } [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_PathingMapUV ("UV", Int) = 0 [HideInInspector][Vector2]_PathingMapPan ("Panning", Vector) = (0, 0, 0, 0) _PathingColorMap ("RGB Color | A Mask--{reference_properties:[_PathingColorMapPan, _PathingColorMapUV]}", 2D) = "white" { } [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_PathingColorMapUV ("UV", Int) = 0 [HideInInspector][Vector2]_PathingColorMapPan ("Panning", Vector) = (0, 0, 0, 0) [Enum(Fill, 0, Path, 1, Loop, 2)]_PathTypeR ("R Path Type", Float) = 0 [Enum(Fill, 0, Path, 1, Loop, 2)]_PathTypeG ("G Path Type", Float) = 0 [Enum(Fill, 0, Path, 1, Loop, 2)]_PathTypeB ("B Path Type", Float) = 0 [HDR]_PathColorR ("R Color--{reference_property:_PathColorRThemeIndex}", Color) = (1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _PathColorRThemeIndex ("", Int) = 0 [HDR]_PathColorG ("G Color--{reference_property:_PathColorGThemeIndex}", Color) = (1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _PathColorGThemeIndex ("", Int) = 0 [HDR]_PathColorB ("B Color--{reference_property:_PathColorBThemeIndex}", Color) = (1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _PathColorBThemeIndex ("", Int) = 0 [Vector3]_PathEmissionStrength ("Emission Strength", Vector) = (0.0, 0.0, 0.0, 1) [Vector3]_PathSoftness ("Softness", Vector) = (1, 1, 1, 1) [Vector3]_PathSpeed ("Speed", Vector) = (1.0, 1.0, 1.0, 1) [Vector3]_PathWidth ("Length", Vector) = (0.03, 0.03, 0.03, 1) [Header(Timing Options)] [Vector3]_PathTime ("Manual Timing", Vector) = (-999.0, -999.0, -999.0, 1) [Vector3]_PathOffset ("Timing Offset", Vector) = (0.0, 0.0, 0.0, 1) [Vector3]_PathSegments ("Path Segments", Vector) = (0.0, 0.0, 0.0, 1) [HideInInspector] m_start_PathAudioLink ("Audio Link ♫--{ condition_showS:_EnableAudioLink==1}", Float) = 0 // Time Offsets [Header(Time Offset)] [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkPathTimeOffsetBandR ("Band R", Int) = 0 [Vector2]_AudioLinkPathTimeOffsetR ("Offset R", Vector) = (0, 0, 0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkPathTimeOffsetBandG ("Band G", Int) = 0 [Vector2]_AudioLinkPathTimeOffsetG ("Offset G", Vector) = (0, 0, 0) [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _AudioLinkPathTimeOffsetBandB ("Band B", Int) = 0 [Vector2]_AudioLinkPathTimeOffsetB ("Offset B", Vector) = (0, 0, 0) [HideInInspector] m_end_PathAudioLink ("", Float) = 0 [HideInInspector] m_end_pathing ("", Float) = 0 // Mirror Rendering [HideInInspector] m_start_mirrorOptions ("Mirror--{reference_property:_EnableMirrorOptions}", Float) = 0 [HideInInspector][ThryToggle(POI_MIRROR)]_EnableMirrorOptions ("Enable Mirror Options", Float) = 0 [ThryWideEnum(Show In Both, 0, Show Only In Mirror, 1, Dont Show In Mirror, 2)] _Mirror ("Show in mirror", Int) = 0 _MirrorTexture ("Mirror Texture--{reference_properties:[_MirrorTexturePan, _MirrorTextureUV]},", 2D) = "white" { } [HideInInspector][Vector2]_MirrorTexturePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _MirrorTextureUV("UV", Int) = 0 [HideInInspector] m_end_mirrorOptions ("Mirror", Float) = 0 [HideInInspector] m_start_depthFX ("Depth FX--{reference_property:_EnableTouchGlow}", Float) = 0 [HideInInspector][ThryToggle(GRAIN)]_EnableTouchGlow ("Enable Depth FX", Float) = 0 _DepthMask ("Mask--{reference_properties:[_DepthMaskPan, _DepthMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_DepthMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DepthMaskUV ("UV", Int) = 0 [Space(10)] [ThryToggleUI(true)]_DepthColorToggle ("<size=13><b> Color & Emission</b></size>", Float) = 0 [ThryWideEnum(Replace, 0, Multiply, 1, Add, 2)] _DepthColorBlendMode ("Blend Type--{condition_showS:(_DepthColorToggle==1)}", Int) = 0 _DepthTexture ("Depth Texture--{reference_properties:[_DepthTexturePan, _DepthTextureUV], condition_showS:(_DepthColorToggle==1)}", 2D) = "white" { } [HideInInspector][Vector2]_DepthTexturePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _DepthTextureUV ("UV", Int) = 0 _DepthColor ("Color--{condition_showS:(_DepthColorToggle==1), reference_property:_DepthColorThemeIndex}", Color) = (1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _DepthColorThemeIndex ("", Int) = 0 _DepthEmissionStrength ("Emission Strength", Range(0, 20)) = 0 _DepthColorMinDepth ("Min Depth--{condition_showS:(_DepthColorToggle==1)}", Float) = 0 _DepthColorMaxDepth ("Max Depth--{condition_showS:(_DepthColorToggle==1)}", Float) = 1 _DepthColorMinValue ("Min Color Blend--{condition_showS:(_DepthColorToggle==1)}", Range(0, 1)) = 0 _DepthColorMaxValue ("Max Color Blend--{condition_showS:(_DepthColorToggle==1)}", Range(0, 1)) = 1 [Space(10)] [ThryToggleUI(true)]_DepthAlphaToggle ("<size=13><b> Alpha</b></size>", Float) = 0 _DepthAlphaMinDepth ("Min Depth--{condition_showS:(_DepthAlphaToggle==1)}", Float) = 0 _DepthAlphaMaxDepth ("Max Depth--{condition_showS:(_DepthAlphaToggle==1)}", Float) = 1 _DepthAlphaMinValue ("Min Alpha--{condition_showS:(_DepthAlphaToggle==1)}", Range(0, 1)) = 0 _DepthAlphaMaxValue ("Max Alpha--{condition_showS:(_DepthAlphaToggle==1)}", Range(0, 1)) = 1 [HideInInspector] m_end_depthFX ("Depth FX", Float) = 0 [HideInInspector] m_start_Iridescence ("Iridescence--{reference_property:_EnableIridescence}", Float) = 0 [HideInInspector][ThryToggle(POI_IRIDESCENCE)]_EnableIridescence ("Enable Iridescence", Float) = 0 [Gradient]_IridescenceRamp ("Ramp--{reference_properties:[_IridescenceRampPan]}", 2D) = "white" { } [HideInInspector][Vector2]_IridescenceRampPan ("Panning", Vector) = (0, 0, 0, 0) _IridescenceMask ("Mask--{reference_properties:[_IridescenceMaskPan, _IridescenceMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_IridescenceMaskPan("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_IridescenceMaskUV ("Mask UV", Int) = 0 [ToggleUI]_IridescenceNormalToggle ("Custom Normals?", Float) = 0 [Normal]_IridescenceNormalMap ("Normal Map--{reference_properties:[_IridescenceNormalIntensity, _IridescenceNormalMapPan, _IridescenceNormalMapUV]}", 2D) = "bump" { } [HideInInspector]_IridescenceNormalIntensity ("Normal Intensity", Range(0, 10)) = 1 [HideInInspector][Vector2]_IridescenceNormalMapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_IridescenceNormalMapUV ("Normal UV", Int) = 0 [Enum(Vertex, 0, Pixel, 1)] _IridescenceNormalSelection ("Normal Select", Int) = 1 _IridescenceIntensity ("Intensity", Range(0, 10)) = 1 _IridescenceAddBlend ("Blend Add", Range(0, 1)) = 0 _IridescenceReplaceBlend ("Blend Replace", Range(0, 1)) = 0 _IridescenceMultiplyBlend ("Blend Multiply", Range(0, 1)) = 0 _IridescenceEmissionStrength ("Emission Strength", Range(0, 20)) = 0 [Enum(Run Early, 0, Run Late, 1)] _IridescenceTime ("When To Run", Int) = 0 [Header(Hue Shift)] [ToggleUI]_IridescenceHueShiftEnabled ("Enable", Float) = 0 _IridescenceHueShiftSpeed ("Speed", Float) = 0 _IridescenceHueShift ("Shift", Range(0,1)) = 0 // Iridescence Audio Link [HideInInspector] m_start_IridescenceAudioLink ("Audio Link ♫--{ condition_showS:_EnableAudioLink==1}", Float) = 0 [Enum(Bass, 0, Low Mid, 1, High Mid, 2, Treble, 3)] _IridescenceAudioLinkEmissionBand ("Scale Band", Int) = 0 [Vector2]_IridescenceAudioLinkEmission("Scale Mod", Vector) = (0,0,0,0) [HideInInspector] m_end_IridescenceAudioLink ("Audio Link", Float) = 0 [HideInInspector] m_end_Iridescence ("Iridescence", Float) = 0 // MSDF OVERLAY [HideInInspector] m_start_Text ("Stats Overlay--{reference_property:_TextEnabled}", Float) = 0 _TextGlyphs ("Font Array", 2D) = "black" { } _TextPixelRange ("Pixel Range", Float) = 4.0 [HideInInspector][ThryToggle(EFFECT_BUMP)]_TextEnabled ("Text?", Float) = 0 // FPS [HideInInspector] m_start_TextFPS ("FPS--{reference_property:_TextFPSEnabled}", Float) = 0 [HideInInspector][ToggleUI]_TextFPSEnabled ("FPS Text?", Float) = 0 [ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _TextFPSUV ("FPS UV", Int) = 0 _TextFPSColor ("Color--{reference_property:_TextFPSColorThemeIndex}", Color) = (1, 1, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _TextFPSColorThemeIndex ("", Int) = 0 _TextFPSEmissionStrength ("Emission Strength", Range(0, 20)) = 0 [Vector2]_TextFPSOffset ("Offset", Vector) = (0, 0, 0, 0) _TextFPSRotation ("Rotation", Range(0, 360)) = 0 [Vector2]_TextFPSScale ("Scale", Vector) = (1, 1, 1, 1) _TextFPSPadding ("Padding Reduction", Vector) = (0, 0, 0, 0) [HideInInspector] m_end_TextFPS ("FPS", Float) = 0 // POSITION [HideInInspector] m_start_TextPosition ("Position--{reference_property:_TextPositionEnabled}", Float) = 0 [HideInInspector][ToggleUI]_TextPositionEnabled ("Position Text?", Float) = 0 [ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _TextPositionUV ("Position UV", Int) = 0 //[ToggleUI]_TextPositionVertical ("Vertical?", Float) = 0 _TextPositionColor ("Color--{reference_property:_TextPositionColorThemeIndex}", Color) = (1, 0, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _TextPositionColorThemeIndex ("", Int) = 0 _TextPositionEmissionStrength ("Emission Strength", Range(0, 20)) = 0 [Vector2]_TextPositionOffset ("Offset", Vector) = (0, 0, 0, 0) _TextPositionRotation ("Rotation", Range(0, 360)) = 0 [Vector2]_TextPositionScale ("Scale", Vector) = (1, 1, 1, 1) _TextPositionPadding ("Padding Reduction", Vector) = (0, 0, 0, 0) [HideInInspector] m_end_TextPosition ("Position", Float) = 0 // INSTANCE TIME [HideInInspector] m_start_TextInstanceTime ("Instance Time--{reference_property:_TextTimeEnabled}", Float) = 0 [HideInInspector][ToggleUI]_TextTimeEnabled ("Time Text?", Float) = 0 [ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _TextTimeUV ("Time UV", Int) = 0 _TextTimeColor ("Color--{reference_property:_TextTimeColorThemeIndex}", Color) = (1, 0, 1, 1) [HideInInspector][ThryWideEnum(Off, 0, Theme Color 0, 1, Theme Color 1, 2, Theme Color 2, 3, Theme Color 3, 4, ColorChord 0, 5, ColorChord 1, 6, ColorChord 2, 7, ColorChord 3, 8, AL Theme 0, 9, AL Theme 1, 10, AL Theme 2, 11, AL Theme 3, 12)] _TextTimeColorThemeIndex ("", Int) = 0 _TextTimeEmissionStrength ("Emission Strength", Range(0, 20)) = 0 [Vector2]_TextTimeOffset ("Offset", Vector) = (0, 0, 0, 0) _TextTimeRotation ("Rotation", Range(0, 360)) = 0 [Vector2]_TextTimeScale ("Scale", Vector) = (1, 1, 1, 1) _TextTimePadding ("Padding Reduction", Vector) = (0, 0, 0, 0) [HideInInspector] m_end_TextInstanceTime ("Instance Time", Float) = 0 [HideInInspector] m_end_Text ("MSDF Text Overlay", Float) = 0 // Poi Extras // Audio link [HideInInspector] m_AudioLinkCategory (" Audio Link--{reference_property:_EnableAudioLink}", Float) = 0 [HideInInspector] m_start_audioLink ("Audio Link", Float) = 0 [HideInInspector][ThryToggle(COLOR_GRADING_LOG_VIEW)] _EnableAudioLink ("Enabled?", Float) = 0 [Helpbox(1)] _AudioLinkHelp ("This section houses the global controls for audio link. Controls for individual features are in their respective sections. (Emission, Dissolve, etc...)", Int) = 0 [ToggleUI] _AudioLinkAnimToggle ("Anim Toggle", Float) = 1 /* _AudioLinkDelay ("Delay", Range(0, 1)) = 0 [ToggleUI]_AudioLinkCCStripY("CC Strip Y UV", Float) = 0 */ //[ToggleUI]_AudioLinkAveraging ("Enable averaging", Float) = 0 //_AudioLinkAverageRange ("Average Sampling Range", Range(0, 1)) = .5 [ThryHeaderLabel(Debug Visualizer, 13)] [ToggleUI]_DebugWaveform("Waveform", Float) = 0 [ToggleUI]_DebugDFT("DFT", Float) = 0 [ToggleUI]_DebugBass("Bass", Float) = 0 [ToggleUI]_DebugLowMids("Low Mids", Float) = 0 [ToggleUI]_DebugHighMids("High Mids", Float) = 0 [ToggleUI]_DebugTreble("Treble", Float) = 0 [ToggleUI]_DebugCCColors("Colorchord Colors", Float) = 0 [ToggleUI]_DebugCCStrip("Colorchord Strip", Float) = 0 [ToggleUI]_DebugCCLights("Colorchord Lights", Float) = 0 [ToggleUI]_DebugAutocorrelator("Autocorrelator", Float) = 0 [ToggleUI]_DebugChronotensity("Chronotensity", Float) = 0 [Helpbox(1)]_DebugVisualizerHelpbox ("Debug examples are best viewed on a flat surface with simple uvs like a default unity quad.", Int) = 0 [HideInInspector] m_end_audioLink ("Audio Link", Float) = 0 [HideInInspector] m_start_ALDecalSpectrum ("AL ♫ Spectrum--{ reference_property:_EnableALDecal}", Float) = 0 [HideInInspector][ThryToggle(POI_AL_DECAL)]_EnableALDecal ("Enable AL Decal", Float) = 0 [HideInInspector][ThryWideEnum(lil Spectrum, 0)] _ALDecalType ("AL Type--{ condition_showS:_EnableAudioLink==1}", Int) = 0 [ThryHeaderLabel(Transform, 13)] [Space(4)] [Enum(Normal, 0, Circle, 1)] _ALDecalUVMode ("UV Mode", Float) = 0 [ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)] _ALDecalUV ("UV", Int) = 0 [Vector2]_ALUVPosition ("Position", Vector) = (.5, .5, 1) _ALUVScale ("Scale", Vector) = (1, 1, 1, 1) _ALUVRotation ("Rotation", Range(0, 360)) = 0 _ALUVRotationSpeed ("Rotation Speed", Float) = 0 _ALDecalLineWidth ("Line Width", Range(0, 1)) = 1.0 _ALDecaldCircleDimensions ("Cirlce Dimensions--{ condition_showS:_ALDecalUVMode==1}", Vector) = (0, 1, 0, 1) [Space][ThryHeaderLabel(Volume, 13)] [Space(4)] _ALDecalVolumeStep ("Volume Step Num (0 = Off)", Float) = 0.0 _ALDecalVolumeClipMin ("Volume Clip Min", Range(0, 1)) = 0.0 _ALDecalVolumeClipMax ("Volume Clip Max", Range(0, 1)) = 1.0 [Space][ThryHeaderLabel(Band, 13)] [Space(4)] _ALDecalBandStep ("Band Step Num (0 = Off)", Float) = 0.0 _ALDecalBandClipMin ("Band Clip Min", Range(0, 1)) = 0.0 _ALDecalBandClipMax ("Band Clip Max", Range(0, 1)) = 1.0 [Space][ThryToggleUI(true)]_ALDecalShapeClip ("<size=13><b> Shape Clip</b></size>", Float) = 0 _ALDecalShapeClipVolumeWidth ("Volume Width--{ condition_showS:_ALDecalShapeClip==1}", Range(0, 1)) = 0.5 _ALDecalShapeClipBandWidth ("Band Width--{ condition_showS:_ALDecalShapeClip==1}", Range(0, 1)) = 0.5 [Space][ThryHeaderLabel(Audio Mods, 13)] [Space(4)] _ALDecalVolume ("Volume", Int) = 0.5 _ALDecalBaseBoost ("Base Boost", Float) = 5.0 _ALDecalTrebleBoost ("Treble Boost", Float) = 1.0 [Space][ThryHeaderLabel(Colors and Blending, 13)] [Space(4)] [Enum(UVX, 0, UVY, 1, Volume, 2)] _ALDecalVolumeColorSource ("Source", Int) = 1 _ALDecalVolumeColorLow ("Volume Color Low", Color) = (0, 0, 1) _ALDecalLowEmission ("Low Emission", Range(0, 20)) = 0 _ALDecalVolumeColorMid ("Volume Color Mid", Color) = (0, 1, 0) _ALDecalMidEmission ("Mid Emission", Range(0, 20)) = 0 _ALDecalVolumeColorHigh ("Volume Color High", Color) = (1, 0, 0) _ALDecalHighEmission ("High Emission", Range(0, 20)) = 0 [ThryWideEnum(Replace, 0, Darken, 1, Multiply, 2, Color Burn, 3, Linear Burn, 4, Lighten, 5, Screen, 6, Color Dodge, 7, Linear Dodge(Add), 8, Overlay, 9, Soft Lighten, 10, Hard Light, 11, Vivid Light, 12, Linear Light, 13, Pin Light, 14, Hard Mix, 15, Difference, 16, Exclusion, 17, Subtract, 18, Divide, 19)]_ALDecalBlendType ("Blend Type", Range(0, 1)) = 0 _ALDecalBlendAlpha ("Alpha", Range(0, 1)) = 1 _ALDecalControlsAlpha ("Override Alpha", Range(0, 1)) = 0 [HideInInspector] m_end_ALDecalSpectrum ("AL ♫ Spectrum", Float) = 0 // Rendering Options [HideInInspector] m_modifierCategory ("Modifiers", Float) = 0 [HideInInspector] m_start_uvDistortion (" Distortion UV--{reference_property:_EnableDistortion}", Float) = 0 [HideInInspector][ThryToggle(USER_LUT)] _EnableDistortion ("Enabled?", Float) = 0 [ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6)] _DistortionUvToDistort ("Distorted UV", Int) = 0 _DistortionMask ("Mask--{reference_properties:[_DistortionMaskPan, _DistortionMaskUV]}", 2D) = "white" { } [HideInInspector][Vector2]_DistortionMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6)] _DistortionMaskUV ("UV", Int) = 0 _DistortionFlowTexture ("Distortion Texture 1--{reference_properties:[_DistortionFlowTexturePan, _DistortionFlowTextureUV]}", 2D) = "black" { } [HideInInspector][Vector2]_DistortionFlowTexturePan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6)] _DistortionFlowTextureUV ("UV", Int) = 0 _DistortionFlowTexture1 ("Distortion Texture 2--{reference_properties:[_DistortionFlowTexture1Pan, _DistortionFlowTexture1UV]}", 2D) = "black" { } [HideInInspector][Vector2]_DistortionFlowTexture1Pan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6)] _DistortionFlowTexture1UV ("UV", Int) = 0 _DistortionStrength ("Strength1", Float) = 0.03 _DistortionStrength1 ("Strength2", Float) = 0.01 [HideInInspector] m_end_uvDistortion ("Distortion UV", Float) = 0 [HideInInspector] m_start_uvPanosphere ("Panosphere UV", Float) = 0 [ToggleUI] _StereoEnabled ("Stereo Enabled", Float) = 0 [ToggleUI] _PanoUseBothEyes ("Perspective Correct (VR)", Float) = 1 [HideInInspector] m_end_uvPanosphere ("Panosphere UV", Float) = 0 [HideInInspector] m_start_uvPolar ("Polar UV", Float) = 0 [ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5)] _PolarUV ("UV", Int) = 0 [Vector2]_PolarCenter ("Center Coordinate", Vector) = (.5, .5, 0, 0) _PolarRadialScale ("Radial Scale", Float) = 1 _PolarLengthScale ("Length Scale", Float) = 1 _PolarSpiralPower ("Spiral Power", Float) = 0 [HideInInspector] m_end_uvPolar ("Polar UV", Float) = 0 [HideInInspector] m_start_parallax (" Parallax Heightmapping--{reference_property:_PoiParallax}", Float) = 0 [HideInInspector][ThryToggle(POI_PARALLAX)]_PoiParallax ("Enable", Float) = 0 [ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_ParallaxUV ("Applies To: ", Int) = 0 [ThryTexture]_Heightmap ("Heightmap--{reference_properties:[_HeightmapPan, _HeightmapUV]}", 2D) = "white" { } [HideInInspector][Vector2]_HeightmapPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_HeightmapUV ("UV", Int) = 0 [ThryTexture]_Heightmask ("Mask--{reference_properties:[_HeightmaskPan, _HeightmaskUV, _HeightmaskInvert]}", 2D) = "white" { } [HideInInspector][Vector2]_HeightmaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ToggleUI]_HeightmaskInvert ("Invert", Float) = 0 [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_HeightmaskUV ("UV", Int) = 0 _HeightStrength ("Strength", Range(0, 0.1)) = 0.02 _HeightOffset ("Offset", Range(-1, 1)) = 0 [IntRange]_HeightSteps ("Steps", Range(0, 20)) = 10 // [ThryToggle]_ParallaxUV0 ("UV0", Float) = 0 // [ThryToggle]_ParallaxUV1 ("UV1", Float) = 0 // [ThryToggle]_ParallaxUV2 ("UV2", Float) = 0 // [ThryToggle]_ParallaxUV3 ("UV3", Float) = 0 // [ThryToggle]_ParallaxPano ("Panosphere", Float) = 0 // [ThryToggle]_ParallaxWorldPos ("World Pos", Float) = 0 // [ThryToggle]_ParallaxPolar ("Polar", Float) = 0 // [ThryToggle]_ParallaxDist ("Distorted UV", Float) = 0 [HideInInspector] m_end_parallax ("Parallax Heightmapping", Float) = 0 //Third party [HideInInspector] m_thirdpartyCategory ("Third Party", Float) = 0 // Rendering Options [HideInInspector] m_postprocessing ("Post Processing", Float) = 0 [HideInInspector] m_start_PoiLightData ("PP Animations ", Float) = 0 [Helpbox(1)] _PPHelp ("This section meant for rael time adjustments through animations and not to be changed in unity", Int) = 0 _PPLightingMultiplier ("Lighting Mulitplier", Float) = 1 _PPLightingAddition ("Lighting Add", Float) = 0 _PPEmissionMultiplier ("Emission Multiplier", Float) = 1 _PPFinalColorMultiplier ("Final Color Multiplier", Float) = 1 [HideInInspector] m_end_PoiLightData ("PP Animations ", Float) = 0 [HideInInspector] m_start_postprocess ("Post Processing--{reference_property:_PostProcess}", Float) = 0 [HideInInspector][ThryToggle(MOCHIE_POSTPROCESS)]_PostProcess ("Enable", Float) = 0 [ThryTexture] _PPMask("Mask--{reference_properties:[_PPMaskPan, _PPMaskUV, _PPMaskInvert]}", 2D) = "white" { } [HideInInspector][Vector2]_PPMaskPan ("Panning", Vector) = (0, 0, 0, 0) [HideInInspector][ToggleUI]_PPMaskInvert ("Invert", Float) = 0 [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7)]_PPMaskUV ("UV", Int) = 0 [NoScaleOffset][ThryTexture] _PPLUT("LUT", 2D) = "white" {} _PPLUTStrength("LUT Strength", Range(0,1)) = 0 _PPHue("Hue", Range(0,1)) = 0 [HDR]_PPTint("Tint", Color) = (1,1,1,1) [Vector3]_PPRGB("RGB", Vector) = (1,1,1,1) _PPContrast("Contrast", Float) = 1 _PPSaturation("Saturation", Float) = 1 _PPBrightness("Brightness", Float) = 1 _PPLightness("Lightness", Float) = 0 _PPHDR("HDR", Float) = 0 [HideInInspector] m_end_postprocess ("", Float) = 0 // Rendering Options [HideInInspector] m_renderingCategory ("Rendering", Float) = 0 [Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", Float) = 2 [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Float) = 4 [Enum(Off, 0, On, 1)] _ZWrite ("ZWrite", Int) = 1 [Enum(Thry.ColorMask)] _ColorMask ("Color Mask", Int) = 15 _OffsetFactor ("Offset Factor", Float) = 0.0 _OffsetUnits ("Offset Units", Float) = 0.0 [ToggleUI]_RenderingReduceClipDistance ("Reduce Clip Distance", Float) = 0 [ToggleUI]_IgnoreFog ("Ignore Fog", Float) = 0 [HideInInspector] Instancing ("Instancing", Float) = 0 //add this property for instancing variants settings to be shown [ThryWideEnum(Standard,0,Toon,1,Toon Cutout,2)] enum_fallback("VRC Fallback--{on_value:''0,tag::VRCFallback=Cutout;1,tag::VRCFallback=Toon;2,tag::VRCFallback=ToonCutout''}", Float) = 0 // Blending Options [HideInInspector] m_start_blending ("Blending", Float) = 0 [Enum(Thry.BlendOp)]_BlendOp ("RGB Blend Op", Int) = 0 [Enum(Thry.BlendOp)]_BlendOpAlpha ("Alpha Blend Op", Int) = 0 [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Source Blend", Int) = 1 [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Destination Blend", Int) = 0 [HideInInspector] m_end_blending ("Blending", Float) = 0 // Stencils [HideInInspector] m_start_StencilPassOptions ("Stencil", Float) = 0 [IntRange] _StencilRef ("Stencil Reference Value", Range(0, 255)) = 0 [IntRange] _StencilReadMask ("Stencil ReadMask Value", Range(0, 255)) = 255 [IntRange] _StencilWriteMask ("Stencil WriteMask Value", Range(0, 255)) = 255 [Enum(UnityEngine.Rendering.StencilOp)] _StencilPassOp ("Stencil Pass Op", Float) = 0 [Enum(UnityEngine.Rendering.StencilOp)] _StencilFailOp ("Stencil Fail Op", Float) = 0 [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFailOp ("Stencil ZFail Op", Float) = 0 [Enum(UnityEngine.Rendering.CompareFunction)] _StencilCompareFunction ("Stencil Compare Function", Float) = 8 [HideInInspector] m_end_StencilPassOptions ("Stencil", Float) = 0 } SubShader { Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "VRCFallback" = "Standard" } Pass { Tags { "LightMode" = "ForwardBase" } Stencil { Ref [_StencilRef] ReadMask [_StencilReadMask] WriteMask [_StencilWriteMask] Comp [_StencilCompareFunction] Pass [_StencilPassOp] Fail [_StencilFailOp] ZFail [_StencilZFailOp] } ZWrite [_ZWrite] Cull [_Cull] AlphaToMask [_AlphaToCoverage] ZTest [_ZTest] ColorMask [_ColorMask] Offset [_OffsetFactor], [_OffsetUnits] BlendOp [_BlendOp], [_BlendOpAlpha] Blend [_SrcBlend] [_DstBlend] CGPROGRAM #pragma target 5.0 #pragma shader_feature_local POI_UDIMDISCARD #pragma shader_feature USER_LUT #pragma shader_feature_local POI_PARALLAX #pragma shader_feature COLOR_GRADING_LOG_VIEW #pragma shader_feature_local POI_LIGHT_DATA_DEBUG #pragma shader_feature_local POI_LIGHT_DATA_ADDITIVE_ENABLE #pragma shader_feature_local POI_LIGHT_DATA_ADDITIVE_DIRECTIONAL_ENABLE #pragma shader_feature_local POI_VERTEXLIGHT_ON #pragma shader_feature COLOR_GRADING_HDR //#pragma shader_feature KEYWORD #pragma shader_feature FINALPASS #pragma shader_feature AUTO_EXPOSURE #pragma shader_feature_local POI_BACKFACE #pragma shader_feature VIGNETTE #pragma shader_feature GEOM_TYPE_MESH #pragma shader_feature DISTORT #pragma shader_feature VIGNETTE_MASKED #pragma shader_feature_local _LIGHTINGMODE_TEXTURERAMP _LIGHTINGMODE_MATHRAMP _LIGHTINGMODE_SHADEMAP _LIGHTINGMODE_REALISTIC _LIGHTINGMODE_WRAPPED _LIGHTINGMODE_SKIN _LIGHTINGMODE_FLAT #pragma shader_feature COLOR_GRADING_HDR_3D #pragma shader_feature_local POI_MATCAP0 #pragma shader_feature_local POI_MATCAP0_CUSTOM_NORMAL #pragma shader_feature_local POI_MATCAP1_CUSTOM_NORMAL #pragma shader_feature_local _CUBEMAP #pragma shader_feature GEOM_TYPE_BRANCH #pragma shader_feature GEOM_TYPE_BRANCH_DETAIL #pragma shader_feature GEOM_TYPE_FROND #pragma shader_feature DEPTH_OF_FIELD_COC_VIEW #pragma shader_feature_local POI_AL_DECAL #pragma shader_feature _SUNDISK_HIGH_QUALITY #pragma shader_feature _EMISSION #pragma shader_feature_local POI_EMISSION_1 #pragma shader_feature_local POI_EMISSION_2 #pragma shader_feature_local POI_EMISSION_3 #pragma shader_feature _GLOSSYREFLECTIONS_OFF #pragma shader_feature _SUNDISK_SIMPLE #pragma shader_feature_local MOCHIE_PBR #pragma shader_feature_local _COLORCOLOR_ON #pragma shader_feature_local POI_ENVIRORIM #pragma shader_feature_local POI_STYLIZED_StylizedSpecular #pragma shader_feature_local POI_PATHING #pragma shader_feature_local POI_MIRROR #pragma shader_feature GRAIN #pragma shader_feature_local POI_IRIDESCENCE #pragma shader_feature EFFECT_BUMP #pragma shader_feature_local MOCHIE_POSTPROCESS #pragma shader_feature VERTEXLIGHT_ON #pragma multi_compile_fwdbase #pragma multi_compile_instancing #pragma multi_compile_fog #pragma multi_compile _ VERTEXLIGHT_ON #define POI_PASS_BASE // UNITY Includes #include "UnityCG.cginc" #include "UnityStandardUtils.cginc" #include "AutoLight.cginc" #include "UnityLightingCommon.cginc" #include "UnityPBSLighting.cginc" #pragma vertex vert #pragma fragment frag #define DielectricSpec float4(0.04, 0.04, 0.04, 1.0 - 0.04) #define pi float(3.14159265359) #define POI2D_SAMPLER_PAN(tex, texSampler, uv, pan) (UNITY_SAMPLE_TEX2D_SAMPLER(tex, texSampler, uv + _Time.x * pan)) #define POI2D_SAMPLER_PANGRAD(tex, texSampler, uv, pan, ddx, ddy) (UNITY_SAMPLE_TEX2D_SAMPLER(tex, texSampler, uv + _Time.x * pan, ddx, ddy)) #define POI2D_SAMPLER(tex, texSampler, uv) (UNITY_SAMPLE_TEX2D_SAMPLER(tex, texSampler, uv)) #define POI2D_PAN(tex, uv, pan) (tex2D(tex, uv + _Time.x * pan)) #define POI2D(tex, uv) (tex2D(tex, uv)) #define POI_SAMPLE_TEX2D(tex, uv) (UNITY_SAMPLE_TEX2D(tex, uv)) #define POI_SAMPLE_TEX2D_PAN(tex, uv, pan) (UNITY_SAMPLE_TEX2D(tex, uv + _Time.x * pan)) #define POI_SAFE_RGB1 float4(mainTexture.rgb * .0001, 1) #define POI_SAFE_RGBA mainTexture #if defined(UNITY_COMPILER_HLSL) #define PoiInitStruct(type, name) name = (type)0; #else #define PoiInitStruct(type, name) #endif #define POI_ERROR(poiMesh, gridSize) lerp(float3(1, 0, 1), float3(0, 0, 0), fmod(floor((poiMesh.worldPos.x) * gridSize) + floor((poiMesh.worldPos.y) * gridSize) + floor((poiMesh.worldPos.z) * gridSize), 2) == 0) #define POI_MODE_OPAQUE 0 #define POI_MODE_CUTOUT 1 #define POI_MODE_FADE 2 #define POI_MODE_TRANSPARENT 3 #define POI_MODE_ADDITIVE 4 #define POI_MODE_SOFTADDITIVE 5 #define POI_MODE_MULTIPLICATIVE 6 #define POI_MODE_2XMULTIPLICATIVE 7 #define POI_MODE_TRANSCLIPPING 9 /* Texture2D ; float4 _ST; float2 Pan; float UV; [HideInInspector][ThryWideEnum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, Panosphere, 4, World Pos XZ, 5, Polar UV, 6, Distorted UV, 7 )] */ // Map of where features in AudioLink are. #define ALPASS_DFT uint2(0,4) //Size: 128, 2 #define ALPASS_WAVEFORM uint2(0,6) //Size: 128, 16 #define ALPASS_AUDIOLINK uint2(0,0) //Size: 128, 4 #define ALPASS_AUDIOBASS uint2(0,0) //Size: 128, 1 #define ALPASS_AUDIOLOWMIDS uint2(0,1) //Size: 128, 1 #define ALPASS_AUDIOHIGHMIDS uint2(0,2) //Size: 128, 1 #define ALPASS_AUDIOTREBLE uint2(0,3) //Size: 128, 1 #define ALPASS_AUDIOLINKHISTORY uint2(1,0) //Size: 127, 4 #define ALPASS_GENERALVU uint2(0,22) //Size: 12, 1 #define ALPASS_CCINTERNAL uint2(12,22) //Size: 12, 2 #define ALPASS_CCCOLORS uint2(25,22) //Size: 11, 1 #define ALPASS_CCSTRIP uint2(0,24) //Size: 128, 1 #define ALPASS_CCLIGHTS uint2(0,25) //Size: 128, 2 #define ALPASS_AUTOCORRELATOR uint2(0,27) //Size: 128, 1 #define ALPASS_GENERALVU_INSTANCE_TIME uint2(2,22) #define ALPASS_GENERALVU_LOCAL_TIME uint2(3,22) #define ALPASS_GENERALVU_NETWORK_TIME uint2(4,22) #define ALPASS_GENERALVU_PLAYERINFO uint2(6,22) // Added in version 2.5 #define ALPASS_FILTEREDAUDIOLINK uint2(0,28) //Size: 16, 4 // Added in version 2.6 #define ALPASS_CHRONOTENSITY uint2(16,28) //Size: 8, 4 #define ALPASS_THEME_COLOR0 uint2(0,23) #define ALPASS_THEME_COLOR1 uint2(1,23) #define ALPASS_THEME_COLOR2 uint2(2,23) #define ALPASS_THEME_COLOR3 uint2(3,23) #define ALPASS_FILTEREDVU uint2(24,28) //Size: 4, 4 #define ALPASS_FILTEREDVU_INTENSITY uint2(24,28) //Size: 4, 1 #define ALPASS_FILTEREDVU_MARKER uint2(24,29) //Size: 4, 1 // Some basic constants to use (Note, these should be compatible with // future version of AudioLink, but may change. #define AUDIOLINK_SAMPHIST 3069 // Internal use for algos, do not change. #define AUDIOLINK_SAMPLEDATA24 2046 #define AUDIOLINK_EXPBINS 24 #define AUDIOLINK_EXPOCT 10 #define AUDIOLINK_ETOTALBINS (AUDIOLINK_EXPBINS * AUDIOLINK_EXPOCT) #define AUDIOLINK_WIDTH 128 #define AUDIOLINK_SPS 48000 // Samples per second #define AUDIOLINK_ROOTNOTE 0 #define AUDIOLINK_4BAND_FREQFLOOR 0.123 #define AUDIOLINK_4BAND_FREQCEILING 1 #define AUDIOLINK_BOTTOM_FREQUENCY 13.75 #define AUDIOLINK_BASE_AMPLITUDE 2.5 #define AUDIOLINK_DELAY_COEFFICIENT_MIN 0.3 #define AUDIOLINK_DELAY_COEFFICIENT_MAX 0.9 #define AUDIOLINK_DFT_Q 4.0 #define AUDIOLINK_TREBLE_CORRECTION 5.0 // ColorChord constants #define COLORCHORD_EMAXBIN 192 #define COLORCHORD_IIR_DECAY_1 0.90 #define COLORCHORD_IIR_DECAY_2 0.85 #define COLORCHORD_CONSTANT_DECAY_1 0.01 #define COLORCHORD_CONSTANT_DECAY_2 0.0 #define COLORCHORD_NOTE_CLOSEST 3.0 #define COLORCHORD_NEW_NOTE_GAIN 8.0 #define COLORCHORD_MAX_NOTES 10 // We use glsl_mod for most calculations because it behaves better // on negative numbers, and in some situations actually outperforms // HLSL's modf(). #ifndef glsl_mod #define glsl_mod(x, y) (((x) - (y) * floor((x) / (y)))) #endif uniform float4 _AudioTexture_TexelSize; #ifdef SHADER_TARGET_SURFACE_ANALYSIS #define AUDIOLINK_STANDARD_INDEXING #endif // Mechanism to index into texture. #ifdef AUDIOLINK_STANDARD_INDEXING sampler2D _AudioTexture; #define AudioLinkData(xycoord) tex2Dlod(_AudioTexture, float4(uint2(xycoord) * _AudioTexture_TexelSize.xy, 0, 0)) #else uniform Texture2D<float4> _AudioTexture; SamplerState sampler_AudioTexture; #define AudioLinkData(xycoord) _AudioTexture[uint2(xycoord)] #endif float _Mode; float4 _GlobalThemeColor0; float4 _GlobalThemeColor1; float4 _GlobalThemeColor2; float4 _GlobalThemeColor3; #ifdef POI_UDIMDISCARD float _UDIMDiscardMode; float _UDIMDiscardUV; float4 _UDIMDiscardRow3; float4 _UDIMDiscardRow2; float4 _UDIMDiscardRow1; float4 _UDIMDiscardRow0; #endif #ifdef USER_LUT #if defined(PROP_DISTORTIONFLOWTEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _DistortionFlowTexture; float4 _DistortionFlowTexture_ST; float2 _DistortionFlowTexturePan; float _DistortionFlowTextureUV; #endif #if defined(PROP_DISTORTIONFLOWTEXTURE1) || !defined(OPTIMIZER_ENABLED) Texture2D _DistortionFlowTexture1; float4 _DistortionFlowTexture1_ST; float2 _DistortionFlowTexture1Pan; float _DistortionFlowTexture1UV; #endif #if defined(PROP_DISTORTIONMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _DistortionMask; float4 _DistortionMask_ST; float2 _DistortionMaskPan; float _DistortionMaskUV; #endif float _DistortionUvToDistort; float _DistortionStrength; float _DistortionStrength1; #endif float _StereoEnabled; float _PolarUV; float2 _PolarCenter; float _PolarRadialScale; float _PolarLengthScale; float _PolarSpiralPower; float _PanoUseBothEyes; #ifdef POI_PARALLAX Texture2D _Heightmap; float4 _Heightmap_ST; float2 _HeightmapPan; float _HeightmapUV; #if defined(PROP_HEIGHTMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _Heightmask; #endif float4 _Heightmask_ST; float2 _HeightmaskPan; float _HeightmaskUV; float _HeightmaskInvert; float _ParallaxUV; float _HeightStrength; float _HeightOffset; float _HeightSteps; // float _ParallaxUV0; // float _ParallaxUV1; // float _ParallaxUV2; // float _ParallaxUV3; // float _ParallaxPano; // float _ParallaxWorldPos; // float _ParallaxPolar; // float _ParallaxDist; #endif #ifdef COLOR_GRADING_LOG_VIEW float _AudioLinkDelay; float _AudioLinkAnimToggle; float _DebugWaveform; float _DebugDFT; float _DebugBass; float _DebugLowMids; float _DebugHighMids; float _DebugTreble; float _DebugCCColors; float _DebugCCStrip; float _DebugCCLights; float _DebugAutocorrelator; float _DebugChronotensity; float _AudioLinkCCStripY; #endif #if defined(PROP_LIGHTINGAOMAPS) || !defined(OPTIMIZER_ENABLED) Texture2D _LightingAOMaps; #endif float4 _LightingAOMaps_ST; float2 _LightingAOMapsPan; float _LightingAOMapsUV; float _LightDataAOStrengthR; float _LightDataAOStrengthG; float _LightDataAOStrengthB; float _LightDataAOStrengthA; #if defined(PROP_LIGHTINGDETAILSHADOWMAPS) || !defined(OPTIMIZER_ENABLED) Texture2D _LightingDetailShadowMaps; #endif float4 _LightingDetailShadowMaps_ST; float2 _LightingDetailShadowMapsPan; float _LightingDetailShadowMapsUV; float _LightingDetailShadowStrengthR; float _LightingDetailShadowStrengthG; float _LightingDetailShadowStrengthB; float _LightingDetailShadowStrengthA; #if defined(PROP_LIGHTINGSHADOWMASKS) || !defined(OPTIMIZER_ENABLED) Texture2D _LightingShadowMasks; #endif float4 _LightingShadowMasks_ST; float2 _LightingShadowMasksPan; float _LightingShadowMasksUV; float _LightingShadowMaskStrengthR; float _LightingShadowMaskStrengthG; float _LightingShadowMaskStrengthB; float _LightingShadowMaskStrengthA; // Lighting Data float _Unlit_Intensity; float _LightingColorMode; float _LightingMapMode; float _LightingDirectionMode; float3 _LightngForcedDirection; float _LightingIndirectUsesNormals; float _LightingCapEnabled; float _LightingCap; float _LightingForceColorEnabled; float3 _LightingForcedColor; float _LightingForcedColorThemeIndex; float _LightingCastedShadows; float _LightingMonochromatic; float _LightingMinLightBrightness; // Additive Lighting Data float _LightingAdditiveLimited; float _LightingAdditiveLimit; float _LightingAdditivePassthrough; // Lighting Data Debug float _LightingDebugVisualize; float _IgnoreFog; float _RenderingReduceClipDistance; float4 _Color; float _ColorThemeIndex; UNITY_DECLARE_TEX2D(_MainTex); float4 _MainTex_ST; float2 _MainTexPan; float _MainTexUV; float4 _MainTex_TexelSize; Texture2D _BumpMap; float4 _BumpMap_ST; float2 _BumpMapPan; float _BumpMapUV; float _BumpScale; Texture2D _ClippingMask; float4 _ClippingMask_ST; float2 _ClippingMaskPan; float _ClippingMaskUV; float _Inverse_Clipping; float _Cutoff; float _MainColorAdjustToggle; #if defined(PROP_MAINCOLORADJUSTTEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _MainColorAdjustTexture; #endif float4 _MainColorAdjustTexture_ST; float2 _MainColorAdjustTexturePan; float _MainColorAdjustTextureUV; float _MainHueShiftToggle; float _MainHueShiftReplace; float _MainHueShift; float _MainHueShiftSpeed; float _Saturation; float _MainBrightness; float _MainHueALCTEnabled; float _MainALHueShiftBand; float _MainALHueShiftCTIndex; float _MainHueALMotionSpeed; SamplerState sampler_linear_clamp; SamplerState sampler_linear_repeat; float _AlphaForceOpaque; float _AlphaMod; float _AlphaPremultiply; float _AlphaToCoverage; float _AlphaSharpennedA2C; float _AlphaMipScale; float _AlphaDithering; float _AlphaDitherGradient; float _AlphaDistanceFade; float _AlphaDistanceFadeType; float _AlphaDistanceFadeMinAlpha; float _AlphaDistanceFadeMaxAlpha; float _AlphaDistanceFadeMin; float _AlphaDistanceFadeMax; float _AlphaFresnel; float _AlphaFresnelAlpha; float _AlphaFresnelSharpness; float _AlphaFresnelWidth; float _AlphaFresnelInvert; float _AlphaAngular; float _AngleType; float _AngleCompareTo; float3 _AngleForwardDirection; float _CameraAngleMin; float _CameraAngleMax; float _ModelAngleMin; float _ModelAngleMax; float _AngleMinAlpha; float _AlphaAudioLinkEnabled; float2 _AlphaAudioLinkAddRange; float _AlphaAudioLinkAddBand; /* Texture2D ; float4 _ST; float2 Pan; float UV; */ #ifdef FINALPASS #if defined(PROP_DETAILMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _DetailMask; #endif float4 _DetailMask_ST; float2 _DetailMaskPan; float _DetailMaskUV; #if defined(PROP_DETAILNORMALMAP) || !defined(OPTIMIZER_ENABLED) Texture2D _DetailNormalMap; #endif float4 _DetailNormalMap_ST; float2 _DetailNormalMapPan; float _DetailNormalMapUV; #if defined(PROP_DETAILTEX) || !defined(OPTIMIZER_ENABLED) Texture2D _DetailTex; #endif float4 _DetailTex_ST; float2 _DetailTexPan; float _DetailTexUV; float3 _DetailTint; float _DetailTintThemeIndex; float _DetailTexIntensity; float _DetailBrightness; float _DetailNormalMapScale; #endif #ifdef AUTO_EXPOSURE float4 _VertexManipulationLocalTranslation; float4 _VertexManipulationLocalRotation; float3 _VertexManipulationLocalRotationSpeed; float4 _VertexManipulationLocalScale; float4 _VertexManipulationWorldTranslation; float _VertexManipulationHeight; sampler2D _VertexManipulationHeightMask; float4 _VertexManipulationHeightMask_ST; float2 _VertexManipulationHeightMaskPan; float _VertexManipulationHeightMaskUV; float _VertexManipulationHeightBias; float _VertexRoundingEnabled; float _VertexRoundingDivision; //AL float3 _VertexLocalTranslationALMin; float3 _VertexLocalTranslationALMax; float _VertexLocalTranslationALBand; float3 _VertexLocalRotationAL; float _VertexLocalRotationALBand; float3 _VertexLocalRotationCTALSpeed; float _VertexLocalRotationCTALBand; float _VertexLocalRotationCTALType; float4 _VertexLocalScaleALMin; float4 _VertexLocalScaleALMax; float _VertexLocalScaleALBand; float3 _VertexWorldTranslationALMin; float3 _VertexWorldTranslationALMax; float _VertexWorldTranslationALBand; float2 _VertexManipulationHeightAL; float _VertexManipulationHeightBand; float2 _VertexRoundingRangeAL; float _VertexRoundingRangeBand; #endif /* Texture2D ; float4 _ST; float2 Pan; float UV; */ float _MainVertexColoringLinearSpace; float _MainVertexColoring; float _MainUseVertexColorAlpha; #ifdef POI_BACKFACE float _BackFaceEnabled; float _BackFaceDetailIntensity; float _BackFaceEmissionStrength; float2 _BackFacePanning; float4 _BackFaceColor; float _BackFaceColorThemeIndex; float _BackFaceReplaceAlpha; float _BackFaceAlpha; #if defined(PROP_BACKFACETEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _BackFaceTexture; #endif float4 _BackFaceTexture_ST; float2 _BackFaceTexturePan; float _BackFaceTextureUV; #if defined(PROP_BACKFACEMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _BackFaceMask; #endif float4 _BackFaceMask_ST; float2 _BackFaceMaskPan; float _BackFaceMaskUV; float _BackFaceHueShiftEnabled; float _BackFaceHueShift; float _BackFaceHueShiftSpeed; #endif //TODO detail strength stuff #ifdef VIGNETTE #if defined(PROP_RGBMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _RGBMask; #endif float4 _RGBMask_ST; float2 _RGBMaskPan; float _RGBMaskUV; #if defined(PROP_REDTEXURE) || !defined(OPTIMIZER_ENABLED) Texture2D _RedTexure; #endif float4 _RedTexure_ST; float2 _RedTexurePan; float _RedTexureUV; #if defined(PROP_GREENTEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _GreenTexture; #endif float4 _GreenTexture_ST; float2 _GreenTexturePan; float _GreenTextureUV; #if defined(PROP_BLUETEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _BlueTexture; #endif float4 _BlueTexture_ST; float2 _BlueTexturePan; float _BlueTextureUV; #if defined(PROP_ALPHATEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _AlphaTexture; #endif float4 _AlphaTexture_ST; float2 _AlphaTexturePan; float _AlphaTextureUV; #ifdef GEOM_TYPE_MESH #if defined(PROP_RGBNORMALR) || !defined(OPTIMIZER_ENABLED) #endif Texture2D _RgbNormalR; float4 _RgbNormalR_ST; float2 _RgbNormalRPan; float _RgbNormalRUV; float _RgbNormalRScale; #if defined(PROP_RGBNORMALG) || !defined(OPTIMIZER_ENABLED) #endif Texture2D _RgbNormalG; float4 _RgbNormalG_ST; float2 _RgbNormalGPan; float _RgbNormalGUV; float _RgbNormalGScale; #if defined(PROP_RGBNORMALB) || !defined(OPTIMIZER_ENABLED) #endif Texture2D _RgbNormalB; float4 _RgbNormalB_ST; float2 _RgbNormalBPan; float _RgbNormalBUV; float _RgbNormalBScale; #if defined(PROP_RGBNORMALA) || !defined(OPTIMIZER_ENABLED) #endif Texture2D _RgbNormalA; float4 _RgbNormalA_ST; float2 _RgbNormalAPan; float _RgbNormalAUV; float _RgbNormalAScale; float _RgbNormalsEnabled; #endif float4 _RedColor; float4 _GreenColor; float4 _BlueColor; float4 _AlphaColor; float _RedColorThemeIndex; float _GreenColorThemeIndex; float _BlueColorThemeIndex; float _AlphaColorThemeIndex; float _RGBBlendMultiplicative; float _RGBUseVertexColors; float _RGBNormalBlend; #endif /* Texture2D ; float4 _ST; float2 Pan; float UV; */ #ifdef DISTORT float _DissolveType; float _DissolveEdgeWidth; float4 _DissolveEdgeColor; sampler2D _DissolveEdgeGradient; float4 _DissolveEdgeGradient_ST; float2 _DissolveEdgeGradientPan; float _DissolveEdgeGradientUV; float _DissolveEdgeEmission; float4 _DissolveTextureColor; float _DissolveEdgeColorThemeIndex; float _DissolveTextureColorThemeIndex; #if defined(PROP_DISSOLVETOTEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _DissolveToTexture; #endif float4 _DissolveToTexture_ST; float2 _DissolveToTexturePan; float _DissolveToTextureUV; #if defined(PROP_DISSOLVENOISETEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _DissolveNoiseTexture; #endif float4 _DissolveNoiseTexture_ST; float2 _DissolveNoiseTexturePan; float _DissolveNoiseTextureUV; #if defined(PROP_DISSOLVEDETAILNOISE) || !defined(OPTIMIZER_ENABLED) Texture2D _DissolveDetailNoise; #endif float4 _DissolveDetailNoise_ST; float2 _DissolveDetailNoisePan; float _DissolveDetailNoiseUV; #if defined(PROP_DISSOLVEMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _DissolveMask; #endif float4 _DissolveMask_ST; float2 _DissolveMaskPan; float _DissolveMaskUV; float _DissolveMaskInvert; float _DissolveAlpha; float _ContinuousDissolve; float _DissolveDetailStrength; float _DissolveEdgeHardness; float _DissolveInvertNoise; float _DissolveInvertDetailNoise; float _DissolveToEmissionStrength; // Point to Point float _DissolveP2PWorldLocal; float _DissolveP2PEdgeLength; float4 _DissolveStartPoint; float4 _DissolveEndPoint; // World Dissolve float _DissolveWorldShape; float4 _DissolveShapePosition; float4 _DissolveShapeRotation; float _DissolveShapeScale; float _DissolveInvertShape; float _DissolveShapeEdgeLength; float _DissolveAlpha0; float _DissolveAlpha1; float _DissolveAlpha2; float _DissolveAlpha3; float _DissolveAlpha4; float _DissolveAlpha5; float _DissolveAlpha6; float _DissolveAlpha7; float _DissolveAlpha8; float _DissolveAlpha9; // Masking float _DissolveEmissionSide; float _DissolveEmission1Side; float _DissolveUseVertexColors; float4 edgeColor; float edgeAlpha; float dissolveAlpha; float4 dissolveToTexture; float _DissolveHueShiftEnabled; float _DissolveHueShiftSpeed; float _DissolveHueShift; float _DissolveEdgeHueShiftEnabled; float _DissolveEdgeHueShiftSpeed; float _DissolveEdgeHueShift; #endif /* Texture2D ; float4 _ST; float2 Pan; float UV; */ // Toon Lighting UNITY_DECLARE_TEX2D(_ToonRamp); float _ShadowOffset; float _ShadowStrength; float _LightingIgnoreAmbientColor; // Math Toon Lighting float _LightingGradientStart; float _LightingGradientEnd; float3 _LightingShadowColor; float _LightingGradientStartWrap; float _LightingGradientEndWrap; // ShadeMap Lighting float3 _1st_ShadeColor; Texture2D _1st_ShadeMap; float4 _1st_ShadeMap_ST; float2 _1st_ShadeMapPan; float _1st_ShadeMapUV; float _Use_1stShadeMapAlpha_As_ShadowMask; float _1stShadeMapMask_Inverse; float _Use_BaseAs1st; float3 _2nd_ShadeColor; Texture2D _2nd_ShadeMap; float4 _2nd_ShadeMap_ST; float2 _2nd_ShadeMapPan; float _2nd_ShadeMapUV; float _Use_2ndShadeMapAlpha_As_ShadowMask; float _2ndShadeMapMask_Inverse; float _Use_1stAs2nd; float _BaseColor_Step; float _BaseShade_Feather; float _ShadeColor_Step; float _1st2nd_Shades_Feather; float _ShadingShadeMapBlendType; // Realistic Lighting float _LightingStandardSmoothness; // Skin sampler2D _SkinLUT; float _SssScale; float _SssBumpBlur; float3 _SssTransmissionAbsorption; float3 _SssColorBleedAoWeights; // Additive float _LightingAdditiveType; float _LightingAdditiveGradientStart; float _LightingAdditiveGradientEnd; float _LightingAdditiveDetailStrength; float _LightingAdditiveLimitIntensity; float _LightingAdditiveMaxIntensity; #ifdef POI_MATCAP0 #if defined(PROP_MATCAP) || !defined(OPTIMIZER_ENABLED) Texture2D _Matcap; float4 _Matcap_ST; float2 _MatcapPan; float _MatcapUV; #endif #if defined(PROP_MATCAPMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _MatcapMask; float4 _MatcapMask_ST; float2 _MatcapMaskPan; float _MatcapMaskUV; #endif #ifdef POI_MATCAP0_CUSTOM_NORMAL #if defined(PROP_MATCAP0NORMALMAP) || !defined(OPTIMIZER_ENABLED) Texture2D _Matcap0NormalMap; float4 _Matcap0NormalMap_ST; float2 _Matcap0NormalMapPan; float _Matcap0NormalMapUV; #endif float _Matcap0NormalMapScale; #endif float _MatcapUVMode; float _MatcapMaskInvert; float _MatcapBorder; float4 _MatcapColor; float _MatcapColorThemeIndex; float _MatcapIntensity; float _MatcapReplace; float _MatcapMultiply; float _MatcapAdd; float _MatcapAlphaOverride; float _MatcapEnable; float _MatcapLightMask; float _MatcapEmissionStrength; float _MatcapNormal; float _MatcapHueShiftEnabled; float _MatcapHueShiftSpeed; float _MatcapHueShift; #endif #ifdef COLOR_GRADING_HDR_3D #if defined(PROP_MATCAP2) || !defined(OPTIMIZER_ENABLED) Texture2D _Matcap2; float4 _Matcap2_ST; float2 _Matcap2Pan; float _Matcap2UV; #endif #if defined(PROP_MATCAP2MASK) || !defined(OPTIMIZER_ENABLED) Texture2D _Matcap2Mask; float4 _Matcap2Mask_ST; float2 _Matcap2MaskPan; float _Matcap2MaskUV; #endif #ifdef POI_MATCAP1_CUSTOM_NORMAL #if defined(PROP_MATCAP1NORMALMAP) || !defined(OPTIMIZER_ENABLED) Texture2D _Matcap1NormalMap; float4 _Matcap1NormalMap_ST; float2 _Matcap1NormalMapPan; float _Matcap1NormalMapUV; #endif float _Matcap1NormalMapScale; #endif float _Matcap2UVMode; float _Matcap2MaskInvert; float _Matcap2Border; float4 _Matcap2Color; float _Matcap2ColorThemeIndex; float _Matcap2Intensity; float _Matcap2Replace; float _Matcap2Multiply; float _Matcap2Add; float _Matcap2AlphaOverride; float _Matcap2Enable; float _Matcap2LightMask; float _Matcap2EmissionStrength; float _Matcap2Normal; float _Matcap2HueShiftEnabled; float _Matcap2HueShiftSpeed; float _Matcap2HueShift; #endif #ifdef _CUBEMAP #if defined(PROP_CUBEMAP) || !defined(OPTIMIZER_ENABLED) samplerCUBE _CubeMap; #endif #if defined(PROP_CUBEMAPMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _CubeMapMask; float4 _CubeMapMask_ST; float2 _CubeMapMaskPan; float _CubeMapMaskUV; #endif float _CubeMapUVMode; float _CubeMapMaskInvert; float4 _CubeMapColor; float _CubeMapColorThemeIndex; float _CubeMapIntensity; float _CubeMapReplace; float _CubeMapMultiply; float _CubeMapAdd; float _CubeMapEnable; float _CubeMapLightMask; float _CubeMapEmissionStrength; float _CubeMapNormal; float _CubeMapHueShiftEnabled; float _CubeMapHueShiftSpeed; float _CubeMapHueShift; #endif /* Texture2D ; float4 _ST; float2 Pan; float UV; */ Texture2D _DecalMask; float4 _DecalMask_ST; float2 _DecalMaskPan; float _DecalMaskUV; #ifdef COLOR_GRADING_LOG_VIEW // Audio Link half _AudioLinkDecal0ScaleBand; float4 _AudioLinkDecal0Scale; half _AudioLinkDecal0RotationBand; float2 _AudioLinkDecal0Rotation; half _AudioLinkDecal0AlphaBand; float2 _AudioLinkDecal0Alpha; half _AudioLinkDecal0EmissionBand; float2 _AudioLinkDecal0Emission; half _AudioLinkDecal1ScaleBand; float4 _AudioLinkDecal1Scale; half _AudioLinkDecal1RotationBand; float2 _AudioLinkDecal1Rotation; half _AudioLinkDecal1AlphaBand; float2 _AudioLinkDecal1Alpha; half _AudioLinkDecal1EmissionBand; float2 _AudioLinkDecal1Emission; half _AudioLinkDecal2ScaleBand; float4 _AudioLinkDecal2Scale; half _AudioLinkDecal2RotationBand; float2 _AudioLinkDecal2Rotation; half _AudioLinkDecal2AlphaBand; float2 _AudioLinkDecal2Alpha; half _AudioLinkDecal2EmissionBand; float2 _AudioLinkDecal2Emission; half _AudioLinkDecal3ScaleBand; float4 _AudioLinkDecal3Scale; half _AudioLinkDecal3RotationBand; float2 _AudioLinkDecal3Rotation; half _AudioLinkDecal3AlphaBand; float2 _AudioLinkDecal3Alpha; half _AudioLinkDecal3EmissionBand; float2 _AudioLinkDecal3Emission; float _AudioLinkDecalX; float _AudioLinkDecal3SideBand; float4 _AudioLinkDecal3SideMin; float4 _AudioLinkDecal3SideMax; #endif #ifdef GEOM_TYPE_BRANCH sampler2D _DecalTexture; float4 _DecalTexture_ST; float2 _DecalTexturePan; float _DecalTextureUV; float4 _DecalColor; float _DecalColorThemeIndex; fixed _DecalTiled; float _DecalBlendType; half _DecalRotation; half2 _DecalScale; float4 _DecalSideOffset; half2 _DecalPosition; half _DecalRotationSpeed; float _DecalEmissionStrength; float _DecalBlendAlpha; float _DecalOverideAlpha; float _DecalHueShiftEnabled; float _DecalHueShift; float _DecalHueShiftSpeed; float _Decal0Depth; float _Decal0HueAngleStrength; #endif #ifdef GEOM_TYPE_BRANCH_DETAIL sampler2D _DecalTexture1; float4 _DecalTexture1_ST; float2 _DecalTexture1Pan; float _DecalTexture1UV; float4 _DecalColor1; float _DecalColor1ThemeIndex; fixed _DecalTiled1; float _DecalBlendType1; half _DecalRotation1; half2 _DecalScale1; float4 _DecalSideOffset1; half2 _DecalPosition1; half _DecalRotationSpeed1; float _DecalEmissionStrength1; float _DecalBlendAlpha1; float _DecalOverideAlpha1; float _DecalHueShiftEnabled1; float _DecalHueShift1; float _DecalHueShiftSpeed1; float _Decal1Depth; float _Decal1HueAngleStrength; #endif #ifdef GEOM_TYPE_FROND sampler2D _DecalTexture2; float4 _DecalTexture2_ST; float2 _DecalTexture2Pan; float _DecalTexture2UV; float4 _DecalColor2; float _DecalColor2ThemeIndex; fixed _DecalTiled2; float _DecalBlendType2; half _DecalRotation2; half2 _DecalScale2; float4 _DecalSideOffset2; half2 _DecalPosition2; half _DecalRotationSpeed2; float _DecalEmissionStrength2; float _DecalBlendAlpha2; float _DecalOverideAlpha2; float _DecalHueShiftEnabled2; float _DecalHueShift2; float _DecalHueShiftSpeed2; float _Decal2Depth; float _Decal2HueAngleStrength; #endif #ifdef DEPTH_OF_FIELD_COC_VIEW sampler2D _DecalTexture3; float4 _DecalTexture3_ST; float2 _DecalTexture3Pan; float _DecalTexture3UV; float4 _DecalColor3; float _DecalColor3ThemeIndex; fixed _DecalTiled3; float _DecalBlendType3; half _DecalRotation3; half2 _DecalScale3; float4 _DecalSideOffset3; half2 _DecalPosition3; half _DecalRotationSpeed3; float _DecalEmissionStrength3; float _DecalBlendAlpha3; float _DecalOverideAlpha3; float _DecalHueShiftEnabled3; float _DecalHueShift3; float _DecalHueShiftSpeed3; float _Decal3Depth; float _Decal3HueAngleStrength; #endif /* Texture2D ; float4 _ST; float2 Pan; float UV; */ #ifdef COLOR_GRADING_LOG_VIEW #ifdef POI_AL_DECAL float _ALDecalUV; float4 _ALUVScale; float2 _ALUVPosition; float _ALUVRotation; float _ALUVRotationSpeed; float4 _ALDecaldCircleDimensions; float _ALDecalUVMode; float _ALDecalVolumeStep; float _ALDecalVolumeClipMin; float _ALDecalVolumeClipMax; float _ALDecalBandStep; float _ALDecalBandClipMin; float _ALDecalBandClipMax; float _ALDecalShapeClip; float _ALDecalShapeClipVolumeWidth; float _ALDecalShapeClipBandWidth; float _ALDecalVolume; float _ALDecalBaseBoost; float _ALDecalTrebleBoost; float _ALDecalLineWidth; float _ALDecalVolumeColorSource; float3 _ALDecalVolumeColorLow; float3 _ALDecalVolumeColorMid; float3 _ALDecalVolumeColorHigh; float _ALDecalLowEmission; float _ALDecalMidEmission; float _ALDecalHighEmission; float _ALDecalBlendType; float _ALDecalBlendAlpha; float _ALDecalControlsAlpha; #endif #endif /* Texture2D ; float4 _ST; float2 Pan; float UV; */ #ifdef _SUNDISK_HIGH_QUALITY UNITY_DECLARE_TEX2DARRAY(_FlipbookTexArray); float4 _FlipbookTexArray_ST; float4 _FlipbookColor; float _FlipbookColorThemeIndex; float _FlipbookFPS; float _FlipbookTotalFrames; float4 _FlipbookScaleOffset; float4 _FlipbookSideOffset; float _FlipbookTiled; float _FlipbookCurrentFrame; float _FlipbookEmissionStrength; float _FlipbookRotation; float _EnableFlipbook; float _FlipbookTexArrayUV; float _FlipbookAlphaControlsFinalAlpha; float _FlipbookRotationSpeed; float _FlipbookIntensityControlsAlpha; float _FlipbookColorReplaces; float2 _FlipbookTexArrayPan; // blending float _FlipbookReplace; float _FlipbookMultiply; float _FlipbookAdd; #if defined(PROP_FLIPBOOKMASSK) || !defined(OPTIMIZED_ENABLED) Texture2D _FlipbookMask; #endif float4 _FlipbookMask_ST; float2 _FlipbookMaskPan; float _FlipbookMaskUV; // anim float _FlipbookMovementType; float4 _FlipbookStartEndOffset; float _FlipbookMovementSpeed; // Crossfade float _FlipbookCrossfadeEnabled; float2 _FlipbookCrossfadeRange; // Hueshift float _FlipbookHueShiftEnabled; float _FlipbookHueShiftSpeed; float _FlipbookHueShift; #ifdef COLOR_GRADING_LOG_VIEW float _FlipbookChronotensityEnabled; float _FlipbookChronotensityBand; float _FlipbookChronotensitySpeed; #endif #endif #ifdef _EMISSION #if defined(PROP_EMISSIONMAP) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionMap; #endif float4 _EmissionMap_ST; float2 _EmissionMapPan; float _EmissionMapUV; #if defined(PROP_EMISSIONMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionMask; #endif float4 _EmissionMask_ST; float2 _EmissionMaskPan; float _EmissionMaskUV; #if defined(PROP_EMISSIONSCROLLINGCURVE) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionScrollingCurve; #endif float4 _EmissionScrollingCurve_ST; float4 _EmissionColor; float _EmissionBaseColorAsMap; float _EmissionStrength; float _EmissionHueShiftEnabled; float _EmissionHueShift; float _EmissionHueShiftSpeed; float _EmissionCenterOutEnabled; float _EmissionCenterOutSpeed; float _EnableGITDEmission; float _GITDEWorldOrMesh; float _GITDEMinEmissionMultiplier; float _GITDEMaxEmissionMultiplier; float _GITDEMinLight; float _GITDEMaxLight; float _EmissionBlinkingEnabled; float _EmissiveBlink_Min; float _EmissiveBlink_Max; float _EmissiveBlink_Velocity; float _EmissionBlinkingOffset; float _ScrollingEmission; float4 _EmissiveScroll_Direction; float _EmissiveScroll_Width; float _EmissiveScroll_Velocity; float _EmissiveScroll_Interval; float _EmissionScrollingOffset; float _EmissionReplace0; float _EmissionScrollingVertexColor; float _EmissionScrollingUseCurve; float _EmissionColorThemeIndex; // Audio Link float _EmissionAL0Enabled; float2 _EmissionAL0StrengthMod; float _EmissionAL0StrengthBand; float2 _AudioLinkEmission0CenterOut; float _AudioLinkEmission0CenterOutwidth; float _AudioLinkEmission0CenterOutSize; float _AudioLinkEmission0CenterOutBand; #endif #ifdef POI_EMISSION_1 #if defined(PROP_EMISSIONMAP1) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionMap1; #endif float4 _EmissionMap1_ST; float2 _EmissionMap1Pan; float _EmissionMap1UV; #if defined(PROP_EMISSIONMASK1) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionMask1; #endif float4 _EmissionMask1_ST; float2 _EmissionMask1Pan; float _EmissionMask1UV; #if defined(PROP_EMISSIONSCROLLINGCURVE1) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionScrollingCurve1; #endif float4 _EmissionScrollingCurve1_ST; float4 _EmissionColor1; float _EmissionBaseColorAsMap1; float _EmissionStrength1; float _EnableEmission1; float _EmissionHueShift1; float _EmissionHueShiftSpeed1; float4 _EmissiveScroll_Direction1; float _EmissiveScroll_Width1; float _EmissiveScroll_Velocity1; float _EmissiveScroll_Interval1; float _EmissionBlinkingEnabled1; float _EmissiveBlink_Min1; float _EmissiveBlink_Max1; float _EmissiveBlink_Velocity1; float _ScrollingEmission1; float _EnableGITDEmission1; float _GITDEMinEmissionMultiplier1; float _GITDEMaxEmissionMultiplier1; float _GITDEMinLight1; float _GITDEMaxLight1; float _GITDEWorldOrMesh1; float _EmissionCenterOutEnabled1; float _EmissionCenterOutSpeed1; float _EmissionHueShiftEnabled1; float _EmissionBlinkingOffset1; float _EmissionScrollingOffset1; float _EmissionScrollingVertexColor1; float _EmissionScrollingUseCurve1; float _EmissionReplace1; float _EmissionColor1ThemeIndex; // Audio Link float _EmissionAL1Enabled; float2 _EmissionAL1StrengthMod; float _EmissionAL1StrengthBand; float2 _AudioLinkEmission1CenterOut; float _AudioLinkEmission1CenterOutwidth; float _AudioLinkEmission1CenterOutSize; float _AudioLinkEmission1CenterOutBand; #endif #ifdef POI_EMISSION_2 #if defined(PROP_EMISSIONMAP2) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionMap2; #endif float4 _EmissionMap2_ST; float2 _EmissionMap2Pan; float _EmissionMap2UV; #if defined(PROP_EMISSIONMASK2) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionMask2; #endif float4 _EmissionMask2_ST; float2 _EmissionMask2Pan; float _EmissionMask2UV; #if defined(PROP_EMISSIONSCROLLINGCURVE2) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionScrollingCurve2; #endif float4 _EmissionScrollingCurve2_ST; float4 _EmissionColor2; float _EmissionBaseColorAsMap2; float _EmissionStrength2; float _EnableEmission2; float _EmissionHueShift2; float _EmissionHueShiftSpeed2; float4 _EmissiveScroll_Direction2; float _EmissiveScroll_Width2; float _EmissiveScroll_Velocity2; float _EmissiveScroll_Interval2; float _EmissionBlinkingEnabled2; float _EmissiveBlink_Min2; float _EmissiveBlink_Max2; float _EmissiveBlink_Velocity2; float _ScrollingEmission2; float _EnableGITDEmission2; float _GITDEMinEmissionMultiplier2; float _GITDEMaxEmissionMultiplier2; float _GITDEMinLight2; float _GITDEMaxLight2; float _GITDEWorldOrMesh2; float _EmissionCenterOutEnabled2; float _EmissionCenterOutSpeed2; float _EmissionHueShiftEnabled2; float _EmissionBlinkingOffset2; float _EmissionScrollingOffset2; float _EmissionScrollingVertexColor2; float _EmissionScrollingUseCurve2; float _EmissionReplace2; float _EmissionColor2ThemeIndex; // Audio Link float _EmissionAL2Enabled; float2 _EmissionAL2StrengthMod; float _EmissionAL2StrengthBand; float2 _AudioLinkEmission2CenterOut; float _AudioLinkEmission2CenterOutwidth; float _AudioLinkEmission2CenterOutSize; float _AudioLinkEmission2CenterOutBand; #endif #ifdef POI_EMISSION_3 #if defined(PROP_EMISSIONMAP3) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionMap3; #endif float4 _EmissionMap3_ST; float2 _EmissionMap3Pan; float _EmissionMap3UV; #if defined(PROP_EMISSIONMASK3) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionMask3; #endif float4 _EmissionMask3_ST; float2 _EmissionMask3Pan; float _EmissionMask3UV; #if defined(PROP_EMISSIONSCROLLINGCURVE3) || !defined(OPTIMIZER_ENABLED) Texture2D _EmissionScrollingCurve3; #endif float4 _EmissionScrollingCurve3_ST; float4 _EmissionColor3; float _EmissionBaseColorAsMap3; float _EmissionStrength3; float _EnableEmission3; float _EmissionHueShift3; float _EmissionHueShiftSpeed3; float4 _EmissiveScroll_Direction3; float _EmissiveScroll_Width3; float _EmissiveScroll_Velocity3; float _EmissiveScroll_Interval3; float _EmissionBlinkingEnabled3; float _EmissiveBlink_Min3; float _EmissiveBlink_Max3; float _EmissiveBlink_Velocity3; float _ScrollingEmission3; float _EnableGITDEmission3; float _GITDEMinEmissionMultiplier3; float _GITDEMaxEmissionMultiplier3; float _GITDEMinLight3; float _GITDEMaxLight3; float _GITDEWorldOrMesh3; float _EmissionCenterOutEnabled3; float _EmissionCenterOutSpeed3; float _EmissionHueShiftEnabled3; float _EmissionBlinkingOffset3; float _EmissionScrollingOffset3; float _EmissionScrollingVertexColor3; float _EmissionScrollingUseCurve3; float _EmissionReplace3; float _EmissionColor3ThemeIndex; // Audio Link float _EmissionAL3Enabled; float2 _EmissionAL3StrengthMod; float _EmissionAL3StrengthBand; float2 _AudioLinkEmission3CenterOut; float _AudioLinkEmission3CenterOutwidth; float _AudioLinkEmission3CenterOutSize; float _AudioLinkEmission3CenterOutBand; #endif #ifdef _GLOSSYREFLECTIONS_OFF float4 _RimLightColor; float _RimLightingInvert; float _RimWidth; float _RimStrength; float _RimSharpness; float _RimLightColorBias; float _ShadowMix; float _ShadowMixThreshold; float _ShadowMixWidthMod; float _EnableRimLighting; float _RimBrighten; float _RimLightNormal; float _RimHueShiftEnabled; float _RimHueShiftSpeed; float _RimHueShift; float _RimWidthNoiseStrength; float _RimLightColorThemeIndex; #if defined(PROP_RIMTEX) || !defined(OPTIMIZER_ENABLED) Texture2D _RimTex; #endif float4 _RimTex_ST; float2 _RimTexPan; float _RimTexUV; #if defined(PROP_RIMMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _RimMask; #endif float4 _RimMask_ST; float2 _RimMaskPan; float _RimMaskUV; #if defined(PROP_RIMWIDTHNOISETEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _RimWidthNoiseTexture; #endif float4 _RimWidthNoiseTexture_ST; float2 _RimWidthNoiseTexturePan; float _RimWidthNoiseTextureUV; #endif /* Texture2D ; float4 _ST; float2 Pan; float UV; */ #ifdef _SUNDISK_SIMPLE float _GlitterUV; half3 _GlitterColor; float _GlitterColorThemeIndex; float2 _GlitterPan; half _GlitterSpeed; half _GlitterBrightness; float _GlitterFrequency; float _GlitterJitter; half _GlitterSize; half _GlitterContrast; half _GlitterAngleRange; half _GlitterMinBrightness; half _GlitterBias; fixed _GlitterUseSurfaceColor; float _GlitterBlendType; float _GlitterMode; float _GlitterShape; float _GlitterCenterSize; float _glitterFrequencyLinearEmissive; float _GlitterJaggyFix; float _GlitterTextureRotation; float2 _GlitterUVPanning; float _GlitterHueShiftEnabled; float _GlitterHueShiftSpeed; float _GlitterHueShift; float _GlitterHideInShadow; float _GlitterRandomColors; float2 _GlitterMinMaxSaturation; float2 _GlitterMinMaxBrightness; float _GlitterRandomSize; float4 _GlitterMinMaxSize; float _GlitterRandomRotation; #if defined(PROP_GLITTERMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _GlitterMask; #endif float4 _GlitterMask_ST; float2 _GlitterMaskPan; float _GlitterMaskUV; #if defined(PROP_GLITTERCOLORMAP) || !defined(OPTIMIZER_ENABLED) Texture2D _GlitterColorMap; #endif float4 _GlitterColorMap_ST; float2 _GlitterColorMapPan; float _GlitterColorMapUV; #if defined(PROP_GLITTERTEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _GlitterTexture; #endif float4 _GlitterTexture_ST; float2 _GlitterTexturePan; float _GlitterTextureUV; #endif /* Texture2D ; float4 _ST; float2 Pan; float UV; */ #ifdef MOCHIE_PBR #if defined(PROP_MOCHIEMETALLICMAP) || !defined(OPTIMIZER_ENABLED) Texture2D _MochieMetallicMap; #endif float4 _MochieMetallicMap_ST; float2 _MochieMetallicMapPan; float _MochieMetallicMapUV; float _MochieMetallicMapInvert; #if defined(PROP_MOCHIEROUGHNESSMAP) || !defined(OPTIMIZER_ENABLED) Texture2D _MochieRoughnessMap; #endif float4 _MochieRoughnessMap_ST; float2 _MochieRoughnessMapPan; float _MochieRoughnessMapUV; float _MochieRoughnessMapInvert; #if defined(PROP_MOCHIEREFLECTIONMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _MochieReflectionMask; #endif float4 _MochieReflectionMask_ST; float2 _MochieReflectionMaskPan; float _MochieReflectionMaskUV; float _MochieReflectionMaskInvert; #if defined(PROP_MOCHIESPECULARMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _MochieSpecularMask; #endif float4 _MochieSpecularMask_ST; float2 _MochieSpecularMaskPan; float _MochieSpecularMaskUV; float _MochieSpecularMaskInvert; float _MochieReflectionTintThemeIndex; float _MochieSpecularTintThemeIndex; float _MochieRoughnessMultiplier; float _MochieMetallicMultiplier; float _MochieReflectionStrength; float _MochieSpecularStrength; float4 _MochieSpecularTint; float4 _MochieReflectionTint; float _MochieLitFallback; samplerCUBE _MochieReflCube; float4 _MochieReflCube_HDR; float _MochieForceFallback; #endif #ifdef _COLORCOLOR_ON samplerCUBE _ClearCoatCubeMap; float _ClearCoatSampleWorld; #if defined(PROP_CLEARCOATMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _ClearCoatMask; #endif float4 _ClearCoatMask_ST; float2 _ClearCoatMaskPan; float _ClearCoatMaskUV; #if defined(PROP_CLEARCOATSMOOTHNESSMAP) || !defined(OPTIMIZER_ENABLED) Texture2D _ClearCoatSmoothnessMap; #endif float _ClearCoatNormal; float4 _ClearCoatSmoothnessMap_ST; float2 _ClearCoatSmoothnessMapPan; float _ClearCoatSmoothnessMapUV; float _ClearCoatInvertSmoothness; float _ClearCoat; float _ClearCoatSmoothness; float3 _ClearCoatTint; float _ClearCoatTintThemeIndex; float _ClearCoatForceLighting; float lighty_clear_boy_uwu_var; #endif #ifdef POI_ENVIRORIM #if defined(PROP_RIMENVIROMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _RimEnviroMask; #endif float4 _RimEnviroMask_ST; float2 _RimEnviroMaskPan; float _RimEnviroMaskUV; float _RimEnviroBlur; float _RimEnviroMinBrightness; float _RimEnviroWidth; float _RimEnviroSharpness; float _RimEnviroIntensity; #endif #ifdef POI_STYLIZED_StylizedSpecular #if defined(PROP_HIGHCOLOR_TEX) || !defined(OPTIMIZER_ENABLED) Texture2D _HighColor_Tex; #endif float4 _HighColor_Tex_ST; float2 _HighColor_TexPan; float _HighColor_TexUV; #if defined(PROP_SET_HIGHCOLORMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _Set_HighColorMask; #endif float4 _Set_HighColorMask_ST; float2 _Set_HighColorMaskPan; float _Set_HighColorMaskUV; float _Tweak_HighColorMaskLevel; /* #if defined(PROP_StylizedSpecularOPTMAP1) || !defined(OPTIMIZER_ENABLED) Texture2D _StylizedSpecularOptMap1; #endif float4 _StylizedSpecularOptMap1_ST; float2 _StylizedSpecularOptMap1Pan; float _StylizedSpecularOptMap1UV; #if defined(PROP_StylizedSpecularOPTMAP2) || !defined(OPTIMIZER_ENABLED) Texture2D _StylizedSpecularOptMap2; #endif float4 _StylizedSpecularOptMap2_ST; float2 _StylizedSpecularOptMap2Pan; float _StylizedSpecularOptMap2UV; */ float4 _HighColor; float _UseLightColor; float _HighColor_Power; float _StylizedSpecularFeather; float _Layer1Strength; float _Layer2Size; float _StylizedSpecular2Feather; float _Layer2Strength; float _StylizedSpecularStrength; float _UseSpecularOptMap2; float _HighColorThemeIndex; float _Is_BlendAddToHiColor; float _Is_SpecularToHighColor; #endif #ifdef POI_PATHING #if defined(PROP_PATHINGMAP) || !defined(OPTIMIZER_ENABLED) Texture2D _PathingMap; SamplerState SmpRepeatPoint; #endif float4 _PathingMap_ST; float2 _PathingMapPan; float _PathingMapUV; #if defined(PROP_PATHINGCOLORMAP) || !defined(OPTIMIZER_ENABLED) Texture2D _PathingColorMap; #endif float4 _PathingColorMap_ST; float2 _PathingColorMapPan; float _PathingColorMapUV; // Fill, 0, Path, 1, Loop, 2 half _PathTypeR; half _PathTypeG; half _PathTypeB; half3 _PathWidth; float3 _PathTime; float3 _PathOffset; float3 _PathSpeed; float4 _PathColorR; float4 _PathColorG; float4 _PathColorB; float3 _PathEmissionStrength; float3 _PathSoftness; float3 _PathSegments; float3 _PathAlpha; float _PathColorRThemeIndex; float _PathColorGThemeIndex; float _PathColorBThemeIndex; #ifdef COLOR_GRADING_LOG_VIEW // Time Offset half _AudioLinkPathTimeOffsetBandR; half2 _AudioLinkPathTimeOffsetR; half _AudioLinkPathTimeOffsetBandG; half2 _AudioLinkPathTimeOffsetG; half _AudioLinkPathTimeOffsetBandB; half2 _AudioLinkPathTimeOffsetB; // Emission Offset half _AudioLinkPathEmissionAddBandR; half2 _AudioLinkPathEmissionAddR; half _AudioLinkPathEmissionAddBandG; half2 _AudioLinkPathEmissionAddG; half _AudioLinkPathEmissionAddBandB; half2 _AudioLinkPathEmissionAddB; // Length Offset half _AudioLinkPathWidthOffsetBandR; half2 _AudioLinkPathWidthOffsetR; half _AudioLinkPathWidthOffsetBandG; half2 _AudioLinkPathWidthOffsetG; half _AudioLinkPathWidthOffsetBandB; half2 _AudioLinkPathWidthOffsetB; #endif #endif #ifdef POI_MIRROR float _Mirror; #if defined(PROP_MIRRORTEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _MirrorTexture; #endif float4 _MirrorTexture_ST; float2 _MirrorTexturePan; float _MirrorTextureUV; #endif #ifdef GRAIN sampler2D _CameraDepthTexture; #endif #if defined(PROP_DEPTHMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _DepthMask; #endif float4 _DepthMask_ST; float2 _DepthMaskPan; float _DepthMaskUV; // Color float _DepthColorToggle; float _DepthColorBlendMode; #if defined(PROP_DEPTHTEXTURE) || !defined(OPTIMIZER_ENABLED) Texture2D _DepthTexture; #endif float4 _DepthTexture_ST; float2 _DepthTexturePan; float _DepthTextureUV; float3 _DepthColor; float _DepthColorThemeIndex; float _DepthColorMinDepth; float _DepthColorMaxDepth; float _DepthColorMinValue; float _DepthColorMaxValue; float _DepthEmissionStrength; // Emission // Alpha float _DepthAlphaToggle; float _DepthAlphaMinValue; float _DepthAlphaMaxValue; float _DepthAlphaMinDepth; float _DepthAlphaMaxDepth; /* Texture2D ; float4 _ST; float2 Pan; float UV; */ #ifdef POI_IRIDESCENCE #if defined(PROP_IRIDESCENCERAMP) || !defined(OPTIMIZER_ENABLED) Texture2D _IridescenceRamp; #endif float4 _IridescenceRamp_ST; float2 _IridescenceRampPan; #if defined(PROP_IRIDESCENCEMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _IridescenceMask; #endif float4 _IridescenceMask_ST; float2 _IridescenceMaskPan; float _IridescenceMaskUV; #if defined(PROP_IRIDESCENCENORMALMAP) || !defined(OPTIMIZER_ENABLED) Texture2D _IridescenceNormalMap; #endif float4 _IridescenceNormalMap_ST; float2 _IridescenceNormalMapPan; float _IridescenceNormalMapUV; float _IridescenceTime; float _IridescenceIntensity; float _IridescenceHueShiftEnabled; float _IridescenceHueShiftSpeed; float _IridescenceHueShift; float2 _IridescenceAudioLinkEmission; float _IridescenceAudioLinkEmissionBand; float _IridescenceNormalSelection; float _IridescenceNormalIntensity; float _IridescenceNormalToggle; float _IridescenceAddBlend; float _IridescenceReplaceBlend; float _IridescenceMultiplyBlend; float _IridescenceEmissionStrength; #endif float _PPLightingMultiplier; float _PPLightingAddition; float _PPEmissionMultiplier; float _PPFinalColorMultiplier; #ifdef EFFECT_BUMP sampler2D _TextGlyphs; float4 _TextGlyphs_ST; float4 _TextGlyphs_TexelSize; float _TextFPSUV; float _TextTimeUV; float _TextPositionUV; float _TextPixelRange; float _TextFPSEnabled; float _TextPositionEnabled; float _TextTimeEnabled; float4 _TextFPSColor; float _TextFPSEmissionStrength; fixed4 _TextFPSPadding; float2 _TextFPSOffset; float2 _TextFPSScale; float _TextFPSRotation; fixed _TextPositionVertical; float4 _TextPositionColor; float _TextPositionEmissionStrength; fixed4 _TextPositionPadding; float2 _TextPositionOffset; float2 _TextPositionScale; float _TextPositionRotation; float4 _TextTimeColor; float _TextTimeEmissionStrength; fixed4 _TextTimePadding; float2 _TextTimeOffset; float2 _TextTimeScale; float _TextTimeRotation; float _TextFPSColorThemeIndex; float _TextPositionColorThemeIndex; float _TextTimeColorThemeIndex; float3 globalTextEmission; #define ASCII_LEFT_PARENTHESIS 40 #define ASCII_RIGHT_PARENTHESIS 41 #define ASCII_POSITIVE 43 #define ASCII_PERIOD 46 #define ASCII_NEGATIVE 45 #define ASCII_COMMA 44 #define ASCII_E 69 #define ASCII_F 70 #define ASCII_I 73 #define ASCII_M 77 #define ASCII_O 79 #define ASCII_P 80 #define ASCII_S 83 #define ASCII_T 54 #define ASCII_SEMICOLON 58 #define glyphWidth 0.0625 #endif #ifdef MOCHIE_POSTPROCESS #if defined(PROP_PPLUT) || !defined(OPTIMIZER_ENABLED) Texture2D _PPLUT; SamplerState sampler_PPLUT; #endif float4 _PPLUT_TexelSize; float _PPLUTStrength; #if defined(PROP_PPMASK) || !defined(OPTIMIZER_ENABLED) Texture2D _PPMask; #endif float4 _PPMask_ST; float2 _PPMaskPan; float _PPMaskUV; float _PPMaskInvert; float3 _PPTint; float3 _PPRGB; float _PPHue; float _PPContrast; float _PPSaturation; float _PPBrightness; float _PPLightness; float _PPHDR; const static float COLORS = 32; #endif //Structs struct appdata { float4 vertex : POSITION; float3 normal : NORMAL; float4 tangent : TANGENT; float4 color : COLOR; float2 uv0 : TEXCOORD0; float2 uv1 : TEXCOORD1; float2 uv2 : TEXCOORD2; float2 uv3 : TEXCOORD3; uint vertexId : SV_VertexID; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : SV_POSITION; float2 uv[4] : TEXCOORD0; float3 objNormal : TEXCOORD4; float3 normal : TEXCOORD5; float3 tangent : TEXCOORD6; float3 binormal : TEXCOORD7; float4 worldPos : TEXCOORD8; float4 localPos : TEXCOORD9; float3 objectPos : TEXCOORD10; float4 vertexColor : TEXCOORD11; float3 tangentViewDir : TEXCOORD12; float4 lightmapUV : TEXCOORD13; float4 grabPos: TEXCOORD14; float4 worldDirection: TEXCOORD15; UNITY_SHADOW_COORDS(16) UNITY_FOG_COORDS(17) UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; struct PoiMesh { // 0 Vertex normal // 1 Fragment normal float3 normals[2]; float3 objNormal; float3 tangentSpaceNormal; float3 binormal; float3 tangent; float3 worldPos; float3 localPos; float3 objectPosition; float isFrontFace; float4 vertexColor; float4 lightmapUV; // 0-3 UV0-UV3 // 4 Panosphere UV // 5 world pos xz // 6 Polar UV // 7 Distorted UV float2 uv[8]; float2 parallaxUV; }; struct PoiCam { float3 viewDir; float3 forwardDir; float3 worldPos; float distanceToVert; float4 clipPos; float3 reflectionDir; float3 tangentViewDir; float4 grabPos; float2 screenUV; float vDotN; float4 worldDirection; }; struct PoiMods { float4 Mask; float4 audioLink; float audioLinkAvailable; float audioLinkVersion; float4 audioLinkTexture; float2 detailMask; float2 backFaceDetailIntensity; float4 globalColorTheme[12]; float ALTime[8]; }; struct PoiLight { float3 direction; float attenuation; float attenuationStrength; float3 directColor; float3 indirectColor; float occlusion; float shadowMask; float detailShadow; float3 halfDir; float lightMap; float3 rampedLightMap; float nDotL; float nDotV; float nDotH; float lDotv; float lDotH; float nDotLSaturated; float nDotLNormalized; #ifdef UNITY_PASS_FORWARDADD float additiveShadow; #endif float3 finalLighting; #if defined(VERTEXLIGHT_ON) && defined(POI_VERTEXLIGHT_ON) // Non Important Lights float4 vDotNL; float3 vColor[4]; float4 vCorrectedDotNL; float4 vAttenuation; float4 vAttenuationDotNL; float3 vPosition[4]; float3 vDirection[4]; float3 vFinalLighting; float3 vHalfDir[4]; half4 vDotNH; half4 vDotLH; #endif }; struct PoiVertexLights { float3 direction; float3 color; float attenuation; }; struct PoiFragData { float3 baseColor; float3 finalColor; float alpha; float3 emission; }; float2 poiUV(float2 uv, float4 tex_st) { return uv * tex_st.xy + tex_st.zw; } //Lighting Helpers float calculateluminance(float3 color) { return color.r * 0.299 + color.g * 0.587 + color.b * 0.114; } bool IsInMirror() { return unity_CameraProjection[2][0] != 0.f || unity_CameraProjection[2][1] != 0.f; } /* * MIT License * * Copyright (c) 2018 s-ilent * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ float shEvaluateDiffuseL1Geomerics_local(float L0, float3 L1, float3 n) { // average energy float R0 = max(0, L0); // avg direction of incoming light float3 R1 = 0.5f * L1; // directional brightness float lenR1 = length(R1); // linear angle between normal and direction 0-1 //float q = 0.5f * (1.0f + dot(R1 / lenR1, n)); //float q = dot(R1 / lenR1, n) * 0.5 + 0.5; float q = dot(normalize(R1), n) * 0.5 + 0.5; q = saturate(q); // Thanks to ScruffyRuffles for the bug identity. // power for q // lerps from 1 (linear) to 3 (cubic) based on directionality float p = 1.0f + 2.0f * lenR1 / R0; // dynamic range constant // should vary between 4 (highly directional) and 0 (ambient) float a = (1.0f - lenR1 / R0) / (1.0f + lenR1 / R0); return R0 * (a + (1.0f - a) * (p + 1.0f) * pow(q, p)); } half3 BetterSH9(half4 normal) { float3 indirect; float3 L0 = float3(unity_SHAr.w, unity_SHAg.w, unity_SHAb.w) + float3(unity_SHBr.z, unity_SHBg.z, unity_SHBb.z) / 3.0; indirect.r = shEvaluateDiffuseL1Geomerics_local(L0.r, unity_SHAr.xyz, normal.xyz); indirect.g = shEvaluateDiffuseL1Geomerics_local(L0.g, unity_SHAg.xyz, normal.xyz); indirect.b = shEvaluateDiffuseL1Geomerics_local(L0.b, unity_SHAb.xyz, normal.xyz); indirect = max(0, indirect); indirect += SHEvalLinearL2(normal); return indirect; } // Silent's code ends here float3 getCameraForward() { #if UNITY_SINGLE_PASS_STEREO float3 p1 = mul(unity_StereoCameraToWorld[0], float4(0, 0, 1, 1)); float3 p2 = mul(unity_StereoCameraToWorld[0], float4(0, 0, 0, 1)); #else float3 p1 = mul(unity_CameraToWorld, float4(0, 0, 1, 1)).xyz; float3 p2 = mul(unity_CameraToWorld, float4(0, 0, 0, 1)).xyz; #endif return normalize(p2 - p1); } half3 GetSHLength() { half3 x, x1; x.r = length(unity_SHAr); x.g = length(unity_SHAg); x.b = length(unity_SHAb); x1.r = length(unity_SHBr); x1.g = length(unity_SHBg); x1.b = length(unity_SHBb); return x + x1; } float3 BoxProjection(float3 direction, float3 position, float4 cubemapPosition, float3 boxMin, float3 boxMax) { #if UNITY_SPECCUBE_BOX_PROJECTION //UNITY_BRANCH if (cubemapPosition.w > 0) { float3 factors = ((direction > 0 ? boxMax : boxMin) - position) / direction; float scalar = min(min(factors.x, factors.y), factors.z); direction = direction * scalar + (position - cubemapPosition.xyz); } #endif return direction; } float poiMax(float2 i) { return max(i.x, i.y); } float poiMax(float3 i) { return max(max(i.x, i.y), i.z); } float poiMax(float4 i) { return max(max(max(i.x, i.y), i.z), i.w); } float3 calculateNormal(in float3 baseNormal, in PoiMesh poiMesh, in Texture2D normalTexture, in float4 normal_ST, in float2 normalPan, in float normalUV, in float normalIntensity) { float3 normal = UnpackScaleNormal(POI2D_SAMPLER_PAN(normalTexture, _MainTex, poiUV(poiMesh.uv[normalUV], normal_ST), normalPan), normalIntensity); return normalize( normal.x * poiMesh.tangent + normal.y * poiMesh.binormal + normal.z * baseNormal ); } float remap(float x, float minOld, float maxOld, float minNew = 0, float maxNew = 1) { return minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld); } float2 remap(float2 x, float2 minOld, float2 maxOld, float2 minNew = 0, float2 maxNew = 1) { return minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld); } float3 remap(float3 x, float3 minOld, float3 maxOld, float3 minNew = 0, float3 maxNew = 1) { return minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld); } float4 remap(float4 x, float4 minOld, float4 maxOld, float4 minNew = 0, float4 maxNew = 1) { return minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld); } float remapClamped(float minOld, float maxOld, float x, float minNew = 0, float maxNew = 1) { return clamp(minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld), minNew, maxNew); } float2 remapClamped(float2 minOld, float2 maxOld, float2 x, float2 minNew, float2 maxNew) { return clamp(minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld), minNew, maxNew); } float3 remapClamped(float3 minOld, float3 maxOld, float3 x, float3 minNew, float3 maxNew) { return clamp(minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld), minNew, maxNew); } float4 remapClamped(float4 minOld, float4 maxOld, float4 x, float4 minNew, float4 maxNew) { return clamp(minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld), minNew, maxNew); } float2 calcParallax(in float height, in PoiCam poiCam) { return((height * - 1) + 1) * (poiCam.tangentViewDir.xy / poiCam.tangentViewDir.z); } /* 0: Zero float4(0.0, 0.0, 0.0, 0.0), 1: One float4(1.0, 1.0, 1.0, 1.0), 2: DstColor destinationColor, 3: SrcColor sourceColor, 4: OneMinusDstColor float4(1.0, 1.0, 1.0, 1.0) - destinationColor, 5: SrcAlpha sourceColor.aaaa, 6: OneMinusSrcColor float4(1.0, 1.0, 1.0, 1.0) - sourceColor, 7: DstAlpha destinationColor.aaaa, 8: OneMinusDstAlpha float4(1.0, 1.0, 1.0, 1.0) - destinationColor., 9: SrcAlphaSaturate saturate(sourceColor.aaaa), 10: OneMinusSrcAlpha float4(1.0, 1.0, 1.0, 1.0) - sourceColor.aaaa, */ float4 poiBlend(const float sourceFactor, const float4 sourceColor, const float destinationFactor, const float4 destinationColor, const float4 blendFactor) { float4 sA = 1 - blendFactor; const float4 blendData[11] = { float4(0.0, 0.0, 0.0, 0.0), float4(1.0, 1.0, 1.0, 1.0), destinationColor, sourceColor, float4(1.0, 1.0, 1.0, 1.0) - destinationColor, sA, float4(1.0, 1.0, 1.0, 1.0) - sourceColor, sA, float4(1.0, 1.0, 1.0, 1.0) - sA, saturate(sourceColor.aaaa), 1 - sA, }; return lerp(blendData[sourceFactor] * sourceColor + blendData[destinationFactor] * destinationColor, sourceColor, sA); } // Average float3 blendAverage(float3 base, float3 blend) { return(base + blend) / 2.0; } // Color burn float blendColorBurn(float base, float blend) { return(blend == 0.0)?blend : max((1.0 - ((1.0 - base) / blend)), 0.0); } float3 blendColorBurn(float3 base, float3 blend) { return float3(blendColorBurn(base.r, blend.r), blendColorBurn(base.g, blend.g), blendColorBurn(base.b, blend.b)); } // Color Dodge float blendColorDodge(float base, float blend) { return(blend == 1.0)?blend : min(base / (1.0 - blend), 1.0); } float3 blendColorDodge(float3 base, float3 blend) { return float3(blendColorDodge(base.r, blend.r), blendColorDodge(base.g, blend.g), blendColorDodge(base.b, blend.b)); } // Darken float blendDarken(float base, float blend) { return min(blend, base); } float3 blendDarken(float3 base, float3 blend) { return float3(blendDarken(base.r, blend.r), blendDarken(base.g, blend.g), blendDarken(base.b, blend.b)); } // Exclusion float3 blendExclusion(float3 base, float3 blend) { return base + blend - 2.0 * base * blend; } // Reflect float blendReflect(float base, float blend) { return(blend == 1.0)?blend : min(base * base / (1.0 - blend), 1.0); } float3 blendReflect(float3 base, float3 blend) { return float3(blendReflect(base.r, blend.r), blendReflect(base.g, blend.g), blendReflect(base.b, blend.b)); } // Glow float3 blendGlow(float3 base, float3 blend) { return blendReflect(blend, base); } // Overlay float blendOverlay(float base, float blend) { return base < 0.5?(2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)); } float3 blendOverlay(float3 base, float3 blend) { return float3(blendOverlay(base.r, blend.r), blendOverlay(base.g, blend.g), blendOverlay(base.b, blend.b)); } // Hard Light float3 blendHardLight(float3 base, float3 blend) { return blendOverlay(blend, base); } // Vivid light float blendVividLight(float base, float blend) { return(blend < 0.5)?blendColorBurn(base, (2.0 * blend)) : blendColorDodge(base, (2.0 * (blend - 0.5))); } float3 blendVividLight(float3 base, float3 blend) { return float3(blendVividLight(base.r, blend.r), blendVividLight(base.g, blend.g), blendVividLight(base.b, blend.b)); } // Hard mix float blendHardMix(float base, float blend) { return(blendVividLight(base, blend) < 0.5)?0.0 : 1.0; } float3 blendHardMix(float3 base, float3 blend) { return float3(blendHardMix(base.r, blend.r), blendHardMix(base.g, blend.g), blendHardMix(base.b, blend.b)); } // Lighten float blendLighten(float base, float blend) { return max(blend, base); } float3 blendLighten(float3 base, float3 blend) { return float3(blendLighten(base.r, blend.r), blendLighten(base.g, blend.g), blendLighten(base.b, blend.b)); } // Linear Burn float blendLinearBurn(float base, float blend) { // Note : Same implementation as BlendSubtractf return max(base + blend - 1.0, 0.0); } float3 blendLinearBurn(float3 base, float3 blend) { // Note : Same implementation as BlendSubtract return max(base + blend - float3(1.0, 1.0, 1.0), float3(0.0, 0.0, 0.0)); } // Linear Dodge float blendLinearDodge(float base, float blend) { // Note : Same implementation as BlendAddf return min(base + blend, 1.0); } float3 blendLinearDodge(float3 base, float3 blend) { // Note : Same implementation as BlendAdd return min(base + blend, float3(1.0, 1.0, 1.0)); } // Linear light float blendLinearLight(float base, float blend) { return blend < 0.5?blendLinearBurn(base, (2.0 * blend)) : blendLinearDodge(base, (2.0 * (blend - 0.5))); } float3 blendLinearLight(float3 base, float3 blend) { return float3(blendLinearLight(base.r, blend.r), blendLinearLight(base.g, blend.g), blendLinearLight(base.b, blend.b)); } // Multiply float3 blendMultiply(float3 base, float3 blend) { return base * blend; } // Negation float3 blendNegation(float3 base, float3 blend) { return float3(1.0, 1.0, 1.0) - abs(float3(1.0, 1.0, 1.0) - base - blend); } // Normal float3 blendNormal(float3 base, float3 blend) { return blend; } // Phoenix float3 blendPhoenix(float3 base, float3 blend) { return min(base, blend) - max(base, blend) + float3(1.0, 1.0, 1.0); } // Pin light float blendPinLight(float base, float blend) { return(blend < 0.5)?blendDarken(base, (2.0 * blend)) : blendLighten(base, (2.0 * (blend - 0.5))); } float3 blendPinLight(float3 base, float3 blend) { return float3(blendPinLight(base.r, blend.r), blendPinLight(base.g, blend.g), blendPinLight(base.b, blend.b)); } // Screen float blendScreen(float base, float blend) { return 1.0 - ((1.0 - base) * (1.0 - blend)); } float3 blendScreen(float3 base, float3 blend) { return float3(blendScreen(base.r, blend.r), blendScreen(base.g, blend.g), blendScreen(base.b, blend.b)); } // Soft Light float blendSoftLight(float base, float blend) { return(blend < 0.5)?(2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend)); } float3 blendSoftLight(float3 base, float3 blend) { return float3(blendSoftLight(base.r, blend.r), blendSoftLight(base.g, blend.g), blendSoftLight(base.b, blend.b)); } // Subtract float blendSubtract(float base, float blend) { return max(base - blend, 0.0); } float3 blendSubtract(float3 base, float3 blend) { return max(base - blend, 0.0); } // Difference float blendDifference(float base, float blend) { return abs(base - blend); } float3 blendDifference(float3 base, float3 blend) { return abs(base - blend); } // Divide float blendDivide(float base, float blend) { return base / max(blend, 0.0001); } float3 blendDivide(float3 base, float3 blend) { return base / max(blend, 0.0001); } float3 customBlend(float3 base, float3 blend, float blendType) { float3 ret = 0; switch(blendType) { case 0: { ret = blendNormal(base, blend); break; } case 1: { ret = blendDarken(base, blend); break; } case 2: { ret = blendMultiply(base, blend); break; } case 3: { ret = blendColorBurn(base, blend); break; } case 4: { ret = blendLinearBurn(base, blend); break; } case 5: { ret = blendLighten(base, blend); break; } case 6: { ret = blendScreen(base, blend); break; } case 7: { ret = blendColorDodge(base, blend); break; } case 8: { ret = blendLinearDodge(base, blend); break; } case 9: { ret = blendOverlay(base, blend); break; } case 10: { ret = blendSoftLight(base, blend); break; } case 11: { ret = blendHardLight(base, blend); break; } case 12: { ret = blendVividLight(base, blend); break; } case 13: { ret = blendLinearLight(base, blend); break; } case 14: { ret = blendPinLight(base, blend); break; } case 15: { ret = blendHardMix(base, blend); break; } case 16: { ret = blendDifference(base, blend); break; } case 17: { ret = blendExclusion(base, blend); break; } case 18: { ret = blendSubtract(base, blend); break; } case 19: { ret = blendDivide(base, blend); break; } } return ret; } float random(float2 p) { return frac(sin(dot(p, float2(12.9898, 78.2383))) * 43758.5453123); } float2 random2(float2 p) { return frac(sin(float2(dot(p, float2(127.1, 311.7)), dot(p, float2(269.5, 183.3)))) * 43758.5453); } float3 random3(float3 p) { return frac(sin(float3(dot(p, float3(127.1, 311.7, 248.6)), dot(p, float3(269.5, 183.3, 423.3)), dot(p, float3(248.3, 315.9, 184.2)))) * 43758.5453); } float3 randomFloat3(float2 Seed, float maximum) { return(.5 + float3( frac(sin(dot(Seed.xy, float2(12.9898, 78.233))) * 43758.5453), frac(sin(dot(Seed.yx, float2(12.9898, 78.233))) * 43758.5453), frac(sin(dot(float2(Seed), float2(12.9898, 78.233))) * 43758.5453) ) * .5) * (maximum); } float3 randomFloat3Range(float2 Seed, float Range) { return(float3( frac(sin(dot(Seed.xy, float2(12.9898, 78.233))) * 43758.5453), frac(sin(dot(Seed.yx, float2(12.9898, 78.233))) * 43758.5453), frac(sin(dot(float2(Seed.x * Seed.y, Seed.y + Seed.x), float2(12.9898, 78.233))) * 43758.5453) ) * 2 - 1) * Range; } float3 randomFloat3WiggleRange(float2 Seed, float Range, float wiggleSpeed) { float3 rando = (float3( frac(sin(dot(Seed.xy, float2(12.9898, 78.233))) * 43758.5453), frac(sin(dot(Seed.yx, float2(12.9898, 78.233))) * 43758.5453), frac(sin(dot(float2(Seed.x * Seed.y, Seed.y + Seed.x), float2(12.9898, 78.233))) * 43758.5453) ) * 2 - 1); float speed = 1 + wiggleSpeed; return float3(sin((_Time.x + rando.x * pi) * speed), sin((_Time.x + rando.y *
31,839
https://github.com/LaurenDebruyn/aocdbc/blob/master/correct_programs/ethz_eprog_2019/exercise_08/problem_05.py
Github Open Source
Open Source
MIT
2,021
aocdbc
LaurenDebruyn
Python
Code
488
1,155
""" Simulate the wolf fleeing a city. A city is given as a grid of ``n x n`` crossroads. At each crossroad, the wolf picks a random direction. The grid size ``n`` is greater than 1 and odd. The wolf starts at ``(0, 0)``. The wolf escaped the city when he reaches the border of the grid. The wolf can never visit the same crossroad twice. If there are no more options, the wolf is shot by the hunters and dies. Estimate the probability of the wolf escaping the city. (We deliberately exclude the parts of the exercise concerning the drawing of the paths in the GUI.) """ import random from typing import Set, Sequence, Optional, Final from icontract import require, ensure class Position: """Represent the current position of the wolf on the grid.""" x: Final[int] #: X-coordinate of the cell y: Final[int] #: Y-coordinate of the cell def __init__(self, x: int, y: int) -> None: """Initialize with the given values.""" self.x = x self.y = y # fmt: off @ensure(lambda result: len(result) == 4) @ensure(lambda pos, result: pos not in result) @ensure( lambda pos, result: all( not (next_pos.x != pos.x) or (abs(next_pos.x - pos.x) == 1) for next_pos in result ), "Next is at most 1 field in x-direction" ) @ensure( lambda pos, result: all( not (next_pos.y != pos.y) or (abs(next_pos.y - pos.y) == 1) for next_pos in result ), "Next is at most 1 field in y-direction" ) @ensure( lambda pos, result: all( (next_pos.x == pos.x) ^ (next_pos.y == pos.y) for next_pos in result ), "Next is either in x- or in y-direction" ) # fmt: on def list_next_positions(pos: Position) -> Sequence[Position]: """List all the possible next positions based on the current position ``pos``.""" return ( Position(x=pos.x + 1, y=pos.y), Position(x=pos.x, y=pos.y + 1), Position(x=pos.x - 1, y=pos.y), Position(x=pos.x, y=pos.y - 1), ) @require(lambda trials: trials > 0) @require(lambda grid_size: grid_size > 1) @require(lambda grid_size: grid_size % 2 == 1) @ensure(lambda result: 0 <= result <= 1) def simulate(trials: int, grid_size: int) -> float: """ Simulate ``trials` number of wolf journeys on the quadratic ``grid_size`` grid.""" success_count = 0 half_grid_size = grid_size // 2 border = (-half_grid_size, half_grid_size) for _ in range(trials): visited = set() # type: Set[Position] position = Position(x=0, y=0) success = None # type: Optional[bool] while True: assert position.x < half_grid_size, ( f"position invariant for x: " f"{position=}, {half_grid_size=}, {grid_size=}" ) assert position.y < half_grid_size, ( f"position invariant for y: " f"{position=}, {half_grid_size=}, {grid_size=}" ) assert ( position not in visited ), f"visited invariant: {visited=}, {grid_size=}" old_visited_len = len(visited) visited.add(position) next_positions = list_next_positions(pos=position) if all(next_pos in visited for next_pos in next_positions): success = False break position = random.choice( [pos for pos in next_positions if pos not in visited] ) if position.x in border or position.y in border: success = True break assert len(visited) == old_visited_len + 1, "Loop invariant" assert success is not None if success: success_count += 1 return success_count / trials
6,155
https://github.com/AndersenLab/wi-nf/blob/master/.dockerignore
Github Open Source
Open Source
MIT
2,018
wi-nf
AndersenLab
Ignore List
Code
3
20
** !setup_pyenv.sh !bin/init_pyenv.sh
27,645
https://github.com/FlorianLeveil/projet-algo-1/blob/master/mini_projet.py
Github Open Source
Open Source
MIT
null
projet-algo-1
FlorianLeveil
Python
Code
1,052
2,951
from math import * dic = { 'Marseille': { 'Nîmes' : 122, 'Ajaccio' : 521, 'Paris' : 773, 'Perpignan' : 317, 'Annecy' : 421, 'Besançon' : 564, 'Toulouse' : 403, 'Toulon' : 122 }, 'Nîmes':{ 'Ajaccio' : 605, 'Paris' : 711, 'Perpignan' : 203, 'Annecy' : 359, 'Besançon' : 502, 'Toulouse' : 290, 'Toulon' : 190 }, 'Ajaccio':{ 'Paris' : 1253, 'Perpignan' : 797, 'Annecy' : 901, 'Besançon' : 1044, 'Toulouse' : 883, 'Toulon' : 471 }, 'Paris': { 'Perpignan' : 846, 'Annecy' : 538, 'Besançon' : 412, 'Toulouse' : 676, 'Toulon' : 838 }, 'Perpignan': { 'Annecy' :560, 'Besançon' : 703, 'Toulouse' : 207, 'Toulon' : 383 }, 'Annecy': { 'Besançon' : 215, 'Toulouse' : 646, 'Toulon' : 487 }, 'Besançon': { 'Toulouse' : 707, 'Toulon' :627 }, 'Toulouse': { 'Toulon' : 468 } } def theGODfunction(vroomvroom): def accel(temps_distance_fait): temps = temps_distance_fait[0] distance_fait = temps_distance_fait[1] vitesse = 0 while vitesse < 90: temps += 1 vitesse += 10 tempsheure = 1 / 60 distance_fait += (tempsheure * vitesse) temps_distance_fait[0] = temps temps_distance_fait[1] = distance_fait return temps_distance_fait def frein(temps_distance_fait): temps = temps_distance_fait[0] distance_fait = temps_distance_fait[1] vitesse = 90 while vitesse > 0: temps += 1 tempsheure = 1 / 60 distance_fait += (tempsheure * vitesse) vitesse -= 10 temps_distance_fait[0] = temps temps_distance_fait[1] = distance_fait return temps_distance_fait def pause(temps_distance_fait): frein(temps_distance_fait) temps_distance_fait[0] += 15 #le temps de prendre un petit café accel(temps_distance_fait) return temps_distance_fait def roulerposer(temps_distance_fait): temps = temps_distance_fait[0] distance_fait = temps_distance_fait[1] temps += (1/10) tempsheure = ((1 / 60) / 10) distance_fait += (tempsheure * 90) temps_distance_fait[0] = temps temps_distance_fait[1] = distance_fait return temps_distance_fait vitesse = 0 temps = 0 distance_fait = 0 distance = vroomvroom temps_avant_pause = 0 temps_distance_fait = [0,0] arret = [0,0] arret = frein(arret) while True: if vitesse == 0: accel(temps_distance_fait) vitesse = 90 if temps_avant_pause >= 111: pause(temps_distance_fait) vitesse = 90 temps_avant_pause = 0 if distance - temps_distance_fait[1] <= arret[1]: frein(temps_distance_fait) break temps_avant_pause += (1/10) roulerposer(temps_distance_fait) return temps_distance_fait def minutes_en_heure(temps_distance_fait): temps = temps_distance_fait[0] heure = temps / 60 minutes = temps % 60 arrondHeure = floor(heure) arrondMinutes = ceil(minutes) temps_around = [arrondHeure, arrondMinutes] return temps_around def addtime(temps_distance_fait): temps = temps_distance_fait[0] + 45 lereturn = [temps, 0] return lereturn def tempstotal(temps_minutes1, temps_minutes2, temps_minutes3): temps1 = temps_minutes1[0] temps2 = temps_minutes2[0] temps3 = temps_minutes3[0] finaltemps = temps1 + temps2 + temps3 tabfinaltemps = [finaltemps, 0] izi = minutes_en_heure(tabfinaltemps) return izi nbvilles = input('Combien de livraison ton camion doit-il faire ? Une, deux ou trois ? (Marque ton chiffre sous le format numérique): ') print('Les villes disponible sont: Marseille, Nîmes, Ajaccio, Paris, Perpignan, Annecy, Besançon, Toulouse, Toulon.') if nbvilles == '1': ville1 = input('Ville de départ: ') ville2 = input('Ville d\'arriver: ') try: nbkil = dic[ville2][ville1] except KeyError: nbkil = dic[ville1][ville2] result = theGODfunction(nbkil) theend = minutes_en_heure(result) km = floor(result[1]) print('Vôtre ville de départ est ' + ville1) print('Vôtre ville de d\'arriver est ' + ville2) print('Vous avez parcouru la distance de ' + str(km) + ' Km.') print('Ce trajet vous à pris ' + str(theend[0]) + ' Heures et ' + str(theend[1]) +' Minutes.') elif nbvilles == '2': ville1 = input('Ville de départ: ') ville2 = input('Ville pour la première livraison: ') ville3 = input('Ville pour la denière livraison: ') try: nbkil = dic[ville2][ville1] except KeyError: nbkil = dic[ville1][ville2] result = theGODfunction(nbkil) idk = addtime(result) km = floor(result[1]) try: nbkil1 = dic[ville2][ville3] except KeyError: nbkil1 = dic[ville3][ville2] result1 = theGODfunction(nbkil1) idk1 = addtime(result1) km1 = floor(result1[1]) untab = [0,0] finalkm = km + km1 temps_final = tempstotal(idk, idk1, untab) theend = minutes_en_heure(idk) theend1 = minutes_en_heure(idk1) print('---------------------------------------------------------------------------------------------------') print('Votre ville de départ est: ' + ville1) print('Vôtre ville pour votre première livraison est: ' + ville2) print('Vôtre ville de d\'arriver est ' + ville3) print('---------------------------------------------------------------------------------------------------') print('De '+ ville1 + ' a ' + ville2 + ' vous avez parcouru la distance de ' + str(km) + ' Km en ' + str(theend[0]) + ' Heures et ' + str(theend[1]) +' Minutes. Et le camion c\'est arreter 45 minutes en plus.') print('De '+ ville2 + ' a ' + ville3 + ' vous avez parcouru la distance de ' + str(km1) + ' Km en '+ str(theend1[0]) + ' Heures et ' + str(theend1[1]) +' Minutes. Et le camion c\'est arreter 45 minutes en plus.') print('---------------------------------------------------------------------------------------------------') print('La distance total parcourue est de: ' + str(finalkm) + 'km') print('Le temps total est de: ' + str(temps_final[0]) + ' Heures et ' + str(temps_final[1]) + ' minutes.') elif nbvilles == '3': ville1 = input('Ville de départ: ') ville2 = input('Ville pour la première livraison: ') ville3 = input('Ville pour la seconde livraison: ') ville4 = input('Ville pour la dernière livraison: ') try: nbkil = dic[ville2][ville1] except KeyError: nbkil = dic[ville1][ville2] result = theGODfunction(nbkil) idk = addtime(result) km = floor(result[1]) try: nbkil1 = dic[ville2][ville3] except KeyError: nbkil1 = dic[ville3][ville2] result1 = theGODfunction(nbkil1) idk1 = addtime(result1) km1 = floor(result1[1]) try: nbkil2 = dic[ville4][ville3] except KeyError: nbkil2 = dic[ville3][ville4] result2 = theGODfunction(nbkil2) idk2 = addtime(result2) km2 = floor(result2[1]) finalkm = km + km1 + km2 temps_final = tempstotal(idk, idk1, idk2) theend = minutes_en_heure(idk) theend1 = minutes_en_heure(idk1) theend2 = minutes_en_heure(idk2) print('---------------------------------------------------------------------------------------------------') print('Votre ville de départ est: ' + ville1) print('Vôtre ville pour votre première livraison est: ' + ville2) print('Vôtre ville pour votre deuxieme livraison est: ' + ville3) print('Vôtre ville de d\'arriver est ' + ville4) print('---------------------------------------------------------------------------------------------------') print('De '+ ville1 + ' a ' + ville2 + ' vous avez parcouru la distance de ' + str(km) + ' Km en ' + str(theend[0]) + ' Heures et ' + str(theend[1]) +' Minutes. Et le camion c\'est arreter 45 minutes en plus.') print('De '+ ville2 + ' a ' + ville3 + ' vous avez parcouru la distance de ' + str(km1) + ' Km en '+ str(theend1[0]) + ' Heures et ' + str(theend1[1]) +' Minutes. Et le camion c\'est arreter 45 minutes en plus.') print('De '+ ville3 + ' a ' + ville4 + ' vous avez parcouru la distance de ' + str(km2) + ' Km en ' + str(theend2[0]) + ' Heures et ' + str(theend2[1]) +' Minutes. Et le camion c\'est arreter 45 minutes en plus.') print('---------------------------------------------------------------------------------------------------') print('La distance total parcourue est de: ' + str(finalkm) + 'km') print('Le temps total est de: ' + str(temps_final[0]) + ' Heures et ' + str(temps_final[1]) + ' minutes.') else: print('Tu tes trompé dans tes valeurs !')
15,643