text stringlengths 3 1.05M |
|---|
try:
import sys
# importing whole module
from tkinter import *
from tkinter.ttk import *
from time import strftime
import time
root = Tk()
root.title("A Digital Clock")
def clock():
Strr = strftime("%a/%H:%M:%S:%p ")
design.config(text = Strr)
design.after(100,clock)
design = Label(root,... |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-2016 Facebook, Inc. (http://www.facebook.com) |
+---------... |
"""AWS Login utilities"""
import os
import logging
import boto3
from botocore.config import Config
logger = logging.getLogger(__name__)
def get_boto3_client(service: str, profile: str = None, region: str = "us-east-1") -> boto3.Session.client:
"""Get a boto3 client for a given service"""
logging.getLogger('bo... |
import React from "react"
import Modal from "react-modal"
import Helmet from "react-helmet"
import { SkipNavLink } from "@reach/skip-nav"
import MdClose from "react-icons/lib/md/close"
import { navigate, PageRenderer } from "gatsby"
import presets, { colors } from "../utils/presets"
import Banner from "../components/ba... |
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var prefix = 'fas';
var iconName = 'border-right';
var width = 448;
var height = 512;
var ligatures = [];
var unicode = 'f852';
var svgPathData = 'M240 224h-32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm... |
import React, { useState } from 'react';
import { connect } from 'react-redux';
import styled from 'styled-components';
import { signup } from '../actions';
import { PageContainer,
LoginContainer,
LoginHeader,
FormContainer,
InputContainer, Button} from '../styled-components';
import Footer from "... |
var settings = {
username: 'me@there.com',
password: 'n0tMyP455w0rd',
accountName: 'me',
label: 'prod'
}
module.exports = settings;
|
#!/usr/bin/env python3
"""build_pot
Build a PO template (for i18n) and update the .po files to reflect
the last changes.
"""
import os.path
import sys
import glob
import tokenize
from distutils.core import Command
from utils.i18n import pygettext
# from pygettext.main():
class Options:
# constants
GNU = 1... |
from __future__ import absolute_import, division, print_function
import tensorflow as tf
import tensorflow.contrib.eager as tfe
# If use eager, should call this first
tf.enable_eager_execution()
# A toy dataset of points around 3*x+2
NUM_EXAMPLES = 1000
training_inputs = tf.random_normal([NUM_EXAMPLES])
noise = tf.... |
import MiniApp, {
CustomPermission,
CustomPermissionResult,
} from 'js-miniapp-sdk';
import {
REQUEST_PERMISSIONS_SUCCESS,
REQUEST_PERMISSIONS_FAILURE,
} from './types';
type PermissionsSuccessAction = {
type: String,
permissions: CustomPermissionResult[],
};
const requestCustomPermissions = (
requeste... |
import numpy as np
from dipy.data import get_gtab_taiwan_dsi
from numpy.testing import (assert_almost_equal,
assert_equal,
run_module_suite)
from dipy.reconst.mapmri import MapmriModel, mapmri_index_matrix, mapmri_EAP
from dipy.sims.voxel import (MultiTensor, all_te... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import subprocess
DEFAULT_DATASET = 'infovis'
DATASETS = [ DEFAULT_DATASET, '20newsgroups', 'nsfgrants', 'nsf25k', 'nsf10k', 'nsf1k', 'poliblogs', 'fomc', 'CR_financial_collapse', 'CR_stock_market_plunge', 'FCIC_final_report', 'FCIC_first_hearing', 'FR_fed... |
/**
* @licstart The following is the entire license notice for the
* Javascript code in this page
*
* Copyright 2018 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... |
from django.shortcuts import render, redirect
from django.views import View
from django.http import request, HttpResponseRedirect
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.templat... |
'use strict';
const fs = require("fs/promises");
const path = require("path");
const os = require("os");
const files = require('../../lib/utils/files');
describe("files.list",function(){
before(async function(){
this.dir = await fs.mkdtemp(path.join(os.tmpdir(), "node-thumbnailer-list-"));
this.file = path.... |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... |
module.exports={title:"Seagate",slug:"seagate",svg:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Seagate</title><path d="M11.2279 22.6842c-.2642-1.0048-.5233-1.9919-.7764-2.9548.2734-.1324.4986-.2368.7965-.384 1.239-.528 2.4364-1.1329 3.5508-1.8929 1.3946-.9512 2.6975-2.0144 3.8322-3.26... |
"use strict";
const fs = require("fs");
const promisify = require("util.promisify");
const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.writeFile);
const plugins = [
[
"imagemin-gifsicle",
{
interlaced: true
}
],
[
"imagemin-jpegtran",
{
progressive: true
... |
const colors = require('colors/safe');
const faqSchema = require('../../api/v1/faq/index.model');
const { purify } = require('../../helpers/sanitize');
const { faqDB } = require('../../db');
const { defaultContent: content } = require('../../helpers/variables/faq');
const {
faqsDeletedMessage,
faqsSeededMessage,
} ... |
from typing import Dict, List, NewType
from backend.common.consts.api_version import ApiMajorVersion
from backend.common.models.district import District
from backend.common.queries.dict_converters.converter_base import ConverterBase
DistrictDict = NewType("DistrictDict", Dict)
class DistrictConverter(ConverterBase)... |
# Copyright 2015 Google Inc. 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 applicable law or ag... |
console.log('DAY 05');
const input = "input_05.txt";
const output = document.getElementById('export');
axios.get(input)
.then(function (response) {
performA(response.data);
})
.catch(function (error) {
console.log(error);
});
function performA(data)
{
let passes = data.split('\n');
let highest = ... |
'use strict';
const argv = require('argv');
const logger = require('./common/middleware/logger');
const app = require('./app/app');
const billing = require('./billing/billing');
const migrate = require('./common/utils/migrate');
const argvOptions = [
{
name: 'task',
type: 'string'
}
];
(asyn... |
sap.ui.define(['sap/ui/webc/common/thirdparty/base/asset-registries/Icons'], function (Icons) { 'use strict';
const name = "email-read";
const pathData = "M512 143v337q0 13-9.5 22.5T480 512H32q-14 0-23-9.5T0 480V143L254 0zm-48 337L256 326 48 480h416zM328 294l152-135L255 37 32 159l151 135-17 18L32 191v273l223-170 225... |
from __future__ import print_function, unicode_literals, division, absolute_import
import random as _random
from pyotp.hotp import HOTP
from pyotp.otp import OTP
from pyotp.totp import TOTP
from . import utils
def random_base32(length=16, random=_random.SystemRandom(),
chars=list('ABCDEFGHIJKLMNOPQ... |
from django.core.exceptions import ImproperlyConfigured
from django.core.servers.basehttp import get_internal_wsgi_application
from django.core.signals import request_started
from django.core.wsgi import get_wsgi_application
from django.db import close_old_connections
from django.test import SimpleTestCase, override_se... |
/** Parse type signatures
* @file
*
* The parser translates the lexer's tokens into IR nodes
*
* This source file is part of the Cone Programming Language C compiler
* See Copyright Notice in conec.h
*/
#include "parser.h"
#include "../ir/ir.h"
#include "../shared/memory.h"
#include "../shared/error.h"
#include ... |
#!/usr/bin/env node
'use strict'
const assert = require('assert')
const program = require('commander')
const Analytics = require('.')
const pkg = require('./package')
const run = (method, options) => {
const writeKey = process.env.SEGMENT_WRITE_KEY || program.writeKey
assert(writeKey, 'You need to define your wri... |
/*
* Copyright (C) 2015-2017 Alibaba Group Holding Limited
*/
#include <stdint.h>
#include "k_config.h"
#include "board.h"
#include "aos/hal/uart.h"
#include "aos/hal/gpio.h"
#include "aos/hal/i2c.h"
#include "aos/hal/can.h"
#include "aos/hal/timer.h"
#include "stm32f4xx_hal.h"
#include "hal_uart_stm32f4.h"
#inc... |
# Preprocess iemocap conversation emotion dataset
import argparse
import pickle
import random
import os
from pathlib import Path
import numpy as np
from tqdm import tqdm
from sklearn import metrics
from sklearn.model_selection import train_test_split
from utils import Vocab, Tokenizer, PAD_TOKEN, SOS_TOKEN,... |
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Sherpa Schema
*/
var SherpaSchema = new Schema({
challenge: {
type: String,
default: '',
trim: true
},
sherpa: {
type: Boolean
},
sherpaName: {
type: String,
default: '',
required: ... |
# coding: utf-8
from datetime import timedelta as td
import json
from unittest.mock import patch, Mock
from django.core import mail
from django.utils.timezone import now
from hc.api.models import Channel, Check, Notification, TokenBucket
from hc.test import BaseTestCase
from requests.exceptions import ConnectionError... |
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
const { prefix } = require('../../globals/js/settings');
module.exports = {
context: {
prefix,
},
variants: [
{... |
"""
Classic cart-pole system implemented by Rich Sutton et al.
Copied from http://incompleteideas.net/sutton/book/code/pole.c
permalink: https://perma.cc/C9ZM-652R
"""
import math
import gym
from gym import spaces, logger
from gym.utils import seeding
import numpy as np
class CartPoleEnv(gym.Env):
"""
Descri... |
module.exports = function getZerosCount(number) {
let counter = 0;
for (let i = 5; number/i >= 1; i *= 5)
counter += Math.floor(number/i);
return counter;
};
|
import path from 'path';
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import commonjs from '@rollup/plugin-commonjs';
import url from '@rollup/plugin-url';
import svelte from 'rollup-plugin-svelte';
import babel from '@rollup/plugin-babel';
import { terser } from 'rol... |
# -*- coding: utf-8 -*-
import os
from openprocurement.api.interfaces import IContentConfigurator
from pyramid.interfaces import IRequest
from zope.configuration.xmlconfig import file as ZcmlFile
from zope.interface import directlyProvides
import openprocurement.tender.cfaua
from openprocurement.tender.cfaua.adapters.c... |
/*
* iplink_hsr.c HSR device support
*
* 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.
*
* Authors: Arvid Br... |
// https://jsbin.com/qubonu/1/edit?js,output
import React from 'react';
class App extends React.Component {
constructor(){
super();
this.state = {data: [
{id: 1, name: "Simon Bailey"},{id: 2, name: "Thomas Burleson"},
{id: 3, name: "Will Button"},{id: 4, name: "Ben Clinkinbeard"},
{id: 5, na... |
import numpy as np
from matplotlib import pyplot as plt
def sigmoid(alpha, x):
return 1.0 / (1.0 + np.exp(-alpha * x))
if __name__ == '__main__':
x = np.linspace(-5.0, 5.0, 100)
s = np.vectorize(sigmoid)
plt.plot(x, s(1.0, x), label = str(1.0))
plt.show()
# 後で書く。
|
import json
import logging
import re
import urllib
from collections import defaultdict
from dataclasses import dataclass, field
from typing import Any, Dict, Generator, Iterable, List
import click
import requests
from datahub.configuration import ConfigModel
from datahub.configuration.common import AllowDenyPattern
f... |
# coding=utf-8
from pyecharts.chart import Chart
class Line(Chart):
"""
<<< 折线/面积图 >>>
折线图是用折线将各个数据点标志连接起来的图表,用于展现数据的变化趋势。
"""
def __init__(self, title="", subtitle="", **kwargs):
super(Line, self).__init__(title, subtitle, **kwargs)
def add(self, *args, **kwargs):
self.__a... |
import collections
from datetime import timedelta
import functools
import gc
import json
import operator
import pickle
import re
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
FrozenSet,
Hashable,
List,
Mapping,
Optional,
Sequence,
Set,
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Mirantis 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 ... |
# Copyright (c) 2018 PaddlePaddle 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 appli... |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_src_wchar_t_cpy_53b.c
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_src.label.xml
Template File: sources-sink-53b.tmpl.c
*/
/*
* @description
* CWE: 122 Heap Based Buffer Overflow
* BadSource: Initialize data as... |
'use strict'
/**
* Modules (Node.js)
* @constant
*/
const fs = require('fs')
const os = require('os')
const path = require('path')
const readline = require('readline')
const url = require('url')
/**
* Modules (Electron)
* @constant
*/
const electron = require('electron')
const { remote, ipcRenderer } = electro... |
#include "xmlvm.h"
#include "java_lang_String.h"
#include "org_apache_harmony_luni_platform_Endianness.h"
#define XMLVM_CURRENT_CLASS_NAME Endianness
#define XMLVM_CURRENT_PKG_CLASS_NAME org_apache_harmony_luni_platform_Endianness
__TIB_DEFINITION_org_apache_harmony_luni_platform_Endianness __TIB_org_apache_harmony_... |
import {
BrowserRouter as Router,
Switch,
Route
} from 'react-router-dom'
import Home from './pages'
import Blog from './pages/blog'
import Resume from './pages/resume'
import { ThemeProvider } from 'styled-components'
import {
// Nature,
// Traditional,
Dark,
} from './constants/colors'
const theme = {
... |
const express = require('express');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const ejs = require('ejs');
const mysql = require('mysql');
var randomString = require("randomstring");
//Express
const app = express();
app.use(express.static('public'));
app.use(cookieParser... |
# -*- coding: utf-8 -*- #
# Copyright 2015 Google LLC. 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 requir... |
describe("List", function () {
"use strict";
var List;
beforeEach(module('angularSideBySideSelect'));
beforeEach(function () {
inject(function ($injector) {
List = $injector.get("List");
});
});
it("should be instantiable", function () {
return new List();
... |
# Copyright 2020 TestProject (https://testproject.io)
#
# 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 ... |
# Author: Jean-Remi King, <jeanremi.king@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import assert_raises, assert_true, assert_equal
from ...utils import requires_sklearn
from ..search_light import SearchLight, GeneralizationLight
from .. impo... |
function calcCircleArea(radius) {
let area = Math.PI * (radius ** 2)
console.log(area)
console.log(area.toFixed(2))
} |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _sync = _interopRequireDefault(require("react-icons/lib/md/sync"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = _sync.default;
exports.defau... |
/*!
=========================================================
* Paper Kit React - v1.2.0
=========================================================
* Product Page: https://www.creative-tim.com/product/paper-kit-react
* Copyright 2020 Creative Tim (https://www.creative-tim.com)
* Licensed under MIT (https://github.com... |
from django.db import models
import uuid
# Create your models here.
# Create your models here.
class student(models.Model):
stud_no = models.CharField(max_length = 10, help_text = "Enter student number", default = None)
first_name = models.CharField(max_length = 20, help_text = "Enter first name", default =... |
const uuid = require('uuid');
const Router = require('koa-router');
const userService = require('../service/user');
const Redis = require('../common/redis');
let router = new Router({
prefix: '/user'
});
//测试服务是否开启
router.get("/test", async (ctx) => {
ctx.data = '服务已启动';
});
//后台用户登录
router.post("/login", async... |
const namespacedRoutePath = require('../../../lib/provider-registration/helpers/namespaced-route-path')
const should = require('should') // eslint-disable-line
describe('Tests for namespacedRoutePath', function () {
it('create route with :host and :id parameter', function () {
const params = { hosts: true, names... |
function patchIconToNamedIcon({ j, path, nameAttr, nameAttrIndex, iconName, consequentIconName, alternateIconName }) {
if (isSimpleIcon(nameAttr)) {
path.node.name.name = `${iconName}Icon`;
path.node.attributes.splice(nameAttrIndex, 1);
} else if (isTernaryIcon(nameAttr)) {
path.node.attributes.splice(n... |
const loadPlugin = id => {
localStorage.setItem('plugin', id);
const url = `${location.protocol}//${location.host}${location.pathname}`;
const newURL = `${url}?${$.param({
plugin: id
})}`;
window.location.href = newURL;
};
$(() => {
var storedID = localStorage.getItem('plugin');
if (storedID && storedID !==... |
from flask import render_template,redirect,url_for,flash,request
from flask_login import login_user, current_user, logout_user,login_required
from . import auth
from .. import db,bcrypt
from ..models import User
from .forms import LoginForm,SignUpForm
@auth.route('/signup',methods = ["GET","POST"])
def signup():
... |
"""
.. _howto_spotfindingresults:
Assessing :py:class:`.SpotFindingResults`
=========================================
Purpose of this tutorial:
* Deciding between spot-based or pixel-based decoding
* Choosing a :py:class:`.FindSpotsAlgorithm`
* Tuning a :py:class:`.FindSpotsAlgorithm`
Although it is not necessary t... |
const { path, immutablePreset } = require('./index');
describe('pathon', () => {
test('methods', () => {
const pRoot = path('root', { child: true }, immutablePreset);
expect(typeof pRoot.set).toBe('function');
expect(typeof pRoot.del).toBe('function');
expect(typeof pRoot.get).toBe('function');
e... |
"""Polynomial contrast coding"""
import numpy as np
import pandas as pd
from patsy.contrasts import Poly
from category_encoders.ordinal import OrdinalEncoder
from sklearn.base import BaseEstimator, TransformerMixin
import category_encoders.utils as util
__author__ = 'willmcginnis'
class PolynomialEncoder(BaseEstima... |
from layers import MLP
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
class MMOE(keras.Model):
def __init__(self, num_tasks, num_experts, expert_hidden_units, task_hidden_units, feat_vocab,
embedding_size):
super().__init__()
self.embeddi... |
import React, { Component } from 'react';
class TestForm extends Component {
constructor(){
super();
this.state = {
currentInput : "",
currentOutput : ""
}
}
clickHandler(e){
this.props.addTest(this.state.currentInput, this.state.currentOutput);
this.setState({'currentOutput' : "... |
# -*- coding: utf-8 -*-
# Author: Jiajun Ren <jiajunren0522@gmail.com>
import logging
from renormalizer.mps import Mpo, Mps, MpDm, gs, ThermalProp
from renormalizer.spectra.base import SpectraTdMpsJobBase
from renormalizer.mps.mps import BraKetPair
from renormalizer.utils import Quantity, OptimizeConfig
logger = lo... |
import React from 'react';
import { Modal } from '../src/Overlay';
import { Bounce } from '../src/Animation';
class ModalDemo extends React.Component {
constructor(props, context) {
super(props, context);
this.handleOpenModal = this.handleOpenModal.bind(this);
this.handleHide = this.handleHide.bind(this)... |
from collections import namedtuple
class Error(namedtuple('Error', ['maybe_id', 'maybe_links', 'maybe_status',
'maybe_code', 'maybe_title', 'maybe_detail',
'maybe_source', 'maybe_meta'])):
"""Representation of a single error from a list of errors i... |
/**
* EasyUI for jQuery 1.8.0
*
* Copyright (c) 2009-2019 www.jeasyui.com. All rights reserved.
*
* Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php
* To use it on other terms please contact us: info@jeasyui.com
*
*/
(function($){
var _1=1;
function _2(_3){
$(_3).addCla... |
import connectToggle from '../connectors/connectToggle.js';
import ToggleComponent from '../components/Toggle.js';
/**
* The Toggle provides an on/off filtering feature based on an attribute value. Note that if you provide an “off” option, it will be refined at initialization.
* @name Toggle
* @kind widget
* @requ... |
# Generated by Django 2.1.4 on 2019-03-18 14:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('server', '0092_auto_20190305_1358'),
]
operations = [
migrations.AlterField(
model_name='message',
name='message_typ... |
# Copyright 2013 VMware, Inc. 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 a... |
/********************************************************************
* Copyright (C) 2013-2014 Texas Instruments Incorporated.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of so... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... |
import React from 'react';
import PropTypes from 'prop-types';
import Text from '../Text';
import Wrapper from './Wrapper';
const Tag = ({ label }) => {
return (
<Wrapper>
<Text color="grey" fontWeight="bold" fontSize="xs" textTransform="uppercase">
{label}
</Text>
</Wrapper>
);
};
Ta... |
import * as React from 'react'
import { GatsbyImage } from "gatsby-plugin-image"
import { graphql, useStaticQuery } from 'gatsby'
import { Carousel } from 'react-responsive-carousel'
import 'react-responsive-carousel/lib/styles/carousel.min.css'
import '../../styles/carousel.css';
const VeniceHotel2018SlideSh... |
import { Meteor } from 'meteor/meteor';
import { withTracker } from 'meteor/react-meteor-data';
import { Chain, ChainStates } from '/imports/api/chain/chain.js';
import ChainStatus from './ChainStatus.jsx';
export default ChainStatusContainer = withTracker((curr) => {
let statusHandle;
let chainStatesHandle;
let... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 22:22:07 2020
@author: Tom
"""
numbers_dict = {
1: "one",
2: "two",
3: "three",
4: "four",
5: "five",
6: "six",
7: "seven",
8: "eight",
9: "nine",
10: "ten",
11: "eleven",
12: "twelve",
13: "thirteen",
14: "fourt... |
function buildElement(tag, options) {
const element = document.createElement(tag);
return setElement(element, options);
}
function setElement(
element,
{
classList = [], attributes = {},
events = [], children = [],
...rest
} = {}
) {
for(klass of classList) {
el... |
// / <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:... |
import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import BarItem from './BarItem'
import toLower from 'lodash/toLower'
import logo from '../../assets/logo.png'
import style from './index.scss'
const Sidebar = props => {
let {appName, menuCollaps, selectedItem, toggleM... |
import logging
import uuid
from django.conf import settings
from django.contrib.auth import get_user_model
from django.shortcuts import render
from django.urls import reverse
from helusers.utils import uuid_to_username
from auth_backends.adfs.base import BaseADFS
from auth_backends.helsinki_tunnistus_suomifi import H... |
from pandac.PandaModules import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.showbase import DirectObject
from toontown.friends import FriendHandle
from otp.avatar import Avatar
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from... |
# -*- coding:utf-8 -*-
from calendar import monthrange
from datetime import datetime, timedelta
__author__ = [
'"liubo" <liubo@hi-wifi.cn>'
]
def get_first_time_of_month(year=None, month=None):
if not year or not month:
now = datetime.now()
if not year:
year = now.year
if ... |
/**
* Created by Chen on 2016/3/7.
*/
describe('Test of sub structure search', function(){
var MB = TestMolBuilder;
var allMols = {};
var allMolNames = [
'benzene', 'PhEt', 'hexane',
'BnBr', 'iPrPh', 'diene',
'cisButene', 'transButene',
'cisDiene', 'transDiene',
'cisDiMeHexane', 'transDiMeHexane1', 'tra... |
# Copyright (c) 2018 PaddlePaddle 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 appli... |
from typing import List, Tuple, Optional, Union
import wx
import wx.adv
import wx.lib.masked.numctrl
import wx.svg
from asn1editor.interfaces.BitstringInterface import BitstringInterface
from asn1editor.interfaces.OptionalInterface import OptionalInterface
from asn1editor.interfaces.ValueInterface import ValueInterfa... |
'''
img tools
包含图片处理常见工具.
function:
1. get_img(getpath, gray=False, scale_percent=100) 根据路径返回img/灰度选择/缩放
2. save_img(savepath, img) 保存图片
3. plot_line_chart(y1, y2, y3) 画折线图 暂不完善
4. cut_pic(img,pattern=0, up = 0, down = 0, left = 0, right = 0) 切割图片/比例切割/像素切割
5. plot_3d_line(x, z, y, over, x_max, y_max, z_max) ... |
class InvalidKeyException(Exception):
def __init__(self):
Exception.__init__(self, "The Caesarean key must be in the range: [1, 25].")
class InvalidModeException(Exception):
def __init__(self):
Exception.__init__(self, "The mode selected must be:"
"\n1 - Encryp... |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... |
(function(window){var svgSprite='<svg><symbol id="icon-xinxihuan002" viewBox="0 0 1024 1024"><path d="M883.904 199.36c-49.28-49.152-108.352-73.664-177.536-73.664-38.72 0-74.816 8.192-108.096 24.512C564.352 166.592 535.872 178.496 512 206.656 488.896 178.432 460.416 166.592 426.56 150.208c-33.92-16.384-70.144-24.64-108.... |
/**
* Adds shortcut methods for JSON API responses:
*
* * `res.apiResponse(data)`
* * `res.apiError(key, err, msg, code)`
* * `res.apiNotFound(err, msg)`
* * `res.apiNotAllowed(err, msg)`
*
* ####Example:
*
* app.all('/api*', keystone.middleware.api);
*
* @param {app.request} req
* @param {app... |
// load cookies library
const Cookies = require('universal-cookie').default;
// setup cookies
const cookies = new Cookies();
let initState = {
locale : cookies.get('os-locale') || 'zh_HK',
locales : [
{
name : "English",
code : "en_US"
},
{
name : "... |
# Copyright 2020 MONAI Consortium
# 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, s... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Written by Martin v. Löwis <loewis@informatik.hu-berlin.de>
"""Generate binary message catalog from textual translation description.
This program converts a textual Uniforum-style message catalog (.po file) into
a binary GNU catalog (.mo file). This is essentially the... |
var from = require('fromjs');
function Repository() {
var self = this
, contacts = require('./contacts.json')
, dummyPromise = {};
dummyPromise.then = function () {
return dummyPromise;
};
dummyPromise.catch = function () {
return dummyPromise;
};
self.getContact = function (id) {
retu... |
import functools
import torch
import torch.nn as nn
import torch.nn.functional as F
import models.modules.module_util as mutil
class ResidualDenseBlock_5C(nn.Module):
def __init__(self, nf=64, gc=32, bias=True):
super(ResidualDenseBlock_5C, self).__init__()
# gc: growth channel, i.e. intermediate ... |