src
stringlengths
721
1.04M
from enum import Enum from typing import Optional, Callable, Awaitable, List, NamedTuple, Dict, Tuple from randovania.game_description.resources.item_resource_info import ItemResourceInfo from randovania.game_description.resources.pickup_entry import PickupEntry class GameConnectionStatus(Enum): Disconnected = "...
# -*- coding: utf-8 -*- # Copyright 2011 Takeshi KOMIYA # # 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...
""" def singleton(cls, *args, **kw): instances = {} def _singleton(): if cls not in instances: instances[cls] = cls(*args, **kw) return instances[cls] return _singleton @singleton """ """ url:http://app.50bang.org/?action=session """ r_app_key = "0307cafd71...
from time import sleep __author__ = 'ptonini' import re import os import sys import time from mutagen.mp3 import MP3 from mutagen.easyid3 import EasyID3 class Tracks: def __init__(self, source): if isinstance(source, dict): self.__dict__.update(source) elif isinstance(source, list...
# -*- coding: utf-8 -*- """ =============================================================================== Delaunay: Generate random networks based on Delaunay Tessellations =============================================================================== """ import sys import scipy as sp import numpy as np import Open...
from os.path import join, dirname HERE = dirname(__file__) import logging from apps.tournaments.models import Server, GameRequest from .rpc_client import get_interface import yaml resource_load = lambda name: yaml.load(open( join(HERE, 'resources', name) )) game_ports = resource_load('game_ports.yaml') game_nam...
''' Orthrus commands implementation ''' import os import sys import shutil import re import subprocess import random import glob import webbrowser import tarfile import time import json import string from orthrusutils import orthrusutils as util from builder import builder as b from job import job as j from spectrum.af...
import sqlite3 from wtforms.fields import StringField, IntegerField from wtforms import validators from wtforms_tornado import Form from config import CONFIG from get_content import TContents class CheckContents(Form): title = StringField(validators=[validators.length(min=1, max=100)]) slug = StringField(va...
# -*- coding: utf-8 -*- # Sked - a wikish scheduler with Python and PyGTK # (c) 2006-10 Alexandre Erwin Ittner <alexandre@ittner.com.br> # # 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; eithe...
import unittest import os from lexpy.trie import Trie from lexpy.utils import build_trie_from_file from lexpy.exceptions import InvalidWildCardExpressionError HERE = os.path.dirname(__file__) large_dataset = os.path.join(HERE, 'data/words.txt') small_dataset = os.path.join(HERE, 'data/words2.txt') class TestWordC...
# encoding:utf-8 # Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD+Patents license found in the # LICENSE file in the root directory of this source tree. # author : Facebook # translate : h-j-13 import numpy as np d = 64 ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'credits.ui' # # Created by: PyQt5 UI code generator 5.6 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_DialogCredits(object): def setupUi(self, DialogCredits): Dialo...
from fabric.api import * import fabric.contrib.project as project import http.server import os import shutil import sys import socketserver # Local path configuration (can be absolute or relative to fabfile) env.deploy_path = 'output' DEPLOY_PATH = env.deploy_path # Remote server configuration production = 'root@char...
# Copyright 2016-17 Steven Cooper # # 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 writ...
# Copyright (C) 2017 Forest and Biomass Romania # Copyright (C) 2020 NextERP Romania # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo.exceptions import ValidationError from odoo.tests.common import SavepointCase class TestVatUnique(SavepointCase): @classmethod def setUpClass(cls...
# Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # 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 ...
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # Copyright (C) Canux CHENG <canuxcheng@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 li...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Copyright (c) 2015. The Koodous 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-...
from django.shortcuts import render_to_response,get_object_or_404 from django.template import RequestContext from apps.views import paginate from datetime import date from forms import * from models import * def list(request, language): congress_records = Congress.objects.all().order_by('priority').order_by('-opening...
import mock import colander from pyramid import httpexceptions from kinto.core.resource import ResourceSchema from kinto.core.errors import ERRORS from . import BaseTest class GetTest(BaseTest): def test_get_record_returns_all_fields(self): record = self.model.create_record({'field': 'value'}) ...
# -*- coding: utf-8 -*- from django.test import TestCase from eats.lib.name_form import abbreviate_name, asciify_name, create_name_forms, demacronise_name, substitute_ascii, unpunctuate_name class NameFormTestCase (TestCase): def test_abbreviate_name (self): data = ( ('en', u'Smith and Smit...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Message.to_factory' db.add_column('businesstest_message', 'to_factory', self.gf('django.db...
# coding: utf-8 # Copyright (C) 2016-Today: La Louve (<http://www.lalouve.net/>) # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, fields, models class ProductPrintCategory(models.Model): _name = 'product.pri...
import gevent import sys from gevent.server import StreamServer from JumpScale import j import inspect import time import os from PortalTCPChannels import ManholeSession, WorkerSession, TCPSessionLog try: import fcntl except: pass raise RuntimeError("is not working now") #THERE ARE SOME GOOD IDEAS IN HERE I...
#------------------------------------------------------------------------------ # Copyright (c) 2016, frmdstryr. # # Distributed under the terms of the MIT License. # # The full license is in the file LICENSE, distributed with this software. #-----------------------------------------------------------------------------...
# -*- coding: utf-8 -*- from __future__ import absolute_import import urllib import hashlib from mikoto.libs.text import * from mikoto.libs.emoji import * from vilya.config import EMAIL_SUFFIX def trunc_utf8(string, num, etc="..."): """truncate a utf-8 string, show as num chars. arg: string, a utf-8 encodin...
# This Python file uses the following encoding: utf-8 # send and receive monitoring and control messages to from UniSCADA monitoring system # udp kuulamiseks thread? # neeme import time, datetime import sqlite3 import traceback from socket import * import sys import os import gzip import tarfile import requests impor...
# -*- coding: utf-8 -*- """swiftsc utility module.""" import sys from io import BytesIO import magic def check_mimetype(filepath): """Check mimetype of file. :rtype: str :return: mimetype :param str filepath: target filename path """ if hasattr(magic, 'open'): # for python-magic pack...
"""SCons.Platform SCons platform selection. This looks for modules that define a callable object that can modify a construction environment as appropriate for a given platform. Note that we take a more simplistic view of "platform" than Python does. We're looking for a single string that determines a set of tool-ind...
# 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. # This program is distributed in the hope that it will be useful, # but...
#!/usr/bin/env python # Time-stamp: <2009-04-14 14:07:21 Tao Liu> import os import sys import re from PIL import Image, ImageDraw # ------------------------------------ # Main function # ------------------------------------ help_message = """ Draw the K-means clustering result. need 6 parameter: %s <kmeans_file> <li...
import requests import time import re from pprint import pprint auth_headers = {} def _validate_credentials(fn): def wrapper(*args): def is_not_populated(d,r): return reduce( lambda x,y: x or y, map(lambda k: k not in d or not d[k], r) ) if is_not_populated(auth_headers, ('cookie...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import os import random random.seed(i...
# -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # # Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/ # All Rights Reserved. # info Vauxoo (info@vauxoo.com) ####################################...
import requests class Restheart(object): def __init__(self): # self._baseUrl = 'http://127.0.0.1:8088/db/' # localhost self._baseUrl = 'https://restheart.icos-cp.eu/db/' # production self._verfify = True if self._baseUrl.__contains__('restheart') else False def get_records_to_update(self, op, pagesize, coll...
from redux.ast import ASTNode import logging class Visitor(object): "Implements the extrinsic Visitor pattern." def __init__(self): super(Visitor, self).__init__() self.depth = 0 def log(self, fmt, *args, **kwargs): logging.getLogger(type(self).__name__).debug("%s%d: " + fmt, " ...
from geo_bsd import set_output_handler from geo_bsd import set_progress_handler from geo_bsd import ordinary_kriging from PySide import QtCore class OKThread(QtCore.QThread): propSignal = QtCore.Signal(object) logMessage = QtCore.Signal(str) progressMessage = QtCore.Signal(int) def __init__(self, Prop...
# -*- coding: utf-8 -*- """Tests for the flow module.""" # # (C) Pywikibot team, 2015 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals __version__ = '$Id$' from pywikibot.exceptions import NoPage from pywikibot.flow import Board, Topic, Post from pywikibo...
# Copyright (C) 2015 Patrick Happel <patrick.happel@rub.de> # # This file is part of pySICM. # # pySICM 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 ...
import atexit import os import tempfile from mkt.settings import ROOT _tmpdirs = set() def _cleanup(): try: import sys import shutil except ImportError: return tmp = None try: for tmp in _tmpdirs: shutil.rmtree(tmp) except Exception, exc: sys....
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 option) an...
import pytest from flask import g from flask import session from flaskr.db import get_db def test_register(client, app): # test that viewing the page renders without template errors assert client.get("/auth/register").status_code == 200 # test that successful registration redirects to the login page ...
""" Pyth -- Python text markup and conversion """ from __future__ import absolute_import import os.path __version__ = '0.5.6' writerMap = { '.rtf': 'pyth.plugins.rtf15.writer.Rtf15Writer', '.html': 'pyth.plugins.xhtml.writer.XHTMLWriter', '.xhtml': 'pyth.plugins.xhtml.writer.XHTMLWriter', '.txt': 'py...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # -*- encoding: utf-8 -*- # # Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 # # htt...
"""basic tests of lazy loaded attributes""" from test.lib.testing import assert_raises, assert_raises_message import datetime from sqlalchemy import exc as sa_exc from sqlalchemy.orm import attributes, exc as orm_exc import sqlalchemy as sa from test.lib import testing from sqlalchemy import Integer, String, ForeignKe...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
# 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 ...
# 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 option) any later version. # # This program is distributed in the hope that it will be useful # but...
"""Operator classes for eval. """ import operator as op from functools import partial from datetime import datetime import numpy as np import pandas as pd from pandas.compat import PY3, string_types, text_type import pandas.core.common as com from pandas.formats.printing import pprint_thing, pprint_thing_encoded imp...
import os from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def _release(self, assignment, exchange): self._copy_file("files/test.ipynb", "release/ps1/p1.ipynb") run_command([ "nbgrader", "release", assignmen...
# -*- coding: utf-8 -*- import unittest import wx from outwiker.core.pluginsloader import PluginsLoader from outwiker.pages.wiki.wikipage import WikiPageFactory from outwiker.gui.tester import Tester from test.utils import removeDir from test.basetestcases import BaseOutWikerGUIMixin class HackPage_SetAliasTest(un...
from __future__ import unicode_literals from enum import Enum from django.db import models from django.contrib.auth.models import User class DataType(Enum): """ Enumeration of valid file types """ NETCDF = 1 TEXT = 2 JSON = 3 NAMELIST = 4 IMAGE = 5 XML = 6 class BaseModel(models...
""" This module test for counterpartyd compability with Ethereum's Smart Contracts. """ """ import os import pytest from pyethereum import tester import serpent import logging logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG, format='%(message)s') logger = logging.getLogger() # customize V...
"""Forms for OAuth2 applications.""" from __future__ import unicode_literals from django import forms from django.core.exceptions import ValidationError from django.forms import widgets from django.utils.translation import ugettext, ugettext_lazy as _ from djblets.forms.widgets import CopyableTextInput, ListEditWidge...
from pygments.style import Style from pygments.token import Token, Comment, Name, Keyword, Generic, Number, Operator, String, Punctuation, Error BASE03 = '#002b36' BASE02 = '#073642' BASE01 = '#586e75' BASE00 = '#657b83' BASE0 = '#839496' BASE1 = '#93a1a1' BASE2 = '#eee8d5' BASE3 = '#fdf6e3' YELLOW = '#b58900' ORANGE ...
""" Sending RF signals with low-cost GPIO RF Modules on a Raspberry Pi. """ import logging import threading import time from Adafruit_GPIO import GPIO from rfdevices.protocol import BasebandValue, Protocol, PulseOrder log = logging.getLogger(__name__) class Transmitter: """Representation of a GPIO RF chip."""...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import datetime as dt from Tkinter import Tk import tkFileDialog import openpyxl as op import argparse import os.path import sys import re import csv __metaclass__ = type class RFC4180(csv.Dialect): def __i...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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) 2010-2013 Claudio Guarnieri. # Copyright (C) 2014-2016 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from _winreg import HKEY_CURRENT_USER from lib.common.abstracts import Package class PPT(Package): "...
# # Copyright 2014, NICTA # # This software may be distributed and modified according to the terms of # the BSD 2-Clause license. Note that NO WARRANTY is provided. # See "LICENSE_BSD2.txt" for details. # # @TAG(NICTA_BSD) # '''Versioning functionality. This computes a version identifier based on the current source co...
import os import unittest from ..exceptions import LoginToPortalError, MemberSuiteAPIError from ..security import models from ..security.services import login_to_portal, logout from ..utils import get_new_client LOGIN_TO_PORTAL_RETRIES = 5 LOGIN_TO_PORTAL_DELAY = 1 MEMBER_ID = os.environ['TEST_MS_MEMBER_PORTAL_USER...
# --coding: utf8-- import os.path from django.db.models.fields.files import ImageFieldFile from django.utils.safestring import mark_safe from django.utils.html import escape from django import template register = template.Library() PIXEL_TO_CM = 0.00846666 class ImageNode(template.Node): def __init__(self, val...
# Copyright (C) 2003-2005 Andrey Lebedev <andrey@micro.lt> # # 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. # # This p...
# Copyright (C) 2016-2017 Pelagicore AB # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the # above copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS...
VERSION = (0, 2, 0, "dev", 1) def get_version(): if VERSION[3] == "final": return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2]) elif VERSION[3] == "dev": return "%s.%s.%s%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3], VERSION[4]) else: return "%s.%s.%s%s" % (VERSION[0],...
from mpi4py import MPI import mpiunittest as unittest import sys, os, tempfile class BaseTestFile(object): COMM = MPI.COMM_NULL FILE = MPI.FILE_NULL prefix = 'mpi4py' def setUp(self): fd, self.fname = tempfile.mkstemp(prefix=self.prefix) os.close(fd) self.amode = MPI.MODE_RD...
#! /usr/bin/env python """ Parse PER vs. SINR data from trace files. Revision Info ============= * $LastChangedBy: mandke $ * $LastChangedDate: 2011-10-19 17:04:02 -0500 (Wed, 19 Oct 2011) $ * $LastChangedRevision: 5220 $ :author: Ketan Mandke <kmandke@mail.utexas.edu> :copyright: Copyright 2009-2011 The Unive...
#!/usr/bin/env python # # Copyright (C) 2014 Narf Industries <info@narfindustries.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 # th...
# # BitBake XMLRPC Server # # Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer # Copyright (C) 2006 - 2008 Richard Purdie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This p...
from model.address import Adress import re class Address: def __init__(self, app): self.app = app def create_new_address(self, address): wd = self.app.wd # open home page self.app.open_home_page_address() # add_new_address wd.find_element_by_link_text("add ne...
# -*- coding: utf-8 -*- from ..item import Item from ddbmock import config import sqlite3, cPickle as pickle # I know, using global "variable" for this kind of state *is* bad. But it helps # keeping execution times to a sane value. In particular, this allows to use # in-memory version of sqlite conn = sqlite3.connect...
# # Copyright (c) SAS Institute 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 to in w...
### # CoinToss, a probability simulator. # Copyright (C) 2014 Nicolas A. Ortega # # 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 option) any later...
# Copyright (C) 2010-2011 Richard Lincoln # # 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 to use, copy, modify, merge, publish...
# BSD 3-Clause License # # Copyright (c) 2016-18, University of Liverpool # All rights reserved. # # 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 notic...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Command line utilities. This module is also executable to create script boilerplate. :: $ python -m clitool.cli -o your-script.py $ ./your-script.py --help """ import logging import inspect import os import sys import argparse import warnings from functools ...
#!/usr/bin/python3.4 import sys import os import subprocess zm_home = os.path.expanduser("~") zm_pth_workdir = zm_home+"/.vuadek/" if not os.path.exists(zm_pth_workdir): os.makedirs(zm_pth_workdir) zm_fl_remains = zm_pth_workdir+"remains" pathname = os.path.dirname(sys.argv[1]) if not os.path.isfile(zm_fl_rema...
# 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 ...
""" Procedures specific to photometric data. """ import os import numpy as np from urllib.request import urlopen from urllib.parse import urlencode from .tools import load_results def reddening_correction_sfd98(extinction_r): """ Compute the reddening values using the SFD98 correction set. Parameters ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Script to remove links that are being or have been spammed. Usage: python pwb.py spamremove www.spammedsite.com It will use Special:Linksearch to find the pages on the wiki that link to that site, then for each page make a proposed change consisting of removing all t...
# -*- coding: utf-8 -*- """ Bliss setup script. """ import os import sys import shutil import fileinput from distutils.core import setup from distutils.command.install_data import install_data from distutils.command.sdist import sdist from bliss import version scripts = [] # ["bin/bliss-run"] import sys if sys.he...
# Copyright (c) 2017 Bart Massey # This work is available under the "MIT license". # Please see the file COPYING in this distribution # for license terms. # Filter URLs to be root-relative and have consistent file # naming. from re_memo import * # Given the domainname of the Drupal site (to be removed) # and the pag...
# -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui import sys #import icons_rc import sqlite3 import decimal import qtreedata as d def isNum(value): # Einai to value arithmos, i den einai ? """ use: Returns False if value is not a number , True otherwise input parameters : 1.value : the va...
from django import forms from django.forms import widgets from sponge.utils import config as config_utils from sponge.utils import group as group_utils class ConfigForm(forms.Form): scheduler_username = forms.CharField(help_text="The username of a Pulp user who can modify all sync schedules. Granting 'read' and 'u...
import io import os import json import requests import logging from multiprocessing import Pool, cpu_count from multiprocessing.dummy import Pool as ThreadPool import config from uniresto.util.mplog import MultiProcessingLog import uniscrapers mplog = MultiProcessingLog(config.LOG_FILENAME, 'a', 0, 0) mplog.setForma...
#!/usr/bin/env python # # Copyright 2016 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 requir...
#coding: utf-8 # Copyright 2005-2010 Wesabe, 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 a...
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-08-06 02:49 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
#-*- coding: utf-8 -*- import numpy as n, random, os, sys, time from scipy.io import wavfile as w tfoo=time.time() H=n.hstack V=n.vstack f_a = 44100. # Hz, frequência de amostragem ############## 2.2.1 Tabela de busca (LUT) Lambda_tilde=Lt=1024.*16 # Senoide fooXY=n.linspace(0,2*n.pi,Lt,endpoint=False) S_i=n.sin(foo...
# # Add/Remove dialog for TortoiseHg # # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> # try: import pygtk pygtk.require("2.0") except: pass import gtk import gobject from mercurial import ui, util, hg from mercurial.i18n import _ from status import GStatus def run(hgcmd='add', root='', cwd='', files=[...
""" 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, software distri...
# 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, software # distribu...
import downhill import numpy as np import util class TestBuild: def test_sgd(self): assert isinstance(util.build_rosen('sgd')[0], downhill.SGD) assert isinstance(util.build_factor('sgd')[0], downhill.SGD) def test_nag(self): assert isinstance(util.build_rosen('nag')[0], downhill.NAG)...
# -*- coding: utf-8 -*- from decimal import Decimal from typing import Union from PyQt5.QtCore import pyqtSignal, Qt, QSize from PyQt5.QtGui import QPalette, QPainter from PyQt5.QtWidgets import (QLineEdit, QStyle, QStyleOptionFrame, QSizePolicy) from .util import char_width_in_lineedit, ColorScheme from electrum.u...
from __future__ import unicode_literals from __future__ import absolute_import import logging from django.views.generic.base import TemplateResponseMixin from wiki.core.plugins import registry from wiki.conf import settings log = logging.getLogger(__name__) class ArticleMixin(TemplateResponseMixin): """A mix...
""" Provide a common place to access pmf-based divergences. """ from .earth_movers_distance import ( earth_movers_distance_pmf as earth_movers_distance, ) from .jensen_shannon_divergence import ( jensen_shannon_divergence_pmf as jensen_shannon_divergence, ) from ._kl_nonmerge import ( cross_entropy_pmf ...
#!/usr/bin/env python from sub8_sim_tools import rendering, physics from sub8_sim_tools.widgets import Sub from sub8_sim_tools.physics import Box, Sphere, Mesh from sub8_sim_tools.meshes import Transdec from rosgraph_msgs.msg import Clock from vispy import app, gloo import numpy as np import rospy class SimWorld(rend...
#!/usr/bin/env python # encoding: utf-8 # Copyright 2020 California Institute of Technology. ALL RIGHTS # RESERVED. U.S. Government Sponsorship acknowledged. import sys, logging, transaction from Products.CMFPlone.utils import get_installer _products = [ # 'edrnsite.portlets', # 'edrn.theme', # 'eke.know...
# -*- coding: utf-8 -*- # Autor: Wojtek Gembalczyk w.gembalczyk@coderdojo.org.pl import mcpi.minecraft as minecraft import mcpi.block as block import time import math def woda3x3(x, z): mc.setBlocks(x, 0, z-6, x, 2, z+6, block.AIR.id) #powietrze nad rzeką mc.setBlocks(x, 0, z-5, x, 0, z+5, block.DIRT.id) ...
#!/usr/bin/env python # encoding: utf-8 """ Created by Magnus Morton on 2012-03-14. (c) Copyright 2012 Magnus Morton. This file is part of Nest. Nest is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either...