text stringlengths 3 1.05M |
|---|
import unittest
import import_ipynb
import pandas as pd
import pandas.testing as pd_testing
class Test(unittest.TestCase):
def setUp(self):
import Exercise_15_06_Ensemble_learning_Boosting_v1_0
self.exercises = Exercise_15_06_Ensemble_learning_Boosting_v1_0
self.filename = 'https:/... |
"""
License: Apache 2.0. See LICENSE file in root directory.
Copyright(c) 2020-2021 Intel Corporation. All Rights Reserved.
"""
import rsid_py
PORT='COM9'
def on_result(result, user_id):
print('on_result', result)
if result == rsid_py.AuthenticateStatus.Success:
print('Authenticated user:', user_... |
#!/usr/bin/env python
import time
import cv2
import rospy
import tf
import yaml
from cv_bridge import CvBridge
from geometry_msgs.msg import PoseStamped
from light_classification.tl_classifier import TLClassifier
from scipy.spatial import KDTree
from sensor_msgs.msg import Image
from std_msgs.msg import Int32
from sty... |
'use strict';
module.exports = (sequelize, DataTypes) => {
var ballot = sequelize.define('ballot', {
vote: {
type: DataTypes.INTEGER,
allowNull: false
},
name: {
type: DataTypes.STRING,
allowNull: false
}
}, {
timestamps: false
});
ballot.associate = function(models) ... |
#
# PySNMP MIB module ARTEM-COMPOINT-WLAN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ARTEM-COMPOINT-WLAN-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:25:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... |
const express = require('express');
const controllers = require('./controllers');
const sequelize = require('./config/connection');
const path = require('path');
const { dirname } = require('path');
const app = express ();
const PORT = process.env.PORT || 3001;
const exphbs = require('express-handlebars');
const hbs ... |
/* $FreeBSD: releng/11.0/lib/libelftc/elftc_version.c 300698 2016-05-25 20:56:30Z emaste $ */
#include <sys/types.h>
#include <libelftc.h>
const char *
elftc_version(void)
{
return "elftoolchain r3477M";
}
|
from django.test import TestCase
from .models import Image, Location, Category
# Create your tests here.
class CategoryTestCase(TestCase):
def setUp(self):
self.category=Category(category_name='Travel')
self.category.save_category()
def test_instance(self):
self.assertTrue(isinstanc... |
from helpers.enums import Network
from scripts.rewards.utils.propose_rewards import propose_rewards
if __name__ == "__main__":
propose_rewards(Network.Ethereum)
|
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The MagnaChain Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test spending coinbase transactions.
The coinbase transaction in block N can appear in block
N+100.... |
'use strict';
const { Writable } = require('stream');
const writtenSym = Symbol('written');
class LogStream extends Writable {
constructor(options) {
super(options);
this.isTTY = false;
this[writtenSym] = '';
}
write(chunk, encoding, callback) {
this[writtenSym] += chunk.toString();
}
toSt... |
/**
* Copyright 2016 Facebook, Inc.
*
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
* use, copy, modify, and distribute this software in source code or binary
* form for use in connection with the web services and APIs provided by
* Facebook.
*
* As with any software that integrat... |
#!/usr/bin/env python
#
# update_tests.py: testing update cases.
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or mo... |
const broadcast = require('./broadcast')
const noop = require('noop4')
const Skype = require('./handlers/skype')
const Discord = require('./handlers/discord')
const IRC = require('./handlers/irc')
const skype = new Skype()
const discord = new Discord()
const irc = new IRC()
function start(cb) {
cb = cb || noop()
... |
"""
A threaded shared-memory scheduler
See local.py
"""
import atexit
import multiprocessing.pool
import sys
import threading
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from threading import Lock, current_thread
from . import config
from .local import MultiprocessingPoolExec... |
from numbers import Number
from itertools import combinations
import numpy as np
from joblib import Parallel, delayed
from sklearn.utils import check_random_state
from inspect import getargspec
def powerset(x, min_size=1, max_size=None, descending=True):
"""
Iterates over the power set.
powerset([1,2,3])... |
import pytest
import qcelemental
from qcelemental.testing import compare
_results = {
"subject1": """
3 au
Co 0 0 0
H 2 0 0
h_OTher -2 0 0
""",
"ans1_au": """3 au
CoH2
Co 0.000000000000 0.000000000000 0.000000000000
H 2.000000000000 0.000000000000 0.0000000000... |
import os
from tempfile import TemporaryDirectory
from io import StringIO
from typing import Any, List, Optional, Tuple, Union
from unittest import TestCase
TEST_ROOT = os.path.dirname(os.path.realpath(__file__))
DEBUG = False
class IgnoreArgument:
def __repr__(self) -> str:
return "(ignored)"
def read... |
import theme from './theme';
import reset from './reset';
export { theme, reset };
|
import multiprocessing as mp
mp.set_start_method('spawn', force=True)
import argparse
import os
import time
import yaml
import numpy
import logging
from easydict import EasyDict
import pprint
from tensorboardX import SummaryWriter
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.opt... |
import numpy
import chainerx
def test_py_types():
assert chainerx.bool is bool
assert chainerx.int is int
assert chainerx.float is float
def test_dtypes():
assert chainerx.dtype is numpy.dtype
assert chainerx.bool_ is numpy.bool_
assert chainerx.int8 is numpy.int8
assert chainerx.int16 ... |
/**
* Tests vuex action
*
* @param {object} opts
* @param {function} opts.action - action to dispatch
* @param {*} opts.actionPayload - payload action will be dispatched with
* @param {Array<object>} opts.expectedMutations - mutations expected to be committed inside action call
* @param {Array<object>} opts.expe... |
const mongoose = require('mongoose');
const { Schema } = mongoose;
const followSchema = new Schema({
follower: {
type: String,
required: true,
},
following: {
type: String,
required: true,
},
isFollowing: {
type: Boolean,
default: false,
},
});
module.exports.Follow = mongoose.mod... |
# import Flask and jsonify
from flask import render_template, Flask, jsonify, request, make_response
# import Resource, Api and reqparser
from flask_restful import Resource, Api, reqparse
import pandas as pd
import numpy as np
import pickle
app = Flask(__name__)
api = Api(app)
with open('myfile.pickle', 'rb') as fi... |
const sqlectron = require('../core/index.js'); |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... |
import React, { useCallback } from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import { themeGet } from 'styled-system'
import { Button } from 'pcln-design-system'
import { ChevronDown } from 'pcln-icons'
import Popover from 'pcln-popover'
import MenuList from '../MenuList'
const ... |
from django.conf import settings
from modeltranslation.translator import translator, TranslationOptions
from geotrek.flatpages import models as flatpages_models
class FlatPageTO(TranslationOptions):
fields = ('title', 'content', 'external_url') + (
('published',) if settings.PUBLISHED_BY_LANG else tuple... |
from django.urls import path
from .views import wildcard_redirect
urlpatterns = [
path('<path>/', wildcard_redirect ),
]
|
# Copyright 2016-2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import io
import os
from collections import abc, defaultdict
from typing import Dict, Iterable, List, Optional, Set, Tuple, cast
from pkg_resources import Requirement
from pants.engine.f... |
# -*- coding: utf-8 -*-
"""This module contains all non-cipher related data extraction logic."""
import json
from collections import OrderedDict
from pytube.compat import HTMLParser
from pytube.compat import quote
from pytube.compat import urlencode
from pytube.exceptions import RegexMatchError
from pytube.helpers imp... |
// Compiled by ClojureScript 1.10.339 {}
goog.provide('example.demos.demo_autocomplete');
goog.require('cljs.core');
goog.require('reagent.core');
goog.require('material_ui');
goog.require('example.utils.theme');
goog.require('example.demos.demo_text_field');
goog.require('cljsjs.react_select');
example.demos.demo_auto... |
module.exports = {
productionSourceMap: false,
css: {
extract: true,
sourceMap: false,
loaderOptions: {
sass: {
// 配置全局sass
prependData: `
@import "./modules/mist-ui/theme-chalk/common-var.scss";
`,
}
},
},
} |
/* Taxonomy Classification: 0000300603130000000211 */
/*
* WRITE/READ 0 write
* WHICH BOUND 0 upper
* DATA TYPE 0 char
* MEMORY LOCATION 0 stack
* SCOPE 3 inter-file/inter-proc
* CONTAINER 0 no
* POI... |
// components/NotFound.js
import React from 'react';
const NotFound = () =>
<div className='container-404'>
<h3>404 page not found</h3>
<p>Devvy Here! Your page does not seem to exist :(</p>
<p>Try Heading back back!</p>
<iframe
src="https://giphy.com/embed/xT0GqtpF1NWd9VbstO"
width="36... |
from itertools import permutations
from day18_1 import SnailfishNumber
def get_magnitude(number1, number2):
snf1 = SnailfishNumber(number1)
snf2 = SnailfishNumber(number2)
added = snf1 + snf2
added.reduce()
return added.magnitude()
def main(filename):
with open(filename) as f:
raw_n... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from numpy.testing import assert_equal, assert_allclose
import pytest
from ..._utils.examples import make_example_dataset
from ..pixcoord import PixCoord
... |
from .. import backend as K
from .. import activations, initializations, regularizers
import numpy as np
from ..engine import Layer, InputSpec
from ..utils.np_utils import conv_output_length
import warnings
class ConvRecurrent2D(Layer):
'''Abstract base class for convolutional recurrent layers.
Do not use in... |
_base_ = [
'../../../lvis/mask_rcnn_r50_fpn_sample1e-3_mstrain_1x_lvis_v1.py'
]
data = dict(train=dict(oversample_thr=0.0))
# model = dict(roi_head=dict(bbox_head=dict(loss_cls=dict(type="Icloglog",activation='normal'),
# init_cfg = dict(type='Constant',val=0.01, bias=-3.4... |
class BaseError extends Error {
constructor(message, ...args) {
this._message = message;
// super(...args);
Error.captureStackTrace(this, this.constructor.name);
// this.message = message;
this.name = this.constructor.name;
this.isOperational = true;
this.timecode = new Date();
this... |
from django.urls import re_path
from . import consumers
websocket_urlpatterns = [
re_path(
r'ws/notifications/(?P<user_id>\w+)/$',
consumers.NotificationConsumer
)
]
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_src_containers_Backend_User_Subjects_Edit_js"],{
/***/ "./resources/js/src/components/Backend/UI/Breadcrumb/Breadcrumb.js":
/*!*************************************************************************!*\
!*** ./resources/js/src/components/Backe... |
from ..IReg import IReg
class RD190(IReg):
def __init__(self):
self._header = ['REG',
'CST_ICMS',
'CFOP',
'ALIQ_ICMS',
'VL_OPR',
'VL_BC_ICMS',
'VL_ICMS',
... |
# This module contains some code copied from unittest2/loader.py and other
# code developed in reference to that module and others within unittest2.
# unittest2 is Copyright (c) 2001-2010 Python Software Foundation; All
# Rights Reserved. See: http://docs.python.org/license.html
import logging
import os
import types
... |
/*
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/os_interface/linux/drm_command_stream.h"
#include "shared/test/common/helpers/ult_hw_config.h"
using namespace NEO;
template <typename GfxFamily>
class TestedDrmCommandStreamReceiver : publi... |
/*!
* bootstrap-fileinput v4.3.6
* http://plugins.krajee.com/file-input
*
* Author: Kartik Visweswaran
* Copyright: 2014 - 2016, Kartik Visweswaran, Krajee.com
*
* Licensed under the BSD 3-Clause
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
*/
(function (factory) {
"use strict";... |
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
register_host_test("accel_cal")
|
import torch
def critic_update(state_mb, return_mb, q, optim_q):
val_loc = q(state_mb)
critic_loss = (return_mb - val_loc).pow(2).mean()
optim_q.zero_grad()
critic_loss.backward()
optim_q.step()
del val_loc
critic_loss_numpy = critic_loss.detach().cpu().numpy()
del critic_loss
yi... |
"use strict";
jQuery(document).ready(function ($) {
$(window).load(function () {
$(".loaded").fadeOut();
$(".preloader").delay(1000).fadeOut("slow");
});
/*---------------------------------------------*
* Mobile menu
---------------------------------------------*/
$('#navbar-collapse').find(... |
'use strict';
const math = require('./math');
const cheatSheet = require('./cheatSheet');
const modules = [
{ mod: math, key: 'math' },
{ mod: cheatSheet, key: 'cheatSheet' }
];
module.exports = modules;
|
webpackJsonp([27],{1003:function(e,t,r){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),o=s(i),a=function(e){var t=e.split("-");return t.length>1?t[0].charAt(0).toUpperCase()+t[0].slice(1)+" "+t[1].charAt(0).toUpperCase()+t[1].slice(1):e.charAt... |
!function(e){function n(n){for(var t,c,s=n[0],u=n[1],p=n[2],f=0,l=[];f<s.length;f++)c=s[f],Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&l.push(o[c][0]),o[c]=0;for(t in u)Object.prototype.hasOwnProperty.call(u,t)&&(e[t]=u[t]);for(i&&i(n);l.length;)l.shift()();return a.push.apply(a,p||[]),r()}function r(){for(var e,n... |
function doubleclickdetect(el,callback){
var touchsurface = el,
startX,
startY,
distX,
distY,
isdouble,
allowedTime = 60,
restraint = 50,
handledoubleclick = callback || function(isdouble){};
touchsurface.addEventListener('touchstart', function(e){
var touchobj = e.changedTouches[0];
isdouble = false;
... |
#include <jni.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "srp_api_ctrl.h"
#define LOG_TAG "libsa_jni"
#include <cutils/log.h>
void Java_com_android_music_SetSACtrlJNI_set(JNIEnv * env, jobject obj, int effect_num)
{
unsigned long effect_enable = effect_num ? 1 : 0;
... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
#
# file: store.py
#
# RTK, 05-Jan-2020
# Last update: 11-Jan-2020
#
################################################################
import pickle
import sys
import os
import numpy as np
import time
import matplotlib.pylab as plt
sys.path.append("../")
from PSO import *
from RO import *
from GWO import *
from ... |
import {
internal_safe_get as safeGet,
internal_safe_set as safeSet
} from '@tarojs/taro'
import { componentTrigger } from './create-component'
import { shakeFnFromObject, isEmptyObject, diffObjToPath } from './util'
import PropTypes from 'prop-types'
const isDEV = typeof process === 'undefined' ||
!process.env ... |
import inspect
import scrubadub
try:
unicode
except NameError:
unicode = str # Python 2 and 3 compatibility
# this is a mixin class to make it easy to centralize a lot of the core
# functionality of the test suite
class BaseTestCase(object):
def clean(self, text, **kwargs):
if 'replace_with' i... |
import React from 'react'
import { storiesOf } from '@kadira/storybook'
import Heading from '.'
storiesOf('Heading', module)
.add('default', () => (
<Heading>Id tempor duis non esse commodo fugiat excepteur nostrud.</Heading>
))
.add('palette', () => (
<Heading palette="primary">Id tempor duis non esse c... |
(function(){'use strict';var g;var l=["-ms-","-moz-","-webkit-",""],m=function(a,c){for(var b,d,e=0;e<l.length;++e)b=l[e]+"transition-duration",d=""+c,a.style.setProperty(b,d)};function n(a,c,b,d,e,h,f){this.j=a;this.f=c;this.w=b;a=d||"none";this.l=e="none"===a?0:e||1E3;this.g=h||"linear";this.i=[];if(e){h=f||"top";if(... |
#!/usr/bin/python3
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# 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... |
var config_8php =
[
[ "tpps_admin_settings", "config_8php.html#a7155964acfb2b6be9400922c1aa47767", null ],
[ "tpps_admin_settings_validate", "config_8php.html#a9a02a4f12ceb42be0204fbaa31fa180f", null ],
[ "tpps_update_old_submissions", "config_8php.html#ad37f195b3ad06c449635a53383735a51", null ]
]; |
'use strict'
import {Router} from 'express'
import {bearerAuth} from '../middleware/parser-auth.js'
import parserBody from '../middleware/parser-body'
import Profile from '../model/profile.js'
import createError from 'http-errors'
import {log} from '../lib'
export default new Router()
.post('/api/profile', bearerAuth... |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
import { __extends, __decorate, __metadata, __param } from 'tslib';
import { TransferState, BrowserTransferStateModule } from '@angular/platform-browser';
import { ElementRef, NgZone, Inject, PLATFORM_ID, Input, Output, EventEmitter, Component, NgModule } from '@angular/core';
import DxLoadIndicator from 'devextreme/ui... |
#
# Copyright Contributors to the OpenTimelineIO project
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and rep... |
def swap(p,q): # We have swap the total list.
temp = p
p = q
q = temp
print(p,q)
print(p[0],q[0])
def main():
a,b=map(int,input().split())
x=[0] * 1
y=[0] * 1
x[0]=a
y[0]=b
swap(x, y)
print(x, y)
if __name__=="__main__":
main(... |
# Version 0 is an empty database.
#
# Version 1 is the schema state at the time when we started doing DB
# versioning.
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Float, String, Integer, Column, ForeignKey, Binary, DateTime
from sqlalchemy.orm import relation
Base ... |
"""
Event-driven framework of Quantitative Trading Robots.
"""
import sys
from collections import defaultdict
from queue import Empty, Queue
from threading import Thread
from time import sleep
from typing import Any, Callable, List
EVENT_TIMER = "eTimer"
class Event:
"""
Event object consists of a type strin... |
import random #brings in random function
#Made By Blake McCullough
#Discord - Spoiled_Kitten#4911
#Github - https://github.com/Blake-McCullough/
#Email - privblakemccullough@protonmail.com
print("Random dice roller by Blake McCullough") #displays creators name
print("Would you like the dice to")#asks what the user wou... |
//
// CZWeatherCondition.h
// CZWeatherKit
//
// Copyright (c) 2015 Comyar Zaheri. All rights reserved.
//
// 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, includ... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# This Python script contains a quantum random integer generator
# using the operation QuantumRandomNumberGenerator defined in
# the file qrng.qs.
# For instructions on how to install the qsharp package,
# see: https://docs.microsoft.com/azure/q... |
from LAC import LAC
import pkuseg
import jieba
import os
cn_data_path = "./demo_data/cn/demo.txt"
output_data_path = "./demo_data/cn/seg_train_caps.txt"
bseg = LAC(mode='seg') # baidu
pseg = pkuseg.pkuseg() # pku
with open (cn_data_path, "r") as f:
for line in f.readlines():
print(f'bseg: {bseg.run(line)... |
import os
import shutil
import sys
from glob import glob
import sphinx_bootstrap_theme
from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey
sys.path.append("../src")
# Allow autosummary to generate stub files
autosummary_generate = True
add_module_names = False # don't include module path to module/... |
from typing import (
Any,
Callable,
Dict,
Iterable,
Sequence,
Tuple,
)
from eth_typing import (
TypeStr,
)
from eth_utils import (
to_dict,
)
from eth_utils.curried import (
apply_formatter_at_index,
)
from eth_utils.toolz import (
curry,
)
from web3._utils.abi import (
map... |
"""Test suite for Organization module."""
import json
from uuid import uuid4
from app import db
from tests.base import BaseTestCase
from tests.utils import add_user, add_organization, add_sample_group, with_user
class TestOrganizationModule(BaseTestCase):
"""Tests for the Organizations module."""
@with_us... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from typin... |
/*
* Copyright 2014 Takuya Asano
* Copyright 2010-2014 Atilika Inc. and contributors
*
* 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... |
theBoard = {'7': ' ', '8': ' ', '9': ' ',
'4': ' ', '5': ' ', '6': ' ',
'1': ' ', '2': ' ', '3': ' '}
blank_Board = {'7': '7', '8': '8', '9': '9',
'4': '4', '5': '5', '6': '6',
'1': '1', '2': '2', '3': '3'}
board_keys = []
for key in theBoard:
board_keys.appe... |
/**
* @file Module simplifying JavaScript's audio to a public interface of an images dictionary and playSound function
*/
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
/**
* Dictionary of sound objects
* @typedef {Object} sounds
* @property {buffer} audioNode - Binary blobs from soun... |
from deconvtest.framework.module.align import Align
class Evaluation(Align):
"""
Evaluation module
"""
def __init__(self, method: str = None, parameters: dict = None):
super(Evaluation, self).__init__(method=method,
parameters=parameters,
... |
import pytest
from werkzeug.exceptions import Unauthorized
from emol.models import Combatant, Card, CardReminder
@pytest.mark.parametrize(
'privileged_user',
[{ 'rapier': ['edit_authorizations']}],
indirect=True
)
def test_authorizations_authorized(app, combatant, privileged_user):
"""Test adding au... |
#!/usr/bin/env python3
import sys
import argparse
import os
def download_abstract(url, cookie_file, abstract_html_file):
url_tmp_file = open('tmp.url', 'w')
url_tmp_file.write(url+'\n')
url_tmp_file.close()
wget_cmd = "wget --user-agent=\"Mozilla/5.0 (Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0\... |
from .concurrent import *
from .pipeline import *
from .ui import *
from .tasks import *
from .tex import *
from .misc import *
|
export const twoFer = (name) => {
if (name == "Alice" || name == "Bob") {
return `One for ${name}, one for me.`
} else {
return `One for you, one for me.`
}
}
|
from django.urls import path, re_path
urlpatterns = [
path('/path-starting-with-slash/', lambda x: x),
re_path(r'/url-starting-with-slash/$', lambda x: x),
]
|
// /d/dagger/Daggerdale/shops/vethor_trophy.c
#include <std.h>
#include <daemons.h>
inherit ROOM;
string query_time_of_day();
void create(){
::create();
set_terrain(WOOD_BUILDING);
set_travel(DIRT_ROAD);
set_property("light", 2);
set_property("indoors",1);
set_property("no teleport",1);
set... |
/*
* Copyright 2016 Linaro Ltd.
* Copyright 2016 ZTE Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#ifndef __ZX_PLANE_REGS_H__
#define __ZX_PLANE_REGS_H_... |
#! /usr/bin/env python
import sys
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--filter')
options = parser.parse_args()
result = subprocess.check_output(['git', 'for-each-ref', '--shell', 'refs/heads'])
splitResult = str.split(result, '\n')
branchList = list()
br... |
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
import os
import pickle
import pyworld
import soundfile as sf
# Charge les fichiers wav dans une liste
# wav_dir : Répertoire
# sr : Taux d'échantillonnage
def load_wavs(wav_dir, sr):
wavs = list()
filenames = list()
for file in os.listdir... |
class orderedset(object):
def __init__(self):
self.items = []
self.set = set()
def add(self, item):
if item in self.set:
return False
self.items.append(item)
self.set.add(item)
return True
def pop(self):
item = self.items.pop()
se... |
import React from "react";
import { graphql } from "gatsby";
import Layout from "../components/layout";
import { css } from "@emotion/core";
import MiniHeader from "../components/MiniHeader";
import headspace from "../assets/headspacebanner3.jpg";
export default ({ data }) => {
const post = data.markdownRemark;
re... |
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import a from"./../../../../math/base/assert/is-nan.js";var r=a;function t(a,t){return r(a)||r(t)||a>=t?NaN:a}var e=t;export default e;
//# sourceMappingURL=mode.js.map |
[!outputon]
[!set(SOAP, "TRUE")]
[!if=(Comments, "TRUE")]
// ************************************************************************ //
// Invokable interface declaration header for [!InterfaceName]
// ************************************************************************ //
[!endif]
#ifndef [!IntfFileName]... |
from vocoder.models.fatchord_version import WaveRNN
from vocoder.vocoder_dataset_custom import VocoderDataset, collate_vocoder
from vocoder.distribution import discretized_mix_logistic_loss
from vocoder.display import stream, simple_table
from vocoder.gen_wavernn import gen_testset
from torch.utils.data import DataLoad... |
from django.conf import settings
from django.http import HttpResponseRedirect
from django.utils.deprecation import MiddlewareMixin
class AjaxRedirect(MiddlewareMixin):
def process_request(self, request):
ajax_referer = request.META.get('HTTP_X_ALT_REFERER')
if ajax_referer:
... |
#! /usr/bin/env python
# coding=utf-8
#================================================================
# Copyright (C) 2018 * Ltd. All rights reserved.
#
# Editor : VIM
# File name : utils.py
# Author : YunYang1994
# Created date: 2018-11-22 12:02:52
# Description :
#
#=========================... |
// Add to index.js or the first page that loads with your app.
// For Intel XDK and please add this to your app.js.
$(document).ready(function() {
// if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/)) {
// document.addEventListener("deviceready", onDeviceReady, false);
// ... |
# Stdlib
import importlib
import inspect
# External Libraries
from japronto import Application, RouteNotFoundException
def route(*args, **kwargs):
def decorator(func):
return Route(func, *args, **kwargs)
return decorator
class Route:
def __init__(self, func, path, methods, *args, **kwargs):
... |