text
stringlengths
3
1.05M
import { getWechat, getOAuth } from '../wechat' const client = getWechat() export async function getSignatureAsync(url){ const data = await client.fetchAccessToken() const token = data.access_token const ticketData = await client.fetchTicket(token) const ticket = ticketData.ticket console.log('哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈'...
from sklearn import linear_model import numpy as np from joblib import load import boto3 from io import BytesIO import json def response(message, status_code): return { 'statusCode': str(status_code), 'body': json.dumps(message), 'headers': { 'Content-Type': 'application/json', ...
import sys #print(sys.path) sys.path.append('') ##get import to look in the working dir. from shotglass2.shotglass import get_site_config from shotglass2.takeabeltof.texting import TextMessage import pdb magic_numbers = { 'valid_phone_number':{'number':'+15005550006','code':None}, 'non_mobile_number':{'numb...
# # author: Jungtaek Kim (jtkim@postech.ac.kr) # last updated: February 8, 2021 # import numpy as np from bayeso_benchmarks.benchmark_base import Function def fun_target(bx, dim_bx, a, b, c, r, s, t): assert len(bx.shape) == 1 assert bx.shape[0] == dim_bx assert isinstance(a, float) assert isinstanc...
/* * 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 ...
import os from typing import Optional, Dict from pathlib import Path from pydantic import BaseSettings class APISettings(BaseSettings): # 开发模式配置 DEBUG: bool = os.environ.get('DEBUG', True) # 项目文档 TITLE: str = "FastAPI+MySQL+Tortoise-orm项目生成" DESCRIPTION: str = "FastAPI 基于 Tortoise-orm 实现的大型项目框架"...
/** * Returns a promise that resolves when an element with a selector appears on the page for the first time. * Note: Use elementReadyRAF if this is too slow or unreliable. * @param {String} selector querySelector string */ export function elementReady (selector) { return new Promise((resolve, reject) => { co...
// Copyright 2017 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd #ifndef PACKAGER_HLS_PUBLIC_HLS_PARAMS_H_ #define PACKAGER_HLS_PUBLIC_HLS_PARAMS_H_ #include <str...
def task_with_flag(): def _task(flag): print("Flag {0}".format("On" if flag else "Off")) return { 'params': [{ 'name': 'flag', 'long': 'flagon', 'short': 'f', 'type': bool, 'default': True, 'inverse': 'flagoff'}], '...
/*************************************************************************/ /* */ /* Copyright (c) 1994 Stanford University */ /* */ /* All rights r...
def test_foo(): print("Hello World!")
/* * This file is part of the MicroPython project, http://micropython.org/ * * Original template for this file comes from: * Low level disk I/O module skeleton for FatFs, (C)ChaN, 2013 * * The MIT License (MIT) * * Copyright (c) 2013, 2014 Damien P. George * * Permission is hereby granted, free of c...
"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *-------------------------------------------------...
"""Square tests.""" # pylint: disable=redefined-outer-name from datetime import datetime import pytest import pytz from model_bakery import baker from will_of_the_prophets import board @pytest.fixture(autouse=True) def clear_caches(): board.clear_caches() @pytest.fixture def some_datetime(): return pytz...
/* * Morpheuz Sleep Monitor * * Copyright (c) 2013-2015 James Fowler * * 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 *...
from .arm.object import ARMObject, _object_cache from .arm.attr import Attr def get_object_cls(item): cls = None for Object in _object_cache: if Object.__spec__['object'] != item.get('object'): continue if 'polymorphic' in Object.__spec__: found = True for at...
# coding: utf-8 """ MangaDex API MangaDex is an ad-free manga reader offering high-quality images! This document details our API as it is right now. It is in no way a promise to never change it, although we will endeavour to publicly notify any major change. # Authentication You can login with the `/auth/l...
#pragma once #include <string> namespace chaiscript { class ChaiScript; } namespace geometrize { namespace script { /** * @brief runScript Evaluates the provided script code. * @param code The script code to evaluate. * @param runner The engine that will evaluate the script. */ void runScript(const std::string...
// // IWHeadPanelView.h // Masonry // // Created by 秦传龙 on 2021/5/21. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface IWHeadPanelModal : NSObject // 电池电量 0 ~ 1 @property (nonatomic, assign) CGFloat electricity; // 工作时长 @property (nonatomic, copy) NSString *wokerTime; // 更新时间 @property (nonatomic,...
#!/usr/bin/env python import base_filters COPY_GOOGLE_DOC_KEY = '1vGWXvrnEzIMXlVXQgAYEewRi5Iw3bHWLE_8QyEiasRk' USE_ASSETS = False # Use these variables to override the default cache timeouts for this graphic # DEFAULT_MAX_AGE = 20 # ASSETS_MAX_AGE = 300 JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
#!/usr/bin/env python """Tests of classes for dealing with trees and phylogeny. """ import json import os import sys import unittest from copy import copy, deepcopy from tempfile import TemporaryDirectory from unittest import TestCase, main from numpy import arange, array from cogent3 import load_tree, make_tree fro...
import collections class Solution: def countLargestGroup(self, n: int) -> int: table = collections.Counter() for i in range(1, n + 1): sd = 0 while i: sd += i % 10 i //= 10 table[sd] += 1 largestSize = max(table.values()) ...
/** * \file dnn/src/arm_common/elemwise/binary/algo.h * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") * * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed o...
import axios from 'axios' import useAsync from './useAsync' export default (url, config = {}) => useAsync(axios.delete, [url, config])
const { createClient, getRange, parseObjectResponse } = require('./redis'); const TIMESERIES_KEY = 'ts:pop'; describe('pop', () => { let client; beforeEach(async () => { client = await createClient(); return client.flushdb(); }); afterEach(() => { return client.quit(); }); function pop(id, ...
# -*- coding: utf-8 -*- from workalendar.core import WesternCalendar, ChristianMixin class Bulgaria(WesternCalendar, ChristianMixin): "Bulgaria" FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + ( (3, 3, "Liberation Day"), # Ден на Освобождението на Б (5, 1, "International Workers' Day"), #...
""" Copyright 2015 Brocade Communications Systems, 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 t...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from datetime import date from functools import partial import subprocess import click import requests send_request = partial( requests.get, headers={'accept': 'application/vnd.github.drax-preview+json'}) def _get_git_in...
from telegram import (ReplyKeyboardMarkup, ReplyKeyboardRemove) from utils import * import random, time from selects import change_money, change_energy, get_energy, get_money FORUM, FORUM_GAME, FORUM_GAME_PLAY = 'forum', 'forum_game', 'forum_game_playing' def forum(update, context): msg = 'Прийдя на форум вы види...
import RoundedButton from "@components/buttons/RoundedButton"; import { Avatar, Box, Stack } from "@mui/material"; import moment from "moment"; import EditIcon from "@mui/icons-material/Edit"; import OpenInNewIcon from "@mui/icons-material/OpenInNew"; import { TRUST_LEVELS } from "@constants"; // ----- Users ----- exp...
import unittest import mock from auth0_client.v3.authentication.passwordless import Passwordless class TestPasswordless(unittest.TestCase): @mock.patch('auth0_client.v3.authentication.passwordless.Passwordless.post') def test_email(self, mock_post): p = Passwordless('my.domain.com') p.email...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables __a...
import os from sanic import Sanic from sanic.response import HTTPResponse, json, text from tinydb import TinyDB, Query BASE_URL = 'https://todo-backend-sanic.herokuapp.com/todo' app = Sanic('todo') db = TinyDB('todos.json') @app.middleware('response') async def cors_headers(request, response): cors_headers = {...
import json as js import logging import re from .mqtt import mqtt from ..helpers import get_kwargs from ..helpers import key_wanted log = logging.getLogger("json_mqtt") class json_mqtt(mqtt): def __str__(self): return "outputs all the results to the supplied mqtt broker in a single message formated as j...
// LAF OS Library // Copyright (C) 2019-2021 Igara Studio S.A. // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef OS_WINDOW_SPEC_H_INCLUDED #define OS_WINDOW_SPEC_H_INCLUDED #pragma once #include "gfx/rect.h" #include "gfx/size.h" #include "os/screen.h" ...
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" fil...
from forex_python.converter import CurrencyRates,CurrencyCodes from tkinter import * FONT=("Arial",15,"bold") from currency import options,opt2 c= CurrencyRates() #create obj of Currencyrates cc=CurrencyCodes() def getamt(): amount=float(val_entry.get()) fr=menu.get() to=menu2.get() con=c.con...
import argparse import copy import subprocess COMMON_CONFIG = { "--subsample_testset": 500, "--max_paraphrases": 20, } GPU_CONFIG = { "single": { "--transformer_clf_gpu_id": 0, "--use_gpu_id": 0, "--gpt2_gpu_id": 0, "--strategy_gpu_id": 0, "--ce_gpu_id": 0, ...
import React from "react"; function ToggleDisabled() { return ( <div class="p-6 card bordered"> <div class="form-control"> <label class="label"> <span class="label-text">Unchecked + Disabled</span> <div> <input type="checkbox" disabled="disabled" class="toggle" /> ...
# encoding: utf-8 from six import text_type from ckan.lib.navl.dictization_functions import (flatten_schema, get_all_key_combinations, make_full_schema, flatten_dict, unflatten, ...
""" Provides functions for the discovery of Fibre nodes """ import sys import json import time import threading import traceback import struct import fibre.protocol import fibre.utils import fibre.remote_object from fibre.utils import Event, Logger from fibre.protocol import ChannelBrokenException, TimeoutError import...
from flask_sqlalchemy import SQLAlchemy import json db = SQLAlchemy() class Interface(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String, unique=True) url = db.Column(db.String) query_string = db.Column(db.String) active = db.Column(db.Boolean, index=True) defa...
; (function (angular, undefined) { 'use strict'; angular .module('app.levantamentos') .factory('Levantamentos', ['ConfigurationService', 'User', 'Entidades', 'groupByFilter', levantamentos]); function levantamentos(Config, User, Entidades, groupBy) { var Empresa, ...
var should = require('should'); exports.findOne = { iterations: 1, // To run this test multiple times (useful when you're caching results), increase this number. insert: { Name: 'TEST: Nolan Wright' }, check: function (result) { should(result.id).be.ok; should(result.Name).equal('TEST: Nolan Wright'); } };
# -*- coding: utf-8 -*- """Console script for notes.""" import click from . import notes @click.command() def main(args=None): """Console script for notes.""" click.echo("Replace this message by putting your code into " "notes.cli.main") click.echo("See click documentation at http://click.p...
import numpy as np import math import matplotlib.pyplot as plt import seaborn as sns class ComponentSpecificParametersEnum: __LOW = "low" __HIGH = "high" __K = "k" __TRANSFORMATION = "transformation" __SCIKIT = "scikit" __CLAB_INPUT_FILE = "clab_input_file" __COEF_DIV = "coef_div" __C...
// Magnific Popup v1.0.0 by Dmitry Semenov // http://bit.ly/magnific-popup#build=inline+image+ajax+iframe+gallery+retina+imagezoom+fastclick (function(a){typeof define=="function"&&define.amd?define(["jquery"],a):typeof exports=="object"?a(require("jquery")):a(window.jQuery||window.Zepto)})(function(a){var b="Close",c=...
# -*- coding: utf-8 -*- # Copyright 2017, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. # pylint: disable=missing-docstring """ InitializeGate (CompositeGate instance) test. """ import math import unittest from...
#import <UIKit/UIKit.h> @interface LoginWebViewController : UIViewController @property (nonatomic) BOOL addAdditionalAccount; @property (nonatomic, copy) void(^ _Nonnull finishedBlock)(NSError * _Nullable, CFCredentials * _Nullable); - (void) performLogin:(UIViewController * _Nonnull)sender finished:(void (^ _Nonnul...
"use strict"; exports.__esModule = true; exports.c_switch__toggle_before_BackgroundColor = { "name": "--pf-c-switch__toggle--before--BackgroundColor", "value": "#fff", "var": "var(--pf-c-switch__toggle--before--BackgroundColor)" }; exports["default"] = exports.c_switch__toggle_before_BackgroundColor;
#!/usr/bin/env python #========================================================================= # # Copyright Insight Software 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 ...
const express = require('express'); const app =express(); const httpServer = require("http").createServer(app); const io = require("socket.io")(httpServer, { cors: { origin: "http://localhost:3000", }, }); const SerialPort = require('serialport'); const Readline = SerialPort.parsers.Readline; const parser = ...
from reciever.message_checks.check import Check import logging class CheckManifestCountInstances(Check): def __init__(self, message): super(CheckManifestCountInstances, self).__init__(message) def check(self): """ Checks if the manifest.count attribute matches the number of manifest i...
// var nconf; // nconf = require('nconf'); // // nconf.argv() // .env() // .file({ file: './config.json' }); // // module.exports = nconf;
/**************************************************************************** **************************************************************************** *** *** This header was automatically generated from a Linux kernel header *** of the same name, to make information necessary for userspace to *** call i...
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["not-found"],{ /***/ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/lib/index.js?!./src/routes/not-found/NotFound.css": /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__("./node_modu...
/* $NetBSD: altivec.c,v 1.5 2003/07/15 02:54:45 lukem Exp $ */ /* * Copyright (C) 1996 Wolfgang Solfrank. * Copyright (C) 1996 TooLs GmbH. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met:...
!function(a){var b,c,d="0.4.2",e="hasOwnProperty",f=/[\.\/]/,g="*",h=function(){},i=function(a,b){return a-b},j={n:{}},k=function(a,d){a=String(a);var e,f=c,g=Array.prototype.slice.call(arguments,2),h=k.listeners(a),j=0,l=[],m={},n=[],o=b;b=a,c=0;for(var p=0,q=h.length;q>p;p++)"zIndex"in h[p]&&(l.push(h[p].zIndex),h[p]...
/* 种豆得豆 脚本更新地址:jd_plantBean_help.js 更新时间:2021-08-20 活动入口:京东APP我的-更多工具-种豆得豆 已支持IOS京东多账号,云端多京东账号 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js 注:会自动关注任务中的店铺跟商品,介意者勿使用。 互助码shareCode请先手动运行脚本查看打印可看到 每个京东账号每天只能帮助3个人。多出的助力码将会助力失败。 =====================================Quantumult X================================= [task_local...
""" Regridding module file for regridding input forcing files. """ import os import sys import traceback import time import ESMF import numpy as np from core import err_handler from core import ioMod from core import timeInterpMod NETCDF = "NETCDF" GRIB2 = "GRIB2" next_file_number = 0 def mkfilename(): globa...
""" In this example we show how pacman can be drawn by defining your own custom :code:`Shape` class. Building on the built in :code:`Circle` shape the definition is quite simple as long as we remember that the :code:`in_circle`, and :code:`not_in_mouth` variables are numpy arrays so they need to be combined using the :...
/* * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The OpenAirInterface Software Alliance licenses this file to You under * the OAI Public Lic...
import axios from 'axios'; import { USER_LOGIN_FAIL, USER_LOGIN_REQUEST, USER_LOGIN_SUCCESS, USER_LOGOUT, USER_REGISTER_REQUEST, USER_REGISTER_SUCCESS, USER_REGISTER_FAIL, USER_DETAILS_REQUEST, USER_DETAILS_SUCCESS, USER_DETAILS_FAIL, USER_DETAILS_RESET, USER_UPDATE_PROFILE_REQUEST, USER_UPDA...
export const loadScreen = () => async (dispatch, getState) => { window.location = 'www.google.com'; console.log(window.location); };
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys sys.path.append('/Users/sky/Downloads/iTOL') import logging import iTOL import os import time logger = logging.getLogger('[iTOL]') formatter = logging.Formatter('%(asctime)s %(levelname)s %(name)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S') logger.setLevel(lo...
import React from 'react' import PropTypes from 'prop-types' import intl from 'react-intl-universal' import Grid from '@material-ui/core/Grid' import Typography from '@material-ui/core/Typography' import { makeStyles } from '@material-ui/core/styles' import MainCard from './MainCard' const useStyles = makeStyles(theme...
# qubit number=5 # total number=41 import cirq import qiskit from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister from qiskit import BasicAer, execute, transpile from pprint import pprint from qiskit.test.mock import FakeVigo from math import log2,floor, sqrt, pi import numpy as np import networkx as ...
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib 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 a...
import os import sys import configparser import csv import config import pypeline_io as io import numpy as np import astropy.io.fits as fits # migrate pycrates commands to fits import logging try: from ciao_contrib import runtool as rt from sherpa.astro import ui as sherpa import pychips except ImportError...
DEBUG = True #jdfkdjs DATA_FOLDER = "data" USERS_DATA_FOLDER = "users" #BASE_URL = "http://0.0.0.0:5000" BASE_URL = "https://chub-calendar.herokuapp.com/" MIN_YEAR = 2017 MAX_YEAR = 2100 PASSWORD_SALT = "something random and full of non-standard characters" #HOST_IP = "0.0.0.0" # set to None for production localhost =...
var ANY; var BOOLEAN; var NUMBER; var STRING; var OBJECT; //The second operand type is any ANY, ANY; BOOLEAN, ANY; NUMBER, ANY; STRING, ANY; OBJECT, ANY; //Return type is any var resultIsAny1 = (ANY, ANY); var resultIsAny2 = (BOOLEAN, ANY); var resultIsAny3 = (NUMBER, ANY); var resultIsAny4 = (STRING...
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable-msg=import-error # pylint: disable-msg=no-member # pylint: disable-msg=not-callable """ Hybrid_run.py is written for run Hybrid model """ import time import logging import matplotlib.pyplot as plt import torch from torch import optim from torch import n...
/*----------------------------------------------------------------------------*/ /* Copyright (c) 2015-2018 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of...
/* eslint no-console: ["error", { allow: ["log"] }] */ const gulp = require('gulp'); const connect = require('gulp-connect'); const gopen = require('gulp-open'); const fs = require('fs'); const path = require('path'); const buildJs = require('./build-js.js'); const buildStyles = require('./build-styles.js'); // Tasks...
module.exports = require('./i18n');
var searchData= [ ['headernotread',['HeaderNotRead',['../d1/d6b/class_c_stun_message_reader.html#aa968984fa00f96cab6cd1023cbbd2de1acb771a82a3c9ca38f06f425ff1b9cad7',1,'CStunMessageReader']]], ['headervalidated',['HeaderValidated',['../d1/d6b/class_c_stun_message_reader.html#aa968984fa00f96cab6cd1023cbbd2de1af00b359...
# Generated by Django 3.2.9 on 2022-01-16 15:15 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('integrations', '0004_integration_client_org_related'), ] operations = [ migrations.RenameField( model_name='integration', ol...
function circularLinkedList() { // creating a node for the linked list let Node = function (nodeValue) { this.element = nodeValue; this.next = null; } let length = 0; let head = null; // Get node at specific index this.getNodeAt = function (index) { if (index >= 0 &&...
import core from 'core'; export default () => { core.setCurrentPage(1); };
from os import listdir from os import path from pickle import dump from keras.applications.vgg16 import VGG16 from keras.preprocessing.image import load_img from keras.preprocessing.image import img_to_array from keras.applications.vgg16 import preprocess_input from keras.models import Model # extract features from ea...
""" Example script for use of two-level fully connected network policy, using the single-lane ring road setting. """ import ray import ray.rllib.ppo as ppo from ray.tune.registry import get_registry, register_env as register_rllib_env from .stabilizing_the_ring import make_create_env def to_subpolicy_state(inputs): ...
import { Route, Redirect } from 'react-router-dom'; import { useAuth } from '../../helper/AuthContext'; export default function PrivateRoute({ component: Component, ...rest }) { const { currentUser } = useAuth(); return ( <Route {...rest} render={(props) => { return currentUser ? ( ...
import React from 'react' import Layout from '../components/layout' import SEO from '../components/seo' import Form from '../components/form' import style from '../styles/content.module.css' const ContactPage = () => ( <Layout> <SEO title="Contact" description="Get in touch with the show and give us ...
import numbers from typing import TYPE_CHECKING, List, Tuple, Type, Union import warnings import numpy as np from pandas._libs import lib, missing as libmissing from pandas._typing import ArrayLike from pandas.compat.numpy import function as nv from pandas.core.dtypes.common import ( is_bool_dtype, ...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from tensorflow.python.framework import ops from tensorflow.python.framework import dtypes from tensorflow.python.ops import control_flow_ops ...
import a_file def test_a(capsys): assert a_file.bla() == 5 assert a_file.LOG_MESSAGE in capsys.readouterr().err
// Local import errorActionsTest from './actions.testPartial'; import errorReducerTest from './reducer.testPartial'; import errorSelectorsTest from './selectors.testPartial'; describe('Error Module Tests: ', () => { // run all test in block errorActionsTest(); errorReducerTest(); errorSelectorsTest(); });
# Author: Martin McBride # Created: 2021-06-11 # Copyright (C) 2021, Martin McBride # License: MIT # The boat has a gradient subtracted from it. # The main (triple) features shows the boat, patches and subtracted features. # There is also an example using subtract with scaling and subtract modulo. from PIL import Im...
# -*- coding: utf-8 -*- """ Created on Mar 13, 2012 @author: moloch Copyright 2012 Root the Box 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/licen...
# Problem: https://www.hackerrank.com/challenges/text-wrap/problem import math # import textwrap # %% def wrap(string, max_width): last_iter = int(math.ceil(len(string)/max_width)) pos, result = 0, '' for _ in range(last_iter): if _ == last_iter - 1: result += string[pos:] else:...
#!/usr/bin/env python import re # 2007-04-01 11:20 find_time = re.compile( "(?P<year>\d{4})" # 4 digit year "-" "(?P<month>\d{2})" # 2 digit month "-" "(?P<day>\d{2})" # 2 digit day "\s+" # white space(s) "(?P<hour>\d{2})" # 2 digit hour ":" "(?P<minute>\d{2})" # 2 digit minute ...
from django.core.urlresolvers import reverse from django.conf import settings from django.db import models from restaurants.models import RestaurantLocation # Create your models here. class Item(models.Model): # associations user = models.ForeignKey(settings.AUTH_USER_MODEL) restaurant = models.ForeignKe...
# Copyright (c) 2020 fortiss GmbH # # Authors: Patrick Hart, Julian Bernhard, Klemens Esterle, and # Tobias Kessler # # This software is released under the MIT License. # https://opensource.org/licenses/MIT import unittest import numpy as np import os import matplotlib import time # Bark imports from bark.runtime.co...
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Refl...
""" Create statistics about developments in ADFD. Some ideas: * development of posts per day/month/year * development of new users per day/month/year * development of new topics per day/month/year * development of ratio of moderator/admin posts to posts of normal users * development of mentions of specific substances...
#---------------------------------------- # Outside imports ...
const Vec3 = require('vec3').Vec3 module.exports.entity = function (entity, serv, { version }) { const blocks = require('minecraft-data')(version).blocks entity.calculatePhysics = async (delta) => { if (entity.gravity) { addGravity(entity, 'x', delta) addGravity(entity, 'y', delta) addGravit...
/* The MIT License (MIT) Copyright (c) 2017 Tim Warburton, Noel Chalmers, Jesse Chan, Ali Karakus 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 wi...
class AlreadyRegistered(Exception): pass
''' Battleships server ''' import json import asyncio import ssl import traceback import websockets import database import log import wst import config from user import auth from user.user import User from game import game database.tables_create() log.startup() users = set() async def handler(websocket, _): ...