src
stringlengths
721
1.04M
#!/usr/bin/env python import sncosmo.models import numpy class SEDFileSource(sncosmo.models.TimeSeriesSource): """A TimeSeriesSource stored in a 3-column ASCII file format, for PHASE, LAMBDA, and F_LAMBDA. The hash symbol # is a comment line. The spectral flux density of this model is given by .....
# -*- coding: utf-8 -*- from itertools import groupby from functools import reduce from . import QuerySetFilter, ValuesDictFilter from .utils import CallablesList class QuerysetIterationHook(QuerySetFilter): def __init__(self, hook_function): self.hook_function = hook_function def __and__(...
import cgi import csv import datetime import json import re import oauth2 class Cell: def __init__(self, xml): self.row = xml['gs$cell']['row'] self.col = xml['gs$cell']['col'] self.value = xml['gs$cell']['inputValue'] self.edit_url = (l['href'] for l in xml['link'] if 'edit' == l['rel']).next() d...
""" Set operations for 1D numeric arrays based on sorting. Contains: ediff1d, unique1d, intersect1d, intersect1d_nu, setxor1d, setmember1d, union1d, setdiff1d All functions work best with integer numerical arrays on input (e.g. indices). For floating point arrays, innacurate results may appear due to ...
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase from labels.models import MuseumObject, DigitalLabel, Portal, TextLabel, Image, \ ...
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
# # ploop disk hauler # import logging import os import shutil import threading import libploop import iters import mstats DDXML_FILENAME = "DiskDescriptor.xml" def get_ddxml_path(path): """Get path to disk descriptor file by path to disk delta or directory""" p = path if os.path.isdir(path) else os.path.dirna...
# -*- coding: utf-8 -*- # Import Elasticsearch library import elasticsearch from elasticsearch_dsl import Search, Q, A # Import advanced python collections import collections # Import global functions from global_functions import escape #----------------- Main Functions -------------------# def tls_classification_s...
##################################################################### # objid.py # # (c) Copyright 2021, Benjamin Parzella. All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foun...
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2017 Intel Corp. # import os import sys import base64 import uuid from cherrypy.test import helper from oobrestserver.Application import Application from oobrestserver.Authenticator import Authenticator class TestServer(helper.CPWebCase): app = None @staticm...
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
""" Jedi is a static analysis tool for Python that can be used in IDEs/editors. Its historic focus is autocompletion, but does static analysis for now as well. Jedi is fast and is very well tested. It understands Python on a deeper level than all other static analysis frameworks for Python. Jedi has support for two di...
# -*- coding: utf-8 -*- # # acs-cte documentation build configuration file, created by # sphinx-quickstart on Fri Dec 20 10:46:26 2013. # # 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 file. # # All...
# # Poly2Tri # Copyright (c) 2009, Mason Green # http://code.google.com/p/poly2tri/ # # 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 co...
""" Django settings for athletica 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, ...) ...
#!/usr/bin/python3 ## Class.py for super_zappy in /home/aracthor/programs/projects/hub/super_zappy/ia/python ## ## Made by aracthor ## Login <aracthor@epitech.net> ## ## Started on Wed Feb 25 09:13:41 2015 aracthor ## Last Update Wed Feb 25 09:20:14 2015 aracthor ## from Enums import EAction class Class: ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 S2S Network Consultoria e Tecnologia da Informacao LTDA # # Author: Tianwei Liu <liutianweidlut@gmail.com> # # 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...
import math import time def primeGenerate(number): largest = number prime_list = largest*[1] if (number<4): return [2,3] prime_list[1] = 0 for i in range(0,largest,2): prime_list[i] = 0 prime_list[2] = 1 for i in range(3,largest,2): if (prime_list[i] == 1): ...
'''Schema description module''' import copy from pgdocgen.ddlobject.ddlobject import DDLObject from pgdocgen.utils import get_logger class Schema(DDLObject): '''SQL schema class''' contents = [] def read_contents(self, name, conn): '''Read schema tables''' sql = '''select c.relname, ...
# -*- coding: utf-8 -*- ################################################################## # pyHTTPd # $Id$ # (c) 2006 by Tim Taubert ################################################################## import os, sys, socket, time, mimetools from mimetypes import MimeTypes from baseConfig import pConfig import baseRo...
from __future__ import absolute_import from .TreeFragment import parse_from_strings, StringParseContext from . import Symtab from . import Naming from . import Code class NonManglingModuleScope(Symtab.ModuleScope): cpp = False def __init__(self, prefix, *args, **kw): self.prefix = prefix se...
# coding: utf-8 """ Wavefront REST API <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ...
""" Module holds base stuff regarding JMX format Copyright 2015 BlazeMeter 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 ap...
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) #...
''' Created on May 30, 2015 @author: isdal ''' import logging import unittest import sys from fancontroller import Thermostat, STATE_OFF, STATE_ON from fancontroller.filters import MedianFilter from fancontroller.fan_controller import NoaaForecast import json logger = logging.getLogger() logger.level = logging.DEBU...
#!/usr/bin/python import MySQLdb import json from ConfigParser import ConfigParser LIMIT = 7 user_and_client_stat_columns = ('TOTAL_CONNECTIONS', 'CONCURRENT_CONNECTIONS', 'CONNECTED_TIME', 'BUSY_TIME', 'CPU_TIME', 'BYTES_RECEIVED', 'BYTES_SENT', 'BINLOG_BYTES_WRITTEN', 'ROWS_READ', 'ROWS_SENT', 'ROWS_DELETED', 'ROWS...
import dragonfly import dragonfly.pandahive import bee from bee import connect import dragonfly.scene.unbound, dragonfly.scene.bound import dragonfly.std import dragonfly.io import dragonfly.canvas import dragonfly.convert.pull import dragonfly.logic import dragonfly.bind import dragonfly.op.pull import Spyder # ## ...
__author__ = 'srkiyengar' import pygame #Acknowledgement - code modified from http://www.pygame.org/docs/ sample # Define some colors BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) RED = (255, 0, 0) # This is a simple class that will help us print to the screen # It has nothing to do with the joyst...
"""add_modified_at_to_users_and_kernels Revision ID: e35332f8d23d Revises: da24ff520049 Create Date: 2020-07-01 14:02:11.022032 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql from sqlalchemy.sql.expression import bindparam from ai.backend.manager.models.base import conv...
import os import sys from typing import Dict, List, Optional, Tuple from bs4 import BeautifulSoup from bs4.element import Tag from shared import fetch_tools, lazy def search_scryfall(query: str) -> Tuple[int, List[str], List[str]]: """Returns a tuple. First member is an integer indicating how many cards match t...
""" Copyright (c) 2017 Eric Shook. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. @author: eshook (Eric Shook, eshook@gmail.edu) @contributors: <Contribute and add your name here!> """ from forest import * import unittest # Test forest/bobs/Bob.p...
import os import unittest from bubblenet.errors import AddressParseError from bubblenet.addresses import ( Address, IPAddress, IPv4Address, IPv6Address, UnixSocketAddress, ) class ParsingTest(unittest.TestCase): # Test cases taken from https://en.wikipedia.org/wiki/Module:IP...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you c...
# -*- coding: utf-8 -*- """ Test the HTTP upgrade phase of connection """ import base64 import email import random import sys from wsproto.connection import WSConnection, CLIENT, SERVER from wsproto.events import ( ConnectionEstablished, ConnectionFailed, ConnectionRequested ) IS_PYTHON3 = sys.version_info >= (...
# 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 ...
#!/usr/bin/env python # Copyright 2019 The Kubernetes 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 appli...
# An Inplace function to rotate a N x N matrix by 90 degrees # In both clockwise and counter clockwise direction class Solution(object): def Rotate90Clock(self, mat): N = len(mat) for x in range(int(N/2)): for y in range(x, N-x-1): temp = mat[x][y] '''...
# standard library imports import datetime import mimetypes import os import re import time import urllib # nonstandard libraries import magic import pytz import web # my imports import config import forms import model #TODO: transactions? urls = ( '/', 'index', # some form targets '/searchpt', 'searc...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.exceptions import ObjectDoesNotExist from django.db import models, migrations def itemCharacterToCharacterItemModel(apps, schema_editor): "copy the data of all M2M (Item x Character) in the CharacterItem Model" Item = apps.get_...
#!/usr/bin/env python3 import lxml.etree as ET import argparse from sdf_timing import sdfparse from sdf_timing.utils import get_scale_seconds from lib.pb_type import get_pb_type_chain import re import os import sys # Adds output to stderr to track if timing data for a particular BEL was found # in bels.json DEBUG = Fa...
# GromacsWrapper: test_amber03star.py # Copyright (c) 2009 Oliver Beckstein <orbeckst@gmail.com> # Released under the GNU Public License 3 (or higher, your choice) # See the file COPYING for details. from __future__ import division, absolute_import, print_function import pytest from gromacs.exceptions import Gromacs...
# 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 # distributed under t...
############################################################################## # 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...
import torch import torch.nn as nn import torch.nn.functional as F from ptsemseg.models.utils import FRRU, RU, conv2DBatchNormRelu, conv2DGroupNormRelu frrn_specs_dic = { "A": { "encoder": [[3, 96, 2], [4, 192, 4], [2, 384, 8], [2, 384, 16]], "decoder": [[2, 192, 8], [2, 192, 4], [2, 48, 2]], ...
import collections.abc import io import os import sys import errno import pathlib import pickle import socket import stat import tempfile import unittest from unittest import mock from test import support from test.support import TESTFN, FakePath try: import grp, pwd except ImportError: grp = pwd = None cla...
# Standard Library import os from gettext import gettext as _ # Lutris Modules from lutris.runners.runner import Runner from lutris.util import system class jzintv(Runner): human_name = _("jzIntv") description = _("Intellivision Emulator") platforms = [_("Intellivision")] runner_executable = "jzintv/...
#!/usr/bin/env python import sys import time import re import sys import uuid debugimport=False use_pyusb=False try: print "[blink1]: trying blink1_pyusb..." from blink1_pyusb import Blink1 as Blink1_pyusb print "[blink1]: using blink1_pyusb" use_pyusb = True #sys.modules['Blink1'] = blink1_pyus...
from __future__ import absolute_import from __future__ import print_function from chains.commandline.commands import Command import time import sys from six.moves import range class CommandAmqpSendmany(Command): def main(self, number=1000, dotEvery=10, numEvery=100): """ Flood message bus with events """ ...
#!/usr/bin/env python from setuptools import setup, find_packages import os, re PKG='pyzookeeper' VERSIONFILE = os.path.join('pyzookeeper', '_version.py') verstr = "unknown" try: verstrline = open(VERSIONFILE, "rt").read() except EnvironmentError: pass # Okay, there is no version file. else: MVSRE = r"^man...
from threading import Thread from time import sleep from pcaspy import Driver, SimpleServer class MotorTestDriver(Driver): prefix = 'PYSCAN:TEST:' pvdb = { 'MOTOR1:SET': {}, 'MOTOR1:GET': {}, 'MOTOR2:SET': {}, 'MOTOR2:GET': {}, 'MOTOR:PRE1:SET': {}, 'MOTOR:PRE1...
# Copyright 2016 - Nokia Corporation # # 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 ...
# (2/3/13) Get "dt" from source_file or sink_file vs. # channels comp, but what about canals ? ######################################################## # # Copyright (c) 2010-2017, Scott D. Peckham # # Feb. 2017. Changes to internal variable names. # Cleanup & testing with Test_Plane_Can...
import gzip import pytest import spindrift.http as http import spindrift.network as network PORT = 12345 class Context(object): def __init__(self): self.server = 0 self.client = 0 class Server(http.HTTPHandler): def on_http_data(self): self.context.server += 1 self.http_...
#! /usr/bin/env python # ========================================================================== # This scripts performs unit tests for the csworkflow script. # # Copyright (C) 2016-2018 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
from django.db import models, connection def pathstr(self): return ' '.join(map(str, (self.upper_id, self.lower_id, self.length))) def path_model(model): name = model.__name__ + 'Path' uniqueness = {'unique_together': [('upper', 'lower')]} attrs = { 'upper': models.ForeignKey(model, rela...
#!/usr/bin/env python """Vector clock class""" import copy # PART coreclass class VectorClock(object): def __init__(self): self.clock = {} # node => counter def update(self, node, counter): """Add a new node:counter value to a VectorClock.""" if node in self.clock and counter <= self...
from pathlib import Path from vesper.signal.signal_error import SignalError from vesper.signal.tests.test_signal import SignalTests from vesper.signal.time_axis import TimeAxis from vesper.signal.wave_file_signal import WaveFileSignal from vesper.tests.test_case import TestCase import vesper.signal.tests.utils as util...
#! /usr/bin/python # coding=utf-8 # # 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 t...
from subprocess import Popen import os import csv srcfile = "/" + input('File Input Name: ') dirpath = os.path.dirname(__file__) srcpath = os.path.dirname(__file__) + srcfile with open(srcpath, newline='') as f: reader = csv.reader(f) for row in reader: host = (row[0]) user = (row[1]) newpath = os.path.dir...
# GNU Solfege - free ear training software # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2011 Tom Cato Amundsen # # 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...
############################################################################## # 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...
#!/usr/bin/env python #-*- coding: utf8 -*- # # Copyright (C) 2012 Ruikai Liu <lrk700@gmail.com> # # This file is part of rbook. # # 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 ...
import lmfit from uncertainties import ufloat import pandas as pd from copy import deepcopy from pycqed.analysis import analysis_toolbox as a_tools from collections import OrderedDict from pycqed.analysis import measurement_analysis as ma_old import pycqed.analysis_v2.base_analysis as ba import numpy as np import loggi...
# -*- coding: utf-8 -*- """ remote_tail_utils module contains utilities for reading remote logs using 'tail'. - start_tailer: Starts a new thread reading the remote file. - stop_tailer: Stop the capturing. """ __author__ = "@jframos" __project__ = "python-qautils [https://github.com/qaenablers/pyt...
#!/usr/bin/python3 ################################ # File Name: test_list.py # Author: Chadd Williams # Date: 11/7/2014 # Class: CS 360 # Assignment: Lecture Examples # Purpose: build some tests that will be run by nosetests ##############################...
import datetime from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import s...
#!/usr/bin/env python3 # Copyright 2017 The Imaging Source Europe GmbH # # 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...
# -*- coding: utf-8 -*- """ This module shows how to program a command-line tool using plumbum. It consists of a tool named 'clt' (implemented in the class CommandLineTool) that has a single sub-command 'say'. >>> clt say --hello world dear world Depending on your preferences in ~/.clt_rc, your output may differ. I...
""" 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...
# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80: # kaizen - Continuously improve, build and manage free software # # Copyright (C) 2011 Björn Ricks <bjoern.ricks@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as publishe...
r"""OS routines for NT or Posix depending on what system we're on. This exports: - all functions from posix or nt, e.g. unlink, stat, etc. - os.path is either posixpath or ntpath - os.name is either 'posix' or 'nt' - os.curdir is a string representing the current directory (always '.') - os.pardir is a strin...
# -*- coding: 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): # Removing unique constraint on 'Question', fields ['simplified_question'] db.delete_unique('questions', ['s...
from battle.actions import * from character import Character class KiCharacter(Character): def __can_attack(self, battle): return False def __move_to_next_enemy(self, battle): current_tile = battle.tile(combatant=self) enemy_tiles = list() for tile in battle.grid.get_tiles():...
import requests import os import re import time from selenium import webdriver import multiprocessing import sys from socket import error as SocketError import errno import argparse import imghdr import uuid import csv import codecs import platform import downloader # define default chrome download path global default...
# # Copyright (C) 2016 Shang Yuanchun <idealities@gmail.com> # # You may 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. # # drummer is distributed in the hope ...
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Framework Package. This package holds all Data Management, and # Web-UI helpful to run brain-simulations. To use it, you also need do download # TheVirtualBrain-Scientific Package (for simulators). See content of the # documentation-folder for more details. See also http:/...
from __future__ import absolute_import from kafka.protocol.api import Request, Response from kafka.protocol.types import Array, Boolean, Bytes, Int8, Int16, Int32, Int64, Schema, String class ApiVersionResponse_v0(Response): API_KEY = 18 API_VERSION = 0 SCHEMA = Schema( ('error_code', Int16), ...
#!/usr/bin/python # 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) any later version. # # Ansible is distributed...
"""update to flask-diamond 0.2.0 Revision ID: 20f04b9598da Revises: cf0f5b45967 Create Date: 2015-02-07 22:54:24.608403 """ # revision identifiers, used by Alembic. revision = '20f04b9598da' down_revision = 'cf0f5b45967' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated...
from boxbranding import getImageVersion, getMachineBuild from sys import modules import socket, fcntl, struct def getVersionString(): return getImageVersion() def getFlashDateString(): try: f = open("/etc/install","r") flashdate = f.read() f.close() return flashdate except: return _("unknown") def getEn...
# -*- coding: utf-8 -*- """ This file is part of PyZ80. PyZ80 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. PyZ80 is distributed ...
""" pgoapi - Pokemon Go API Copyright (c) 2016 tjado <https://github.com/tejado> 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...
# -*- coding: 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 'Tract.B08301_001E' db.add_column('census_tract', 'B08301_001E', self.g...
#!/usr/bin/env python3 # Copyright (C) 2017-2020 The btclib developers # # This file is part of btclib. It is subject to the license terms in the # LICENSE file found in the top-level directory of this distribution. # # No part of btclib including this file, may be copied, modified, propagated, # or distributed except...
import logging import string from datetime import datetime from django.utils import timezone from django.core.exceptions import MultipleObjectsReturned from management.models import Contact, Group, Message from modules.texter import Texter from modules.utils import quote, add_contact_to_group, keywords_without_word f...
import unittest from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from statemanager import api import os from statemanager.error import NoStateDefinedError, NoWorkflowDefined class TestWorkflowState(unittest.TestCase): def setUp(self): engine = create_engine("sqlite://", echo=Fa...
import os import random import pygame as pg import util ''' Audio components. version: 1.0 author: Daniel O'Grady ''' MAX_SOUND_CHANNELS = 4 class AudioMixer(object): ''' Mixes ambient and effect sounds, where ambient sounds actually loop indefinitely while effects are just queued. There can be mu...
# -*- coding: utf-8 -*- from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder from django.contrib.auth.models import User class InformationChangeForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(Informati...
# # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of REDHAWK core. # # REDHAWK core is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free ...
# 6) Ensure tokens work from the email, and also clicking the # link in the email works. from sst.actions import ( assert_element, assert_title_contains, click_button, get_element, go_to, wait_for, write_textfield, ) from u1testutils import mail from u1testutils.sso import mail as sso_mail f...
import seamless from seamless.core import macro_mode_on from seamless.core import context, cell, macro mod_init = """ from .mod3 import testvalue """ mod1 = """ from . import testvalue def func(): return testvalue """ mod2 = """ from .mod1 import func """ mod3 = """ testvalue = 42 """ package = { "__init_...
# Plan a parallel copy using n workers into output shape s. # The algorithm requires prod(s) to be a multiple of n and # works by matching factors from n with those of s, # with preference to the right (for R) or left (for L). # This means as many workers as possible for the most sig. dimensions, # each doing as many c...
from django.core.urlresolvers import reverse from nose.tools import eq_, ok_ from test_utils import RequestFactory from amo.tests import app_factory, TestCase from versions.models import Version from mkt.versions.serializers import VersionSerializer class TestVersionSerializer(TestCase): def setUp(self): ...
# 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. # --------------------------------------------------------------------...
import sys import traceback import asyncio from apium.registry import get_driver from apium.config import Configurator from apium.proxy import apium @asyncio.coroutine def routine(future, config): try: Configurator.from_yaml(config) yield from get_driver().connect_broker() get_driver().at...
#!/usr/bin/env python # Inspired by https://github.com/ayust/kitnirc/blob/master/kitnirc/contrib/healthcheck.py # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Copyr...
# vim: set fileencoding=utf-8 """Common functions for GUI-related tests.""" from PIL import Image from os import path from src.litava import locate_on_screen_using_litava TYPING_INTERVAL = 0.25 DIRECTORY_WITH_REGIONS = "regions" OUTPUT_DIRECTORY = "." def perform_move_mouse_cursor(context, x=0, y=0): """Move...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014 NaviNet 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 # # ...
""" Import data from external RDBMS databases into Hive. """ import datetime import logging import textwrap import luigi from luigi.hive import HiveQueryTask, HivePartitionTarget from edx.analytics.tasks.sqoop import SqoopImportFromMysql from edx.analytics.tasks.url import url_path_join from edx.analytics.tasks.util....
# Copyright (C) 2015 Twitter, Inc. """Container for all plugable resource object logic used by the Ads API SDK.""" import dateutil.parser import json from datetime import datetime from twitter_ads.utils import format_time from twitter_ads.enum import ENTITY, TRANSFORM from twitter_ads.http import Request from twitte...