code stringlengths 1 199k |
|---|
from expects import expect
from mamba import describe, context, before
from spec.ui._ipod_helpers import *
from spec.ui._fixture import update_environment
with describe('ipodio playlist create') as _:
@before.all
def setup_all():
_.new_name = 'leño'
_.playlist_name = 'playlist'
_.existin... |
from datetime import datetime, timedelta
from itertools import chain, cycle
from django.shortcuts import render_to_response
from django.utils.translation import ugettext, ugettext_lazy as _
from django.http import HttpResponseRedirect, Http404
from django import forms
from django.views.decorators.http import require_PO... |
import datetime
from decimal import Decimal
from django.utils import translation
import mock
from nose.tools import eq_, ok_
import amo
import amo.tests
from addons.models import Addon, AddonUser
from constants.payments import PROVIDER_BANGO, PROVIDER_BOKU
from market.models import AddonPremium, Price, PriceCurrency, R... |
from neon.transforms.cost import Cost
class MulticlsSVMLoss(Cost):
def __init__(self, delta=1.):
self.delta = delta
def __call__(self, y, t):
T = self.be.empty_like(y)
T[:] = self.be.max(y * t, axis=0)
# T = self.be.array(self.be.max(y * t, axis=0).asnumpyarray(), y.shape[0], axi... |
from unittest import mock
from taskplus.core.actions import GetRoleDetailsAction, GetRoleDetailsRequest
from taskplus.core.domain import UserRole
from taskplus.core.shared.response import ResponseFailure
def test_get_role_details_action():
role = mock.Mock()
role = UserRole(name='admin', id=1)
roles_repo = ... |
import math
import net
SIGMOID = 0
TANH = 1
class bp:
def __init__(self, net, learning_rate, momentum):
self.type = net.getType()
self.net = net
self.lr = learning_rate
self.m = momentum
self.layer = net.getLayer()
self.lc = [[[0]*max(self.layer)]*max(self.layer)]*len(self.layer)
def _dfunc(... |
"""The freesurfer module provides basic functions for interfacing with
freesurfer tools.
Currently these tools are supported:
* Dicom2Nifti: using mri_convert
* Resample: using mri_convert
Examples
--------
See the docstrings for the individual classes for 'working' examples.
"""
__docformat__ = 'restructured... |
'''@file standard_trainer.py
contains the StandardTrainer'''
from nabu.neuralnetworks.trainers import trainer
class StandardTrainer(trainer.Trainer):
'''a trainer with no added functionality'''
def aditional_loss(self):
'''
add an aditional loss
returns:
the aditional loss or... |
SECRET_KEY = 'fake-key'
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
}
INSTALLED_APPS = [
"django_nose",
"tests",
]
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = [
'--with-coverage',
'--cover-package=search_views',
] |
import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="tickfont", parent_name="layout.ternary.aaxis", **kwargs
):
super(TickfontValidator, self).__init__(
plotly_name=plotly_name,
paren... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('caudexer', '0002_auto_20151107_1409'),
]
operations = [
migrations.AlterField(
model_name='goodreadsdata',
name='good_reads_id',
... |
from ZSI import Binding
MESSAGE = "Hello from Python!"
def main():
binding = Binding(url='http://localhost:8080/server.py')
print ' Sending: %s' % MESSAGE
response = binding.echo(MESSAGE)
print 'Response: %s' % MESSAGE
if __name__ == '__main__':
main() |
import deepchem as dc
import numpy as np
import sklearn
from sklearn.ensemble import RandomForestClassifier
N = 100
n_feat = 5
n_classes = 3
X = np.random.rand(N, n_feat)
y = np.random.randint(3, size=(N,))
dataset = dc.data.NumpyDataset(X, y)
sklearn_model = RandomForestClassifier(class_weight="balanced", n_estimators... |
"""
Support for RESTful binary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.rest/
"""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.sensor.rest import RestData
f... |
import sys
args = ' '.join(sys.argv[1:])
print(f"""Deprecated as of commit 959939b771. Use flask utility script instead:
$ flask {args}
""")
raise SystemExit(1) |
import sys
import os
import shlex
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'dolphintools'
copyright = u'2015, Alper Kucukural'
author = u'Alper Kucukural'
version = '1.0.0'
release = '1.0.0'
language = None
exclude_patterns = ['_build']
pygments_style = 'sph... |
import collections
import numbers
import re
import sqlalchemy as sa
from sqlalchemy.ext import compiler as sa_compiler
from sqlalchemy.sql import expression as sa_expression
ACCESS_KEY_ID_RE = re.compile('[A-Z0-9]{20}')
SECRET_ACCESS_KEY_RE = re.compile('[A-Za-z0-9/+=]{40}')
TOKEN_RE = re.compile('[A-Za-z0-9/+=]+')
AWS... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^signin/', views.signin, name='signin'),
url(r'^signout/', views.signout, name='signout'),
url(r'^change_password/', views.change_password, name='change_password'),
] |
import test_framework.loginit
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import http.client
import urllib.parse
class HTTPBasicsTest (BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(4, self.options.tmpdir)
def run_test(self):
... |
import _plotly_utils.basevalidators
class XValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="x", parent_name="isosurface.caps", **kwargs):
super(XValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_cla... |
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
fig=plt.figure()
ax=fig.add_axes([0.1,0.1,0.8,0.8])
m = Basemap(llcrnrlon=0.,llcrnrlat=20.,urcrnrlon=80.,urcrnrlat=70.,\
rsphere=(6378137.00,6356752.3142),\
resolution='l',projection='merc',\
... |
from django.conf.urls import *
from django.contrib.auth.decorators import login_required
from volunteers.views import *
urlpatterns = patterns('',
#(r'^$', login_required(ShowsInProcessing.as_view()), {}, 'volunteer_show_list'),
#(r'^(?P<show_slug>\[-\w]+)/$', login_required(ShowReview.as_view()), {}, 'voluntee... |
from . import load_fixture
from lintreview.config import load_config
from lintreview.diff import DiffCollection
from lintreview.review import Review, Problems, Comment
from lintreview.repo import GithubRepository, GithubPullRequest
from mock import Mock, call
from nose.tools import eq_
from github3.issues.comment impor... |
from twisted.trial.unittest import TestCase
from txaws.exception import AWSError
from txaws.exception import AWSResponseParseError
from txaws.util import XML
REQUEST_ID = "0ef9fc37-6230-4d81-b2e6-1b36277d4247"
class AWSErrorTestCase(TestCase):
def test_creation(self):
error = AWSError("<dummy1 />", 500, "Se... |
from PySide import QtCore, QtGui
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(529, 329)
self.selInfoWidget = QtGui.QWidget(Form)
self.selInfoWidget.setGeometry(QtCore.QRect(260, 10, 264, 222))
self.selInfoWidget.setObjectName("selInfo... |
"""Test the zapwallettxes functionality.
- start two iopd nodes
- create two transactions on node 0 - one is confirmed and one is unconfirmed.
- restart node 0 and verify that both the confirmed and the unconfirmed
transactions are still available.
- restart node 0 with zapwallettxes and persistmempool, and verify th... |
"""Kytos Napps Module."""
import json
import os
import re
import sys
import tarfile
import urllib
from abc import ABCMeta, abstractmethod
from pathlib import Path
from random import randint
from threading import Event, Thread
from kytos.core.events import KytosEvent
from kytos.core.logs import NAppLog
__all__ = ('Kytos... |
import sqlite3, sys
if (len(sys.argv) < 1):
sys.stderr.write('You need to give the name of the ILI DB\n')
sys.exit(1)
else:
dbfile = sys.argv[1]
con = sqlite3.connect(dbfile)
c = con.cursor()
u = "ili_load-kinds.py"
c.execute("""INSERT INTO kind (id, kind, u)
VALUES (?,?,?)""", [1,'concept',u])
c... |
"""kaxabu URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... |
"""
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.
The first integer of each row is greater than the last integer of the previous row.
For example,
Consider the following matrix:
[
[1, 3, 5, 7... |
from abc import ABCMeta, abstractmethod
from enum import Enum
class InputType(Enum):
ls = 1
dir = 2
unknown = 3
class ParserBase(metaclass=ABCMeta):
def __init__(self, input_text, extensions):
self.input = input_text.splitlines()
self.extensions = extensions
@abstractmethod
def r... |
"""
Support for an interface to work with a remote instance of Home Assistant.
If a connection error occurs while communicating with the API a
HomeAssistantError will be raised.
For more details about the Python API, please refer to the documentation at
https://home-assistant.io/developers/python_api/
"""
from datetime... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_ith_backpack_field_06.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_imperial_officer_m_4.iff"
result.attribute_template_id = 9
result.stfName("npc_name","human_base_male")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
class Solution:
# @return a string
def intToRoman(self, n):
roman_numeral_map = (
('M', 1000),
('CM', 900),
('D', 500),
('CD', 400),
('C', 100),
('XC', 90),
('L', 50),
('XL', 40),
('X', 10),
... |
from sqlalchemy.testing import eq_, assert_raises, assert_raises_message
import operator
from sqlalchemy import *
from sqlalchemy import exc as sa_exc, util
from sqlalchemy.sql import compiler, table, column
from sqlalchemy.engine import default
from sqlalchemy.orm import *
from sqlalchemy.orm import attributes
from sq... |
"""
MoinMoin - Side by side diffs
@copyright: 2002 Juergen Hermann <jh@web.de>,
2002 Scott Moonen <smoonen@andstuff.org>
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin.support import difflib
from MoinMoin.wikiutil import escape
def indent(line):
eol = ''
while line and... |
import platform
def is_windows():
"""Returns true if current platform is windows"""
return any(platform.win32_ver()) |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectiona... |
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from usermgmt import utils
register = template.Library()
@register.filter(is_safe=True)
@stringfilter
def render_attributes(value, autoescape... |
import os
import ast
"""
Load the cornell movie dialog corpus.
Available from here:
http://www.cs.cornell.edu/~cristian/Cornell_Movie-Dialogs_Corpus.html
"""
class CornellData:
"""
"""
def __init__(self, dirName):
"""
Args:
dirName (string): directory where to load the corpus
... |
from thumbnails.conf import settings
from thumbnails.engines import DummyEngine
from thumbnails.helpers import get_engine, generate_filename, get_cache_backend
from thumbnails.images import SourceFile, Thumbnail
__version__ = '0.5.1'
def get_thumbnail(original, size, **options):
"""
Creates or gets an already c... |
"""
WSGI config for mords_backend project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... |
from emojibot.utils.response import Response
def test_constructor():
response = Response()
assert isinstance(response, Response) |
from __future__ import absolute_import
from jinja2.ext import Extension
from .templatetags.promotions_tags import promo_ballance
class PromotionsExtension(Extension):
def __init__(self, environment):
super(PromotionsExtension, self).__init__(environment)
environment.filters["promo_ballance"] = promo... |
from collections import OrderedDict
from os.path import dirname, join
filename = join(dirname(__file__), 'passability.png')
sprites = OrderedDict((
('wall', {'none': [[[0, 0, 16, 16], [0, 0], [0, 0], 60]]}),
('platform', {'none': [[[48, 0, 16, 16], [48, 0], [0, 0], 60]]}),
('climb_platform', {'none': [[[16,... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/mission/quest_item/shared_sayama_edosun_q2_needed.iff"
result.attribute_template_id = -1
result.stfName("loot_nboo_n","sayama_edosun_q2_needed")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return... |
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_dathomir_freedprisonerscamp_large1.iff"
result.attribute_template_id = -1
result.stfName("poi_n","base_poi_building")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/all/shared_frn_all_throwpillow_med_s02.iff"
result.attribute_template_id = 6
result.stfName("frn_n","frn_throwpillow")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
from openturns import *
from math import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
# Instanciate one distribution object
dim = 1
meanPoint = NumericalPoint(dim, 1.0)
meanPoint[0] = 0.5
sigma = NumericalPoint(dim, 1.0)
sigma[0] = 2.0
R = CorrelationMatrix(dim)
distribution1 = Norma... |
"""
Constants
"""
TOOL_FREEBAYES = 'freebayes'
TOOL_PINDEL = 'pindel'
TOOL_DELLY = 'delly'
TOOL_LUMPY = 'lumpy' |
def count(S, m, n):
table = [[0 for x in range(m)] for x in range(n+1)]
for i in range(m):
table[0][i] = 1
for i in range(1, n+1):
for j in range(m):
x = table[i - S[j]][j] if i-S[j] >= 0 else 0
y = table[i][j-1] if j >= 1 else 0
table[i][j] = x + y
re... |
import _plotly_utils.basevalidators
class AnnotationsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(self, plotly_name="annotations", parent_name="layout.scene", **kwargs):
super(AnnotationsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... |
import unittest
import numpy as np
import pyoptima as opt
class SimulatedAnnealingTest(unittest.TestCase):
def test_with_parabola(self):
""" Test with a simple parabolic function with 2 variables """
def neighbour_func(params):
new_params = params
params['x0'] += np.random.un... |
from django.contrib import admin
from .models import Author, Genre, Book, BookInstance, Language
"""
admin.site.register(Book)
admin.site.register(Author)
admin.site.register(BookInstance)
admin.site.register(Genre)
admin.site.register(Language)
"""
admin.site.register(Genre)
admin.site.register(Language)
class BooksIn... |
from datetime import datetime
import json
import logging
import threading
import paho.mqtt.client as paho
import pytz
from wiotp.sdk import (
AbstractClient,
ConfigurationException,
ConnectionException,
MissingMessageEncoderException,
InvalidEventException,
)
from wiotp.sdk.device.command import Com... |
from __future__ import absolute_import, division, print_function
import struct
class BBType(object):
command = 1
command_return = 2
consolemsg = 3
ping = 4
pong = 5
getenv = 6
getenv_return = 7
fs = 8
fs_return = 9
class BBPacket(object):
def __init__(self, p_type=0, p_flags=0, p... |
"""BibFormat element - Prints INSPIRE jobs contact name HEPNAMES search
"""
from datetime import datetime
def format_element(bfo, style="", separator=''):
"""Default format for the contact person link in the Jobs format.
This link will point to a direct search in the HepNames database.
@param style: CSS cla... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('QuickBooking', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='timing',
name='id',
field=models.... |
import os
from app import create_app, db
from app.models import User, Role
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
migrate = Migrate(app, db)
def make_shell_context():
return dic... |
import wx
from math import cos, pi, radians, sin
from Queue import Queue
from sys import maxint
from threading import Thread
from time import clock, sleep
from win32api import EnumDisplayMonitors, GetSystemMetrics, mouse_event as mouse_event2
from win32con import MOUSEEVENTF_ABSOLUTE, MOUSEEVENTF_MOVE
import eg
from eg... |
'''
script.matchcenter - Football information for Kodi
A program addon that can be mapped to a key on your remote to display football information.
Livescores, Event details, Line-ups, League tables, next and previous matches by team. Follow what
others are saying about the match in twitter.
Copyrigh... |
"""Subclass of GitView, which is generated by wxFormBuilder."""
import wx
from beatle import tran, model, localpath
from beatle.model import git
from beatle.lib import wxx
from beatle.lib.decorators import classproperty
from beatle.lib.handlers import Identifiers
from beatle.app import resources as rc
from beatle.app.u... |
Card = collections.namedtuple('Card', ['rank', 'suit'])
class FrenchDeck:
ranks = [str(n) for n in range(2, 11)] + list('JQKA')
suits = 'spades diamonds clubs hearts'.split()
def __init__(self):
self._cards = [Card(rank, suit) for suit in self.suits
for rank i... |
import sys
filename = 'data/people-simple.fs'
from zodbtools import FileDB
from PP3E.Dbase.TableBrowser.formgui import FormGui
from PP3E.Dbase.TableBrowser.formtable import Table, InstanceRecord
class Person: pass
initrecs = {'bob': dict(name='bob', job='devel', pay=30),
'sue': dict(name='sue', job='music... |
class IssueReportingAction(object):
def to_dict(self):
return self.__dict__
class DynamicReportingAction(IssueReportingAction):
def __init__(self):
self.type = 'dynamic'
class StaticReportingAction(IssueReportingAction):
def __init__(self, url, args, label, blank_window):
self.url = ... |
from django.core.exceptions import PermissionDenied
from core.models import Author, Editor
def copy_author_to_submission(user, book):
author = Author(
first_name=user.first_name,
middle_name=user.profile.middle_name,
last_name=user.last_name,
salutation=user.profile.salutation,
... |
from enigma import iPlayableService, iRdsDecoder
from Screens.Screen import Screen
from Components.ActionMap import NumberActionMap
from Components.ServiceEventTracker import ServiceEventTracker
from Components.Pixmap import Pixmap
from Components.Label import Label
from Components.Sources.StaticText import StaticText
... |
""" addons.xml generator """
import os
import sys
import time
import re
import xml.etree.ElementTree as ET
try:
import shutil, zipfile
except Exception as e:
print('An error occurred importing module!\n%s\n' % e)
print(sys.version)
if sys.version < '3':
import codecs
def u(x):
return codecs.unic... |
"""Definitions for output formats."""
import collections
from enum import Enum, unique
__copyright__ = 'Copyright 2021, 3Liz'
__license__ = 'GPL version 3'
__email__ = 'info@3liz.org'
format_output = collections.namedtuple('format', ['label', 'driver_name', 'extension'])
@unique
class Format(Enum):
""" Name of outp... |
import wx
from Gauge import Gauge
class DependencyPanel(wx.Panel):
def __init__(self, parent, text, gaugeColor, textColor, env = 0, mineral = 0, energy = 0, nothing = 0):
wx.Panel.__init__(self, parent, -1)
gaugeBorders = (5, 5, 1, 7)
self.env = Gauge(self, gaugeColor, textColor, gaugeBorders, env)
self.minera... |
import re
import tempfile
import mimetools
import cgi
import logging
import shutil
import filecmp
import os
import cpc.util.log
'''
Created on Mar 7, 2011
@author: iman
'''
from cpc.network.server_request import ServerRequest
import urlparse
log=logging.getLogger(__name__)
class HttpMethodParser(object):
'''
cl... |
import sys, os, re, string
from autotest_lib.client.bin import utils, fsinfo, fsdev_mgr, partition
from autotest_lib.client.common_lib import error
fd_mgr = fsdev_mgr.FsdevManager()
_DISKPART_FILE = '/proc/partitions'
def get_disk_list(std_mounts_only=True):
# Get hold of the currently mounted file systems
moun... |
type = "passive"
def handler(fit, src, context):
fit.ship.boostItemAttr("shieldThermalDamageResonance", src.getModifiedItemAttr("shipBonusSupercarrierC2"),
skill="Caldari Carrier")
fit.ship.boostItemAttr("shieldEmDamageResonance", src.getModifiedItemAttr("shipBonusSupercarrierC2"),
... |
from django.views.generic import FormView
class ChangePassword(FormView):
pass
change_password = ChangePassword.as_view() |
../../../../../share/pyshared/papyon/sip/call_manager.py |
from django.conf.urls import url, include, patterns
from . import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
) |
from __future__ import absolute_import
from __future__ import unicode_literals
from gnuradio import gr, blocks
from . import fec_swig as fec
from .threaded_encoder import threaded_encoder
from .capillary_threaded_encoder import capillary_threaded_encoder
from .bitflip import read_bitlist
class extended_encoder(gr.hier_... |
import os
import csv
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Generate a lattice of pentagon case-control points",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('x_size', type=int, help="Number of ... |
import re
def mgo_text_split(query_text):
''' split text to support mongodb $text match on a phrase '''
sep = r'[`\-=~!@#$%^&*()_+\[\]{};\'\\:"|<,./<>?]'
word_lst = re.split(sep, query_text)
text_query = ' '.join('\"{}\"'.format(w) for w in word_lst)
return text_query
def querylogic(list):
query... |
liste = [0, "foo"] # type: list
print(liste)
String = "ABCDEFGHIJ"
print(list(String))
element = liste[0]
print(element)
l = len(liste) # type: int
print(l)
liste.append("bar")
liste += ["bar"] # tut das gleiche
print(liste)
liste.insert(0, "test")
print(liste)
liste.pop()
print(liste)
del liste[1]
liste.remove('bar')... |
from collections import namedtuple
from math import pi
import pygame
TOTAL_MASS = 20 # Made up units
TOTAL_HEIGHT = 350 # Pygame pixels
STARTING_SPEED = 0, 0 # pixels/sec?
BASE_STRENGTH = 1500000
mass_fractions = {
"head": 0.0826,
"torso": 0.551,
"upper_arm": 0.0325,
"forearm": 0.0187 + 0.0065, # In... |
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 pr... |
from ImageScripter import *
from elan import *
raise ValueError('fff')
Viewer.Start()
Viewer.CloseAndClean()
Configurator.Start()
Configurator.inputoutput.Click()
addNewComDev(ComType = "Standard Connection",HardwareType = "Serial Port",Comport = '0')
addNewDevice(Configurator.genericserialdevices,"Generic Serial Devic... |
from abjad import *
def test_pitchtools_PitchArrayCell_pitches_01():
array = pitchtools.PitchArray([[1, 2, 1], [2, 1, 1]])
array[0].cells[0].pitches.append(NamedPitch(0))
array[0].cells[1].pitches.append(NamedPitch(2))
'''
[c'] [d' ] []
[ ] [] []
'''
assert array[0].cells[0].... |
from setuptools import setup, find_packages
from trackma import utils
try:
LONG_DESCRIPTION = open("README.rst").read()
except IOError:
LONG_DESCRIPTION = __doc__
NAME = "Trackma"
REQUIREMENTS = []
EXTRA_REQUIREMENTS = {
'curses': ['urwid'],
'GTK': ['pygobject'],
'Qt': [],
}
setup(
name=NAME,
... |
import dia
import string
import re
import datetime
class SQLRenderer:
def __init__(self):
self.f = None
def begin_render(self, data, filename):
self.f = open(filename, "w")
# name = os.path.split(filename)[1]
self.f.write('''BEGIN TRANSACTION;\n''')
for layer in data.laye... |
from __future__ import unicode_literals, absolute_import
from flask import render_template, request
from operator import attrgetter
from indico.core import signals
from indico.util.signals import named_objects_from_signal
from indico.util.struct.iterables import group_list
from indico.util.string import return_ascii, f... |
type = "passive"
def handler(fit, ship, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Missile Launcher Heavy",
"speed", ship.getModifiedItemAttr("shipBonusATC1")) |
from test_settings import Settings
class TestCase(Settings):
def test_sidebar(self):
# Ayarlari yapiyor.
self.do_settings()
# Genel'e tikliyor.
self.driver.find_element_by_css_selector(
'li.ng-binding:nth-child(3) > a:nth-child(1) > span:nth-child(2)').click()
# O... |
import os
import shutil
from tempfile import mkdtemp
import wx
from outwiker.core.attachment import Attachment
from outwiker.core.tree import WikiDocument
from outwiker.pages.text.textpage import TextPageFactory
from outwiker.core.application import Application
from outwiker.core.attachwatcher import AttachWatcher
from... |
import bpy
from ....utils import MetarigError
from ....utils import create_widget, copy_bone
from ....utils import strip_org
from .limb_utils import *
from ..super_widgets import create_hand_widget
from rna_prop_ui import rna_idprop_ui_prop_get
def create_arm( cls, bones ):
org_bones = cls... |
'''
**Scaling of longitudinal beam and machine parameters, with user interface.**
:Authors: **Konstantinos Iliakis**, **Helga Timko**
'''
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.Qt import QButtonGroup, QHBoxLayout, QGroupBox
from scipy import integrate
from scipy.constants import m_p, e, c
import numpy as... |
import os
import time
import hashlib
import logging
from base64 import b64encode
from collections import OrderedDict, defaultdict
from twisted.internet.task import LoopingCall
from twisted.internet.defer import Deferred
from dispersy.authentication import MemberAuthentication
from dispersy.candidate import Candidate
fr... |
"""
oauthlib.oauth2.rfc6749.endpoint.introspect
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An implementation of the OAuth 2.0 `Token Introspection`.
.. _`Token Introspection`: https://tools.ietf.org/html/rfc7662
"""
from __future__ import absolute_import, unicode_literals
import json
import logging
from oauthlib.commo... |
import socket
import threading
import hashlib
import base64
import json
class BadWSRequest(Exception):
pass
class BadWSFrame(Exception):
pass
class BadCmdCall(Exception):
pass
class BadCmdParam(Exception):
pass
class Client(threading.Thread):
_MAGIC_STRING = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
... |
import logging
import requests
import yaml
PARTS_URI = 'https://wiki.ubuntu.com/Snappy/Parts'
PARTS_URI_PARAMS = {'action': 'raw'}
_WIKI_OPEN = '{{{'
_WIKI_CLOSE = '}}}'
logging.getLogger("urllib3").setLevel(logging.CRITICAL)
class Wiki:
wiki_parts = None
def _fetch(self):
if self.wiki_parts is None:
... |
"""
This module provides methods that parse variables into
one of the three base level variable types. We map the
variable type names to methods that can handle them. Each
method consumes a Request object 'rq' as the first positional
argument, and does its work by calling one of the variable-setting
methods on rq.
"""
... |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of t... |
from __future__ import print_function
import numpy as np
h, l, c = np.loadtxt('data.csv', delimiter=',', usecols=(4, 5, 6), unpack=True)
N = 5
h = h[-N:]
l = l[-N:]
print("len(h)", len(h), "len(l)", len(l))
print("Close", c)
previousclose = c[-N -1: -1]
print("len(previousclose)", len(previousclose))
print("Previous cl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.