text
stringlengths
3
1.05M
const { Command } = require('klasa'); const { MessageAttachment } = require('discord.js'); const { createCanvas, Image, registerFont } = require('canvas'); const fs = require('fs'); const bg = fs.readFileSync('./resources/pm-bg.png'); const canvas = createCanvas(376, 174); const ctx = canvas.getContext('2d'); ctx.font...
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // MIT License. See license.txt /** * Make a standard page layout with a toolbar and title * * @param {Object} opts * * @param {string} opts.parent [HTMLElement] Parent element * @param {boolean} opts.single_column Whether to include sidebar ...
import Sketch from '../sketch'; export default class handleBlender extends Sketch { constructor() { super(); this.namespace = '图层混合|handleBlender'; } getColor(selectionType, layer) { let color; if (selectionType === 'fill') { if (layer instanceof MSTextLayer) { color = layer.textC...
import Select from "react-select"; import styled from "styled-components"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faFolder } from "@fortawesome/free-solid-svg-icons"; const LoadFromGithub = ({ selectedBranch, branches, projectsInBranch, listProjectsInBranch, loadProject...
export default{"AO":"\u0905\u0919\u094d\u0917\u094b\u0932\u093e","AZ":"\u0905\u091c\u0930\u092c\u0948\u091c\u093e\u0928","AQ":"\u0905\u0928\u094d\u091f\u093e\u0930\u0924\u093f\u0915\u093e","AD":"\u0905\u0928\u094d\u0921\u094b\u0930\u094d\u0930\u093e","AF":"\u0905\u092b\u094d\u0917\u093e\u0928\u093f\u0937\u094d\u0924\u0...
class ConnectionError(Exception): ''' Unable to connect to the api server - wrong internet connection, server is down,... ''' pass class UnsupportedCurrencyError(Exception): ''' Currency code or symbol is not supported ''' pass
const chai = require('chai'); chai.should(); const mccValidate = require('../mcc-validate'); describe('profile/mcc-validate', () => { it('should return the input-mcc if valid', done => { const mcc = '7392'; const validation = mccValidate(mcc); validation.should.be.equal('7392'); done(); }); it(...
"""pred_bitcoin URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-...
#!/usr/bin/env python # insert_mmgis.py # Mars Target Encyclopedia # Add information from the MMGIS (lat/lon coords ) to our MTE PostgreSQL DB. # # Kiri Wagstaff # October 20, 2016 # Copyright notice at bottom of file. import sys, os from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import string impo...
import '../elementAtOrDefault'; import { generate, generateThenThrow } from './utils'; test('ElementAtOrDefault: With length, index past end', () => { expect([1,2,3].elementAtOrDefault(3, 'default')).toBe('default'); }); test('ElementAtOrDefault: With length', () => { expect([1,2,3].elementAtOrDefault(1, 'def...
import cv2 from filters.image_filter import ImageFilter class GaussBinarization(ImageFilter): def __init__(self, block_size=15, C=2): """Performs Adaptive Gauss binarization on given image """ super().__init__() self.block_size = block_size self.C = C def process(self,...
import {renderMd, renderMdParagraph} from './markdown'; // ! This directly updates the DOM and registers events. export default function showLocationSelector() { document.getElementById('recruiter-screen').innerHTML = renderMdParagraph(cfStrings.recruiter.locationSelector.text) + ` <input id="res...
import React, { Fragment, useEffect, useState, useRef, useContext, } from "react"; import Select from "react-select"; import { GlobalContext } from "context"; import * as CONSTANTS from "constants/Constants"; import { GuideTooltip } from "components/common"; import { createSelectArray } from "utils/Utils";...
import WebMercatorViewport, {normalizeViewportProps} from 'viewport-mercator-project'; import {clamp} from './math-utils'; import assert from './assert'; // MAPBOX LIMITS export const MAPBOX_LIMITS = { minZoom: 0, maxZoom: 24, minPitch: 0, maxPitch: 60 }; const DEFAULT_STATE = { pitch: 0, bearing: 0, al...
var express = require('express'); var router = express.Router(); var request = require ('request'); var jsonString = null; var urlMTS = "https://www.quandl.com/api/v3/datasets/YAHOO/MC_MTS.json?api_key=HGoTu3E3A_Lsv6biw1kc"; request({ url: urlMTS, json: true }, function (error, response, body){ if (!error...
webpackJsonp([0],{ /***/ 2017: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AddonMessagesSettingsPageModule", function() { return A...
const JSalertValiderMail = () =>{ swal("Vérification complete", ", Votre vérification a été bien fait", "success"); } // Convert for example 9 to 09 const addDigitBefore = (number) => { return ("0" + number).slice(-2); }; const excelDateToJSDate = (serial) => { const utc_days = Math.floor(serial - 25569); if ...
/* * jQuery JavaScript Library v1.7.1 * http://jquery.com/ * * Copyright 2011, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. ...
(window.webpackJsonp=window.webpackJsonp||[]).push([[119],{542:function(t,e,l){"use strict";l.r(e);var a=l(25),v=Object(a.a)({},(function(){var t=this,e=t.$createElement,l=t._self._c||e;return l("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[l("h1",{attrs:{id:"数量选择器-counter"}},[l("a",{staticClass:"he...
from datetime import datetime from django.conf import settings from django.utils.crypto import constant_time_compare, salted_hmac from django.utils.http import base36_to_int, int_to_base36 class PasswordResetTokenGenerator: """ Strategy object used to generate and check tokens for the password reset mech...
import ReactMarkdown from 'react-markdown'; import PageLayout from '../components/PageLayout'; import { useContext } from 'react'; import consent from '../content/consent'; import { LanguageContext } from '../components/LanguageSelector'; export default function Consent() { const { language } = useContext(LanguageCo...
""" ASGI config for django_celery_redis_demo project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefa...
""" Tests of the command-line interface :Author: Jonathan Karr <karr@mssm.edu> :Date: 2021-08-12 :Copyright: 2021, Center for Reproducible Biomedical Modeling :License: MIT """ from biosimulators_masspy import __main__ from biosimulators_masspy import core from biosimulators_masspy.data_model import KISAO_ALGORITHM_M...
import React from 'react'; import styled from '@emotion/styled'; import { withPrefix } from 'gatsby'; const Wrapper = styled.div({ display: 'flex', marginTop: '-4px', }); export default function Logo() { return ( <Wrapper> <img style={{ maxWidth: '32px', maxHeight: '32px',...
# coding: utf-8 from datetime import date, datetime from typing import List, Dict, Type from openapi_server.models.base_model_ import Model from openapi_server.models.rate import Rate from openapi_server import util class Values(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openap...
;(function () { var utils = baidu.editor.utils, uiUtils = baidu.editor.ui.uiUtils, EventBase = baidu.editor.EventBase, UIBase = baidu.editor.ui.UIBase = function () { }; UIBase.prototype = { className:'', uiName:'', initOptions:function (options) { ...
import React, { Component } from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import i18n from 'd2-i18n'; import ReactGridLayout from 'react-grid-layout'; import { acUpdateDashboardLayout, acRemoveDashboardItem, } from '../../actions/editDashboard'; import { Item } from '...
import React from "react"; import Img from "gatsby-image"; import HomeSearch from "../components/HomeSearch"; import bgGrunge from "../img/grunge.png"; import agoda from "../img/agencies/agoda.png"; import bookingcom from "../img/agencies/2.png"; import expedia from "../img/agencies/expedia.png"; import hotelsdotcom ...
import { css } from 'styled-components'; import theme from 'styled-theming'; const color = theme('mode', { dark: '#fff', light: '#000', }); export default { li: css` color: ${color}; `, };
/* eslint-env node */ 'use strict'; module.exports = function(environment) { let ENV = { modulePrefix: 'rarwe', environment, rootURL: '/', locationType: 'auto', EmberENV: { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-contro...
// API key const API_KEY = "pk.eyJ1Ijoia2Nrbmd1eWVuIiwiYSI6ImNrbGtjZnpnbDBldngydWtieHNlb2V0eG0ifQ.lBc7J6gLS4zwnFHVvTatbg";
""" Test the config module. """ import unittest import os import tempfile import shutil import platform from nightjar_common.extension_point.errors import ConfigurationError from .. import config class ConfigTest(unittest.TestCase): """Test the config class and creator.""" def setUp(self) -> None: ...
"""package's __init__ file""" from . import subpackage
export const mockAccount = { foo: 'bar', baz: 'bak' } export const account = { getAccount(accountId) { return new Promise( resolve => setTimeout(resolve, 300, Object.assign({ id: accountId }, mockAccount)) ) } } export const brokenAccount = { getAccount(accountId) { return new Promise( ...
const buildType = process.env.ANU_ENV; const supportPlat = ['wx', 'bu', 'qq', 'ali']; const keys = { ali: 'subPackages', bu: 'subPackages', wx: 'subpackages', qq: 'subpackages' }; const getSubpackage = require('./getSubPackage'); module.exports = function (modules, json) { if (modules.componentType ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
angular .module('MyApp',['ngMaterial', 'ngMessages', 'material.svgAssetsCache']) .controller('AppCtrl', function($scope) { $scope.data = { group1 : 'Banana', group2 : '2', group3 : 'avatar-1' }; $scope.avatarData = [{ id: "avatars:svg-1", title: 'avatar 1', v...
"""profiles_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Cl...
export default { pages: ["pages/index/index", "pages/user/index", "pages/table/index"], window: { backgroundTextStyle: "light", navigationBarBackgroundColor: "#fff", navigationBarTitleText: "WeChat", navigationBarTextStyle: "black" } };
var a01198 = [ [ "MeshItems", "a01821.html", [ [ "EdgeT", "a01833.html", [ [ "Refs", "a01833.html#af0ee51596f4578845a761f1e8163af06", null ], [ "halfedges", "a01833.html#afd56cdde651aaef4a8d476da52a7ee68", null ] ] ], [ "FaceT", "a01837.html", [ [ "IsTriangle", "a01837.html...
/******/ (function(modules) { // webpackBootstrap /******/ // install a JSONP callback for chunk loading /******/ function webpackJsonpCallback(data) { /******/ var chunkIds = data[0]; /******/ var moreModules = data[1]; /******/ var executeModules = data[2]; /******/ /******/ // add "moreModules" to the modu...
QueryBuilder.templates.group = '\ <div id="{{= it.group_id }}" class="rules-group-container"> \ <div class="rules-group-header"> \ <div class="btn-group pull-right group-actions"> \ <button type="button" class="btn btn-xs btn-primary" data-add="rule"> \ <i class="material-icons">{{= it.icons.ad...
/* * @Descripttion: 饼图 * @version: * @Author: qianlishi * @Date: 2021-08-29 07:28:20 * @LastEditors: qianlishi * @LastEditTime: 2021-09-28 14:19:19 */ export const widgetPiechart = { code: 'widget-piechart', type: 'chart', label: '饼图', icon: 'iconicon_tubiao_bingtu', options: { // 配置...
module.exports = { "sendSMS": "sms/send", "checkStatus": "sms/status", "sendedList": "sms/list", "balance": "balance", "tariffs": "tariffs", "addSign": "sign/add", "signList": "sign/list", "addGroup": "group/add", "deleteGroup": "group/delete", "groupList": "group/list", "addContact": "contact/add", "delete...
// 代码中会兼容本地 service mock 以及部署站点的静态数据 export default { // 支持值为 Object 和 Array 'GET /api/currentUser': { data: { name: 'BiaoChenXuying', // avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png', avatar: 'http://p61te2jup.bkt.clouddn.com/WechatIMG8.jpeg', userid: '00...
import cadquery as cq # These can be modified rather than hardcoding values for each dimension. circle_radius = 50.0 # Radius of the plate thickness = 13.0 # Thickness of the plate rectangle_width = 13.0 # Width of rectangular hole in cylindrical plate rectangle_length = 19.0 # Length of rectangular hole in cylind...
from logic.randomize import base_alphabet_encode, base_random_number, ALPHABET def test_base_random_number(): for i in range(0, 100): assert 0 <= base_random_number(1) <= len(ALPHABET) - 1 for i in range(0, 100): assert 0 <= base_random_number(2) <= len(ALPHABET)**2 - 1 for i in range(0, 1...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.loaderStyles = void 0; var tslib_1 = require("tslib"); var utils_1 = require("../../../../utils"); var rootFlexDirections = { above: 'column-reverse', below: 'column', start: 'row-reverse', end: 'row', }; exports.loader...
/* * Copyright 2013 Mozilla Foundation * * 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 agr...
define(['dart_sdk', 'packages/angular_components/src/laminate/ruler/ruler_interface', 'packages/angular_components/utils/browser/dom_service/dom_service'], function(dart_sdk, ruler_interface, dom_service) { 'use strict'; const core = dart_sdk.core; const html = dart_sdk.html; const math = dart_sdk.math; const...
$(document).ready(function(){ let theme = localStorage.getItem('data-theme'); const changeThemeToDark = () => { document.documentElement.setAttribute("class", "dark") localStorage.setItem("data-theme", "dark") } const changeThemeToLight = () => { document.documentElement.setAttri...
import json import logging import ckan.lib.search as search import ckan.lib.dictization.model_dictize as model_dictize from ckanext.harvest.model import HarvestObject from ckan.lib.base import model from ckan.model import Session from ckanext.multilang.model import PackageMultilang, GroupMultilang, TagMultilang fr...
/** * jQuery Form Validator * ------------------------------------------ * * German language package * * @website http://formvalidator.net/ * @license MIT */ (function($, window) { 'use strict'; $(window).bind('validatorsLoaded', function() { $.formUtils.LANG = { errorTitle: 'Ihre Anfrage konnt...
modules.export = require('stylelint').lint;
from . import config from .base import Base from .models import city, user, trip, carrier, station base = Base(config.mongodb['host'], config.mongodb['port'], config.mongodb['database']) City = city.CityCollection(base) User = user.UserCollection(base) Trip = trip.TripCollection(base) Carrier = carrier.C...
/** * @ngdoc overview * @name ngmReportHubApp * @description * # ngmReportHubApp * * Main module of the application. */ angular .module('ngmEthiopia', []) .config([ '$routeProvider', '$compileProvider', function ( $routeProvider, $compileProvider ) { // https://medium.com/swlh/improving-angular-performance-...
const { GraphQLObjectType, GraphQLList, GraphQLString, GraphQLInt, GraphQLEnumType, GraphQLJSON, GraphQLBoolean, } = require(`gatsby/graphql`) const Remark = require(`remark`) const select = require(`unist-util-select`) const sanitizeHTML = require(`sanitize-html`) const _ = require(`lodash`) const visit ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
var base_url_prefix = base_url + "api/admin/", totalRecords = 0, records = [], displayRecords = [], filterSearch = "", orderByCol = "id", orderByAct = "desc", dateSearch = "", recPerPage = 15; count_post = (page = null) => { urltxt = base_url_prefix + "similarity" url = page != ...
import math from typing import List from decimal import Decimal from operator import add, sub, mul, truediv, pow precedence = { '+': 0, '-': 0, '*': 1, '/': 2, '--': 3, '^': 4 } constants = { 'pi': math.pi, 'e': math.e } functions = { 'sin': (math.sin, 1), 'cos': (math.cos, 1)...
#!/usr/bin/env python2 # # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-24 10:21 from __future__ import unicode_literals from django.db import migrations import filebrowser.fields def set_blank(apps, schema_editor): Invoice = apps.get_model('payment', 'Invoice') for invoice in Invoice.objects.all(): if invoi...
/** * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * */ 'use st...
module.exports = { outputDir: __dirname + '/../server/web', // publicPath: process.env.NODE_ENV === 'production' // ? '/' // : '/' }
/* * @lc app=leetcode.cn id=397 lang=javascript * * [397] 整数替换 */ // @lc code=start /** * @param {number} n * @return {number} */ var integerReplacement = function(n) { let count = 0;; while(n != 1){ if(n & 1){ if(n === 3){ n = n - 1 } else { ...
try { UObject.prototype.ToText = UObject.prototype.Conv_ObjectToText; } catch (e) {}; try { UObject.prototype.ToString = UObject.prototype.Conv_ObjectToString; } catch (e) {}; try { UObject.prototype.Equal = UObject.prototype.EqualEqual_ObjectObject; } catch (e) {}; try { UObject.prototype.NotEqual = UObject.prototype....
import React, { Component } from "react"; import LinearGradient from "react-native-linear-gradient"; export class GradientHelper extends Component { render() { const { style, color1, color2, start = { x: 0, y: 0 }, end = { x: 0, y: 1 }, children } = this.props; return ...
define(['altair/facades/declare', 'altair/cartridges/extension/extensions/_Base'], function (declare, _Base) { return declare([_Base], { name: 'render', extend: function (Module) { Module.extendOnce({ viewPath: 'views', ...
#!/usr/bin/env python from ansible.module_utils.hashivault import hashivault_argspec from ansible.module_utils.hashivault import hashivault_auth_client from ansible.module_utils.hashivault import hashivault_init from ansible.module_utils.hashivault import hashiwrapper ANSIBLE_METADATA = {'status': ['stableinterface'],...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
/** * Google Speech API 実行 * Auther: Kuyuri Iroha */ 'use strict'; // 環境変数ロード const dotenv = require('dotenv'); dotenv.config(); const fs = require('fs'); let chokidar = require('chokidar'); let requestWiki = require('superagent'); // Imports the Google Cloud client library const speech = require('@google-cloud/...
(function ($) { $.fn.numberRock = function (options) { var defaults = {speed: 1000, count: 100}; var opts = $.extend({}, defaults, options); var div_by = 100, count = opts["count"], speed = Math.floor(count / div_by), sum = 0, $display = this, run_count = 1, i...
const Path = require('path') const express = require('express') const Settings = require('settings-sharelatex') const logger = require('logger-sharelatex') const metrics = require('metrics-sharelatex') const expressLocals = require('./ExpressLocals') const Validation = require('./Validation') const Router = require('.....
import React, { Component } from 'react'; import { Link, BrowserRouter as Router, Route } from 'react-router-dom'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { simpleAction, displayInfo, isLogged } from '../actions/simpleActions'; import '../static/stylesheets/main.scss'; ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
import { nearlyEqual as bigNearlyEqual } from '../../utils/bignumber/nearlyEqual' import { nearlyEqual } from '../../utils/number' import { factory } from '../../utils/factory' import { createAlgorithm03 } from '../../type/matrix/utils/algorithm03' import { createAlgorithm07 } from '../../type/matrix/utils/algorithm07'...
from .QAgent import QAgent from .DQNAgent import DQNAgent from .ActorCriticAgent import ActorCriticAgent
import { mixJumbotron } from '@freshes/robot' export default mixJumbotron()
// Copyright 2011 The Closure Library Authors. All Rights Reserved. // // 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 requ...
CKEDITOR.plugins.setLang("print", "fr-ca", { toolbar: "Imprimer" });
import fuzz_lightyear from fuzz_lightyear.main import run_user_defined_setup def test_setup(): count = 40 def setup_function(): nonlocal count count = 50 fuzz_lightyear.setup(setup_function) run_user_defined_setup() assert count == 50
import numpy as np from pymoo.dm.decision_making import DecisionMaking class PseudoWeights(DecisionMaking): def __init__(self, weights) -> None: super().__init__() self.weights = weights self.pseudo_weights = None def do(self, F, **kwargs): # get minimum and maximum for each...
var Module=typeof pyodide._module!=="undefined"?pyodide._module:{};Module.checkABI(1);if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0;Module.finishedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){var loadPackage=function(metadata){var PACKAGE_PATH;if(typeof window==="object"...
import PropTypes from 'prop-types'; import classNames from 'classnames'; import Avatar from 'components/avatar'; import Markdown from 'components/markdown'; import Itch from 'svg/itch.svg'; import Twitter from 'svg/twitter.svg'; import Instagram from 'svg/insta.svg'; import Web from 'svg/web.svg'; import style from ...
/*! For license information please see index.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DiAnalytics=t():e.DiAnalytics=t()}(self,(function(){return(()=>{var __webpack_modules__={...
import React, { useState } from 'react'; import { showToast } from 'js/common'; import getCallback from 'js/pay/callback'; import Header from 'component/header'; import Content from 'component/content'; import Button from 'component/button'; import './index.scss'; export default () => { const [data, setData] = useSt...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 OpenStack Foundation # # 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...
/** * web-upload 工具类 * * 约定: * 上传按钮的id = 图片隐藏域id + 'BtnId' * 图片预览框的id = 图片隐藏域id + 'PreId' * * @author paulo */ (function() { var $WebUpload = function(pictureId) { this.pictureId = pictureId; this.uploadBtnId = pictureId + "BtnId"; this.uploadPreId = pictureId + "PreId"; this.uploadUrl = Feng.ctxPa...
import express from "express"; import request from "supertest"; import { CustomError, errorHandler } from "../errorUtils"; import { expect } from "chai"; const app = express(); app.get("/statusCodeError", (req, res, next) => { const error = new CustomError(400, "Error"); return next(error); }); app.get("/statusEr...
const debug = require('debug')('test') module.exports = async function () { // setup your sandbox environment debug('setup test environment') await Promise.resolve() }
#!/usr/bin/env python # coding: utf-8 from xumm.resource import XummResource from typing import Dict, Callable, Any from ..xumm_api import XummGetPayloadResponse as XummPayload class SubscriptionCallbackParams(XummResource): """ Attributes: model_types (dict): The key is attribute name ...
import React from "react"; import PropTypes from "prop-types"; import Link from "next/link"; import { URL_EXTENTION_POSTS } from "../../../config/constants.js"; import { Grid, Typography } from "@material-ui/core"; import { makeStyles } from "@material-ui/styles"; import { Card } from "@courselit/components-library"; i...
(function(){const input=document.querySelector("#book-search-input");const results=document.querySelector("#book-search-results");input.addEventListener("focus",init);input.addEventListener("keyup",search);function init(){input.removeEventListener("focus",init);input.required=true;loadScript("/harbor-sync/lunr.min.js")...
from uuid import UUID, uuid4 from .graph_node import NodeLabel, GraphNodeIdentifier, GraphNode, IsGoldenFlag from basic_types import NanoType, NanoID from .style import Style from .dynamic_enum import DynamicEnum, DynamicEnumVector class ProductID(GraphNodeIdentifier): LABEL = NodeLabel('PRODUCT') def __init...
from __future__ import print_function import numpy as np import math from scipy.special import logsumexp import torch import torch.utils.data import torch.nn as nn from torch.autograd import Variable from utils.distributions import log_Bernoulli, log_Normal_diag, log_Normal_standard, log_Logistic_256 from utils.v...
// Server sent events to subscribe to and propagate to angular serverEvents = [ 'connection-error', 'connection-state', 'event-test', 'log', 'logged-in', 'logged-out', 'play-token-lost', 'play-track', 'play-track-failed', 'streaming-error', 'track-end', 'track-end', 'user-message', ]; angular...
from datetime import datetime class Logger: def __init__(self): self.date_time = datetime.today() # obtained datetime object to extract current date and time self.date = self.date_time.date() self.cur_time = self.date_time.strftime('%H:%M:%S:%f') # write the relevant message in lo...
#!/bin/sh # Include ../lib in the search path so we can find screen.py # (Thanks to https://unix.stackexchange.com/questions/20880) if "true" : '''\' then export PYTHONPATH="$(dirname $0)/../lib:$PYTHONPATH" exec python "$0" "$@" exit 127 fi ''' import sys from screen import Screen from screen import Tex...
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ from __future__ import unicode_literals import datetime import decimal import os import platform import sys import warnings from django.conf import settings from django.db import utils from django.db.backends.base.base ...
const { readdirSync } = require("fs"); const { join } = require("path"); module.exports.choices = readdirSync(join(__dirname, "..", "benchmarks")).map( (x) => x.replace(".js", ""), );