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/islamshu/adsspy/blob/master/resources/views/frontend/products.blade.php
|
Github Open Source
|
Open Source
|
MIT
| null |
adsspy
|
islamshu
|
PHP
|
Code
| 41
| 184
|
<div class="products" id="products">
<div class="container">
<h2 class="text-center">our products</h2>
<div class="row">
@foreach ($products as $item)
<div class="product col-sm-12 col-md-6 col-lg-4 text-center wow animate__bounceInUp" data-wow-offset="350">
<img src="{{ asset('uploads/'.$item->image) }}" alt="{{ $item->title }}">
<h3>{{ $item->title }}</h3>
<p>{!! $item->dec !!}</p>
</div>
@endforeach
</div>
</div>
</div>
| 26,495
|
https://github.com/ebi-uniprot/uniprot-covid-client/blob/master/src/messages/state/__tests__/messagesReducers.spec.ts
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
uniprot-covid-client
|
ebi-uniprot
|
TypeScript
|
Code
| 180
| 490
|
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import { addMessage, deleteMessage } from '../messagesActions';
import messagesReducers from '../messagesReducers';
import {
MessageFormat,
MessageLevel,
MessageType,
} from '../../types/messagesTypes';
const dateNow = 1542736574043;
jest.spyOn(Date, 'now').mockImplementation(() => dateNow);
describe('Messages reducer', () => {
let state;
let message: MessageType;
beforeEach(() => {
state = { active: [], deleted: {} };
message = {
id: 'job-id',
content: 'job message',
format: MessageFormat.POP_UP,
level: MessageLevel.SUCCESS,
};
});
test('should add message', () => {
const action = addMessage(message);
expect(messagesReducers(state, action)).toEqual({
active: [message],
deleted: {},
});
});
test('should not add message if it has already expired', () => {
message = {
...message,
dateExpired: dateNow - 1,
};
const action = addMessage(message);
expect(messagesReducers(state, action)).toEqual(state);
});
test('should not add message if it is not active yet', () => {
message = {
...message,
dateActive: dateNow + 1,
};
const action = addMessage(message);
expect(messagesReducers(state, action)).toEqual(state);
});
test('should delete message', () => {
const { id } = message;
state = {
...state,
active: [message],
};
const action = deleteMessage(id);
expect(messagesReducers(state, action)).toEqual({
active: [],
deleted: { [id]: true },
});
});
});
| 22,290
|
https://github.com/Thomas-Frew/The-Democracy-of-Art/blob/master/tdoa_exhibition_review_post.php
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,019
|
The-Democracy-of-Art
|
Thomas-Frew
|
PHP
|
Code
| 140
| 513
|
<?php
// Top-Level Connection and Session Elements (non-update variation)
if(!isset($_SESSION)) {
session_start();
}
if(!isset($_SESSION['user_id'])) {
include_once('tdoa_database_tools.php');
load();
}
else {
include_once('tdoa_database_tools.php');
include_once('database_connection/connect_db.php');
}
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$errors = array();
// Assigns Review Content to a variable
if(empty($_POST['review'])) {
$errors[] = "Please enter a name for this artwork.";
}
else {
$rev = mysqli_real_escape_string($dbc, trim($_POST['review']));
}
// Assigns Artwork ID to a variable
if(isset($_GET['artwork_id'])) {
$artwork_id = $_GET['artwork_id'];
}
else {
$errors[] = "Artwork not found. Please try again later";
}
if(empty($errors)) {
// MySQL Query (updates artwork review)
$q = "UPDATE tdoa_artworks SET review_desc = '$rev' WHERE artwork_id = $artwork_id";
$r = mysqli_query($dbc, $q);
if(mysqli_affected_rows($dbc) == 1) {
load('tdoa_exhibition.php');
}
else {
$errors[] = "Database connection failed. Please free to try again later." . mysqli_error($dbc);
include('tdoa_exhibition.php');
}
mysqli_close($dbc);
}
else {
include('tdoa_exhibition.php');
}
}
else {
load('tdoa_exhibition.php');
}
?>
| 5,891
|
https://github.com/FallenDev/ReSharper.EnhancedTooltip/blob/master/source/GammaJul.ReSharper.EnhancedTooltip/Presentation/IdentifierTooltipContent.cs
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
ReSharper.EnhancedTooltip
|
FallenDev
|
C#
|
Code
| 108
| 299
|
using System.Collections.Generic;
using JetBrains.UI.Icons;
using JetBrains.UI.RichText;
using JetBrains.Util;
namespace GammaJul.ReSharper.EnhancedTooltip.Presentation {
public class IdentifierTooltipContent : TooltipContent {
public IconId? Icon { get; set; }
public RichText? Description { get; set; }
public RichText? Obsolete { get; set; }
public RichText? Return { get; set; }
public RichText? Value { get; set; }
public RichText? Remarks { get; set; }
public int? OverloadCount { get; set; }
public List<ExceptionContent> Exceptions { get; } = new();
public RichText? BaseType { get; set; }
public List<RichText> ImplementedInterfaces { get; } = new();
public AttributeUsageContent? AttributeUsage { get; set; }
public IdentifierTooltipContent(RichText? text, TextRange trackingRange)
: base(text, trackingRange) {
}
}
}
| 25,464
|
https://github.com/PickHD/e-kuisioner-app/blob/master/app/views/auth/reqTokenPage.ejs
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
e-kuisioner-app
|
PickHD
|
EJS
|
Code
| 90
| 417
|
<div class="row" id="req-token-section">
<h1>Permintaan Ulang Token</h1>
<div class="wishes-concept">
<img src="/static/img/wishes_concept.svg" alt="wishes-concept">
</div>
<div class="req-form">
<form action="/auth/request-token" method="POST" autocomplete="on">
<div class="form-row">
<div class="form-group col-md-12">
<label for="email">Alamat Email Anda</label>
<input type="email" class="form-control form-control-sm" name="email" placeholder="Masukan Email Anda"
inputmode="email" required>
</div>
</div>
<div class="form-groups col-md-12">
<label for="choose_template">Tujuan Pengiriman Email</label>
<select name="choose_template" class="form-control form-control-sm" required>
<option>-Pilih Salah Satu Tujuan-</option>
<% listTemplate.forEach(l => { %>
<option><%=l%> </option>
<% }) %>
</select>
</div>
<button type="submit" class="btn btn-primary">Cari</button>
</form>
</div>
</div>
<% if (warningAlert) { %>
<script>
Swal.fire({
icon: 'warning',
title: 'Pemberitahuan',
text: '<%=msg%>',
})
</script>
<%};%>
| 36,710
|
https://github.com/raffitamizian/AwsWatchman/blob/master/Watchman.Engine/Generation/ServiceAlarmConfigExtensions.cs
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
AwsWatchman
|
raffitamizian
|
C#
|
Code
| 48
| 160
|
using Watchman.Configuration.Generic;
namespace Watchman.Engine.Generation
{
static class ServiceAlarmConfigExtensions
{
public static TAlarmConfig OverrideWith<TAlarmConfig>(this TAlarmConfig serviceConfig,
TAlarmConfig resourceConfig) where TAlarmConfig : class, IServiceAlarmConfig<TAlarmConfig>, new()
{
if (resourceConfig == null)
{
return serviceConfig ?? new TAlarmConfig();
}
if (serviceConfig == null)
{
return resourceConfig;
}
return resourceConfig.Merge(serviceConfig);
}
}
}
| 15,968
|
https://github.com/cloudzfy/leetcode/blob/master/src/380.insert_delete_getrandom_o_1/code.cpp
|
Github Open Source
|
Open Source
|
MIT
| 2,016
|
leetcode
|
cloudzfy
|
C++
|
Code
| 158
| 392
|
class RandomizedSet {
private:
vector<int> nums;
unordered_map<int, int> m;
public:
/** Initialize your data structure here. */
RandomizedSet() {
srand(time(0));
}
/** Inserts a value to the set. Returns true if the set did not already contain the specified element. */
bool insert(int val) {
if (m.find(val) == m.end()) {
m[val] = nums.size();
nums.push_back(val);
return true;
}
return false;
}
/** Removes a value from the set. Returns true if the set contained the specified element. */
bool remove(int val) {
if (m.find(val) != m.end()) {
nums[m[val]] = nums.back();
m[nums.back()] = m[val];
nums.pop_back();
m.erase(val);
return true;
}
return false;
}
/** Get a random element from the set. */
int getRandom() {
int idx = (double)rand() / RAND_MAX * nums.size();
return nums[idx];
}
};
/**
* Your RandomizedSet object will be instantiated and called as such:
* RandomizedSet obj = new RandomizedSet();
* bool param_1 = obj.insert(val);
* bool param_2 = obj.remove(val);
* int param_3 = obj.getRandom();
*/
| 17,210
|
https://github.com/motion-work/headless-neos-nuxt-kickstart/blob/master/components/content/Image.vue
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
headless-neos-nuxt-kickstart
|
motion-work
|
Vue
|
Code
| 33
| 118
|
<template>
<img :src="image.uri" :alt="image.alt" v-lazy-load>
</template>
<script>
export default {
props: ['__typename', 'type', 'identifier', 'group', 'options', 'image', 'link']
}
</script>
<style lang="scss" scoped>
img {
height: auto;
width: auto;
max-width: 100%;
}
</style>
| 33,979
|
https://github.com/Vinotha16/WIN_ROLLBACK/blob/master/templates/linux_actualfacts/centos8/suaccess_57_actual.fact
|
Github Open Source
|
Open Source
|
BSD-3-Clause
| 2,021
|
WIN_ROLLBACK
|
Vinotha16
|
Shell
|
Code
| 55
| 192
|
#!/bin/bash
a=$(cat /etc/pam.d/su | grep "^auth.*required.*pam_wheel.so" | xargs)
b=$(cat /etc/group | egrep "wheel:x:10:[a-z]+")
cmd="${a}","${b}"
if [ $(sudo grep '^auth.*required.*pam_wheel.so' /etc/pam.d/su | wc -l) -eq 0 ] || [ $(sudo egrep "wheel:x:10:[a-z]+" /etc/group | wc -l) -eq 0 ]; then
echo "{ \"suaccess_57_actual\" : \"\" }"
else
echo "{ \"suaccess_57_actual\" : \"${cmd}\" }"
exit 0
fi
| 40,935
|
https://github.com/BhuwanUpadhyay/12-safely-exchanging-information-across-microservices/blob/master/order-service/src/main/java/io/github/bhuwanupadhyay/order/infrastructure/brokers/rabbitmq/OrderEventSource.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
12-safely-exchanging-information-across-microservices
|
BhuwanUpadhyay
|
Java
|
Code
| 25
| 160
|
package io.github.bhuwanupadhyay.order.infrastructure.brokers.rabbitmq;
import org.springframework.cloud.stream.annotation.Input;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.SubscribableChannel;
public interface OrderEventSource {
String PAYMENT_RECEIVED_CHANNEL = "paymentReceivedChannel";
@Output("paymentRequestedChannel")
MessageChannel paymentRequested();
@Input(PAYMENT_RECEIVED_CHANNEL)
SubscribableChannel paymentReceived();
}
| 11,385
|
https://github.com/imalimin/FilmKilns/blob/master/src/al_common/include/AlTextWriter.h
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
FilmKilns
|
imalimin
|
C
|
Code
| 82
| 250
|
/*
* Copyright (c) 2018-present, lmyooyo@gmail.com.
*
* This source code is licensed under the GPL license found in the
* LICENSE file in the root directory of this source tree.
*/
#ifndef HWVC_ANDROID_ALTEXTWRITER_H
#define HWVC_ANDROID_ALTEXTWRITER_H
#include "AlAbsFileWriter.h"
al_class AlTextWriter al_extend AlAbsFileWriter {
public:
AlTextWriter(std::string path, bool appendMode = false);
virtual ~AlTextWriter();
virtual void close() override;
void append(char c);
void append(std::string text);
void append(int32_t value);
void append(int64_t value);
void append(float value);
void append(double value);
private:
FILE *file = nullptr;
};
#endif //HWVC_ANDROID_ALTEXTWRITER_H
| 21,339
|
https://github.com/schamberg97/bullshitMgimoProj/blob/master/software.py
|
Github Open Source
|
Open Source
|
Unlicense
| null |
bullshitMgimoProj
|
schamberg97
|
Python
|
Code
| 135
| 710
|
from myShop import MyShop
from myBot import MYBOT
from sMenu import Menu
class software:
@staticmethod
def runShowTables():
#подключаем библиотеку
import xml.dom.minidom as minidom
from sMenu import Menu
#читаем XML из файла
dom = minidom.parse("myShop.xml")
dom.normalize()
#Читаем таблицу
def listTable(what,whatSub):
pars=dom.getElementsByTagName(what)[0]
#Читаем элементы таблицы Materials
nodes=pars.getElementsByTagName(whatSub)
#Выводим элементы таблицы на экран
for node in nodes:
id = node.getElementsByTagName("id")[0]
name = node.getElementsByTagName("name")[0]
print(id.firstChild.data, name.firstChild.data)
menu_items=["Категории", "Цвета", "Адреса", "Материал", "Сезон", "Товар"]
menu_actions=['categories','colors', 'cities', 'materials', 'seasons', 'products'] # Базу клиентов и заказов не предлагаем ;)
menu_actions_nodes=['category','color', 'city', 'material', 'season', 'product']
menu_title="Смотреть таблицу"
my_menu=Menu(menu_title, menu_items)
choice=my_menu.get_user_choice()
listTable(menu_actions[choice-1], menu_actions_nodes[choice-1])
@staticmethod
def run():
#Создаем магазин товаров
myShop=MyShop("myShop.xml")
#myShop.printProduct()
#Добавляем тестовые данные
myShop.addSampleData(30, 30, 500)
#myShop.printProduct()
myShop.saveXML("new.xml")
#Создаем бота
bot=MYBOT(myShop)
#обучаем бота
bot.botTraining(0)
#получаем данные от пользователя
print('Для выхода - нажмите Ctrl-C')
sd=bot.getUserChoice()
#строим рекомендацию и выводим рекомендованный товар
print("Ваш рекомендованный товар: ",bot.getPrecigion(sd))
| 35,283
|
https://github.com/timoles/codeql/blob/master/javascript/ql/test/library-tests/frameworks/SQL/postgres2.js
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
codeql
|
timoles
|
JavaScript
|
Code
| 218
| 470
|
// Adapted from the documentation of https://github.com/brianc/node-postgres,
// which is licensed under the MIT license; see file node-postgres-LICENSE.
const pgPool = require('pg-pool');
// create a config to configure both pooling behavior
// and client options
// note: all config is optional and the environment variables
// will be read if the config is not present
var config = {
user: 'foo', //env var: PGUSER
database: 'my_db', //env var: PGDATABASE
password: 'secret', //env var: PGPASSWORD
host: 'localhost', // Server hosting the postgres database
port: 5432, //env var: PGPORT
max: 10, // max number of clients in the pool
idleTimeoutMillis: 30000, // how long a client is allowed to remain idle before being closed
};
//this initializes a connection pool
//it will keep idle connections open for 30 seconds
//and set a limit of maximum 10 idle clients
const pool = new pgPool(config);
pool.connect(function(err, client, done) {
if(err) {
return console.error('error fetching client from pool', err);
}
//use the client for executing the query
client.query('SELECT $1::int AS number', ['1'], function(err, result) {
//call `done(err)` to release the client back to the pool (or destroy it if there is an error)
done(err);
if(err) {
return console.error('error running query', err);
}
console.log(result.rows[0].number);
//output: 1
});
});
let client2 = await pool.connect();
client2.query('SELECT 123');
const Cursor = require('pg-cursor');
client2.query(new Cursor('SELECT * from users'));
| 6,231
|
https://github.com/RichardTiborNagy/point-cloud-visualizer/blob/master/Point Cloud Visualizer/Assets/Component Data/Values.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
point-cloud-visualizer
|
RichardTiborNagy
|
C#
|
Code
| 78
| 190
|
using Unity.Entities;
using Unity.Mathematics;
namespace PointCloudVisualizer
{
public struct PointPosition : IComponentData
{
public float3 Value;
public PointPosition(float3 newValue) { Value = newValue; }
public static implicit operator float3(PointPosition data) => data.Value;
public static implicit operator PointPosition(float3 data) => new PointPosition(data);
}
public struct PointColor : IComponentData
{
public float4 Value;
public PointColor(float4 newValue) { Value = newValue; }
public static implicit operator float4(PointColor data) => data.Value;
public static implicit operator PointColor(float4 data) => new PointColor(data);
}
}
| 35,575
|
https://github.com/ChromeDevTools/devtools-frontend/blob/master/node_modules/es-abstract/2021/IsExtensible.js
|
Github Open Source
|
Open Source
|
BSD-3-Clause, MIT
| 2,023
|
devtools-frontend
|
ChromeDevTools
|
JavaScript
|
Code
| 43
| 176
|
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $Object = GetIntrinsic('%Object%');
var isPrimitive = require('../helpers/isPrimitive');
var $preventExtensions = $Object.preventExtensions;
var $isExtensible = $Object.isExtensible;
// https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o
module.exports = $preventExtensions
? function IsExtensible(obj) {
return !isPrimitive(obj) && $isExtensible(obj);
}
: function IsExtensible(obj) {
return !isPrimitive(obj);
};
| 26,511
|
https://github.com/zhang1pr/LeetCode.js/blob/master/801-900/(855)ExamRoom.js
|
Github Open Source
|
Open Source
|
MIT
| null |
LeetCode.js
|
zhang1pr
|
JavaScript
|
Code
| 219
| 595
|
/**
* @param {number} N
*/
var ExamRoom = function(N) {
this.arr = [];
this.N = N;
};
// time: O(1)
// space: O(1)
/**
* @return {number}
*/
ExamRoom.prototype.seat = function() {
if (this.arr.length == 0) {
this.arr.push(0);
return 0;
}
let d = Math.max(this.arr[0], this.N - 1 - this.arr[this.arr.length - 1]);
for (let i = 0; i < this.arr.length - 1; i++) {
d = Math.max(d, Math.floor((this.arr[i + 1] - this.arr[i]) / 2));
}
if (this.arr[0] == d) {
this.arr.unshift(0);
return 0;
}
for (let i = 0; i < this.arr.length - 1; i++) {
if (Math.floor((this.arr[i + 1] - this.arr[i]) / 2) == d) {
this.arr.splice(i + 1, 0, Math.floor((this.arr[i + 1] + this.arr[i]) / 2));
return this.arr[i + 1];
}
}
this.arr.push(this.N - 1);
return this.N - 1;
};
// time: O(n)
// space: O(1)
/**
* @param {number} p
* @return {void}
*/
ExamRoom.prototype.leave = function(p) {
for (let i = 0; i < this.arr.length; i++) {
if (this.arr[i] == p) {
this.arr.splice(i, 1);
}
}
};
// time: O(n)
// space: O(1)
/**
* Your ExamRoom object will be instantiated and called as such:
* var obj = new ExamRoom(N)
* var param_1 = obj.seat()
* obj.leave(p)
*/
// ['ExamRoom', 'seat', 'seat', 'seat', 'seat', 'leave', 'seat'], [[10], [], [], [], [], [4], []]
| 43,151
|
https://github.com/wlbtm/MusicStory/blob/master/commons/src/main/java/com/cn/util/IpUtil.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,020
|
MusicStory
|
wlbtm
|
Java
|
Code
| 263
| 1,099
|
package com.cn.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
/**
* IP 获取工具类
*
* @author ngcly
* @date 2018-01-05 10:38
*/
@Component
public class IpUtil {
private static final String[] HEADERS = {
"X-Forwarded-For",
"Proxy-Client-IP",
"WL-Proxy-Client-IP",
"HTTP_X_FORWARDED_FOR",
"HTTP_X_FORWARDED",
"HTTP_X_CLUSTER_CLIENT_IP",
"HTTP_CLIENT_IP",
"HTTP_FORWARDED_FOR",
"HTTP_FORWARDED",
"HTTP_VIA",
"REMOTE_ADDR",
"X-Real-IP"
};
private static final String LOCAL_IPV6="0:0:0:0:0:0:0:1";
/**
* 判断ip是否为空,空返回true
* @param ip
* @return
*/
public static boolean isEmptyIp(final String ip){
return (ip == null || ip.length() == 0 || ip.trim().equals("") || "unknown".equalsIgnoreCase(ip));
}
/**
* 判断ip是否不为空,不为空返回true
* @param ip
* @return
*/
public static boolean isNotEmptyIp(final String ip){
return !isEmptyIp(ip);
}
/***
* 获取客户端ip地址(可以穿透代理)
* @param request HttpServletRequest
* @return
*/
public static String getIpAddress(HttpServletRequest request) {
String ip = "";
for (String header : HEADERS) {
ip = request.getHeader(header);
if(isNotEmptyIp(ip)) {
break;
}
}
if(isEmptyIp(ip)){
ip = request.getRemoteAddr();
}
if(isNotEmptyIp(ip) && ip.contains(",")){
ip = ip.split(",")[0];
}
if(LOCAL_IPV6.equals(ip)){
ip = "127.0.0.1";
}
return ip;
}
/**
* 获取本机的局域网ip地址,兼容Linux
* @return String
* @throws Exception
*/
public String getLocalHostIP() throws Exception{
Enumeration<NetworkInterface> allNetInterfaces = NetworkInterface.getNetworkInterfaces();
String localHostAddress = "";
while(allNetInterfaces.hasMoreElements()){
NetworkInterface networkInterface = allNetInterfaces.nextElement();
Enumeration<InetAddress> address = networkInterface.getInetAddresses();
while(address.hasMoreElements()){
InetAddress inetAddress = address.nextElement();
if(inetAddress != null && inetAddress instanceof Inet4Address){
localHostAddress = inetAddress.getHostAddress();
}
}
}
return localHostAddress;
}
/**
* 根据ip获取城市
* @return
* @throws UnsupportedEncodingException
*/
public static String getIpAddresses(String ip) {
String url;
// 淘宝接口
url = "http://whois.pconline.com.cn/ipJson.jsp?json=true&ip="+ip;
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> responseEntity = restTemplate.getForEntity(url,String.class);
if(responseEntity.getStatusCode().is2xxSuccessful()){
JSONObject data = JSON.parseObject(responseEntity.getBody());
return data.getString("addr");
}
return null;
}
}
| 2,708
|
https://github.com/denandrapr/INTA/blob/master/index.php
|
Github Open Source
|
Open Source
|
MIT
| 2,018
|
INTA
|
denandrapr
|
Hack
|
Code
| 373
| 1,838
|
<!DOCTYPE html>
<html lang="zxx">
<head>
<title>Beranda</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<script>
addEventListener("load", function () {
setTimeout(hideURLbar, 0);
}, false);
function hideURLbar() {
window.scrollTo(0, 1);
}
</script>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<link href="css/prettyPhoto.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel='stylesheet' type='text/css' />
<link href="css/fontawesome-all.css" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=Quicksand:300,400,500,700" rel="stylesheet">
</head>
<body>
<!--/banner-w3layouts-sec-->
<div class="banner-w3layouts">
<header>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="index.html">Opo Jeneng e?</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon">
<i class="fas fa-bars"></i>
</span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="index.html">Beranda
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item ml-xl-2">
<a class="nav-link" href="pricing.html">Tentang</a>
</li>
</ul>
</div>
</nav>
</header>
<!--banner-w3layouts-->
<div class="banner-w3layouts-info">
<!--/search_form -->
<div id="search_form" class="search_top text-center">
<h3>Kenali Bencana Disekitar Kita</h3>
<p>Sistem Informasi Bencana</p>
<form action="hasil.php" method="get" class="ban-form row">
<div class="col-md-1 banf">
</div>
<div class="col-md-7 banf">
<input class="form-control" type="text" name="cari" placeholder="Kata Kunci / Hashtag" required="">
</div>
<div class="col-md-3 banf">
<input class="form-control" type="submit" value="Cari">
</div>
<div class="col-md-1 banf">
</div>
</form>
</div>
<!--//search_form -->
</div>
<!--//banner-w3layouts-->
</div>
<!--//banner-w3layouts-sec-->
<!---->
<!-- /.footer -->
<script src="js/jquery-2.2.3.min.js"></script>
<!-- carousel -->
<script src="js/owl.carousel.js"></script>
<script>
$(document).ready(function () {
$('.owl-carousel').owlCarousel({
loop: true,
margin: 10,
responsiveClass: true,
responsive: {
0: {
items: 1,
nav: true
},
600: {
items: 2,
nav: false
},
900: {
items: 3,
nav: false
},
1000: {
items: 4,
nav: true,
loop: false,
margin: 20
}
}
})
})
</script>
<!-- //carousel -->
<!-- stats -->
<script src="js/jquery.waypoints.min.js"></script>
<script src="js/jquery.countup.js"></script>
<script>
$('.counter').countUp();
</script>
<!-- //stats -->
<!-- flexSlider -->
<script defer src="js/jquery.flexslider.js"></script>
<script>
$(window).load(function () {
$('.flexslider').flexslider({
animation: "slide",
start: function (slider) {
$('body').removeClass('loading');
}
});
});
</script>
<!-- //flexSlider -->
<!-- start-smooth-scrolling -->
<script src="js/move-top.js"></script>
<script src="js/easing.js"></script>
<script>
jQuery(document).ready(function ($) {
$(".scroll").click(function (event) {
event.preventDefault();
$('html,body').animate({
scrollTop: $(this.hash).offset().top
}, 1000);
});
});
</script>
<!-- //end-smooth-scrolling -->
<!-- dropdown nav -->
<script>
$(document).ready(function () {
$(".dropdown").hover(
function () {
$('.dropdown-menu', this).stop(true, true).slideDown("fast");
$(this).toggleClass('open');
},
function () {
$('.dropdown-menu', this).stop(true, true).slideUp("fast");
$(this).toggleClass('open');
}
);
});
</script>
<!-- //dropdown nav -->
<!-- smooth-scrolling-of-move-up -->
<script>
$(document).ready(function () {
/*
var defaults = {
containerID: 'toTop', // fading element id
containerHoverID: 'toTopHover', // fading element hover id
scrollSpeed: 1200,
easingType: 'linear'
};
*/
$().UItoTop({
easingType: 'easeOutQuart'
});
});
</script>
<!-- //smooth-scrolling-of-move-up -->
<script src="js/bootstrap.js"></script>
<!-- js file -->
</body>
</html>
| 46,513
|
https://github.com/callstack/react-native-paper/blob/master/src/components/Checkbox/Checkbox.tsx
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
react-native-paper
|
callstack
|
TSX
|
Code
| 243
| 552
|
import * as React from 'react';
import { GestureResponderEvent, Platform } from 'react-native';
import CheckboxAndroid from './CheckboxAndroid';
import CheckboxIOS from './CheckboxIOS';
import { useInternalTheme } from '../../core/theming';
import type { ThemeProp } from '../../types';
export type Props = {
/**
* Status of checkbox.
*/
status: 'checked' | 'unchecked' | 'indeterminate';
/**
* Whether checkbox is disabled.
*/
disabled?: boolean;
/**
* Function to execute on press.
*/
onPress?: (e: GestureResponderEvent) => void;
/**
* Custom color for unchecked checkbox.
*/
uncheckedColor?: string;
/**
* Custom color for checkbox.
*/
color?: string;
/**
* @optional
*/
theme?: ThemeProp;
/**
* testID to be used on tests.
*/
testID?: string;
};
/**
* Checkboxes allow the selection of multiple options from a set.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { Checkbox } from 'react-native-paper';
*
* const MyComponent = () => {
* const [checked, setChecked] = React.useState(false);
*
* return (
* <Checkbox
* status={checked ? 'checked' : 'unchecked'}
* onPress={() => {
* setChecked(!checked);
* }}
* />
* );
* };
*
* export default MyComponent;
* ```
*/
const Checkbox = ({ theme: themeOverrides, ...props }: Props) => {
const theme = useInternalTheme(themeOverrides);
return Platform.OS === 'ios' ? (
<CheckboxIOS {...props} theme={theme} />
) : (
<CheckboxAndroid {...props} theme={theme} />
);
};
export default Checkbox;
// @component-docs ignore-next-line
const CheckboxWithTheme = Checkbox;
// @component-docs ignore-next-line
export { CheckboxWithTheme as Checkbox };
| 19,847
|
https://github.com/Shreyanshmmgn/Pokemon-Masters/blob/master/Assets/Scripts/cameraMovement.cs
|
Github Open Source
|
Open Source
|
MIT
| null |
Pokemon-Masters
|
Shreyanshmmgn
|
C#
|
Code
| 79
| 230
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class cameraMovement : MonoBehaviour
{
// Start is called before the first frame update
// public Camera camera_1;
[SerializeField]
public Transform g1,g2;
[SerializeField]
public Vector2 intialPosition;
public Animator animator;
void Start()
{
// camera_1 = GetComponent<Camera>();
animator = GetComponent<Animator>();
// intialPosition = camera_1.transform.position;
}
// Update is called once per frame
void Update()
{
}
public void newPosition()
{
gameObject.transform.position = g2.transform.position;
}
public void newPosition2()
{
gameObject.transform.position = g1.transform.position;
}
}
| 27,872
|
https://github.com/matoruru/purescript-react-material-ui-svgicon/blob/master/src/MaterialUI/SVGIcon/Icon/Restaurant.purs
|
Github Open Source
|
Open Source
|
MIT
| null |
purescript-react-material-ui-svgicon
|
matoruru
|
PureScript
|
Code
| 45
| 133
|
module MaterialUI.SVGIcon.Icon.Restaurant
( restaurant
, restaurant_
) where
import Prelude (flip)
import MaterialUI.SVGIcon.Type (SVGIcon, SVGIcon_)
import React (unsafeCreateElement, ReactClass) as R
foreign import restaurantImpl :: forall a. R.ReactClass a
restaurant :: SVGIcon
restaurant = flip (R.unsafeCreateElement restaurantImpl) []
restaurant_ :: SVGIcon_
restaurant_ = restaurant {}
| 26,567
|
https://github.com/bradunov/shkola/blob/master/questions/numbers/q00012/iter.lua
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
shkola
|
bradunov
|
Lua
|
Code
| 20
| 67
|
array_number = {}
array_number[1] = math.random(5)
factor = math.random(6) + 1;
for i = 2,7 do
array_number[i] = array_number[i-1]+factor;
end
| 7,967
|
https://github.com/AntoineGRoy/literacy-data-api/blob/master/test/cacheManager.spec.js
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
literacy-data-api
|
AntoineGRoy
|
JavaScript
|
Code
| 285
| 861
|
const sinon = require('sinon');
const proxyquire = require('proxyquire');
const sandbox = sinon.createSandbox();
describe('CacheManager', () => {
let memcached;
let cache;
let params;
beforeEach(() => {
cache = {
jobId: 'fake-job',
token: 'th1s1safak3t0k3n'
};
memcached = {
set: sandbox.stub(),
get: sandbox.stub().returns(cache),
del: sandbox.stub()
};
params = {
pkg_id: 'pkg',
cursor: 123456789000000,
};
});
const { MemcachedManager } = proxyquire('../src/helperClasses', {
'memcached': sinon.stub().callsFake(() => {
return memcached;
}),
});
afterEach(() => {
sandbox.restore();
});
it('should initialize successfully', () => {
const test = new MemcachedManager('fakeaddr');
test.memcached.should.deep.equal(memcached);
});
it('should throw an error if no address specified', () => {
try {
const test = new MemcachedManager();
test.should.equal(null);
} catch (e) {
e.message.should.equal('Please provide a cache address');
}
});
it('should set a key-value pair in the cache', ()=>{
const test = new MemcachedManager('fakeaddr');
test.cacheResults('fake-key', cache, 3600);
memcached.set.should.have.been.calledWith('fake-key', cache, 3600, sinon.match.func);
});
it('should get the corresponding cache from the key', () => {
const test = new MemcachedManager('fakeaddr');
test.get('fake-key', (err, data) => {
});
memcached.get.should.have.been.calledWith('fake-key', sinon.match.func);
});
it('should delete the key-value pair from the cache', ()=>{
const test = new MemcachedManager('fakeaddr');
test.removeCache('fake-key');
memcached.del.should.have.been.calledWith('fake-key', sinon.match.func);
});
it('should create a key from the prefix and parameters', () => {
const test = new MemcachedManager('fakeaddr');
const newKey = test.createKey('test', params);
newKey.should.equal(`__test__${params.pkg_id}${params.cursor}`);
});
it('should throw an error on bad prefix arguments', () => {
try {
const test = new MemcachedManager('fakeaddr');
const newKey = test.createKey(() => {return 'test'}, params);
} catch(e) {
e.message.should.equal('Keys can only be made with strings or numbers!');
}
});
it('should throw an error on bad key params', () => {
params.pkg_id = true;
try {
const test = new MemcachedManager('fakeaddr');
const newKey = test.createKey('test', params);
} catch(e) {
e.message.should.equal('Keys can only be made with strings or numbers!');
}
});
});
| 2,712
|
https://github.com/Genbox/SimpleS3-Ext/blob/master/src/SimpleS3.Core/Network/Requests/Buckets/GetBucketTaggingRequest.cs
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
SimpleS3-Ext
|
Genbox
|
C#
|
Code
| 88
| 239
|
using Genbox.SimpleS3.Core.Abstracts.Enums;
using Genbox.SimpleS3.Core.Common.Marshal;
namespace Genbox.SimpleS3.Core.Network.Requests.Buckets
{
/// <summary>
/// Returns the tag set associated with the bucket. To use this operation, you must have permission to perform the s3:GetBucketTagging action.
/// By default, the bucket owner has this permission and can grant this permission to others.
/// </summary>
public class GetBucketTaggingRequest : BaseRequest, IHasBucketName
{
internal GetBucketTaggingRequest() : base(HttpMethod.GET) { }
public GetBucketTaggingRequest(string bucketName) : this()
{
Initialize(bucketName);
}
public string BucketName { get; set; }
internal void Initialize(string bucketName)
{
BucketName = bucketName;
}
}
}
| 5,675
|
https://github.com/RozzaaqAbdul/klinikkeuangan/blob/master/cms/cmskeuangan/views/v_header.php
|
Github Open Source
|
Open Source
|
LicenseRef-scancode-unknown-license-reference, MIT
| 2,020
|
klinikkeuangan
|
RozzaaqAbdul
|
PHP
|
Code
| 62
| 257
|
<header class="main-header">
<!-- Logo -->
<a href="index.html" class="logo">
<!-- mini logo -->
<div class="logo-mini">
<span class="light-logo"><img src="<?php echo base_url(); ?>images/logo-light.png" alt="logo"></span>
<span class="dark-logo"><img src="<?php echo base_url(); ?>images/logo-dark.png" alt="logo"></span>
</div>
<!-- logo-->
<div class="logo-lg">
<span class="light-logo"><img src="<?php echo base_url(); ?>images/logo-light-text.png" alt="logo"></span>
<span class="dark-logo"><img src="<?php echo base_url(); ?>images/logo-dark-text.png" alt="logo"></span>
</div>
</a>
<!-- Header Navbar -->
<nav class="navbar navbar-static-top">
<!-- Sidebar toggle button-->
</nav>
</header>
| 39,779
|
https://github.com/sushilkumarss-sdn/medulla/blob/master/deploy/tidb-cluster/Tiltfile
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
medulla
|
sushilkumarss-sdn
|
Starlark
|
Code
| 44
| 472
|
k8s_yaml(helm('.', name='tidb-cluster', namespace='tidb-cluster', values=['./values.tilt.yaml']))
k8s_kind('TidbCluster', pod_readiness='ignore')
k8s_resource(
workload='tidb-cluster',
resource_deps=['tidb-scheduler'],
objects=['tidb-cluster:namespace'],
labels=['tidb-cluster']
)
k8s_resource(
new_name='tidb-cluster-discovery',
extra_pod_selectors=[{'app.kubernetes.io/component': 'discovery'}],
resource_deps=['tidb-cluster'],
objects=['tilt-tidb-cluster-discovery:configmap'],
labels=['tidb-cluster']
)
k8s_resource(
new_name='tidb-cluster-pd',
extra_pod_selectors=[{'app.kubernetes.io/component': 'pd'}],
resource_deps=['tidb-cluster'],
objects=['tilt-tidb-cluster-pd:configmap'],
labels=['tidb-cluster']
)
k8s_resource(
new_name='tidb-cluster-tikv',
extra_pod_selectors=[{'app.kubernetes.io/component': 'tikv'}],
resource_deps=['tidb-cluster'],
objects=['tilt-tidb-cluster-tikv:configmap'],
labels=['tidb-cluster']
)
k8s_resource(
new_name='tidb-cluster-tidb',
extra_pod_selectors=[{'app.kubernetes.io/component': 'tidb'}],
resource_deps=['tidb-cluster'],
objects=['tilt-tidb-cluster-tidb:configmap'],
labels=['tidb-cluster']
)
| 30,605
|
https://github.com/michaeldaou/scala/blob/master/test/files/neg/inlineMaxSize.scala
|
Github Open Source
|
Open Source
|
BSD-3-Clause
| 2,021
|
scala
|
michaeldaou
|
Scala
|
Code
| 100
| 134
|
// not a JUnit test because of https://github.com/scala-opt/scala/issues/23
class C {
@inline final def f = 0
@inline final def g = f + f + f + f + f + f + f + f + f + f
@inline final def h = g + g + g + g + g + g + g + g + g + g
@inline final def i = h + h + h + h + h + h + h + h + h + h
@inline final def j = i + i + i
}
| 24,708
|
https://github.com/knight666/exlibris/blob/master/Projects/FrameworkGL/Application.h
|
Github Open Source
|
Open Source
|
MIT
| null |
exlibris
|
knight666
|
C
|
Code
| 170
| 581
|
#ifndef _APPLICATION_H_
#define _APPLICATION_H_
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
namespace Framework
{
class Application
{
public:
Application(int a_ArgumentCount, const char** a_Arguments);
virtual ~Application();
GLFWwindow* GetWindow() const;
virtual bool ParseCommandLine(int a_ArgumentCount, const char** a_Arguments) = 0;
virtual bool Initialize() = 0;
virtual void Update(float a_DeltaTime) = 0;
virtual void Render() = 0;
virtual void Destroy() = 0;
bool IsRunning() const;
void Quit();
int Run();
protected:
virtual void OnCharacter(unsigned int a_Character);
virtual void OnKeyPressed(int a_Key, int a_ScanCode, int a_Modifiers);
virtual void OnKeyReleased(int a_Key, int a_ScanCode, int a_Modifiers);
virtual void OnMouseMoved(const glm::vec2& a_Position);
virtual void OnButtonPressed(int a_Button, const glm::vec2& a_Position, int a_Modifiers);
virtual void OnButtonReleased(int a_Button, const glm::vec2& a_Position, int a_Modifiers);
private:
bool _InitializeOpenGL();
void _DestroyOpenGL();
friend void ProcessCharacter(GLFWwindow* a_Window, unsigned int a_Character);
friend void ProcessKey(GLFWwindow* a_Window, int a_Key, int a_ScanCode, int a_Action, int a_Modifiers);
friend void ProcessButton(GLFWwindow* a_Window, int a_Button, int a_Action, int a_Modifiers);
friend void ProcessCursor(GLFWwindow* a_Window, double a_X, double a_Y);
protected:
bool m_Running;
int m_ArgumentCount;
const char** m_Arguments;
GLFWwindow* m_Window;
}; // class Application
}; // namespace Framework
#endif
| 14,862
|
https://github.com/forgottenlands/ForgottenCore406/blob/master/src/server/game/Entities/Item/Container/Bag.h
|
Github Open Source
|
Open Source
|
OpenSSL
| null |
ForgottenCore406
|
forgottenlands
|
C
|
Code
| 318
| 774
|
/*
* Copyright (C) 2005 - 2012 MaNGOS <http://www.getmangos.com/>
*
* Copyright (C) 2008 - 2012 Trinity <http://www.trinitycore.org/>
*
* Copyright (C) 2010 - 2012 ProjectSkyfire <http://www.projectskyfire.org/>
*
* Copyright (C) 2011 - 2012 ArkCORE <http://www.arkania.net/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef ARKCORE_BAG_H
#define ARKCORE_BAG_H
// Maximum 36 Slots ((CONTAINER_END - CONTAINER_FIELD_SLOT_1)/2
#define MAX_BAG_SIZE 36 // 2.0.12
#include "Item.h"
#include "ItemPrototype.h"
class Bag: public Item {
public:
Bag();
~Bag();
void AddToWorld();
void RemoveFromWorld();
bool Create(uint32 guidlow, uint32 itemid, Player const* owner);
void Clear();
void StoreItem(uint8 slot, Item *pItem, bool update);
void RemoveItem(uint8 slot, bool update);
Item* GetItemByPos(uint8 slot) const;
uint32 GetItemCount(uint32 item, Item* eItem = NULL) const;
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem =
NULL) const;
uint8 GetSlotByItemGUID(uint64 guid) const;
bool IsEmpty() const;
uint32 GetFreeSlots() const;
uint32 GetBagSize() const {
return GetUInt32Value(CONTAINER_FIELD_NUM_SLOTS);
}
// DB operations
// overwrite virtual Item::SaveToDB
void SaveToDB(SQLTransaction& trans);
// overwrite virtual Item::LoadFromDB
bool LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields,
uint32 entry);
// overwrite virtual Item::DeleteFromDB
void DeleteFromDB(SQLTransaction& trans);
void BuildCreateUpdateBlockForPlayer(UpdateData *data,
Player *target) const;
protected:
// Bag Storage space
Item* m_bagslot[MAX_BAG_SIZE];
};
inline Item* NewItemOrBag(ItemPrototype const * proto) {
return (proto->InventoryType == INVTYPE_BAG) ? new Bag : new Item;
}
#endif
| 5,990
|
https://github.com/r-azo-r/REEF/blob/master/reef-runtime-local/src/main/java/com/microsoft/reef/runtime/local/driver/Container.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,014
|
REEF
|
r-azo-r
|
Java
|
Code
| 314
| 586
|
/**
* Copyright (C) 2014 Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.microsoft.reef.runtime.local.driver;
import com.microsoft.reef.annotations.audience.Private;
import java.io.File;
import java.util.List;
/**
* Represents a Container: A slice of a machine.
* <p/>
* In the case of the local resourcemanager, this slice is always the one of the machine where the job was submitted.
*/
@Private
interface Container extends AutoCloseable {
/**
* Run the given commandLine in the container.
*
* @param commandLine the command line to execute. It will typically be joined by spaces to form the command line.
*/
public void run(final List<String> commandLine);
/**
* Copies the files to the working directory of the container.
*
* @param files the files to be added to the container.
*/
public void addLocalFiles(final Iterable<File> files);
public void addGlobalFiles(final File globalFolder);
/**
* @return true if the Container is currently executing, false otherwise.
*/
public boolean isRunning();
/**
* @return the ID of the node this Container is executing on.
*/
public String getNodeID();
/**
* @return the ID of this Container.
*/
public String getContainerID();
/**
* @return the main memory available to the Container.
*/
public int getMemory();
/**
* @return the core available to the Container.
*/
public int getNumberOfCores();
/**
* @return the working directory of the Container.
*/
public File getFolder();
/**
* Kills the Container.
*/
@Override
public void close();
}
| 47,482
|
https://github.com/sscharfenberg/imperiumstellarum/blob/master/resources/src/game/components/Modal/Modal.vue
|
Github Open Source
|
Open Source
|
MIT
| null |
imperiumstellarum
|
sscharfenberg
|
Vue
|
Code
| 314
| 1,104
|
<script>
/******************************************************************************
* Component: ModalDialogue
*****************************************************************************/
import { useI18n } from "vue-i18n";
import { computed, onMounted, onUnmounted } from "vue";
import GameButton from "Components/Button/GameButton";
import Icon from "Components/Icon/Icon";
export default {
name: "ModalDialogue",
props: {
title: {
type: String,
required: true,
},
fullSize: Boolean,
},
components: { Icon, GameButton },
emits: ["close"],
setup(props, { emit, slots }) {
const onKeyDown = (e) => {
if (e.key === "Escape") {
document.removeEventListener("keydown", onKeyDown);
emit("close");
}
};
const renderActions = computed(() => slots.actions);
onMounted(() => {
document.addEventListener("keydown", onKeyDown);
});
onUnmounted(() => {
document.removeEventListener("keydown", onKeyDown);
});
return {
renderActions,
...useI18n(),
};
},
};
</script>
<template>
<div class="modal" :style="{ display: 'block' }">
<div class="modal__backdrop">
<div class="modal__dialog" :class="{ wide: fullSize }">
<header class="modal__head">
<h1>{{ title }}</h1>
<button class="app-btn small close" @click="$emit('close')">
<icon name="cancel" :size="2" />
</button>
</header>
<main class="modal__body">
<slot></slot>
</main>
<nav class="modal__actions" v-if="renderActions">
<game-button
@click="$emit('close')"
:text-string="t('common.modal.cancel')"
icon-name="cancel"
/>
<slot name="actions"></slot>
</nav>
</div>
</div>
</div>
</template>
<style lang="scss">
// the rest of the styles can be found in
// resources/src/app/styles/components/_modal.scss
.stats {
display: grid;
grid-template-columns: calc(50% - 2px) calc(50% - 2px);
padding: 0;
margin: 0 0 16px 0;
grid-gap: 4px;
list-style: none;
> li {
padding: 4px;
text-align: center;
@include themed() {
border: 1px solid t("g-abbey");
background: t("g-deep");
}
&.featured {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
@include themed() {
border-color: t("g-infra");
}
}
&.stats--two-col {
grid-column: 1 / span 2;
}
&.stats__dots {
padding: 4px 8px 0 8px;
}
&.stats--centered {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
&.stats--padded {
padding: 8px;
}
&.text-left {
justify-content: flex-start;
text-align: left;
}
&.justified {
justify-content: space-between;
}
}
&__dot {
display: inline-block;
width: 4px;
height: 4px;
margin: 0 4px 4px 0;
border-radius: 50%;
text-indent: -1000em;
@include themed() {
background: linear-gradient(
to bottom,
t("s-warning") 0%,
t("s-error") 100%
);
}
}
}
.wide {
max-width: 800px;
margin: 10px;
@include respond-to("small") {
margin: 30px 20px 20px 20px;
}
}
</style>
| 20,570
|
https://github.com/ajomuch92/metro-button-flutter/blob/master/example/lib/main.dart
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
metro-button-flutter
|
ajomuch92
|
Dart
|
Code
| 151
| 612
|
import 'package:flutter/material.dart';
import 'package:metro_button/metro_button.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Metro Buttons Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: Scaffold(
appBar: AppBar(
title: Text('Metro Buttons Demo'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CommandButton(
title: Text(
'Title',
style: TextStyle(
fontSize: 40.0,
color: Colors.blueAccent
),
overflow: TextOverflow.ellipsis,
),
subtitle: Text(
'Subtitle',
style: TextStyle(
fontSize: 16.0,
color: Colors.blueAccent
),
overflow: TextOverflow.ellipsis,
),
onTap: (){print('Hello');},
icon: Icon(Icons.ac_unit, color: Colors.blueAccent, size: 44.0,),
backgroundColor: Colors.white,
borderColor: Colors.blueAccent,
reverse: true,
radius: 5.0,
),
SizedBox(height: 10.0),
ShortcutButton(
title: Text(
'Title',
style: TextStyle(
fontSize: 20.0,
color: Colors.blueAccent
),
overflow: TextOverflow.ellipsis,
),
onTap: (){print('World');},
icon: Icon(Icons.ac_unit, color: Colors.blueAccent, size: 32.0,),
backgroundColor: Colors.white,
borderColor: Colors.blueAccent,
radius: 3.0,
badge: Text('10', style: TextStyle(color: Colors.blueAccent, fontSize: 12),),
size: 100.0,
),
],
),
),
),
);
}
}
| 16,280
|
https://github.com/1757WestwoodRobotics/mentorbot/blob/master/commands/setreturn.py
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
mentorbot
|
1757WestwoodRobotics
|
Python
|
Code
| 49
| 170
|
from commands2 import CommandBase
from subsystems.drivesubsystem import DriveSubsystem
class SetReturn(CommandBase):
def __init__(self, drive: DriveSubsystem) -> None:
CommandBase.__init__(self)
self.drive = drive
def initialize(self) -> None:
currentPose = self.drive.odometry.getPose()
self.drive.returnPos = currentPose
currentX = currentPose.X()
currentY = currentPose.Y()
print("New Coordinates \nX: {0}, Y: {1}".format(currentX, currentY))
def isFinished(self) -> bool:
return True
| 13,853
|
https://github.com/tresata-opensource/quartz-couchdb-store/blob/master/src/main/java/org/motechproject/quartz/CouchDbTrigger.java
|
Github Open Source
|
Open Source
|
BSD-2-Clause
| 2,013
|
quartz-couchdb-store
|
tresata-opensource
|
Java
|
Code
| 519
| 1,963
|
package org.motechproject.quartz;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonSubTypes;
import org.codehaus.jackson.annotate.JsonTypeInfo;
import org.quartz.Calendar;
import org.quartz.JobDataMap;
import org.quartz.JobKey;
import org.quartz.TriggerKey;
import org.quartz.impl.triggers.AbstractTrigger;
import java.util.Date;
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "triggerType")
@JsonSubTypes({
@JsonSubTypes.Type(value = CouchDbSimpleTrigger.class, name = "simple"),
@JsonSubTypes.Type(value = CouchDbCronTrigger.class, name = "cron"),
@JsonSubTypes.Type(value = CouchDbCalendarIntervalTrigger.class, name = "calendar")
})
public abstract class CouchDbTrigger<T extends AbstractTrigger> {
private T trigger;
private String revision;
private String type;
private CouchDbTriggerState state;
private Date startTime;
private Date endTime;
public CouchDbTrigger(T trigger, CouchDbTriggerState state) {
this.type = "CouchDbTrigger";
this.trigger = trigger;
this.state = state;
}
public CouchDbTrigger(T trigger) {
this(trigger, CouchDbTriggerState.WAITING);
}
@JsonProperty("type")
public String getType() {
return this.type;
}
@JsonProperty("type")
public void setType(String type) {
this.type = type;
}
@JsonProperty("_id")
public String getId() {
return toId(getGroup(), getName());
}
public static String toId(String group, String name) {
return "trigger:" + group + "-" + name;
}
@JsonProperty("_id")
public void setId(String id) {
// id is derived dont set it
}
@JsonProperty("_rev")
public String getRevision() {
return revision;
}
@JsonProperty("_rev")
public void setRevision(String revision) {
this.revision = revision;
}
@JsonProperty("trigger_name")
public String getName() {
return trigger.getName();
}
@JsonProperty("trigger_name")
public void setName(String name) {
trigger.setName(name);
}
@JsonProperty("trigger_group")
public String getGroup() {
return trigger.getGroup();
}
@JsonProperty("trigger_group")
public void setGroup(String group) {
trigger.setGroup(group);
}
@JsonProperty("job_name")
public String getJobName() {
return trigger.getJobName();
}
@JsonProperty("job_name")
public void setJobName(String jobName) {
trigger.setJobName(jobName);
}
@JsonProperty("job_group")
public String getJobGroup() {
return trigger.getJobGroup();
}
@JsonProperty("job_group")
public void setJobGroup(String jobGroup) {
trigger.setJobGroup(jobGroup);
}
@JsonProperty("description")
public String getDescription() {
return trigger.getDescription();
}
@JsonProperty("description")
public void setDescription(String description) {
trigger.setDescription(description);
}
@JsonProperty("state")
public CouchDbTriggerState getState() {
return state;
}
@JsonProperty("state")
public void setState(CouchDbTriggerState state) {
this.state = state;
}
@JsonProperty("next_fire_time")
public Date getNextFireTime() {
return trigger.getNextFireTime();
}
@JsonProperty("next_fire_time")
public void setNextFireTime(Date nextFireTime) {
trigger.setNextFireTime(nextFireTime);
}
@JsonProperty("previous_fire_time")
public Date getPreviousFireTime() {
return trigger.getPreviousFireTime();
}
@JsonProperty("previous_fire_time")
public void setPreviousFireTime(Date previousFireTime) {
trigger.setPreviousFireTime(previousFireTime);
}
@JsonProperty("priority")
public Integer getPriorityValue() {
return trigger.getPriority();
}
@JsonProperty("priority")
public void setPriorityValue(Integer priority) {
trigger.setPriority(priority);
}
@JsonProperty("start_time")
public Date getStartTime() {
return trigger.getStartTime();
}
@JsonProperty("start_time")
public void setStartTime(Date startTime) {
this.startTime = startTime;
trigger.setStartTime(this.startTime);
setEndTimeIfAlreadyDeserialized();
}
@JsonProperty("end_time")
public Date getEndTime() {
return trigger.getEndTime();
}
/* if trigger.setEndTime() is called before start time is deserialized by jackson,
it complains that end time must be before start time; workaround to ensure setEndTime()
is called only after both startTime and endTime have been deserialized
*/
@JsonProperty("end_time")
public void setEndTime(Date endTime) {
this.endTime = endTime;
if (this.startTime != null) {
setEndTimeIfAlreadyDeserialized();
}
}
private void setEndTimeIfAlreadyDeserialized() {
if (this.endTime != null) {
trigger.setEndTime(this.endTime);
this.endTime = null;
}
}
@JsonProperty("calendar_name")
public void setCalendarName(String calendarName) {
trigger.setCalendarName(calendarName);
}
@JsonProperty("calendar_name")
public String getCalendarName() {
return trigger.getCalendarName();
}
@JsonProperty("misfire_instruction")
public void setMisfireInstructionValue(Integer misfireInstruction) {
trigger.setMisfireInstruction(misfireInstruction);
}
@JsonProperty("misfire_instruction")
public Integer getMisfireInstructionValue() {
return trigger.getMisfireInstruction();
}
@JsonProperty("job_data")
public JobDataMap getJobDataMap() {
return trigger.getJobDataMap();
}
@JsonProperty("job_data")
public void setJobDataMap(JobDataMap jobDataMap) {
trigger.setJobDataMap(jobDataMap);
}
@JsonIgnore
public T getTrigger() {
return trigger;
}
@JsonIgnore
public T getBaseTrigger() {
return trigger;
}
@JsonIgnore
public TriggerKey getKey() {
return trigger.getKey();
}
@JsonIgnore
public JobKey getJobKey() {
return trigger.getJobKey();
}
@JsonIgnore
public void triggered(Calendar calendar) {
trigger.triggered(calendar);
}
@JsonIgnore
public void updateWithNewCalendar(Calendar calendar, int misfireThreshold) {
trigger.updateWithNewCalendar(calendar, misfireThreshold);
}
}
| 46,873
|
https://github.com/Smurf-IV/Krypton-Toolkit-Suite-Extended-NET-4.7/blob/master/Source/Krypton Toolkit Suite Extended/Shared/Toolkit Settings/Classes/Palette Explorer/Colours/AllMergedColourSettingsManager.cs
|
Github Open Source
|
Open Source
|
BSD-3-Clause
| 2,020
|
Krypton-Toolkit-Suite-Extended-NET-4.7
|
Smurf-IV
|
C#
|
Code
| 2,323
| 9,525
|
#region BSD License
/*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE.md file or at
* https://github.com/Wagnerp/Krypton-Toolkit-Suite-Extended-NET-5.470/blob/master/LICENSE
*
*/
#endregion
using Core.Classes;
using Microsoft.WindowsAPICodePack.Dialogs;
using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using ToolkitSettings.BackEnd;
using ToolkitSettings.Settings.Palette_Explorer.Colours;
namespace ToolkitSettings.Classes.PaletteExplorer.Colours
{
public class AllMergedColourSettingsManager
{
#region Variables
private bool _alwaysUsePrompt = false, _settingsModified = false;
private AllMergedColourSettings _allMergedColourSettings = new AllMergedColourSettings();
#endregion
#region Properties
/// <summary>
/// Gets or sets a value indicating whether [always use prompt].
/// </summary>
/// <value>
/// <c>true</c> if [always use prompt]; otherwise, <c>false</c>.
/// </value>
public bool AlwaysUsePrompt
{
get
{
return _alwaysUsePrompt;
}
set
{
_alwaysUsePrompt = value;
}
}
/// <summary>
/// Gets or sets a value indicating whether [settings modified].
/// </summary>
/// <value>
/// <c>true</c> if [settings modified]; otherwise, <c>false</c>.
/// </value>
public bool SettingsModified
{
get
{
return _settingsModified;
}
set
{
_settingsModified = value;
}
}
#endregion
#region Settings Manipulation
/// <summary>
/// Sets the value of AlwaysUsePrompt to value.
/// </summary>
/// <param name="value">The value of AlwaysUsePrompt.</param>
public void SetAlwaysUsePrompt(bool value)
{
AlwaysUsePrompt = value;
}
/// <summary>
/// Returns the value of AlwaysUsePrompt.
/// </summary>
/// <returns>The value of AlwaysUsePrompt.</returns>
public bool GetAlwaysUsePrompt()
{
return AlwaysUsePrompt;
}
/// <summary>
/// Sets the value of SettingsModified to value.
/// </summary>
/// <param name="value">The value of SettingsModified.</param>
public void SetSettingsModified(bool value)
{
SettingsModified = value;
}
/// <summary>
/// Returns the value of SettingsModified.
/// </summary>
/// <returns>The value of SettingsModified.</returns>
public bool GetSettingsModified()
{
return SettingsModified;
}
#endregion
#region Constructors
public AllMergedColourSettingsManager()
{
}
#endregion
#region Setters and Getters
/// <summary>
/// Sets the value of BaseColour to colour.
/// </summary>
/// <param name="colour">The value of BaseColour.</param>
public void SetBaseColour(Color colour)
{
_allMergedColourSettings.BaseColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of BaseColour.
/// </summary>
/// <returns>The value of BaseColour.</returns>
public Color GetBaseColour()
{
return _allMergedColourSettings.BaseColour;
}
/// <summary>
/// Sets the value of DarkColour to colour.
/// </summary>
/// <param name="colour">The value of DarkColour.</param>
public void SetDarkColour(Color colour)
{
_allMergedColourSettings.DarkColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of DarkColour.
/// </summary>
/// <returns>The value of DarkColour.</returns>
public Color GetDarkColour()
{
return _allMergedColourSettings.DarkColour;
}
/// <summary>
/// Sets the value of MediumColour to colour.
/// </summary>
/// <param name="colour">The value of MediumColour.</param>
public void SetMediumColour(Color colour)
{
_allMergedColourSettings.MediumColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of MediumColour.
/// </summary>
/// <returns>The value of MediumColour.</returns>
public Color GetMediumColour()
{
return _allMergedColourSettings.MediumColour;
}
/// <summary>
/// Sets the value of LightColour to colour.
/// </summary>
/// <param name="colour">The value of LightColour.</param>
public void SetLightColour(Color colour)
{
_allMergedColourSettings.LightColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of LightColour.
/// </summary>
/// <returns>The value of LightColour.</returns>
public Color GetLightColour()
{
return _allMergedColourSettings.LightColour;
}
/// <summary>
/// Sets the value of LightestColour to colour.
/// </summary>
/// <param name="colour">The value of LightestColour.</param>
public void SetLightestColour(Color colour)
{
_allMergedColourSettings.LightestColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of LightestColour.
/// </summary>
/// <returns>The value of LightestColour.</returns>
public Color GetLightestColour()
{
return _allMergedColourSettings.LightestColour;
}
/// <summary>
/// Sets the value of CustomColourOne to colour.
/// </summary>
/// <param name="colour">The value of CustomColourOne.</param>
public void SetCustomColourOne(Color colour)
{
_allMergedColourSettings.CustomColourOne = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomColourOne.
/// </summary>
/// <returns>The value of CustomColourOne.</returns>
public Color GetCustomColourOne()
{
return _allMergedColourSettings.CustomColourOne;
}
/// <summary>
/// Sets the value of CustomColourTwo to colour.
/// </summary>
/// <param name="colour">The value of CustomColourTwo.</param>
public void SetCustomColourTwo(Color colour)
{
_allMergedColourSettings.CustomColourTwo = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomColourTwo.
/// </summary>
/// <returns>The value of CustomColourTwo.</returns>
public Color GetCustomColourTwo()
{
return _allMergedColourSettings.CustomColourTwo;
}
/// <summary>
/// Sets the value of CustomColourThree to colour.
/// </summary>
/// <param name="colour">The value of CustomColourThree.</param>
public void SetCustomColourThree(Color colour)
{
_allMergedColourSettings.CustomColourThree = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomColourThree.
/// </summary>
/// <returns>The value of CustomColourThree.</returns>
public Color GetCustomColourThree()
{
return _allMergedColourSettings.CustomColourThree;
}
/// <summary>
/// Sets the value of CustomColourFour to colour.
/// </summary>
/// <param name="colour">The value of CustomColourFour.</param>
public void SetCustomColourFour(Color colour)
{
_allMergedColourSettings.CustomColourFour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomColourFour.
/// </summary>
/// <returns>The value of CustomColourFour.</returns>
public Color GetCustomColourFour()
{
return _allMergedColourSettings.CustomColourFour;
}
/// <summary>
/// Sets the value of CustomColourFive to colour.
/// </summary>
/// <param name="colour">The value of CustomColourFive.</param>
public void SetCustomColourFive(Color colour)
{
_allMergedColourSettings.CustomColourFive = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomColourFive.
/// </summary>
/// <returns>The value of CustomColourFive.</returns>
public Color GetCustomColourFive()
{
return _allMergedColourSettings.CustomColourFive;
}
/// <summary>
/// Sets the value of CustomColourSix to colour.
/// </summary>
/// <param name="colour">The value of CustomColourSix.</param>
public void SetCustomColourSix(Color colour)
{
_allMergedColourSettings.CustomColourSix = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomColourSix.
/// </summary>
/// <returns>The value of CustomColourSix.</returns>
public Color GetCustomColourSix()
{
return _allMergedColourSettings.CustomColourSix;
}
/// <summary>
/// Sets the value of CustomTextColourOne to colour.
/// </summary>
/// <param name="colour">The value of CustomTextColourOne.</param>
public void SetCustomTextColourOne(Color colour)
{
_allMergedColourSettings.CustomTextColourOne = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomTextColourOne.
/// </summary>
/// <returns>The value of CustomTextColourOne.</returns>
public Color GetCustomTextColourOne()
{
return _allMergedColourSettings.CustomTextColourOne;
}
/// <summary>
/// Sets the value of CustomTextColourTwo to colour.
/// </summary>
/// <param name="colour">The value of CustomTextColourTwo.</param>
public void SetCustomTextColourTwo(Color colour)
{
_allMergedColourSettings.CustomTextColourTwo = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomTextColourTwo.
/// </summary>
/// <returns>The value of CustomTextColourTwo.</returns>
public Color GetCustomTextColourTwo()
{
return _allMergedColourSettings.CustomTextColourTwo;
}
/// <summary>
/// Sets the value of CustomTextColourThree to colour.
/// </summary>
/// <param name="colour">The value of CustomTextColourThree.</param>
public void SetCustomTextColourThree(Color colour)
{
_allMergedColourSettings.CustomTextColourThree = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomTextColourThree.
/// </summary>
/// <returns>The value of CustomTextColourThree.</returns>
public Color GetCustomTextColourThree()
{
return _allMergedColourSettings.CustomTextColourThree;
}
/// <summary>
/// Sets the value of CustomTextColourFour to colour.
/// </summary>
/// <param name="colour">The value of CustomTextColourFour.</param>
public void SetCustomTextColourFour(Color colour)
{
_allMergedColourSettings.CustomTextColourFour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomTextColourFour.
/// </summary>
/// <returns>The value of CustomTextColourFour.</returns>
public Color GetCustomTextColourFour()
{
return _allMergedColourSettings.CustomTextColourFour;
}
/// <summary>
/// Sets the value of CustomTextColourFive to colour.
/// </summary>
/// <param name="colour">The value of CustomTextColourFive.</param>
public void SetCustomTextColourFive(Color colour)
{
_allMergedColourSettings.CustomTextColourFive = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomTextColourFive.
/// </summary>
/// <returns>The value of CustomTextColourFive.</returns>
public Color GetCustomTextColourFive()
{
return _allMergedColourSettings.CustomTextColourFive;
}
/// <summary>
/// Sets the value of CustomTextColourSix to colour.
/// </summary>
/// <param name="colour">The value of CustomTextColourSix.</param>
public void SetCustomTextColourSix(Color colour)
{
_allMergedColourSettings.CustomTextColourSix = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of CustomTextColourSix.
/// </summary>
/// <returns>The value of CustomTextColourSix.</returns>
public Color GetCustomTextColourSix()
{
return _allMergedColourSettings.CustomTextColourSix;
}
/// <summary>
/// Sets the value of LinkDisabledColour to colour.
/// </summary>
/// <param name="colour">The value of LinkDisabledColour.</param>
public void SetLinkDisabledColour(Color colour)
{
_allMergedColourSettings.LinkDisabledColour = colour;
}
/// <summary>
/// Returns the value of LinkDisabledColour.
/// </summary>
/// <returns>The value of LinkDisabledColour.</returns>
public Color GetLinkDisabledColour()
{
return _allMergedColourSettings.LinkDisabledColour;
}
/// <summary>
/// Sets the value of LinkFocusedColour to colour.
/// </summary>
/// <param name="colour">The value of LinkFocusedColour.</param>
public void SetLinkFocusedColour(Color colour)
{
_allMergedColourSettings.LinkFocusedColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of LinkFocusedColour.
/// </summary>
/// <returns>The value of LinkFocusedColour.</returns>
public Color GetLinkFocusedColour()
{
return _allMergedColourSettings.LinkFocusedColour;
}
/// <summary>
/// Sets the value of LinkHoverColour to colour.
/// </summary>
/// <param name="colour">The value of LinkHoverColour.</param>
public void SetLinkHoverColour(Color colour)
{
_allMergedColourSettings.LinkHoverColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of LinkHoverColour.
/// </summary>
/// <returns>The value of LinkHoverColour.</returns>
public Color GetLinkHoverColour()
{
return _allMergedColourSettings.LinkHoverColour;
}
/// <summary>
/// Sets the value of LinkNormalColour to colour.
/// </summary>
/// <param name="colour">The value of LinkNormalColour.</param>
public void SetLinkNormalColour(Color colour)
{
_allMergedColourSettings.LinkNormalColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of LinkNormalColour.
/// </summary>
/// <returns>The value of LinkNormalColour.</returns>
public Color GetLinkNormalColour()
{
return _allMergedColourSettings.LinkNormalColour;
}
/// <summary>
/// Sets the value of LinkVisitedColour to colour.
/// </summary>
/// <param name="colour">The value of LinkVisitedColour.</param>
public void SetLinkVisitedColour(Color colour)
{
_allMergedColourSettings.LinkVisitedColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of LinkVisitedColour.
/// </summary>
/// <returns>The value of LinkVisitedColour.</returns>
public Color GetLinkVisitedColour()
{
return _allMergedColourSettings.LinkVisitedColour;
}
/// <summary>
/// Sets the value of BorderColour to colour.
/// </summary>
/// <param name="colour">The value of BorderColour.</param>
public void SetBorderColour(Color colour)
{
_allMergedColourSettings.BorderColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of BorderColour.
/// </summary>
/// <returns>The value of BorderColour.</returns>
public Color GetBorderColour()
{
return _allMergedColourSettings.BorderColour;
}
/// <summary>
/// Sets the value of DisabledControlColour to colour.
/// </summary>
/// <param name="colour">The value of DisabledControlColour.</param>
public void SetDisabledControlColour(Color colour)
{
_allMergedColourSettings.DisabledControlColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of DisabledControlColour.
/// </summary>
/// <returns>The value of DisabledControlColour.</returns>
public Color GetDisabledControlColour()
{
return _allMergedColourSettings.DisabledControlColour;
}
/// <summary>
/// Sets the value of MenuTextColour to colour.
/// </summary>
/// <param name="colour">The value of MenuTextColour.</param>
public void SetMenuTextColour(Color colour)
{
_allMergedColourSettings.MenuTextColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of MenuTextColour.
/// </summary>
/// <returns>The value of MenuTextColour.</returns>
public Color GetMenuTextColour()
{
return _allMergedColourSettings.MenuTextColour;
}
/// <summary>
/// Sets the value of StatusStripTextColour to colour.
/// </summary>
/// <param name="colour">The value of StatusStripTextColour.</param>
public void SetStatusStripTextColour(Color colour)
{
_allMergedColourSettings.StatusStripTextColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of StatusStripTextColour.
/// </summary>
/// <returns>The value of StatusStripTextColour.</returns>
public Color GetStatusStripTextColour()
{
return _allMergedColourSettings.StatusStripTextColour;
}
/// <summary>
/// Sets the value of RibbonTabTextColour to colour.
/// </summary>
/// <param name="colour">The value of RibbonTabTextColour.</param>
public void SetRibbonTabTextColour(Color colour)
{
_allMergedColourSettings.RibbonTabTextColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of RibbonTabTextColour.
/// </summary>
/// <returns>The value of RibbonTabTextColour.</returns>
public Color GetRibbonTabTextColour()
{
return _allMergedColourSettings.RibbonTabTextColour;
}
/// <summary>
/// Sets the value of AlternativeNormalTextColour to colour.
/// </summary>
/// <param name="colour">The value of AlternativeNormalTextColour.</param>
public void SetAlternativeNormalTextColour(Color colour)
{
_allMergedColourSettings.AlternativeNormalTextColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of AlternativeNormalTextColour.
/// </summary>
/// <returns>The value of AlternativeNormalTextColour.</returns>
public Color GetAlternativeNormalTextColour()
{
return _allMergedColourSettings.AlternativeNormalTextColour;
}
/// <summary>
/// Sets the value of DisabledTextColour to colour.
/// </summary>
/// <param name="colour">The value of DisabledTextColour.</param>
public void SetDisabledTextColour(Color colour)
{
_allMergedColourSettings.DisabledTextColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of DisabledTextColour.
/// </summary>
/// <returns>The value of DisabledTextColour.</returns>
public Color GetDisabledTextColour()
{
return _allMergedColourSettings.DisabledTextColour;
}
/// <summary>
/// Sets the value of FocusedTextColour to colour.
/// </summary>
/// <param name="colour">The value of FocusedTextColour.</param>
public void SetFocusedTextColour(Color colour)
{
_allMergedColourSettings.FocusedTextColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of FocusedTextColour.
/// </summary>
/// <returns>The value of FocusedTextColour.</returns>
public Color GetFocusedTextColour()
{
return _allMergedColourSettings.FocusedTextColour;
}
/// <summary>
/// Sets the value of NormalTextColour to colour.
/// </summary>
/// <param name="colour">The value of NormalTextColour.</param>
public void SetNormalTextColour(Color colour)
{
_allMergedColourSettings.NormalTextColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of NormalTextColour.
/// </summary>
/// <returns>The value of NormalTextColour.</returns>
public Color GetNormalTextColour()
{
return _allMergedColourSettings.NormalTextColour;
}
/// <summary>
/// Sets the value of PressedTextColour to colour.
/// </summary>
/// <param name="colour">The value of PressedTextColour.</param>
public void SetPressedTextColour(Color colour)
{
_allMergedColourSettings.PressedTextColour = colour;
SetSettingsModified(true);
}
/// <summary>
/// Returns the value of PressedTextColour.
/// </summary>
/// <returns>The value of PressedTextColour.</returns>
public Color GetPressedTextColour()
{
return _allMergedColourSettings.PressedTextColour;
}
#endregion
#region Methods
/// <summary>
/// Resets to defaults.
/// </summary>
public void ResetToDefaults()
{
if (ExtendedKryptonMessageBox.Show("WARNING! You are about to reset these settings back to their original state. This action cannot be undone!\nDo you want to proceed?", "Reset Settings", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
{
SetBaseColour(Color.Empty);
SetDarkColour(Color.Empty);
SetMediumColour(Color.Empty);
SetLightColour(Color.Empty);
SetLightestColour(Color.Empty);
SetCustomColourOne(Color.Empty);
SetCustomColourTwo(Color.Empty);
SetCustomColourThree(Color.Empty);
SetCustomColourFour(Color.Empty);
SetCustomColourFive(Color.Empty);
SetCustomColourSix(Color.Empty);
SetCustomTextColourOne(Color.Empty);
SetCustomTextColourTwo(Color.Empty);
SetCustomTextColourThree(Color.Empty);
SetCustomTextColourFour(Color.Empty);
SetCustomTextColourFive(Color.Empty);
SetCustomTextColourSix(Color.Empty);
SetLinkDisabledColour(Color.Empty);
SetLinkFocusedColour(Color.Empty);
SetLinkHoverColour(Color.Empty);
SetLinkNormalColour(Color.Empty);
SetLinkVisitedColour(Color.Empty);
SetBorderColour(Color.Empty);
SetDisabledControlColour(Color.Empty);
SetMenuTextColour(Color.Empty);
SetStatusStripTextColour(Color.Empty);
SetRibbonTabTextColour(Color.Empty);
SetDisabledTextColour(Color.Empty);
SetFocusedTextColour(Color.Empty);
SetNormalTextColour(Color.Empty);
SetPressedTextColour(Color.Empty);
SaveAllMergedColourSettings();
if (ExtendedKryptonMessageBox.Show($"Done! Do you want to restart the application now?", "Action Complete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Application.Restart();
}
}
}
/// <summary>
/// Saves all merged colour settings.
/// </summary>
/// <param name="alwaysUsePrompt">if set to <c>true</c> [always use prompt].</param>
public void SaveAllMergedColourSettings(bool alwaysUsePrompt = false)
{
if (alwaysUsePrompt)
{
if (ExtendedKryptonMessageBox.Show("You have changed a setting value. Do you want to save these changes?", "Setting Values Changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
_allMergedColourSettings.Save();
SetSettingsModified(false);
}
}
else
{
_allMergedColourSettings.Save();
SetSettingsModified(false);
}
}
#endregion
#region IO Stuff
public static void WriteARGBColoursToFile(string colourConfigurationFilePath)
{
AllMergedColourSettingsManager manager = new AllMergedColourSettingsManager();
try
{
if (!File.Exists(colourConfigurationFilePath))
{
File.Create(colourConfigurationFilePath);
}
StreamWriter writer = new StreamWriter(colourConfigurationFilePath);
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetAlternativeNormalTextColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetBaseColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetBorderColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomColourOne()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomColourTwo()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomColourThree()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomColourFour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomColourFive()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomColourSix()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomTextColourOne()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomTextColourTwo()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomTextColourThree()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomTextColourFour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomTextColourFive()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetCustomTextColourSix()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetDarkColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetDisabledControlColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetDisabledTextColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetFocusedTextColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetLightColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetLightestColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetLinkDisabledColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetLinkFocusedColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetLinkHoverColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetLinkNormalColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetLinkVisitedColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetMediumColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetMenuTextColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetNormalTextColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetPressedTextColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetRibbonTabTextColour()));
writer.WriteLine(TranslationMethods.ColourARGBToString(manager.GetStatusStripTextColour()));
writer.Flush();
writer.Close();
writer.Dispose();
}
catch (Exception exc)
{
ExceptionHandler.CaptureException(exc, icon: MessageBoxIcon.Error, methodSignature: MethodHelpers.GetCurrentMethod());
}
}
public static void WriteRGBColoursToFile(string colourConfigurationFilePath)
{
AllMergedColourSettingsManager manager = new AllMergedColourSettingsManager();
try
{
if (!File.Exists(colourConfigurationFilePath))
{
File.Create(colourConfigurationFilePath);
}
StreamWriter writer = new StreamWriter(colourConfigurationFilePath);
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetAlternativeNormalTextColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetBaseColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetBorderColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourOne()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourTwo()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourThree()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourFour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourFive()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomColourSix()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourOne()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourTwo()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourThree()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourFour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourFive()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetCustomTextColourSix()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetDarkColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetDisabledControlColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetDisabledTextColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetFocusedTextColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLightColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLightestColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLinkDisabledColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLinkFocusedColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLinkHoverColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLinkNormalColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetLinkVisitedColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetMediumColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetMenuTextColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetNormalTextColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetPressedTextColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetRibbonTabTextColour()));
writer.WriteLine(TranslationMethods.RGBColourToString(manager.GetStatusStripTextColour()));
writer.Flush();
writer.Close();
writer.Dispose();
}
catch (Exception exc)
{
ExceptionHandler.CaptureException(exc, icon: MessageBoxIcon.Error, methodSignature: MethodHelpers.GetCurrentMethod());
}
}
/// <summary>
/// Creates a ARGB colour configuration file.
/// </summary>
public static void CreateARGBConfigurationFile()
{
try
{
CommonSaveFileDialog csfd = new CommonSaveFileDialog();
csfd.Title = "Save Colours To:";
csfd.Filters.Add(new CommonFileDialogFilter("Colour Configuration File", ".ccf"));
csfd.Filters.Add(new CommonFileDialogFilter("Normal Text File", ".txt"));
csfd.DefaultFileName = $"All Colour Configuration File - { TranslationMethods.ReturnSafeFileNameDateTimeString() }";
csfd.AlwaysAppendDefaultExtension = true;
csfd.DefaultExtension = "ccf";
if (csfd.ShowDialog() == CommonFileDialogResult.Ok)
{
WriteARGBColoursToFile(csfd.FileName);
}
}
catch (Exception exc)
{
ExceptionHandler.CaptureException(exc, icon: MessageBoxIcon.Error, methodSignature: MethodHelpers.GetCurrentMethod());
}
}
/// <summary>
/// Creates a RGB colour configuration file.
/// </summary>
public static void CreateRGBConfigurationFile()
{
try
{
CommonSaveFileDialog csfd = new CommonSaveFileDialog();
csfd.Title = "Save Colours To:";
csfd.Filters.Add(new CommonFileDialogFilter("Colour Configuration File", ".ccf"));
csfd.Filters.Add(new CommonFileDialogFilter("Normal Text File", ".txt"));
csfd.DefaultFileName = $"All Colour Configuration File - { TranslationMethods.ReturnSafeFileNameDateTimeString() }";
csfd.AlwaysAppendDefaultExtension = true;
csfd.DefaultExtension = "ccf";
if (csfd.ShowDialog() == CommonFileDialogResult.Ok)
{
WriteRGBColoursToFile(csfd.FileName);
}
}
catch (Exception exc)
{
ExceptionHandler.CaptureException(exc, icon: MessageBoxIcon.Error, methodSignature: MethodHelpers.GetCurrentMethod());
}
}
#endregion
}
}
| 13,110
|
https://github.com/Warm-men/tuya-panel-kit/blob/master/src/components/tab/utils.js
|
Github Open Source
|
Open Source
|
MIT
| null |
tuya-panel-kit
|
Warm-men
|
JavaScript
|
Code
| 116
| 292
|
import React from 'react';
const toArray = children => {
const arr = [];
React.Children.forEach(children, child => {
if (child) {
arr.push(child);
}
});
return arr;
};
const getActiveIndex = (children, activeKey) => {
const arr = toArray(children);
for (let i = 0; i < arr.length; i++) {
if (arr[i].key === activeKey) {
return i;
}
}
return -1;
};
const activeKeyIsValid = (children, key) => {
const keys = React.Children.map(children, child => child && child.key);
return keys.indexOf(key) >= 0;
};
const getDefaultActiveKey = children => {
let activeKey;
React.Children.forEach(children, child => {
if (child && !activeKey && !child.props.disabled) {
activeKey = child.key;
}
});
return activeKey;
};
export default {
toArray,
getActiveIndex,
activeKeyIsValid,
getDefaultActiveKey
};
| 22,720
|
https://github.com/brianorion/TSA-Software-App-2020-/blob/master/ActualApp/Wireframe/kv/homepagestudent.kv
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
TSA-Software-App-2020-
|
brianorion
|
Kvlang
|
Code
| 367
| 1,431
|
<HomePageStudent>:
canvas:
Color:
rgba: 251/255, 232/255, 233/255, 1
# to put a background image on the login screen
Rectangle:
pos: self.pos
size: self.size
FloatLayout:
# Bottom Border
GridLayout:
pos_hint: {"top": 0.042, "center_x": 0.5}
size_hint: 1, 0.05
canvas:
Rectangle:
pos: self.pos
size: self.size
source: "Image/Homepage/Bottom Border.png"
# Upper Border
GridLayout:
size_hint: 1, 0.035
pos_hint: {"top": 1, "center_x": 0.5}
canvas:
Rectangle:
pos: self.pos
size: self.size
source: "Image/Homepage/Upper Border.png"
# Side Border
GridLayout:
size_hint: 0.07, 1
pos_hint: {"top": 1, "right": 1.00075}
canvas:
Rectangle:
pos: self.pos
size: self.size
source: "Image/Homepage/Side Border.png"
# Side Border
GridLayout:
size_hint: 0.07, 1
pos_hint: {"top": 1, "left": 1}
canvas:
Rectangle:
pos: self.pos
size: self.size
source: "Image/Homepage/Side Border.png"
# The title of the Page
Label:
text: "Chem Hero\nHomepage"
font_size: "40dp"
font_name: "Cabin Sketch"
color: 0, 0, 0, 1
pos_hint: {"top": 0.93, "center_x": 0.5}
size_hint: 1, 0.1
GridLayout:
col: 1
row: 1
pos_hint: {"top": 0.8, "center_x": 0.5}
size_hint: 0.8, 0.01
canvas:
Rectangle:
pos: self.pos
size: self.size
source: "Image/1-1 Login/Content #20/Divider #79.png"
# Buttons for navigation
Button:
pos_hint: {"top": 0.7, "center_x": 0.3}
size_hint: 0.35, 0.07
text: "Element\nSearch"
background_normal: "Image/Homepage/Ellipse 1.png"
on_release: app.change_screen("search_element")
Label:
text: "Search an element.\nIt will provide basic\nelement properties\nand facts."
halign: "left"
color: 0, 0, 0, 1
markup: True
pos_hint: {"top": 0.66, "center_x": 0.3}
size_hint: 0.35, 0.2
font_size: "14dp"
Button:
pos_hint: {"top": 0.45, "center_x": 0.3}
text: "Molar\nCalculator"
background_normal: "Image/Homepage/Ellipse 1.png"
size_hint: 0.35, 0.07
on_release: app.change_screen("molar_calculator")
Label:
text: "Calculate a molecular\nmass. Given a molecule,\nit will show percent\ncomposition and\nhow it is calculated."
halign: "left"
color: 0, 0, 0, 1
markup: True
pos_hint: {"top": 0.41, "center_x": 0.3}
size_hint: 0.35, 0.2
font_size: "14dp"
Button:
pos_hint: {"top": 0.45, "center_x": 0.7}
text: "Calculate\nFormula"
background_normal: "Image/Homepage/Ellipse 1.png"
size_hint: 0.35, 0.07
on_release: app.change_screen("calculate_formula")
Label:
text: "This will find the\n empirical and\nmolecular formula."
halign: "left"
color: 0, 0, 0, 1
markup: True
pos_hint: {"top": 0.41, "center_x": 0.72}
size_hint: 0.35, 0.2
font_size: "14dp"
Button:
pos_hint: {"top": 0.7, "center_x": 0.7}
background_normal: "Image/Homepage/Ellipse 1.png"
text: "Balancing\nEquation"
size_hint: 0.35, 0.07
on_release: app.change_screen("balancing_equations")
Label:
text: "It will balance\nbalance an equation."
halign: "left"
color: 0, 0, 0, 1
markup: True
pos_hint: {"top": 0.66, "center_x": 0.72}
size_hint: 0.35, 0.2
font_size: "14dp"
Button:
pos_hint: {"top": 0.15, "center_x": 0.5}
size_hint: 0.7, 0.07
background_normal: "Image/Homepage/Ellipse 1.png"
text: "Sign Out"
on_release: app.sign_out()
background_color: 1, 0.2, 0.2, 1
| 39,688
|
https://github.com/vskrip/twitter-clone-api/blob/master/routes/api.php
|
Github Open Source
|
Open Source
|
MIT
| null |
twitter-clone-api
|
vskrip
|
PHP
|
Code
| 111
| 442
|
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
// Users
Route::group(['middleware' => 'auth:api'], function () {
// Route::get('users', 'UserController@index');
// Route::get('users/{user}', 'UserController@show');
// Route::post('users', 'UserController@store');
Route::put('users/{id}', 'UserController@update');
// Route::delete('users/{id}', 'UserController@delete');
});
// Auth
Route::prefix('/auth')->group(function () {
Route::post('login', 'Auth\LoginController@login')->name('login');
Route::post('logout', 'Auth\LoginController@logout')->name('logout');
Route::post('register', 'Auth\RegisterController@register')->name('register');
});
// Twitts
Route::group(['middleware' => 'auth:api'], function () {
Route::get('twitts', 'TwittController@index');
Route::get('twitts/{twitt}', 'TwittController@show');
Route::get('twitts/latest/{id}', 'TwittController@getLatestTwitts');
Route::post('twitts', 'TwittController@store');
Route::put('twitts/{twitt}', 'TwittController@update');
Route::delete('twitts/{twitt}', 'TwittController@delete');
});
| 32,097
|
https://github.com/qq1588518/sqlcipher-ormlite-database-android-studio/blob/master/app/src/main/java/com/j256/ormlite/dao/RawRowObjectMapper.java
|
Github Open Source
|
Open Source
|
BSD-3-Clause
| 2,022
|
sqlcipher-ormlite-database-android-studio
|
qq1588518
|
Java
|
Code
| 267
| 534
|
package com.j256.ormlite.dao;
import java.sql.SQLException;
import com.j256.ormlite.field.DataType;
import com.j256.ormlite.stmt.QueryBuilder;
/**
* Parameterized row mapper that takes output from the {@link GenericRawResults} and returns a T. Is used in the
* {@link Dao#queryRaw(String, DataType[], RawRowObjectMapper, String...)} method.
*
* <p>
* <b> NOTE: </b> If you need to map Strings instead then consider using the {@link RawRowMapper} with the
* {@link Dao#queryRaw(String, RawRowMapper, String...)} method which allows you to iterate over the raw results as
* String[].
* </p>
*
* @param <T>
* Type that the mapRow returns.
* @author graywatson
*/
public interface RawRowObjectMapper<T> {
/**
* Used to convert a raw results row to an object.
*
* <p>
* <b>NOTE:</b> If you are using the {@link QueryBuilder#prepareStatementString()} to build your query, it may have
* added the id column to the selected column list if the Dao object has an id you did not include it in the columns
* you selected. So the results might have one more column than you are expecting.
* </p>
*
* @return The created object with all of the fields set from the results. Return null if there is no object
* generated from these results.
* @param columnNames
* Array of names of columns.
* @param dataTypes
* Array of the DataTypes of each of the columns as passed into the
* {@link Dao#queryRaw(String, DataType[], RawRowObjectMapper, String...)}
* @param resultColumns
* Array of result columns.
* @throws SQLException
* If there is any critical error with the data and you want to stop the paging.
*/
public T mapRow(String[] columnNames, DataType[] dataTypes, Object[] resultColumns) throws SQLException;
}
| 46,744
|
https://github.com/AliYildizoz909/fast-wiki/blob/master/src/Components/Home.tsx
|
Github Open Source
|
Open Source
|
MIT
| null |
fast-wiki
|
AliYildizoz909
|
TypeScript
|
Code
| 176
| 528
|
import React, { Component, FunctionComponent } from 'react'
import { Button, Col, Container, Row } from 'react-bootstrap'
import IWikipediaService from '../Services/IWikipediaService'
import Search from '../Components/Search'
import Content from '../Components/Content'
interface IProps {
route?: any
WikiService: IWikipediaService
}
interface IState {
}
export default class Home extends Component<IProps, IState> {
state = {}
render() {
const wikiService = this.props.WikiService;
const history = this.props.route.history;
return (
<Container className="mb-5">
<Row className="mb-3">
<Col md="2">
<GoBackButton className="float-left mb-2 " goBack={history.goBack} />
</Col>
<Col md={{ span: 6, offset: 1 }} >
<Search wikiService={wikiService} history={history} />
</Col>
</Row>
<Row>
<Col md={{ span: 10, offset: 1 }}>
<Content wikiService={wikiService} />
</Col>
</Row>
</Container>
)
}
}
const GoBackButton: FunctionComponent<{ className?: string, goBack: any }> = ({ className, goBack }) => <Button className={"btn-sm btn-success " + (className ? className : "")} onClick={() => goBack()}>
<svg width="2em" height="2em" viewBox="0 0 16 16" className="bi bi-arrow-left" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path fillRule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z" />
</svg>
</Button>
| 50,878
|
https://github.com/DeepInThought/swim/blob/master/swim-system-java/swim-core-java/swim.collections/src/test/java/swim/collections/FingerTrieSeqSpec.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
swim
|
DeepInThought
|
Java
|
Code
| 874
| 2,271
|
// Copyright 2015-2020 SWIM.AI inc.
//
// 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.
package swim.collections;
import java.util.Iterator;
import java.util.ListIterator;
import org.testng.annotations.Test;
import swim.util.Builder;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
public class FingerTrieSeqSpec {
@Test
public void testEmpty() {
assertTrue(FingerTrieSeq.empty().isEmpty());
assertEquals(FingerTrieSeq.empty().size(), 0);
}
@Test
public void testUnary() {
final FingerTrieSeq<String> xs = FingerTrieSeq.of("unit");
assertFalse(xs.isEmpty());
final Iterator<String> iter = xs.iterator();
assertTrue(iter.hasNext());
assertEquals(iter.next(), "unit");
assertFalse(iter.hasNext());
}
@Test
public void testRemoved() {
assertEquals(FingerTrieSeq.of(1, 2, 3, 4).removed(0), FingerTrieSeq.of(2, 3, 4));
assertEquals(FingerTrieSeq.of(1, 2, 3, 4).removed(1), FingerTrieSeq.of(1, 3, 4));
assertEquals(FingerTrieSeq.of(1, 2, 3, 4).removed(2), FingerTrieSeq.of(1, 2, 4));
assertEquals(FingerTrieSeq.of(1, 2, 3, 4).removed(3), FingerTrieSeq.of(1, 2, 3));
}
@Test
public void testComposeSeqs() {
for (int k = 4; k <= 20; k += 4) {
final int n = 1 << k;
testCompose(n);
}
}
private void testCompose(int n) {
System.out.println("Composing FingerTrieSeq with " + n + " elements ...");
final Builder<Integer, FingerTrieSeq<Integer>> builder = FingerTrieSeq.builder();
for (int i = 1; i <= n; i += 1) {
builder.add(i);
}
final FingerTrieSeq<Integer> xs = builder.bind();
assertFalse(xs.isEmpty());
assertEquals(xs.size(), n);
final Iterator<Integer> iter = xs.iterator();
long sum = 0L;
while (iter.hasNext()) {
sum += iter.next().longValue();
}
assertEquals(sum, ((long) n * ((long) n + 1L) / 2L), "sum of first " + n + " integers");
}
@Test
public void testDropSeqs() {
testDrop((1 << 10) + 1);
testDrop((1 << 15) + 1);
}
private void testDrop(int n) {
final Builder<Integer, FingerTrieSeq<Integer>> builder = FingerTrieSeq.builder();
for (int i = 0; i <= n; i += 1) {
builder.add(i);
}
final FingerTrieSeq<Integer> xs = builder.bind();
for (int a = 0; a < n; a += 1) {
final FingerTrieSeq<Integer> ys = xs.drop(a);
final Iterator<Integer> iter = ys.iterator();
for (int i = a; i < n; i += 1) {
final int y = iter.next();
assertEquals(y, i);
}
}
}
@Test
public void testTakeSeqs() {
testTake((1 << 10) + 1);
testTake((1 << 15) + 1);
}
private void testTake(int n) {
final Builder<Integer, FingerTrieSeq<Integer>> builder = FingerTrieSeq.builder();
for (int i = 0; i <= n; i += 1) {
builder.add(i);
}
final FingerTrieSeq<Integer> xs = builder.bind();
for (int b = 0; b < n; b += 1) {
final FingerTrieSeq<Integer> ys = xs.take(b);
final Iterator<Integer> iter = ys.iterator();
for (int i = 0; i < b; i += 1) {
final int y = iter.next();
assertEquals(y, i);
}
}
}
@Test
public void testAppendAndDropSeqs() {
for (int appendCount = 0; appendCount < 128; appendCount += 1) {
for (int dropCount = 0; dropCount < appendCount; dropCount += 1) {
testAppendAndDrop(appendCount, dropCount);
}
}
}
private void testAppendAndDrop(int appendCount, int dropCount) {
FingerTrieSeq<Integer> xs = FingerTrieSeq.empty();
for (int i = 0; i < appendCount; i += 1) {
xs = xs.appended(i);
}
for (int j = 0; j < dropCount; j += 1) {
xs = xs.tail();
}
for (int i = appendCount; i < appendCount + dropCount; i += 1) {
xs = xs.appended(i);
}
for (int i = 0; i < appendCount; i += 1) {
assertEquals(xs.get(i).intValue(), i + dropCount);
}
}
@Test
public void testPrependAndDropSeqs() {
for (int prependCount = 0; prependCount < 128; prependCount += 1) {
for (int dropCount = 0; dropCount < prependCount; dropCount += 1) {
testPrependAndDrop(prependCount, dropCount);
}
}
}
private void testPrependAndDrop(int prependCount, int dropCount) {
FingerTrieSeq<Integer> xs = FingerTrieSeq.empty();
for (int i = 0; i < prependCount; i += 1) {
xs = xs.prepended(i);
}
for (int j = 0; j < dropCount; j += 1) {
xs = xs.body();
}
for (int i = prependCount; i < prependCount + dropCount; i += 1) {
xs = xs.prepended(i);
}
for (int i = 0; i < prependCount; i += 1) {
assertEquals(xs.get(i).intValue(), prependCount + dropCount - i - 1);
}
}
@Test
public void testListIterator() {
testListIteratorSize((1 << 10) + 1);
testListIteratorSize((1 << 15) + 1);
}
private void testListIteratorSize(int n) {
final Builder<Integer, FingerTrieSeq<Integer>> builder = FingerTrieSeq.builder();
for (int i = 0; i <= n; i += 1) {
builder.add(i);
}
final FingerTrieSeq<Integer> xs = builder.bind();
for (int a = 0; a < n; a += 1) {
final ListIterator<Integer> iter = xs.listIterator(a);
for (int i = a; i < n; i += 1) {
assertTrue(iter.hasNext());
final int y = iter.next();
assertEquals(y, i);
}
}
}
@Test
public void testReverseListIterator() {
testReverseListIteratorSize((1 << 10) + 1);
testReverseListIteratorSize((1 << 15) + 1);
}
private void testReverseListIteratorSize(int n) {
final Builder<Integer, FingerTrieSeq<Integer>> builder = FingerTrieSeq.builder();
for (int i = 0; i <= n; i += 1) {
builder.add(i);
}
final FingerTrieSeq<Integer> xs = builder.bind();
for (int b = 0; b < n; b += 1) {
final ListIterator<Integer> iter = xs.listIterator(b);
for (int i = b - 1; i >= 0; i -= 1) {
assertTrue(iter.hasPrevious());
final int y = iter.previous();
assertEquals(y, i);
}
assertFalse(iter.hasPrevious());
}
}
}
| 8,984
|
https://github.com/knutwalker/covidd/blob/master/src/main.rs
|
Github Open Source
|
Open Source
|
Apache-2.0, MIT
| 2,020
|
covidd
|
knutwalker
|
Rust
|
Code
| 774
| 2,639
|
/*!
Render COVID-19 case data for Dresden in the terminal
# Installation
## Prerequisites
This tool is build with Rust so you need to have a rust toolchain and cargo installed.
If you don't, please visit [https://rustup.rs/](https://rustup.rs/) and follow their instructions.
## Building
The preferred way is to run:
```
make install
```
If you do not have a fairly recent `make` (on macOS, homebrew can install a newer version),
or don't want to use make, you can also run `cargo install --path .`.
## Already built binaries
If you don't want to compile on your own, you can find binaries at [the Github release page](https://github.com/knutwalker/covidd/releases).
# Usage
Run `covidd`.
- Press Up/Right to zoom in
- Press Down/Left to zoom out
- Press Home/End to fully zoom in/out
- Press 1 through 9 to zoom to the latest <n> weeks
- Press q to quit
Run `covidd --help` for an overview of more available options.
### Screenshot

*/
#[macro_use]
extern crate eyre;
#[macro_use]
extern crate tracing;
use std::fmt::Display;
use args::{CacheCommand, Command, Run};
use chrono::{DateTime, Duration, Utc};
use color_eyre::{Help, Result};
use data::{CachedData, Data, DataPoint};
mod api;
mod args;
mod cache;
mod data;
mod messages;
mod ui;
#[instrument]
fn main() -> Result<()> {
let cmd = Command::get();
install_tracing(cmd.verbosity());
install_eyre()?;
let data_for_ui = match cmd {
Command::Cache(c) => cache_command(c.cmd)?,
Command::Run(r) => run_command(r)?,
};
if let Some(data) = data_for_ui {
if atty::is(atty::Stream::Stdout) {
let msg = messages::Messages::user_default();
ui::draw(&data, msg)?;
} else {
let data = summarized_data(&data);
println!("{}", data)
}
}
Ok(())
}
#[instrument(err)]
fn run_command(r: Run) -> Result<Option<Data>> {
let show_ui = !r.no_ui;
let data = current_data_with_updated_cache(r)?;
if show_ui {
Ok(Some(data))
} else {
Ok(None)
}
}
#[instrument(err)]
fn cache_command(c: CacheCommand) -> Result<Option<Data>> {
match c {
CacheCommand::List => {
if let Some((file, data)) = cache::get_cached()? {
println!("{}\t{}", file.display(), data.created_at);
}
}
CacheCommand::Flush => cache::remove_cache()?,
CacheCommand::Refresh => {
let _ = current_data_with_updated_cache(Run {
force: true,
..Run::default()
})?;
}
};
Ok(None)
}
fn current_data_with_updated_cache(r: Run) -> Result<Data> {
let cached_data = cached_data_if_current(r.force, r.cache, r.stale_after)?;
let data = if let Some(data) = cached_data {
debug!("Using data from cache from {}", data.created_at);
data.attributes
} else {
debug!("Calling API for new data");
let data = api::call(r.timeout.into())?;
cache::store_data(&data)?;
data
};
Ok(data)
}
fn cached_data_if_current(
ignore_cache: bool,
force_cache: bool,
stale_after: humantime::Duration,
) -> Result<Option<CachedData>> {
let data = if ignore_cache {
debug!("Ignoring cache since --force was given");
None
} else {
let data = data_from_cache(force_cache)?;
trace!("Found some data in cache: {}", data.is_some());
match data {
Some(data) => {
if cache_is_stale(data.created_at, stale_after)? {
None
} else {
Some(data)
}
}
_ => None,
}
};
trace!("Found current data in cache: {}", data.is_some());
Ok(data)
}
fn data_from_cache(force: bool) -> Result<Option<CachedData>> {
let cached = cache::get_cached_data()?;
if force && cached.is_none() {
Err(eyre!("--cache is defined, but there is not cached data available").suggestion(
"Run the `cache refresh` subcommand to set a new cache. Treat any warnings as errors.",
))?;
}
Ok(cached)
}
fn cache_is_stale(created: DateTime<Utc>, stale_after: humantime::Duration) -> Result<bool> {
let stale_after = Duration::from_std(stale_after.into())?;
let now = Utc::now();
let age = now - created;
let is_current = age < stale_after;
trace!(
"Cached data: created={}, age={}, current={}",
created,
humantime::format_duration(age.to_std()?),
is_current
);
Ok(!is_current)
}
fn summarized_data(data_points: &[DataPoint]) -> SummarizedData {
let mut data = SummarizedData::default();
let mut dp = data_points.iter().rev();
if let Some(dp) = dp.next() {
data.incidence = dp.incidence_calculated;
data.cases = dp.cases.total;
data.deaths = dp.deaths.total;
data.hospitalisations = dp.hospitalisations.total;
data.recoveries = dp.recoveries.total;
}
if let Some(dp) = dp.next() {
data.incidence_increase = data.incidence - dp.incidence_calculated;
data.cases_increase = data.cases - dp.cases.total;
data.deaths_increase = data.deaths - dp.deaths.total;
data.hospitalisations_increase = data.hospitalisations - dp.hospitalisations.total;
data.recoveries_increase = data.recoveries - dp.recoveries.total;
}
data
}
#[derive(Debug, Default)]
struct SummarizedData {
recoveries: u32,
recoveries_increase: u32,
hospitalisations: u32,
hospitalisations_increase: u32,
deaths: u32,
deaths_increase: u32,
cases: u32,
cases_increase: u32,
incidence: f64,
incidence_increase: f64,
}
impl Display for SummarizedData {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(f, "incidence: {}", self.incidence)?;
writeln!(f, "incidence_increase: {}", self.incidence_increase)?;
writeln!(f, "cases: {}", self.cases)?;
writeln!(f, "cases_increase: {}", self.cases_increase)?;
writeln!(f, "deaths: {}", self.deaths)?;
writeln!(f, "deaths_increase: {}", self.deaths_increase)?;
writeln!(f, "hospitalisations: {}", self.hospitalisations)?;
writeln!(
f,
"hospitalisations_increase: {}",
self.hospitalisations_increase
)?;
writeln!(f, "recoveries: {}", self.recoveries)?;
writeln!(f, "recoveries_increase: {}", self.recoveries_increase)
}
}
fn install_tracing(verbosity: i8) {
use tracing_error::ErrorLayer;
use tracing_subscriber::prelude::*;
use tracing_subscriber::{fmt, EnvFilter};
let fmt_layer = fmt::layer().with_target(true);
let filter_layer = EnvFilter::try_from_env("COVIDD_LOG")
.or_else(|_| EnvFilter::try_new(verbosity_to_level(verbosity)))
.unwrap();
tracing_subscriber::registry()
.with(filter_layer)
.with(fmt_layer)
.with(ErrorLayer::default())
.init();
}
fn verbosity_to_level(verbosity: i8) -> &'static str {
match verbosity {
i8::MIN..=-2 => "off",
-1 => "error",
0 => "warn",
1 => concat!(env!("CARGO_PKG_NAME"), "=info"),
2 => concat!(env!("CARGO_PKG_NAME"), "=debug"),
3 => concat!(env!("CARGO_PKG_NAME"), "=trace"),
4 => concat!(env!("CARGO_PKG_NAME"), "=trace,info"),
5 => concat!(env!("CARGO_PKG_NAME"), "=trace,debug"),
6..=i8::MAX => "trace",
}
}
fn install_eyre() -> Result<()> {
color_eyre::config::HookBuilder::default()
.display_env_section(false)
.issue_url(concat!(env!("CARGO_PKG_REPOSITORY"), "/issues/new"))
.add_issue_metadata("version", env!("CARGO_PKG_VERSION"))
.issue_filter(|kind| match kind {
color_eyre::ErrorKind::NonRecoverable(_) => false,
color_eyre::ErrorKind::Recoverable(_) => true,
})
.install()
}
| 43,198
|
https://github.com/yoanlcq/fate/blob/master/game/src/platform/sdl2_platform.rs
|
Github Open Source
|
Open Source
|
Apache-2.0, MIT
| 2,021
|
fate
|
yoanlcq
|
Rust
|
Code
| 421
| 1,852
|
use std::os::raw::c_void;
use super::{Platform, Settings};
use fate::math::Extent2;
use event::Event;
use mouse_cursor::MouseCursor;
use dmc;
use sdl2::{self, Sdl, EventPump};
use sdl2::event::{Event as Sdl2Event, WindowEvent};
use sdl2::video::{Window, GLContext};
use sdl2::mouse::{Cursor as Sdl2Cursor, SystemCursor as Sdl2SystemCursor};
pub struct Sdl2Platform {
sdl2: Sdl,
window: Window,
#[allow(dead_code)]
gl_context: GLContext,
event_pump: EventPump,
}
impl Sdl2Platform {
pub fn new(settings: &Settings) -> Self {
let &Settings {
ref title,
canvas_size: Extent2 { w, h },
gl_pixel_format_settings: dmc::gl::GLPixelFormatSettings {
msaa: dmc::gl::GLMsaa { buffer_count: msaa_buffer_count, sample_count },
depth_bits,
stencil_bits,
double_buffer,
stereo,
red_bits,
green_bits,
blue_bits,
alpha_bits,
accum_red_bits,
accum_blue_bits,
accum_green_bits,
accum_alpha_bits,
aux_buffers: _,
transparent: _,
},
gl_context_settings: dmc::gl::GLContextSettings {
version: dmc::gl::GLVersion { major, minor, variant: _ },
profile,
debug,
forward_compatible,
robust_access: _,
},
} = settings;
let sdl2 = sdl2::init().unwrap();
let video_subsystem = sdl2.video().unwrap();
let gl_attr = video_subsystem.gl_attr();
gl_attr.set_context_version(major, minor);
gl_attr.set_context_profile(match profile {
dmc::gl::GLProfile::Core => sdl2::video::GLProfile::Core,
dmc::gl::GLProfile::Compatibility => sdl2::video::GLProfile::Compatibility,
});
{
let mut flags = gl_attr.set_context_flags();
if debug {
flags.debug();
}
if forward_compatible {
flags.forward_compatible();
}
flags.set();
}
gl_attr.set_red_size(red_bits);
gl_attr.set_green_size(green_bits);
gl_attr.set_blue_size(blue_bits);
gl_attr.set_alpha_size(alpha_bits);
gl_attr.set_double_buffer(double_buffer);
gl_attr.set_depth_size(depth_bits);
gl_attr.set_stencil_size(stencil_bits);
gl_attr.set_stereo(stereo);
gl_attr.set_multisample_buffers(msaa_buffer_count as _);
gl_attr.set_multisample_samples(sample_count as _);
gl_attr.set_accum_red_size(accum_red_bits);
gl_attr.set_accum_green_size(accum_green_bits);
gl_attr.set_accum_blue_size(accum_blue_bits);
gl_attr.set_accum_alpha_size(accum_alpha_bits);
// NOTE: DO NOT actually set this! It causes window creation to fail for some reason.
// gl_attr.set_accelerated_visual(true)
// This one could be interesting someday
// gl_attr.set_framebuffer_srgb_compatible(value: bool);
let window = video_subsystem.window(title, w, h)
.opengl()
.position_centered()
.resizable()
.build()
.expect("Could not create window");
let gl_context = window.gl_create_context().unwrap();
let event_pump = sdl2.event_pump().unwrap();
Self {
sdl2, window, gl_context, event_pump
}
}
}
impl Platform for Sdl2Platform {
fn show_window(&mut self) {
// Window starts shown
}
fn canvas_size(&self) -> Extent2<u32> {
self.window.size().into()
}
fn gl_swap_buffers(&mut self) {
self.window.gl_swap_window();
}
fn gl_get_proc_address(&self, proc_name: &str) -> *const c_void {
self.sdl2.video().unwrap().gl_get_proc_address(proc_name) as *const _
}
fn set_mouse_cursor(&mut self, mouse_cursor: &MouseCursor) {
match *mouse_cursor {
MouseCursor::System(c) => {
let s = dmc_to_sdl2_system_cursor(c).expect("SDL2 doesn't support this cursor");
let c = Sdl2Cursor::from_system(s).expect("Failed to create SDL2 cursor");
c.set()
},
}
}
fn set_mouse_cursor_visible(&mut self, visible: bool) {
self.sdl2.mouse().show_cursor(visible)
}
fn poll_event(&mut self) -> Option<Event> {
match self.event_pump.poll_event()? {
Sdl2Event::Quit {..} => Some(Event::Quit),
Sdl2Event::MouseMotion { x, y, .. } => Some(Event::MouseMotion(x as _, y as _)),
Sdl2Event::Window { win_event, .. } => match win_event {
WindowEvent::Resized(w, h)
| WindowEvent::SizeChanged(w, h) => Some(Event::CanvasResized(w as _, h as _)),
_ => None,
}
_ => None,
}
}
}
fn dmc_to_sdl2_system_cursor(s: dmc::SystemCursor) -> Option<Sdl2SystemCursor> {
Some(match s {
dmc::SystemCursor::Arrow => Sdl2SystemCursor::Arrow,
dmc::SystemCursor::Ibeam => Sdl2SystemCursor::IBeam,
dmc::SystemCursor::Wait => Sdl2SystemCursor::Wait,
dmc::SystemCursor::Crosshair => Sdl2SystemCursor::Crosshair,
dmc::SystemCursor::WaitArrow => Sdl2SystemCursor::WaitArrow,
dmc::SystemCursor::ResizeNWToSE => Sdl2SystemCursor::SizeNWSE,
dmc::SystemCursor::ResizeNEToSW => Sdl2SystemCursor::SizeNESW,
dmc::SystemCursor::ResizeWE => Sdl2SystemCursor::SizeWE,
dmc::SystemCursor::ResizeNS => Sdl2SystemCursor::SizeNS,
dmc::SystemCursor::ResizeAll => Sdl2SystemCursor::SizeAll,
dmc::SystemCursor::Deny => Sdl2SystemCursor::No,
dmc::SystemCursor::Hand => Sdl2SystemCursor::Hand,
_ => return None,
})
}
| 4,803
|
https://github.com/flyskywhy/node_modules-appium/blob/master/node_modules/appium-windows-driver/test/unit/winappdriver-specs.js
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,017
|
node_modules-appium
|
flyskywhy
|
JavaScript
|
Code
| 112
| 397
|
// transpile:mocha
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import WinAppDriverServer from '../../lib/winappdriver';
import { withMocks } from 'appium-test-support';
chai.should();
chai.use(chaiAsPromised);
function buildWinAppDriverOpts () {
return {
app: 'foo',
host: 'localhost',
port: 4723
};
}
describe('WinAppDriverServer', () => {
describe('#constructor', () => {
it('should complain if required options not sent', () => {
(() => {
new WinAppDriverServer();
}).should.throw(/Option.*app.*required/);
(() => {
new WinAppDriverServer({});
}).should.throw(/Option.*app.*required/);
});
});
describe('#startSession', withMocks({ }, (mocks, S) => {
let winAppDriver = new WinAppDriverServer(buildWinAppDriverOpts());
it('should start a session', async () => {
let caps = { foo: 'bar' };
mocks.jwproxy = S.sandbox.mock(winAppDriver.jwproxy);
mocks.jwproxy.expects("command").once()
.withExactArgs("/session", "POST", { desiredCapabilities: caps })
.returns(Promise.resolve());
await winAppDriver.startSession(caps);
mocks.jwproxy.verify();
});
}));
});
| 50,988
|
https://github.com/chrisnankam24/SGP/blob/master/application/models/Portingsmsnotification_model.php
|
Github Open Source
|
Open Source
|
MIT
| null |
SGP
|
chrisnankam24
|
PHP
|
Code
| 136
| 592
|
<?php
/*
* Generated by CRUDigniter v2.3 Beta
* www.crudigniter.com
*/
class Portingsmsnotification_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
/*
* Get portingsmsnotification by portingSmsNotificationId
*/
function get_portingsmsnotification($portingSmsNotificationId)
{
return $this->db->get_where('portingsmsnotification',array('portingSmsNotificationId'=>$portingSmsNotificationId))->row_array();
}
/*
* Get portingsmsnotification by status
*/
function get_portingsmsnotificationByStatus($status)
{
return $this->db->get_where('portingsmsnotification',array('status'=>$status))->result_array();
}
/*
* Get all portingsmsnotification
*/
function get_all_portingsmsnotification()
{
return $this->db->get('portingsmsnotification')->result_array();
}
/*
* function to add new portingsmsnotification
*/
function add_portingsmsnotification($params)
{
$this->db->insert('portingsmsnotification',$params);
return $this->db->insert_id();
}
/*
* function to update portingsmsnotification
*/
function update_portingsmsnotification($portingSmsNotificationId,$params)
{
$this->db->where('portingSmsNotificationId',$portingSmsNotificationId);
$response = $this->db->update('portingsmsnotification',$params);
if($response)
{
return "portingsmsnotification updated successfully";
}
else
{
return "Error occuring while updating portingsmsnotification";
}
}
/*
* function to delete portingsmsnotification
*/
function delete_portingsmsnotification($portingSmsNotificationId)
{
$response = $this->db->delete('portingsmsnotification',array('portingSmsNotificationId'=>$portingSmsNotificationId));
if($response)
{
return "portingsmsnotification deleted successfully";
}
else
{
return "Error occuring while deleting portingsmsnotification";
}
}
}
| 6,818
|
https://github.com/arushton/drive-ami/blob/master/setup.py
|
Github Open Source
|
Open Source
|
BSD-3-Clause
| 2,015
|
drive-ami
|
arushton
|
Python
|
Code
| 33
| 196
|
#!/usr/bin/env python
from setuptools import setup
requirements = ['pexpect',
'astropy',
'colorlog',
]
setup(
name="drive-ami",
version="0.8.1",
packages=['driveami'],
scripts=['bin/driveami_filter_rawfile_listing.py',
'bin/driveami_list_rawfiles.py',
'bin/driveami_calibrate_rawfiles.py'],
description="An interface layer for scripting the AMI-Reduce pipeline.",
author="Tim Staley",
author_email="timstaley337@gmail.com",
url="https://github.com/timstaley/drive-ami",
install_requires=requirements,
)
| 37,711
|
https://github.com/alsotang/ko-sleep/blob/master/test/test.js
|
Github Open Source
|
Open Source
|
MIT
| 2,018
|
ko-sleep
|
alsotang
|
JavaScript
|
Code
| 52
| 110
|
const test = require('ava')
const sleep = require('..')
test('should sleep', async function (t) {
var start = new Date();
await sleep(30);
t.true((new Date - start) >= 30)
})
test('should sleep with human time string', async function (t) {
var start = new Date();
await sleep('30ms');
t.true((new Date - start) >= 30)
})
| 43,662
|
https://github.com/AlexRogalskiy/java-framework-compare/blob/master/micronaut-driver/src/main/java/com/datastax/examples/micronaut/RestInterface.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,020
|
java-framework-compare
|
AlexRogalskiy
|
Java
|
Code
| 121
| 499
|
package com.datastax.examples.micronaut;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import io.micronaut.http.annotation.Body;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Delete;
import io.micronaut.http.annotation.Get;
import io.micronaut.http.annotation.Patch;
import io.micronaut.http.annotation.PathVariable;
import io.micronaut.http.annotation.Post;
import io.micronaut.http.annotation.Put;
import lombok.RequiredArgsConstructor;
@Controller("/issue")
@RequiredArgsConstructor
public class RestInterface {
private final Repository repository;
@Get
public List<Issue> readAll() {
List<Issue> list = new ArrayList<>();
repository.findAll().forEach(list::add);
return list;
}
@Get("/{id}/")
public Optional<Issue> read(@PathVariable("id") UUID id) {
return repository.findById(id);
}
@Post
public Issue create(@Body Issue body) {
return repository.insert(body);
}
@Put("/{id}/")
public Issue update(@PathVariable("id") UUID id, @Body Issue body) {
return repository.update(body);
}
@Patch("/{id}/")
public Issue partialUpdate(@PathVariable("id") UUID id, @Body Issue body) {
final Issue issue = repository.findById(id).orElseThrow(RuntimeException::new);
issue.partialUpdate(body);
return repository.update(issue);
}
@Delete("/{id}/")
public void delete(@PathVariable("id") UUID id) {
repository.deleteById(id);
}
@Delete
public void deleteAll() {
repository.deleteAll();
}
}
| 2,340
|
https://github.com/zhaofeng092/python_auto_office/blob/master/B站/【pandas高级应用】Python自动化办公/0801/代码/016/016.py
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
python_auto_office
|
zhaofeng092
|
Python
|
Code
| 69
| 351
|
import pandas as pd
# students = pd.read_excel('C:/Temp/Student_score.xlsx', sheet_name='Students')
# scores = pd.read_excel('C:/Temp/Student_score.xlsx', sheet_name='Scores')
# table = students.merge(scores, how='left', on='ID').fillna(0)
# table.Score = table.Score.astype(int)
# print(table)
# students = pd.read_excel('C:/Temp/Student_score.xlsx', sheet_name='Students', index_col='ID')
# scores = pd.read_excel('C:/Temp/Student_score.xlsx', sheet_name='Scores', index_col='ID')
# table = students.merge(scores, how='left', left_on=students.index, right_on=scores.index).fillna(0)
# table.Score = table.Score.astype(int)
# print(table)
students = pd.read_excel('C:/Temp/Student_score.xlsx', sheet_name='Students', index_col='ID')
scores = pd.read_excel('C:/Temp/Student_score.xlsx', sheet_name='Scores', index_col='ID')
table = students.join(scores, how='left').fillna(0)
table.Score = table.Score.astype(int)
print(table)
| 15,005
|
https://github.com/nikitanamdev/AlgoBook/blob/master/python/sorting/QuickSort.py
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
AlgoBook
|
nikitanamdev
|
Python
|
Code
| 148
| 315
|
def quicksort(array):
# If the input array contains fewer than two elements,
# then return it as the result of the function
if len(array) < 2:
return array
low, same, high = [], [], []
# Select your `pivot` element randomly
pivot = array[randint(0, len(array) - 1)]
for item in array:
# Elements that are smaller than the `pivot` go to
# the `low` list. Elements that are larger than
# `pivot` go to the `high` list. Elements that are
# equal to `pivot` go to the `same` list.
if item < pivot:
low.append(item)
elif item == pivot:
same.append(item)
elif item > pivot:
high.append(item)
# The final result combines the sorted `low` list
# with the `same` list and the sorted `high` list
return quicksort(low) + same + quicksort(high)
if __name__ == "__main__":
user_input = input("Enter numbers separated by comma:\n")
unsorted = [int(x) for x in user_input.split(",")]
print(quicksort(unsorted))
| 20,599
|
https://github.com/ihunterghost/bd-project/blob/master/resources/views/crudresponsesist/readresponse.blade.php
|
Github Open Source
|
Open Source
|
MIT
| null |
bd-project
|
ihunterghost
|
PHP
|
Code
| 101
| 578
|
@extends('layouts.app')
@section('content')
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito">
</head>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card">
<div class="card-header text-center">
BUSCAR SISTEMA PLANETÁRIO
</div>
<div class="container">
<div class="row text-center">
<div class="col bg-secondary"><b>ID</b></div>
<div class="col bg-secondary"><b>NOME</b></div>
<div class="col bg-secondary"><b>QTD PLANETAS</b></div>
<div class="col bg-secondary"><b>QTD ESTRELAS</b></div>
<div class="col bg-secondary"><b>IDADE SIST</b></div>
<div class="col bg-secondary"><b>GALÁXIA</b></div>
</div>
</div>
@foreach ($sist as $sist)
<div class="container">
<div class="row text-center">
<div class="col">{{$sist->id_sist}}</div>
<div class="col">{{$sist->nome_sist}}</div>
<div class="col">{{$sist->qtd_planetas}}</div>
<div class="col">{{$sist->qtd_estrelas}}</div>
<div class="col">{{$sist->idade_sist}}</div>
<div class="col">{{$sist->galaxia}}</div>
</div>
</div>
@endforeach
<div class="text-center">
<a class=" badge badge-secondary"href="{{ route('sist') }}">Voltar</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
@endsection
| 35,120
|
https://github.com/prashantsri/test/blob/master/fundoo/node_modules/@angular/core/src/render3/state.d.ts
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
test
|
prashantsri
|
TypeScript
|
Code
| 811
| 1,560
|
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Sanitizer } from '../sanitization/security';
import { TElementNode, TNode, TViewNode } from './interfaces/node';
import { LQueries } from './interfaces/query';
import { Renderer3, RendererFactory3 } from './interfaces/renderer';
import { LViewData, OpaqueViewState, TView } from './interfaces/view';
export declare function getRenderer(): Renderer3;
export declare function setRenderer(r: Renderer3): void;
export declare function getRendererFactory(): RendererFactory3;
export declare function setRendererFactory(factory: RendererFactory3): void;
export declare function getCurrentSanitizer(): Sanitizer | null;
export declare function getElementDepthCount(): number;
export declare function increaseElementDepthCount(): void;
export declare function decreaseElementDepthCount(): void;
export declare function getBindingsEnabled(): boolean;
/**
* Enables directive matching on elements.
*
* * Example:
* ```
* <my-comp my-directive>
* Should match component / directive.
* </my-comp>
* <div ngNonBindable>
* <!-- disabledBindings() -->
* <my-comp my-directive>
* Should not match component / directive because we are in ngNonBindable.
* </my-comp>
* <!-- enableBindings() -->
* </div>
* ```
*/
export declare function enableBindings(): void;
/**
* Disables directive matching on element.
*
* * Example:
* ```
* <my-comp my-directive>
* Should match component / directive.
* </my-comp>
* <div ngNonBindable>
* <!-- disabledBindings() -->
* <my-comp my-directive>
* Should not match component / directive because we are in ngNonBindable.
* </my-comp>
* <!-- enableBindings() -->
* </div>
* ```
*/
export declare function disableBindings(): void;
/**
* Returns the current OpaqueViewState instance.
*
* Used in conjunction with the restoreView() instruction to save a snapshot
* of the current view and restore it when listeners are invoked. This allows
* walking the declaration view tree in listeners to get vars from parent views.
*/
export declare function getCurrentView(): OpaqueViewState;
export declare function _getViewData(): LViewData;
/**
* Restores `contextViewData` to the given OpaqueViewState instance.
*
* Used in conjunction with the getCurrentView() instruction to save a snapshot
* of the current view and restore it when listeners are invoked. This allows
* walking the declaration view tree in listeners to get vars from parent views.
*
* @param viewToRestore The OpaqueViewState instance to restore.
*/
export declare function restoreView(viewToRestore: OpaqueViewState): void;
export declare function getPreviousOrParentTNode(): TNode;
export declare function setPreviousOrParentTNode(tNode: TNode): void;
export declare function setTNodeAndViewData(tNode: TNode, view: LViewData): void;
export declare function getIsParent(): boolean;
export declare function setIsParent(value: boolean): void;
export declare function getTView(): TView;
export declare function getCurrentQueries(): LQueries | null;
export declare function setCurrentQueries(queries: LQueries | null): void;
/**
* Query instructions can ask for "current queries" in 2 different cases:
* - when creating view queries (at the root of a component view, before any node is created - in
* this case currentQueries points to view queries)
* - when creating content queries (i.e. this previousOrParentTNode points to a node on which we
* create content queries).
*/
export declare function getOrCreateCurrentQueries(QueryType: {
new (parent: null, shallow: null, deep: null): LQueries;
}): LQueries;
export declare function getCreationMode(): boolean;
/**
* Internal function that returns the current LViewData instance.
*
* The getCurrentView() instruction should be used for anything public.
*/
export declare function getViewData(): LViewData;
export declare function getContextViewData(): LViewData;
export declare function getCleanup(view: LViewData): any[];
export declare function getTViewCleanup(view: LViewData): any[];
export declare function getCheckNoChangesMode(): boolean;
export declare function setCheckNoChangesMode(mode: boolean): void;
export declare function getFirstTemplatePass(): boolean;
export declare function setFirstTemplatePass(value: boolean): void;
export declare function getBindingRoot(): number;
export declare function setBindingRoot(value: number): void;
/**
* Swap the current state with a new state.
*
* For performance reasons we store the state in the top level of the module.
* This way we minimize the number of properties to read. Whenever a new view
* is entered we have to store the state for later, and when the view is
* exited the state has to be restored
*
* @param newView New state to become active
* @param host Element to which the View is a child of
* @returns the previous state;
*/
export declare function enterView(newView: LViewData, hostTNode: TElementNode | TViewNode | null): LViewData;
export declare function nextContextImpl<T = any>(level?: number): T;
/**
* Resets the application state.
*/
export declare function resetComponentState(): void;
/**
* Used in lieu of enterView to make it clear when we are exiting a child view. This makes
* the direction of traversal (up or down the view tree) a bit clearer.
*
* @param newView New state to become active
* @param creationOnly An optional boolean to indicate that the view was processed in creation mode
* only, i.e. the first update will be done later. Only possible for dynamically created views.
*/
export declare function leaveView(newView: LViewData, creationOnly?: boolean): void;
export declare function assertPreviousIsParent(): void;
export declare function assertHasParent(): void;
export declare function assertDataInRange(index: number, arr?: any[]): void;
export declare function assertDataNext(index: number, arr?: any[]): void;
| 8,324
|
https://github.com/TuriansNotBad/dks3airestoration/blob/master/done/table_ai_common.lua
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
dks3airestoration
|
TuriansNotBad
|
Lua
|
Code
| 5,165
| 13,617
|
---
-- Handles table goals and table logic.
-- @module TableAI
g_LogicTable = {} -- table that holds all logic tables
g_GoalTable = {} -- table that holds all goal tables
Logic = nil -- global table that will be accessible by callers of Register functions
Goal = nil -- global table that will be accessible by callers of Register functions
---
-- Handles all logic registration and creates a global Logic table.
-- Global Logic variable is overridden upon each call of this function
-- @function RegisterTableLogic
-- @tparam number logicId Unique identifier for this logic.
function RegisterTableLogic( logicId )
REGISTER_LOGIC_FUNC(logicId, "TableLogic_" .. logicId, "TableLogic_" .. logicId .. "_Interrupt")
-- this table will be accessible from the logic files and should be used.
Logic = {}
-- save this table in our list of them all
g_LogicTable[logicId] = Logic
end
---
-- Handles all goal registration and creates a global Goal table. After its called all your goal functionality must go to the Goal table.
-- Global Goal variable is overridden upon each call of this function.
-- @function RegisterTableGoal
-- @tparam number goalId Unique identifier for this goal.
-- @tparam string goalNumber Name for this goal. (Goal table doesn't store this information)
function RegisterTableGoal( goalId, goalName )
REGISTER_GOAL(goalId, goalName)
-- this table will be accessible from the goal files and should be used for Activate/Update/Terminate/Initalize functions.
Goal = {}
-- save this table in our list of them all
g_GoalTable[goalId] = Goal
end
---
-- Sets up the logic as either table logic or normal logic.
-- @function SetupScriptLogicInfo
-- @tparam number logicId Id of the logic
-- @tparam userdata logicInfo logic info object
function SetupScriptLogicInfo(logicId, logicInfo)
local logicTable = g_LogicTable[logicId] -- logic table
if logicTable ~= nil then
local interruptInfoTbl = _CreateInterruptTypeInfoTable(logicTable)
local shouldUpdate = logicTable.Update ~= nil
-- set this as table logic
logicInfo:SetTableLogic(shouldUpdate, _IsInterruptFuncExist(interruptInfoTbl, logicTable))
logicTable.InterruptInfoTable = interruptInfoTbl -- assign interrupt table to the logic table
else
-- this logic is not table logic
logicInfo:SetNormalLogic()
end
end
---
-- Sets up the goal as either table goal or normal goal.
-- @function SetupScriptGoalInfo
-- @tparam number goalId Id of the goal
-- @tparam userdata goalInfo goal info object
function SetupScriptGoalInfo(goalId, goalInfo)
local goalTbl = g_GoalTable[goalId] -- goal table
if goalTbl ~= nil then
local interruptInfoTbl = _CreateInterruptTypeInfoTable(goalTbl)
local shouldUpdate = goalTbl.Update ~= nil
-- set this as table goal
goalInfo:SetTableGoal(shouldUpdate, goalTbl.Terminate ~= nil, _IsInterruptFuncExist(interruptInfoTbl, goalTbl), goalTbl.Initialize ~= nil)
goalTbl.InterruptInfoTable = interruptInfoTbl -- assign interrupt table to the goal table
else
-- this goal is not table goal
goalInfo:SetNormalGoal()
end
end
---
-- Common table logic execute function. Will attempt to call table logic's Main function, does nothing if it doesn't exist.
-- @function ExecTableLogic
-- @tparam userdata ai AI object.
-- @tparam number logicId Id of the logic.
function ExecTableLogic(ai, logicId)
local logicTbl = g_LogicTable[logicId] -- logic table
-- check if logic table with this id exists
if logicTbl ~= nil then
if logicTbl.Main ~= nil then
-- if Main function is defined - call it
logicTbl.Main(logicTbl, ai)
end
end
end
---
-- Common table logic update function. Will attempt to call table logic's Update function, does nothing if it doesn't exist.
-- @function UpdateTableLogic
-- @tparam userdata ai AI object.
-- @tparam number logicId Id of the logic.
function UpdateTableLogic(ai, logicId)
local logicTbl = g_LogicTable[logicId] -- logic table
-- check if logic table with this id exists
if logicTbl ~= nil then
if logicTbl.Update ~= nil then
-- if Update function is defined - call it
logicTbl.Update(logicTbl, ai)
end
end
end
---
-- Common table goal initialize function. Will attempt to call the goal table's initialize function and return it's result.
-- @function InitializeTableGoal
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @tparam number goalId Goal id.
-- @return Returns true if it calls the table goal's Initialize function or false if none exist.
function InitializeTableGoal(ai, goal, goalId)
-- have we initialized
local bInitalized = false
-- goal table
local goalTbl = g_GoalTable[goalId]
if goalTbl ~= nil then
if goalTbl.Initialize ~= nil then
-- calls the Initialize function for this table goal
goalTbl.Initialize(goalTbl, ai, goal, ai:GetChangeBattleStateCount())
bInitalized = true
end
end
return bInitalized
end
---
-- Common table goal activate function. Will attempt to call the goal table's activate function and return it's result.
-- @function ActivateTableGoal
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @tparam number goalId Goal id.
-- @return Returns the result of the table goal's Activate function (usually nil) or false if none exist.
function ActivateTableGoal(ai, goal, goalId)
-- have we activated
local bActivated = false
-- goal table
local goalTbl = g_GoalTable[goalId]
if goalTbl ~= nil then
if goalTbl.Activate ~= nil then
-- calls the Activate function for this table goal
bActivated = goalTbl.Activate(goalTbl, ai, goal)
end
end
return bActivated
end
---
-- Common table goal update function. Will attempt to call the goal table's update function and return it's result.
-- @function UpdateTableGoal
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @tparam number goalId Goal id.
-- @return Returns the result of the table goal's Update function or GOAL_RESULT_Continue if none exist.
function UpdateTableGoal(ai, goal, goalId)
-- update result
local goalResult = GOAL_RESULT_Continue
-- goal table
local goalTbl = g_GoalTable[goalId]
if goalTbl ~= nil then
if goalTbl.Update ~= nil then
-- calls the Update function for this table goal
goalResult = goalTbl.Update(goalTbl, ai, goal)
end
end
return goalResult
end
---
-- Common table goal terminate function. Will attempt to call the goal table's terminate function and return it's result.
-- @function TerminateTableGoal
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @tparam number goalId Goal id.
-- @return Returns the result of the table goal's Terminate function (usually nil) or false if none exist.
function TerminateTableGoal(ai, goal, goalId)
-- have we terminated
local bTerminated = false
-- goal table
local goalTbl = g_GoalTable[goalId]
if goalTbl ~= nil then
if goalTbl.Terminate ~= nil then
-- calls the Terminate function for this table goal
bTerminated = goalTbl.Terminate(goalTbl, ai, goal)
end
end
return bTerminated
end
---
-- Common table logic interrupt handler (typed). Checks if a custom interrupt function is assigned to the table logic for the specified interrupt type
-- and tries to run it.
-- @function InterruptTableLogic
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @tparam number logicId Logic id.
-- @return Returns true if the custom interrupt function returns true or if the subgoal is changed at any point in the interrupt.
function InterruptTableLogic(ai, goal, logicId, interruptId)
-- have we processed the interrupt
local bInterruptHandled = false
-- logic table
local tbl = g_LogicTable[logicId]
if tbl ~= nil then
-- calls the interrupt function for this interrupt type
bInterruptHandled = _InterruptTableGoal_TypeCall(ai, goal, tbl, interruptId)
end
return bInterruptHandled
end
---
-- Common table goal interrupt handler (typed). Checks if a custom interrupt function is assigned to the table goal for the specified interrupt type
-- and tries to run it.
-- @function InterruptTableGoal
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @tparam number goalId Goal id.
-- @return Returns true if the custom interrupt function returns true or if the subgoal is changed at any point in the interrupt.
function InterruptTableGoal(ai, goal, goalId, interruptId)
-- have we processed the interrupt
local bInterruptHandled = false
-- goal table
local tbl = g_GoalTable[goalId]
if tbl ~= nil then
-- calls the interrupt function for this interrupt type
bInterruptHandled = _InterruptTableGoal_TypeCall(ai, goal, tbl, interruptId)
end
return bInterruptHandled
end
---
-- Common table goal interrupt handler (untyped). Checks if a custom interrupt function is assigned to the table goal/logic and tries to run it.
-- @function InterruptTableGoal_Common
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @tparam number goalId Goal id.
-- @return Returns true if the custom interrupt function returns true or if the subgoal is changed at any point in the interrupt.
function InterruptTableGoal_Common(ai, goal, goalId)
-- have we processed the interrupt
local bInterruptHandled = false
-- goal table
local tbl = g_GoalTable[goalId]
-- check if custom interrupt function is defined
if tbl ~= nil and tbl.Interrupt ~= nil then
-- check if the function handles this
if tbl.Interrupt(tbl, ai, goal) then
bInterruptHandled = true
end
-- check if the function changed the subgoal.
if goal:IsInterruptSubGoalChanged() then
bInterruptHandled = true
end
end
return bInterruptHandled
end
---
-- Checks the interrupt info table to see if any of its entries have a function assigned by the designer.
-- @function _IsInterruptFuncExist
-- @tparam table interruptInfoTbl Interrupt info table as generated by the _CreateInterruptTypeInfoTable.
-- @param arg1 Unknown. Unused.
-- @return Returns true if it finds any custom interrupt functions.
function _IsInterruptFuncExist(interruptInfoTbl, arg1)
-- iterate over all possible interrupts
for interruptId = INTERUPT_First, INTERUPT_Last do
-- if any interrupt info entry has bEmpty flag set to false then we've found it.
if not interruptInfoTbl[interruptId].bEmpty then
return true
end
end
return false
end
---
-- General handler for type interrupts for table goal/logic. Calls the interrupt function from the table for the specified interrupt id.
-- @function _InterruptTableGoal_TypeCall
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @tparam table tbl Goal/logic table.
-- @tparam number interruptId Id of the interrupt.
-- @return Returns true if successfully processed the interrupt.
function _InterruptTableGoal_TypeCall(ai, goal, tbl, interruptId)
-- call the interrupt function from the table's interruptInfoTbl
if tbl.InterruptInfoTable[interruptId].func(ai, goal, tbl) then
return true
end
-- interrupt function didn't handle this interrupt
return false
end
---
-- Creates interrupt type info table. Table has an entry for each recognized interrupt by the game, each entry is a table of its own with 2 keys:
-- func - containing the function that processes the interrupt (this is a boiler plate function, it tries to retrieve the real interrupt function from
-- the table provided to it and calls it. If that fails it will call the default function which simply returns false). Interrupt is considered processed
-- if either the user defined interrupt function returns true or the subgoal is changed in the interrupt. ai_define.lua contains all interrupt constants that can be used.
-- You can consult this function definition found in table_ai_common.lua for how you should name your interrupt functions.
-- @function _CreateInterruptTypeInfoTable
-- @tparam table tbl Logic/Goal table.
-- @return Table with the interrupt type info.
function _CreateInterruptTypeInfoTable( tbl )
local interruptInfoTbl = {}
interruptInfoTbl[INTERUPT_FindEnemy] = {
-- interrupt function that will be called on this type of interrupt
func = function(ai, goal, tbl)
-- if the goal/logic table defines a function for this type of interrupt - call it
-- if it doesn't the default is called
if _GetInterruptFunc(tbl.Interrupt_FindEnemy)(tbl, ai, goal) then
-- if found function returned true then we successfully processed the interrupt
-- default function never returns true
return true
end
-- if at any point in the interrupt call the subgoal was changed
-- then we consider interrupt successfully processed
if goal:IsInterruptSubGoalChanged() then
return true
end
-- did not process
return false
end,
-- indicates whether the Goal/Logic table defined the interrupt function for this type
bEmpty = tbl.Interrupt_FindEnemy == nil
}
interruptInfoTbl[INTERUPT_FindAttack] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_FindAttack)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_FindAttack == nil
}
interruptInfoTbl[INTERUPT_Damaged] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_Damaged)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_Damaged == nil
}
interruptInfoTbl[INTERUPT_Damaged_Stranger] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_Damaged_Stranger)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_Damaged_Stranger == nil
}
interruptInfoTbl[INTERUPT_FindMissile] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_FindMissile)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_FindMissile == nil
}
interruptInfoTbl[INTERUPT_SuccessGuard] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_SuccessGuard)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_SuccessGuard == nil
}
interruptInfoTbl[INTERUPT_MissSwing] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_MissSwing)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_MissSwing == nil
}
interruptInfoTbl[INTERUPT_GuardBegin] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_GuardBegin)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_GuardBegin == nil
}
interruptInfoTbl[INTERUPT_GuardFinish] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_GuardFinish)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_GuardFinish == nil
}
interruptInfoTbl[INTERUPT_GuardBreak] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_GuardBreak)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_GuardBreak == nil
}
interruptInfoTbl[INTERUPT_Shoot] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_Shoot)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_Shoot == nil
}
interruptInfoTbl[INTERUPT_ShootReady] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_ShootReady)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_ShootReady == nil
}
interruptInfoTbl[INTERUPT_UseItem] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_UseItem)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_UseItem == nil
}
interruptInfoTbl[INTERUPT_EnterBattleArea] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_EnterBattleArea)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_EnterBattleArea == nil
}
interruptInfoTbl[INTERUPT_LeaveBattleArea] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_LeaveBattleArea)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_LeaveBattleArea == nil
}
interruptInfoTbl[INTERUPT_CANNOT_MOVE] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_CANNOT_MOVE)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_CANNOT_MOVE == nil
}
-- this kind of interrupt takes an extra argument - Area Observe Slot
-- likely indicating which area has triggered the interurpt
interruptInfoTbl[INTERUPT_Inside_ObserveArea] = {
func = function(ai, goal, tbl)
-- this iterates over all area observe slots for the inside type
-- and calles the interrupt function for each. If any return true then the whole thing returns true.
if _InterruptTableGoal_Inside_ObserveArea(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_Inside_ObserveArea == nil
}
interruptInfoTbl[INTERUPT_ReboundByOpponentGuard] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_ReboundByOpponentGuard)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_ReboundByOpponentGuard == nil
}
interruptInfoTbl[INTERUPT_ForgetTarget] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_ForgetTarget)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_ForgetTarget == nil
}
interruptInfoTbl[INTERUPT_FriendRequestSupport] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_FriendRequestSupport)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_FriendRequestSupport == nil
}
interruptInfoTbl[INTERUPT_TargetIsGuard] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_TargetIsGuard)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_TargetIsGuard == nil
}
interruptInfoTbl[INTERUPT_HitEnemyWall] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_HitEnemyWall)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_HitEnemyWall == nil
}
interruptInfoTbl[INTERUPT_SuccessParry] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_SuccessParry)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_SuccessParry == nil
}
interruptInfoTbl[INTERUPT_CANNOT_MOVE_DisableInterupt] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_CANNOT_MOVE_DisableInterupt)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_CANNOT_MOVE_DisableInterupt == nil
}
interruptInfoTbl[INTERUPT_ParryTiming] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_ParryTiming)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_ParryTiming == nil
}
interruptInfoTbl[INTERUPT_RideNode_LadderBottom] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_RideNode_LadderBottom)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_RideNode_LadderBottom == nil
}
interruptInfoTbl[INTERUPT_FLAG_RideNode_Door] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_FLAG_RideNode_Door)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_FLAG_RideNode_Door == nil
}
interruptInfoTbl[INTERUPT_StraightByPath] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_StraightByPath)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_StraightByPath == nil
}
interruptInfoTbl[INTERUPT_ChangedAnimIdOffset] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_ChangedAnimIdOffset)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_ChangedAnimIdOffset == nil
}
interruptInfoTbl[INTERUPT_SuccessThrow] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_SuccessThrow)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_SuccessThrow == nil
}
interruptInfoTbl[INTERUPT_LookedTarget] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_LookedTarget)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_LookedTarget == nil
}
interruptInfoTbl[INTERUPT_LoseSightTarget] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_LoseSightTarget)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_LoseSightTarget == nil
}
interruptInfoTbl[INTERUPT_RideNode_InsideWall] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_RideNode_InsideWall)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_RideNode_InsideWall == nil
}
interruptInfoTbl[INTERUPT_MissSwingSelf] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_MissSwingSelf)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_MissSwingSelf == nil
}
interruptInfoTbl[INTERUPT_GuardBreakBlow] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_GuardBreakBlow)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_GuardBreakBlow == nil
}
-- this type of interrupt recieves additional argument - the target out of range slot.
interruptInfoTbl[INTERUPT_TargetOutOfRange] = {
func = function(ai, goal, tbl)
-- This will iterate over all target out of range interrupt slots and run our function against each of them until it gets a positive result
if _InterruptTableGoal_TargetOutOfRange(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_TargetOutOfRange == nil
}
interruptInfoTbl[INTERUPT_UnstableFloor] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_UnstableFloor)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_UnstableFloor == nil
}
interruptInfoTbl[INTERUPT_BreakFloor] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_BreakFloor)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_BreakFloor == nil
}
interruptInfoTbl[INTERUPT_BreakObserveObj] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_BreakObserveObj)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_BreakObserveObj == nil
}
interruptInfoTbl[INTERUPT_EventRequest] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_EventRequest)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_EventRequest == nil
}
-- this kind of interrupt takes an extra argument - Area Observe Slot
-- likely indicating which area has triggered the interurpt
interruptInfoTbl[INTERUPT_Outside_ObserveArea] = {
func = function(ai, goal, tbl)
-- this iterates over all area observe slots for the inside type
-- and calles the interrupt function for each. If any return true then the whole thing returns true.
if _InterruptTableGoal_Outside_ObserveArea(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_Outside_ObserveArea == nil
}
-- this type of interrupt recieves additional argument - the target out of angle slot.
interruptInfoTbl[INTERUPT_TargetOutOfAngle] = {
func = function(ai, goal, tbl)
-- This will iterate over all target out of angle interrupt slots and run our function against each of them until it gets a positive result
if _InterruptTableGoal_TargetOutOfAngle(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_TargetOutOfAngle == nil
}
interruptInfoTbl[INTERUPT_PlatoonAiOrder] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_PlatoonAiOrder)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_PlatoonAiOrder == nil
}
-- this type of interrupt gets an extra argument - special effect type
interruptInfoTbl[INTERUPT_ActivateSpecialEffect] = {
func = function(ai, goal, tbl)
-- this will iterate over all effects and run the table interrupt function against each one till it gets a positive
if _InterruptTableGoal_ActivateSpecialEffect(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_ActivateSpecialEffect == nil
}
-- this type of interrupt gets an extra argument - special effect type
interruptInfoTbl[INTERUPT_InactivateSpecialEffect] = {
func = function(ai, goal, tbl)
-- this will iterate over all effects and run the table interrupt function against each one till it gets a positive
if _InterruptTableGoal_InactivateSpecialEffect(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_InactivateSpecialEffect == nil
}
interruptInfoTbl[INTERUPT_MovedEnd_OnFailedPath] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_MovedEnd_OnFailedPath)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_MovedEnd_OnFailedPath == nil
}
interruptInfoTbl[INTERUPT_ChangeSoundTarget] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_ChangeSoundTarget)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_ChangeSoundTarget == nil
}
interruptInfoTbl[INTERUPT_OnCreateDamage] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_OnCreateDamage)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_OnCreateDamage == nil
}
-- this kind of interrupt gets an extra argument - trigger region category
interruptInfoTbl[INTERUPT_InvadeTriggerRegion] = {
func = function(ai, goal, tbl)
-- this will iterate over all region categories and run the table interrupt function against each one till it gets a positive
if _InterruptTableGoal_InvadeTriggerRegion(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_InvadeTriggerRegion == nil
}
-- this kind of interrupt gets an extra argument - trigger region category
interruptInfoTbl[INTERUPT_LeaveTriggerRegion] = {
func = function(ai, goal, tbl)
-- this will iterate over all region categories and run the table interrupt function against each one till it gets a positive
if _InterruptTableGoal_LeaveTriggerRegion(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_LeaveTriggerRegion == nil
}
interruptInfoTbl[INTERUPT_AIGuardBroken] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_AIGuardBroken)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_AIGuardBroken == nil
}
interruptInfoTbl[INTERUPT_AIReboundByOpponentGuard] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_AIReboundByOpponentGuard)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_AIReboundByOpponentGuard == nil
}
interruptInfoTbl[INTERUPT_BackstabRisk] = {
func = function(ai, goal, tbl)
if _GetInterruptFunc(tbl.Interrupt_BackstabRisk)(tbl, ai, goal) then
return true
end
if goal:IsInterruptSubGoalChanged() then
return true
end
return false
end,
bEmpty = tbl.Interrupt_BackstabRisk == nil
}
return interruptInfoTbl
end
---
-- Checks if the provided table interrupt function is nil. Returns its argument if it isn't nil, otherwise returns the dummy function.
-- @function _GetInterruptFunc
-- @tparam function tblInterruptFunc Goal/Logic table interrupt function.
-- @return Goal/Logic table interrupt function or the dummy function.
function _GetInterruptFunc( tblInterruptFunc )
if tblInterruptFunc ~= nil then
return tblInterruptFunc
end
return _InterruptTableGoal_TypeCall_Dummy
end
---
-- Dummy function used when Goal/Logic table don't provide a handler for the interrupts.
-- @function _InterruptTableGoal_TypeCall_Dummy
-- @return Returns false.
function _InterruptTableGoal_TypeCall_Dummy()
return false
end
---
-- Handles the interrupt calls for target out of range/angle interrupts. Will iterate over all slots, checking if target is out of range/angle with the
-- provided fIsOutOfRange function and run the tblInterruptFunc to handle it if it is. If any targets out of range/angle are found and tblInterruptFunc didn't handle it
-- returns false.
-- @function _InterruptTableGoal_TargetOutOfRange_Common
-- @tparam table tbl Goal/Logic table.
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @tparam function fIsOutOfRange Function that checks whether target is out of range/angle. This function receives slot index as its only argument.
-- @tparam function tblInterruptFunc Goal/Logic table interrupt function. Its result is the result of the entire function.
--It recieves tbl, ai, goal, and slot index as its arguments.
-- @return Returns true if successfully processed the interrupt.
function _InterruptTableGoal_TargetOutOfRange_Common( tbl, ai, goal, fIsOutOfRange, tblInterruptFunc )
-- keeps track if we found anything out of range
local bSlotEnable = false
for slot = 0, 31 do
-- check if target is out of range at this slot
if fIsOutOfRange(slot) then
-- set the flag that we've found at least 1 thing
bSlotEnable = true
-- check with the table interrupt function
if tblInterruptFunc(tbl, ai, goal, slot) then
return true
end
end
end
-- if any target was out of range and we didn't successfully process it, we return false
if bSlotEnable then
return false
end
-- there wasn't any targets out of range in the slots we checked, give it unknown slot if it wants to work with it
return tblInterruptFunc(tbl, ai, goal, -1)
end
---
-- Handles the interrupt calls for target out of range interrupts. Will iterate over all slots checking if target is out of range and ran
-- the Goal/Logic table interrupt function (if present). If at any point interrupt function returns a positive result it will stop iterating and return.
-- If any targets out of range are found and the interrupt function didn't handle it it returns false. Table interrupt funciton gets an extra argument -
-- slot index.
-- @function _InterruptTableGoal_TargetOutOfRange
-- @tparam table tbl Goal/Logic table.
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @return Returns true if successfully processed the interrupt.
function _InterruptTableGoal_TargetOutOfRange( tbl, ai, goal )
-- check if the target is out of range on this interrupt slot
-- saves this ai reference in an upvalue
local f = function( slot )
return ai:IsTargetOutOfRangeInterruptSlot( slot )
end
-- runs the interrupt function for each slot
return _InterruptTableGoal_TargetOutOfRange_Common( tbl, ai, goal, f, _GetInterruptFunc( tbl.Interrupt_TargetOutOfRange ) )
end
---
-- Handles the interrupt calls for target out of angle interrupts. Will iterate over all slots checking if target is out of angle and ran
-- the Goal/Logic table interrupt function (if present). If at any point interrupt function returns a positive result it will stop iterating and return.
-- If any targets out of angle are found and the interrupt function didn't handle it it returns false. Table interrupt funciton gets an extra argument -
-- slot index.
-- @function _InterruptTableGoal_TargetOutOfAngle
-- @tparam table tbl Goal/Logic table.
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @return Returns true if successfully processed the interrupt.
function _InterruptTableGoal_TargetOutOfAngle( tbl, ai, goal )
-- check if the target is out of angle on this interrupt slot
-- saves this ai reference in an upvalue
local f = function( slot )
return ai:IsTargetOutOfAngleInterruptSlot( slot )
end
-- runs the interrupt function for each slot
return _InterruptTableGoal_TargetOutOfRange_Common( tbl, ai, goal, f, _GetInterruptFunc( tbl.Interrupt_TargetOutOfAngle ) )
end
---
-- Handles the interrupt calls for inside observearea interrupts. Will iterate over all slots and run the table interrupt function against each one till it gets a
-- positive. Table interrupt function gets an extra argument - area observe slot.
-- @function _InterruptTableGoal_Inside_ObserveArea
-- @tparam table tbl Goal/Logic table.
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @return Returns true if successfully processed the interrupt.
function _InterruptTableGoal_Inside_ObserveArea( tbl, ai, goal )
-- get amount of slots
local slotNum = ai:GetAreaObserveSlotNum(AI_AREAOBSERVE_INTERRUPT__INSIDE)
for slot = 0, slotNum - 1 do
-- run the interrupt check for each slot till we get a positive
if _GetInterruptFunc(tbl.Interrupt_Inside_ObserveArea)(tbl, ai, goal, ai:GetAreaObserveSlot(AI_AREAOBSERVE_INTERRUPT__INSIDE, slot)) then
return true
end
end
end
---
-- Handles the interrupt calls for outside observearea interrupts. Will iterate over all slots and run the table interrupt function against each one till it gets a
-- positive. Table interrupt function gets an extra argument - area observe slot.
-- @function _InterruptTableGoal_Outside_ObserveArea
-- @tparam table tbl Goal/Logic table.
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @return Returns true if successfully processed the interrupt.
function _InterruptTableGoal_Outside_ObserveArea( tbl, ai, goal )
-- get amount of slots
local slotNum = ai:GetAreaObserveSlotNum(AI_AREAOBSERVE_INTERRUPT__OUTSIDE)
for slot = 0, slotNum - 1 do
-- run the interrupt check for each slot till we get a positive
if _GetInterruptFunc(tbl.Interrupt_Outside_ObserveArea)(tbl, ai, goal, ai:GetAreaObserveSlot(AI_AREAOBSERVE_INTERRUPT__OUTSIDE, slot)) then
return true
end
end
end
---
-- Handles the interrupt calls for activate special effect interrupts. Will iterate over all effects and run the table interrupt function against each one till it gets a
-- positive. Table interrupt function gets an extra argument - special effect type
-- @function _InterruptTableGoal_ActivateSpecialEffect
-- @tparam table tbl Goal/Logic table.
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @return Returns true if successfully processed the interrupt.
function _InterruptTableGoal_ActivateSpecialEffect(tbl, ai, goal)
-- get amount of effects
local effectNum = ai:GetSpecialEffectActivateInterruptNum()
for effectIndex = 0, effectNum - 1 do
-- run the interrupt check for each effect
if _GetInterruptFunc(tbl.Interrupt_ActivateSpecialEffect)(tbl, ai, goal, ai:GetSpecialEffectActivateInterruptType(effectIndex)) then
return true
end
end
end
---
-- Handles the interrupt calls for deactivate special effect interrupts. Will iterate over all effects and run the table interrupt function against
-- each one till it gets a positive. Table interrupt function gets an extra argument - special effect type
-- @function _InterruptTableGoal_InactivateSpecialEffect
-- @tparam table tbl Goal/Logic table.
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @return Returns true if successfully processed the interrupt.
function _InterruptTableGoal_InactivateSpecialEffect(tbl, ai, goal)
-- get amount of effects
local effectNum = ai:GetSpecialEffectInactivateInterruptNum()
for effectIndex = 0, effectNum - 1 do
-- run the interrupt check for each effect
if _GetInterruptFunc(tbl.Interrupt_InactivateSpecialEffect)(tbl, ai, goal, ai:GetSpecialEffectInactivateInterruptType(effectIndex)) then
return true
end
end
end
---
-- Handles the interrupt calls for invade trigger region interrupts. Will iterate over all region categories and run the table interrupt function against
-- each one till it gets a positive. Table interrupt function gets an extra argument - trigger region category.
-- @function _InterruptTableGoal_InvadeTriggerRegion
-- @tparam table tbl Goal/Logic table.
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @return Returns true if successfully processed the interrupt.
function _InterruptTableGoal_InvadeTriggerRegion(tbl, ai, goal)
-- get amount of categories
local categoryNum = ai:GetInvadeTriggerRegionCategoryNum()
for categoryIndex = 0, categoryNum - 1 do
-- run the interrupt check for each category
if _GetInterruptFunc(tbl.Interrupt_InvadeTriggerRegion)(tbl, ai, goal, ai:GetInvadeTriggerRegionCategory(categoryIndex)) then
return true
end
end
end
---
-- Handles the interrupt calls for leave trigger region interrupts. Will iterate over all region categories and run the table interrupt function against
-- each one till it gets a positive. Table interrupt function gets an extra argument - trigger region category.
-- @function _InterruptTableGoal_LeaveTriggerRegion
-- @tparam table tbl Goal/Logic table.
-- @tparam userdata ai AI object.
-- @tparam userdata goal Goal object.
-- @return Returns true if successfully processed the interrupt.
function _InterruptTableGoal_LeaveTriggerRegion(tbl, ai, goal)
-- get amount of categories
local categoryNum = ai:GetLeaveTriggerRegionCategoryNum()
for categoryIndex = 0, categoryNum - 1 do
-- run the interrupt check for each category
if _GetInterruptFunc(tbl.Interrupt_InvadeTriggerRegion)(tbl, ai, goal, ai:GetLeaveTriggerRegionCategory(categoryIndex)) then
return true
end
end
end
| 11,405
|
https://github.com/xKerman/restricted-unserialize/blob/master/src/ArrayHandler.php
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
restricted-unserialize
|
xKerman
|
PHP
|
Code
| 178
| 497
|
<?php
/**
* handler for PHP serialized array
*/
namespace xKerman\Restricted;
/**
* Handler for PHP serialiezed array
*/
class ArrayHandler implements HandlerInterface
{
/** @var ParserInterface $expressionParser parser for unserialize expression */
private $expressionParser;
/** @var integer */
const CLOSE_BRACE_LENGTH = 1;
/**
* constructor
*
* @param ParserInterface $expressionParser parser for unserialize expression
*/
public function __construct(ParserInterface $expressionParser)
{
$this->expressionParser = $expressionParser;
}
/**
* parse given `$source` as PHP serialized array
*
* @param Source $source parser input
* @param string|null $args array length
* @return array
* @throws UnserializeFailedException
*/
public function handle(Source $source, $args)
{
$length = intval($args, 10);
$result = array();
for ($i = 0; $i < $length; ++$i) {
list($key, $source) = $this->parseKey($source);
list($value, $source) = $this->expressionParser->parse($source);
$result[$key] = $value;
}
$source->consume('}', self::CLOSE_BRACE_LENGTH);
return array($result, $source);
}
/**
* parse given `$source` as array key (s.t. integer|string)
*
* @param Source $source input
* @return array
* @throws UnserializeFailedException
*/
private function parseKey($source)
{
list($key, $source) = $this->expressionParser->parse($source);
if (!is_integer($key) && !is_string($key)) {
return $source->triggerError();
}
return array($key, $source);
}
}
| 32,210
|
https://github.com/Bing-ok/yql-plus/blob/master/yqlplus_engine/src/test/java/com/yahoo/yqlplus/engine/java/SourceNamedBindingModule.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
yql-plus
|
Bing-ok
|
Java
|
Code
| 128
| 382
|
/*
* Copyright (c) 2016 Yahoo Inc.
* Licensed under the terms of the Apache version 2.0 license.
* See LICENSE file for terms.
*/
package com.yahoo.yqlplus.engine.java;
import com.google.common.collect.ImmutableMap;
import com.google.inject.AbstractModule;
import com.google.inject.name.Names;
import com.yahoo.yqlplus.api.Source;
import java.util.Map;
/**
* Convenience for binding a bunch of names to source classes.
*/
public class SourceNamedBindingModule extends AbstractModule {
private Map<String, Class<? extends Source>> sources;
public SourceNamedBindingModule(Map<String, Class<? extends Source>> sources) {
this.sources = sources;
}
@SuppressWarnings("unchecked")
public SourceNamedBindingModule(Object... kvPairs) {
ImmutableMap.Builder<String, Class<? extends Source>> sources = ImmutableMap.builder();
for (int i = 0; i < kvPairs.length; i += 2) {
sources.put((String) kvPairs[i], (Class<? extends Source>) kvPairs[i + 1]);
}
this.sources = sources.build();
}
@Override
protected void configure() {
for (Map.Entry<String, Class<? extends Source>> e : sources.entrySet()) {
bind(Source.class).annotatedWith(Names.named(e.getKey())).to(e.getValue());
}
}
}
| 32,415
|
https://github.com/maddox/magic-cards-docker/blob/master/script/restart
|
Github Open Source
|
Open Source
|
MIT
| 2,018
|
magic-cards-docker
|
maddox
|
Shell
|
Code
| 3
| 16
|
#!/bin/bash
script/stop
script/start
| 45,051
|
https://github.com/Pckool/GCG/blob/master/GCG_Source.build/module.django.template.engine.cpp
|
Github Open Source
|
Open Source
|
MIT
| null |
GCG
|
Pckool
|
C++
|
Code
| 20,000
| 80,269
|
/* Generated code for Python source for module 'django.template.engine' * created by Nuitka version 0.5.28.2 * * This code is in part copyright 2017 Kay Hayen. * * 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. */ #include "nuitka/prelude.h" #include "__helpers.h" /* The _module_django$template$engine is a Python object pointer of module type. */ /* Note: For full compatibility with CPython, every module variable access * needs to go through it except for cases where the module cannot possibly * have changed in the mean time. */ PyObject *module_django$template$engine; PyDictObject *moduledict_django$template$engine; /* The module constants used, if any. */ extern PyObject *const_str_plain_Engine; static PyObject *const_tuple_str_digest_3bbfc9e47a18c021f544d0ce3c91b282_tuple; extern PyObject *const_str_plain_metaclass; extern PyObject *const_str_plain___spec__; extern PyObject *const_str_plain_TemplateDoesNotExist; extern PyObject *const_tuple_type_tuple_type_list_tuple; static PyObject *const_tuple_2f1547449c8f83e314319c4496be8ea4_tuple; extern PyObject *const_str_plain_builtins; extern PyObject *const_dict_empty; extern PyObject *const_str_plain_render_to_string; extern PyObject *const_slice_int_pos_1_none_none; extern PyObject *const_str_plain___file__; extern PyObject *const_str_plain_lru_cache; extern PyObject *const_str_plain_import_string; extern PyObject *const_str_plain_template_code; static PyObject *const_str_digest_d5ee484663c6485afe35f700304700ab; static PyObject *const_tuple_e7359ab5a6a76bd3186458e1401bce46_tuple; extern PyObject *const_str_plain_dirs; extern PyObject *const_str_plain_args; static PyObject *const_str_digest_f0f44e311c48a97ce26f6e9d8264d01f; extern PyObject *const_str_angle_listcontraction; extern PyObject *const_str_plain_DjangoTemplates; static PyObject *const_str_digest_5dfcab6a83ff85495be42996bdd627d7; extern PyObject *const_tuple_str_digest_d391ce3e66d4a0f3554daaf7b66457a2_tuple; static PyObject *const_str_digest_9f43746c934f465c934b0a5e60249f9c; extern PyObject *const_str_plain_items; extern PyObject *const_str_plain_from_string; static PyObject *const_str_digest_96e3281d75c0037d9db734e328894673; static PyObject *const_str_digest_647918cfb6b083817c7b32e5fa0eefe3; extern PyObject *const_tuple_str_plain_import_string_tuple; extern PyObject *const_str_digest_d391ce3e66d4a0f3554daaf7b66457a2; static PyObject *const_str_plain_supports_recursion; static PyObject *const_tuple_str_plain_Context_str_plain_Template_tuple; extern PyObject *const_str_plain_tried; extern PyObject *const_str_plain_join; static PyObject *const_tuple_str_plain_self_str_plain_builtins_tuple; extern PyObject *const_tuple_str_plain_ImproperlyConfigured_tuple; extern PyObject *const_str_plain_template_dirs; static PyObject *const_tuple_10d0bd3864a7847e74448586bbe73840_tuple; static PyObject *const_str_digest_ab2d81eeb9961553c22c81995e05cd2c; extern PyObject *const_str_plain___doc__; static PyObject *const_tuple_f888f3660827d445ed26298caf71dea8_tuple; extern PyObject *const_str_plain_extend; extern PyObject *const_tuple_str_plain_self_str_plain_template_code_tuple; static PyObject *const_str_digest_85419b83afe434b50ca498b9488b968b; extern PyObject *const_str_plain_context_processors; extern PyObject *const_str_plain___package__; extern PyObject *const_str_digest_690178e17eae3581689f22974cc26edf; static PyObject *const_tuple_d940a67f800c993667e2bb2a294bedae_tuple; extern PyObject *const_str_plain_render; extern PyObject *const_str_plain_Context; extern PyObject *const_str_angle_genexpr; static PyObject *const_str_plain_not_found; extern PyObject *const_str_plain_template; extern PyObject *const_tuple_str_plain_cached_property_tuple; static PyObject *const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple; extern PyObject *const_str_plain___qualname__; static PyObject *const_str_digest_87b1af58fda9b1a0e08325c7fe9389c5; static PyObject *const_str_digest_7bc7842c12000ccaa90d38590a606e93; extern PyObject *const_str_plain_t; extern PyObject *const_str_digest_5d6e7b4f2db498ca0ac8c75d77b24da0; extern PyObject *const_str_plain_template_libraries; static PyObject *const_tuple_999d13b73143f9034aae36762fcc455d_tuple; extern PyObject *const_str_digest_b9c4baf879ebd882d40843df3a4dead7; extern PyObject *const_str_digest_dadad3649855b4ef34e37aac871ea911; extern PyObject *const_str_plain_path; extern PyObject *const_str_plain_string_types; extern PyObject *const_str_plain_six; static PyObject *const_tuple_55c8d9942467c8d45f0bc3b45af337d3_tuple; extern PyObject *const_tuple_str_plain_self_tuple; extern PyObject *const_tuple_str_plain_DjangoTemplates_tuple; extern PyObject *const_str_plain_all; extern PyObject *const_str_plain_e; extern PyObject *const_str_plain_Template; extern PyObject *const_str_digest_dfb6e1abbed3113ee07234fdc458a320; static PyObject *const_str_digest_fbf135e93a85f18349a93f79e8e7453b; extern PyObject *const_str_plain_engine; static PyObject *const_tuple_str_digest_6be1581c44183599cf1bf9867ba809fb_tuple; extern PyObject *const_str_plain_context; extern PyObject *const_tuple_str_plain_TemplateDoesNotExist_tuple; extern PyObject *const_tuple_empty; extern PyObject *const_str_digest_467c9722f19d9d40d148689532cdc0b1; extern PyObject *const_tuple_str_plain_engines_tuple; extern PyObject *const_str_plain_append; static PyObject *const_tuple_str_plain_self_str_plain_context_processors_tuple; static PyObject *const_tuple_str_plain_x_str_plain_builtins_tuple; static PyObject *const_str_plain_django_engines; static PyObject *const_str_digest_54c51542d472cc22958b32a56d86b0c0; static PyObject *const_str_digest_232f66335f094a391b160d4505c336d9; extern PyObject *const_str_plain___loader__; static PyObject *const_str_digest_13f6ed90d5f2655c1929956883749ddb; extern PyObject *const_str_plain_get_default; extern PyObject *const_str_plain_template_name; extern PyObject *const_str_plain_name; extern PyObject *const_str_plain_exceptions; static PyObject *const_str_digest_5f62a3ed0ed37013f0898c7278c88eb0; extern PyObject *const_str_plain_template_context_processors; static PyObject *const_str_plain_get_template_libraries; static PyObject *const_list_30c60d01c497c25f51e75753618b09ed_list; extern PyObject *const_str_plain_select_template; extern PyObject *const_str_plain_ImproperlyConfigured; static PyObject *const_str_plain_template_loaders; extern PyObject *const_str_plain_template_name_list; extern PyObject *const_str_plain_ModuleSpec; static PyObject *const_tuple_8d385fcc7061a64cc2c08c10d4733b51_tuple; extern PyObject *const_str_digest_6980fe85b537b92ddfc78c6a18354abc; extern PyObject *const_str_plain_skip; static PyObject *const_tuple_str_plain__builtin_context_processors_tuple; extern PyObject *const_str_digest_c075052d723d6707083e869a0e3659bb; static PyObject *const_str_plain_find_template_loader; extern PyObject *const_str_plain_import_library; static PyObject *const_tuple_str_digest_b9c4baf879ebd882d40843df3a4dead7_str_plain_path_tuple; static PyObject *const_str_plain_find_template; static PyObject *const_str_plain_loader_class; extern PyObject *const_int_0; static PyObject *const_str_digest_8468118cf7fc34b236a9f5542335157e; extern PyObject *const_str_plain_file_charset; extern PyObject *const_str_plain_loaders; extern PyObject *const_str_plain_cached_property; extern PyObject *const_str_plain_string_if_invalid; extern PyObject *const_str_digest_db35ab94a03c3cbeb13cbe2a1d728b77; static PyObject *const_str_digest_6be1581c44183599cf1bf9867ba809fb; extern PyObject *const_str_plain_origin; static PyObject *const_str_digest_42592d12fa1b5dbf52387e7505f4a28e; extern PyObject *const_str_plain_x; static PyObject *const_tuple_str_plain_import_library_tuple; static PyObject *const_str_digest_5e7d486bf364ae2eb998d28ef41b3939; extern PyObject *const_str_plain_autoescape; static PyObject *const_str_digest_fe4e8b13a26b7fbc769685b7f689f85b; extern PyObject *const_tuple_str_plain_lru_cache_str_plain_six_tuple; extern PyObject *const_tuple_type_list_type_tuple_tuple; extern PyObject *const_str_plain_get_template; extern PyObject *const_str_plain_base; static PyObject *const_str_digest_fb4df92c0244e8d9910b7a1c4561394a; static PyObject *const_tuple_5342357bada8c032df5196f76e35df18_tuple; static PyObject *const_str_digest_fbe569291871437c78819136a9f00252; static PyObject *const_tuple_2cd505382556b66f6e10d18572972e83_tuple; static PyObject *const_str_plain_loaded; extern PyObject *const_str_plain___cached__; static PyObject *const_str_digest_be42fb332c8078c935933ef4d0a80fcf; extern PyObject *const_str_plain___class__; static PyObject *const_str_digest_96d82ab19ee2bc1ec26b24b0d381698d; extern PyObject *const_tuple_none_tuple; extern PyObject *const_tuple_type_object_tuple; extern PyObject *const_str_plain___module__; extern PyObject *const_str_plain_library; static PyObject *const_str_digest_e7b57bbc2554a0c60d5a28147d437bf8; extern PyObject *const_str_plain_debug; extern PyObject *const_int_pos_1; extern PyObject *const_str_plain_exc; static PyObject *const_str_digest_239857b5b94043719f09f91d3094c0fb; static PyObject *const_str_digest_39f86a30c3f5423a2d8ccbc2797bb96d; static PyObject *const_str_plain_template_loader; extern PyObject *const_str_plain___prepare__; extern PyObject *const_str_plain___init__; static PyObject *const_str_digest_38cf09af3cd8f72f2d3014c7c2befe3c; static PyObject *const_list_str_digest_54c51542d472cc22958b32a56d86b0c0_list; extern PyObject *const_str_plain_self; extern PyObject *const_str_plain__builtin_context_processors; static PyObject *const_list_str_digest_5f62a3ed0ed37013f0898c7278c88eb0_list; extern PyObject *const_str_digest_11597ab11dd401cd546aa0e378bc8ed2; extern PyObject *const_str_plain_libraries; extern PyObject *const_str_plain_template_builtins; static PyObject *const_tuple_str_digest_be42fb332c8078c935933ef4d0a80fcf_tuple; static PyObject *const_str_digest_3f0e701b53dba95e71e3f9f850a1b3ce; extern PyObject *const_str_plain_app_dirs; extern PyObject *const_str_plain_engines; static PyObject *const_str_plain_get_template_builtins; extern PyObject *const_str_empty; extern PyObject *const_str_digest_3d2fb639fc3676a85e9d77bb02d18a21; extern PyObject *const_tuple_none_none_tuple; static PyObject *const_str_digest_3bbfc9e47a18c021f544d0ce3c91b282; static PyObject *const_str_plain_get_template_loaders; static PyObject *const_str_plain_default_builtins; static PyObject *const_tuple_str_plain_engine_str_plain_engines_str_plain_DjangoTemplates_tuple; extern PyObject *const_str_plain_loader; static PyObject *module_filename_obj; static bool constants_created = false; static void createModuleConstants( void ) { const_tuple_str_digest_3bbfc9e47a18c021f544d0ce3c91b282_tuple = PyTuple_New( 1 ); const_str_digest_3bbfc9e47a18c021f544d0ce3c91b282 = UNSTREAM_STRING( &constant_bin[ 1125149 ], 41, 0 ); PyTuple_SET_ITEM( const_tuple_str_digest_3bbfc9e47a18c021f544d0ce3c91b282_tuple, 0, const_str_digest_3bbfc9e47a18c021f544d0ce3c91b282 ); Py_INCREF( const_str_digest_3bbfc9e47a18c021f544d0ce3c91b282 ); const_tuple_2f1547449c8f83e314319c4496be8ea4_tuple = PyTuple_New( 5 ); PyTuple_SET_ITEM( const_tuple_2f1547449c8f83e314319c4496be8ea4_tuple, 0, const_str_plain_self ); Py_INCREF( const_str_plain_self ); PyTuple_SET_ITEM( const_tuple_2f1547449c8f83e314319c4496be8ea4_tuple, 1, const_str_plain_template_name_list ); Py_INCREF( const_str_plain_template_name_list ); const_str_plain_not_found = UNSTREAM_STRING( &constant_bin[ 751177 ], 9, 1 ); PyTuple_SET_ITEM( const_tuple_2f1547449c8f83e314319c4496be8ea4_tuple, 2, const_str_plain_not_found ); Py_INCREF( const_str_plain_not_found ); PyTuple_SET_ITEM( const_tuple_2f1547449c8f83e314319c4496be8ea4_tuple, 3, const_str_plain_template_name ); Py_INCREF( const_str_plain_template_name ); PyTuple_SET_ITEM( const_tuple_2f1547449c8f83e314319c4496be8ea4_tuple, 4, const_str_plain_exc ); Py_INCREF( const_str_plain_exc ); const_str_digest_d5ee484663c6485afe35f700304700ab = UNSTREAM_STRING( &constant_bin[ 1098978 ], 19, 0 ); const_tuple_e7359ab5a6a76bd3186458e1401bce46_tuple = PyTuple_New( 8 ); PyTuple_SET_ITEM( const_tuple_e7359ab5a6a76bd3186458e1401bce46_tuple, 0, const_str_plain_self ); Py_INCREF( const_str_plain_self ); PyTuple_SET_ITEM( const_tuple_e7359ab5a6a76bd3186458e1401bce46_tuple, 1, const_str_plain_name ); Py_INCREF( const_str_plain_name ); PyTuple_SET_ITEM( const_tuple_e7359ab5a6a76bd3186458e1401bce46_tuple, 2, const_str_plain_dirs ); Py_INCREF( const_str_plain_dirs ); PyTuple_SET_ITEM( const_tuple_e7359ab5a6a76bd3186458e1401bce46_tuple, 3, const_str_plain_skip ); Py_INCREF( const_str_plain_skip ); PyTuple_SET_ITEM( const_tuple_e7359ab5a6a76bd3186458e1401bce46_tuple, 4, const_str_plain_tried ); Py_INCREF( const_str_plain_tried ); PyTuple_SET_ITEM( const_tuple_e7359ab5a6a76bd3186458e1401bce46_tuple, 5, const_str_plain_loader ); Py_INCREF( const_str_plain_loader ); PyTuple_SET_ITEM( const_tuple_e7359ab5a6a76bd3186458e1401bce46_tuple, 6, const_str_plain_template ); Py_INCREF( const_str_plain_template ); PyTuple_SET_ITEM( const_tuple_e7359ab5a6a76bd3186458e1401bce46_tuple, 7, const_str_plain_e ); Py_INCREF( const_str_plain_e ); const_str_digest_f0f44e311c48a97ce26f6e9d8264d01f = UNSTREAM_STRING( &constant_bin[ 1098344 ], 27, 0 ); const_str_digest_5dfcab6a83ff85495be42996bdd627d7 = UNSTREAM_STRING( &constant_bin[ 1098399 ], 27, 0 ); const_str_digest_9f43746c934f465c934b0a5e60249f9c = UNSTREAM_STRING( &constant_bin[ 1125190 ], 25, 0 ); const_str_digest_96e3281d75c0037d9db734e328894673 = UNSTREAM_STRING( &constant_bin[ 1125215 ], 22, 0 ); const_str_digest_647918cfb6b083817c7b32e5fa0eefe3 = UNSTREAM_STRING( &constant_bin[ 1125237 ], 53, 0 ); const_str_plain_supports_recursion = UNSTREAM_STRING( &constant_bin[ 1125290 ], 18, 1 ); const_tuple_str_plain_Context_str_plain_Template_tuple = PyTuple_New( 2 ); PyTuple_SET_ITEM( const_tuple_str_plain_Context_str_plain_Template_tuple, 0, const_str_plain_Context ); Py_INCREF( const_str_plain_Context ); PyTuple_SET_ITEM( const_tuple_str_plain_Context_str_plain_Template_tuple, 1, const_str_plain_Template ); Py_INCREF( const_str_plain_Template ); const_tuple_str_plain_self_str_plain_builtins_tuple = PyTuple_New( 2 ); PyTuple_SET_ITEM( const_tuple_str_plain_self_str_plain_builtins_tuple, 0, const_str_plain_self ); Py_INCREF( const_str_plain_self ); PyTuple_SET_ITEM( const_tuple_str_plain_self_str_plain_builtins_tuple, 1, const_str_plain_builtins ); Py_INCREF( const_str_plain_builtins ); const_tuple_10d0bd3864a7847e74448586bbe73840_tuple = PyTuple_New( 3 ); PyTuple_SET_ITEM( const_tuple_10d0bd3864a7847e74448586bbe73840_tuple, 0, const_str_plain_engines ); Py_INCREF( const_str_plain_engines ); PyTuple_SET_ITEM( const_tuple_10d0bd3864a7847e74448586bbe73840_tuple, 1, const_str_plain_DjangoTemplates ); Py_INCREF( const_str_plain_DjangoTemplates ); const_str_plain_django_engines = UNSTREAM_STRING( &constant_bin[ 1125308 ], 14, 1 ); PyTuple_SET_ITEM( const_tuple_10d0bd3864a7847e74448586bbe73840_tuple, 2, const_str_plain_django_engines ); Py_INCREF( const_str_plain_django_engines ); const_str_digest_ab2d81eeb9961553c22c81995e05cd2c = UNSTREAM_STRING( &constant_bin[ 1125322 ], 37, 0 ); const_tuple_f888f3660827d445ed26298caf71dea8_tuple = PyTuple_New( 11 ); PyTuple_SET_ITEM( const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 0, const_str_plain_self ); Py_INCREF( const_str_plain_self ); PyTuple_SET_ITEM( const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 1, const_str_plain_dirs ); Py_INCREF( const_str_plain_dirs ); PyTuple_SET_ITEM( const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 2, const_str_plain_app_dirs ); Py_INCREF( const_str_plain_app_dirs ); PyTuple_SET_ITEM( const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 3, const_str_plain_context_processors ); Py_INCREF( const_str_plain_context_processors ); PyTuple_SET_ITEM( const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 4, const_str_plain_debug ); Py_INCREF( const_str_plain_debug ); PyTuple_SET_ITEM( const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 5, const_str_plain_loaders ); Py_INCREF( const_str_plain_loaders ); PyTuple_SET_ITEM( const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 6, const_str_plain_string_if_invalid ); Py_INCREF( const_str_plain_string_if_invalid ); PyTuple_SET_ITEM( const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 7, const_str_plain_file_charset ); Py_INCREF( const_str_plain_file_charset ); PyTuple_SET_ITEM( const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 8, const_str_plain_libraries ); Py_INCREF( const_str_plain_libraries ); PyTuple_SET_ITEM( const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 9, const_str_plain_builtins ); Py_INCREF( const_str_plain_builtins ); PyTuple_SET_ITEM( const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 10, const_str_plain_autoescape ); Py_INCREF( const_str_plain_autoescape ); const_str_digest_85419b83afe434b50ca498b9488b968b = UNSTREAM_STRING( &constant_bin[ 1125359 ], 489, 0 ); const_tuple_d940a67f800c993667e2bb2a294bedae_tuple = PyTuple_New( 4 ); PyTuple_SET_ITEM( const_tuple_d940a67f800c993667e2bb2a294bedae_tuple, 0, const_str_plain_self ); Py_INCREF( const_str_plain_self ); PyTuple_SET_ITEM( const_tuple_d940a67f800c993667e2bb2a294bedae_tuple, 1, const_str_plain_template_name ); Py_INCREF( const_str_plain_template_name ); PyTuple_SET_ITEM( const_tuple_d940a67f800c993667e2bb2a294bedae_tuple, 2, const_str_plain_template ); Py_INCREF( const_str_plain_template ); PyTuple_SET_ITEM( const_tuple_d940a67f800c993667e2bb2a294bedae_tuple, 3, const_str_plain_origin ); Py_INCREF( const_str_plain_origin ); const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple = PyTuple_New( 10 ); PyTuple_SET_ITEM( const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple, 0, Py_None ); Py_INCREF( Py_None ); PyTuple_SET_ITEM( const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple, 1, Py_False ); Py_INCREF( Py_False ); PyTuple_SET_ITEM( const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple, 2, Py_None ); Py_INCREF( Py_None ); PyTuple_SET_ITEM( const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple, 3, Py_False ); Py_INCREF( Py_False ); PyTuple_SET_ITEM( const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple, 4, Py_None ); Py_INCREF( Py_None ); PyTuple_SET_ITEM( const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple, 5, const_str_empty ); Py_INCREF( const_str_empty ); PyTuple_SET_ITEM( const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple, 6, const_str_digest_c075052d723d6707083e869a0e3659bb ); Py_INCREF( const_str_digest_c075052d723d6707083e869a0e3659bb ); PyTuple_SET_ITEM( const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple, 7, Py_None ); Py_INCREF( Py_None ); PyTuple_SET_ITEM( const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple, 8, Py_None ); Py_INCREF( Py_None ); PyTuple_SET_ITEM( const_tuple_c1fddb391582c1bef88bbe4fff0f1c0c_tuple, 9, Py_True ); Py_INCREF( Py_True ); const_str_digest_87b1af58fda9b1a0e08325c7fe9389c5 = UNSTREAM_STRING( &constant_bin[ 1125848 ], 27, 0 ); const_str_digest_7bc7842c12000ccaa90d38590a606e93 = UNSTREAM_STRING( &constant_bin[ 1125848 ], 20, 0 ); const_tuple_999d13b73143f9034aae36762fcc455d_tuple = PyTuple_New( 5 ); PyTuple_SET_ITEM( const_tuple_999d13b73143f9034aae36762fcc455d_tuple, 0, const_str_plain_self ); Py_INCREF( const_str_plain_self ); PyTuple_SET_ITEM( const_tuple_999d13b73143f9034aae36762fcc455d_tuple, 1, const_str_plain_libraries ); Py_INCREF( const_str_plain_libraries ); const_str_plain_loaded = UNSTREAM_STRING( &constant_bin[ 13362 ], 6, 1 ); PyTuple_SET_ITEM( const_tuple_999d13b73143f9034aae36762fcc455d_tuple, 2, const_str_plain_loaded ); Py_INCREF( const_str_plain_loaded ); PyTuple_SET_ITEM( const_tuple_999d13b73143f9034aae36762fcc455d_tuple, 3, const_str_plain_name ); Py_INCREF( const_str_plain_name ); PyTuple_SET_ITEM( const_tuple_999d13b73143f9034aae36762fcc455d_tuple, 4, const_str_plain_path ); Py_INCREF( const_str_plain_path ); const_tuple_55c8d9942467c8d45f0bc3b45af337d3_tuple = PyTuple_New( 4 ); PyTuple_SET_ITEM( const_tuple_55c8d9942467c8d45f0bc3b45af337d3_tuple, 0, const_str_plain_self ); Py_INCREF( const_str_plain_self ); PyTuple_SET_ITEM( const_tuple_55c8d9942467c8d45f0bc3b45af337d3_tuple, 1, const_str_plain_loader ); Py_INCREF( const_str_plain_loader ); PyTuple_SET_ITEM( const_tuple_55c8d9942467c8d45f0bc3b45af337d3_tuple, 2, const_str_plain_args ); Py_INCREF( const_str_plain_args ); const_str_plain_loader_class = UNSTREAM_STRING( &constant_bin[ 1125875 ], 12, 1 ); PyTuple_SET_ITEM( const_tuple_55c8d9942467c8d45f0bc3b45af337d3_tuple, 3, const_str_plain_loader_class ); Py_INCREF( const_str_plain_loader_class ); const_str_digest_fbf135e93a85f18349a93f79e8e7453b = UNSTREAM_STRING( &constant_bin[ 1125887 ], 23, 0 ); const_tuple_str_digest_6be1581c44183599cf1bf9867ba809fb_tuple = PyTuple_New( 1 ); const_str_digest_6be1581c44183599cf1bf9867ba809fb = UNSTREAM_STRING( &constant_bin[ 1125910 ], 80, 0 ); PyTuple_SET_ITEM( const_tuple_str_digest_6be1581c44183599cf1bf9867ba809fb_tuple, 0, const_str_digest_6be1581c44183599cf1bf9867ba809fb ); Py_INCREF( const_str_digest_6be1581c44183599cf1bf9867ba809fb ); const_tuple_str_plain_self_str_plain_context_processors_tuple = PyTuple_New( 2 ); PyTuple_SET_ITEM( const_tuple_str_plain_self_str_plain_context_processors_tuple, 0, const_str_plain_self ); Py_INCREF( const_str_plain_self ); PyTuple_SET_ITEM( const_tuple_str_plain_self_str_plain_context_processors_tuple, 1, const_str_plain_context_processors ); Py_INCREF( const_str_plain_context_processors ); const_tuple_str_plain_x_str_plain_builtins_tuple = PyTuple_New( 2 ); PyTuple_SET_ITEM( const_tuple_str_plain_x_str_plain_builtins_tuple, 0, const_str_plain_x ); Py_INCREF( const_str_plain_x ); PyTuple_SET_ITEM( const_tuple_str_plain_x_str_plain_builtins_tuple, 1, const_str_plain_builtins ); Py_INCREF( const_str_plain_builtins ); const_str_digest_54c51542d472cc22958b32a56d86b0c0 = UNSTREAM_STRING( &constant_bin[ 1125990 ], 46, 0 ); const_str_digest_232f66335f094a391b160d4505c336d9 = UNSTREAM_STRING( &constant_bin[ 1099402 ], 18, 0 ); const_str_digest_13f6ed90d5f2655c1929956883749ddb = UNSTREAM_STRING( &constant_bin[ 1126036 ], 128, 0 ); const_str_digest_5f62a3ed0ed37013f0898c7278c88eb0 = UNSTREAM_STRING( &constant_bin[ 1126164 ], 41, 0 ); const_str_plain_get_template_libraries = UNSTREAM_STRING( &constant_bin[ 1126205 ], 22, 1 ); const_list_30c60d01c497c25f51e75753618b09ed_list = PyList_New( 3 ); PyList_SET_ITEM( const_list_30c60d01c497c25f51e75753618b09ed_list, 0, const_str_digest_f0f44e311c48a97ce26f6e9d8264d01f ); Py_INCREF( const_str_digest_f0f44e311c48a97ce26f6e9d8264d01f ); PyList_SET_ITEM( const_list_30c60d01c497c25f51e75753618b09ed_list, 1, const_str_digest_5d6e7b4f2db498ca0ac8c75d77b24da0 ); Py_INCREF( const_str_digest_5d6e7b4f2db498ca0ac8c75d77b24da0 ); PyList_SET_ITEM( const_list_30c60d01c497c25f51e75753618b09ed_list, 2, const_str_digest_5dfcab6a83ff85495be42996bdd627d7 ); Py_INCREF( const_str_digest_5dfcab6a83ff85495be42996bdd627d7 ); const_str_plain_template_loaders = UNSTREAM_STRING( &constant_bin[ 1125894 ], 16, 1 ); const_tuple_8d385fcc7061a64cc2c08c10d4733b51_tuple = PyTuple_New( 4 ); PyTuple_SET_ITEM( const_tuple_8d385fcc7061a64cc2c08c10d4733b51_tuple, 0, const_str_plain_self ); Py_INCREF( const_str_plain_self ); PyTuple_SET_ITEM( const_tuple_8d385fcc7061a64cc2c08c10d4733b51_tuple, 1, const_str_plain_template_name ); Py_INCREF( const_str_plain_template_name ); PyTuple_SET_ITEM( const_tuple_8d385fcc7061a64cc2c08c10d4733b51_tuple, 2, const_str_plain_context ); Py_INCREF( const_str_plain_context ); PyTuple_SET_ITEM( const_tuple_8d385fcc7061a64cc2c08c10d4733b51_tuple, 3, const_str_plain_t ); Py_INCREF( const_str_plain_t ); const_tuple_str_plain__builtin_context_processors_tuple = PyTuple_New( 1 ); PyTuple_SET_ITEM( const_tuple_str_plain__builtin_context_processors_tuple, 0, const_str_plain__builtin_context_processors ); Py_INCREF( const_str_plain__builtin_context_processors ); const_str_plain_find_template_loader = UNSTREAM_STRING( &constant_bin[ 1125855 ], 20, 1 ); const_tuple_str_digest_b9c4baf879ebd882d40843df3a4dead7_str_plain_path_tuple = PyTuple_New( 2 ); PyTuple_SET_ITEM( const_tuple_str_digest_b9c4baf879ebd882d40843df3a4dead7_str_plain_path_tuple, 0, const_str_digest_b9c4baf879ebd882d40843df3a4dead7 ); Py_INCREF( const_str_digest_b9c4baf879ebd882d40843df3a4dead7 ); PyTuple_SET_ITEM( const_tuple_str_digest_b9c4baf879ebd882d40843df3a4dead7_str_plain_path_tuple, 1, const_str_plain_path ); Py_INCREF( const_str_plain_path ); const_str_plain_find_template = UNSTREAM_STRING( &constant_bin[ 1125855 ], 13, 1 ); const_str_digest_8468118cf7fc34b236a9f5542335157e = UNSTREAM_STRING( &constant_bin[ 1126227 ], 87, 0 ); const_str_digest_42592d12fa1b5dbf52387e7505f4a28e = UNSTREAM_STRING( &constant_bin[ 1125237 ], 34, 0 ); const_tuple_str_plain_import_library_tuple = PyTuple_New( 1 ); PyTuple_SET_ITEM( const_tuple_str_plain_import_library_tuple, 0, const_str_plain_import_library ); Py_INCREF( const_str_plain_import_library ); const_str_digest_5e7d486bf364ae2eb998d28ef41b3939 = UNSTREAM_STRING( &constant_bin[ 1126314 ], 29, 0 ); const_str_digest_fe4e8b13a26b7fbc769685b7f689f85b = UNSTREAM_STRING( &constant_bin[ 1126343 ], 28, 0 ); const_str_digest_fb4df92c0244e8d9910b7a1c4561394a = UNSTREAM_STRING( &constant_bin[ 1126371 ], 31, 0 ); const_tuple_5342357bada8c032df5196f76e35df18_tuple = PyTuple_New( 17 ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 0, const_str_plain___class__ ); Py_INCREF( const_str_plain___class__ ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 1, const_str_plain___qualname__ ); Py_INCREF( const_str_plain___qualname__ ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 2, const_str_plain___module__ ); Py_INCREF( const_str_plain___module__ ); const_str_plain_default_builtins = UNSTREAM_STRING( &constant_bin[ 1126402 ], 16, 1 ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 3, const_str_plain_default_builtins ); Py_INCREF( const_str_plain_default_builtins ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 4, const_str_plain___init__ ); Py_INCREF( const_str_plain___init__ ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 5, const_str_plain_get_default ); Py_INCREF( const_str_plain_get_default ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 6, const_str_plain_template_context_processors ); Py_INCREF( const_str_plain_template_context_processors ); const_str_plain_get_template_builtins = UNSTREAM_STRING( &constant_bin[ 1126350 ], 21, 1 ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 7, const_str_plain_get_template_builtins ); Py_INCREF( const_str_plain_get_template_builtins ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 8, const_str_plain_get_template_libraries ); Py_INCREF( const_str_plain_get_template_libraries ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 9, const_str_plain_template_loaders ); Py_INCREF( const_str_plain_template_loaders ); const_str_plain_get_template_loaders = UNSTREAM_STRING( &constant_bin[ 1126418 ], 20, 1 ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 10, const_str_plain_get_template_loaders ); Py_INCREF( const_str_plain_get_template_loaders ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 11, const_str_plain_find_template_loader ); Py_INCREF( const_str_plain_find_template_loader ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 12, const_str_plain_find_template ); Py_INCREF( const_str_plain_find_template ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 13, const_str_plain_from_string ); Py_INCREF( const_str_plain_from_string ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 14, const_str_plain_get_template ); Py_INCREF( const_str_plain_get_template ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 15, const_str_plain_render_to_string ); Py_INCREF( const_str_plain_render_to_string ); PyTuple_SET_ITEM( const_tuple_5342357bada8c032df5196f76e35df18_tuple, 16, const_str_plain_select_template ); Py_INCREF( const_str_plain_select_template ); const_str_digest_fbe569291871437c78819136a9f00252 = UNSTREAM_STRING( &constant_bin[ 1126438 ], 132, 0 ); const_tuple_2cd505382556b66f6e10d18572972e83_tuple = PyTuple_New( 5 ); PyTuple_SET_ITEM( const_tuple_2cd505382556b66f6e10d18572972e83_tuple, 0, const_str_plain_self ); Py_INCREF( const_str_plain_self ); PyTuple_SET_ITEM( const_tuple_2cd505382556b66f6e10d18572972e83_tuple, 1, const_str_plain_template_loaders ); Py_INCREF( const_str_plain_template_loaders ); PyTuple_SET_ITEM( const_tuple_2cd505382556b66f6e10d18572972e83_tuple, 2, const_str_plain_loaders ); Py_INCREF( const_str_plain_loaders ); const_str_plain_template_loader = UNSTREAM_STRING( &constant_bin[ 1125860 ], 15, 1 ); PyTuple_SET_ITEM( const_tuple_2cd505382556b66f6e10d18572972e83_tuple, 3, const_str_plain_template_loader ); Py_INCREF( const_str_plain_template_loader ); PyTuple_SET_ITEM( const_tuple_2cd505382556b66f6e10d18572972e83_tuple, 4, const_str_plain_loader ); Py_INCREF( const_str_plain_loader ); const_str_digest_be42fb332c8078c935933ef4d0a80fcf = UNSTREAM_STRING( &constant_bin[ 1126570 ], 49, 0 ); const_str_digest_96d82ab19ee2bc1ec26b24b0d381698d = UNSTREAM_STRING( &constant_bin[ 1126619 ], 132, 0 ); const_str_digest_e7b57bbc2554a0c60d5a28147d437bf8 = UNSTREAM_STRING( &constant_bin[ 1126751 ], 23, 0 ); const_str_digest_239857b5b94043719f09f91d3094c0fb = UNSTREAM_STRING( &constant_bin[ 1126774 ], 27, 0 ); const_str_digest_39f86a30c3f5423a2d8ccbc2797bb96d = UNSTREAM_STRING( &constant_bin[ 1099383 ], 15, 0 ); const_str_digest_38cf09af3cd8f72f2d3014c7c2befe3c = UNSTREAM_STRING( &constant_bin[ 1126801 ], 51, 0 ); const_list_str_digest_54c51542d472cc22958b32a56d86b0c0_list = PyList_New( 1 ); PyList_SET_ITEM( const_list_str_digest_54c51542d472cc22958b32a56d86b0c0_list, 0, const_str_digest_54c51542d472cc22958b32a56d86b0c0 ); Py_INCREF( const_str_digest_54c51542d472cc22958b32a56d86b0c0 ); const_list_str_digest_5f62a3ed0ed37013f0898c7278c88eb0_list = PyList_New( 1 ); PyList_SET_ITEM( const_list_str_digest_5f62a3ed0ed37013f0898c7278c88eb0_list, 0, const_str_digest_5f62a3ed0ed37013f0898c7278c88eb0 ); Py_INCREF( const_str_digest_5f62a3ed0ed37013f0898c7278c88eb0 ); const_tuple_str_digest_be42fb332c8078c935933ef4d0a80fcf_tuple = PyTuple_New( 1 ); PyTuple_SET_ITEM( const_tuple_str_digest_be42fb332c8078c935933ef4d0a80fcf_tuple, 0, const_str_digest_be42fb332c8078c935933ef4d0a80fcf ); Py_INCREF( const_str_digest_be42fb332c8078c935933ef4d0a80fcf ); const_str_digest_3f0e701b53dba95e71e3f9f850a1b3ce = UNSTREAM_STRING( &constant_bin[ 1126852 ], 18, 0 ); const_tuple_str_plain_engine_str_plain_engines_str_plain_DjangoTemplates_tuple = PyTuple_New( 3 ); PyTuple_SET_ITEM( const_tuple_str_plain_engine_str_plain_engines_str_plain_DjangoTemplates_tuple, 0, const_str_plain_engine ); Py_INCREF( const_str_plain_engine ); PyTuple_SET_ITEM( const_tuple_str_plain_engine_str_plain_engines_str_plain_DjangoTemplates_tuple, 1, const_str_plain_engines ); Py_INCREF( const_str_plain_engines ); PyTuple_SET_ITEM( const_tuple_str_plain_engine_str_plain_engines_str_plain_DjangoTemplates_tuple, 2, const_str_plain_DjangoTemplates ); Py_INCREF( const_str_plain_DjangoTemplates ); constants_created = true; } #ifndef __NUITKA_NO_ASSERT__ void checkModuleConstants_django$template$engine( void ) { // The module may not have been used at all. if (constants_created == false) return; } #endif // The module code objects. static PyCodeObject *codeobj_628b33451b85fccfd94e9e7e0dcbf43a; static PyCodeObject *codeobj_62532f927034d6276ca5e8a732a366a1; static PyCodeObject *codeobj_7f55e29bf7c0019da15c9ccfd659a580; static PyCodeObject *codeobj_55186d9e40b3446776ce2c3373ff270c; static PyCodeObject *codeobj_a54baf356a17b8b4f7235d0dfd045a81; static PyCodeObject *codeobj_87d993fa3d05505573237e2e0c1e8bc4; static PyCodeObject *codeobj_e3e0d3faa8a81091422da817cb2bba3f; static PyCodeObject *codeobj_41daf0feae544bbc9081c221068ff4cd; static PyCodeObject *codeobj_742e343ac314969a76237aae585de2e9; static PyCodeObject *codeobj_978c8ed3e6c4aa35d9b6ec230cdbd742; static PyCodeObject *codeobj_b17c2ea0084acc349c94f1c9603f09e7; static PyCodeObject *codeobj_a51a90c72dc94d3272516ed6082aeb3d; static PyCodeObject *codeobj_6da1160b8383805c096d5812518aab68; static PyCodeObject *codeobj_926f065148014bc71abcbd66bbac4e04; static PyCodeObject *codeobj_e3cfa77b68b2cd43a22663dde34251d6; static PyCodeObject *codeobj_db2b5b2369557c150d3e350c58104bef; static PyCodeObject *codeobj_3119ef248ad3b1e8fbcaea5e4cdde9d3; static PyCodeObject *codeobj_735439d854f01fd329f628fe293226f2; static void createModuleCodeObjects(void) { module_filename_obj = MAKE_RELATIVE_PATH( const_str_digest_9f43746c934f465c934b0a5e60249f9c ); codeobj_628b33451b85fccfd94e9e7e0dcbf43a = MAKE_CODEOBJ( module_filename_obj, const_str_angle_genexpr, 93, const_tuple_str_digest_b9c4baf879ebd882d40843df3a4dead7_str_plain_path_tuple, 1, 0, CO_GENERATOR | CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_62532f927034d6276ca5e8a732a366a1 = MAKE_CODEOBJ( module_filename_obj, const_str_angle_listcontraction, 76, const_tuple_str_plain_engine_str_plain_engines_str_plain_DjangoTemplates_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_7f55e29bf7c0019da15c9ccfd659a580 = MAKE_CODEOBJ( module_filename_obj, const_str_angle_listcontraction, 96, const_tuple_str_plain_x_str_plain_builtins_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_55186d9e40b3446776ce2c3373ff270c = MAKE_CODEOBJ( module_filename_obj, const_str_digest_fb4df92c0244e8d9910b7a1c4561394a, 1, const_tuple_empty, 0, 0, CO_NOFREE ); codeobj_a54baf356a17b8b4f7235d0dfd045a81 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_Engine, 12, const_tuple_5342357bada8c032df5196f76e35df18_tuple, 0, 0, CO_NOFREE ); codeobj_87d993fa3d05505573237e2e0c1e8bc4 = MAKE_CODEOBJ( module_filename_obj, const_str_plain___init__, 19, const_tuple_f888f3660827d445ed26298caf71dea8_tuple, 11, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_e3e0d3faa8a81091422da817cb2bba3f = MAKE_CODEOBJ( module_filename_obj, const_str_plain_find_template, 130, const_tuple_e7359ab5a6a76bd3186458e1401bce46_tuple, 4, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_41daf0feae544bbc9081c221068ff4cd = MAKE_CODEOBJ( module_filename_obj, const_str_plain_find_template_loader, 116, const_tuple_55c8d9942467c8d45f0bc3b45af337d3_tuple, 2, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_742e343ac314969a76237aae585de2e9 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_from_string, 150, const_tuple_str_plain_self_str_plain_template_code_tuple, 2, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_978c8ed3e6c4aa35d9b6ec230cdbd742 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_get_default, 54, const_tuple_10d0bd3864a7847e74448586bbe73840_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_b17c2ea0084acc349c94f1c9603f09e7 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_get_template, 157, const_tuple_d940a67f800c993667e2bb2a294bedae_tuple, 2, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_a51a90c72dc94d3272516ed6082aeb3d = MAKE_CODEOBJ( module_filename_obj, const_str_plain_get_template_builtins, 95, const_tuple_str_plain_self_str_plain_builtins_tuple, 2, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_6da1160b8383805c096d5812518aab68 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_get_template_libraries, 98, const_tuple_999d13b73143f9034aae36762fcc455d_tuple, 2, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_926f065148014bc71abcbd66bbac4e04 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_get_template_loaders, 108, const_tuple_2cd505382556b66f6e10d18572972e83_tuple, 2, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_e3cfa77b68b2cd43a22663dde34251d6 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_render_to_string, 168, const_tuple_8d385fcc7061a64cc2c08c10d4733b51_tuple, 3, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_db2b5b2369557c150d3e350c58104bef = MAKE_CODEOBJ( module_filename_obj, const_str_plain_select_template, 184, const_tuple_2f1547449c8f83e314319c4496be8ea4_tuple, 2, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_3119ef248ad3b1e8fbcaea5e4cdde9d3 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_template_context_processors, 89, const_tuple_str_plain_self_str_plain_context_processors_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); codeobj_735439d854f01fd329f628fe293226f2 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_template_loaders, 104, const_tuple_str_plain_self_tuple, 1, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE ); } // The module function declarations. #if _NUITKA_EXPERIMENTAL_GENERATOR_GOTO static PyObject *django$template$engine$$$function_3_template_context_processors$$$genexpr_1_genexpr_context( struct Nuitka_GeneratorObject *generator, PyObject *yield_return_value ); #else static void django$template$engine$$$function_3_template_context_processors$$$genexpr_1_genexpr_context( struct Nuitka_GeneratorObject *generator ); #endif NUITKA_CROSS_MODULE PyObject *impl___internal__$$$function_12_complex_call_helper_pos_star_list( PyObject **python_pars ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_10_from_string( ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_11_get_template( ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_12_render_to_string( PyObject *defaults ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_13_select_template( ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_1___init__( PyObject *defaults ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_2_get_default( ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_3_template_context_processors( ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_4_get_template_builtins( ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_5_get_template_libraries( ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_6_template_loaders( ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_7_get_template_loaders( ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_8_find_template_loader( ); static PyObject *MAKE_FUNCTION_django$template$engine$$$function_9_find_template( PyObject *defaults ); // The module function definitions. static PyObject *impl_django$template$engine$$$function_1___init__( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *par_dirs = python_pars[ 1 ]; PyObject *par_app_dirs = python_pars[ 2 ]; PyObject *par_context_processors = python_pars[ 3 ]; PyObject *par_debug = python_pars[ 4 ]; PyObject *par_loaders = python_pars[ 5 ]; PyObject *par_string_if_invalid = python_pars[ 6 ]; PyObject *par_file_charset = python_pars[ 7 ]; PyObject *par_libraries = python_pars[ 8 ]; PyObject *par_builtins = python_pars[ 9 ]; PyObject *par_autoescape = python_pars[ 10 ]; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_element_name_1; PyObject *tmp_args_element_name_2; PyObject *tmp_assattr_name_1; PyObject *tmp_assattr_name_2; PyObject *tmp_assattr_name_3; PyObject *tmp_assattr_name_4; PyObject *tmp_assattr_name_5; PyObject *tmp_assattr_name_6; PyObject *tmp_assattr_name_7; PyObject *tmp_assattr_name_8; PyObject *tmp_assattr_name_9; PyObject *tmp_assattr_name_10; PyObject *tmp_assattr_name_11; PyObject *tmp_assattr_name_12; PyObject *tmp_assattr_target_1; PyObject *tmp_assattr_target_2; PyObject *tmp_assattr_target_3; PyObject *tmp_assattr_target_4; PyObject *tmp_assattr_target_5; PyObject *tmp_assattr_target_6; PyObject *tmp_assattr_target_7; PyObject *tmp_assattr_target_8; PyObject *tmp_assattr_target_9; PyObject *tmp_assattr_target_10; PyObject *tmp_assattr_target_11; PyObject *tmp_assattr_target_12; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_assign_source_6; PyObject *tmp_assign_source_7; PyObject *tmp_called_name_1; PyObject *tmp_called_name_2; PyObject *tmp_called_name_3; PyObject *tmp_compare_left_1; PyObject *tmp_compare_left_2; PyObject *tmp_compare_left_3; PyObject *tmp_compare_left_4; PyObject *tmp_compare_left_5; PyObject *tmp_compare_right_1; PyObject *tmp_compare_right_2; PyObject *tmp_compare_right_3; PyObject *tmp_compare_right_4; PyObject *tmp_compare_right_5; int tmp_cond_truth_1; int tmp_cond_truth_2; int tmp_cond_truth_3; PyObject *tmp_cond_value_1; PyObject *tmp_cond_value_2; PyObject *tmp_cond_value_3; bool tmp_is_1; bool tmp_is_2; bool tmp_is_3; bool tmp_is_4; bool tmp_is_5; PyObject *tmp_left_name_1; PyObject *tmp_left_name_2; PyObject *tmp_list_element_1; PyObject *tmp_raise_type_1; bool tmp_result; PyObject *tmp_return_value; PyObject *tmp_right_name_1; PyObject *tmp_right_name_2; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; PyObject *tmp_source_name_3; PyObject *tmp_source_name_4; PyObject *tmp_tuple_element_1; static struct Nuitka_FrameObject *cache_frame_87d993fa3d05505573237e2e0c1e8bc4 = NULL; struct Nuitka_FrameObject *frame_87d993fa3d05505573237e2e0c1e8bc4; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. tmp_compare_left_1 = par_dirs; CHECK_OBJECT( tmp_compare_left_1 ); tmp_compare_right_1 = Py_None; tmp_is_1 = ( tmp_compare_left_1 == tmp_compare_right_1 ); if ( tmp_is_1 ) { goto branch_yes_1; } else { goto branch_no_1; } branch_yes_1:; tmp_assign_source_1 = PyList_New( 0 ); { PyObject *old = par_dirs; par_dirs = tmp_assign_source_1; Py_XDECREF( old ); } branch_no_1:; // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_87d993fa3d05505573237e2e0c1e8bc4, codeobj_87d993fa3d05505573237e2e0c1e8bc4, module_django$template$engine, sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_87d993fa3d05505573237e2e0c1e8bc4 = cache_frame_87d993fa3d05505573237e2e0c1e8bc4; // Push the new frame as the currently active one. pushFrameStack( frame_87d993fa3d05505573237e2e0c1e8bc4 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_87d993fa3d05505573237e2e0c1e8bc4 ) == 2 ); // Frame stack // Framed code: tmp_compare_left_2 = par_context_processors; if ( tmp_compare_left_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "context_processors" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 24; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_compare_right_2 = Py_None; tmp_is_2 = ( tmp_compare_left_2 == tmp_compare_right_2 ); if ( tmp_is_2 ) { goto branch_yes_2; } else { goto branch_no_2; } branch_yes_2:; tmp_assign_source_2 = PyList_New( 0 ); { PyObject *old = par_context_processors; par_context_processors = tmp_assign_source_2; Py_XDECREF( old ); } branch_no_2:; tmp_compare_left_3 = par_loaders; if ( tmp_compare_left_3 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loaders" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 26; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_compare_right_3 = Py_None; tmp_is_3 = ( tmp_compare_left_3 == tmp_compare_right_3 ); if ( tmp_is_3 ) { goto branch_yes_3; } else { goto branch_no_3; } branch_yes_3:; tmp_assign_source_3 = LIST_COPY( const_list_str_digest_5f62a3ed0ed37013f0898c7278c88eb0_list ); { PyObject *old = par_loaders; par_loaders = tmp_assign_source_3; Py_XDECREF( old ); } tmp_cond_value_1 = par_app_dirs; if ( tmp_cond_value_1 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "app_dirs" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 28; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_cond_truth_1 = CHECK_IF_TRUE( tmp_cond_value_1 ); if ( tmp_cond_truth_1 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 28; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } if ( tmp_cond_truth_1 == 1 ) { goto branch_yes_4; } else { goto branch_no_4; } branch_yes_4:; tmp_left_name_1 = par_loaders; CHECK_OBJECT( tmp_left_name_1 ); tmp_right_name_1 = LIST_COPY( const_list_str_digest_54c51542d472cc22958b32a56d86b0c0_list ); tmp_result = BINARY_OPERATION_ADD_INPLACE( &tmp_left_name_1, tmp_right_name_1 ); tmp_assign_source_4 = tmp_left_name_1; Py_DECREF( tmp_right_name_1 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 29; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } par_loaders = tmp_assign_source_4; branch_no_4:; tmp_cond_value_2 = par_debug; if ( tmp_cond_value_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "debug" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 30; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_cond_truth_2 = CHECK_IF_TRUE( tmp_cond_value_2 ); if ( tmp_cond_truth_2 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 30; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } if ( tmp_cond_truth_2 == 1 ) { goto branch_no_5; } else { goto branch_yes_5; } branch_yes_5:; tmp_assign_source_5 = PyList_New( 1 ); tmp_list_element_1 = PyTuple_New( 2 ); tmp_tuple_element_1 = const_str_digest_ab2d81eeb9961553c22c81995e05cd2c; Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_list_element_1, 0, tmp_tuple_element_1 ); tmp_tuple_element_1 = par_loaders; if ( tmp_tuple_element_1 == NULL ) { Py_DECREF( tmp_assign_source_5 ); Py_DECREF( tmp_list_element_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loaders" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 31; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_list_element_1, 1, tmp_tuple_element_1 ); PyList_SET_ITEM( tmp_assign_source_5, 0, tmp_list_element_1 ); { PyObject *old = par_loaders; par_loaders = tmp_assign_source_5; Py_XDECREF( old ); } branch_no_5:; goto branch_end_3; branch_no_3:; tmp_cond_value_3 = par_app_dirs; if ( tmp_cond_value_3 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "app_dirs" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 33; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_cond_truth_3 = CHECK_IF_TRUE( tmp_cond_value_3 ); if ( tmp_cond_truth_3 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 33; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } if ( tmp_cond_truth_3 == 1 ) { goto branch_yes_6; } else { goto branch_no_6; } branch_yes_6:; tmp_called_name_1 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_ImproperlyConfigured ); if (unlikely( tmp_called_name_1 == NULL )) { tmp_called_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_ImproperlyConfigured ); } if ( tmp_called_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "ImproperlyConfigured" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 34; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } frame_87d993fa3d05505573237e2e0c1e8bc4->m_frame.f_lineno = 34; tmp_raise_type_1 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, &PyTuple_GET_ITEM( const_tuple_str_digest_be42fb332c8078c935933ef4d0a80fcf_tuple, 0 ) ); if ( tmp_raise_type_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 34; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } exception_type = tmp_raise_type_1; exception_lineno = 34; RAISE_EXCEPTION_WITH_TYPE( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; branch_no_6:; branch_end_3:; tmp_compare_left_4 = par_libraries; if ( tmp_compare_left_4 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "libraries" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 36; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_compare_right_4 = Py_None; tmp_is_4 = ( tmp_compare_left_4 == tmp_compare_right_4 ); if ( tmp_is_4 ) { goto branch_yes_7; } else { goto branch_no_7; } branch_yes_7:; tmp_assign_source_6 = PyDict_New(); { PyObject *old = par_libraries; par_libraries = tmp_assign_source_6; Py_XDECREF( old ); } branch_no_7:; tmp_compare_left_5 = par_builtins; if ( tmp_compare_left_5 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "builtins" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 38; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_compare_right_5 = Py_None; tmp_is_5 = ( tmp_compare_left_5 == tmp_compare_right_5 ); if ( tmp_is_5 ) { goto branch_yes_8; } else { goto branch_no_8; } branch_yes_8:; tmp_assign_source_7 = PyList_New( 0 ); { PyObject *old = par_builtins; par_builtins = tmp_assign_source_7; Py_XDECREF( old ); } branch_no_8:; tmp_assattr_name_1 = par_dirs; if ( tmp_assattr_name_1 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "dirs" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 41; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_1 = par_self; if ( tmp_assattr_target_1 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 41; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_1, const_str_plain_dirs, tmp_assattr_name_1 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 41; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_name_2 = par_app_dirs; if ( tmp_assattr_name_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "app_dirs" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 42; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_2 = par_self; if ( tmp_assattr_target_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 42; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_2, const_str_plain_app_dirs, tmp_assattr_name_2 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 42; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_name_3 = par_autoescape; if ( tmp_assattr_name_3 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "autoescape" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 43; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_3 = par_self; if ( tmp_assattr_target_3 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 43; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_3, const_str_plain_autoescape, tmp_assattr_name_3 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 43; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_name_4 = par_context_processors; if ( tmp_assattr_name_4 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "context_processors" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 44; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_4 = par_self; if ( tmp_assattr_target_4 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 44; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_4, const_str_plain_context_processors, tmp_assattr_name_4 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 44; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_name_5 = par_debug; if ( tmp_assattr_name_5 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "debug" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 45; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_5 = par_self; if ( tmp_assattr_target_5 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 45; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_5, const_str_plain_debug, tmp_assattr_name_5 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 45; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_name_6 = par_loaders; if ( tmp_assattr_name_6 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loaders" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 46; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_6 = par_self; if ( tmp_assattr_target_6 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 46; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_6, const_str_plain_loaders, tmp_assattr_name_6 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 46; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_name_7 = par_string_if_invalid; if ( tmp_assattr_name_7 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "string_if_invalid" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 47; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_7 = par_self; if ( tmp_assattr_target_7 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 47; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_7, const_str_plain_string_if_invalid, tmp_assattr_name_7 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 47; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_name_8 = par_file_charset; if ( tmp_assattr_name_8 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "file_charset" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 48; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_8 = par_self; if ( tmp_assattr_target_8 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 48; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_8, const_str_plain_file_charset, tmp_assattr_name_8 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 48; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_name_9 = par_libraries; if ( tmp_assattr_name_9 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "libraries" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 49; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_9 = par_self; if ( tmp_assattr_target_9 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 49; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_9, const_str_plain_libraries, tmp_assattr_name_9 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 49; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_source_name_1 = par_self; if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 50; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_called_name_2 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_get_template_libraries ); if ( tmp_called_name_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 50; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_args_element_name_1 = par_libraries; if ( tmp_args_element_name_1 == NULL ) { Py_DECREF( tmp_called_name_2 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "libraries" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 50; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } frame_87d993fa3d05505573237e2e0c1e8bc4->m_frame.f_lineno = 50; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_assattr_name_10 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_2, call_args ); } Py_DECREF( tmp_called_name_2 ); if ( tmp_assattr_name_10 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 50; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_10 = par_self; if ( tmp_assattr_target_10 == NULL ) { Py_DECREF( tmp_assattr_name_10 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 50; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_10, const_str_plain_template_libraries, tmp_assattr_name_10 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_assattr_name_10 ); exception_lineno = 50; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } Py_DECREF( tmp_assattr_name_10 ); tmp_source_name_2 = par_self; if ( tmp_source_name_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 51; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_left_name_2 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_default_builtins ); if ( tmp_left_name_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 51; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_right_name_2 = par_builtins; if ( tmp_right_name_2 == NULL ) { Py_DECREF( tmp_left_name_2 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "builtins" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 51; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_name_11 = BINARY_OPERATION_ADD( tmp_left_name_2, tmp_right_name_2 ); Py_DECREF( tmp_left_name_2 ); if ( tmp_assattr_name_11 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 51; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_11 = par_self; if ( tmp_assattr_target_11 == NULL ) { Py_DECREF( tmp_assattr_name_11 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 51; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_11, const_str_plain_builtins, tmp_assattr_name_11 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_assattr_name_11 ); exception_lineno = 51; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } Py_DECREF( tmp_assattr_name_11 ); tmp_source_name_3 = par_self; if ( tmp_source_name_3 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 52; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_called_name_3 = LOOKUP_ATTRIBUTE( tmp_source_name_3, const_str_plain_get_template_builtins ); if ( tmp_called_name_3 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 52; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_source_name_4 = par_self; if ( tmp_source_name_4 == NULL ) { Py_DECREF( tmp_called_name_3 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 52; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_args_element_name_2 = LOOKUP_ATTRIBUTE( tmp_source_name_4, const_str_plain_builtins ); if ( tmp_args_element_name_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_3 ); exception_lineno = 52; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } frame_87d993fa3d05505573237e2e0c1e8bc4->m_frame.f_lineno = 52; { PyObject *call_args[] = { tmp_args_element_name_2 }; tmp_assattr_name_12 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_3, call_args ); } Py_DECREF( tmp_called_name_3 ); Py_DECREF( tmp_args_element_name_2 ); if ( tmp_assattr_name_12 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 52; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_assattr_target_12 = par_self; if ( tmp_assattr_target_12 == NULL ) { Py_DECREF( tmp_assattr_name_12 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 52; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } tmp_result = SET_ATTRIBUTE( tmp_assattr_target_12, const_str_plain_template_builtins, tmp_assattr_name_12 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_assattr_name_12 ); exception_lineno = 52; type_description_1 = "ooooooooooo"; goto frame_exception_exit_1; } Py_DECREF( tmp_assattr_name_12 ); #if 0 RESTORE_FRAME_EXCEPTION( frame_87d993fa3d05505573237e2e0c1e8bc4 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_87d993fa3d05505573237e2e0c1e8bc4 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_87d993fa3d05505573237e2e0c1e8bc4, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_87d993fa3d05505573237e2e0c1e8bc4->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_87d993fa3d05505573237e2e0c1e8bc4, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_87d993fa3d05505573237e2e0c1e8bc4, type_description_1, par_self, par_dirs, par_app_dirs, par_context_processors, par_debug, par_loaders, par_string_if_invalid, par_file_charset, par_libraries, par_builtins, par_autoescape ); // Release cached frame. if ( frame_87d993fa3d05505573237e2e0c1e8bc4 == cache_frame_87d993fa3d05505573237e2e0c1e8bc4 ) { Py_DECREF( frame_87d993fa3d05505573237e2e0c1e8bc4 ); } cache_frame_87d993fa3d05505573237e2e0c1e8bc4 = NULL; assertFrameObject( frame_87d993fa3d05505573237e2e0c1e8bc4 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; tmp_return_value = Py_None; Py_INCREF( tmp_return_value ); goto try_return_handler_1; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_1___init__ ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_dirs ); par_dirs = NULL; Py_XDECREF( par_app_dirs ); par_app_dirs = NULL; Py_XDECREF( par_context_processors ); par_context_processors = NULL; Py_XDECREF( par_debug ); par_debug = NULL; Py_XDECREF( par_loaders ); par_loaders = NULL; Py_XDECREF( par_string_if_invalid ); par_string_if_invalid = NULL; Py_XDECREF( par_file_charset ); par_file_charset = NULL; Py_XDECREF( par_libraries ); par_libraries = NULL; Py_XDECREF( par_builtins ); par_builtins = NULL; Py_XDECREF( par_autoescape ); par_autoescape = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_dirs ); par_dirs = NULL; Py_XDECREF( par_app_dirs ); par_app_dirs = NULL; Py_XDECREF( par_context_processors ); par_context_processors = NULL; Py_XDECREF( par_debug ); par_debug = NULL; Py_XDECREF( par_loaders ); par_loaders = NULL; Py_XDECREF( par_string_if_invalid ); par_string_if_invalid = NULL; Py_XDECREF( par_file_charset ); par_file_charset = NULL; Py_XDECREF( par_libraries ); par_libraries = NULL; Py_XDECREF( par_builtins ); par_builtins = NULL; Py_XDECREF( par_autoescape ); par_autoescape = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_1___init__ ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_django$template$engine$$$function_2_get_default( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *var_engines = NULL; PyObject *var_DjangoTemplates = NULL; PyObject *var_django_engines = NULL; PyObject *outline_0_var_engine = NULL; PyObject *tmp_listcontraction_1__$0 = NULL; PyObject *tmp_listcontraction_1__contraction = NULL; PyObject *tmp_listcontraction_1__iter_value_0 = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *exception_keeper_type_3; PyObject *exception_keeper_value_3; PyTracebackObject *exception_keeper_tb_3; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_3; PyObject *tmp_append_list_1; PyObject *tmp_append_value_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_assign_source_6; PyObject *tmp_assign_source_7; PyObject *tmp_called_instance_1; PyObject *tmp_called_name_1; PyObject *tmp_called_name_2; int tmp_cmp_Eq_1; int tmp_cmp_Eq_2; PyObject *tmp_compare_left_1; PyObject *tmp_compare_left_2; PyObject *tmp_compare_right_1; PyObject *tmp_compare_right_2; PyObject *tmp_fromlist_name_1; PyObject *tmp_fromlist_name_2; PyObject *tmp_globals_name_1; PyObject *tmp_globals_name_2; PyObject *tmp_import_name_from_1; PyObject *tmp_import_name_from_2; PyObject *tmp_isinstance_cls_1; PyObject *tmp_isinstance_inst_1; PyObject *tmp_iter_arg_1; PyObject *tmp_len_arg_1; PyObject *tmp_len_arg_2; PyObject *tmp_level_name_1; PyObject *tmp_level_name_2; PyObject *tmp_locals_name_1; PyObject *tmp_locals_name_2; PyObject *tmp_name_name_1; PyObject *tmp_name_name_2; PyObject *tmp_next_source_1; PyObject *tmp_outline_return_value_1; PyObject *tmp_raise_type_1; PyObject *tmp_raise_type_2; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_subscribed_name_1; PyObject *tmp_subscript_name_1; static struct Nuitka_FrameObject *cache_frame_62532f927034d6276ca5e8a732a366a1_2 = NULL; struct Nuitka_FrameObject *frame_62532f927034d6276ca5e8a732a366a1_2; static struct Nuitka_FrameObject *cache_frame_978c8ed3e6c4aa35d9b6ec230cdbd742 = NULL; struct Nuitka_FrameObject *frame_978c8ed3e6c4aa35d9b6ec230cdbd742; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; NUITKA_MAY_BE_UNUSED char const *type_description_2 = NULL; tmp_return_value = NULL; tmp_outline_return_value_1 = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_978c8ed3e6c4aa35d9b6ec230cdbd742, codeobj_978c8ed3e6c4aa35d9b6ec230cdbd742, module_django$template$engine, sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_978c8ed3e6c4aa35d9b6ec230cdbd742 = cache_frame_978c8ed3e6c4aa35d9b6ec230cdbd742; // Push the new frame as the currently active one. pushFrameStack( frame_978c8ed3e6c4aa35d9b6ec230cdbd742 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_978c8ed3e6c4aa35d9b6ec230cdbd742 ) == 2 ); // Frame stack // Framed code: tmp_name_name_1 = const_str_digest_6980fe85b537b92ddfc78c6a18354abc; tmp_globals_name_1 = (PyObject *)moduledict_django$template$engine; tmp_locals_name_1 = Py_None; tmp_fromlist_name_1 = const_tuple_str_plain_engines_tuple; tmp_level_name_1 = const_int_0; frame_978c8ed3e6c4aa35d9b6ec230cdbd742->m_frame.f_lineno = 74; tmp_import_name_from_1 = IMPORT_MODULE5( tmp_name_name_1, tmp_globals_name_1, tmp_locals_name_1, tmp_fromlist_name_1, tmp_level_name_1 ); if ( tmp_import_name_from_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 74; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_assign_source_1 = IMPORT_NAME( tmp_import_name_from_1, const_str_plain_engines ); Py_DECREF( tmp_import_name_from_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 74; type_description_1 = "ooo"; goto frame_exception_exit_1; } assert( var_engines == NULL ); var_engines = tmp_assign_source_1; tmp_name_name_2 = const_str_digest_11597ab11dd401cd546aa0e378bc8ed2; tmp_globals_name_2 = (PyObject *)moduledict_django$template$engine; tmp_locals_name_2 = Py_None; tmp_fromlist_name_2 = const_tuple_str_plain_DjangoTemplates_tuple; tmp_level_name_2 = const_int_0; frame_978c8ed3e6c4aa35d9b6ec230cdbd742->m_frame.f_lineno = 75; tmp_import_name_from_2 = IMPORT_MODULE5( tmp_name_name_2, tmp_globals_name_2, tmp_locals_name_2, tmp_fromlist_name_2, tmp_level_name_2 ); if ( tmp_import_name_from_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 75; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_assign_source_2 = IMPORT_NAME( tmp_import_name_from_2, const_str_plain_DjangoTemplates ); Py_DECREF( tmp_import_name_from_2 ); if ( tmp_assign_source_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 75; type_description_1 = "ooo"; goto frame_exception_exit_1; } assert( var_DjangoTemplates == NULL ); var_DjangoTemplates = tmp_assign_source_2; // Tried code: tmp_called_instance_1 = var_engines; if ( tmp_called_instance_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "free variable '%s' referenced before assignment in enclosing scope", "engines" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 76; type_description_1 = "ooo"; goto try_except_handler_2; } frame_978c8ed3e6c4aa35d9b6ec230cdbd742->m_frame.f_lineno = 76; tmp_iter_arg_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_1, const_str_plain_all ); if ( tmp_iter_arg_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 76; type_description_1 = "ooo"; goto try_except_handler_2; } tmp_assign_source_4 = MAKE_ITERATOR( tmp_iter_arg_1 ); Py_DECREF( tmp_iter_arg_1 ); if ( tmp_assign_source_4 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 76; type_description_1 = "ooo"; goto try_except_handler_2; } assert( tmp_listcontraction_1__$0 == NULL ); tmp_listcontraction_1__$0 = tmp_assign_source_4; tmp_assign_source_5 = PyList_New( 0 ); assert( tmp_listcontraction_1__contraction == NULL ); tmp_listcontraction_1__contraction = tmp_assign_source_5; MAKE_OR_REUSE_FRAME( cache_frame_62532f927034d6276ca5e8a732a366a1_2, codeobj_62532f927034d6276ca5e8a732a366a1, module_django$template$engine, sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_62532f927034d6276ca5e8a732a366a1_2 = cache_frame_62532f927034d6276ca5e8a732a366a1_2; // Push the new frame as the currently active one. pushFrameStack( frame_62532f927034d6276ca5e8a732a366a1_2 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_62532f927034d6276ca5e8a732a366a1_2 ) == 2 ); // Frame stack // Framed code: // Tried code: loop_start_1:; tmp_next_source_1 = tmp_listcontraction_1__$0; CHECK_OBJECT( tmp_next_source_1 ); tmp_assign_source_6 = ITERATOR_NEXT( tmp_next_source_1 ); if ( tmp_assign_source_6 == NULL ) { if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() ) { goto loop_end_1; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_2 = "ooo"; exception_lineno = 76; goto try_except_handler_3; } } { PyObject *old = tmp_listcontraction_1__iter_value_0; tmp_listcontraction_1__iter_value_0 = tmp_assign_source_6; Py_XDECREF( old ); } tmp_assign_source_7 = tmp_listcontraction_1__iter_value_0; CHECK_OBJECT( tmp_assign_source_7 ); { PyObject *old = outline_0_var_engine; outline_0_var_engine = tmp_assign_source_7; Py_INCREF( outline_0_var_engine ); Py_XDECREF( old ); } tmp_isinstance_inst_1 = outline_0_var_engine; CHECK_OBJECT( tmp_isinstance_inst_1 ); tmp_isinstance_cls_1 = var_DjangoTemplates; if ( tmp_isinstance_cls_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "free variable '%s' referenced before assignment in enclosing scope", "DjangoTemplates" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 77; type_description_2 = "ooo"; goto try_except_handler_3; } tmp_res = Nuitka_IsInstance( tmp_isinstance_inst_1, tmp_isinstance_cls_1 ); if ( tmp_res == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 77; type_description_2 = "ooo"; goto try_except_handler_3; } if ( tmp_res == 1 ) { goto branch_yes_1; } else { goto branch_no_1; } branch_yes_1:; tmp_append_list_1 = tmp_listcontraction_1__contraction; CHECK_OBJECT( tmp_append_list_1 ); tmp_append_value_1 = outline_0_var_engine; CHECK_OBJECT( tmp_append_value_1 ); assert( PyList_Check( tmp_append_list_1 ) ); tmp_res = PyList_Append( tmp_append_list_1, tmp_append_value_1 ); if ( tmp_res == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 76; type_description_2 = "ooo"; goto try_except_handler_3; } branch_no_1:; if ( CONSIDER_THREADING() == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 76; type_description_2 = "ooo"; goto try_except_handler_3; } goto loop_start_1; loop_end_1:; tmp_outline_return_value_1 = tmp_listcontraction_1__contraction; CHECK_OBJECT( tmp_outline_return_value_1 ); Py_INCREF( tmp_outline_return_value_1 ); goto try_return_handler_3; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_2_get_default ); return NULL; // Return handler code: try_return_handler_3:; Py_XDECREF( tmp_listcontraction_1__$0 ); tmp_listcontraction_1__$0 = NULL; Py_XDECREF( tmp_listcontraction_1__contraction ); tmp_listcontraction_1__contraction = NULL; Py_XDECREF( tmp_listcontraction_1__iter_value_0 ); tmp_listcontraction_1__iter_value_0 = NULL; goto frame_return_exit_2; // Exception handler code: try_except_handler_3:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_listcontraction_1__$0 ); tmp_listcontraction_1__$0 = NULL; Py_XDECREF( tmp_listcontraction_1__contraction ); tmp_listcontraction_1__contraction = NULL; Py_XDECREF( tmp_listcontraction_1__iter_value_0 ); tmp_listcontraction_1__iter_value_0 = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto frame_exception_exit_2; // End of try: #if 0 RESTORE_FRAME_EXCEPTION( frame_62532f927034d6276ca5e8a732a366a1_2 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_2:; #if 0 RESTORE_FRAME_EXCEPTION( frame_62532f927034d6276ca5e8a732a366a1_2 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_2; frame_exception_exit_2:; #if 0 RESTORE_FRAME_EXCEPTION( frame_62532f927034d6276ca5e8a732a366a1_2 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_62532f927034d6276ca5e8a732a366a1_2, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_62532f927034d6276ca5e8a732a366a1_2->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_62532f927034d6276ca5e8a732a366a1_2, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_62532f927034d6276ca5e8a732a366a1_2, type_description_2, outline_0_var_engine, var_engines, var_DjangoTemplates ); // Release cached frame. if ( frame_62532f927034d6276ca5e8a732a366a1_2 == cache_frame_62532f927034d6276ca5e8a732a366a1_2 ) { Py_DECREF( frame_62532f927034d6276ca5e8a732a366a1_2 ); } cache_frame_62532f927034d6276ca5e8a732a366a1_2 = NULL; assertFrameObject( frame_62532f927034d6276ca5e8a732a366a1_2 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto nested_frame_exit_1; frame_no_exception_1:; goto skip_nested_handling_1; nested_frame_exit_1:; type_description_1 = "ooo"; goto try_except_handler_2; skip_nested_handling_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_2_get_default ); return NULL; // Return handler code: try_return_handler_2:; Py_XDECREF( outline_0_var_engine ); outline_0_var_engine = NULL; goto outline_result_1; // Exception handler code: try_except_handler_2:; exception_keeper_type_2 = exception_type; exception_keeper_value_2 = exception_value; exception_keeper_tb_2 = exception_tb; exception_keeper_lineno_2 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( outline_0_var_engine ); outline_0_var_engine = NULL; // Re-raise. exception_type = exception_keeper_type_2; exception_value = exception_keeper_value_2; exception_tb = exception_keeper_tb_2; exception_lineno = exception_keeper_lineno_2; goto outline_exception_1; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_2_get_default ); return NULL; outline_exception_1:; exception_lineno = 76; goto frame_exception_exit_1; outline_result_1:; tmp_assign_source_3 = tmp_outline_return_value_1; assert( var_django_engines == NULL ); var_django_engines = tmp_assign_source_3; tmp_len_arg_1 = var_django_engines; CHECK_OBJECT( tmp_len_arg_1 ); tmp_compare_left_1 = BUILTIN_LEN( tmp_len_arg_1 ); if ( tmp_compare_left_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 78; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_compare_right_1 = const_int_pos_1; tmp_cmp_Eq_1 = RICH_COMPARE_BOOL_EQ( tmp_compare_left_1, tmp_compare_right_1 ); if ( tmp_cmp_Eq_1 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_compare_left_1 ); exception_lineno = 78; type_description_1 = "ooo"; goto frame_exception_exit_1; } Py_DECREF( tmp_compare_left_1 ); if ( tmp_cmp_Eq_1 == 1 ) { goto branch_yes_2; } else { goto branch_no_2; } branch_yes_2:; tmp_subscribed_name_1 = var_django_engines; if ( tmp_subscribed_name_1 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "django_engines" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 80; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_subscript_name_1 = const_int_0; tmp_source_name_1 = LOOKUP_SUBSCRIPT( tmp_subscribed_name_1, tmp_subscript_name_1 ); if ( tmp_source_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 80; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_return_value = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_engine ); Py_DECREF( tmp_source_name_1 ); if ( tmp_return_value == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 80; type_description_1 = "ooo"; goto frame_exception_exit_1; } goto frame_return_exit_1; goto branch_end_2; branch_no_2:; tmp_len_arg_2 = var_django_engines; if ( tmp_len_arg_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "django_engines" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 81; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_compare_left_2 = BUILTIN_LEN( tmp_len_arg_2 ); if ( tmp_compare_left_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 81; type_description_1 = "ooo"; goto frame_exception_exit_1; } tmp_compare_right_2 = const_int_0; tmp_cmp_Eq_2 = RICH_COMPARE_BOOL_EQ( tmp_compare_left_2, tmp_compare_right_2 ); if ( tmp_cmp_Eq_2 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_compare_left_2 ); exception_lineno = 81; type_description_1 = "ooo"; goto frame_exception_exit_1; } Py_DECREF( tmp_compare_left_2 ); if ( tmp_cmp_Eq_2 == 1 ) { goto branch_yes_3; } else { goto branch_no_3; } branch_yes_3:; tmp_called_name_1 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_ImproperlyConfigured ); if (unlikely( tmp_called_name_1 == NULL )) { tmp_called_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_ImproperlyConfigured ); } if ( tmp_called_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "ImproperlyConfigured" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 82; type_description_1 = "ooo"; goto frame_exception_exit_1; } frame_978c8ed3e6c4aa35d9b6ec230cdbd742->m_frame.f_lineno = 82; tmp_raise_type_1 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, &PyTuple_GET_ITEM( const_tuple_str_digest_3bbfc9e47a18c021f544d0ce3c91b282_tuple, 0 ) ); if ( tmp_raise_type_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 82; type_description_1 = "ooo"; goto frame_exception_exit_1; } exception_type = tmp_raise_type_1; exception_lineno = 82; RAISE_EXCEPTION_WITH_TYPE( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooo"; goto frame_exception_exit_1; goto branch_end_3; branch_no_3:; tmp_called_name_2 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_ImproperlyConfigured ); if (unlikely( tmp_called_name_2 == NULL )) { tmp_called_name_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_ImproperlyConfigured ); } if ( tmp_called_name_2 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "ImproperlyConfigured" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 85; type_description_1 = "ooo"; goto frame_exception_exit_1; } frame_978c8ed3e6c4aa35d9b6ec230cdbd742->m_frame.f_lineno = 85; tmp_raise_type_2 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_2, &PyTuple_GET_ITEM( const_tuple_str_digest_6be1581c44183599cf1bf9867ba809fb_tuple, 0 ) ); if ( tmp_raise_type_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 85; type_description_1 = "ooo"; goto frame_exception_exit_1; } exception_type = tmp_raise_type_2; exception_lineno = 85; RAISE_EXCEPTION_WITH_TYPE( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooo"; goto frame_exception_exit_1; branch_end_3:; branch_end_2:; #if 0 RESTORE_FRAME_EXCEPTION( frame_978c8ed3e6c4aa35d9b6ec230cdbd742 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_2; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_978c8ed3e6c4aa35d9b6ec230cdbd742 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_978c8ed3e6c4aa35d9b6ec230cdbd742 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_978c8ed3e6c4aa35d9b6ec230cdbd742, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_978c8ed3e6c4aa35d9b6ec230cdbd742->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_978c8ed3e6c4aa35d9b6ec230cdbd742, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_978c8ed3e6c4aa35d9b6ec230cdbd742, type_description_1, var_engines, var_DjangoTemplates, var_django_engines ); // Release cached frame. if ( frame_978c8ed3e6c4aa35d9b6ec230cdbd742 == cache_frame_978c8ed3e6c4aa35d9b6ec230cdbd742 ) { Py_DECREF( frame_978c8ed3e6c4aa35d9b6ec230cdbd742 ); } cache_frame_978c8ed3e6c4aa35d9b6ec230cdbd742 = NULL; assertFrameObject( frame_978c8ed3e6c4aa35d9b6ec230cdbd742 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_2:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_2_get_default ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( var_engines ); var_engines = NULL; Py_XDECREF( var_DjangoTemplates ); var_DjangoTemplates = NULL; Py_XDECREF( var_django_engines ); var_django_engines = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_3 = exception_type; exception_keeper_value_3 = exception_value; exception_keeper_tb_3 = exception_tb; exception_keeper_lineno_3 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( var_engines ); var_engines = NULL; Py_XDECREF( var_DjangoTemplates ); var_DjangoTemplates = NULL; Py_XDECREF( var_django_engines ); var_django_engines = NULL; // Re-raise. exception_type = exception_keeper_type_3; exception_value = exception_keeper_value_3; exception_tb = exception_keeper_tb_3; exception_lineno = exception_keeper_lineno_3; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_2_get_default ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_django$template$engine$$$function_3_template_context_processors( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *var_context_processors = NULL; PyObject *tmp_genexpr_1__$0 = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_iter_arg_1; PyObject *tmp_left_name_1; PyObject *tmp_outline_return_value_1; bool tmp_result; PyObject *tmp_return_value; PyObject *tmp_right_name_1; PyObject *tmp_source_name_1; PyObject *tmp_tuple_arg_1; PyObject *tmp_tuple_arg_2; static struct Nuitka_FrameObject *cache_frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 = NULL; struct Nuitka_FrameObject *frame_3119ef248ad3b1e8fbcaea5e4cdde9d3; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; tmp_outline_return_value_1 = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_3119ef248ad3b1e8fbcaea5e4cdde9d3, codeobj_3119ef248ad3b1e8fbcaea5e4cdde9d3, module_django$template$engine, sizeof(void *)+sizeof(void *) ); frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 = cache_frame_3119ef248ad3b1e8fbcaea5e4cdde9d3; // Push the new frame as the currently active one. pushFrameStack( frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 ) == 2 ); // Frame stack // Framed code: tmp_assign_source_1 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain__builtin_context_processors ); if (unlikely( tmp_assign_source_1 == NULL )) { tmp_assign_source_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain__builtin_context_processors ); } if ( tmp_assign_source_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "_builtin_context_processors" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 91; type_description_1 = "oo"; goto frame_exception_exit_1; } assert( var_context_processors == NULL ); Py_INCREF( tmp_assign_source_1 ); var_context_processors = tmp_assign_source_1; tmp_left_name_1 = var_context_processors; CHECK_OBJECT( tmp_left_name_1 ); tmp_source_name_1 = par_self; CHECK_OBJECT( tmp_source_name_1 ); tmp_tuple_arg_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_context_processors ); if ( tmp_tuple_arg_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 92; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_right_name_1 = PySequence_Tuple( tmp_tuple_arg_1 ); Py_DECREF( tmp_tuple_arg_1 ); if ( tmp_right_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 92; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_result = BINARY_OPERATION_ADD_INPLACE( &tmp_left_name_1, tmp_right_name_1 ); tmp_assign_source_2 = tmp_left_name_1; Py_DECREF( tmp_right_name_1 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 92; type_description_1 = "oo"; goto frame_exception_exit_1; } var_context_processors = tmp_assign_source_2; tmp_iter_arg_1 = var_context_processors; CHECK_OBJECT( tmp_iter_arg_1 ); tmp_assign_source_3 = MAKE_ITERATOR( tmp_iter_arg_1 ); if ( tmp_assign_source_3 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 93; type_description_1 = "oo"; goto frame_exception_exit_1; } assert( tmp_genexpr_1__$0 == NULL ); tmp_genexpr_1__$0 = tmp_assign_source_3; // Tried code: tmp_outline_return_value_1 = Nuitka_Generator_New( django$template$engine$$$function_3_template_context_processors$$$genexpr_1_genexpr_context, module_django$template$engine, const_str_angle_genexpr, #if PYTHON_VERSION >= 350 const_str_digest_647918cfb6b083817c7b32e5fa0eefe3, #endif codeobj_628b33451b85fccfd94e9e7e0dcbf43a, 1 ); ((struct Nuitka_GeneratorObject *)tmp_outline_return_value_1)->m_closure[0] = PyCell_NEW0( tmp_genexpr_1__$0 ); assert( Py_SIZE( tmp_outline_return_value_1 ) >= 1 ); goto try_return_handler_2; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_3_template_context_processors ); return NULL; // Return handler code: try_return_handler_2:; CHECK_OBJECT( (PyObject *)tmp_genexpr_1__$0 ); Py_DECREF( tmp_genexpr_1__$0 ); tmp_genexpr_1__$0 = NULL; goto outline_result_1; // End of try: CHECK_OBJECT( (PyObject *)tmp_genexpr_1__$0 ); Py_DECREF( tmp_genexpr_1__$0 ); tmp_genexpr_1__$0 = NULL; // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_3_template_context_processors ); return NULL; outline_result_1:; tmp_tuple_arg_2 = tmp_outline_return_value_1; tmp_return_value = PySequence_Tuple( tmp_tuple_arg_2 ); Py_DECREF( tmp_tuple_arg_2 ); if ( tmp_return_value == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 93; type_description_1 = "oo"; goto frame_exception_exit_1; } goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_3119ef248ad3b1e8fbcaea5e4cdde9d3, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_3119ef248ad3b1e8fbcaea5e4cdde9d3->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_3119ef248ad3b1e8fbcaea5e4cdde9d3, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_3119ef248ad3b1e8fbcaea5e4cdde9d3, type_description_1, par_self, var_context_processors ); // Release cached frame. if ( frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 == cache_frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 ) { Py_DECREF( frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 ); } cache_frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 = NULL; assertFrameObject( frame_3119ef248ad3b1e8fbcaea5e4cdde9d3 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_3_template_context_processors ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( var_context_processors ); var_context_processors = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( var_context_processors ); var_context_processors = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_3_template_context_processors ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } #if _NUITKA_EXPERIMENTAL_GENERATOR_GOTO struct django$template$engine$$$function_3_template_context_processors$$$genexpr_1_genexpr_locals { PyObject *var_path PyObject *tmp_iter_value_0 PyObject *exception_type PyObject *exception_value PyTracebackObject *exception_tb int exception_lineno PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; int exception_keeper_lineno_2; PyObject *tmp_args_element_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_called_name_1; PyObject *tmp_expression_name_1; PyObject *tmp_next_source_1; char const *type_description_1 }; #endif #if _NUITKA_EXPERIMENTAL_GENERATOR_GOTO static PyObject *django$template$engine$$$function_3_template_context_processors$$$genexpr_1_genexpr_context( struct Nuitka_GeneratorObject *generator, PyObject *yield_return_value ) #else static void django$template$engine$$$function_3_template_context_processors$$$genexpr_1_genexpr_context( struct Nuitka_GeneratorObject *generator ) #endif { CHECK_OBJECT( (PyObject *)generator ); assert( Nuitka_Generator_Check( (PyObject *)generator ) ); // Local variable initialization PyObject *var_path = NULL; PyObject *tmp_iter_value_0 = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *tmp_args_element_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_called_name_1; PyObject *tmp_expression_name_1; PyObject *tmp_next_source_1; NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; static struct Nuitka_FrameObject *cache_frame_generator = NULL; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; // Dispatch to yield based on return label index: // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_generator, codeobj_628b33451b85fccfd94e9e7e0dcbf43a, module_django$template$engine, sizeof(void *)+sizeof(void *) ); generator->m_frame = cache_frame_generator; // Mark the frame object as in use, ref count 1 will be up for reuse. Py_INCREF( generator->m_frame ); assert( Py_REFCNT( generator->m_frame ) == 2 ); // Frame stack #if PYTHON_VERSION >= 340 generator->m_frame->m_frame.f_gen = (PyObject *)generator; #endif Py_CLEAR( generator->m_frame->m_frame.f_back ); generator->m_frame->m_frame.f_back = PyThreadState_GET()->frame; Py_INCREF( generator->m_frame->m_frame.f_back ); PyThreadState_GET()->frame = &generator->m_frame->m_frame; Py_INCREF( generator->m_frame ); Nuitka_Frame_MarkAsExecuting( generator->m_frame ); #if PYTHON_VERSION >= 300 // Accept currently existing exception as the one to publish again when we // yield or yield from. PyThreadState *thread_state = PyThreadState_GET(); generator->m_frame->m_frame.f_exc_type = thread_state->exc_type; if ( generator->m_frame->m_frame.f_exc_type == Py_None ) generator->m_frame->m_frame.f_exc_type = NULL; Py_XINCREF( generator->m_frame->m_frame.f_exc_type ); generator->m_frame->m_frame.f_exc_value = thread_state->exc_value; Py_XINCREF( generator->m_frame->m_frame.f_exc_value ); generator->m_frame->m_frame.f_exc_traceback = thread_state->exc_traceback; Py_XINCREF( generator->m_frame->m_frame.f_exc_traceback ); #endif // Framed code: // Tried code: loop_start_1:; if ( generator->m_closure[0] == NULL ) { tmp_next_source_1 = NULL; } else { tmp_next_source_1 = PyCell_GET( generator->m_closure[0] ); } CHECK_OBJECT( tmp_next_source_1 ); tmp_assign_source_1 = ITERATOR_NEXT( tmp_next_source_1 ); if ( tmp_assign_source_1 == NULL ) { if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() ) { goto loop_end_1; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "No"; exception_lineno = 93; goto try_except_handler_2; } } { PyObject *old = tmp_iter_value_0; tmp_iter_value_0 = tmp_assign_source_1; Py_XDECREF( old ); } tmp_assign_source_2 = tmp_iter_value_0; CHECK_OBJECT( tmp_assign_source_2 ); { PyObject *old = var_path; var_path = tmp_assign_source_2; Py_INCREF( var_path ); Py_XDECREF( old ); } tmp_called_name_1 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_import_string ); if (unlikely( tmp_called_name_1 == NULL )) { tmp_called_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_import_string ); } if ( tmp_called_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "import_string" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 93; type_description_1 = "No"; goto try_except_handler_2; } tmp_args_element_name_1 = var_path; CHECK_OBJECT( tmp_args_element_name_1 ); generator->m_frame->m_frame.f_lineno = 93; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_expression_name_1 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } if ( tmp_expression_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 93; type_description_1 = "No"; goto try_except_handler_2; } tmp_unused = GENERATOR_YIELD( generator, tmp_expression_name_1 ); if ( tmp_unused == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 93; type_description_1 = "No"; goto try_except_handler_2; } if ( CONSIDER_THREADING() == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 93; type_description_1 = "No"; goto try_except_handler_2; } goto loop_start_1; loop_end_1:; goto try_end_1; // Exception handler code: try_except_handler_2:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_iter_value_0 ); tmp_iter_value_0 = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto frame_exception_exit_1; // End of try: try_end_1:; Nuitka_Frame_MarkAsNotExecuting( generator->m_frame ); #if PYTHON_VERSION >= 300 Py_CLEAR( generator->m_frame->m_frame.f_exc_type ); Py_CLEAR( generator->m_frame->m_frame.f_exc_value ); Py_CLEAR( generator->m_frame->m_frame.f_exc_traceback ); #endif // Allow re-use of the frame again. Py_DECREF( generator->m_frame ); goto frame_no_exception_1; frame_exception_exit_1:; // If it's not an exit exception, consider and create a traceback for it. if ( !EXCEPTION_MATCH_GENERATOR( exception_type ) ) { if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( generator->m_frame, exception_lineno ); } else if ( exception_tb->tb_frame != &generator->m_frame->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, generator->m_frame, exception_lineno ); } Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)generator->m_frame, type_description_1, NULL, var_path ); // Release cached frame. if ( generator->m_frame == cache_frame_generator ) { Py_DECREF( generator->m_frame ); } cache_frame_generator = NULL; assertFrameObject( generator->m_frame ); } #if PYTHON_VERSION >= 300 Py_CLEAR( generator->m_frame->m_frame.f_exc_type ); Py_CLEAR( generator->m_frame->m_frame.f_exc_value ); Py_CLEAR( generator->m_frame->m_frame.f_exc_traceback ); #endif Py_DECREF( generator->m_frame ); // Return the error. goto try_except_handler_1; frame_no_exception_1:; goto try_end_2; // Exception handler code: try_except_handler_1:; exception_keeper_type_2 = exception_type; exception_keeper_value_2 = exception_value; exception_keeper_tb_2 = exception_tb; exception_keeper_lineno_2 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( var_path ); var_path = NULL; // Re-raise. exception_type = exception_keeper_type_2; exception_value = exception_keeper_value_2; exception_tb = exception_keeper_tb_2; exception_lineno = exception_keeper_lineno_2; goto function_exception_exit; // End of try: try_end_2:; Py_XDECREF( tmp_iter_value_0 ); tmp_iter_value_0 = NULL; Py_XDECREF( var_path ); var_path = NULL; #if _NUITKA_EXPERIMENTAL_GENERATOR_GOTO return NULL; #else generator->m_yielded = NULL; return; #endif function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); #if _NUITKA_EXPERIMENTAL_GENERATOR_GOTO return NULL; #else generator->m_yielded = NULL; return; #endif } static PyObject *impl_django$template$engine$$$function_4_get_template_builtins( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *par_builtins = python_pars[ 1 ]; PyObject *outline_0_var_x = NULL; PyObject *tmp_listcontraction_1__$0 = NULL; PyObject *tmp_listcontraction_1__contraction = NULL; PyObject *tmp_listcontraction_1__iter_value_0 = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *exception_keeper_type_3; PyObject *exception_keeper_value_3; PyTracebackObject *exception_keeper_tb_3; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_3; PyObject *tmp_append_list_1; PyObject *tmp_append_value_1; PyObject *tmp_args_element_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_called_name_1; PyObject *tmp_iter_arg_1; PyObject *tmp_next_source_1; PyObject *tmp_outline_return_value_1; int tmp_res; PyObject *tmp_return_value; static struct Nuitka_FrameObject *cache_frame_7f55e29bf7c0019da15c9ccfd659a580_2 = NULL; struct Nuitka_FrameObject *frame_7f55e29bf7c0019da15c9ccfd659a580_2; static struct Nuitka_FrameObject *cache_frame_a51a90c72dc94d3272516ed6082aeb3d = NULL; struct Nuitka_FrameObject *frame_a51a90c72dc94d3272516ed6082aeb3d; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; NUITKA_MAY_BE_UNUSED char const *type_description_2 = NULL; tmp_return_value = NULL; tmp_outline_return_value_1 = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_a51a90c72dc94d3272516ed6082aeb3d, codeobj_a51a90c72dc94d3272516ed6082aeb3d, module_django$template$engine, sizeof(void *)+sizeof(void *) ); frame_a51a90c72dc94d3272516ed6082aeb3d = cache_frame_a51a90c72dc94d3272516ed6082aeb3d; // Push the new frame as the currently active one. pushFrameStack( frame_a51a90c72dc94d3272516ed6082aeb3d ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_a51a90c72dc94d3272516ed6082aeb3d ) == 2 ); // Frame stack // Framed code: // Tried code: tmp_iter_arg_1 = par_builtins; CHECK_OBJECT( tmp_iter_arg_1 ); tmp_assign_source_1 = MAKE_ITERATOR( tmp_iter_arg_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 96; type_description_1 = "oo"; goto try_except_handler_2; } assert( tmp_listcontraction_1__$0 == NULL ); tmp_listcontraction_1__$0 = tmp_assign_source_1; tmp_assign_source_2 = PyList_New( 0 ); assert( tmp_listcontraction_1__contraction == NULL ); tmp_listcontraction_1__contraction = tmp_assign_source_2; MAKE_OR_REUSE_FRAME( cache_frame_7f55e29bf7c0019da15c9ccfd659a580_2, codeobj_7f55e29bf7c0019da15c9ccfd659a580, module_django$template$engine, sizeof(void *)+sizeof(void *) ); frame_7f55e29bf7c0019da15c9ccfd659a580_2 = cache_frame_7f55e29bf7c0019da15c9ccfd659a580_2; // Push the new frame as the currently active one. pushFrameStack( frame_7f55e29bf7c0019da15c9ccfd659a580_2 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_7f55e29bf7c0019da15c9ccfd659a580_2 ) == 2 ); // Frame stack // Framed code: // Tried code: loop_start_1:; tmp_next_source_1 = tmp_listcontraction_1__$0; CHECK_OBJECT( tmp_next_source_1 ); tmp_assign_source_3 = ITERATOR_NEXT( tmp_next_source_1 ); if ( tmp_assign_source_3 == NULL ) { if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() ) { goto loop_end_1; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_2 = "oo"; exception_lineno = 96; goto try_except_handler_3; } } { PyObject *old = tmp_listcontraction_1__iter_value_0; tmp_listcontraction_1__iter_value_0 = tmp_assign_source_3; Py_XDECREF( old ); } tmp_assign_source_4 = tmp_listcontraction_1__iter_value_0; CHECK_OBJECT( tmp_assign_source_4 ); { PyObject *old = outline_0_var_x; outline_0_var_x = tmp_assign_source_4; Py_INCREF( outline_0_var_x ); Py_XDECREF( old ); } tmp_append_list_1 = tmp_listcontraction_1__contraction; CHECK_OBJECT( tmp_append_list_1 ); tmp_called_name_1 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_import_library ); if (unlikely( tmp_called_name_1 == NULL )) { tmp_called_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_import_library ); } if ( tmp_called_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "import_library" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 96; type_description_2 = "oo"; goto try_except_handler_3; } tmp_args_element_name_1 = outline_0_var_x; CHECK_OBJECT( tmp_args_element_name_1 ); frame_7f55e29bf7c0019da15c9ccfd659a580_2->m_frame.f_lineno = 96; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_append_value_1 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } if ( tmp_append_value_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 96; type_description_2 = "oo"; goto try_except_handler_3; } assert( PyList_Check( tmp_append_list_1 ) ); tmp_res = PyList_Append( tmp_append_list_1, tmp_append_value_1 ); Py_DECREF( tmp_append_value_1 ); if ( tmp_res == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 96; type_description_2 = "oo"; goto try_except_handler_3; } if ( CONSIDER_THREADING() == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 96; type_description_2 = "oo"; goto try_except_handler_3; } goto loop_start_1; loop_end_1:; tmp_outline_return_value_1 = tmp_listcontraction_1__contraction; CHECK_OBJECT( tmp_outline_return_value_1 ); Py_INCREF( tmp_outline_return_value_1 ); goto try_return_handler_3; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_4_get_template_builtins ); return NULL; // Return handler code: try_return_handler_3:; Py_XDECREF( tmp_listcontraction_1__$0 ); tmp_listcontraction_1__$0 = NULL; Py_XDECREF( tmp_listcontraction_1__contraction ); tmp_listcontraction_1__contraction = NULL; Py_XDECREF( tmp_listcontraction_1__iter_value_0 ); tmp_listcontraction_1__iter_value_0 = NULL; goto frame_return_exit_2; // Exception handler code: try_except_handler_3:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_listcontraction_1__$0 ); tmp_listcontraction_1__$0 = NULL; Py_XDECREF( tmp_listcontraction_1__contraction ); tmp_listcontraction_1__contraction = NULL; Py_XDECREF( tmp_listcontraction_1__iter_value_0 ); tmp_listcontraction_1__iter_value_0 = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto frame_exception_exit_2; // End of try: #if 0 RESTORE_FRAME_EXCEPTION( frame_7f55e29bf7c0019da15c9ccfd659a580_2 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_2:; #if 0 RESTORE_FRAME_EXCEPTION( frame_7f55e29bf7c0019da15c9ccfd659a580_2 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_2; frame_exception_exit_2:; #if 0 RESTORE_FRAME_EXCEPTION( frame_7f55e29bf7c0019da15c9ccfd659a580_2 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_7f55e29bf7c0019da15c9ccfd659a580_2, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_7f55e29bf7c0019da15c9ccfd659a580_2->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_7f55e29bf7c0019da15c9ccfd659a580_2, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_7f55e29bf7c0019da15c9ccfd659a580_2, type_description_2, outline_0_var_x, par_builtins ); // Release cached frame. if ( frame_7f55e29bf7c0019da15c9ccfd659a580_2 == cache_frame_7f55e29bf7c0019da15c9ccfd659a580_2 ) { Py_DECREF( frame_7f55e29bf7c0019da15c9ccfd659a580_2 ); } cache_frame_7f55e29bf7c0019da15c9ccfd659a580_2 = NULL; assertFrameObject( frame_7f55e29bf7c0019da15c9ccfd659a580_2 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto nested_frame_exit_1; frame_no_exception_1:; goto skip_nested_handling_1; nested_frame_exit_1:; type_description_1 = "oo"; goto try_except_handler_2; skip_nested_handling_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_4_get_template_builtins ); return NULL; // Return handler code: try_return_handler_2:; Py_XDECREF( outline_0_var_x ); outline_0_var_x = NULL; goto outline_result_1; // Exception handler code: try_except_handler_2:; exception_keeper_type_2 = exception_type; exception_keeper_value_2 = exception_value; exception_keeper_tb_2 = exception_tb; exception_keeper_lineno_2 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( outline_0_var_x ); outline_0_var_x = NULL; // Re-raise. exception_type = exception_keeper_type_2; exception_value = exception_keeper_value_2; exception_tb = exception_keeper_tb_2; exception_lineno = exception_keeper_lineno_2; goto outline_exception_1; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_4_get_template_builtins ); return NULL; outline_exception_1:; exception_lineno = 96; goto frame_exception_exit_1; outline_result_1:; tmp_return_value = tmp_outline_return_value_1; goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_a51a90c72dc94d3272516ed6082aeb3d ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_2; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_a51a90c72dc94d3272516ed6082aeb3d ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_a51a90c72dc94d3272516ed6082aeb3d ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_a51a90c72dc94d3272516ed6082aeb3d, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_a51a90c72dc94d3272516ed6082aeb3d->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_a51a90c72dc94d3272516ed6082aeb3d, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_a51a90c72dc94d3272516ed6082aeb3d, type_description_1, par_self, par_builtins ); // Release cached frame. if ( frame_a51a90c72dc94d3272516ed6082aeb3d == cache_frame_a51a90c72dc94d3272516ed6082aeb3d ) { Py_DECREF( frame_a51a90c72dc94d3272516ed6082aeb3d ); } cache_frame_a51a90c72dc94d3272516ed6082aeb3d = NULL; assertFrameObject( frame_a51a90c72dc94d3272516ed6082aeb3d ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_2:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_4_get_template_builtins ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_builtins ); par_builtins = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_3 = exception_type; exception_keeper_value_3 = exception_value; exception_keeper_tb_3 = exception_tb; exception_keeper_lineno_3 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_builtins ); par_builtins = NULL; // Re-raise. exception_type = exception_keeper_type_3; exception_value = exception_keeper_value_3; exception_tb = exception_keeper_tb_3; exception_lineno = exception_keeper_lineno_3; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_4_get_template_builtins ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_django$template$engine$$$function_5_get_template_libraries( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *par_libraries = python_pars[ 1 ]; PyObject *var_loaded = NULL; PyObject *var_name = NULL; PyObject *var_path = NULL; PyObject *tmp_for_loop_1__for_iterator = NULL; PyObject *tmp_for_loop_1__iter_value = NULL; PyObject *tmp_tuple_unpack_1__element_1 = NULL; PyObject *tmp_tuple_unpack_1__element_2 = NULL; PyObject *tmp_tuple_unpack_1__source_iter = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *exception_keeper_type_3; PyObject *exception_keeper_value_3; PyTracebackObject *exception_keeper_tb_3; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_3; PyObject *exception_keeper_type_4; PyObject *exception_keeper_value_4; PyTracebackObject *exception_keeper_tb_4; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_4; PyObject *tmp_args_element_name_1; PyObject *tmp_ass_subscribed_1; PyObject *tmp_ass_subscript_1; PyObject *tmp_ass_subvalue_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_assign_source_6; PyObject *tmp_assign_source_7; PyObject *tmp_assign_source_8; PyObject *tmp_called_instance_1; PyObject *tmp_called_name_1; PyObject *tmp_iter_arg_1; PyObject *tmp_iter_arg_2; PyObject *tmp_iterator_attempt; PyObject *tmp_iterator_name_1; PyObject *tmp_next_source_1; bool tmp_result; PyObject *tmp_return_value; PyObject *tmp_unpack_1; PyObject *tmp_unpack_2; static struct Nuitka_FrameObject *cache_frame_6da1160b8383805c096d5812518aab68 = NULL; struct Nuitka_FrameObject *frame_6da1160b8383805c096d5812518aab68; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. tmp_assign_source_1 = PyDict_New(); assert( var_loaded == NULL ); var_loaded = tmp_assign_source_1; // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_6da1160b8383805c096d5812518aab68, codeobj_6da1160b8383805c096d5812518aab68, module_django$template$engine, sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_6da1160b8383805c096d5812518aab68 = cache_frame_6da1160b8383805c096d5812518aab68; // Push the new frame as the currently active one. pushFrameStack( frame_6da1160b8383805c096d5812518aab68 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_6da1160b8383805c096d5812518aab68 ) == 2 ); // Frame stack // Framed code: tmp_called_instance_1 = par_libraries; CHECK_OBJECT( tmp_called_instance_1 ); frame_6da1160b8383805c096d5812518aab68->m_frame.f_lineno = 100; tmp_iter_arg_1 = CALL_METHOD_NO_ARGS( tmp_called_instance_1, const_str_plain_items ); if ( tmp_iter_arg_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 100; type_description_1 = "ooooo"; goto frame_exception_exit_1; } tmp_assign_source_2 = MAKE_ITERATOR( tmp_iter_arg_1 ); Py_DECREF( tmp_iter_arg_1 ); if ( tmp_assign_source_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 100; type_description_1 = "ooooo"; goto frame_exception_exit_1; } assert( tmp_for_loop_1__for_iterator == NULL ); tmp_for_loop_1__for_iterator = tmp_assign_source_2; // Tried code: loop_start_1:; tmp_next_source_1 = tmp_for_loop_1__for_iterator; CHECK_OBJECT( tmp_next_source_1 ); tmp_assign_source_3 = ITERATOR_NEXT( tmp_next_source_1 ); if ( tmp_assign_source_3 == NULL ) { if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() ) { goto loop_end_1; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooooo"; exception_lineno = 100; goto try_except_handler_2; } } { PyObject *old = tmp_for_loop_1__iter_value; tmp_for_loop_1__iter_value = tmp_assign_source_3; Py_XDECREF( old ); } // Tried code: tmp_iter_arg_2 = tmp_for_loop_1__iter_value; CHECK_OBJECT( tmp_iter_arg_2 ); tmp_assign_source_4 = MAKE_ITERATOR( tmp_iter_arg_2 ); if ( tmp_assign_source_4 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 100; type_description_1 = "ooooo"; goto try_except_handler_3; } { PyObject *old = tmp_tuple_unpack_1__source_iter; tmp_tuple_unpack_1__source_iter = tmp_assign_source_4; Py_XDECREF( old ); } // Tried code: tmp_unpack_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_1 ); tmp_assign_source_5 = UNPACK_NEXT( tmp_unpack_1, 0, 2 ); if ( tmp_assign_source_5 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "ooooo"; exception_lineno = 100; goto try_except_handler_4; } { PyObject *old = tmp_tuple_unpack_1__element_1; tmp_tuple_unpack_1__element_1 = tmp_assign_source_5; Py_XDECREF( old ); } tmp_unpack_2 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_2 ); tmp_assign_source_6 = UNPACK_NEXT( tmp_unpack_2, 1, 2 ); if ( tmp_assign_source_6 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "ooooo"; exception_lineno = 100; goto try_except_handler_4; } { PyObject *old = tmp_tuple_unpack_1__element_2; tmp_tuple_unpack_1__element_2 = tmp_assign_source_6; Py_XDECREF( old ); } tmp_iterator_name_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_iterator_name_1 ); // Check if iterator has left-over elements. CHECK_OBJECT( tmp_iterator_name_1 ); assert( HAS_ITERNEXT( tmp_iterator_name_1 ) ); tmp_iterator_attempt = (*Py_TYPE( tmp_iterator_name_1 )->tp_iternext)( tmp_iterator_name_1 ); if (likely( tmp_iterator_attempt == NULL )) { PyObject *error = GET_ERROR_OCCURRED(); if ( error != NULL ) { if ( EXCEPTION_MATCH_BOOL_SINGLE( error, PyExc_StopIteration )) { CLEAR_ERROR_OCCURRED(); } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooooo"; exception_lineno = 100; goto try_except_handler_4; } } } else { Py_DECREF( tmp_iterator_attempt ); // TODO: Could avoid PyErr_Format. #if PYTHON_VERSION < 300 PyErr_Format( PyExc_ValueError, "too many values to unpack" ); #else PyErr_Format( PyExc_ValueError, "too many values to unpack (expected 2)" ); #endif FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooooo"; exception_lineno = 100; goto try_except_handler_4; } goto try_end_1; // Exception handler code: try_except_handler_4:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_tuple_unpack_1__source_iter ); tmp_tuple_unpack_1__source_iter = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto try_except_handler_3; // End of try: try_end_1:; goto try_end_2; // Exception handler code: try_except_handler_3:; exception_keeper_type_2 = exception_type; exception_keeper_value_2 = exception_value; exception_keeper_tb_2 = exception_tb; exception_keeper_lineno_2 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; // Re-raise. exception_type = exception_keeper_type_2; exception_value = exception_keeper_value_2; exception_tb = exception_keeper_tb_2; exception_lineno = exception_keeper_lineno_2; goto try_except_handler_2; // End of try: try_end_2:; Py_XDECREF( tmp_tuple_unpack_1__source_iter ); tmp_tuple_unpack_1__source_iter = NULL; tmp_assign_source_7 = tmp_tuple_unpack_1__element_1; CHECK_OBJECT( tmp_assign_source_7 ); { PyObject *old = var_name; var_name = tmp_assign_source_7; Py_INCREF( var_name ); Py_XDECREF( old ); } Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; tmp_assign_source_8 = tmp_tuple_unpack_1__element_2; CHECK_OBJECT( tmp_assign_source_8 ); { PyObject *old = var_path; var_path = tmp_assign_source_8; Py_INCREF( var_path ); Py_XDECREF( old ); } Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_1 ); tmp_tuple_unpack_1__element_1 = NULL; Py_XDECREF( tmp_tuple_unpack_1__element_2 ); tmp_tuple_unpack_1__element_2 = NULL; tmp_called_name_1 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_import_library ); if (unlikely( tmp_called_name_1 == NULL )) { tmp_called_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_import_library ); } if ( tmp_called_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "import_library" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 101; type_description_1 = "ooooo"; goto try_except_handler_2; } tmp_args_element_name_1 = var_path; if ( tmp_args_element_name_1 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "path" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 101; type_description_1 = "ooooo"; goto try_except_handler_2; } frame_6da1160b8383805c096d5812518aab68->m_frame.f_lineno = 101; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_ass_subvalue_1 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } if ( tmp_ass_subvalue_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 101; type_description_1 = "ooooo"; goto try_except_handler_2; } tmp_ass_subscribed_1 = var_loaded; if ( tmp_ass_subscribed_1 == NULL ) { Py_DECREF( tmp_ass_subvalue_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loaded" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 101; type_description_1 = "ooooo"; goto try_except_handler_2; } tmp_ass_subscript_1 = var_name; if ( tmp_ass_subscript_1 == NULL ) { Py_DECREF( tmp_ass_subvalue_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "name" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 101; type_description_1 = "ooooo"; goto try_except_handler_2; } tmp_result = SET_SUBSCRIPT( tmp_ass_subscribed_1, tmp_ass_subscript_1, tmp_ass_subvalue_1 ); Py_DECREF( tmp_ass_subvalue_1 ); if ( tmp_result == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 101; type_description_1 = "ooooo"; goto try_except_handler_2; } if ( CONSIDER_THREADING() == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 100; type_description_1 = "ooooo"; goto try_except_handler_2; } goto loop_start_1; loop_end_1:; goto try_end_3; // Exception handler code: try_except_handler_2:; exception_keeper_type_3 = exception_type; exception_keeper_value_3 = exception_value; exception_keeper_tb_3 = exception_tb; exception_keeper_lineno_3 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_for_loop_1__iter_value ); tmp_for_loop_1__iter_value = NULL; Py_XDECREF( tmp_for_loop_1__for_iterator ); tmp_for_loop_1__for_iterator = NULL; // Re-raise. exception_type = exception_keeper_type_3; exception_value = exception_keeper_value_3; exception_tb = exception_keeper_tb_3; exception_lineno = exception_keeper_lineno_3; goto frame_exception_exit_1; // End of try: try_end_3:; Py_XDECREF( tmp_for_loop_1__iter_value ); tmp_for_loop_1__iter_value = NULL; Py_XDECREF( tmp_for_loop_1__for_iterator ); tmp_for_loop_1__for_iterator = NULL; tmp_return_value = var_loaded; if ( tmp_return_value == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loaded" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 102; type_description_1 = "ooooo"; goto frame_exception_exit_1; } Py_INCREF( tmp_return_value ); goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_6da1160b8383805c096d5812518aab68 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_6da1160b8383805c096d5812518aab68 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_6da1160b8383805c096d5812518aab68 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_6da1160b8383805c096d5812518aab68, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_6da1160b8383805c096d5812518aab68->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_6da1160b8383805c096d5812518aab68, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_6da1160b8383805c096d5812518aab68, type_description_1, par_self, par_libraries, var_loaded, var_name, var_path ); // Release cached frame. if ( frame_6da1160b8383805c096d5812518aab68 == cache_frame_6da1160b8383805c096d5812518aab68 ) { Py_DECREF( frame_6da1160b8383805c096d5812518aab68 ); } cache_frame_6da1160b8383805c096d5812518aab68 = NULL; assertFrameObject( frame_6da1160b8383805c096d5812518aab68 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_5_get_template_libraries ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_libraries ); par_libraries = NULL; Py_XDECREF( var_loaded ); var_loaded = NULL; Py_XDECREF( var_name ); var_name = NULL; Py_XDECREF( var_path ); var_path = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_4 = exception_type; exception_keeper_value_4 = exception_value; exception_keeper_tb_4 = exception_tb; exception_keeper_lineno_4 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_libraries ); par_libraries = NULL; Py_XDECREF( var_loaded ); var_loaded = NULL; Py_XDECREF( var_name ); var_name = NULL; Py_XDECREF( var_path ); var_path = NULL; // Re-raise. exception_type = exception_keeper_type_4; exception_value = exception_keeper_value_4; exception_tb = exception_keeper_tb_4; exception_lineno = exception_keeper_lineno_4; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_5_get_template_libraries ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_django$template$engine$$$function_6_template_loaders( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_element_name_1; PyObject *tmp_called_name_1; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; static struct Nuitka_FrameObject *cache_frame_735439d854f01fd329f628fe293226f2 = NULL; struct Nuitka_FrameObject *frame_735439d854f01fd329f628fe293226f2; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_735439d854f01fd329f628fe293226f2, codeobj_735439d854f01fd329f628fe293226f2, module_django$template$engine, sizeof(void *) ); frame_735439d854f01fd329f628fe293226f2 = cache_frame_735439d854f01fd329f628fe293226f2; // Push the new frame as the currently active one. pushFrameStack( frame_735439d854f01fd329f628fe293226f2 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_735439d854f01fd329f628fe293226f2 ) == 2 ); // Frame stack // Framed code: tmp_source_name_1 = par_self; CHECK_OBJECT( tmp_source_name_1 ); tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_get_template_loaders ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 106; type_description_1 = "o"; goto frame_exception_exit_1; } tmp_source_name_2 = par_self; if ( tmp_source_name_2 == NULL ) { Py_DECREF( tmp_called_name_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 106; type_description_1 = "o"; goto frame_exception_exit_1; } tmp_args_element_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_loaders ); if ( tmp_args_element_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_1 ); exception_lineno = 106; type_description_1 = "o"; goto frame_exception_exit_1; } frame_735439d854f01fd329f628fe293226f2->m_frame.f_lineno = 106; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_return_value = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_element_name_1 ); if ( tmp_return_value == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 106; type_description_1 = "o"; goto frame_exception_exit_1; } goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_735439d854f01fd329f628fe293226f2 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_735439d854f01fd329f628fe293226f2 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_735439d854f01fd329f628fe293226f2 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_735439d854f01fd329f628fe293226f2, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_735439d854f01fd329f628fe293226f2->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_735439d854f01fd329f628fe293226f2, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_735439d854f01fd329f628fe293226f2, type_description_1, par_self ); // Release cached frame. if ( frame_735439d854f01fd329f628fe293226f2 == cache_frame_735439d854f01fd329f628fe293226f2 ) { Py_DECREF( frame_735439d854f01fd329f628fe293226f2 ); } cache_frame_735439d854f01fd329f628fe293226f2 = NULL; assertFrameObject( frame_735439d854f01fd329f628fe293226f2 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_6_template_loaders ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_self ); par_self = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_self ); par_self = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_6_template_loaders ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_django$template$engine$$$function_7_get_template_loaders( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *par_template_loaders = python_pars[ 1 ]; PyObject *var_loaders = NULL; PyObject *var_template_loader = NULL; PyObject *var_loader = NULL; PyObject *tmp_for_loop_1__for_iterator = NULL; PyObject *tmp_for_loop_1__iter_value = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *tmp_args_element_name_1; PyObject *tmp_args_element_name_2; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_called_name_1; PyObject *tmp_called_name_2; PyObject *tmp_compare_left_1; PyObject *tmp_compare_right_1; bool tmp_isnot_1; PyObject *tmp_iter_arg_1; PyObject *tmp_next_source_1; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; static struct Nuitka_FrameObject *cache_frame_926f065148014bc71abcbd66bbac4e04 = NULL; struct Nuitka_FrameObject *frame_926f065148014bc71abcbd66bbac4e04; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. tmp_assign_source_1 = PyList_New( 0 ); assert( var_loaders == NULL ); var_loaders = tmp_assign_source_1; // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_926f065148014bc71abcbd66bbac4e04, codeobj_926f065148014bc71abcbd66bbac4e04, module_django$template$engine, sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_926f065148014bc71abcbd66bbac4e04 = cache_frame_926f065148014bc71abcbd66bbac4e04; // Push the new frame as the currently active one. pushFrameStack( frame_926f065148014bc71abcbd66bbac4e04 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_926f065148014bc71abcbd66bbac4e04 ) == 2 ); // Frame stack // Framed code: tmp_iter_arg_1 = par_template_loaders; CHECK_OBJECT( tmp_iter_arg_1 ); tmp_assign_source_2 = MAKE_ITERATOR( tmp_iter_arg_1 ); if ( tmp_assign_source_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 110; type_description_1 = "ooooo"; goto frame_exception_exit_1; } assert( tmp_for_loop_1__for_iterator == NULL ); tmp_for_loop_1__for_iterator = tmp_assign_source_2; // Tried code: loop_start_1:; tmp_next_source_1 = tmp_for_loop_1__for_iterator; CHECK_OBJECT( tmp_next_source_1 ); tmp_assign_source_3 = ITERATOR_NEXT( tmp_next_source_1 ); if ( tmp_assign_source_3 == NULL ) { if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() ) { goto loop_end_1; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "ooooo"; exception_lineno = 110; goto try_except_handler_2; } } { PyObject *old = tmp_for_loop_1__iter_value; tmp_for_loop_1__iter_value = tmp_assign_source_3; Py_XDECREF( old ); } tmp_assign_source_4 = tmp_for_loop_1__iter_value; CHECK_OBJECT( tmp_assign_source_4 ); { PyObject *old = var_template_loader; var_template_loader = tmp_assign_source_4; Py_INCREF( var_template_loader ); Py_XDECREF( old ); } tmp_source_name_1 = par_self; if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 111; type_description_1 = "ooooo"; goto try_except_handler_2; } tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_find_template_loader ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 111; type_description_1 = "ooooo"; goto try_except_handler_2; } tmp_args_element_name_1 = var_template_loader; if ( tmp_args_element_name_1 == NULL ) { Py_DECREF( tmp_called_name_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "template_loader" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 111; type_description_1 = "ooooo"; goto try_except_handler_2; } frame_926f065148014bc71abcbd66bbac4e04->m_frame.f_lineno = 111; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_assign_source_5 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } Py_DECREF( tmp_called_name_1 ); if ( tmp_assign_source_5 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 111; type_description_1 = "ooooo"; goto try_except_handler_2; } { PyObject *old = var_loader; var_loader = tmp_assign_source_5; Py_XDECREF( old ); } tmp_compare_left_1 = var_loader; CHECK_OBJECT( tmp_compare_left_1 ); tmp_compare_right_1 = Py_None; tmp_isnot_1 = ( tmp_compare_left_1 != tmp_compare_right_1 ); if ( tmp_isnot_1 ) { goto branch_yes_1; } else { goto branch_no_1; } branch_yes_1:; tmp_source_name_2 = var_loaders; if ( tmp_source_name_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loaders" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 113; type_description_1 = "ooooo"; goto try_except_handler_2; } tmp_called_name_2 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_append ); if ( tmp_called_name_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 113; type_description_1 = "ooooo"; goto try_except_handler_2; } tmp_args_element_name_2 = var_loader; if ( tmp_args_element_name_2 == NULL ) { Py_DECREF( tmp_called_name_2 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loader" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 113; type_description_1 = "ooooo"; goto try_except_handler_2; } frame_926f065148014bc71abcbd66bbac4e04->m_frame.f_lineno = 113; { PyObject *call_args[] = { tmp_args_element_name_2 }; tmp_unused = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_2, call_args ); } Py_DECREF( tmp_called_name_2 ); if ( tmp_unused == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 113; type_description_1 = "ooooo"; goto try_except_handler_2; } Py_DECREF( tmp_unused ); branch_no_1:; if ( CONSIDER_THREADING() == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 110; type_description_1 = "ooooo"; goto try_except_handler_2; } goto loop_start_1; loop_end_1:; goto try_end_1; // Exception handler code: try_except_handler_2:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_for_loop_1__iter_value ); tmp_for_loop_1__iter_value = NULL; Py_XDECREF( tmp_for_loop_1__for_iterator ); tmp_for_loop_1__for_iterator = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto frame_exception_exit_1; // End of try: try_end_1:; Py_XDECREF( tmp_for_loop_1__iter_value ); tmp_for_loop_1__iter_value = NULL; Py_XDECREF( tmp_for_loop_1__for_iterator ); tmp_for_loop_1__for_iterator = NULL; tmp_return_value = var_loaders; if ( tmp_return_value == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loaders" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 114; type_description_1 = "ooooo"; goto frame_exception_exit_1; } Py_INCREF( tmp_return_value ); goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_926f065148014bc71abcbd66bbac4e04 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_926f065148014bc71abcbd66bbac4e04 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_926f065148014bc71abcbd66bbac4e04 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_926f065148014bc71abcbd66bbac4e04, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_926f065148014bc71abcbd66bbac4e04->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_926f065148014bc71abcbd66bbac4e04, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_926f065148014bc71abcbd66bbac4e04, type_description_1, par_self, par_template_loaders, var_loaders, var_template_loader, var_loader ); // Release cached frame. if ( frame_926f065148014bc71abcbd66bbac4e04 == cache_frame_926f065148014bc71abcbd66bbac4e04 ) { Py_DECREF( frame_926f065148014bc71abcbd66bbac4e04 ); } cache_frame_926f065148014bc71abcbd66bbac4e04 = NULL; assertFrameObject( frame_926f065148014bc71abcbd66bbac4e04 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_7_get_template_loaders ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_template_loaders ); par_template_loaders = NULL; Py_XDECREF( var_loaders ); var_loaders = NULL; Py_XDECREF( var_template_loader ); var_template_loader = NULL; Py_XDECREF( var_loader ); var_loader = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_2 = exception_type; exception_keeper_value_2 = exception_value; exception_keeper_tb_2 = exception_tb; exception_keeper_lineno_2 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_template_loaders ); par_template_loaders = NULL; Py_XDECREF( var_loaders ); var_loaders = NULL; Py_XDECREF( var_template_loader ); var_template_loader = NULL; Py_XDECREF( var_loader ); var_loader = NULL; // Re-raise. exception_type = exception_keeper_type_2; exception_value = exception_keeper_value_2; exception_tb = exception_keeper_tb_2; exception_lineno = exception_keeper_lineno_2; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_7_get_template_loaders ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_django$template$engine$$$function_8_find_template_loader( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *par_loader = python_pars[ 1 ]; PyObject *var_args = NULL; PyObject *var_loader_class = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_element_name_1; PyObject *tmp_args_element_name_2; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_called_name_1; PyObject *tmp_called_name_2; PyObject *tmp_dircall_arg1_1; PyObject *tmp_dircall_arg2_1; PyObject *tmp_dircall_arg3_1; PyObject *tmp_isinstance_cls_1; PyObject *tmp_isinstance_cls_2; PyObject *tmp_isinstance_inst_1; PyObject *tmp_isinstance_inst_2; PyObject *tmp_left_name_1; PyObject *tmp_list_arg_1; PyObject *tmp_raise_type_1; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_right_name_1; PyObject *tmp_source_name_1; PyObject *tmp_subscribed_name_1; PyObject *tmp_subscribed_name_2; PyObject *tmp_subscript_name_1; PyObject *tmp_subscript_name_2; PyObject *tmp_tuple_element_1; static struct Nuitka_FrameObject *cache_frame_41daf0feae544bbc9081c221068ff4cd = NULL; struct Nuitka_FrameObject *frame_41daf0feae544bbc9081c221068ff4cd; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_41daf0feae544bbc9081c221068ff4cd, codeobj_41daf0feae544bbc9081c221068ff4cd, module_django$template$engine, sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_41daf0feae544bbc9081c221068ff4cd = cache_frame_41daf0feae544bbc9081c221068ff4cd; // Push the new frame as the currently active one. pushFrameStack( frame_41daf0feae544bbc9081c221068ff4cd ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_41daf0feae544bbc9081c221068ff4cd ) == 2 ); // Frame stack // Framed code: tmp_isinstance_inst_1 = par_loader; CHECK_OBJECT( tmp_isinstance_inst_1 ); tmp_isinstance_cls_1 = const_tuple_type_tuple_type_list_tuple; tmp_res = Nuitka_IsInstance( tmp_isinstance_inst_1, tmp_isinstance_cls_1 ); if ( tmp_res == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 117; type_description_1 = "oooo"; goto frame_exception_exit_1; } if ( tmp_res == 1 ) { goto branch_yes_1; } else { goto branch_no_1; } branch_yes_1:; tmp_subscribed_name_1 = par_loader; CHECK_OBJECT( tmp_subscribed_name_1 ); tmp_subscript_name_1 = const_slice_int_pos_1_none_none; tmp_list_arg_1 = LOOKUP_SUBSCRIPT( tmp_subscribed_name_1, tmp_subscript_name_1 ); if ( tmp_list_arg_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 118; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_assign_source_1 = PySequence_List( tmp_list_arg_1 ); Py_DECREF( tmp_list_arg_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 118; type_description_1 = "oooo"; goto frame_exception_exit_1; } assert( var_args == NULL ); var_args = tmp_assign_source_1; tmp_subscribed_name_2 = par_loader; if ( tmp_subscribed_name_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loader" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 119; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_subscript_name_2 = const_int_0; tmp_assign_source_2 = LOOKUP_SUBSCRIPT( tmp_subscribed_name_2, tmp_subscript_name_2 ); if ( tmp_assign_source_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 119; type_description_1 = "oooo"; goto frame_exception_exit_1; } { PyObject *old = par_loader; par_loader = tmp_assign_source_2; Py_XDECREF( old ); } goto branch_end_1; branch_no_1:; tmp_assign_source_3 = PyList_New( 0 ); assert( var_args == NULL ); var_args = tmp_assign_source_3; branch_end_1:; tmp_isinstance_inst_2 = par_loader; CHECK_OBJECT( tmp_isinstance_inst_2 ); tmp_source_name_1 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_six ); if (unlikely( tmp_source_name_1 == NULL )) { tmp_source_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_six ); } if ( tmp_source_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "six" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 123; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_isinstance_cls_2 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_string_types ); if ( tmp_isinstance_cls_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 123; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_res = Nuitka_IsInstance( tmp_isinstance_inst_2, tmp_isinstance_cls_2 ); Py_DECREF( tmp_isinstance_cls_2 ); if ( tmp_res == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 123; type_description_1 = "oooo"; goto frame_exception_exit_1; } if ( tmp_res == 1 ) { goto branch_yes_2; } else { goto branch_no_2; } branch_yes_2:; tmp_called_name_1 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_import_string ); if (unlikely( tmp_called_name_1 == NULL )) { tmp_called_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_import_string ); } if ( tmp_called_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "import_string" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 124; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_args_element_name_1 = par_loader; if ( tmp_args_element_name_1 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loader" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 124; type_description_1 = "oooo"; goto frame_exception_exit_1; } frame_41daf0feae544bbc9081c221068ff4cd->m_frame.f_lineno = 124; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_assign_source_4 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } if ( tmp_assign_source_4 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 124; type_description_1 = "oooo"; goto frame_exception_exit_1; } assert( var_loader_class == NULL ); var_loader_class = tmp_assign_source_4; tmp_dircall_arg1_1 = var_loader_class; CHECK_OBJECT( tmp_dircall_arg1_1 ); tmp_dircall_arg2_1 = PyTuple_New( 1 ); tmp_tuple_element_1 = par_self; if ( tmp_tuple_element_1 == NULL ) { Py_DECREF( tmp_dircall_arg2_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "self" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 125; type_description_1 = "oooo"; goto frame_exception_exit_1; } Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_dircall_arg2_1, 0, tmp_tuple_element_1 ); tmp_dircall_arg3_1 = var_args; if ( tmp_dircall_arg3_1 == NULL ) { Py_DECREF( tmp_dircall_arg2_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "args" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 125; type_description_1 = "oooo"; goto frame_exception_exit_1; } Py_INCREF( tmp_dircall_arg1_1 ); Py_INCREF( tmp_dircall_arg3_1 ); { PyObject *dir_call_args[] = {tmp_dircall_arg1_1, tmp_dircall_arg2_1, tmp_dircall_arg3_1}; tmp_return_value = impl___internal__$$$function_12_complex_call_helper_pos_star_list( dir_call_args ); } if ( tmp_return_value == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 125; type_description_1 = "oooo"; goto frame_exception_exit_1; } goto frame_return_exit_1; goto branch_end_2; branch_no_2:; tmp_called_name_2 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_ImproperlyConfigured ); if (unlikely( tmp_called_name_2 == NULL )) { tmp_called_name_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_ImproperlyConfigured ); } if ( tmp_called_name_2 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "ImproperlyConfigured" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 127; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_left_name_1 = const_str_digest_38cf09af3cd8f72f2d3014c7c2befe3c; tmp_right_name_1 = par_loader; if ( tmp_right_name_1 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loader" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 128; type_description_1 = "oooo"; goto frame_exception_exit_1; } tmp_args_element_name_2 = BINARY_OPERATION_REMAINDER( tmp_left_name_1, tmp_right_name_1 ); if ( tmp_args_element_name_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 128; type_description_1 = "oooo"; goto frame_exception_exit_1; } frame_41daf0feae544bbc9081c221068ff4cd->m_frame.f_lineno = 127; { PyObject *call_args[] = { tmp_args_element_name_2 }; tmp_raise_type_1 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_2, call_args ); } Py_DECREF( tmp_args_element_name_2 ); if ( tmp_raise_type_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 127; type_description_1 = "oooo"; goto frame_exception_exit_1; } exception_type = tmp_raise_type_1; exception_lineno = 127; RAISE_EXCEPTION_WITH_TYPE( &exception_type, &exception_value, &exception_tb ); type_description_1 = "oooo"; goto frame_exception_exit_1; branch_end_2:; #if 0 RESTORE_FRAME_EXCEPTION( frame_41daf0feae544bbc9081c221068ff4cd ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_41daf0feae544bbc9081c221068ff4cd ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_41daf0feae544bbc9081c221068ff4cd ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_41daf0feae544bbc9081c221068ff4cd, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_41daf0feae544bbc9081c221068ff4cd->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_41daf0feae544bbc9081c221068ff4cd, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_41daf0feae544bbc9081c221068ff4cd, type_description_1, par_self, par_loader, var_args, var_loader_class ); // Release cached frame. if ( frame_41daf0feae544bbc9081c221068ff4cd == cache_frame_41daf0feae544bbc9081c221068ff4cd ) { Py_DECREF( frame_41daf0feae544bbc9081c221068ff4cd ); } cache_frame_41daf0feae544bbc9081c221068ff4cd = NULL; assertFrameObject( frame_41daf0feae544bbc9081c221068ff4cd ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_8_find_template_loader ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_loader ); par_loader = NULL; Py_XDECREF( var_args ); var_args = NULL; Py_XDECREF( var_loader_class ); var_loader_class = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_loader ); par_loader = NULL; Py_XDECREF( var_args ); var_args = NULL; Py_XDECREF( var_loader_class ); var_loader_class = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_8_find_template_loader ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_django$template$engine$$$function_9_find_template( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *par_name = python_pars[ 1 ]; PyObject *par_dirs = python_pars[ 2 ]; PyObject *par_skip = python_pars[ 3 ]; PyObject *var_tried = NULL; PyObject *var_loader = NULL; PyObject *var_template = NULL; PyObject *var_e = NULL; PyObject *tmp_for_loop_1__for_iterator = NULL; PyObject *tmp_for_loop_1__iter_value = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *exception_keeper_type_3; PyObject *exception_keeper_value_3; PyTracebackObject *exception_keeper_tb_3; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_3; PyObject *exception_keeper_type_4; PyObject *exception_keeper_value_4; PyTracebackObject *exception_keeper_tb_4; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_4; PyObject *exception_keeper_type_5; PyObject *exception_keeper_value_5; PyTracebackObject *exception_keeper_tb_5; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_5; PyObject *exception_keeper_type_6; PyObject *exception_keeper_value_6; PyTracebackObject *exception_keeper_tb_6; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_6; PyObject *exception_keeper_type_7; PyObject *exception_keeper_value_7; PyTracebackObject *exception_keeper_tb_7; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_7; PyObject *exception_preserved_type_1; PyObject *exception_preserved_value_1; PyTracebackObject *exception_preserved_tb_1; PyObject *exception_preserved_type_2; PyObject *exception_preserved_value_2; PyTracebackObject *exception_preserved_tb_2; PyObject *tmp_args_element_name_1; PyObject *tmp_args_element_name_2; PyObject *tmp_args_element_name_3; PyObject *tmp_args_name_1; PyObject *tmp_args_name_2; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_assign_source_6; PyObject *tmp_called_name_1; PyObject *tmp_called_name_2; PyObject *tmp_called_name_3; PyObject *tmp_called_name_4; PyObject *tmp_compare_left_1; PyObject *tmp_compare_left_2; PyObject *tmp_compare_right_1; PyObject *tmp_compare_right_2; int tmp_cond_truth_1; PyObject *tmp_cond_value_1; PyObject *tmp_dict_key_1; PyObject *tmp_dict_key_2; PyObject *tmp_dict_key_3; PyObject *tmp_dict_value_1; PyObject *tmp_dict_value_2; PyObject *tmp_dict_value_3; int tmp_exc_match_exception_match_1; int tmp_exc_match_exception_match_2; PyObject *tmp_iter_arg_1; PyObject *tmp_kw_name_1; PyObject *tmp_kw_name_2; PyObject *tmp_next_source_1; PyObject *tmp_raise_type_1; int tmp_res; bool tmp_result; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_source_name_2; PyObject *tmp_source_name_3; PyObject *tmp_source_name_4; PyObject *tmp_source_name_5; PyObject *tmp_source_name_6; PyObject *tmp_tuple_element_1; PyObject *tmp_tuple_element_2; PyObject *tmp_tuple_element_3; NUITKA_MAY_BE_UNUSED PyObject *tmp_unused; static struct Nuitka_FrameObject *cache_frame_e3e0d3faa8a81091422da817cb2bba3f = NULL; struct Nuitka_FrameObject *frame_e3e0d3faa8a81091422da817cb2bba3f; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. tmp_assign_source_1 = PyList_New( 0 ); assert( var_tried == NULL ); var_tried = tmp_assign_source_1; // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_e3e0d3faa8a81091422da817cb2bba3f, codeobj_e3e0d3faa8a81091422da817cb2bba3f, module_django$template$engine, sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_e3e0d3faa8a81091422da817cb2bba3f = cache_frame_e3e0d3faa8a81091422da817cb2bba3f; // Push the new frame as the currently active one. pushFrameStack( frame_e3e0d3faa8a81091422da817cb2bba3f ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_e3e0d3faa8a81091422da817cb2bba3f ) == 2 ); // Frame stack // Framed code: tmp_source_name_1 = par_self; CHECK_OBJECT( tmp_source_name_1 ); tmp_iter_arg_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_template_loaders ); if ( tmp_iter_arg_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 132; type_description_1 = "oooooooo"; goto frame_exception_exit_1; } tmp_assign_source_2 = MAKE_ITERATOR( tmp_iter_arg_1 ); Py_DECREF( tmp_iter_arg_1 ); if ( tmp_assign_source_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 132; type_description_1 = "oooooooo"; goto frame_exception_exit_1; } assert( tmp_for_loop_1__for_iterator == NULL ); tmp_for_loop_1__for_iterator = tmp_assign_source_2; // Tried code: loop_start_1:; tmp_next_source_1 = tmp_for_loop_1__for_iterator; CHECK_OBJECT( tmp_next_source_1 ); tmp_assign_source_3 = ITERATOR_NEXT( tmp_next_source_1 ); if ( tmp_assign_source_3 == NULL ) { if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() ) { goto loop_end_1; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "oooooooo"; exception_lineno = 132; goto try_except_handler_2; } } { PyObject *old = tmp_for_loop_1__iter_value; tmp_for_loop_1__iter_value = tmp_assign_source_3; Py_XDECREF( old ); } tmp_assign_source_4 = tmp_for_loop_1__iter_value; CHECK_OBJECT( tmp_assign_source_4 ); { PyObject *old = var_loader; var_loader = tmp_assign_source_4; Py_INCREF( var_loader ); Py_XDECREF( old ); } tmp_source_name_2 = var_loader; CHECK_OBJECT( tmp_source_name_2 ); tmp_cond_value_1 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_supports_recursion ); if ( tmp_cond_value_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 133; type_description_1 = "oooooooo"; goto try_except_handler_2; } tmp_cond_truth_1 = CHECK_IF_TRUE( tmp_cond_value_1 ); if ( tmp_cond_truth_1 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_cond_value_1 ); exception_lineno = 133; type_description_1 = "oooooooo"; goto try_except_handler_2; } Py_DECREF( tmp_cond_value_1 ); if ( tmp_cond_truth_1 == 1 ) { goto branch_yes_1; } else { goto branch_no_1; } branch_yes_1:; // Tried code: tmp_source_name_3 = var_loader; if ( tmp_source_name_3 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loader" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 135; type_description_1 = "oooooooo"; goto try_except_handler_3; } tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_3, const_str_plain_get_template ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 135; type_description_1 = "oooooooo"; goto try_except_handler_3; } tmp_args_name_1 = PyTuple_New( 1 ); tmp_tuple_element_1 = par_name; if ( tmp_tuple_element_1 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "name" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 136; type_description_1 = "oooooooo"; goto try_except_handler_3; } Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_args_name_1, 0, tmp_tuple_element_1 ); tmp_kw_name_1 = _PyDict_NewPresized( 2 ); tmp_dict_key_1 = const_str_plain_template_dirs; tmp_dict_value_1 = par_dirs; if ( tmp_dict_value_1 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "dirs" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 136; type_description_1 = "oooooooo"; goto try_except_handler_3; } tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_1, tmp_dict_value_1 ); assert( !(tmp_res != 0) ); tmp_dict_key_2 = const_str_plain_skip; tmp_dict_value_2 = par_skip; if ( tmp_dict_value_2 == NULL ) { Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "skip" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 136; type_description_1 = "oooooooo"; goto try_except_handler_3; } tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_2, tmp_dict_value_2 ); assert( !(tmp_res != 0) ); frame_e3e0d3faa8a81091422da817cb2bba3f->m_frame.f_lineno = 135; tmp_assign_source_5 = CALL_FUNCTION( tmp_called_name_1, tmp_args_name_1, tmp_kw_name_1 ); Py_DECREF( tmp_called_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); if ( tmp_assign_source_5 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 135; type_description_1 = "oooooooo"; goto try_except_handler_3; } { PyObject *old = var_template; var_template = tmp_assign_source_5; Py_XDECREF( old ); } tmp_return_value = PyTuple_New( 2 ); tmp_tuple_element_2 = var_template; CHECK_OBJECT( tmp_tuple_element_2 ); Py_INCREF( tmp_tuple_element_2 ); PyTuple_SET_ITEM( tmp_return_value, 0, tmp_tuple_element_2 ); tmp_source_name_4 = var_template; CHECK_OBJECT( tmp_source_name_4 ); tmp_tuple_element_2 = LOOKUP_ATTRIBUTE( tmp_source_name_4, const_str_plain_origin ); if ( tmp_tuple_element_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_return_value ); exception_lineno = 138; type_description_1 = "oooooooo"; goto try_except_handler_3; } PyTuple_SET_ITEM( tmp_return_value, 1, tmp_tuple_element_2 ); goto try_return_handler_2; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_9_find_template ); return NULL; // Exception handler code: try_except_handler_3:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; // Preserve existing published exception. exception_preserved_type_1 = PyThreadState_GET()->exc_type; Py_XINCREF( exception_preserved_type_1 ); exception_preserved_value_1 = PyThreadState_GET()->exc_value; Py_XINCREF( exception_preserved_value_1 ); exception_preserved_tb_1 = (PyTracebackObject *)PyThreadState_GET()->exc_traceback; Py_XINCREF( exception_preserved_tb_1 ); if ( exception_keeper_tb_1 == NULL ) { exception_keeper_tb_1 = MAKE_TRACEBACK( frame_e3e0d3faa8a81091422da817cb2bba3f, exception_keeper_lineno_1 ); } else if ( exception_keeper_lineno_1 != 0 ) { exception_keeper_tb_1 = ADD_TRACEBACK( exception_keeper_tb_1, frame_e3e0d3faa8a81091422da817cb2bba3f, exception_keeper_lineno_1 ); } NORMALIZE_EXCEPTION( &exception_keeper_type_1, &exception_keeper_value_1, &exception_keeper_tb_1 ); PyException_SetTraceback( exception_keeper_value_1, (PyObject *)exception_keeper_tb_1 ); PUBLISH_EXCEPTION( &exception_keeper_type_1, &exception_keeper_value_1, &exception_keeper_tb_1 ); // Tried code: tmp_compare_left_1 = PyThreadState_GET()->exc_type; tmp_compare_right_1 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_TemplateDoesNotExist ); if (unlikely( tmp_compare_right_1 == NULL )) { tmp_compare_right_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_TemplateDoesNotExist ); } if ( tmp_compare_right_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "TemplateDoesNotExist" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 139; type_description_1 = "oooooooo"; goto try_except_handler_4; } tmp_exc_match_exception_match_1 = EXCEPTION_MATCH_BOOL( tmp_compare_left_1, tmp_compare_right_1 ); if ( tmp_exc_match_exception_match_1 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 139; type_description_1 = "oooooooo"; goto try_except_handler_4; } if ( tmp_exc_match_exception_match_1 == 1 ) { goto branch_yes_2; } else { goto branch_no_2; } branch_yes_2:; tmp_assign_source_6 = PyThreadState_GET()->exc_value; { PyObject *old = var_e; var_e = tmp_assign_source_6; Py_INCREF( var_e ); Py_XDECREF( old ); } // Tried code: tmp_source_name_5 = var_tried; if ( tmp_source_name_5 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "tried" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 140; type_description_1 = "oooooooo"; goto try_except_handler_5; } tmp_called_name_2 = LOOKUP_ATTRIBUTE( tmp_source_name_5, const_str_plain_extend ); if ( tmp_called_name_2 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 140; type_description_1 = "oooooooo"; goto try_except_handler_5; } tmp_source_name_6 = var_e; if ( tmp_source_name_6 == NULL ) { Py_DECREF( tmp_called_name_2 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "e" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 140; type_description_1 = "oooooooo"; goto try_except_handler_5; } tmp_args_element_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_6, const_str_plain_tried ); if ( tmp_args_element_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); Py_DECREF( tmp_called_name_2 ); exception_lineno = 140; type_description_1 = "oooooooo"; goto try_except_handler_5; } frame_e3e0d3faa8a81091422da817cb2bba3f->m_frame.f_lineno = 140; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_unused = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_2, call_args ); } Py_DECREF( tmp_called_name_2 ); Py_DECREF( tmp_args_element_name_1 ); if ( tmp_unused == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 140; type_description_1 = "oooooooo"; goto try_except_handler_5; } Py_DECREF( tmp_unused ); goto try_end_1; // Exception handler code: try_except_handler_5:; exception_keeper_type_2 = exception_type; exception_keeper_value_2 = exception_value; exception_keeper_tb_2 = exception_tb; exception_keeper_lineno_2 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( var_e ); var_e = NULL; // Re-raise. exception_type = exception_keeper_type_2; exception_value = exception_keeper_value_2; exception_tb = exception_keeper_tb_2; exception_lineno = exception_keeper_lineno_2; goto try_except_handler_4; // End of try: try_end_1:; Py_XDECREF( var_e ); var_e = NULL; goto branch_end_2; branch_no_2:; tmp_result = RERAISE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); if (unlikely( tmp_result == false )) { exception_lineno = 134; } if (exception_tb && exception_tb->tb_frame == &frame_e3e0d3faa8a81091422da817cb2bba3f->m_frame) frame_e3e0d3faa8a81091422da817cb2bba3f->m_frame.f_lineno = exception_tb->tb_lineno; type_description_1 = "oooooooo"; goto try_except_handler_4; branch_end_2:; goto try_end_2; // Exception handler code: try_except_handler_4:; exception_keeper_type_3 = exception_type; exception_keeper_value_3 = exception_value; exception_keeper_tb_3 = exception_tb; exception_keeper_lineno_3 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; // Restore previous exception. SET_CURRENT_EXCEPTION( exception_preserved_type_1, exception_preserved_value_1, exception_preserved_tb_1 ); // Re-raise. exception_type = exception_keeper_type_3; exception_value = exception_keeper_value_3; exception_tb = exception_keeper_tb_3; exception_lineno = exception_keeper_lineno_3; goto try_except_handler_2; // End of try: try_end_2:; // Restore previous exception. SET_CURRENT_EXCEPTION( exception_preserved_type_1, exception_preserved_value_1, exception_preserved_tb_1 ); goto try_end_3; // exception handler codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_9_find_template ); return NULL; // End of try: try_end_3:; goto branch_end_1; branch_no_1:; // Tried code: tmp_called_name_3 = var_loader; if ( tmp_called_name_3 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "loader" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 145; type_description_1 = "oooooooo"; goto try_except_handler_6; } tmp_args_element_name_2 = par_name; if ( tmp_args_element_name_2 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "name" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 145; type_description_1 = "oooooooo"; goto try_except_handler_6; } tmp_args_element_name_3 = par_dirs; if ( tmp_args_element_name_3 == NULL ) { exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "dirs" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 145; type_description_1 = "oooooooo"; goto try_except_handler_6; } frame_e3e0d3faa8a81091422da817cb2bba3f->m_frame.f_lineno = 145; { PyObject *call_args[] = { tmp_args_element_name_2, tmp_args_element_name_3 }; tmp_return_value = CALL_FUNCTION_WITH_ARGS2( tmp_called_name_3, call_args ); } if ( tmp_return_value == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 145; type_description_1 = "oooooooo"; goto try_except_handler_6; } goto try_return_handler_2; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_9_find_template ); return NULL; // Exception handler code: try_except_handler_6:; exception_keeper_type_4 = exception_type; exception_keeper_value_4 = exception_value; exception_keeper_tb_4 = exception_tb; exception_keeper_lineno_4 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; // Preserve existing published exception. exception_preserved_type_2 = PyThreadState_GET()->exc_type; Py_XINCREF( exception_preserved_type_2 ); exception_preserved_value_2 = PyThreadState_GET()->exc_value; Py_XINCREF( exception_preserved_value_2 ); exception_preserved_tb_2 = (PyTracebackObject *)PyThreadState_GET()->exc_traceback; Py_XINCREF( exception_preserved_tb_2 ); if ( exception_keeper_tb_4 == NULL ) { exception_keeper_tb_4 = MAKE_TRACEBACK( frame_e3e0d3faa8a81091422da817cb2bba3f, exception_keeper_lineno_4 ); } else if ( exception_keeper_lineno_4 != 0 ) { exception_keeper_tb_4 = ADD_TRACEBACK( exception_keeper_tb_4, frame_e3e0d3faa8a81091422da817cb2bba3f, exception_keeper_lineno_4 ); } NORMALIZE_EXCEPTION( &exception_keeper_type_4, &exception_keeper_value_4, &exception_keeper_tb_4 ); PyException_SetTraceback( exception_keeper_value_4, (PyObject *)exception_keeper_tb_4 ); PUBLISH_EXCEPTION( &exception_keeper_type_4, &exception_keeper_value_4, &exception_keeper_tb_4 ); // Tried code: tmp_compare_left_2 = PyThreadState_GET()->exc_type; tmp_compare_right_2 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_TemplateDoesNotExist ); if (unlikely( tmp_compare_right_2 == NULL )) { tmp_compare_right_2 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_TemplateDoesNotExist ); } if ( tmp_compare_right_2 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "TemplateDoesNotExist" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 146; type_description_1 = "oooooooo"; goto try_except_handler_7; } tmp_exc_match_exception_match_2 = EXCEPTION_MATCH_BOOL( tmp_compare_left_2, tmp_compare_right_2 ); if ( tmp_exc_match_exception_match_2 == -1 ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 146; type_description_1 = "oooooooo"; goto try_except_handler_7; } if ( tmp_exc_match_exception_match_2 == 1 ) { goto branch_no_3; } else { goto branch_yes_3; } branch_yes_3:; tmp_result = RERAISE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); if (unlikely( tmp_result == false )) { exception_lineno = 144; } if (exception_tb && exception_tb->tb_frame == &frame_e3e0d3faa8a81091422da817cb2bba3f->m_frame) frame_e3e0d3faa8a81091422da817cb2bba3f->m_frame.f_lineno = exception_tb->tb_lineno; type_description_1 = "oooooooo"; goto try_except_handler_7; branch_no_3:; goto try_end_4; // Exception handler code: try_except_handler_7:; exception_keeper_type_5 = exception_type; exception_keeper_value_5 = exception_value; exception_keeper_tb_5 = exception_tb; exception_keeper_lineno_5 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; // Restore previous exception. SET_CURRENT_EXCEPTION( exception_preserved_type_2, exception_preserved_value_2, exception_preserved_tb_2 ); // Re-raise. exception_type = exception_keeper_type_5; exception_value = exception_keeper_value_5; exception_tb = exception_keeper_tb_5; exception_lineno = exception_keeper_lineno_5; goto try_except_handler_2; // End of try: try_end_4:; // Restore previous exception. SET_CURRENT_EXCEPTION( exception_preserved_type_2, exception_preserved_value_2, exception_preserved_tb_2 ); goto try_end_5; // exception handler codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_9_find_template ); return NULL; // End of try: try_end_5:; branch_end_1:; if ( CONSIDER_THREADING() == false ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 132; type_description_1 = "oooooooo"; goto try_except_handler_2; } goto loop_start_1; loop_end_1:; goto try_end_6; // Return handler code: try_return_handler_2:; Py_XDECREF( tmp_for_loop_1__iter_value ); tmp_for_loop_1__iter_value = NULL; Py_XDECREF( tmp_for_loop_1__for_iterator ); tmp_for_loop_1__for_iterator = NULL; goto frame_return_exit_1; // Exception handler code: try_except_handler_2:; exception_keeper_type_6 = exception_type; exception_keeper_value_6 = exception_value; exception_keeper_tb_6 = exception_tb; exception_keeper_lineno_6 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_for_loop_1__iter_value ); tmp_for_loop_1__iter_value = NULL; Py_XDECREF( tmp_for_loop_1__for_iterator ); tmp_for_loop_1__for_iterator = NULL; // Re-raise. exception_type = exception_keeper_type_6; exception_value = exception_keeper_value_6; exception_tb = exception_keeper_tb_6; exception_lineno = exception_keeper_lineno_6; goto frame_exception_exit_1; // End of try: try_end_6:; Py_XDECREF( tmp_for_loop_1__iter_value ); tmp_for_loop_1__iter_value = NULL; Py_XDECREF( tmp_for_loop_1__for_iterator ); tmp_for_loop_1__for_iterator = NULL; tmp_called_name_4 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_TemplateDoesNotExist ); if (unlikely( tmp_called_name_4 == NULL )) { tmp_called_name_4 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_TemplateDoesNotExist ); } if ( tmp_called_name_4 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "TemplateDoesNotExist" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 148; type_description_1 = "oooooooo"; goto frame_exception_exit_1; } tmp_args_name_2 = PyTuple_New( 1 ); tmp_tuple_element_3 = par_name; if ( tmp_tuple_element_3 == NULL ) { Py_DECREF( tmp_args_name_2 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "name" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 148; type_description_1 = "oooooooo"; goto frame_exception_exit_1; } Py_INCREF( tmp_tuple_element_3 ); PyTuple_SET_ITEM( tmp_args_name_2, 0, tmp_tuple_element_3 ); tmp_kw_name_2 = _PyDict_NewPresized( 1 ); tmp_dict_key_3 = const_str_plain_tried; tmp_dict_value_3 = var_tried; if ( tmp_dict_value_3 == NULL ) { Py_DECREF( tmp_args_name_2 ); Py_DECREF( tmp_kw_name_2 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "tried" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 148; type_description_1 = "oooooooo"; goto frame_exception_exit_1; } tmp_res = PyDict_SetItem( tmp_kw_name_2, tmp_dict_key_3, tmp_dict_value_3 ); assert( !(tmp_res != 0) ); frame_e3e0d3faa8a81091422da817cb2bba3f->m_frame.f_lineno = 148; tmp_raise_type_1 = CALL_FUNCTION( tmp_called_name_4, tmp_args_name_2, tmp_kw_name_2 ); Py_DECREF( tmp_args_name_2 ); Py_DECREF( tmp_kw_name_2 ); if ( tmp_raise_type_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 148; type_description_1 = "oooooooo"; goto frame_exception_exit_1; } exception_type = tmp_raise_type_1; exception_lineno = 148; RAISE_EXCEPTION_WITH_TYPE( &exception_type, &exception_value, &exception_tb ); type_description_1 = "oooooooo"; goto frame_exception_exit_1; #if 1 RESTORE_FRAME_EXCEPTION( frame_e3e0d3faa8a81091422da817cb2bba3f ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 1 RESTORE_FRAME_EXCEPTION( frame_e3e0d3faa8a81091422da817cb2bba3f ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 1 RESTORE_FRAME_EXCEPTION( frame_e3e0d3faa8a81091422da817cb2bba3f ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_e3e0d3faa8a81091422da817cb2bba3f, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_e3e0d3faa8a81091422da817cb2bba3f->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_e3e0d3faa8a81091422da817cb2bba3f, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_e3e0d3faa8a81091422da817cb2bba3f, type_description_1, par_self, par_name, par_dirs, par_skip, var_tried, var_loader, var_template, var_e ); // Release cached frame. if ( frame_e3e0d3faa8a81091422da817cb2bba3f == cache_frame_e3e0d3faa8a81091422da817cb2bba3f ) { Py_DECREF( frame_e3e0d3faa8a81091422da817cb2bba3f ); } cache_frame_e3e0d3faa8a81091422da817cb2bba3f = NULL; assertFrameObject( frame_e3e0d3faa8a81091422da817cb2bba3f ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_9_find_template ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_name ); par_name = NULL; Py_XDECREF( par_dirs ); par_dirs = NULL; Py_XDECREF( par_skip ); par_skip = NULL; Py_XDECREF( var_tried ); var_tried = NULL; Py_XDECREF( var_loader ); var_loader = NULL; Py_XDECREF( var_template ); var_template = NULL; Py_XDECREF( var_e ); var_e = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_7 = exception_type; exception_keeper_value_7 = exception_value; exception_keeper_tb_7 = exception_tb; exception_keeper_lineno_7 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_name ); par_name = NULL; Py_XDECREF( par_dirs ); par_dirs = NULL; Py_XDECREF( par_skip ); par_skip = NULL; Py_XDECREF( var_tried ); var_tried = NULL; Py_XDECREF( var_loader ); var_loader = NULL; Py_XDECREF( var_template ); var_template = NULL; Py_XDECREF( var_e ); var_e = NULL; // Re-raise. exception_type = exception_keeper_type_7; exception_value = exception_keeper_value_7; exception_tb = exception_keeper_tb_7; exception_lineno = exception_keeper_lineno_7; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_9_find_template ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_django$template$engine$$$function_10_from_string( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *par_template_code = python_pars[ 1 ]; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *tmp_args_name_1; PyObject *tmp_called_name_1; PyObject *tmp_dict_key_1; PyObject *tmp_dict_value_1; PyObject *tmp_kw_name_1; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_tuple_element_1; static struct Nuitka_FrameObject *cache_frame_742e343ac314969a76237aae585de2e9 = NULL; struct Nuitka_FrameObject *frame_742e343ac314969a76237aae585de2e9; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_742e343ac314969a76237aae585de2e9, codeobj_742e343ac314969a76237aae585de2e9, module_django$template$engine, sizeof(void *)+sizeof(void *) ); frame_742e343ac314969a76237aae585de2e9 = cache_frame_742e343ac314969a76237aae585de2e9; // Push the new frame as the currently active one. pushFrameStack( frame_742e343ac314969a76237aae585de2e9 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_742e343ac314969a76237aae585de2e9 ) == 2 ); // Frame stack // Framed code: tmp_called_name_1 = GET_STRING_DICT_VALUE( moduledict_django$template$engine, (Nuitka_StringObject *)const_str_plain_Template ); if (unlikely( tmp_called_name_1 == NULL )) { tmp_called_name_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_Template ); } if ( tmp_called_name_1 == NULL ) { exception_type = PyExc_NameError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "Template" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 155; type_description_1 = "oo"; goto frame_exception_exit_1; } tmp_args_name_1 = PyTuple_New( 1 ); tmp_tuple_element_1 = par_template_code; CHECK_OBJECT( tmp_tuple_element_1 ); Py_INCREF( tmp_tuple_element_1 ); PyTuple_SET_ITEM( tmp_args_name_1, 0, tmp_tuple_element_1 ); tmp_kw_name_1 = _PyDict_NewPresized( 1 ); tmp_dict_key_1 = const_str_plain_engine; tmp_dict_value_1 = par_self; CHECK_OBJECT( tmp_dict_value_1 ); tmp_res = PyDict_SetItem( tmp_kw_name_1, tmp_dict_key_1, tmp_dict_value_1 ); assert( !(tmp_res != 0) ); frame_742e343ac314969a76237aae585de2e9->m_frame.f_lineno = 155; tmp_return_value = CALL_FUNCTION( tmp_called_name_1, tmp_args_name_1, tmp_kw_name_1 ); Py_DECREF( tmp_args_name_1 ); Py_DECREF( tmp_kw_name_1 ); if ( tmp_return_value == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 155; type_description_1 = "oo"; goto frame_exception_exit_1; } goto frame_return_exit_1; #if 0 RESTORE_FRAME_EXCEPTION( frame_742e343ac314969a76237aae585de2e9 ); #endif // Put the previous frame back on top. popFrameStack(); goto frame_no_exception_1; frame_return_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_742e343ac314969a76237aae585de2e9 ); #endif // Put the previous frame back on top. popFrameStack(); goto try_return_handler_1; frame_exception_exit_1:; #if 0 RESTORE_FRAME_EXCEPTION( frame_742e343ac314969a76237aae585de2e9 ); #endif if ( exception_tb == NULL ) { exception_tb = MAKE_TRACEBACK( frame_742e343ac314969a76237aae585de2e9, exception_lineno ); } else if ( exception_tb->tb_frame != &frame_742e343ac314969a76237aae585de2e9->m_frame ) { exception_tb = ADD_TRACEBACK( exception_tb, frame_742e343ac314969a76237aae585de2e9, exception_lineno ); } // Attachs locals to frame if any. Nuitka_Frame_AttachLocals( (struct Nuitka_FrameObject *)frame_742e343ac314969a76237aae585de2e9, type_description_1, par_self, par_template_code ); // Release cached frame. if ( frame_742e343ac314969a76237aae585de2e9 == cache_frame_742e343ac314969a76237aae585de2e9 ) { Py_DECREF( frame_742e343ac314969a76237aae585de2e9 ); } cache_frame_742e343ac314969a76237aae585de2e9 = NULL; assertFrameObject( frame_742e343ac314969a76237aae585de2e9 ); // Put the previous frame back on top. popFrameStack(); // Return the error. goto try_except_handler_1; frame_no_exception_1:; // tried codes exits in all cases NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_10_from_string ); return NULL; // Return handler code: try_return_handler_1:; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_template_code ); par_template_code = NULL; goto function_return_exit; // Exception handler code: try_except_handler_1:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( par_self ); par_self = NULL; Py_XDECREF( par_template_code ); par_template_code = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto function_exception_exit; // End of try: // Return statement must have exited already. NUITKA_CANNOT_GET_HERE( django$template$engine$$$function_10_from_string ); return NULL; function_exception_exit: assert( exception_type ); RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return NULL; function_return_exit: CHECK_OBJECT( tmp_return_value ); assert( had_error || !ERROR_OCCURRED() ); return tmp_return_value; } static PyObject *impl_django$template$engine$$$function_11_get_template( struct Nuitka_FunctionObject const *self, PyObject **python_pars ) { // Preserve error status for checks #ifndef __NUITKA_NO_ASSERT__ NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED(); #endif // Local variable declarations. PyObject *par_self = python_pars[ 0 ]; PyObject *par_template_name = python_pars[ 1 ]; PyObject *var_template = NULL; PyObject *var_origin = NULL; PyObject *tmp_tuple_unpack_1__element_1 = NULL; PyObject *tmp_tuple_unpack_1__element_2 = NULL; PyObject *tmp_tuple_unpack_1__source_iter = NULL; PyObject *exception_type = NULL; PyObject *exception_value = NULL; PyTracebackObject *exception_tb = NULL; NUITKA_MAY_BE_UNUSED int exception_lineno = 0; PyObject *exception_keeper_type_1; PyObject *exception_keeper_value_1; PyTracebackObject *exception_keeper_tb_1; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1; PyObject *exception_keeper_type_2; PyObject *exception_keeper_value_2; PyTracebackObject *exception_keeper_tb_2; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2; PyObject *exception_keeper_type_3; PyObject *exception_keeper_value_3; PyTracebackObject *exception_keeper_tb_3; NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_3; PyObject *tmp_args_element_name_1; PyObject *tmp_args_name_1; PyObject *tmp_assign_source_1; PyObject *tmp_assign_source_2; PyObject *tmp_assign_source_3; PyObject *tmp_assign_source_4; PyObject *tmp_assign_source_5; PyObject *tmp_assign_source_6; PyObject *tmp_called_name_1; PyObject *tmp_called_name_2; PyObject *tmp_dict_key_1; PyObject *tmp_dict_value_1; PyObject *tmp_hasattr_attr_1; PyObject *tmp_hasattr_source_1; PyObject *tmp_iter_arg_1; PyObject *tmp_iterator_attempt; PyObject *tmp_iterator_name_1; PyObject *tmp_kw_name_1; int tmp_res; PyObject *tmp_return_value; PyObject *tmp_source_name_1; PyObject *tmp_tuple_element_1; PyObject *tmp_unpack_1; PyObject *tmp_unpack_2; static struct Nuitka_FrameObject *cache_frame_b17c2ea0084acc349c94f1c9603f09e7 = NULL; struct Nuitka_FrameObject *frame_b17c2ea0084acc349c94f1c9603f09e7; NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; tmp_return_value = NULL; // Actual function code. // Tried code: MAKE_OR_REUSE_FRAME( cache_frame_b17c2ea0084acc349c94f1c9603f09e7, codeobj_b17c2ea0084acc349c94f1c9603f09e7, module_django$template$engine, sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *) ); frame_b17c2ea0084acc349c94f1c9603f09e7 = cache_frame_b17c2ea0084acc349c94f1c9603f09e7; // Push the new frame as the currently active one. pushFrameStack( frame_b17c2ea0084acc349c94f1c9603f09e7 ); // Mark the frame object as in use, ref count 1 will be up for reuse. assert( Py_REFCNT( frame_b17c2ea0084acc349c94f1c9603f09e7 ) == 2 ); // Frame stack // Framed code: // Tried code: tmp_source_name_1 = par_self; CHECK_OBJECT( tmp_source_name_1 ); tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_find_template ); if ( tmp_called_name_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 162; type_description_1 = "oooo"; goto try_except_handler_2; } tmp_args_element_name_1 = par_template_name; if ( tmp_args_element_name_1 == NULL ) { Py_DECREF( tmp_called_name_1 ); exception_type = PyExc_UnboundLocalError; Py_INCREF( exception_type ); exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "template_name" ); exception_tb = NULL; NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); CHAIN_EXCEPTION( exception_value ); exception_lineno = 162; type_description_1 = "oooo"; goto try_except_handler_2; } frame_b17c2ea0084acc349c94f1c9603f09e7->m_frame.f_lineno = 162; { PyObject *call_args[] = { tmp_args_element_name_1 }; tmp_iter_arg_1 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_1, call_args ); } Py_DECREF( tmp_called_name_1 ); if ( tmp_iter_arg_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 162; type_description_1 = "oooo"; goto try_except_handler_2; } tmp_assign_source_1 = MAKE_ITERATOR( tmp_iter_arg_1 ); Py_DECREF( tmp_iter_arg_1 ); if ( tmp_assign_source_1 == NULL ) { assert( ERROR_OCCURRED() ); FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); exception_lineno = 162; type_description_1 = "oooo"; goto try_except_handler_2; } assert( tmp_tuple_unpack_1__source_iter == NULL ); tmp_tuple_unpack_1__source_iter = tmp_assign_source_1; // Tried code: tmp_unpack_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_1 ); tmp_assign_source_2 = UNPACK_NEXT( tmp_unpack_1, 0, 2 ); if ( tmp_assign_source_2 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "oooo"; exception_lineno = 162; goto try_except_handler_3; } assert( tmp_tuple_unpack_1__element_1 == NULL ); tmp_tuple_unpack_1__element_1 = tmp_assign_source_2; tmp_unpack_2 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_unpack_2 ); tmp_assign_source_3 = UNPACK_NEXT( tmp_unpack_2, 1, 2 ); if ( tmp_assign_source_3 == NULL ) { if ( !ERROR_OCCURRED() ) { exception_type = PyExc_StopIteration; Py_INCREF( exception_type ); exception_value = NULL; exception_tb = NULL; } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); } type_description_1 = "oooo"; exception_lineno = 162; goto try_except_handler_3; } assert( tmp_tuple_unpack_1__element_2 == NULL ); tmp_tuple_unpack_1__element_2 = tmp_assign_source_3; tmp_iterator_name_1 = tmp_tuple_unpack_1__source_iter; CHECK_OBJECT( tmp_iterator_name_1 ); // Check if iterator has left-over elements. CHECK_OBJECT( tmp_iterator_name_1 ); assert( HAS_ITERNEXT( tmp_iterator_name_1 ) ); tmp_iterator_attempt = (*Py_TYPE( tmp_iterator_name_1 )->tp_iternext)( tmp_iterator_name_1 ); if (likely( tmp_iterator_attempt == NULL )) { PyObject *error = GET_ERROR_OCCURRED(); if ( error != NULL ) { if ( EXCEPTION_MATCH_BOOL_SINGLE( error, PyExc_StopIteration )) { CLEAR_ERROR_OCCURRED(); } else { FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "oooo"; exception_lineno = 162; goto try_except_handler_3; } } } else { Py_DECREF( tmp_iterator_attempt ); // TODO: Could avoid PyErr_Format. #if PYTHON_VERSION < 300 PyErr_Format( PyExc_ValueError, "too many values to unpack" ); #else PyErr_Format( PyExc_ValueError, "too many values to unpack (expected 2)" ); #endif FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); type_description_1 = "oooo"; exception_lineno = 162; goto try_except_handler_3; } goto try_end_1; // Exception handler code: try_except_handler_3:; exception_keeper_type_1 = exception_type; exception_keeper_value_1 = exception_value; exception_keeper_tb_1 = exception_tb; exception_keeper_lineno_1 = exception_lineno; exception_type = NULL; exception_value = NULL; exception_tb = NULL; exception_lineno = 0; Py_XDECREF( tmp_tuple_unpack_1__source_iter ); tmp_tuple_unpack_1__source_iter = NULL; // Re-raise. exception_type = exception_keeper_type_1; exception_value = exception_keeper_value_1; exception_tb = exception_keeper_tb_1; exception_lineno = exception_keeper_lineno_1; goto try_except_handler_2; // End of try: try_end_1:; goto
| 7,899
|
https://github.com/thuannguyen0101/demo_backpack/blob/master/resources/views/admin/test_summary/test_summary_script.blade.php
|
Github Open Source
|
Open Source
|
MIT
| null |
demo_backpack
|
thuannguyen0101
|
PHP
|
Code
| 100
| 437
|
@push('after_scripts')
<script>
if (typeof registerShowDetailLinkOnTestSummaryAction != "function") {
function registerShowDetailLinkOnTestSummaryAction() {
var $modal = $(
'<div class="modal fade dtr-bs-modal" role="dialog">' +
'<div class="modal-dialog" role="document">' +
'<div class="modal-content">' +
"</div>" +
"</div>"
);
$("#crudTable tbody td .test-summary--show-user-detail").on(
"click",
function (e) {
e.stopPropagation();
e.preventDefault();
console.log(e);
if ("detailLoaded" in e.currentTarget.dataset) {
$(
"#" + "testSummaryUser" + e.currentTarget.dataset.userId
).modal();
} else {
$.ajax({
url: e.currentTarget.dataset.detailLink,
type: "GET",
})
.done(function (data) {
var $content = $modal.find("div.modal-content");
$content.empty().append(data);
$modal
.attr(
"id",
"testSummaryUser" +
e.currentTarget.dataset.userId
)
.appendTo("body")
.modal();
e.currentTarget.dataset.detailLoaded = true;
})
.fail(function (data) {
console.error(data);
});
}
}
);
}
}
crud.addFunctionToDataTablesDrawEventQueue(
"registerShowDetailLinkOnTestSummaryAction"
);
</script>
@endpush
| 23,660
|
https://github.com/R-Autopsy-translation/autopsy/blob/master/Core/src/org/sleuthkit/autopsy/modules/vmextractor/VirtualMachineFinder.java
|
Github Open Source
|
Open Source
|
Zlib, LGPL-2.0-or-later, GPL-1.0-or-later, LicenseRef-scancode-oracle-bcl-javase-javafx-2012, Apache-2.0, CC-BY-3.0, LicenseRef-scancode-unknown-license-reference, LGPL-2.1-or-later, WTFPL
| 2,019
|
autopsy
|
R-Autopsy-translation
|
Java
|
Code
| 830
| 2,005
|
/*
* Autopsy Forensic Browser
*
* Copyright 2012-2016 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* 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.
*/
package org.sleuthkit.autopsy.modules.vmextractor;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import javax.swing.filechooser.FileFilter;
import org.sleuthkit.autopsy.casemodule.GeneralFilter;
import org.sleuthkit.autopsy.coreutils.Logger;
/**
* Virtual machine file finder
*/
public final class VirtualMachineFinder {
private static final Logger logger = Logger.getLogger(VirtualMachineFinder.class.getName());
private static final int MAX_VMDK_DESCRIPTOR_FILE_SIZE_BYTES = 10000;
private static final int MIN_VMDK_EXTENT_DESCRIPTOR_FIELDS = 4; // See readExtentFilesFromVmdkDescriptorFile() for details
private static final int FILE_NAME_FIELD_INDX = 3; // See readExtentFilesFromVmdkDescriptorFile() for details
private static final GeneralFilter virtualMachineFilter = new GeneralFilter(GeneralFilter.VIRTUAL_MACHINE_EXTS, GeneralFilter.VIRTUAL_MACHINE_DESC);
private static final List<FileFilter> vmFiltersList = new ArrayList<>();
static {
vmFiltersList.add(virtualMachineFilter);
}
private static final List<String> VMDK_EXTS = Arrays.asList(new String[]{".vmdk"}); //NON-NLS
private static final GeneralFilter vmdkFilter = new GeneralFilter(VMDK_EXTS, "");
private static final List<FileFilter> vmdkFiltersList = new ArrayList<>();
static {
vmdkFiltersList.add(vmdkFilter);
}
public static final boolean isVirtualMachine(String fileName) {
return isAcceptedByFiler(new File(fileName), vmFiltersList);
}
/**
* Identifies virtual machine files for ingest.
*
* @param imageFolderPath Absolute path to the folder to be analyzed
*
* @return List of VM files to be ingested
*/
public static List<String> identifyVirtualMachines(Path imageFolderPath) {
// get a list of all files in the folder
List<String> files = getAllFilesInFolder(imageFolderPath.toString());
if (files.isEmpty()) {
return Collections.emptyList();
}
// remove all non-vm files
for (Iterator<String> iterator = files.iterator(); iterator.hasNext();) {
String file = iterator.next();
if (!isVirtualMachine(file)) {
iterator.remove();
}
}
// identify VMDK descriptor files - VMDK files with size less than 10KB
List<String> extentFiles = new ArrayList<>();
for (String fileName : files) {
File file = imageFolderPath.resolve(fileName).toFile();
if (isAcceptedByFiler(new File(fileName), vmdkFiltersList) && file.exists() && file.length() < MAX_VMDK_DESCRIPTOR_FILE_SIZE_BYTES) {
// this is likely a VMDK descriptor file - read vmdk extent files listed in it
extentFiles.addAll(readExtentFilesFromVmdkDescriptorFile(file));
}
}
// remove VMDK extent files from list of vm files to proces
files.removeAll(extentFiles);
// what remains on the list is either a vmdk descriptor file or a VMDK file that doesn't have a descriptor file or different type of VM (e.g. VHD)
return files;
}
/**
* Opens VMDK descriptor file, finds and returns a list of all VMDK extent
* files listed in the descriptor file.
*
* @param file VMDK descriptor file to read
*
* @return List of VMDK extent file names listed in the descriptor file
*/
private static List<String> readExtentFilesFromVmdkDescriptorFile(File file) {
List<String> extentFiles = new ArrayList<>();
// remove from the list all VMDK files that are listed in the descriptor file
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
String line = br.readLine();
while (null != line) {
// The extent descriptions provide the following key information:
// Access – may be RW, RDONLY, or NOACCESS
// Size in sectors – a sector is 512 bytes
// Type of extent – may be FLAT, SPARSE, ZERO, VMFS, VMFSSPARSE, VMFSRDM, or VMFSRAW.
// Filename
// Offset – the offset value is specified only for flat extents and corresponds to the offset in the file or device
// where the guest operating system’s data is located.
// Example: RW 4192256 SPARSE "win7-ult-vm-0-s001.vmdk"
String[] splited = line.split(" ");
if (splited.length < MIN_VMDK_EXTENT_DESCRIPTOR_FIELDS) {
// line doesn't have enough fields, can't be an extent descriptor
continue;
}
if (splited[0].equals("RW") || splited[0].equals("RDONLY") || splited[0].equals("NOACCESS")) { //NON-NLS
// found an extent descriptor
// remove quotation marks around the file name
String extentFileName = splited[FILE_NAME_FIELD_INDX].replace("\"", "");
// add extent file to list of extent files
extentFiles.add(extentFileName);
}
line = br.readLine();
}
} catch (Exception ex) {
logger.log(Level.WARNING, String.format("Error while parsing vmdk descriptor file %s", file.toString()), ex); //NON-NLS
}
return extentFiles;
}
private static boolean isAcceptedByFiler(File file, List<FileFilter> filters) {
for (FileFilter filter : filters) {
if (filter.accept(file)) {
return true;
}
}
return false;
}
/**
* Returns a list of all file names in the folder of interest. Sub-folders
* are excluded.
*
* @param path Absolute path of the folder of interest
*
* @return List of all file names in the folder of interest
*/
private static List<String> getAllFilesInFolder(String path) {
// only returns files, skips folders
File file = new File(path);
String[] files = file.list((File current, String name) -> new File(current, name).isFile());
if (files == null) {
// null is returned when folder doesn't exist. need to check this condition, otherwise there is NullPointerException when converting to List
return Collections.emptyList();
}
return new ArrayList<>(Arrays.asList(files));
}
/**
* Prevent instantiation of this utility class.
*/
private VirtualMachineFinder() {
}
}
| 26,693
|
https://github.com/BestItPartner/dex_ethereum_contract/blob/master/contracts/ERC20.sol
|
Github Open Source
|
Open Source
|
MIT
| null |
dex_ethereum_contract
|
BestItPartner
|
Solidity
|
Code
| 25
| 56
|
pragma solidity ^0.6.0;
interface ERC20 {
function transfer(address receiver, uint amount) external returns (bool);
function transferFrom(address sender, address receiver, uint amount) external returns (bool);
}
| 38,666
|
https://github.com/Bartosz-D3V/open-id3-editor/blob/master/app/api/id3v1/domain/id3V1-0.ts
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
open-id3-editor
|
Bartosz-D3V
|
TypeScript
|
Code
| 99
| 215
|
import Genre from '@api/id3/domain/genre';
export default class {
public readonly header = 'TAG';
public title: string;
public artist: string;
public album: string;
public year: number;
public comment: string;
public genre: Genre;
[key: string]: string | number | Genre;
constructor(
title?: string,
artist?: string,
album?: string,
year?: number,
comment?: string,
genre?: Genre
) {
this.title = title ? title : '';
this.artist = artist ? artist : '';
this.album = album ? album : '';
this.year = year ? year : null;
this.comment = comment ? comment : '';
this.genre = genre ? genre : new Genre(-1, '');
}
}
| 45,217
|
https://github.com/MadRabbit/a-plus-forms/blob/master/src/inputs/text.js
|
Github Open Source
|
Open Source
|
ISC
| 2,022
|
a-plus-forms
|
MadRabbit
|
JavaScript
|
Code
| 58
| 130
|
/* @flow */
import React from 'react';
import field from '../core/field';
import trimmer from '../utils/trimmer';
import type { InputProps } from '../types';
type TextInputProps = InputProps & {
type?: string
};
@field()
@trimmer()
export default class TextInput extends React.Component<TextInputProps> {
render() {
const { type = 'text', ...rest } = this.props;
return <input type={type} {...rest} />;
}
}
| 27,031
|
https://github.com/AlexX333BY/boost-file-storage/blob/master/BoostFileStorage/common/socket_message.h
|
Github Open Source
|
Open Source
|
MIT
| null |
boost-file-storage
|
AlexX333BY
|
C
|
Code
| 59
| 270
|
#pragma once
namespace boost_file_storage
{
enum message_type
{
// common commands
OK,
DISCONNECT,
FILE,
ERROR_COMMON,
// client commands
UPLOAD_FILE_QUERY,
//server commands
FILE_TRANSFER_SUCCESS,
ERROR_TOO_BIG,
ERROR_NO_SPACE,
WARNING_NAME_EXISTS
};
struct socket_message
{
public:
socket_message(message_type log_message_type, size_t data_buffer_length = 0, const void *data_bufffer = nullptr);
~socket_message();
message_type get_message_type();
size_t get_buffer_length();
void *get_buffer();
bool is_error_message();
protected:
message_type m_message_type;
size_t m_buffer_length;
void *m_buffer;
};
}
| 41,066
|
https://github.com/Acidburn0zzz/NfWebCrypto/blob/master/plugin/ppapi/ppapi/c/ppp.h
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
NfWebCrypto
|
Acidburn0zzz
|
C
|
Code
| 669
| 1,339
|
/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* From ppp.idl modified Tue Nov 13 08:48:25 2012. */
#ifndef PPAPI_C_PPP_H_
#define PPAPI_C_PPP_H_
#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_module.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/ppb.h"
/**
* @file
* This file defines three functions that your module must
* implement to interact with the browser.
*/
#include "ppapi/c/pp_module.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/ppb.h"
#if __GNUC__ >= 4
#define PP_EXPORT __attribute__ ((visibility("default")))
#elif defined(_MSC_VER)
#define PP_EXPORT __declspec(dllexport)
#endif
/* {PENDING: undefine PP_EXPORT?} */
/* We don't want name mangling for these external functions. We only need
* 'extern "C"' if we're compiling with a C++ compiler.
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup Functions
* @{
*/
/**
* PPP_InitializeModule() is the entry point for a module and is called by the
* browser when your module loads. Your code must implement this function.
*
* Failure indicates to the browser that this module can not be used. In this
* case, the module will be unloaded and ShutdownModule will NOT be called.
*
* @param[in] module A handle to your module. Generally you should store this
* value since it will be required for other API calls.
* @param[in] get_browser_interface A pointer to the function that you can
* use to query for browser interfaces. Generally you should store this value
* for future use.
*
* @return <code>PP_OK</code> on success. Any other value on failure.
*/
PP_EXPORT int32_t PPP_InitializeModule(PP_Module module,
PPB_GetInterface get_browser_interface);
/**
* @}
*/
/**
* @addtogroup Functions
* @{
*/
/**
* PPP_ShutdownModule() is <strong>sometimes</strong> called before the module
* is unloaded. It is not recommended that you implement this function.
*
* There is no practical use of this function for third party modules. Its
* existence is because of some internal use cases inside Chrome.
*
* Since your module runs in a separate process, there's no need to free
* allocated memory. There is also no need to free any resources since all of
* resources associated with an instance will be force-freed when that instance
* is deleted.
*
* <strong>Note:</strong> This function will always be skipped on untrusted
* (Native Client) implementations. This function may be skipped on trusted
* implementations in certain circumstances when Chrome does "fast shutdown"
* of a web page.
*/
PP_EXPORT void PPP_ShutdownModule();
/**
* @}
*/
/**
* @addtogroup Functions
* @{
*/
/**
* PPP_GetInterface() is called by the browser to query the module for
* interfaces it supports.
*
* Your module must implement the <code>PPP_Instance</code> interface or it
* will be unloaded. Other interfaces are optional.
*
* This function is called from within browser code whenever an interface is
* needed. This means your plugin could be reentered via this function if you
* make a browser call and it needs an interface. Furthermore, you should not
* make any other browser calls from within your implementation to avoid
* reentering the browser.
*
* As a result, your implementation of this should merely provide a lookup
* from the requested name to an interface pointer, via something like a big
* if/else block or a map, and not do any other work.
*
* @param[in] interface_name A pointer to a "PPP" (plugin) interface name.
* Interface names are null-terminated ASCII strings.
*
* @return A pointer for the interface or <code>NULL</code> if the interface is
* not supported.
*/
PP_EXPORT const void* PPP_GetInterface(const char* interface_name);
/**
* @}
*/
#ifdef __cplusplus
} /* extern "C" */
#endif
/**
* @addtogroup Typedefs
* @{
*/
/**
* Defines the type of the <code>PPP_InitializeModule</code> function.
*/
typedef int32_t (*PP_InitializeModule_Func)(
PP_Module module,
PPB_GetInterface get_browser_interface);
/**
* Defines the type of the <code>PPP_ShutdownModule</code> function.
*/
typedef void (*PP_ShutdownModule_Func)(void);
/**
* Defines the type of the <code>PPP_ShutdownModule</code> function.
*/
typedef const void* (*PP_GetInterface_Func)(const char* interface_name);
/**
* @}
*/
#endif /* PPAPI_C_PPP_H_ */
| 5,166
|
https://github.com/atlasapi/atlas-deer/blob/master/atlas-api/src/main/java/org/atlasapi/system/HealthController.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
atlas-deer
|
atlasapi
|
Java
|
Code
| 121
| 538
|
package org.atlasapi.system;
import java.io.IOException;
import java.util.Map;
import java.util.Map.Entry;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import com.datastax.driver.core.Session;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HealthController {
private final Gson gson;
private final Session cassandra;
public HealthController(Session cassandra) {
this.cassandra = cassandra;
this.gson = new GsonBuilder().create();
}
@RequestMapping("/system/threads")
public void showThreads(HttpServletResponse response) throws IOException {
response.setContentType("text/html");
response.setStatus(200);
ServletOutputStream out = response.getOutputStream();
out.print("<html><body>");
final Map<Thread, StackTraceElement[]> traces = Thread.getAllStackTraces();
for (Entry<Thread, StackTraceElement[]> entry : traces.entrySet()) {
out.print(String.format(
"<font color='blue'>Stack trace for thread '%s'</font>:<br/>",
entry.getKey().getName()
));
for (StackTraceElement e : entry.getValue()) {
out.print(e.toString() + "<br/>");
}
out.print("<hr/>");
}
out.print("</body></html>");
out.close();
}
@RequestMapping("/system/cassandra")
public void showCassandraMetrics(HttpServletResponse response) throws IOException {
JsonElement json = gson.toJsonTree(cassandra.getCluster()
.getMetrics()
.getRegistry()
.getMetrics());
response.getWriter().write(gson.toJson(json));
response.setStatus(200);
response.flushBuffer();
}
}
| 24,240
|
https://github.com/ghiscoding/Angular-Slickgrid/blob/master/test/rxjsResourceStub.ts
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
Angular-Slickgrid
|
ghiscoding
|
TypeScript
|
Code
| 231
| 588
|
import { RxJsFacade } from '@slickgrid-universal/common';
import { EMPTY, iif, isObservable, firstValueFrom, Observable, ObservableInput, of, OperatorFunction, ObservedValueOf, Subject, switchMap, } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
export class RxJsResourceStub implements RxJsFacade {
readonly className = 'RxJsResource';
/**
* The same Observable instance returned by any call to without a scheduler.
* This returns the EMPTY constant from RxJS
*/
get EMPTY(): Observable<never> {
return EMPTY;
}
/** Simple method to create an Observable */
createObservable<T>(): Observable<T> {
return new Observable<T>();
}
/** Simple method to create a Subject */
createSubject<T>(): Subject<T> {
return new Subject<T>();
}
/** same Observable instance returned by any call to without a scheduler. It is preferrable to use this over empty() */
empty(): Observable<never> {
return EMPTY;
}
firstValueFrom<T>(source: Observable<T>): Promise<T> {
return firstValueFrom(source);
}
iif<T = never, F = never>(condition: () => boolean, trueResult?: any, falseResult?: any): Observable<T | F> {
return iif<T, F>(condition, trueResult, falseResult);
}
/** Tests to see if the object is an RxJS Observable */
isObservable(obj: any): boolean {
return isObservable(obj);
}
/** Converts the arguments to an observable sequence. */
of(value: any): Observable<any> {
return of(value);
}
switchMap<T, O extends ObservableInput<any>>(project: (value: T, index: number) => O): OperatorFunction<T, ObservedValueOf<O>> {
return switchMap(project);
}
/** Emits the values emitted by the source Observable until a `notifier` Observable emits a value. */
takeUntil<T>(notifier: Observable<any>): any {
return takeUntil<T>(notifier);
}
}
| 40,798
|
https://github.com/njw1204/BOJ-AC/blob/master/problem/01000~09999/02675/2675.py3.py
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
BOJ-AC
|
njw1204
|
Python
|
Code
| 13
| 62
|
for i in range(int(input())):
inp=input().split()
c=int(inp[0])
text=list(inp[1])
for j in text: print(j*c,end='')
print()
| 21,613
|
https://github.com/tatskie/Job-Hunt/blob/master/resources/views/backEnd/skills/create.blade.php
|
Github Open Source
|
Open Source
|
MIT
| null |
Job-Hunt
|
tatskie
|
PHP
|
Code
| 120
| 490
|
@extends('backLayout.app')
@section('title')
Create new Skill
@stop
@section('content')
<h1>Create New Skill</h1>
<hr/>
{!! Form::open(['url' => 'skills', 'class' => 'form-horizontal']) !!}
<div class="form-group {{ $errors->has('skill') ? 'has-error' : ''}}">
{!! Form::label('skill', 'Skill: ', ['class' => 'col-sm-3 control-label']) !!}
<div class="col-sm-6">
{!! Form::text('skill', null, ['class' => 'form-control']) !!}
{!! $errors->first('skill', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group {{ $errors->has('user_id') ? 'has-error' : ''}}">
{!! Form::label('user_id', 'User Id: ', ['class' => 'col-sm-3 control-label']) !!}
<div class="col-sm-6">
{!! Form::number('user_id', null, ['class' => 'form-control']) !!}
{!! $errors->first('user_id', '<p class="help-block">:message</p>') !!}
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-3">
{!! Form::submit('Create', ['class' => 'btn btn-primary form-control']) !!}
</div>
</div>
{!! Form::close() !!}
@if ($errors->any())
<ul class="alert alert-danger">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
@endif
@endsection
| 931
|
https://github.com/JonForShort/nes-emulator/blob/master/source/jones/ppu/ppu_render_context.hh
|
Github Open Source
|
Open Source
|
MIT
| 2,018
|
nes-emulator
|
JonForShort
|
C++
|
Code
| 245
| 615
|
//
// MIT License
//
// Copyright 2019
//
// 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.
//
#ifndef JONES_PPU_RENDER_CONTEXT_HH
#define JONES_PPU_RENDER_CONTEXT_HH
#include <cstdint>
namespace jones::ppu {
//
// https://wiki.nesdev.com/w/index.php/PPU_rendering
//
struct ppu_render_context {
uint8_t name_table{};
uint8_t attribute_table{};
uint8_t attribute_table_latch{};
uint8_t attribute_table_shift_low{};
uint8_t attribute_table_shift_high{};
uint8_t background_low{};
uint8_t background_high{};
uint16_t background_shift_low{};
uint16_t background_shift_high{};
uint8_t sprite_shift_low[8]{};
uint8_t sprite_shift_high[8]{};
uint8_t sprite_attribute_latches[8]{};
uint8_t sprite_x_position_counters[8]{};
uint32_t sprite_counter{};
bool sprite_zero_fetched{};
bool sprite_zero_evaluated{};
};
} // namespace jones::ppu
#endif // JONES_PPU_RENDER_CONTEXT_HH
| 5,428
|
https://github.com/ma-sadeghi/OpenPNM/blob/master/openpnm/materials/_bundle_of_tubes.py
|
Github Open Source
|
Open Source
|
MIT
| 2,021
|
OpenPNM
|
ma-sadeghi
|
Python
|
Code
| 619
| 2,313
|
import numpy as np
from openpnm.network import Cubic
from openpnm.utils import logging, Project, prettify_logger_message
from openpnm.geometry import GenericGeometry
from openpnm.phases import GenericPhase
from openpnm.topotools import trim
import openpnm.models as mods
logger = logging.getLogger(__name__)
class BundleOfTubesSettings:
adjust_psd = 'clip'
class BundleOfTubes(Project):
r"""
The materials class creats a network that matches the bundle-of-tubes model
An Project is returned that contain a network with a
bundle-of-tubes topology, and geometry object with the necessary pore
size information, and a phase object with pre-defined pore-scale physics
models attached. Note that this phase object does not have any actual
thermophysical properties which must be added by the user.
Parameters
----------
shape : array_like or int
The number of pores in the X and Y direction of the domain. It will
be 2 pores thick in the Z direction, as required to be a bundle of
tubes model. If an ``int`` is given it will be applied to both the
X and Y directions.
spacing : array_like or float
The spacing between the tubes in the X and Y direction. If a ``float``
is given it will be applied to both the X and Y directions.
length : float
The length of the tubes or thickness of the domain in the z-direction.
psd_params : dictionary
The parameters of the statistical distribution of the pore sizes.
The dictionary must contain the type of distribution to use (specified
as 'distribution'), selected from the ``scipy.stats`` module, and the
parameters corresponding to the chosen distribution.
The default is: ``{'distribution': 'norm', 'loc': 0.5, 'scale': 0.11}.
Note that ``scipy.stats`` uses *loc* and *scale* to be consistent
between different distribution types, instead of things like *mean*
and *stddev*.
name : str, optional
The name to give the Project
"""
def __init__(self, shape, spacing=1.0, length=1.0,
psd_params={"distribution": "norm", "loc": None, "scale": None},
name=None, settings=None, **kwargs):
import scipy.stats as spst
super().__init__(name=name)
self.settings._update(BundleOfTubesSettings, docs=True)
self.settings._update(settings) # Add user supplied settings
if isinstance(shape, int):
shape = np.array([shape, shape, 2])
elif len(shape) == 2:
shape = np.concatenate((np.array(shape), [2]))
else:
raise Exception('Unsupported shape; must be int or list of 2 ints')
if isinstance(spacing, (float, int)):
spacing = float(spacing)
self.settings['spacing'] = spacing
spacing = np.array([spacing, spacing, length])
else:
raise Exception('spacing not understood, must be float')
net = Cubic(shape=shape, spacing=spacing, project=self, **kwargs)
Ps_top = net.pores('top')
Ps_bot = net.pores('bottom')
Ts = net.find_connecting_throat(P1=Ps_top, P2=Ps_bot)
Ts = net.to_mask(throats=Ts)
trim(network=net, throats=~Ts)
geom = GenericGeometry(network=net, pores=net.Ps, throats=net.Ts)
geom.add_model(propname='throat.seed',
model=mods.geometry.throat_seed.random)
if psd_params['loc'] is None:
psd_params['loc'] = spacing[0]/2
if psd_params['scale'] is None:
psd_params['scale'] = spacing[0]/10
if psd_params['distribution'] in ['norm', 'normal', 'gaussian']:
geom.add_model(propname='throat.size_distribution',
seeds='throat.seed',
model=mods.geometry.throat_size.normal,
loc=psd_params['loc'], scale=psd_params['scale'])
elif psd_params['distribution'] in ['weibull']:
geom.add_model(propname='throat.size_distribution',
seeds='throat.seed',
model=mods.geometry.throat_size.weibull,
loc=psd_params['loc'],
scale=psd_params['scale'],
shape=psd_params['shape'])
else:
temp = psd_params.copy()
func = getattr(spst, temp.pop('distribution'))
psd = func.freeze(**temp)
geom.add_model(propname='throat.size_distribution',
seeds='throat.seed',
model=mods.geometry.throat_size.generic_distribution,
func=psd)
if np.any(geom['throat.size_distribution'] < 0):
msg = ('Given size distribution produced negative throat'
' diameters...these will be set to 0.')
logger.warning(prettify_logger_message(msg))
geom.add_model(propname='throat.diameter',
model=mods.misc.clip,
prop='throat.size_distribution',
xmin=1e-12, xmax=np.inf)
if self.settings['adjust_psd'] is None:
if geom['throat.size_distribution'].max() > spacing[0]:
msg = ('Given size distribution produced throats larger than'
' the spacing.')
logger.warning(prettify_logger_message(msg))
elif self.settings['adjust_psd'] == 'clip':
geom.add_model(propname='throat.diameter',
model=mods.misc.clip,
prop='throat.size_distribution',
xmin=1e-12, xmax=spacing[0])
if geom['throat.size_distribution'].max() > spacing[0]:
msg = ('Given size distribution produced throats larger than'
' the spacing...tube diameters will be clipped between'
' 0 and given spacing.')
logger.warning(prettify_logger_message(msg))
elif self.settings['adjust_psd'] == 'normalize':
tmin = max(1e-12, geom['throat.size_distribution'].min())
geom.add_model(propname='throat.diameter',
model=mods.misc.normalize,
prop='throat.size_distribution',
xmin=tmin, xmax=spacing[0])
if geom['throat.size_distribution'].max() > spacing[0]:
msg = ('Given size distribution produced throats larger than'
' the spacing...tube diameters will be normalized to'
' fit given spacing.')
logger.warning(prettify_logger_message(msg))
else:
logger.warning('Settings not understood, ignoring')
geom.add_model(propname='pore.diameter',
model=mods.geometry.pore_size.from_neighbor_throats,
prop='throat.diameter', mode='max')
geom.add_model(propname='pore.diameter',
model=mods.misc.constant, value=0.0)
geom.add_model(propname='throat.length',
model=mods.geometry.throat_length.ctc)
geom.add_model(propname='throat.area',
model=mods.geometry.throat_cross_sectional_area.cylinder)
geom.add_model(propname='pore.area',
model=mods.misc.from_neighbor_throats,
prop='throat.area')
geom.add_model(propname='pore.volume',
model=mods.misc.constant, value=0.0)
geom.add_model(propname='throat.volume',
model=mods.geometry.throat_volume.cylinder)
geom.regenerate_models()
# Now create a generic phase with physics models on it
phase = GenericPhase(network=net)
m = mods.physics.hydraulic_conductance.hagen_poiseuille
phase.add_model(propname='throat.hydraulic_conductance',
model=m, regen_mode='deferred')
m = mods.physics.diffusive_conductance.ordinary_diffusion
phase.add_model(propname='throat.diffusive_conductance',
model=m, regen_mode='deferred')
m = mods.physics.capillary_pressure.washburn
phase.add_model(propname='throat.entry_pressure',
model=m, regen_mode='deferred')
| 41,669
|
https://github.com/o-hayato/tsundoku-accelerator/blob/master/src/functions/prisma.ts
|
Github Open Source
|
Open Source
|
MIT
| null |
tsundoku-accelerator
|
o-hayato
|
TypeScript
|
Code
| 23
| 57
|
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient({
log: ['error', 'info', 'warn']
})
export default prisma
export * from '@prisma/client'
| 32,969
|
https://github.com/code-attic/Symbiote/blob/master/tests/Core.Tests/Log/with_test_logger.cs
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
Symbiote
|
code-attic
|
C#
|
Code
| 32
| 106
|
using Machine.Specifications;
using Symbiote.Core;
using Symbiote.Core.Log.Impl;
namespace Core.Tests.Log
{
public class with_test_logger : with_assimilation
{
protected static TestLogProvider LogProvider;
private Establish context = () =>
{
Assimilate.UseTestLogAdapter( Assimilate.Assimilation );
};
}
}
| 217
|
https://github.com/matthewgthomas/hierarchies-gifts/blob/master/run analyses.r
|
Github Open Source
|
Open Source
|
MIT
| null |
hierarchies-gifts
|
matthewgthomas
|
R
|
Code
| 176
| 430
|
##
## Analysis code for "Similar social complexity and cooperation in independent pastoralist societies"
##
## Author: Matthew Gwynfryn Thomas (@matthewgthomas)
##
## Packages used:
## - futile.logger
## - tidyverse
## - stringr
## - forcats
## - data.table
## - Matrix
## - RColorBrewer
## - rstanarm
## - loo (currently the development version for the model_weights() function)
## - bayesplot
## - xlsx
## - ineq
##
rm(list=ls())
# set up log file
library(futile.logger)
flog.appender(appender.file(paste0("analysis - ", format(Sys.time(), "%Y-%m-%d %H_%M_%S"), ".log"))) # create log file
# load all things
source("init.r")
source("init plots.r")
source("model comparison functions.r")
source("descriptive stats.r")
# social network analyses
source("SNA - reciprocity and assortment.r")
source("SNA - position and herd size.r")
# models predicting gift giving
source("multilevel models - fit.r") # warning: this will take at least a week to fit all models (!)
source("multilevel models - compare.r") # and this will take about 6 hours or so
source("multilevel models - analyse.r")
rmarkdown::render("results text.r", "word_document", output_dir=results.dir) # produce the in-text statistics
rmarkdown::render("map.Rmd", output_dir=docs.dir, output_file="index.html") # make the interactive map webpage
flog.info("Finished analysis!")
| 49,357
|
https://github.com/christiandavid/gatsby-theme-byfolio/blob/master/@christiandavid/gatsby-theme-byfolio/src/css/home.css.js
|
Github Open Source
|
Open Source
|
MIT
| 2,020
|
gatsby-theme-byfolio
|
christiandavid
|
JavaScript
|
Code
| 81
| 273
|
import { css } from "@emotion/core"
const styles = {
blackColor: css`
color: #000;
`,
dataSection: css`
height: 100%;
color: #fff;
`,
dataContainer: css`
margin: 0 auto;
padding: 0 3rem;
max-width: 700px;
height: 100%;
`,
dataContent: css`
padding-top: 20vh;
.Typewriter {
font-size: 1.5em;
}
`,
dataTopbar: css`
position: fixed;
top: 0;
left: 50%;
transform: translate(-50%, 0);
height: 80px;
z-index: 1;
p {
float: left;
line-height: 0px;
font-size: 0.74rem;
font-family: sans-serif;
padding: 39.5px 0;
font-weight: 700;
}
`,
}
export default styles
| 45,855
|
https://github.com/c3woc/c3woc-info-beamer/blob/master/content/node.lua
|
Github Open Source
|
Open Source
|
MIT
| null |
c3woc-info-beamer
|
c3woc
|
Lua
|
Code
| 106
| 316
|
gl.setup(NATIVE_WIDTH, NATIVE_HEIGHT)
local interval = 30
function make_switcher(childs, interval)
local next_switch = 0
local child
local function next_child()
child = childs.next()
next_switch = sys.now() + interval
end
local function draw()
if sys.now() > next_switch then
next_child()
end
util.draw_correct(resource.render_child(child), 0, 0, WIDTH, HEIGHT)
local remaining = next_switch - sys.now()
if remaining < 0.2 or remaining > interval - 0.2 then
util.post_effect(distort_shader, {
effect = 5 + remaining * math.sin(sys.now() * 50);
})
end
end
return {
draw = draw;
}
end
local switcher = make_switcher(util.generator(function()
local cycle = {}
for child, updated in pairs(CHILDS) do
table.insert(cycle, child)
end
return cycle
end), interval)
function node.render()
gl.clear(0,0,0,1)
switcher.draw()
end
| 1,505
|
https://github.com/emilva/spring-cloud-aws/blob/master/spring-cloud-aws-messaging/src/test/java/org/springframework/cloud/aws/messaging/listener/MessageListenerContainerTest.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| null |
spring-cloud-aws
|
emilva
|
Java
|
Code
| 1,030
| 4,883
|
/*
* Copyright 2013-2014 the original author or authors.
*
* 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.
*/
package org.springframework.cloud.aws.messaging.listener;
import com.amazonaws.services.sqs.AmazonSQSAsync;
import com.amazonaws.services.sqs.model.GetQueueAttributesRequest;
import com.amazonaws.services.sqs.model.GetQueueAttributesResult;
import com.amazonaws.services.sqs.model.GetQueueUrlRequest;
import com.amazonaws.services.sqs.model.GetQueueUrlResult;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.ArgumentCaptor;
import org.slf4j.Logger;
import org.springframework.cloud.aws.messaging.listener.AbstractMessageListenerContainer.QueueAttributes;
import org.springframework.cloud.aws.messaging.listener.annotation.SqsListener;
import org.springframework.cloud.aws.messaging.support.destination.DynamicQueueUrlDestinationResolver;
import org.springframework.context.support.StaticApplicationContext;
import org.springframework.messaging.core.CachingDestinationResolverProxy;
import org.springframework.messaging.core.DestinationResolutionException;
import org.springframework.messaging.core.DestinationResolver;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.withSettings;
/**
* @author Agim Emruli
* @author Alain Sahli
* @since 1.0
*/
public class MessageListenerContainerTest {
@Rule
public final ExpectedException expectedException = ExpectedException.none();
@Test
public void testAfterPropertiesSetIsSettingActiveFlag() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
container.setAmazonSqs(mock(AmazonSQSAsync.class, withSettings().stubOnly()));
container.setMessageHandler(mock(QueueMessageHandler.class));
container.afterPropertiesSet();
assertTrue(container.isActive());
}
@Test
public void testAmazonSqsNullThrowsException() throws Exception {
this.expectedException.expect(IllegalStateException.class);
this.expectedException.expectMessage("amazonSqs must not be null");
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
container.setMessageHandler(mock(QueueMessageHandler.class));
container.afterPropertiesSet();
}
@Test
public void testMessageHandlerNullThrowsException() throws Exception {
this.expectedException.expect(IllegalStateException.class);
this.expectedException.expectMessage("messageHandler must not be null");
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
container.setAmazonSqs(mock(AmazonSQSAsync.class, withSettings().stubOnly()));
container.afterPropertiesSet();
}
@Test
public void testDestinationResolverIsCreatedIfNull() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
container.setAmazonSqs(mock(AmazonSQSAsync.class, withSettings().stubOnly()));
container.setMessageHandler(mock(QueueMessageHandler.class));
container.afterPropertiesSet();
DestinationResolver<String> destinationResolver = container.getDestinationResolver();
assertNotNull(destinationResolver);
assertTrue(CachingDestinationResolverProxy.class.isInstance(destinationResolver));
}
@Test
public void testDisposableBeanResetActiveFlag() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
container.setAmazonSqs(mock(AmazonSQSAsync.class, withSettings().stubOnly()));
container.setMessageHandler(mock(QueueMessageHandler.class));
container.afterPropertiesSet();
container.destroy();
assertFalse(container.isActive());
}
@Test
public void testSetAndGetBeanName() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
container.setBeanName("test");
assertEquals("test", container.getBeanName());
}
@Test
public void testCustomDestinationResolverSet() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
container.setAmazonSqs(mock(AmazonSQSAsync.class, withSettings().stubOnly()));
container.setMessageHandler(mock(QueueMessageHandler.class));
DestinationResolver<String> destinationResolver = mock(DynamicQueueUrlDestinationResolver.class);
container.setDestinationResolver(destinationResolver);
container.afterPropertiesSet();
assertEquals(destinationResolver, container.getDestinationResolver());
}
@Test
public void testMaxNumberOfMessages() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
assertNull(container.getMaxNumberOfMessages());
container.setMaxNumberOfMessages(23);
assertEquals(new Integer(23), container.getMaxNumberOfMessages());
}
@Test
public void testVisibilityTimeout() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
assertNull(container.getVisibilityTimeout());
container.setVisibilityTimeout(32);
assertEquals(new Integer(32), container.getVisibilityTimeout());
}
@Test
public void testWaitTimeout() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
assertNull(container.getWaitTimeOut());
container.setWaitTimeOut(42);
assertEquals(new Integer(42), container.getWaitTimeOut());
}
@Test
public void testIsAutoStartup() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
assertTrue(container.isAutoStartup());
container.setAutoStartup(false);
assertFalse(container.isAutoStartup());
}
@Test
public void testGetAndSetPhase() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
assertEquals(Integer.MAX_VALUE, container.getPhase());
container.setPhase(23);
assertEquals(23L, container.getPhase());
}
@Test
public void testIsActive() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
AmazonSQSAsync mock = mock(AmazonSQSAsync.class, withSettings().stubOnly());
container.setAmazonSqs(mock);
container.setMessageHandler(mock(QueueMessageHandler.class));
container.afterPropertiesSet();
when(mock.getQueueUrl(new GetQueueUrlRequest().withQueueName("testQueue"))).
thenReturn(new GetQueueUrlResult().withQueueUrl("http://testQueue.amazonaws.com"));
container.start();
assertTrue(container.isRunning());
container.stop();
assertFalse(container.isRunning());
//Container can still be active an restarted later (e.g. paused for a while)
assertTrue(container.isActive());
}
@Test
public void receiveMessageRequests_withOneElement_created() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
AmazonSQSAsync mock = mock(AmazonSQSAsync.class, withSettings().stubOnly());
QueueMessageHandler messageHandler = new QueueMessageHandler();
container.setAmazonSqs(mock);
container.setMessageHandler(mock(QueueMessageHandler.class));
container.setMessageHandler(messageHandler);
StaticApplicationContext applicationContext = new StaticApplicationContext();
applicationContext.registerSingleton("messageListener", MessageListener.class);
container.setMaxNumberOfMessages(11);
container.setVisibilityTimeout(22);
container.setWaitTimeOut(33);
messageHandler.setApplicationContext(applicationContext);
when(mock.getQueueUrl(new GetQueueUrlRequest().withQueueName("testQueue"))).
thenReturn(new GetQueueUrlResult().withQueueUrl("http://testQueue.amazonaws.com"));
when(mock.getQueueAttributes(any(GetQueueAttributesRequest.class))).thenReturn(new GetQueueAttributesResult());
messageHandler.afterPropertiesSet();
container.afterPropertiesSet();
container.start();
Map<String, QueueAttributes> registeredQueues = container.getRegisteredQueues();
assertEquals("http://testQueue.amazonaws.com", registeredQueues.get("testQueue").getReceiveMessageRequest().getQueueUrl());
assertEquals(11L, registeredQueues.get("testQueue").getReceiveMessageRequest().getMaxNumberOfMessages().longValue());
assertEquals(22L, registeredQueues.get("testQueue").getReceiveMessageRequest().getVisibilityTimeout().longValue());
assertEquals(33L, registeredQueues.get("testQueue").getReceiveMessageRequest().getWaitTimeSeconds().longValue());
}
@Test
public void receiveMessageRequests_withMultipleElements_created() throws Exception {
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
AmazonSQSAsync mock = mock(AmazonSQSAsync.class, withSettings().stubOnly());
container.setAmazonSqs(mock);
StaticApplicationContext applicationContext = new StaticApplicationContext();
QueueMessageHandler messageHandler = new QueueMessageHandler();
messageHandler.setApplicationContext(applicationContext);
container.setMessageHandler(messageHandler);
applicationContext.registerSingleton("messageListener", MessageListener.class);
applicationContext.registerSingleton("anotherMessageListener", AnotherMessageListener.class);
container.setMaxNumberOfMessages(11);
container.setVisibilityTimeout(22);
container.setWaitTimeOut(33);
when(mock.getQueueUrl(new GetQueueUrlRequest().withQueueName("testQueue"))).
thenReturn(new GetQueueUrlResult().withQueueUrl("http://testQueue.amazonaws.com"));
when(mock.getQueueUrl(new GetQueueUrlRequest().withQueueName("anotherTestQueue"))).
thenReturn(new GetQueueUrlResult().withQueueUrl("http://anotherTestQueue.amazonaws.com"));
when(mock.getQueueAttributes(any(GetQueueAttributesRequest.class))).thenReturn(new GetQueueAttributesResult());
messageHandler.afterPropertiesSet();
container.afterPropertiesSet();
container.start();
Map<String, QueueAttributes> registeredQueues = container.getRegisteredQueues();
assertEquals("http://testQueue.amazonaws.com", registeredQueues.get("testQueue").getReceiveMessageRequest().getQueueUrl());
assertEquals(11L, registeredQueues.get("testQueue").getReceiveMessageRequest().getMaxNumberOfMessages().longValue());
assertEquals(22L, registeredQueues.get("testQueue").getReceiveMessageRequest().getVisibilityTimeout().longValue());
assertEquals(33L, registeredQueues.get("testQueue").getReceiveMessageRequest().getWaitTimeSeconds().longValue());
assertEquals("http://anotherTestQueue.amazonaws.com", registeredQueues.get("anotherTestQueue").getReceiveMessageRequest().getQueueUrl());
assertEquals(11L, registeredQueues.get("anotherTestQueue").getReceiveMessageRequest().getMaxNumberOfMessages().longValue());
assertEquals(22L, registeredQueues.get("anotherTestQueue").getReceiveMessageRequest().getVisibilityTimeout().longValue());
assertEquals(33L, registeredQueues.get("anotherTestQueue").getReceiveMessageRequest().getWaitTimeSeconds().longValue());
}
@Test
public void testStartCallsDoStartMethod() throws Exception {
final CountDownLatch countDownLatch = new CountDownLatch(1);
AbstractMessageListenerContainer container = new AbstractMessageListenerContainer() {
@Override
protected void doStart() {
countDownLatch.countDown();
}
@Override
protected void doStop() {
throw new UnsupportedOperationException("not supported yet");
}
};
AmazonSQSAsync mock = mock(AmazonSQSAsync.class, withSettings().stubOnly());
container.setAmazonSqs(mock);
container.setMessageHandler(mock(QueueMessageHandler.class));
container.afterPropertiesSet();
when(mock.getQueueUrl(new GetQueueUrlRequest().withQueueName("testQueue"))).
thenReturn(new GetQueueUrlResult().withQueueUrl("http://testQueue.amazonaws.com"));
container.start();
try {
assertTrue(countDownLatch.await(10, TimeUnit.MILLISECONDS));
} catch (InterruptedException e) {
fail("Expected doStart() method to be called");
}
}
@Test
public void testStopCallsDoStopMethod() throws Exception {
final CountDownLatch countDownLatch = new CountDownLatch(1);
AbstractMessageListenerContainer container = new AbstractMessageListenerContainer() {
@Override
protected void doStart() {
// do nothing in this case
}
@Override
protected void doStop() {
countDownLatch.countDown();
}
};
AmazonSQSAsync mock = mock(AmazonSQSAsync.class, withSettings().stubOnly());
container.setAmazonSqs(mock);
container.setMessageHandler(mock(QueueMessageHandler.class));
container.afterPropertiesSet();
when(mock.getQueueUrl(new GetQueueUrlRequest().withQueueName("testQueue"))).
thenReturn(new GetQueueUrlResult().withQueueUrl("http://testQueue.amazonaws.com"));
container.start();
container.stop();
try {
assertTrue(countDownLatch.await(10, TimeUnit.MILLISECONDS));
} catch (InterruptedException e) {
fail("Expected doStart() method to be called");
}
}
@Test
public void testStopCallsDoStopMethodWithRunnable() throws Exception {
final CountDownLatch countDownLatch = new CountDownLatch(1);
AbstractMessageListenerContainer container = new AbstractMessageListenerContainer() {
@Override
protected void doStart() {
// do nothing in this case
}
@Override
protected void doStop() {
countDownLatch.countDown();
}
};
AmazonSQSAsync mock = mock(AmazonSQSAsync.class, withSettings().stubOnly());
container.setAmazonSqs(mock);
container.setMessageHandler(mock(QueueMessageHandler.class));
container.afterPropertiesSet();
when(mock.getQueueUrl(new GetQueueUrlRequest().withQueueName("testQueue"))).
thenReturn(new GetQueueUrlResult().withQueueUrl("http://testQueue.amazonaws.com"));
container.start();
container.stop(new Runnable() {
@Override
public void run() {
try {
assertTrue(countDownLatch.await(10, TimeUnit.MILLISECONDS));
} catch (InterruptedException e) {
fail("Expected doStart() method to be called");
}
}
});
}
@Test
public void doDestroy_WhenContainerIsDestroyed_shouldBeCalled() throws Exception {
// Arrange
DestroyAwareAbstractMessageListenerContainer abstractMessageListenerContainer = new DestroyAwareAbstractMessageListenerContainer();
// Act
abstractMessageListenerContainer.destroy();
// Assert
assertTrue(abstractMessageListenerContainer.isDestroyCalled());
}
@Test
public void receiveMessageRequests_withDestinationResolverThrowingException_shouldLogWarningAndNotCreateRequest() throws Exception {
// Arrange
AbstractMessageListenerContainer container = new StubAbstractMessageListenerContainer();
Logger loggerMock = container.getLogger();
AmazonSQSAsync mock = mock(AmazonSQSAsync.class, withSettings().stubOnly());
container.setAmazonSqs(mock);
StaticApplicationContext applicationContext = new StaticApplicationContext();
QueueMessageHandler messageHandler = new QueueMessageHandler();
messageHandler.setApplicationContext(applicationContext);
container.setMessageHandler(messageHandler);
applicationContext.registerSingleton("messageListener", MessageListener.class);
applicationContext.registerSingleton("anotherMessageListener", AnotherMessageListener.class);
when(mock.getQueueUrl(new GetQueueUrlRequest().withQueueName("testQueue"))).
thenThrow(new DestinationResolutionException("Queue not found"));
when(mock.getQueueUrl(new GetQueueUrlRequest().withQueueName("anotherTestQueue"))).
thenReturn(new GetQueueUrlResult().withQueueUrl("http://anotherTestQueue.amazonaws.com"));
when(mock.getQueueAttributes(any(GetQueueAttributesRequest.class))).thenReturn(new GetQueueAttributesResult());
messageHandler.afterPropertiesSet();
container.afterPropertiesSet();
// Act
container.start();
// Assert
ArgumentCaptor<String> logMsgArgCaptor = ArgumentCaptor.forClass(String.class);
verify(loggerMock).warn(logMsgArgCaptor.capture());
Map<String, QueueAttributes> registeredQueues = container.getRegisteredQueues();
assertFalse(registeredQueues.containsKey("testQueue"));
assertEquals("Ignoring queue with name 'testQueue' as it does not exist.", logMsgArgCaptor.getValue());
assertEquals("http://anotherTestQueue.amazonaws.com", registeredQueues.get("anotherTestQueue").getReceiveMessageRequest().getQueueUrl());
}
private static class StubAbstractMessageListenerContainer extends AbstractMessageListenerContainer {
private final Logger mock = mock(Logger.class);
@Override
protected void doStart() {
}
@Override
protected void doStop() {
}
@Override
protected Logger getLogger() {
return this.mock;
}
}
private static class MessageListener {
@SuppressWarnings({"UnusedDeclaration", "EmptyMethod"})
@SqsListener("testQueue")
public void listenerMethod(String ignore) {
}
}
private static class AnotherMessageListener {
@SuppressWarnings({"UnusedDeclaration", "EmptyMethod"})
@SqsListener("anotherTestQueue")
public void listenerMethod(String ignore) {
}
}
private static class DestroyAwareAbstractMessageListenerContainer extends AbstractMessageListenerContainer {
private boolean destroyCalled;
private boolean isDestroyCalled() {
return this.destroyCalled;
}
@Override
protected void doStart() {
}
@Override
protected void doStop() {
}
@Override
protected void doDestroy() {
this.destroyCalled = true;
}
}
}
| 44,054
|
https://github.com/cryptoyyxx/starcoin-java/blob/master/src/main/java/org/starcoin/serde/format/jackson/utils/MappingUtils.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
starcoin-java
|
cryptoyyxx
|
Java
|
Code
| 105
| 436
|
package org.starcoin.serde.format.jackson.utils;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.starcoin.serde.format.*;
import org.starcoin.serde.format.jackson.*;
import java.util.Map;
public class MappingUtils {
private MappingUtils() {
}
/**
* Convert 'dynamic' map(probably loaded directly from YAML/JSON) to ContainerFormat map.
*
* @param objectMapper ObjectMapper
* @param map Origin map.
* @return ContainerFormat map.
*/
public static Map<String, ContainerFormat> toContainerFormatMap(ObjectMapper objectMapper, Map<String, Object> map) {
return objectMapper.convertValue(map,
new TypeReference<Map<String, ContainerFormat>>() {
});
}
public static ObjectMapper getObjectMapper() {
ObjectMapper objectMapper = new ObjectMapper();
SimpleModule module = new SimpleModule();
module.addDeserializer(ContainerFormat.class, new ContainerFormatDeserializer());
module.addDeserializer(Format.class, new FormatDeserializer());
module.addDeserializer(NamedFormat.class, new NamedFormatDeserializer());
module.addDeserializer(Format.class, new FormatDeserializer());
module.addDeserializer(NamedVariantFormat.class, new NamedVariantFormatDeserializer());
module.addDeserializer(VariantFormat.class, new VariantFormatDeserializer());
objectMapper.registerModule(module);
return objectMapper;
}
}
| 20,606
|
https://github.com/artevance/bangsus/blob/master/resources/js/views/karyawan/Profil.vue
|
Github Open Source
|
Open Source
|
MIT
| null |
bangsus
|
artevance
|
Vue
|
Code
| 398
| 2,077
|
<template>
<div class="row mt-5">
<transition name="fade" mode="out-in">
<preloader-component v-if="state.page.loading"/>
<div class="col-12 col-xl-12 stretch-card" v-else>
<div class="card">
<div class="card-body">
<router-link :to="{ name: 'karyawan' }">
<i class="fas fa-backspace"></i> Kembali
</router-link>
<div v-if="$access('karyawan.tugasKaryawan', 'read')">
<div class="card-title mt-5">Informasi Pribadi</div>
<div class="row">
<div class="col-12 col-lg-6">
<div class="form-group">
<label>NIP</label>
<input type="text" class="form-control" v-model="data.karyawan.nip" readonly>
</div>
<div class="form-group">
<label>NIK</label>
<input type="text" class="form-control" v-model="data.karyawan.nik" readonly>
</div>
<div class="form-group">
<label>Nama Karyawan</label>
<input type="text" class="form-control" v-model="data.karyawan.nama_karyawan" readonly>
</div>
</div>
<div class="col-12 col-lg-6">
<div class="form-group">
<label>Tempat Lahir</label>
<input type="text" class="form-control" v-model="data.karyawan.tempat_lahir" readonly>
</div>
<div class="form-group">
<label>Tanggal Lahir</label>
<input type="date" class="form-control" v-model="data.karyawan.tanggal_lahir" readonly>
</div>
<div class="row">
<div class="col-6">
<label>Golongan Darah</label>
<input type="text" class="form-control" v-model="data.karyawan.golongan_darah.golongan_darah" readonly>
</div>
<div class="col-6">
<label>Jenis Kelamin</label>
<input type="text" class="form-control" v-model="data.karyawan.jenis_kelamin.jenis_kelamin" readonly>
</div>
</div>
</div>
</div>
<div class="card-title mt-5">Foto KTP</div>
<div v-if="data.karyawan.foto_ktp_id">
<span class="text-success d-block">SUDAH DIUPLOAD</span>
<button class="btn btn-primary d-block my-2" @click="showCreateFotoKTPModal" v-if="$access('karyawan.profil.fotoKTP', 'create')">Upload Sekarang</button>
<img :src="'/gambar/' + data.karyawan.foto_ktp_id" style="max-height: 10%; max-width: 30%">
</div>
<div v-else>
<span class="text-danger d-block">BELUM DIUPLOAD</span>
<button class="btn btn-primary" @click="showCreateFotoKTPModal" v-if="$access('karyawan.profil.fotoKTP', 'create')">Upload Sekarang</button>
</div>
</div>
</div>
</div>
</div>
</transition>
<!-- -->
<div class="modal fade" data-entity="karyawan.fotoKTP" data-method="create" data-backdrop="static" data-keyboard="false" tabindex="-1" v-if="$access('karyawan.profil.fotoKTP', 'create')">
<div class="modal-dialog">
<div class="modal-content">
<form @submit.prevent="updateFotoKTP">
<div class="modal-header">
<h5 class="modal-title">Tambah Foto KTP</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Foto KTP</label>
<input type="file" class="form-control" @input="handleFile">
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary" :disabled="form.fotoKTP.create.loading">
<spinner-component size="sm" color="light" v-if="form.fotoKTP.create.loading"/>
Tambah
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
state: { page: { loading: true } },
data: {
karyawan: {},
tugas_karyawan: [],
cabang: [],
divisi: [],
jabatan: []
},
form: {
fotoKTP: {
create: {
loading: false,
data: {
id: this.$route.params.id,
foto_ktp: ''
}
}
}
}
}
},
created() {
this.prepare()
},
methods: {
/**
* Prepare the page.
*/
prepare() {
this.state.page.loading = true
Promise.all([
this.fetchKaryawan()
])
.then(res => {
this.data.karyawan = res[0].data.container
this.state.page.loading = false
})
.catch(err => {
this.$router.go(-1)
})
},
/**
* Fetch data
*/
fetchKaryawan() {
return this.$axios.get('/ajax/v1/karyawan/' + this.$route.params.id)
},
fetchCabang() {
return this.$axios.get('/ajax/v1/master/cabang')
},
fetchDivisi() {
return this.$axios.get('/ajax/v1/master/divisi')
},
fetchJabatan() {
return this.$axios.get('/ajax/v1/master/jabatan')
},
/**
* Modals
*/
showCreateFotoKTPModal() {
$('[data-entity="karyawan.fotoKTP"][data-method="create"]').modal('show')
},
/**
* Actions
*/
updateFotoKTP() {
this.form.fotoKTP.create.loading = true
this.$axios.put('/ajax/v1/karyawan/foto_ktp', this.form.fotoKTP.create.data)
.then(res => {
$('[data-entity="karyawan.fotoKTP"][data-method="create"]').modal('hide')
this.prepare()
})
.catch(err => {})
.finally(() => {
this.form.fotoKTP.create.loading = false
})
},
handleFile(e) {
let r = new FileReader()
r.readAsDataURL(e.target.files[0])
r.onload = () => this.form.fotoKTP.create.data.foto_ktp = r.result
this.$emit('input', e.target.files[0])
}
}
}
</script>
| 18,650
|
https://github.com/scala-steward/recursionz/blob/master/build.sbt
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,019
|
recursionz
|
scala-steward
|
Scala
|
Code
| 163
| 619
|
import enzief.Dependencies._
fork in Test in ThisBuild := true
resolvers in ThisBuild ++= Seq(
Resolver.sonatypeRepo("snapshots")
)
lazy val root: Project = (project in file("."))
.aggregate(scalaz, eg, testz)
.enablePlugins(ProjectPlugin)
.settings(
skip in publish := true
)
lazy val scalaz: Project = (project in file("scalaz"))
.enablePlugins(ProjectPlugin)
.settings(
schemez(Compile, "main"),
schemez(Test, "test"),
name := "schemez-scalaz",
skip in publish := false,
publishArtifact in makePom := true,
publishArtifact := true,
libraryDependencies ++= Seq(
Scalaz.core
)
)
def schemez(scope: Configuration, path: String): Setting[Seq[File]] =
scope / unmanagedSourceDirectories += (
baseDirectory
.in(scope)
.value / s"../schemez/src/$path/scala"
).getCanonicalFile
lazy val eg: Project = (project in file("example"))
.enablePlugins(ProjectPlugin)
.dependsOn(scalaz)
.settings(
name := "example",
skip in publish := true
)
lazy val testz: Project = (project in file("testz"))
.enablePlugins(ProjectPlugin)
.dependsOn(eg, scalaz)
.settings(
name := "testz",
skip in publish := true,
libraryDependencies ++= Seq(
Scalaz.Testz.testz,
Scalaz.laws,
Testing.scalaCheck
)
)
addCommandAlias(
"fmt",
";scalafmtSbt;scalafmt;test:scalafmt"
)
addCommandAlias(
"wip",
";headerCreate;test:headerCreate" +
";fmt" +
";test:compile"
)
addCommandAlias(
"check",
";headerCheck;test:headerCheck" +
";scalafmtCheck;test:scalafmtCheck;scalafmtSbtCheck" +
";evicted;test:evicted" +
";scalafix --check;test:scalafix --check" +
";scalastyle;test:scalastyle"
)
| 43,490
|
https://github.com/inai17ibar/nnabla-rl/blob/master/reproductions/atari/c51/reproduction_results/RobotankNoFrameskip-v4_results/seed-100/evaluation_result_scalar.tsv
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
nnabla-rl
|
inai17ibar
|
TSV
|
Code
| 1,206
| 4,733
|
iteration mean std_dev min max median
250000 1.797 1.375 0.000 5.000 1.000
500000 3.488 1.849 0.000 8.000 4.000
750000 12.136 5.480 4.000 25.000 11.000
1000000 10.808 4.000 3.000 18.000 11.000
1250000 3.050 1.596 1.000 7.000 3.000
1500000 2.333 1.011 1.000 5.000 2.000
1750000 5.933 2.886 2.000 13.000 5.000
2000000 15.167 3.655 9.000 21.000 14.000
2250000 2.812 2.118 0.000 9.000 3.000
2500000 14.857 3.563 10.000 26.000 14.000
2750000 1.431 0.877 0.000 5.000 1.000
3000000 12.458 3.840 7.000 23.000 12.000
3250000 13.417 5.431 2.000 23.000 13.000
3500000 16.950 5.408 10.000 30.000 15.000
3750000 8.435 3.268 3.000 13.000 10.000
4000000 12.103 3.925 4.000 24.000 11.000
4250000 15.552 5.263 2.000 25.000 15.000
4500000 10.000 3.642 2.000 19.000 10.000
4750000 13.848 4.749 4.000 23.000 14.000
5000000 4.438 1.978 2.000 9.000 4.000
5250000 22.926 6.440 10.000 40.000 22.000
5500000 16.148 3.979 10.000 29.000 16.000
5750000 30.000 7.218 17.000 40.000 32.000
6000000 26.261 7.432 17.000 44.000 23.000
6250000 21.636 6.938 9.000 35.000 20.000
6500000 20.273 6.290 12.000 33.000 19.500
6750000 15.033 4.750 6.000 29.000 14.000
7000000 21.600 5.208 14.000 37.000 22.000
7250000 26.905 6.928 16.000 38.000 26.000
7500000 27.842 8.210 12.000 41.000 31.000
7750000 23.571 7.811 13.000 38.000 21.000
8000000 21.250 7.155 6.000 35.000 22.000
8250000 30.650 7.478 20.000 41.000 31.500
8500000 20.545 6.569 12.000 39.000 19.000
8750000 23.050 5.054 16.000 35.000 22.000
9000000 31.100 7.442 20.000 47.000 31.000
9250000 19.611 5.955 10.000 33.000 18.500
9500000 26.600 8.645 12.000 38.000 25.000
9750000 34.167 8.585 14.000 47.000 35.000
10000000 24.700 8.032 13.000 41.000 22.500
10250000 33.750 6.067 21.000 43.000 35.500
10500000 31.294 8.790 16.000 41.000 36.000
10750000 29.429 9.292 16.000 50.000 31.000
11000000 30.800 6.954 19.000 43.000 31.000
11250000 28.474 8.107 18.000 46.000 29.000
11500000 28.579 8.178 19.000 43.000 26.000
11750000 29.471 8.746 10.000 40.000 30.000
12000000 28.889 8.013 14.000 41.000 30.000
12250000 19.308 6.603 13.000 41.000 18.000
12500000 24.684 8.085 15.000 46.000 22.000
12750000 29.947 8.185 16.000 43.000 34.000
13000000 34.611 6.219 23.000 46.000 36.000
13250000 39.000 4.366 32.000 50.000 39.000
13500000 26.714 8.183 16.000 43.000 23.000
13750000 29.000 6.588 19.000 40.000 29.000
14000000 37.263 4.458 29.000 45.000 37.000
14250000 31.176 9.457 15.000 43.000 35.000
14500000 34.263 7.517 20.000 48.000 36.000
14750000 31.600 9.925 16.000 47.000 36.000
15000000 42.421 6.508 35.000 63.000 40.000
15250000 41.312 6.880 29.000 56.000 39.000
15500000 32.625 8.015 17.000 44.000 34.000
15750000 38.857 8.543 22.000 56.000 41.000
16000000 41.444 3.818 35.000 50.000 40.500
16250000 40.412 6.954 30.000 59.000 39.000
16500000 32.765 6.504 20.000 39.000 36.000
16750000 34.238 5.822 18.000 45.000 34.000
17000000 42.278 7.422 32.000 60.000 41.000
17250000 41.895 7.704 20.000 52.000 43.000
17500000 30.294 7.323 15.000 42.000 29.000
17750000 37.278 8.299 23.000 56.000 37.500
18000000 39.625 9.597 21.000 58.000 39.000
18250000 39.333 8.569 23.000 60.000 39.000
18500000 39.250 10.779 21.000 61.000 39.500
18750000 38.471 6.563 21.000 49.000 39.000
19000000 32.667 6.857 18.000 44.000 35.000
19250000 33.789 10.252 17.000 49.000 38.000
19500000 33.000 7.700 22.000 47.000 34.000
19750000 39.562 11.280 18.000 58.000 40.000
20000000 39.929 6.100 26.000 51.000 38.500
20250000 39.278 7.046 22.000 50.000 41.500
20500000 40.263 11.929 15.000 59.000 42.000
20750000 28.158 7.721 13.000 41.000 28.000
21000000 45.684 7.616 29.000 60.000 46.000
21250000 40.824 6.802 21.000 52.000 42.000
21500000 33.778 7.913 22.000 49.000 32.500
21750000 44.556 4.728 34.000 51.000 45.000
22000000 46.222 5.808 38.000 56.000 45.500
22250000 41.000 9.018 23.000 66.000 41.000
22500000 41.375 8.358 26.000 53.000 41.500
22750000 29.833 6.833 18.000 40.000 30.500
23000000 17.750 7.529 7.000 36.000 17.000
23250000 46.368 10.494 22.000 62.000 47.000
23500000 45.067 7.567 30.000 57.000 44.000
23750000 37.737 8.896 20.000 54.000 40.000
24000000 33.111 9.158 18.000 46.000 32.000
24250000 46.062 9.705 23.000 63.000 45.500
24500000 47.059 9.867 21.000 64.000 46.000
24750000 41.412 8.879 28.000 62.000 38.000
25000000 22.870 6.096 11.000 37.000 22.000
25250000 41.688 8.780 24.000 58.000 42.500
25500000 41.750 7.957 22.000 58.000 41.500
25750000 34.533 4.145 26.000 41.000 36.000
26000000 39.722 7.701 22.000 51.000 40.500
26250000 43.833 7.960 22.000 58.000 44.000
26500000 44.125 6.431 36.000 61.000 42.500
26750000 40.688 6.593 29.000 58.000 41.000
27000000 36.312 9.047 21.000 50.000 40.500
27250000 40.500 13.115 16.000 61.000 42.500
27500000 42.875 6.264 35.000 59.000 42.500
27750000 50.824 11.242 22.000 70.000 52.000
28000000 40.533 5.965 34.000 56.000 38.000
28250000 45.267 10.305 24.000 60.000 42.000
28500000 45.000 8.552 28.000 63.000 43.500
28750000 43.737 5.514 33.000 54.000 44.000
29000000 49.111 8.543 31.000 66.000 48.000
29250000 47.647 6.668 33.000 57.000 46.000
29500000 53.312 5.955 42.000 61.000 55.500
29750000 44.611 8.354 18.000 58.000 45.000
30000000 38.176 8.431 24.000 59.000 38.000
30250000 46.647 8.345 22.000 61.000 47.000
30500000 43.533 9.229 22.000 56.000 45.000
30750000 40.500 6.850 22.000 55.000 40.500
31000000 37.059 9.813 23.000 56.000 37.000
31250000 43.647 6.894 30.000 57.000 44.000
31500000 45.294 7.258 31.000 59.000 45.000
31750000 48.529 7.147 34.000 62.000 49.000
32000000 51.133 7.873 36.000 62.000 52.000
32250000 49.000 8.858 23.000 62.000 50.000
32500000 47.941 7.981 37.000 66.000 46.000
32750000 43.812 11.501 24.000 64.000 41.000
33000000 48.625 8.306 34.000 62.000 48.500
33250000 45.556 8.995 26.000 61.000 44.500
33500000 43.824 6.528 36.000 57.000 42.000
33750000 47.667 8.406 34.000 62.000 46.500
34000000 39.706 9.112 22.000 56.000 39.000
34250000 52.118 8.281 36.000 62.000 54.000
34500000 57.059 7.231 38.000 63.000 60.000
34750000 42.688 6.488 34.000 58.000 41.000
35000000 37.765 8.426 22.000 50.000 40.000
35250000 40.294 12.082 23.000 62.000 42.000
35500000 45.875 8.007 28.000 63.000 45.500
35750000 53.118 7.768 38.000 62.000 54.000
36000000 48.529 7.562 36.000 63.000 48.000
36250000 44.929 5.147 38.000 55.000 44.500
36500000 57.000 7.251 41.000 65.000 59.000
36750000 48.944 7.735 38.000 60.000 46.000
37000000 54.933 8.136 40.000 67.000 55.000
37250000 50.067 9.767 28.000 61.000 53.000
37500000 52.333 8.244 35.000 62.000 55.000
37750000 54.500 6.699 39.000 63.000 55.500
38000000 53.812 6.327 42.000 63.000 54.500
38250000 46.562 8.162 34.000 61.000 46.000
38500000 53.529 7.228 39.000 65.000 55.000
38750000 41.125 9.110 25.000 58.000 41.000
39000000 50.929 7.750 34.000 61.000 52.500
39250000 47.765 8.019 37.000 70.000 46.000
39500000 56.000 7.236 45.000 69.000 55.000
39750000 48.167 8.783 30.000 63.000 46.500
40000000 54.000 7.004 44.000 63.000 53.000
40250000 59.647 7.918 42.000 73.000 61.000
40500000 59.438 8.078 40.000 68.000 62.500
40750000 52.176 7.438 40.000 64.000 53.000
41000000 44.529 6.801 34.000 60.000 43.000
41250000 50.000 7.027 37.000 62.000 48.500
41500000 56.471 7.064 42.000 68.000 58.000
41750000 52.125 8.138 39.000 62.000 53.500
42000000 46.125 10.416 23.000 60.000 45.500
42250000 50.625 6.999 41.000 62.000 49.000
42500000 57.611 7.521 42.000 68.000 61.000
42750000 35.312 10.276 21.000 61.000 36.500
43000000 54.056 6.544 43.000 63.000 56.500
43250000 49.650 9.779 35.000 63.000 48.000
43500000 52.235 9.117 36.000 64.000 56.000
43750000 56.188 7.493 38.000 66.000 57.000
44000000 43.611 8.883 22.000 61.000 44.500
44250000 50.684 7.780 39.000 62.000 49.000
44500000 52.444 7.904 38.000 64.000 54.500
44750000 56.824 7.213 42.000 64.000 59.000
45000000 53.312 8.571 37.000 67.000 56.500
45250000 35.455 14.556 19.000 59.000 36.000
45500000 53.611 11.398 23.000 63.000 59.500
45750000 40.900 5.957 31.000 59.000 39.500
46000000 51.000 6.982 40.000 62.000 50.000
46250000 48.600 10.849 23.000 68.000 47.000
46500000 53.500 7.673 40.000 68.000 53.000
46750000 38.625 8.462 20.000 52.000 39.000
47000000 55.625 7.296 41.000 61.000 60.000
47250000 54.118 7.379 40.000 64.000 55.000
47500000 46.000 12.324 22.000 65.000 48.000
47750000 51.000 7.796 36.000 65.000 51.500
48000000 53.222 8.330 37.000 65.000 55.000
48250000 52.000 7.071 40.000 62.000 53.000
48500000 55.941 6.458 42.000 63.000 60.000
48750000 52.833 8.036 42.000 66.000 54.500
49000000 47.778 10.217 22.000 62.000 48.000
49250000 47.556 10.631 21.000 63.000 49.000
49500000 58.000 6.444 42.000 66.000 60.000
49750000 49.071 7.778 35.000 61.000 49.500
50000000 52.588 6.334 41.000 62.000 53.000
| 33,747
|
https://github.com/FarisLucky/sidepi-project/blob/master/application/controllers/KelolaUser.php
|
Github Open Source
|
Open Source
|
MIT
| null |
sidepi-project
|
FarisLucky
|
PHP
|
Code
| 569
| 3,172
|
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Kelolauser extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->rolemenu->init();
$this->load->library("form_validation");
}
public function index()
{
$data['title'] = 'User';
$data['menus'] = $this->rolemenu->getMenus();
$data['user'] = $this->modelapp->getData("*","tbl_users")->result();
$data['img'] = getCompanyLogo();
$this->pages('kelola_user/view_kelola_user',$data);
}
public function tambah() //Menampilkan Form Tambah
{
$data['title'] = 'Tambah User';
$data['menus'] = $this->rolemenu->getMenus();
$data['akses'] = $this->modelapp->getData("*","user_role")->result(); //Mengambil data role akses
$data['img'] = getCompanyLogo();
$this->pages('kelola_user/view_tambah_user',$data);
}
public function coreTambah() //Core Tambah
{
$this->validate();
if ($this->form_validation->run() == false) {
$this->tambah();
} else {
$input = $this->inputPost();
$password = password_hash($this->input->post('txt_password', true), PASSWORD_DEFAULT);
$input += ["password"=>$password,"foto_user"=>"default.jpg",'tanggal_buat'=>date('Y-m-d')];
$act = $this->modelapp->insertData($input,"user");
if ($act) {
$this->session->set_flashdata('success', "Berhasil ditambahkan");
redirect("kelolauser/tambah");
}
}
}
public function dataUsers() //Fungsi Untuk Load Datatable
{
$this->load->model('Server_side', 'ssd');
$column = "*";
$tbl = "tbl_users";
$nama = "akses";
$search = ['nama_lengkap', 'email', 'no_hp', 'status_user', 'akses'];
$fetch_values = $this->ssd->makeDataTables($column, $tbl, $search, $nama);
$data = array();
foreach ($fetch_values as $value) {
if ($value->akses != 'owner') {
$this->status = '<a href="' . base_url() . 'kelolauser/detailuser/' . $value->id_user . '" class="btn btn-icons btn-inverse-info mx-2" id="detail_data_user"><i class="fa fa-info"></i></a><button type="button" class="btn btn-icons btn-inverse-danger" onclick="deleteItem('."'kelolauser/hapus/$value->id_user'".')"><i class="fa fa-trash"></i></button>';
if ($value->status_user == 'aktif') {
$this->status .= '<button type="button" class="btn btn-sm btn-warning mx-2" onclick="setItem('."'kelolauser/aktifnonaktif/$value->id_user','Nonaktifkan'".')">Nonaktif</button>';
} else {
$this->status .= '<button type="button" class="btn btn-sm btn-warning mx-2" onclick="setItem('."'kelolauser/aktifnonaktif/$value->id_user','Aktifkan'".')">Aktifkan</button>';
}
$this->status .= '<button class="btn btn-sm btn-success" onclick="getModal('."'$value->id_user'".')">Change Password</button>';
} else {
$this->status = '-';
}
$sub = array();
$sub[] = $value->nama_lengkap;
$sub[] = $value->Email;
$sub[] = $value->no_hp;
$sub[] = '<small class="badge badge-primary">' . $value->akses . '</small>';
$sub[] = '<small class="badge badge-info">' . $value->status_user . '</small>';
$sub[] = $this->status;
$data[] = $sub;
}
$output = array(
'draw' => intval($this->input->post('draw')),
'recordsTotal' => intval($this->ssd->get_all_datas($tbl)),
'recordsFiltered' => intval($this->ssd->get_filtered_datas($column, $tbl, $search, $nama)),
'data' => $data
);
return $this->output->set_output(json_encode($output));
}
public function aktifNonaktif($id) //Fungsi Mengubah status User
{
$input = (int) $id;
$get_status = $this->modelapp->getData("status_user","user",["id_user"=>$input]);
if ($get_status->num_rows() > 0) {
$status = $get_status->row_array();
if ($status["status_user"] == "aktif") {
$set_status = "nonaktif";
}else{
$set_status = "aktif";
}
$query = $this->modelapp->updateData(["status_user"=>$set_status],"user",["id_user"=>$input]);
if ($query) {
$this->session->set_flashdata("success","Berhasil diubah");
redirect("kelolauser");
}else{
$this->session->set_flashdata("failed","Gagal diubah");
redirect("kelolauser");
}
}else{
$this->session->set_flashdata("failed","User tidak ditemukan");
redirect("kelolauser");
}
}
public function detailUser($id) //FUngsi menampilkan form detail
{
$active = 'Detail User';
$data['title'] = 'Detail User';
$data['menus'] = $this->rolemenu->getMenus();
$data['users'] = $this->modelapp->getData("*","tbl_users",["id_user"=>$id])->row();
$data['properti'] = $this->modelapp->getData("id_properti,nama_properti,foto_properti","properti",["status"=>"publish"])->result();
$data['img'] = getCompanyLogo();
$this->pages('kelola_user/view_detail_user',$data);
}
public function userProperti() //Menambahkan user assign properti
{
$id = $this->input->post('hidden_user',true);
$properti = $this->input->post('user_properti');
if (isset($properti)) {
$this->modelapp->deleteData(["id_user"=>$id],"user_assign_properti");
foreach ($properti as $key => $value) {
$this->modelapp->insertData(["id_properti"=>$value,"id_user"=>$id],"user_assign_properti");
}
$this->session->set_flashdata("success","Berhasil ditambahkan");
redirect("kelolauser/detailuser/".$id);
}else{
$this->modelapp->deleteData(["id_user"=>$id],"user_assign_properti");
$this->session->set_flashdata("success","Berhasil diubah");
redirect("kelolauser/detailuser".$id);
}
}
public function hapus($id) //Menghapus User
{
$foto = $this->modelapp->getData("foto_user","user",["id_user"=>$id])->row_array();
$path = "./assets/uploads/images/profil/user/".$foto["foto_user"];
if ($foto["foto_user"] != "default.jpg") {
if (file_exists($path) && !is_dir($path)) {
unlink($path);
}
}
$hapus = $this->modelapp->deleteData(["id_user"=>$id],"user");
if ($hapus) {
$this->session->set_flashdata('success',"Berhasil dihapus");
redirect("kelolauser");
} else {
$this->session->set_flashdata('failed',"Gagal dihapus");
redirect("kelolauser");
}
}
public function changePassword()
{
$this->form_validation->set_rules('pw_baru', 'Password Baru', 'trim|required');
$this->form_validation->set_rules('confirm_pw_baru', 'Confirm Password', 'trim|required|matches[pw_baru]');
if ($this->form_validation->run() == false) {
$this->session->set_flashdata('error',form_error('confirm_pw_baru'));
redirect('kelolauser');
} else{
$id = $this->input->post('input_hidden',true);
$new_pass = $this->input->post("pw_baru",true);
$password = password_hash($new_pass, PASSWORD_DEFAULT);
$change = $this->modelapp->updateData(["password"=>$password],"user",["id_user"=>$id]);
if ($change) {
$this->session->set_flashdata('success',"Data berhasil disimpan");
redirect("kelolauser");
} else {
$this->session->set_flashdata('failed',"Tidak ada perubahan");
redirect("kelolauser");
}
}
}
private function validate()
{
$this->form_validation->set_rules('txt_nama','Nama','trim|required|max_length[25]|min_length[3]');
$this->form_validation->set_rules('txt_akses','Hak Akses','trim|required');
$this->form_validation->set_rules('txt_telp','Telp','trim|required|max_length[13]|min_length[10]|greater_than[0]|is_unique[user.no_hp]');
$this->form_validation->set_rules('txt_username','Username','trim|required|is_unique[user.username]|max_length[20]');
$this->form_validation->set_rules('txt_email','Email','trim|required|valid_email|max_length[25]');
$this->form_validation->set_rules('txt_status','Status','trim|required');
$this->form_validation->set_rules('txt_password','Password','trim|required');
$this->form_validation->set_rules('txt_retype_password','Password','trim|required|matches[txt_password]');
$this->form_validation->set_rules('radio_jk','jenis kelamin','trim|required');
}
private function inputPost()
{
$input = [
'nama_lengkap' => $this->input->post('txt_nama', true),
'id_akses' => $this->input->post('txt_akses', true),
'no_hp' => $this->input->post('txt_telp', true),
'email' => $this->input->post('txt_email', true),
'jenis_kelamin' => $this->input->post('radio_jk', true),
'username' => $this->input->post('txt_username', true),
'status_user' => $this->input->post('txt_status', true)
];
return $input;
}
private function pages($page,$data)
{
$this->load->view('partials/part_navbar', $data);
$this->load->view('partials/part_sidebar', $data);
$this->load->view($page, $data);
$this->load->view('partials/part_footer', $data);
}
}
/* End of file Controllername.php */
| 46,755
|
https://github.com/Evoltic/extended-worker/blob/master/src/useWorker.js
|
Github Open Source
|
Open Source
|
0BSD
| 2,021
|
extended-worker
|
Evoltic
|
JavaScript
|
Code
| 488
| 1,488
|
// inside main thread
export class ExtendedWorker {
constructor(worker, useAnotherExtendedWorker, orderTermination) {
this.nextCallId = 0
this.worker = worker
this.orderTermination = orderTermination || ((terminate) => terminate())
this.useAnotherExtendedWorker = useAnotherExtendedWorker
}
terminate() {
this.orderTermination(() => this.worker.terminate())
}
sendMessage(message, callBackOnResponse) {
const callId = this.nextCallId
this.nextCallId++
this.worker.postMessage({ ...message, callId })
const listener = ({ data = {} }) => {
if (data.callId !== callId) return
callBackOnResponse(data.error, data.result)
}
this.worker.addEventListener('message', listener)
return () => this.worker.removeEventListener('message', listener)
}
sendMessagePromisified(message) {
// notice: all worker responses except the first will be ignored
return new Promise((resolve, reject) => {
const unsubscribe = this.sendMessage(message, (err, res) => {
unsubscribe()
if (err) reject(err)
else resolve(res)
})
})
}
listenForRequest(requestName, contextId, handler) {
const listener = ({ data = {} }) => {
const { result: res = {} } = data
if (res.requestName === requestName && res.contextId === contextId) {
handler(res)
}
}
this.worker.addEventListener('message', listener)
return () => this.worker.removeEventListener('message', listener)
}
async createContext() {
const contextId = await this.sendMessagePromisified({
activityName: 'createContext',
})
return contextId
}
async destroyContext(contextId) {
const contextsLeft = await this.sendMessagePromisified({
activityName: 'destroyContext',
contextId,
})
if (contextsLeft === 0) this.terminate()
}
async getMethods(contextId) {
const workerMethodsList = await this.sendMessagePromisified({
activityName: 'getMethodsList',
})
let methods = {}
for (const methodName of workerMethodsList) {
methods[methodName] = (...args) =>
this.sendMessagePromisified({
activityName: 'callWorkerMethod',
methodName,
contextId,
args,
})
}
return methods
}
async subscribeToWorkerPublicState(contextId, subscriber) {
let listenerId
const removeMessageListener = this.sendMessage(
{
activityName: 'subscribeToPublicState',
contextId,
},
(err, { type, v } = {}) => {
if (err) subscriber(err)
if (type === 'state') subscriber(undefined, v)
else if (type === 'listenerId') listenerId = v
}
)
return async () => {
removeMessageListener()
await this.sendMessagePromisified({
activityName: 'unsubscribeFromPublicState',
contextId,
listenerId,
})
}
}
callSubWorkerMethod = async (data) => {
const { workerPath, methodName, args, ...concomitant } = data
let message
let subWorker
try {
subWorker = await this.useAnotherExtendedWorker(workerPath)
const result = await subWorker[methodName](...args)
await subWorker.destroyContext()
message = { result, error: undefined }
} catch (error) {
message = { result: undefined, error }
}
await this.sendMessagePromisified({
activityName: 'receiveSubWorkerMethodCallResult',
...concomitant,
...message,
})
}
async use() {
const contextId = await this.createContext()
const removeSubWorkerCallListener = this.listenForRequest(
'callSubWorkerMethod',
contextId,
this.callSubWorkerMethod
)
const methods = await this.getMethods(contextId)
return {
...methods,
subscribeToWorkerPublicState: async (subscriber) => {
return this.subscribeToWorkerPublicState(contextId, subscriber)
},
destroyContext: async () => {
removeSubWorkerCallListener()
return this.destroyContext(contextId)
},
}
}
}
export class WorkersPool {
constructor(options = {}) {
const { createWorker, permanentWorkers = [] } = options
this.createWorker = createWorker
this.workers = {}
this.permanentWorkers = permanentWorkers
}
checkOut(workerPath) {
if (this.workers[workerPath]) return this.workers[workerPath]
const orderTermination = (terminateWorker) =>
this.terminate(workerPath, terminateWorker)
this.workers[workerPath] = this.createWorker(workerPath, orderTermination)
return this.workers[workerPath]
}
terminate(workerPath, terminateWorker) {
if (this.permanentWorkers.includes(workerPath)) return
delete this.workers[workerPath]
terminateWorker()
}
}
const workersPool = new WorkersPool({
createWorker: (workerPath, orderTermination) => {
const worker = new Worker(workerPath)
return new ExtendedWorker(worker, useWorker, orderTermination)
}
})
export const setPermanentWorkers = (permanentWorkers) => {
workersPool.permanentWorkers = permanentWorkers
}
export const useWorker = async (workerPath) => {
const extendedWorker = workersPool.checkOut(workerPath)
return extendedWorker.use()
}
| 26,398
|
https://github.com/tnguyen0306/vba-challenge/blob/master/VBA Script_TN.vbs
|
Github Open Source
|
Open Source
|
ADSL
| null |
vba-challenge
|
tnguyen0306
|
Visual Basic
|
Code
| 555
| 1,289
|
Sub VBAchallenge()
'assign all varable
Dim lastrow As Double
Dim lastcol As Double
Dim ticker As String
Dim yearlychange As Double
Dim percentchange As Double
Dim totalvol As Double
Dim opencost As Double
Dim closecost As Double
Dim tablerow As Double
Dim greatestPer As Double
Dim smallestPer As Double
Dim greatestTotal As Double
'For loop to work on each sheet
For Each ws In Worksheets
ws.Activate
'identify Last Row & Column & summary table row
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
lastcol = Cells(1, Columns.Count).End(xlToLeft).Column
tablerow = 2
'Set up the sheet
Cells(1, lastcol + 2).Value = "Ticker"
Cells(1, lastcol + 3).Value = "Yearly Change"
Cells(1, lastcol + 4).Value = "Percent Change"
Range("K2:K1000000").NumberFormat = "0.00%"
Cells(1, lastcol + 5).Value = "Total Stock Volume"
Cells(2, lastcol + 8).Value = "Greatest % Increase"
Cells(3, lastcol + 8).Value = "Greatest % Decrease"
Cells(4, lastcol + 8).Value = "Greatest Total Volume"
Cells(1, lastcol + 9).Value = "Ticker"
Cells(1, lastcol + 10).Value = "Value"
greatestPer = 0
smallestPer = 0
greatestTotal = 0
'assign value for open cost
opencost = Cells(2, 3).Value
totalvol = 0
'start for loop to work on each row
For i = 2 To lastrow
'if the tickers are different
If Cells(i + 1, 1).Value <> Cells(i, 1) Then
'get & assign ticker code
ticker = Cells(i, 1).Value
Cells(tablerow, lastcol + 2).Value = ticker
'calculate & assign yearly change
closecost = Cells(i, lastcol - 1).Value
yearlychange = closecost - opencost
Cells(tablerow, lastcol + 3).Value = yearlychange
'Assign correct color
If Cells(tablerow, lastcol + 3).Value < 0 Then
Cells(tablerow, lastcol + 3).Interior.ColorIndex = 3
Else
Cells(tablerow, lastcol + 3).Interior.ColorIndex = 4
End If
'calculate & assign percent change
If opencost <> 0 Then
percentchange = yearlychange / opencost
Else
percentchange = yearlychange
End If
Cells(tablerow, lastcol + 4).Value = percentchange
'calculate & assign total stock volume
totalvol = totalvol + Cells(i, lastcol).Value
Cells(tablerow, lastcol + 5).Value = totalvol
'move on to the next summary table row and reset data
tablerow = tablerow + 1
totalvol = 0
opencost = Cells(i + 1, 3).Value
'if two row have the same ticker
Else
totalvol = totalvol + Cells(i, 7).Value
End If
Next i
'Format to percentage
Range("Q2:Q3").NumberFormat = "0.00%"
'Look up and store the value of greatest % increase change and its ticker
greatestPer = Application.Max(Range(Cells(2, lastcol + 4), Cells(lastrow, lastcol + 4)))
Cells(2, lastcol + 10).Value = greatestPer
For j = 2 To lastrow
If Cells(j, lastcol + 4).Value = greatestPer Then
Exit For
End If
Next
Cells(2, lastcol + 9).Value = Cells(j, lastcol + 2).Value
'Look up and store the value of greatest % decrease change and its ticker
smallestPer = Application.Min(Range(Cells(2, lastcol + 4), Cells(lastrow, lastcol + 4)))
Cells(3, lastcol + 10).Value = smallestPer
For k = 2 To lastrow
If Cells(k, lastcol + 4).Value = smallestPer Then
Exit For
End If
Next
Cells(3, lastcol + 9).Value = Cells(k, lastcol + 2).Value
'Look up and store the value of greatest total volume and its ticker
greatestTotal = Application.Max(Range(Cells(2, lastcol + 5), Cells(lastrow, lastcol + 5)))
Cells(4, lastcol + 10).Value = greatestTotal
For l = 2 To lastrow
If Cells(l, lastcol + 5).Value = greatestTotal Then
Exit For
End If
Next
Cells(4, lastcol + 9).Value = Cells(l, lastcol + 2).Value
'Format all cells to fit the value
Range(Cells(1, lastcol + 2), Cells(lastrow, lastcol + 10)).Columns.AutoFit
Next ws
End Sub
| 27,635
|
https://github.com/gakuzzzz/trinity/blob/master/trinity-core/src/main/scala/org/sisioh/trinity/domain/http/TrinityResponseBuilder.scala
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,013
|
trinity
|
gakuzzzz
|
Scala
|
Code
| 559
| 2,048
|
/*
* Copyright 2010 TRICREO, Inc. (http://tricreo.jp/)
* Copyright 2013 Sisioh Project and others. (http://sisioh.org/)
*
* 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.
*/
package org.sisioh.trinity.domain.http
import com.twitter.finagle.http.{Response => FinagleResponse, Request => FinagleRequest, Status}
import org.jboss.netty.buffer.{ChannelBuffers, ChannelBuffer}
import ChannelBuffers._
import org.jboss.netty.handler.codec.http._
import org.jboss.netty.util.CharsetUtil._
import org.json4s._
import org.json4s.jackson.JsonMethods._
import com.twitter.util.{Await, Future}
import scala.collection.JavaConverters._
import scala.language.implicitConversions
import org.sisioh.trinity.domain.config.Config
import org.sisioh.trinity.infrastructure.DurationUtil._
/**
* Trinity内で扱うレスポンスを表す値オブジェクト。
*
* @param status
* @param headers
* @param cookies
* @param body
*/
case class TrintiyResponse
(status: HttpResponseStatus = Status.Ok,
headers: Map[String, AnyRef] = Map.empty,
cookies: Seq[Cookie] = Seq.empty,
body: Option[ChannelBuffer] = None) {
def this(status: Int,
headers: Map[String, AnyRef],
cookies: Seq[Cookie],
body: Option[ChannelBuffer]) =
this(HttpResponseStatus.valueOf(status), headers, cookies, body)
def bodyAsString: Option[String] = body.map(_.toString(UTF_8))
def toFinagleResponse: FinagleResponse = {
val result = new DefaultHttpResponse(HttpVersion.HTTP_1_1, status)
headers.foreach {
case (k, v: Iterable[_]) =>
result.setHeader(k, v.asJava)
case (k, v) =>
result.setHeader(k, v)
}
if (!cookies.isEmpty) {
val cookieEncoder = new CookieEncoder(true)
cookies.foreach {
xs =>
cookieEncoder.addCookie(xs)
}
result.setHeader("Set-Cookie", cookieEncoder.encode)
}
body.foreach {
b =>
result.setContent(b)
}
FinagleResponse(result)
}
}
/**
* [[org.sisioh.trinity.domain.http.TrinityResponseBuilder]]のためのビルダ。
*
* @param responseFuture `Future`にラップされた[[org.sisioh.trinity.domain.http.TrintiyResponse]]
*/
case class TrinityResponseBuilder
(private val responseFuture: Future[TrintiyResponse] = Future(TrintiyResponse()))
(implicit config: Config){
def withStatus
(status: Int): TrinityResponseBuilder = {
withStatus(HttpResponseStatus.valueOf(status))
}
def withStatus
(status: HttpResponseStatus): TrinityResponseBuilder = {
val newResposeFuture = responseFuture.map {
response =>
response.copy(status = status)
}
TrinityResponseBuilder(newResposeFuture)
}
def withCookie
(tuple: (String, String)): TrinityResponseBuilder = {
val newResposeFuture = responseFuture.map {
response =>
response.copy(cookies = response.cookies :+ new DefaultCookie(tuple._1, tuple._2))
}
TrinityResponseBuilder(newResposeFuture)
}
def withCookie
(cookie: Cookie): TrinityResponseBuilder = {
val newResposeFuture = responseFuture.map {
response =>
response.copy(cookies = response.cookies :+ cookie)
}
TrinityResponseBuilder(newResposeFuture)
}
def withHeader
(header: (String, String)): TrinityResponseBuilder = {
val newResposeFuture = responseFuture.map {
response =>
response.copy(headers = response.headers + header)
}
TrinityResponseBuilder(newResposeFuture)
}
def withBody
(body: Array[Byte]): TrinityResponseBuilder = {
val newResposeFuture = responseFuture.map {
response =>
response.copy(body = Some(copiedBuffer(body)))
}
TrinityResponseBuilder(newResposeFuture)
}
def withBody
(body: => String): TrinityResponseBuilder = {
val newResposeFuture = responseFuture.map {
response =>
response.copy(body = Some(copiedBuffer(body, UTF_8)))
}
TrinityResponseBuilder(newResposeFuture)
}
def withBodyRenderer
(bodyRenderer: BodyRenderer): TrinityResponseBuilder = {
val newResposeFuture = bodyRenderer.render.flatMap {
body =>
responseFuture.map {
response =>
response.copy(body = Some(copiedBuffer(body, UTF_8)))
}
}
TrinityResponseBuilder(newResposeFuture)
}
def withPlain
(body: => String): TrinityResponseBuilder = {
withHeader("Content-Type", "text/plain").withBody(body)
}
def withHtml(body: => String) = {
withHeader("Content-Type", "text/html").withBody(body)
}
def withJson(jValue: => JValue): TrinityResponseBuilder = {
withHeader("Content-Type", "application/json").withBody(compact(jValue))
}
def withNothing = {
withHeader("Content-Type", "text/plain").withBody("")
}
def withOk = withStatus(HttpResponseStatus.OK)
def withNotFound = withStatus(HttpResponseStatus.NOT_FOUND)
/**
* `Future`にラップされた[[org.sisioh.trinity.domain.http.TrintiyResponse]]を返す。
*
* @return `Future`にラップされた[[org.sisioh.trinity.domain.http.TrintiyResponse]]
*/
def toTrinityResponseFuture: Future[TrintiyResponse] = responseFuture
/**
* [[org.sisioh.trinity.domain.http.TrintiyResponse]]を取得する。
*
* @return [[org.sisioh.trinity.domain.http.TrintiyResponse]]
*/
def getTrinityResponse: TrintiyResponse = Await.result(responseFuture, config.awaitDuration.toTwitter)
/**
* `Future`にラップされた `com.twitter.finagle.http.Response` を返す。
*
* @return `Future`にラップされた `com.twitter.finagle.http.Response`
*/
def toFinagleResponseFuture: Future[FinagleResponse] = responseFuture.map(_.toFinagleResponse)
/**
* `com.twitter.finagle.http.Response` を取得する。
*
* @return `com.twitter.finagle.http.Response`
*/
def getFinagleResponse: FinagleResponse = Await.result(toFinagleResponseFuture, config.awaitDuration.toTwitter)
}
trait TrinityResponseImplicitSupport {
implicit def convertToFingaleResponse(res: TrintiyResponse) =
res.toFinagleResponse
implicit def convertToFutureFinagleResponse(res: Future[TrintiyResponse]) =
res.map(_.toFinagleResponse)
}
| 47,027
|
https://github.com/squakez/syndesis/blob/master/app/connector/telegram/src/main/java/io/syndesis/connector/telegram/TelegramSendMessageCustomizer.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
syndesis
|
squakez
|
Java
|
Code
| 194
| 488
|
/*
* Copyright (C) 2016 Red Hat, Inc.
*
* 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.
*/
package io.syndesis.connector.telegram;
import java.util.Map;
import org.apache.camel.Exchange;
import org.apache.camel.component.telegram.model.OutgoingTextMessage;
import io.syndesis.connector.support.util.ConnectorOptions;
import io.syndesis.integration.component.proxy.ComponentProxyComponent;
import io.syndesis.integration.component.proxy.ComponentProxyCustomizer;
public class TelegramSendMessageCustomizer implements ComponentProxyCustomizer {
private String configuredChatId;
@Override
public void customize(ComponentProxyComponent component, Map<String, Object> options) {
this.configuredChatId = ConnectorOptions.extractOption(options, "chatId");
component.setBeforeProducer(this::beforeProducer);
}
private void beforeProducer(Exchange exchange) {
OutgoingTextMessage message = exchange.getIn().getBody(OutgoingTextMessage.class);
// Chat ID priority (in Syndesis) should be: chatId field in the message, chatId at action level, TelegramChatId header
if (message != null && message.getChatId() == null && this.configuredChatId != null) {
// Overriding Camel default priority giving action configuration higher priority than header
message.setChatId(this.configuredChatId);
}
}
}
| 27,080
|
https://github.com/lanyu4377/cosmic/blob/master/packages/module/widget-break-point/components.d.ts
|
Github Open Source
|
Open Source
|
MIT
| null |
cosmic
|
lanyu4377
|
TypeScript
|
Code
| 50
| 214
|
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/vue-next/pull/3399
declare module 'vue' {
export interface GlobalComponents {
ICosmicArrowDown: typeof import('~icons/cosmic/arrow-down')['default']
ICosmicArrowUp: typeof import('~icons/cosmic/arrow-up')['default']
ICosmicMediaDesktop: typeof import('~icons/cosmic/media-desktop')['default']
ICosmicMediaMobile: typeof import('~icons/cosmic/media-mobile')['default']
ICosmicPlus: typeof import('~icons/cosmic/plus')['default']
ICosmicTrash: typeof import('~icons/cosmic/trash')['default']
}
}
export { }
| 35,800
|
https://github.com/dddddavid02/ulauncher-translate/blob/master/src/functions.py
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
ulauncher-translate
|
dddddavid02
|
Python
|
Code
| 28
| 74
|
def strip_list(elements):
return [element for element in elements if len(element.strip()) > 0]
def arg_to_help(arg):
return {
'-p': 'Listen to the translation',
'-sp': 'Listen to the original text',
}[arg]
| 50,137
|
https://github.com/crydotsnake/hyper-batman/blob/master/index.js
|
Github Open Source
|
Open Source
|
MIT
| null |
hyper-batman
|
crydotsnake
|
JavaScript
|
Code
| 45
| 214
|
const foregroundColor = '#6f6f6f'
const backgroundColor = '#1b1d1e'
const cursorColor = '#fcef0c'
exports.decorateConfig = config => {
return Object.assign({}, config, {
backgroundColor,
foregroundColor,
cursorColor,
colors: [
'#1b1d1e',
'#e6dc44',
'#c8be46',
'#f4fd22',
'#737174',
'#747271',
'#62605f',
'#c6c5bf',
'#505354',
'#fff78e',
'#fff27d',
'#feed6c',
'#919495',
'#9a9a9d',
'#a3a3a6',
'#dadbd6'
]
})
}
| 41,320
|
https://github.com/SteHeRa/year-progress-bar/blob/master/sorting-visualiser/Algorithms/quicksort.js
|
Github Open Source
|
Open Source
|
CC-BY-3.0
| null |
year-progress-bar
|
SteHeRa
|
JavaScript
|
Code
| 493
| 1,036
|
let quickAnimations = [];
/*Above we are initialising array to store bars that need to be animated - in order
right before a swap is performed in the bubble sort algorithm,
we push the indexes of the two elements that are getting swapped into the bubbleAnimations array.
We colour the two div elements (bars) and swap the div elements heights. */
//FUNCTION FOR SWAPPING ELEMENTS IN ARRAY
function swap(array, leftIndex, rightIndex) {
var tempIndex = array[leftIndex].index; //we swap the index property of the column/bar object,
array[leftIndex].index = array[rightIndex].index; //this helps keep track of what we're targeting
array[rightIndex].index = tempIndex; //when it comes to animating.
var temp = array[leftIndex];
array[leftIndex] = array[rightIndex]; //this is swapping the actual objects in the array.
array[rightIndex] = temp;
}
//FUNCTION FOR CHOOSING PIVOT AND PUTTING BIGGER ELEMENTS TO THE RIGHT AND SMALLER ELEMENTS TO THE LEFT
function partition(array, left, right) {
let pivot = array[Math.floor((right+left) / 2)].value; //middle element
let i = left; //left pointer
let j = right; //right pointer
while (i <= j) { //While i and j have not yet met in the middle of the array
while(array[i].value < pivot) { //If value of array[i] is less than the pivot value leave
i++; //it where it is and move on to the next one
}
while(array[j].value > pivot) { //If value of array[j] is greater than the pivot value leave
j--; //it where it is and move on to the next one
}
if (i <= j) { //If we are at this line of code we know that array[i] and array[j]
//are on the wrong sides of the pivot so we swap them
swap(array, i, j);
quickAnimations.push(array[i].index, array[j].index); //populating the array that will be used to animate Quicksort
i++;
j--;
}
}
return i;
}
//Implement recursion for unsorted left and right halves until whole array is sorted
function quickSort(array, left, right) {
let index;
if (array.length > 1) {
index = partition(array, left, right); //index of left pointer is returned from partition function
//we use this index to divide the array and then perform quick sort again on the divided sections.
if (left < index - 1) { //if the index is not yet at the left most element
quickSort(array, left, index -1); //perform quicksort on that section
}
if (index < right) { //if the index is not yet at the right most element
quickSort(array, index, right); //perfrom quicksort on that section
}
}
return array;
}
//FUNCTION FOR ANIMATING QUICKSORT FUNCTION
function quickAnimate(array, i) {
setTimeout( () => {
for(j=0; j < array.length - 1 ; j++) {
if (array[j] !== array[i] || array[j] !== array[i+1]) {
document.getElementById(array[j]).style.backgroundColor = "cornflowerblue"; //unhighlight bars after they've been swapped
}
}
if (array[i] + 1) {
document.getElementById(array[i]).style.backgroundColor = "yellow"; //highlight bars that a being swapped
document.getElementById(array[i+1]).style.backgroundColor = "yellow"; //highlight bars that a being swapped
tempHeight = document.getElementById(array[i]).style.height;
document.getElementById(array[i]).style.height = document.getElementById(array[i+1]).style.height; //swap heights of div elements
document.getElementById(array[i+1]).style.height = tempHeight;
}
}, 10 * i);
}
| 31,677
|
https://github.com/davidchambers/an.hour.ago/blob/master/src/an.hour.ago.coffee
|
Github Open Source
|
Open Source
|
WTFPL
| 2,016
|
an.hour.ago
|
davidchambers
|
CoffeeScript
|
Code
| 290
| 684
|
# Helpers
# -------
{defineProperty} = Object
unless defineProperty?
defineProperty = (object, name, descriptor) ->
object.__defineGetter__ name, descriptor.get
def = (object, name, get) ->
defineProperty object, name, {get}
now = Date.now or -> (new Date).getTime()
# `NaturalDate`
# -------------
class NaturalDate
constructor: (@value) ->
$ND = NaturalDate.prototype
$ND.and = (naturalDate) ->
new NaturalDate @value + naturalDate.valueOf()
$ND.before = (date) ->
new Date date.valueOf() - @value
$ND.from = $ND.after = (date) ->
new Date date.valueOf() + @value
$ND.valueOf = ->
@value
def $ND, 'ago', -> new Date now() - @value
def $ND, 'from_now', -> new Date now() + @value
# `DateComparator`
# ----------------
class DateComparator
constructor: (@operator, @self, @offset) ->
$DC = DateComparator.prototype
$DC.before = (date) ->
other = date.valueOf() - @offset
switch @operator
when '<' then @self > other
when '>' then @self < other
$DC.from = $DC.after = (date) ->
other = date.valueOf() + @offset
switch @operator
when '<' then @self < other
when '>' then @self > other
$DC.either_side_of = (date) ->
switch @operator
when '<' then @before(date) and @after(date)
when '>' then @before(date) or @after(date)
def $DC, 'ago', -> @before now()
def $DC, 'from_now', -> @from now()
# Add properties to `Date.prototype`
# ----------------------------------
Date::less_than = (offset) ->
new DateComparator '<', @valueOf(), offset
Date::more_than = (offset) ->
new DateComparator '>', @valueOf(), offset
# Add properties to `Number.prototype`
# ------------------------------------
numberProto = Number.prototype
units =
millisecond: 1
second: seconds = 1000
minute: minutes = 60 * seconds
hour: hours = 60 * minutes
day: days = 24 * hours
week: weeks = 7 * days
fortnight: 2 * weeks
for own unit, ms of units
getter = do (ms = ms) -> -> new NaturalDate this * ms
def numberProto, unit, getter
def numberProto, unit + 's', getter
| 18,222
|
https://github.com/microsoft/onnxruntime/blob/master/onnxruntime/core/mlas/lib/amd64/SconvKernelAvx.asm
|
Github Open Source
|
Open Source
|
MIT
| 2,023
|
onnxruntime
|
microsoft
|
Assembly
|
Code
| 1,547
| 5,296
|
;++
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
; Licensed under the MIT License.
;
; Module Name:
;
; SconvKernelAvx.asm
;
; Abstract:
;
; This module implements the kernels for the single precision convolution
; operation.
;
; This implementation uses AVX instructions.
;
;--
.xlist
INCLUDE mlasi.inc
INCLUDE SconvKernelAvxCommon.inc
.list
;
; Macro Description:
;
; This macro multiplies and accumulates for FilterCount by OutputCount block
; of the output buffer.
;
; Arguments:
;
; KernelType - Supplies the type of kernel to be generated.
;
; FilterCount - Supplies the number of rows from the filter to process.
;
; OutputCount - Supplies the number of output blocks to produce.
;
; VectorOffset - Supplies the byte offset from the filter buffer to fetch
; elements.
;
; BroadcastOffset - Supplies the byte offset from the input buffer to fetch
; elements.
;
; Implicit Arguments:
;
; rcx - Supplies the address of the input buffer.
;
; rdx - Supplies the address of the filter buffer.
;
; rsi - Supplies the FilterStride parameter (see function description).
;
; rbx - Supplies the address of the filter buffer plus 2 * FilterStride.
;
; r9 - Supplies the StrideWidth parameter (see function description).
;
; ymm0-ymm7 - Supplies the block accumulators.
;
ComputeBlock MACRO KernelType, FilterCount, OutputCount, VectorOffset, BroadcastOffset
IFIDNI <KernelType>, <Depthwise>
vmovups ymm12,YMMWORD PTR [rdx]
EmitIfCountGE OutputCount, 1, <vmulps ymm8,ymm12,YMMWORD PTR [rcx]>
EmitIfCountGE OutputCount, 1, <vaddps ymm0,ymm0,ymm8>
EmitIfCountGE OutputCount, 2, <vmulps ymm9,ymm12,YMMWORD PTR [rcx+r9]>
EmitIfCountGE OutputCount, 2, <vaddps ymm4,ymm4,ymm9>
ELSE
EmitIfCountGE OutputCount, 1, <vbroadcastss ymm13,DWORD PTR [rcx+BroadcastOffset]>
EmitIfCountGE OutputCount, 2, <vbroadcastss ymm14,DWORD PTR [rcx+r9+BroadcastOffset]>
IF OutputCount EQ 1
EmitIfCountGE FilterCount, 1, <vmulps ymm8,ymm13,YMMWORD PTR [rdx+VectorOffset]>
EmitIfCountGE FilterCount, 1, <vaddps ymm0,ymm0,ymm8>
EmitIfCountGE FilterCount, 2, <vmulps ymm9,ymm13,YMMWORD PTR [rdx+rsi+VectorOffset]>
EmitIfCountGE FilterCount, 2, <vaddps ymm1,ymm1,ymm9>
EmitIfCountGE FilterCount, 3, <vmulps ymm10,ymm13,YMMWORD PTR [rbx+VectorOffset]>
EmitIfCountGE FilterCount, 3, <vaddps ymm2,ymm2,ymm10>
EmitIfCountGE FilterCount, 4, <vmulps ymm11,ymm13,YMMWORD PTR [rbx+rsi+VectorOffset]>
EmitIfCountGE FilterCount, 4, <vaddps ymm3,ymm3,ymm11>
ELSE
EmitIfCountGE FilterCount, 1, <vmovups ymm12,YMMWORD PTR [rdx+VectorOffset]>
EmitIfCount2GE FilterCount, 1, OutputCount, 1, <vmulps ymm8,ymm13,ymm12>
EmitIfCount2GE FilterCount, 1, OutputCount, 1, <vaddps ymm0,ymm0,ymm8>
EmitIfCount2GE FilterCount, 1, OutputCount, 2, <vmulps ymm9,ymm14,ymm12>
EmitIfCount2GE FilterCount, 1, OutputCount, 2, <vaddps ymm4,ymm4,ymm9>
EmitIfCountGE FilterCount, 2, <vmovups ymm12,YMMWORD PTR [rdx+rsi+VectorOffset]>
EmitIfCount2GE FilterCount, 2, OutputCount, 1, <vmulps ymm10,ymm13,ymm12>
EmitIfCount2GE FilterCount, 2, OutputCount, 1, <vaddps ymm1,ymm1,ymm10>
EmitIfCount2GE FilterCount, 2, OutputCount, 2, <vmulps ymm11,ymm14,ymm12>
EmitIfCount2GE FilterCount, 2, OutputCount, 2, <vaddps ymm5,ymm5,ymm11>
EmitIfCountGE FilterCount, 3, <vmovups ymm12,YMMWORD PTR [rbx+VectorOffset]>
EmitIfCount2GE FilterCount, 3, OutputCount, 1, <vmulps ymm8,ymm13,ymm12>
EmitIfCount2GE FilterCount, 3, OutputCount, 1, <vaddps ymm2,ymm2,ymm8>
EmitIfCount2GE FilterCount, 3, OutputCount, 2, <vmulps ymm9,ymm14,ymm12>
EmitIfCount2GE FilterCount, 3, OutputCount, 2, <vaddps ymm6,ymm6,ymm9>
EmitIfCountGE FilterCount, 4, <vmovups ymm12,YMMWORD PTR [rbx+rsi+VectorOffset]>
EmitIfCount2GE FilterCount, 4, OutputCount, 1, <vmulps ymm10,ymm13,ymm12>
EmitIfCount2GE FilterCount, 4, OutputCount, 1, <vaddps ymm3,ymm3,ymm10>
EmitIfCount2GE FilterCount, 4, OutputCount, 2, <vmulps ymm11,ymm14,ymm12>
EmitIfCount2GE FilterCount, 4, OutputCount, 2, <vaddps ymm7,ymm7,ymm11>
ENDIF
ENDIF
ENDM
;
; Macro Description:
;
; This macro generates code to compute the convolution for a specified number
; of filter rows.
;
; Arguments:
;
; KernelFrame - Supplies the symbol name to access the convolution kernel
; stack.
;
; KernelType - Supplies the type of kernel to be generated.
;
; FilterCount - Supplies the number of rows from the filter to process.
;
; Implicit Arguments:
;
; rdi - Supplies the address of the input buffer.
;
; rsi - Supplies the FilterStride parameter (see function description) when
; KernelType!=Depthwise. Supplies the address of the filter buffer when
; KernelType=Depthwise.
;
; rbp - Supplies the DilationWidth parameter (see function description).
;
; r8 - Supplies the address of the output buffer.
;
; r9 - Supplies the StrideWidth parameter (see function description).
;
; r15 - Supplies the InputStride parameter (see function description).
;
ProcessFilterCountN MACRO KernelFrame, KernelType, FilterCount
LOCAL ProcessOutputCount
LOCAL ProcessNextOutputCountBy2
LOCAL ProcessRemainingOutputCount
LOCAL ProcessOutputCountRightPadAndRemaining
;
; Process the output blocks that include left padding.
;
mov r10,KernelFrame.OutputCountLeftPad[rsp]
test r10,r10
jz ProcessOutputCount
call MlasConv&KernelType&FloatSingleAvxFilter&FilterCount
;
; Process the output blocks that do not include any padding.
;
ProcessOutputCount:
mov r10,KernelFrame.OutputCount[rsp]
sub r10,2
jb ProcessRemainingOutputCount
ProcessNextOutputCountBy2:
ProcessOutputCountN Avx, KernelFrame, KernelType, 8, FilterCount, 2
lea rdi,[rdi+r9*2] ; advance input by 2 elements
sub r10,2
jae ProcessNextOutputCountBy2
ProcessRemainingOutputCount:
add r10,2 ; correct for over-subtract above
;
; Process the output blocks that include right padding plus any remaining output
; blocks from above.
;
ProcessOutputCountRightPadAndRemaining:
add r10,KernelFrame.OutputCountRightPad[rsp]
jz ExitKernel
call MlasConv&KernelType&FloatSingleAvxFilter&FilterCount
ENDM
;
; Macro Description:
;
; This macro generates code to compute the convolution for a specified number
; of filter rows for a pointwise convolution.
;
; Arguments:
;
; FilterCount - Supplies the number of rows from the filter to process.
;
; Implicit Arguments:
;
; rdi - Supplies the address of the input buffer.
;
; rsi - Supplies the FilterStride parameter (see function description).
;
; rbp - Supplies the InputStride parameter (see function description).
;
; r8 - Supplies the address of the output buffer.
;
; r9 - Supplies the StrideWidth parameter (see function description).
;
; r10 - Supplies the OutputCount parameter (see function description).
;
; r12 - Supplies the address of the filter buffer.
;
ProcessPointwiseFilterCountN MACRO FilterCount
LOCAL ProcessNextOutputCountBy2
LOCAL ProcessRemainingOutputCount
sub r10,2
jb ProcessRemainingOutputCount
ProcessNextOutputCountBy2:
ProcessPointwiseOutputCountN Avx, 8, FilterCount, 2
lea rdi,[rdi+r9*2] ; advance input by 2 elements
sub r10,2
jae ProcessNextOutputCountBy2
ProcessRemainingOutputCount:
add r10,2 ; correct for over-subtract above
jz ExitKernel
ProcessPointwiseOutputCountN Avx, 8, FilterCount, 1
ENDM
;
; Generate the convolution kernels.
;
SconvKernelFunction Nchw, 8, Avx
SconvKernelFunction Nchwc, 8, Avx, BiasFilter
SconvKernelDepthwiseFunction 8, Avx
SconvKernelPointwiseFunction Avx, BiasFilter
;
; Macro Description:
;
; This macro generates code to process an output block after the inner
; convolution kernel has executed and then stores the output block to the
; output buffer.
;
; Arguments:
;
; FilterCount - Supplies the number of rows from the filter to process.
;
; OutputCount - Supplies the number of output blocks to produce.
;
IRP FilterCount, <1, 2, 3, 4>
IRP OutputCount, <1, 2, 3>
LEAF_ENTRY MlasConvPostProcessFloatAvxFilter&FilterCount&Output&OutputCount, _TEXT
PUBLIC MlasConvPostProcessFloatFma3Filter&FilterCount&Output&OutputCount
MlasConvPostProcessFloatFma3Filter&FilterCount&Output&OutputCount::
IF FilterCount GT 2
lea rbx,[r8+rax*2] ; compute output plus 2 rows
ENDIF
;
; Test if the existing contents of the output buffer should be accumulated
; with the output block.
;
test dl,MLAS_CONV_KERNEL_FLAG_ACCUMULATE_OUTPUT
jz SkipAccumulateOutput
EmitIfCount2GE FilterCount, 1, OutputCount, 1, <vaddps ymm0,ymm0,YMMWORD PTR [r8]>
EmitIfCount2GE FilterCount, 1, OutputCount, 2, <vaddps ymm4,ymm4,YMMWORD PTR [r8+32]>
EmitIfCount2GE FilterCount, 1, OutputCount, 3, <vaddps ymm8,ymm8,YMMWORD PTR [r8+64]>
EmitIfCount2GE FilterCount, 2, OutputCount, 1, <vaddps ymm1,ymm1,YMMWORD PTR [r8+rax]>
EmitIfCount2GE FilterCount, 2, OutputCount, 2, <vaddps ymm5,ymm5,YMMWORD PTR [r8+rax+32]>
EmitIfCount2GE FilterCount, 2, OutputCount, 3, <vaddps ymm9,ymm9,YMMWORD PTR [r8+rax+64]>
EmitIfCount2GE FilterCount, 3, OutputCount, 1, <vaddps ymm2,ymm2,YMMWORD PTR [rbx]>
EmitIfCount2GE FilterCount, 3, OutputCount, 2, <vaddps ymm6,ymm6,YMMWORD PTR [rbx+32]>
EmitIfCount2GE FilterCount, 3, OutputCount, 3, <vaddps ymm10,ymm10,YMMWORD PTR [rbx+64]>
EmitIfCount2GE FilterCount, 4, OutputCount, 1, <vaddps ymm3,ymm3,YMMWORD PTR [rbx+rax]>
EmitIfCount2GE FilterCount, 4, OutputCount, 2, <vaddps ymm7,ymm7,YMMWORD PTR [rbx+rax+32]>
EmitIfCount2GE FilterCount, 4, OutputCount, 3, <vaddps ymm11,ymm11,YMMWORD PTR [rbx+rax+64]>
SkipAccumulateOutput:
;
; Test if the bias buffer should be accumulated with the output block.
;
test dl,MLAS_CONV_KERNEL_FLAG_BIAS_ADDITION
jz SkipBiasAddition
IF OutputCount EQ 1
EmitIfCountGE FilterCount, 1, <vaddps ymm0,ymm0,YMMWORD PTR [rcx]>
EmitIfCountGE FilterCount, 2, <vaddps ymm1,ymm1,YMMWORD PTR [rcx+32]>
EmitIfCountGE FilterCount, 3, <vaddps ymm2,ymm2,YMMWORD PTR [rcx+64]>
EmitIfCountGE FilterCount, 4, <vaddps ymm3,ymm3,YMMWORD PTR [rcx+96]>
ELSE
EmitIfCountGE FilterCount, 1, <vmovups ymm12,YMMWORD PTR [rcx]>
EmitIfCountGE FilterCount, 2, <vmovups ymm13,YMMWORD PTR [rcx+32]>
EmitIfCountGE FilterCount, 3, <vmovups ymm14,YMMWORD PTR [rcx+64]>
EmitIfCountGE FilterCount, 4, <vmovups ymm15,YMMWORD PTR [rcx+96]>
EmitIfCount2GE FilterCount, 1, OutputCount, 1, <vaddps ymm0,ymm0,ymm12>
EmitIfCount2GE FilterCount, 1, OutputCount, 2, <vaddps ymm4,ymm4,ymm12>
EmitIfCount2GE FilterCount, 1, OutputCount, 3, <vaddps ymm8,ymm8,ymm12>
EmitIfCount2GE FilterCount, 2, OutputCount, 1, <vaddps ymm1,ymm1,ymm13>
EmitIfCount2GE FilterCount, 2, OutputCount, 2, <vaddps ymm5,ymm5,ymm13>
EmitIfCount2GE FilterCount, 2, OutputCount, 3, <vaddps ymm9,ymm9,ymm13>
EmitIfCount2GE FilterCount, 3, OutputCount, 1, <vaddps ymm2,ymm2,ymm14>
EmitIfCount2GE FilterCount, 3, OutputCount, 2, <vaddps ymm6,ymm6,ymm14>
EmitIfCount2GE FilterCount, 3, OutputCount, 3, <vaddps ymm10,ymm10,ymm14>
EmitIfCount2GE FilterCount, 4, OutputCount, 1, <vaddps ymm3,ymm3,ymm15>
EmitIfCount2GE FilterCount, 4, OutputCount, 2, <vaddps ymm7,ymm7,ymm15>
EmitIfCount2GE FilterCount, 4, OutputCount, 3, <vaddps ymm11,ymm11,ymm15>
ENDIF
SkipBiasAddition:
;
; Test for fused ReLU activation.
;
test dl,MLAS_CONV_KERNEL_FLAG_RELU_ACTIVATION
jz SkipReluActivation
vxorps xmm15,xmm15,xmm15
EmitIfCount2GE FilterCount, 1, OutputCount, 1, <vmaxps ymm0,ymm15,ymm0>
EmitIfCount2GE FilterCount, 1, OutputCount, 2, <vmaxps ymm4,ymm15,ymm4>
EmitIfCount2GE FilterCount, 1, OutputCount, 3, <vmaxps ymm8,ymm15,ymm8>
EmitIfCount2GE FilterCount, 2, OutputCount, 1, <vmaxps ymm1,ymm15,ymm1>
EmitIfCount2GE FilterCount, 2, OutputCount, 2, <vmaxps ymm5,ymm15,ymm5>
EmitIfCount2GE FilterCount, 2, OutputCount, 3, <vmaxps ymm9,ymm15,ymm9>
EmitIfCount2GE FilterCount, 3, OutputCount, 1, <vmaxps ymm2,ymm15,ymm2>
EmitIfCount2GE FilterCount, 3, OutputCount, 2, <vmaxps ymm6,ymm15,ymm6>
EmitIfCount2GE FilterCount, 3, OutputCount, 3, <vmaxps ymm10,ymm15,ymm10>
EmitIfCount2GE FilterCount, 4, OutputCount, 1, <vmaxps ymm3,ymm15,ymm3>
EmitIfCount2GE FilterCount, 4, OutputCount, 2, <vmaxps ymm7,ymm15,ymm7>
EmitIfCount2GE FilterCount, 4, OutputCount, 3, <vmaxps ymm11,ymm15,ymm11>
SkipReluActivation:
;
; Store the output block in the output buffer.
;
EmitIfCount2GE FilterCount, 1, OutputCount, 1, <vmovups YMMWORD PTR [r8],ymm0>
EmitIfCount2GE FilterCount, 1, OutputCount, 2, <vmovups YMMWORD PTR [r8+32],ymm4>
EmitIfCount2GE FilterCount, 1, OutputCount, 3, <vmovups YMMWORD PTR [r8+64],ymm8>
EmitIfCount2GE FilterCount, 2, OutputCount, 1, <vmovups YMMWORD PTR [r8+rax],ymm1>
EmitIfCount2GE FilterCount, 2, OutputCount, 2, <vmovups YMMWORD PTR [r8+rax+32],ymm5>
EmitIfCount2GE FilterCount, 2, OutputCount, 3, <vmovups YMMWORD PTR [r8+rax+64],ymm9>
EmitIfCount2GE FilterCount, 3, OutputCount, 1, <vmovups YMMWORD PTR [rbx],ymm2>
EmitIfCount2GE FilterCount, 3, OutputCount, 2, <vmovups YMMWORD PTR [rbx+32],ymm6>
EmitIfCount2GE FilterCount, 3, OutputCount, 3, <vmovups YMMWORD PTR [rbx+64],ymm10>
EmitIfCount2GE FilterCount, 4, OutputCount, 1, <vmovups YMMWORD PTR [rbx+rax],ymm3>
EmitIfCount2GE FilterCount, 4, OutputCount, 2, <vmovups YMMWORD PTR [rbx+rax+32],ymm7>
EmitIfCount2GE FilterCount, 4, OutputCount, 3, <vmovups YMMWORD PTR [rbx+rax+64],ymm11>
add_immed r8,OutputCount*8*4 ; advance output by N nchw8c blocks
ret
LEAF_END MlasConvPostProcessFloatAvxFilter&FilterCount&Output&OutputCount, _TEXT
ENDM
ENDM
END
| 21,596
|
https://github.com/stastnypremysl/ftputil/blob/master/sandbox/ftpsync-0.1/rsyncmatch.py
|
Github Open Source
|
Open Source
|
BSD-3-Clause, AFL-3.0, AFL-2.1
| 2,021
|
ftputil
|
stastnypremysl
|
Python
|
Code
| 1,473
| 4,099
|
import re
import os
import sys
import loggingclass
INCLUDE = "+"
EXCLUDE = "-"
DONE = "."
class RsyncGlob(loggingclass.LoggingClass):
"""
A class that imitates rsync(1)'s way of include/exclude patterns.
Similar to glob()/fnmatch(), but "*" doesn't match "/" - "**" does.
See man rsync(1) for the exclude/include logic.
The GlobChain class creates filter chains like rsync's.
RsyncGlob(pattern), where <pattern> follows the rules in the rsync(1)
man page. In particular, "/XYZ" matches only at the "root", and "XYZ/"
matches only directories.
NOTE: This class uses Unix file name conventions.
It will be pretty simple to implement it for DOS/Windows though,
if someone volunteers.
The following doctest example shows how the globbing works.
Note that leading "/" are stripped for files.
>>> globs=(RsyncGlob("s*m"),RsyncGlob("s**m"),
... RsyncGlob("s\*m"),RsyncGlob("/s*m"),
... RsyncGlob("/s**m"),RsyncGlob("s\**m"))
>>> files=("spam","s/p/a/m","egg/spam","egg/sp/am","s*m","s*am")
>>> def outh():
... s="%10.10s" %""
... for g in globs:
... s=s+"%10.10s"%g.glob
... return s
>>> def outf(f):
... s="%10.10s" %f
... for g in globs:
... s=s+"%10.10s"%g.match(f)
... return s
>>> def out():
... print outh()
... for f in files:
... print outf(f)
>>> out()
s*m s**m s\*m /s*m /s**m s\**m
spam True True False True True False
s/p/a/m False True False False True False
egg/spam True True False False False False
egg/sp/am False True False False False False
s*m True True True True True True
s*am True True False True True True
"""
# This is applied before escaping re metachars
__bksl_re = re.compile(r'(\\.)')
# These are applied after escaping re metachars
__star2_re = re.compile(r'(\\\*\\\*)') # "**"
__star_re = re.compile(r'(\\\*)') # "*"
__quest_re = re.compile(r'(\\\?)') # "?"
__slash_re = re.compile(r'/') # "/"
def __handle_stars(self, s):
parts = self.__star2_re.split(s)
# side effect: patterns containing "**" match complete path
self.path_match = self.path_match or (len(parts) > 1)
# Odd elements are '**' now.
# Even elements must be checked for '*' and '?'
res = ""
i = 0
while i < len(parts):
if parts[i] != "":
tmp = self.__star_re.sub("[^/]*", parts[i])
tmp = self.__quest_re.sub("[^/]", tmp)
res = res + tmp
if i < len(parts) - 1:
res = res + ".*"
i = i + 2
return res
def __init__(self, pat=""):
self.type = None
# patterns starting with +/-.
if len(pat) > 1:
if pat[:2] == "+ ":
self.type = INCLUDE
pat = pat[2:]
elif pat[:2] == "- ":
self.type = EXCLUDE
pat = pat[2:]
# patterns ending with "/" match only directories
if len(pat) > 0 and pat.endswith("/"):
self.dir_match = True
pat = pat[:-1]
else:
self.dir_match = False
self.glob = pat
# patterns containing "/" match entire path,
self.path_match = (pat.find("/") != -1)
# patterns starting with "/" match only at root
if len(pat) > 0 and pat[0] == "/":
pat = pat[1:]
top_match = True
else:
top_match = False
# We transform the glob pattern into a regexp pattern now.
# First, handle all characters escaped with backslashes.
parts = self.__bksl_re.split(pat)
i = 0
self.pat = ""
# Odd elements of parts are an escaped chars now.
# Need to look for glob patterns in even elements.
while i < len(parts):
if parts[i] != "":
# escape any remaining regexp metacharacters like "."
s = re.escape(parts[i])
# sort out "**" and "*"
s = self.__handle_stars(s)
self.pat = self.pat + s
# Add back the escaped chars
if (i < len(parts) - 1):
self.pat = self.pat + parts[i+1]
i = i+2
self.pat = self.pat + "$"
if top_match:
self.pat = "^" + self.pat
# Special case: '**/' matches empty string
elif self.pat[:4] == r".*\/":
self.pat = "(.*/|)" + self.pat[4:]
self.logger.debug("regexp: %s -> (%s)" % (self, self.pat))
self.re = re.compile(self.pat)
def __str__(self):
s = self.glob
if self.dir_match: s = s + "/"
if self.type:
t = self.type
else:
t = " "
if self.path_match:
p="p"
else:
p=" "
return "(%s)[%s%s]" % (s, t, p)
def match(self, filename):
if len(filename) > 0 and filename.endswith("/"):
filename = filename [:-1]
elif self.dir_match:
return False
if self.path_match:
ret = self.re.search(filename) is not None
else:
ret = self.re.match(os.path.basename(filename)) is not None
if ret:
self.logger.debug("%s matches %s" % (filename, self))
return ret
class GlobChain(loggingclass.LoggingClass):
"""
A class that represents a chain of RsyncGlob filter rules.
Filter rules are applied in order. The recurse() function can
be used to filter directories recursively.
doctest example:
>>> loggingclass.init_logging(level=loggingclass.DEBUG,
... format="%(name)s[%(lineno)d]: %(message)s",
... stream=sys.stdout)
>>>
>>> ch = GlobChain()
>>> ch.set_log_level(loggingclass.DEBUG)
>>>
>>> ch.exclude("+ spam/", "- /*/", "+ egg/", "- */", "+ \*", "- *")
GlobChain[251]: added rule: (spam/)[+ ]
GlobChain[251]: added rule: (/*/)[-p]
GlobChain[251]: added rule: (egg/)[+ ]
GlobChain[251]: added rule: (*/)[- ]
GlobChain[251]: added rule: (\*)[+ ]
GlobChain[251]: added rule: (*)[- ]
>>> for x in ("spam", "spam/", "egg",
... "egg/", "*", "spam/egg",
... "spam/egg/", "spam/*/egg", "spam/egg/*"):
... xx = ch.match(x)
GlobChain[279]: exclude spam
GlobChain[279]: include spam/
GlobChain[279]: exclude egg
GlobChain[279]: exclude egg/
GlobChain[279]: include *
GlobChain[279]: exclude spam/egg
GlobChain[279]: include spam/egg/
GlobChain[279]: exclude spam/*/egg
GlobChain[279]: include spam/egg/*
"""
__end_re = re.compile(r"/+$")
def __init__(self):
self._lst = []
def _in_ex(self, x):
if x == INCLUDE:
return "include"
elif x == EXCLUDE:
return "exclude"
else:
return None
def add(self, type, *args):
"""
add(type, *args): add (a) new INCLUDE/EXCLUDE pattern rule(s).
<type> is either INCLUDE or EXCLUDE, or the patterns must
start with "+" or "-".
+/- start character has precedence over <type>.
"""
for x in args:
# "!" resets the rule chain (why?)
if (x == "!"):
l = []
else:
glb = RsyncGlob(x)
if (glb.type == None):
if (type == None):
raise ValueError, "filter type is undefined for %s" % glb
else:
glb.type = type
self.logger.info("added rule: %s" % glb)
self._lst.append(glb)
def exclude(self, *args):
"""
exclude(*args): add (a) new EXCLUDE pattern rule(s)
"""
self.add(EXCLUDE, *args)
def include(self, *args):
"""
include(*args): add (a) new INCLUDE pattern rule(s)
"""
self.add(INCLUDE, *args)
def match(self, path):
"""match(path): returns the result of the current filter chain for path.
The rule chain is traversed until the first rule matches.
If path is a directory, it should end in "/".
"""
# Default is always INCLUDE
ret = INCLUDE
for glb in self._lst:
if glb.match(path):
ret = glb.type
break
self.logger.debug("%s %s" % (self._in_ex(ret), path))
return ret
def _recurse(self, top, dir, collector, *args):
for f in os.listdir(os.path.join(top, dir)):
rel = os.path.join(dir, f)
isdir = os.path.isdir(os.path.join(top, rel))
pat = rel
if (isdir):
pat = pat + "/"
c = self.match(pat)
collector(c, pat, *args)
if c == EXCLUDE:
continue
if isdir:
self._recurse(top, rel, collector, *args)
def collect(self, c, x, *args):
"""
Default collector function to use with recurse().
"""
l = args[0]
if c == INCLUDE:
l.append(x)
elif c == DONE:
return l
def recurse(self, dir, collector = None, *args):
"""
recurse(self, dir, collector = None, *args)
recursively descend <dir>. For each file or directory found,
<collector> is called with arguments (c, x, *args), where
<c> is the result of the test chain (or DONE when finished),
<x> is the current path, and <*args> is the rest of the arguments
of recurse().
Directories for which the chain evaluates to EXCLUDE are never entered.
When c == DONE, <collector> should return its final result. This will
be the return value of recurse().
If <collector> isn't set, a default collector function is used that
returns a list of all files below <dir> for which c == INCLUDE.
"""
if collector == None:
collector = self.collect
args = ([],)
dir = self.__end_re.sub("", dir)
if not os.path.isdir(dir):
raise IOError, "%s is not a directory" % dir
self._recurse(dir, "", collector, *args)
ret = collector(DONE, None, *args)
return ret
def add_file(self, type, name):
"""
add_file(type, name):
Add a list of INCLUDE/EXCLUDE filter rules from a file.
Used to implement --exclude-from, --include-from.
"""
try:
if name == "-":
f = sys.stdin
else:
f = open(name, "r")
for line in f.readlines():
if line.endswith("\n"):
line = line[:-1]
self.add(type, line)
finally:
if name != "-":
f.close()
_known_options = ("exclude=", "include=",
"exclude-from=", "include-from=")
def options(self):
return self._known_options
def getopt(self, options):
"""
getopt(options): parse getopt-style option pairs for filter rules.
Parses all options "--exclude=", "--include=", "--exclude-from=",
"--include-from=", leaving other options untouched.
See rsync(1) for the option semantics.
"""
hits = []
for i in range(0, len(options)):
(name, val) = options[i]
hit = True
if name == "--exclude":
self.exclude(val)
elif name == "--include":
self.include(val)
elif name == "--exclude-from":
self.add_file(EXCLUDE, val)
elif name == "--include-from":
self.add_file(INCLUDE, val)
else:
hit = False
if hit:
hits.append(i)
hits.reverse()
for i in hits:
del options[i]
def print_matches():
"""
Usage: rsyncmatch.py [--debug] [filter rules...] directory ...
Print list of files below <directory> that match the given rules.
Rules are specified with "--exclude=", "--include=", "--exclude-from=",
"--include-from=", see rsync(1) for rule semantics.
"""
import getopt
import logging
loggingclass.init_logging()
gl = GlobChain()
(options, args) = getopt.gnu_getopt(sys.argv[1:], "",
(gl._known_options) + ("debug",))
gl.getopt(options)
for x in options:
if x[0] == "--debug":
GlobChain().set_log_level(loggingclass.DEBUG)
RsyncGlob().set_log_level(loggingclass.DEBUG)
for dir in args:
ls = gl.recurse(dir)
print "List of include files below %s:" % dir
for x in ls:
print " " + x
def _test():
import doctest, rsyncmatch
doctest.testmod(rsyncmatch)
if __name__ == "__main__":
if sys.argv[1] == "--test":
sys.argv = sys.argv[1:]
_test()
else:
print_matches()
| 201
|
https://github.com/ElusiveMori/YARP2/blob/master/.gitignore
|
Github Open Source
|
Open Source
|
MIT
| 2,019
|
YARP2
|
ElusiveMori
|
Ignore List
|
Code
| 5
| 26
|
/_build
/.vs
/.vscode
wurst.dependencies
wurst_run\.args
| 51,086
|
https://github.com/fast01/chaosframework/blob/master/chaos/common/message/PerformanceNodeChannel.cpp
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
chaosframework
|
fast01
|
C++
|
Code
| 363
| 1,660
|
/*
* PerformanceNodeChannel.cpp
* !CHOAS
* Created by Bisegni Claudio.
*
* Copyright 2012 INFN, National Institute of Nuclear Physics
*
* 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.
*/
#include <chaos/common/message/PerformanceNodeChannel.h>
using namespace chaos::common::message;
namespace chaos_data = chaos::common::data;
namespace chaos_direct_io = chaos::common::direct_io;
//! base constructor
PerformanceNodeChannel::PerformanceNodeChannel(NetworkBroker *msg_broker, CNetworkAddress *node_network_address, chaos_direct_io::DirectIOClient *_client_instance):
MessageChannel(msg_broker), client_instance(_client_instance) {
setRemoteNodeAddress(node_network_address->ipPort);
}
PerformanceNodeChannel::~PerformanceNodeChannel() {
releasePerformanceSession(local_performance_session);
}
//Get the performance session for a chaos node
int PerformanceNodeChannel::getPerformanceSession(chaos_direct_io::DirectIOPerformanceSession **performance_session_handler,
uint32_t ms_timeout) {
int err = chaos::ErrorCode::EC_NO_ERROR;
if(!performance_session_handler) return -100;
//get the local endpoint
chaos_direct_io::DirectIOServerEndpoint *local_session_endpoint = broker->getDirectIOServerEndpoint();
if(!local_session_endpoint) return -101;
std::string remote_endpoint_url;
chaos_data::CDataWrapper init_performance_session_param;
//set the init parameter
init_performance_session_param.addStringValue(PerformanceSystemRpcKey::KEY_REQUEST_SERVER_DESCRITPION,
local_session_endpoint->getUrl());
//sent the request and waith the ansewer for startp local session
auto_ptr<chaos_data::CDataWrapper> init_session_result(MessageChannel::sendRequest(PerformanceSystemRpcKey::SYSTEM_PERFORMANCE_DOMAIN,
PerformanceSystemRpcKey::ACTION_PERFORMANCE_INIT_SESSION,
&init_performance_session_param,
ms_timeout));
CHECK_TIMEOUT_AND_RESULT_CODE(init_session_result, err)
if(err == ErrorCode::EC_NO_ERROR) {
auto_ptr<chaos_data::CDataWrapper> info_pack(init_session_result->getCSDataValue(RpcActionDefinitionKey::CS_CMDM_ACTION_MESSAGE));
if(info_pack.get() && info_pack->hasKey(PerformanceSystemRpcKey::KEY_REQUEST_SERVER_DESCRITPION)){
remote_endpoint_url = info_pack->getStringValue(PerformanceSystemRpcKey::KEY_REQUEST_SERVER_DESCRITPION);
chaos_direct_io::DirectIOClientConnection *local_session_client_connection = client_instance->getNewConnection(remote_endpoint_url);
if(!local_session_client_connection) {
//i need to release the enpoint
broker->releaseDirectIOServerEndpoint(local_session_endpoint);
}
// i can create session
local_performance_session = *performance_session_handler = new chaos_direct_io::DirectIOPerformanceSession(local_session_client_connection, local_session_endpoint);
if(!*performance_session_handler) {
client_instance->releaseConnection(local_session_client_connection);
//i need to release the enpoint
broker->releaseDirectIOServerEndpoint(local_session_endpoint);
err = -103;
} else {
try {
chaos::utility::InizializableService::initImplementation(*performance_session_handler, NULL, "DirectIOPerformanceSession", __PRETTY_FUNCTION__);
} catch(chaos::CException ex) {
chaos::utility::InizializableService::deinitImplementation(*performance_session_handler, "DirectIOPerformanceSession", __PRETTY_FUNCTION__);
err = -104;
}
}
}
} else {
//i need to release the enpoint
broker->releaseDirectIOServerEndpoint(local_session_endpoint);
err = -102;
}
return err;
}
//! release the performance session
int PerformanceNodeChannel::releasePerformanceSession(chaos_direct_io::DirectIOPerformanceSession *performance_session,
uint32_t ms_timeout) {
chaos_data::CDataWrapper init_performance_session_param;
if(!performance_session) return -1;
if(local_performance_session != performance_session) return -1;
try{
//set the init parameter
init_performance_session_param.addStringValue(PerformanceSystemRpcKey::KEY_REQUEST_SERVER_DESCRITPION,
performance_session->server_endpoint->getUrl());
//sent the request and waith the ansewer for startp local session
auto_ptr<chaos_data::CDataWrapper> init_session_result(MessageChannel::sendRequest(PerformanceSystemRpcKey::SYSTEM_PERFORMANCE_DOMAIN,
PerformanceSystemRpcKey::ACTION_PERFORMANCE_CLOSE_SESSION,
&init_performance_session_param,
ms_timeout));
chaos::utility::InizializableService::deinitImplementation(performance_session, "DirectIOPerformanceSession", __PRETTY_FUNCTION__);
if(performance_session->client_connection) client_instance->releaseConnection(performance_session->client_connection);
//i need to release the enpoint
if(performance_session->server_endpoint) broker->releaseDirectIOServerEndpoint(performance_session->server_endpoint);
} catch(chaos::CException ex) {
return -100;
}
delete(local_performance_session);
local_performance_session = NULL;
return 0;
}
| 20,747
|
https://github.com/zkan/pronto-feedback/blob/master/pronto_feedback/questions/models.py
|
Github Open Source
|
Open Source
|
MIT
| 2,016
|
pronto-feedback
|
zkan
|
Python
|
Code
| 16
| 55
|
from __future__ import unicode_literals
from django.db import models
class Question(models.Model):
title = models.TextField()
category = models.CharField(max_length=50)
| 26,863
|
https://github.com/dinii-inc/hasura-con-2021-recap-mo-demo/blob/master/packages/hasura/migrations/1625395756522_alter_table_public_order_drop_column_price/down.sql
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
hasura-con-2021-recap-mo-demo
|
dinii-inc
|
SQL
|
Code
| 16
| 35
|
alter table "public"."order" alter column "price" drop not null;
alter table "public"."order" add column "price" text;
| 31,043
|
https://github.com/yeyu0415/kefu/blob/master/src/main/java/com/ukefu/webim/service/es/UKAggResultExtractor.java
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,021
|
kefu
|
yeyu0415
|
Java
|
Code
| 181
| 892
|
package com.ukefu.webim.service.es;
import java.util.ArrayList;
import java.util.List;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.search.aggregations.Aggregations;
import org.elasticsearch.search.aggregations.bucket.histogram.InternalDateHistogram;
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.core.aggregation.AggregatedPage;
import org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPageImpl;
import com.ukefu.webim.web.model.KbsTopic;
import com.ukefu.webim.web.model.KbsTopicComment;
public class UKAggResultExtractor extends UKResultMapper{
private String term ;
public UKAggResultExtractor(String term){
this.term = term ;
}
@SuppressWarnings("unchecked")
@Override
public <T> AggregatedPage<T> mapResults(SearchResponse response, Class<T> clazz, Pageable pageable) {
Aggregations aggregations = response.getAggregations();
List<T> results = new ArrayList<T>();
long total = 0 ;
if(aggregations!=null && aggregations.get(term)!=null){
if(aggregations.get(term) instanceof Terms){
Terms agg = aggregations.get(term) ;
if(agg!=null){
total = agg.getSumOfOtherDocCounts() ;
if(agg.getBuckets()!=null && agg.getBuckets().size()>0){
for (Terms.Bucket entry : agg.getBuckets()) {
if(clazz.equals(KbsTopic.class)){
KbsTopic topic = new KbsTopic();
topic.setCreater(entry.getKeyAsString());
topic.setRowcount((int) entry.getDocCount());
results.add((T) topic) ;
}else if(clazz.equals(KbsTopicComment.class)){
KbsTopicComment topicComment = new KbsTopicComment();
topicComment.setCreater(entry.getKeyAsString());
topicComment.setRowcount((int) entry.getDocCount());
results.add((T) topicComment) ;
}
}
}
}
}else if(aggregations.get(term) instanceof InternalDateHistogram){
InternalDateHistogram agg = aggregations.get(term) ;
total = response.getHits().getTotalHits() ;
if(agg!=null){
// if(agg.getBuckets()!=null && agg.getBuckets().size()>0){
// for (DateHistogram.Bucket entry : agg.getBuckets()) {
// if(clazz.equals(KbsTopic.class)){
// KbsTopic topic = new KbsTopic();
// topic.setKey(entry.getKey().substring(0 , 10));
// topic.setRowcount((int) entry.getDocCount());
// results.add((T) topic) ;
// }
// }
// }
}
}
}
return new AggregatedPageImpl<T>(results, pageable, total);
}
}
| 10,061
|
https://github.com/lefb766/mono/blob/master/mcs/errors/cs0104-4.cs
|
Github Open Source
|
Open Source
|
Apache-2.0
| 2,022
|
mono
|
lefb766
|
C#
|
Code
| 49
| 107
|
// CS0104: `XAttribute' is an ambiguous reference between `A.XAttribute' and `B.XAttribute'
// Line: 21
using System;
namespace A
{
class XAttribute : Attribute { }
}
namespace B
{
class XAttribute : Attribute { }
}
namespace C
{
using A;
using B;
[X]
class Test
{
}
}
| 5,156
|
https://github.com/inventor96/f3-boilerplate/blob/master/app/autoload/Traits/CreatedDt.php
|
Github Open Source
|
Open Source
|
MIT
| 2,022
|
f3-boilerplate
|
inventor96
|
PHP
|
Code
| 45
| 152
|
<?php
namespace Traits;
use DateTime;
use DateTimeZone;
trait CreatedDt {
protected function get_created_dt(string $dt_val): DateTime {
/** @var DateTimeZone */
$tz = \Base::instance()->srv_tz;
return new DateTime($dt_val, $tz);
}
protected function set_created_dt(DateTime $dt): string {
/** @var DateTimeZone */
$tz = \Base::instance()->srv_tz;
return $dt->setTimezone($tz)->format(TIME_FORMAT_SQL);
}
}
| 31,008
|
https://github.com/cogsys-tuebingen/cslibs_vectormaps/blob/master/include/cslibs_vectormaps/utility/serialization.hpp
|
Github Open Source
|
Open Source
|
BSD-3-Clause
| null |
cslibs_vectormaps
|
cogsys-tuebingen
|
C++
|
Code
| 201
| 645
|
#ifndef SERIALIZATION_HPP
#define SERIALIZATION_HPP
#include <yaml-cpp/yaml.h>
#include <cstddef>
#include <cstdint>
#include <vector>
namespace cslibs_vectormaps {
namespace serialization {
template<typename T>
struct Serializer {
union {
T value;
unsigned char bytes[sizeof(T)];
};
const static std::size_t size = sizeof(T);
Serializer() : bytes()
{
}
};
template<typename T>
inline void serialize(const std::vector<T> &data,
YAML::Binary &binary)
{
Serializer<std::uint32_t> id;
Serializer<T> td;
unsigned int bsize = id.size + data.size() * td.size;
std::vector<unsigned char> bytes(bsize);
unsigned char *bytes_ptr = bytes.data();
id.value = data.size();
for(std::size_t i = 0 ; i < id.size ; ++i, ++bytes_ptr)
*bytes_ptr = id.bytes[i];
for(const T& element : data) {
td.value = element;
for(std::size_t i = 0 ; i < td.size ; ++i, ++bytes_ptr)
*bytes_ptr = td.bytes[i];
}
binary.swap(bytes);
}
template<typename T>
inline bool deserialize(const YAML::Binary &binary,
std::vector<T> &data)
{
Serializer<std::uint32_t> id;
Serializer<T> td;
if(binary.size() < id.size)
return false;
const unsigned char* binary_ptr = binary.data();
for(std::size_t i = 0 ; i < id.size ; ++i, ++binary_ptr)
id.bytes[i] = *binary_ptr;
std::size_t size = id.value;
if((binary.size() - id.size) < size * td.size)
return false;
data.resize(size);
for(T& entry : data) {
for(std::size_t i = 0 ; i < td.size ; ++i, ++binary_ptr)
td.bytes[i] = *binary_ptr;
entry = td.value;
}
return true;
}
}
}
#endif // SERIALIZATION_HPP
| 30,165
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.