src
stringlengths
721
1.04M
#!/usr/bin/python """ This callback plugin verifies the required minimum version of Ansible is installed for proper operation of the OpenShift Ansible Installer. The plugin is named with leading `aa_` to ensure this plugin is loaded first (alphanumerically) by Ansible. """ import sys from pkg_resources import parse_ve...
import random import sys import time from reversiboard import * from games.turns.reversi.reversimoves import * # Window parameters WINDOW_WIDTH = 800 WINDOW_HEIGHT = 700 # Colors DARK_GREEN = (0, 128, 0) DARK_GREY = (128, 128, 128) LIGHT_RED = (255, 192, 192) GREEN = (0, 255, 0) WHITE = (255, 255, 255) BLACK = (0, ...
import os import re import shutil import json import time import sys import sqlite3 import gevent.event from Db import Db from Debug import Debug from Config import config from util import helper from Plugin import PluginManager @PluginManager.acceptPlugins class SiteStorage(object): def __init__(self, site, al...
# -*- coding: utf-8 -*- # Resource object code # # Created: Mon Nov 30 13:28:01 2015 # by: The Resource Compiler for PyQt (Qt v4.8.6) # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore qt_resource_data = "\ \x00\x00\x03\x3d\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x...
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Linear Regression Example ========================================================= This example uses the only the first feature of the `diabetes` dataset, in order to illustrate a two-dimensional plot of this regre...
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.battle.BattleProps from panda3d.core import NodePath, SequenceNode, Texture, VBase4 from direct.actor import Actor from direct.directnotify import DirectNotifyGlobal from otp.otpbase import OTPGlobals import random Props = ((5, 'partyBall', 'part...
# -*- coding: utf-8 -*- import warnings from django.db import models, connection, transaction, IntegrityError, DatabaseError from django.contrib.auth.models import User from django.forms import ModelForm from django.core.validators import RegexValidator from cms.models import CMSPlugin from xml.etree import ElementTr...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from flask import url_for from udata.tests.features.territories.test_territories_process import ( create_geozones_fixtures ) from udata.tests.frontend import FrontTestCase class TerritoriesTest(FrontTestCase): modules = ['features.territories',...
from ontobio.ontol_factory import OntologyFactory from ontobio.assoc_factory import AssociationSetFactory from ontobio.assocmodel import AssociationSet import logging import random CVP = 'MP:0004084' # cardiomyopathy MUS = 'NCBITaxon:10090' def test_construct(): """ enrichment test build a gene set from ...
from __future__ import unicode_literals from fabric.api import env, execute, task from fabric.contrib.project import rsync_project from fh_fablib import run_local, cd, require_env, run, step @task(default=True) @require_env def deploy(*args): """Deploys frontend and backend code to the server if the checking st...
import unittest from app import gates from tests.helpers.database_helper import DatabaseHelper test_rules = { "live": { "no_restriction": { "hours_range": [0, 24], "days_range": [0, 6] } }, "develop": { "no_restriction": { "hours_range": [0, 24],...
__author__ = 'hs634' class Crawler(Thread): def __init__(self, q, seen, index, lock, wlock, worker_pool_size): self.queue = q self.seen = seen self.index = index self.worker_pool_size = worker_pool_size self.qandslock = lock self.worker_lock = wlock def crawl(se...
from keras import backend as K from .backend import switch def masked_batch_dot(tensor_a, tensor_b, mask_a, mask_b): ''' The simplest case where this function is applicable is the following: tensor_a: (batch_size, a_length, embed_dim) tensor_b: (batch_size, b_length, embed_dim) mask_a: None or (...
import pandas as pd from . import line, util def rolling_mean(series, period): """現在の株価(短期)と長期移動平均線(長期)のクロス""" slow = series.rolling(window=period, center=False).mean() return util.cross(series, slow) def rolling_mean_ratio(series, period, ratio): """長期移動平均線と現在の株価の最終日の差がratio乖離したら売買シグナル""" mean ...
import logging import os import uuid from django.db import models from django.db.models import signals from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.contrib.contenttypes import generic from django.contrib.staticfiles...
from flask import Flask, request, g, render_template, redirect, url_for, session, jsonify, json from apscheduler.scheduler import Scheduler from flask_oauth import OAuth import requests import arduino import time import pytz import datetime from dateutil.parser import parse from settings import * import logging import ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
from django.shortcuts import render, get_object_or_404, redirect from django.http import Http404, HttpResponse from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.decorators import login_required from django.conf import settings from django.contrib import auth from django.contrib.auth import a...
# Copyright (c) 2008-2010, Michael Gorven, Stefano Rivera # Released under terms of the MIT/X/Expat Licence. See COPYING for details. from copy import copy try: from twisted.plugin import pluginPackagePaths except ImportError: # Not available in Twisted 2.5.0 in Ubuntu hardy # This is straight from twiste...
from __future__ import absolute_import # Copyright (c) 2010-2014 openpyxl from openpyxl.compat import safe_string from openpyxl.cell import get_column_interval, column_index_from_string from openpyxl.descriptors import Integer, Float, Bool, Strict, String, Alias from openpyxl.compat import OrderedDict class Dimensio...
# -*- coding: utf-8 -*- # cf-diff Cloud Formations Diff Tool # Copyright © 2014, Red Hat, Inc. # # 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 3 of the License, or # (at your op...
import collections import Queue import time from threading import enumerate as threadingEnumerate from threading import RLock, current_thread from helper_sql import SqlBulkExecute, sqlExecute, sqlQuery from singleton import Singleton @Singleton class Inventory(collections.MutableMapping): def __init__(self): ...
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import re from .. import _backend_config from .._errors import pretty_message from .._ffi import get_library, register_ffi from ..errors import LibraryNotFoundError from cffi import FFI __all__ = [ 'is_libressl',...
# Copyright 2012 SINA Corporation # Copyright 2014 Cisco Systems, 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/licens...
""" Django settings for cmdb project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impor...
from drongo_utils.helpers import URLHelper from wing_jinja2 import Jinja2 url = URLHelper.url template = Jinja2.template class AuthViews(object): def __init__(self, app, module, base_url): self.app = app self.module = module self.base_url = base_url URLHelper.mount(app, self, b...
''' Created on 08/11/2013 @author: mmpe ''' import multiprocessing import time import unittest from mmpe.functions.timing import get_time from mmpe.datastructures.caching import cache_function, set_cache_property class Example(object): def __init__(self, *args, **kwargs): object.__init__(self, *args, *...
# -*- coding: utf-8 -*- """ Created on Sun Jan 10 15:52:36 2016 P23 figure2.2的源程序 @author: nightwing """ import matplotlib.pyplot as plt DENSITY = 1.29 #空气密度(kg/m3) C = 1.0 #阻力系数 A = 0.33 #截面积(m2) M = 70.0 #人车质量(kg) v1 = 4.0 #(无阻力)速度(m/s) v2 = 4.0 #(有阻力)速度(m/s) P = 400.0 #功率(w) t =...
#!/usr/bin/python3 import random GLOBAL_NULLS = "abcdefghijklmnopqrstuvwxyz" def encrypt(message, key): KEY = key.strip() spacelessmessage = message.replace(" ","") strippedmessage = spacelessmessage.strip() WORK_MSG = strippedmessage.lower() #Use this as workable string SORTED_KEY = sortKey(KEY...
import logging from ep.models import Unit, DeviceParameter, SECURE_SERVER_NAME from django.db import models from ep_secure_importer.controllers.secure_client import SecureClient, secure_vendor_name __author__ = 'mitchell' logger = logging.getLogger(__name__) class SecureDeviceParameterActions(models.Model): @s...
"""Setuptools package definition""" # PLEASE REMOVE UNUSED CODE like CustomInstallCommand if you don't use it from setuptools import setup from setuptools import find_packages import os __version__ = None version_file = "hexgame/version.py" with open(version_file) as f: code = compile(f.read(), version_file, '...
# Copyright 2020 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 or agreed to in writing, ...
#!/usr/bin/env python # encoding: utf-8 """ search.py Created by Ilia Lobsanov on 2008-04-12. Copyright (c) 2008 Nurey Networks Inc. All rights reserved. """ import wsgiref.handlers import logging import os #import pprint #pp = pprint.PrettyPrinter(indent=4,depth=5) from google.appengine.ext import webapp, search, d...
import sys import os import re from setuptools import setup, Extension with open('fastrlock/__init__.py') as f: VERSION = re.search( r'^__version__ \s* = \s* ["\'] ([0-9ab.]+) ["\']', f.read(), re.MULTILINE|re.VERBOSE).group(1) BASEDIR = os.path.dirname(__file__) PKGNAME = 'fastrlock' PKGDIR = os...
""" .. codeauthor:: Kevin Kennedy <kennedy.kevin@gmail.com> """ from Base_Applet import Base_Applet import Tkinter as Tk from widgets import * class VISA(Base_Applet): info = { # Description 'description': 'Generic view for VISA Resources', # List of compatibl...
import sqlalchemy from sqlalchemy import create_engine from sqlalchemy.pool import NullPool import time import psycopg2 # This value must be incremented after schema changes on replicated tables! SCHEMA_VERSION = 5 engine = None DUMP_DEFAULT_THREAD_COUNT = 4 def init_db_connection(connect_str): """Initializes...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import six import xmltodict from unidecode import unidecode class Comercial(object): """ Modelo para os dados comerciais da loja. """ def __init__(self, numero=None, chave=None): self.numero = numero self.chave = chave ...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Pertinence.comment' db.alter_column(u'commons_pertinen...
import operator from array import array from collections import defaultdict import redis import polymr.storage from polymr.storage import dumps from polymr.storage import LevelDBBackend from toolz import partition_all from toolz import valmap snd = operator.itemgetter(1) class FakeDict(object): def __init__(sel...
# vim: ts=4:sw=4:expandtab # coding=utf-8 # BleachBit # Copyright (C) 2008-2020 Andrew Ziem # https://www.bleachbit.org # # 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 3 of the...
from functools import reduce from six.moves import builtins from pyrtl.rtllib import multipliers as mult from ..wire import Const, WireVector from ..corecircuits import as_wires, concat, select from ..pyrtlexceptions import PyrtlError from ..helperfuncs import formatted_str_to_val class Matrix(object): ''' Clas...
#!/usr/bin/env python # File: demud.py # Author: Kiri Wagstaff, 2/28/13; James Bedell, summer 2013 # # Implementation of DEMUD (Discovery through Eigenbasis Modeling of # Uninteresting Data). See Wagstaff et al., AAAI 2013. # # Copyright 2013-2015, by the California Institute of Technology. ALL # RIGHTS RESERVED. Uni...
__source__ = 'https://leetcode.com/problems/baseball-game/description/' # Time: O() # Space: O() # # Description: Leetcode # 682. Baseball Game # # You're now a baseball game point recorder. # # Given a list of strings, each string can be one of the 4 following types: # # Integer (one round's score): Directly represen...
import datetime import os from ..common.abstracttemplatesmanager import ComponentTemplatesManager from ..common.plugin_collection import PluginCollection from . import plugins FILE_PATH = os.path.dirname(os.path.realpath(__file__)) class TemplatesManagerCpp(ComponentTemplatesManager): def __init__(self, compone...
import datetime from aredis.exceptions import RedisError from aredis.utils import (b, bool_ok, nativestr, dict_merge, string_keys_to_dict, list_keys_to_dict, pairs_to_dict, NodeFlag) def p...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from intelmq.lib import utils from intelmq.lib.bot import Bot from intelmq.lib.message import Event class DragonResearchGroupSSHParserBot(Bot): def process(self): report = self.receive_message() if report is None or not ...
"""Pure python implementation of the binary Tokyo Tyrant 1.1.17 protocol Tokyo Cabinet <http://tokyocabinet.sourceforge.net/> is a "super hyper ultra database manager" written and maintained by Mikio Hirabayashi and released under the LGPL. Tokyo Tyrant is the de facto database server for Tokyo Cabinet written and ma...
import sys if sys.version_info >= (3, 0): class_type = type else: from new import classobj class_type = classobj class ConstantType(type): """ Tree representation metaclass for class attributes. Metaclass is extended to all child classes too. """ def __new__(cls, clsname, bases, dct):...
# Copyright 2021 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...
#fcc paracrystal model #note model title and parameter table are automatically inserted #note - calculation requires double precision r""" .. warning:: This model and this model description are under review following concerns raised by SasView users. If you need to use this model, please email...
''' Created on Feb 24, 2016 @author: jokirby ''' import csv import tkinter as tk import time class Window(tk.Frame): def __init__(self, master=None): tk.Frame.__init__(self, master) self.pack() self.createWidgets() def createWidgets(self): self.inString = t...
import socket import sys import hashlib from datetime import datetime import os import signal import glob import sqlite3 import threading import time import RPi.GPIO as GPIO HOST = '' PORT = 8888 PASSWORD = '' ENC_KEY = '' exitapp = False break_ = -1 db_path = 'rgc-server.db3' CODE_VERSION = 2 def stringToint(str...
#### embedding from sklearn.decomposition import PCA from sklearn.manifold import TSNE, MDS from mpl_toolkits.mplot3d import Axes3D class embeddings(obj): def __init__(self, model,data): self.modelChoice = model self.data = data # self.data = FeatureMtx_norm def PCA_embedding(self,n_c...
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 # Distribution by the MIT License. # # -----------------------------------------------------------...
import numpy as np import pytest from sklearn.datasets import make_classification, make_regression # To use this experimental feature, we need to explicitly ask for it: from sklearn.experimental import enable_hist_gradient_boosting # noqa from sklearn.ensemble import HistGradientBoostingRegressor from sklearn.ensembl...
class Reserved: port = 'port' host = 'host' scheme = 'scheme' default_port = 'default_port' consumer_key = 'consumer_key' consumer_secret = 'consumer_secret' oauth_token = 'oauth_token' oauth_token_secret = 'oauth_token_secret' parameters = 'parameters' ...
import pytest import imp import boto.s3 from retrying import retry import uuid import os from boto.s3.key import Key d = imp.load_source( 'd', 'bin/s3ctl' ) class Struct: def __init__(self, **entries): self.__dict__.update(entries) @pytest.fixture(scope="module") def backup_bucket(): retur...
import xml.etree.ElementTree as ET class IOFParseResult(object): def __init__(self, name, data): self.name = name self.data = data def parse(file): ns = { 'iof': 'http://www.orienteering.org/datastandard/3.0', 'orgeo': 'http://orgeo.ru/iof-xml-extensions/3.0', } tree ...
""" Helpers for randomized testing """ from __future__ import print_function, division from random import uniform import random from sympy.core.numbers import I from sympy.simplify.simplify import nsimplify from sympy.core.containers import Tuple from sympy.core.numbers import comp from sympy.core.symbol import Symb...
""" RenderPipeline Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com> 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 right...
#!/usr/bin/env python # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import io import re import string from youtube_dl.extractor import YoutubeIE from youtube_dl.utils import compat_str, compat_urlretrieve _TESTS = [ ...
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from textwrap import dedent import pytest import pytablewriter from pytablewriter.style import Style from ..._common import print_test_result from ...data import ( Data, headers, mix_header_list, mix_value_matrix, null_test_...
from urllib.parse import urlparse from etherealpost.db.filters import JinjaFilters from pymongo import MongoClient from pyramid.config import Configurator from pyramid.httpexceptions import HTTPMovedPermanently # http://stackoverflow.com/a/15705778 def add_auto_route(config, name, pattern, **kw): config.add_rout...
import os import json import time from caspar import CasparServer SESSION_DIR = "sessions" KEYS = { "LG01" : 20, "LG02" : 21, "LG03" : 22, "LG04" : 23, "LG05" : 16, "LG06" : 17, "LG07" : 18, "LG08" : 19, "LG09" : 12, "LG10" : 13, "LG11" : 14, "L...
import time import inspect import random from super3 import more_super3 as super3, callable_super3 def super_proxy(self, type): py_super = super(type, self) my_super = super3(caller=inspect.currentframe().f_back) assert py_super.__str__() == my_super.__str__() \ or (py_super.__self_class__ ...
import datetime import xlwt from time import strftime from mtrack.utils import write_xls from django.http import HttpResponse from django.db import connection def generate_excel_response(data, headings): book = xlwt.Workbook(encoding="utf8") write_xls(sheet_name="BedNets Report", headings=headings, data=data, ...
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitcoin-wallet.""" import hashlib import os import stat import subprocess import textwrap from t...
#!/usr/bin/env python ''' Template to convert from HDF5 files to NPY numpy array Files. This implementation uses parseGFU.py to parse the data ''' # Imports from __future__ import print_function from optparse import OptionParser import tables import numpy as np import parseGFU # Command parsing usage = '%prog [optio...
#!/usr/bin/env python """ cythonize SOURCE: https://github.com/scipy/scipy/blob/master/setup.py Cythonize pyx files into C files as needed. Usage: cythonize [root_dir] Default [root_dir] is 'pyfunt'. Checks pyx files to see if they have been changed relative to their corresponding C files. If they have, then runs...
#!/usr/bin/env python """Distutils based setup script for SymPy. This uses Distutils (http://python.org/sigs/distutils-sig/) the standard python mechanism for installing packages. For the easiest installation just type the command (you'll probably need root privileges for that): python setup.py install This will...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = "Raul Perula-Martinez" __email__ = "raul.perula@uc3m.es" __date__ = "2014-11" __license__ = "GPL v3" __version__ = "1.0.0" # Cadenas # 1 print "\nEJERCICIO 1\n" cad1 = "hola" cad2 = " mundo" cad = cad1+cad2 print cad # 2 print "\nEJERCICIO 2\n" print ca...
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # python version: 2.7.5 final, serial: 0 # Author: Leonard Wei <gooxxgle.mail@gmail.com> """Hash calculation library This module is an hash calculation library that: - calculate the input strings or files - output the result for later verificat...
from PIL import Image from PIL.ExifTags import TAGS, GPSTAGS def get_exif_data(image): """Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags""" exif_data = {} info = image._getexif() if info: for tag, value in info.items(): decoded = TAGS.get(ta...
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2019-2020 Philipp Wolfer # # 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 ...
# -*- coding: utf-8 -*- # # Python Telegram Bot documentation build configuration file, created by # sphinx-quickstart on Mon Aug 10 22:25:07 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated...
from argparse import ArgumentParser import falcon import gunicorn.app.base import json import multiprocessing import sys # A Falcon resource that returns the same quote every time class QuoteResource(object): def on_get(self, req, resp): """Handles GET requests""" quote = {'quote': 'I\'ve always b...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: hapi/chart/template.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflecti...
#!/usr/bin/env python # Copyright (C) 2015 # ASTRON (Netherlands Institute for Radio Astronomy) # P.O.Box 2, 7990 AA Dwingeloo, The Netherlands # # This file is part of the LOFAR software suite. # The LOFAR software suite is free software: you can redistribute it # and/or modify it under the terms of the GNU General P...
#!/usr/bin/env python # -*- coding: utf 8 -*- """ Utility functions. :copyright: 2015 Agile Geoscience :license: Apache 2.0 """ import numpy as np import scipy.signal def rms(a): """ Calculates the RMS of an array. :param a: An array. :returns: The RMS of the array. """ return np.sqrt(np.s...
# SPDX-License-Identifier: AGPL-3.0-or-later """ ArXiV (Scientific preprints) """ from lxml import html from datetime import datetime from searx.utils import eval_xpath_list, eval_xpath_getindex # about about = { "website": 'https://arxiv.org', "wikidata_id": 'Q118398', "official_api_documentation": 'htt...
import typing as t from abc import abstractmethod from functools import reduce from operator import and_ from pca.data.errors import QueryErrors from pca.data.predicate import Predicate from pca.interfaces.dao import ( BatchOfDto, Dto, Id, IDao, Ids, IQueryChain, Kwargs, ) from pca.utils.d...
#! /usr/bin/env python3 """Faster, simpler, Screed-esque iterator for FASTA files Copyright: fasta.py iterate over and return entries of a FASTA file Copyright (C) 2015 William Brazelton, Alex Hyer This program is free software: you can redistribute it and/or modify it under the terms of the GNU Ge...
import urllib2 import lxml.html import numpy import scipy import scipy.misc import scipy.cluster import urlparse import struct import operator import gzip import datetime import requests import httplib from PIL import BmpImagePlugin, PngImagePlugin, Image from socket import error as SocketError from boto.s3.key import ...
# Copyright 2012,2013 James McCauley # # 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 ...
from ctypes import windll, pointer from ctypes.wintypes import DWORD from prompt_toolkit.key_binding.input_processor import KeyPress from prompt_toolkit.keys import Keys from prompt_toolkit.mouse_events import MouseEventTypes from prompt_toolkit.win32_types import EventTypes, KEY_EVENT_RECORD, MOUSE_EVENT_RECORD, INPU...
# python3 # Copyright 2018 DeepMind Technologies Limited. 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 re...
import pathlib import asyncio # noqa: F401 import discord # noqa: F401 from discord.ext import commands from cogs.utils.dataIO import dataIO from cogs.utils import checks from .utils.chat_formatting import pagify path = 'data/rssrelay' class RSSRelay: """Configureable Announcements.""" __version__ = "3.0.1...
from mathutils import Vector, Euler, Matrix import bpy import math import re from .common import dict_get_set from . import common from .Matrix44 import rotation_part # import weakref import logging log = logging.getLogger('bpy.ops.import_mesh.bmd.pseudobones') NtoB = Matrix([[1,0,0,0], [0,0...
from django.db import models from tournamentcontrol.competition.signals.custom import match_forfeit # noqa from tournamentcontrol.competition.signals.ladders import ( # noqa changed_points_formula, scale_ladder_entry, team_ladder_entry_aggregation, ) from tournamentcontrol.competition.signals.matches import ( # ...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
"""Audio Processor. Takes live audio and generates MIDI information from it. Here are the configuration options, and they go on and on. Some of them are optimistic that I'll come back later and add other options, but don't count on it. Probably the most important thing to wrap your head around is that you set a frame...
#!/usr/bin/env python """ 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")...
import unittest import sys sys.path.append('pychess') import game class LegalMovesTest(unittest.TestCase): def setUp(self): self.game = game.Game( '8/8/8/3Kq3/5k2/8/8/8 w - - 0 1') self.white_king = self.game.first_piece(['K'], 0) def test_queen_attacks(self): self.assertI...
''' Copyright (c) OS-Networks, http://os-networks.net Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following...
""" SoftLayer.ssl ~~~~~~~~~~~~~ SSL Manager/helpers :license: MIT, see LICENSE for more details. """ class SSLManager(object): """Manages SSL certificates. :param SoftLayer.API.Client client: an API client instance """ def __init__(self, client): self.client = client ...
#!/usr/bin/env python # Use the built in json and sqlite library import json import sqlite3 def main(): # Running card counter card_count = 0 # Load all json data into a collection card_data = json.load(open('cards.collectible.json')) # Connect to our database and creat table if it doesn't e...
__author__="UShareSoft" from ussclicore.argumentParser import ArgumentParser, ArgumentParserError from ussclicore.cmd import Cmd, CoreGlobal from texttable import Texttable from uforgecli.utils.org_utils import org_get from ussclicore.utils import generics_utils, printer from uforgecli.utils.uforgecli_utils import * ...
algorithm = "hagedorn" propagator = "semiclassical" splitting_method = "Y4" T = 6 dt = 0.01 dimension = 2 ncomponents = 1 eps = 0.05 potential = "henon_heiles" a = 1 b = 3 # The parameter set of the initial wavepacket Q = [[1.0, 0.0], [0.0, 1.0]] P = [[1.0j, 0.0 ], [0.0, 1.0j]] q = [[0.06], [0.0]...
#!/usr/bin/env python3 # # Copyright 2014 Simone Campagna # # 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 ...
#!/usr/bin/env python # -*- coding: latin-1 -*- # $Id: bbcconv.py,v 1.4 2005/03/25 23:33:35 theyworkforyou Exp $ # Screen scrape list of links to Lords on Wikipedia, so we can link to the articles. # The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd # This is free software, and you are welcome to red...