code
stringlengths
1
199k
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('imager_profile', '0004_auto_20150802_0153'), ] operations = [ migrations.RemoveField( model_name='imagerprofile', name='name', ...
from Tkinter import * def main(): """Main""" root = Tk() label = Label(root, text="Hello, world!") label.pack() root.mainloop() if __name__ == "__main__": # Executes only if run as script main()
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_marooned_pirate_tran_m.iff" result.attribute_template_id = 9 result.stfName("npc_name","trandoshan_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
"""Query the switch for configured queues on a port.""" from pyof.foundation.base import GenericMessage from pyof.foundation.basic_types import Pad, UBInt32 from pyof.v0x04.common.header import Header, Type from pyof.v0x04.common.port import PortNo __all__ = ('QueueGetConfigRequest',) class QueueGetConfigRequest(Generi...
" This sub-module provides 'sequence awareness' for blessed." __author__ = 'Jeff Quast <contact@jeffquast.com>' __license__ = 'MIT' __all__ = ('init_sequence_patterns', 'Sequence', 'SequenceTextWrapper',) import functools import textwrap import warnings import math import sys import re from ._binterms import binary_ter...
""" This module define a widget that displays icons to launch softwares or commands when clicked -- a launchbar. Only png icon files are displayed, not xpm because cairo doesn't support loading of xpm file. The order of displaying (from left to right) is in the order of the list. If no icon was found for the name provi...
import os DEBUG = True BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = 'REPLACE_ME_BEFORE_PRODUCTION' ALLOWED_HOSTS = ['.spades.com'] AUTH_USER_MODEL = 'deck.User' STATICFILES_DIRS = ( os.path.join(BASE_DIR, "static"), ) INSTALLED_APPS = ( 'django.contrib.admin', 'django....
"""Provides all the generic data related to the personal information.""" from typing import Tuple BLOOD_GROUPS = ( "O+", "A+", "B+", "AB+", "O−", "A−", "B−", "AB−", ) GENDER_SYMBOLS: Tuple[str, str, str] = ( "♂", "♀", "⚲", ) USERNAMES = [ "aaa", "aaron", "abandone...
from agrc import logging import unittest import sys import datetime import os import shutil from mock import Mock, patch class LoggerTests(unittest.TestCase): logTxt = 'test log text' erTxt = 'test error text' def setUp(self): self.logger = logging.Logger() def tearDown(self): del self.l...
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): # Adding model 'LaunchWindow' db.create_table(u'launch_window_launchwindow', ( (u'id', s...
import logging logger = logging.getLogger("sikteeri.views") from django.conf import settings from django.shortcuts import render_to_response, redirect from django.template import RequestContext from django.utils.translation import ugettext_lazy as _ from sikteeri.version import VERSION def frontpage(request): if se...
from __future__ import unicode_literals try: import sphinxcontrib.gist # NOQA extensions = ['sphinxcontrib.gist'] except ImportError: extensions = [] templates_path = ['_templates'] source_suffix = '.txt' master_doc = 'index' project = 'Nikola' copyright = '2012-2015, The Nikola Contributors' version = '7....
""" ******************************************************************************** Learn Python the Hard Way Third Edition, by Zed A. Shaw ISBN: 978-0321884916 ******************************************************************************** """ import random from urllib import urlopen import sys WORD_URL ...
import logging from math import isclose try: # pragma: no cover import torch optim = torch.optim except ImportError: # pragma: no cover optim = None def pinverse(t): """ Computes the pseudo-inverse of a matrix using SVD. Parameters ---------- t: torch.tensor The matrix whose in...
import unittest from common import TestCase import pyuv class UtilTest(TestCase): def test_hrtime(self): r = pyuv.util.hrtime() self.assertTrue(r) def test_freemem(self): r = pyuv.util.get_free_memory() self.assertTrue(r) def test_totalmem(self): r = pyuv.util.get_tot...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/pants/shared_pants_s14.iff" result.attribute_template_id = 11 result.stfName("wearables_name","pants_s14") #### BEGIN MODIFICATIONS #### result.max_condition = 1000 #### END MODIFICATIONS #### retur...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/attachment/engine/shared_hutt_medium_engine_s02.iff" result.attribute_template_id = 8 result.stfName("item_n","ship_attachment") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
""" Automated tests for checking transformation algorithms (the models package). """ import logging import unittest import os import tempfile import itertools import bz2 import sys import numpy as np from gensim import utils, matutils from gensim.utils import check_output from subprocess import PIPE from gensim.models ...
from protocols.forms import forms from core.utils import SPEED_UNITS class CentrifugeForm(forms.VerbForm): name = "Centrifuge" slug = "centrifuge" has_machine = True # duration = forms.IntegerField(help_text='this is the minimal time this should take', initial = 'sec') # min_speed = forms.IntegerFie...
import scrapy from report_crawler.spiders.__Global_function import get_localtime from report_crawler.spiders.__Global_variable import now_time, end_time class HNU001_Spider(scrapy.Spider): name = 'HNU001' start_urls = ['http://csee.hnu.edu.cn/Front/TZXX_List?LMXX_BH=20130728174138ec48068e-48bf-49a6-ac51-27d04a9b1baa'...
""" This file contains the unit tests for the :mod:`communication` app. Since this app has no models there is model and view tests: * :class:`~communication.tests.CommunicationModelTests` * :class:`~communication.tests.CommunicationViewTests` """ from lab_website.tests import BasicTests from communication.models import...
from .proxy_only_resource import ProxyOnlyResource class Deployment(ProxyOnlyResource): """User crendentials used for publishing activity. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. ...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_commoner_naboo_human_female_07.iff" result.attribute_template_id = 9 result.stfName("npc_name","human_base_female") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
""" Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. """ class Solution: # @return a string def intToRoman(self, num): digits = [(1000, 'M'), (900, 'CM'), (500, 'D'), (400, 'CD' ), (100, 'C'), (90, 'XC'), (50, 'L'), (40, 'XL'),...
from django.db import models from django.conf import settings from django.core.exceptions import ValidationError from polymorphic import PolymorphicModel from django.db.models import F from django.core.urlresolvers import reverse from django.contrib.auth.models import User from celery.exceptions import SoftTimeLimitExc...
'''MobileNetV2 in PyTorch. See the paper "Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation" for more details. ''' import torch import torch.nn as nn import torch.nn.functional as F class Block(nn.Module): '''expand + depthwise + pointwise''' def __init__(...
import sys from os.path import * global G, Y, B, R, W , M , C , end def set_colors(): global G, Y, B, R, W , M , C , end if sys.platform.startswith('win'): # Windows deserve coloring too :D try: import win_unicode_console , colorama win_unicode_console.enable() colorama.init() #Now the unicode will wo...
from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/poi/shared_tatooine_swoop_large4.iff" result.attribute_template_id = -1 result.stfName("poi_n","base_poi_building") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
""" Django settings for lwc project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ...
import rospy from flexbe_core import EventState, Logger from flexbe_core.proxy import ProxySubscriberCached from sensor_msgs.msg import PointCloud2 class StorePointcloudState(EventState): ''' Stores the latest pointcloud of the given topic. -- topic string The topic on which to listen for the pointcloud. #> po...
import sublime HOST_PLATFORM = sublime.platform() WINDOWS = 'windows' LINUX = 'linux' OSX = 'osx'
"""Write worksheets to xml representations in an optimized way""" import datetime import os from tempfile import NamedTemporaryFile from openpyxl.shared.compat import OrderedDict from openpyxl.cell import get_column_letter, Cell from openpyxl.worksheet import Worksheet from openpyxl.shared.xmltools import (XMLGenerato...
import frappe, unittest from frappe.defaults import * class TestDefaults(unittest.TestCase): def test_global(self): clear_user_default("key1") set_global_default("key1", "value1") self.assertEqual(get_global_default("key1"), "value1") set_global_default("key1", "value2") self.assertEqual(get_global_default("...
from gluon import current from s3 import * from s3layouts import * try: from .layouts import * except ImportError: pass import s3menus as default red_cross_filter = {"organisation.organisation_type_id$name" : "Red Cross / Red Crescent"} class S3MainMenu(default.S3MainMenu): """ Custom Application Main Menu ...
import tensorflow as tf class Seq2Seq: logits = None outputs = None cost = None train_op = None def __init__(self, vocab_size, n_hidden=128, n_layers=3): self.learning_late = 0.001 self.vocab_size = vocab_size self.n_hidden = n_hidden self.n_layers = n_layers ...
from __future__ import unicode_literals from django.apps import AppConfig class ScannerEngineConfig(AppConfig): name = 'scanner_engine'
place_time = { "1" : "United Kingdom, London, MI6 / fri 28 august, 3:50 a.m.", "2" : "London, agent Harry's House / fri 28 august, 3:55 a.m.", "3" : "Ireland, Dublin, agent Patrick's House / fri 28 august, 9:45 a.m.", "4" : "Ireland, Dublin, agent Patrick's House / fri 28 august, 11:30 a.m.", "5" : "Ireland, Dubli...
import datetime import time from random import choice import discord import lifesaver from discord.ext import commands from lifesaver.bot.storage import AsyncJSONStorage from lifesaver.utils import ( ListPaginator, clean_mentions, human_delta, pluralize, truncate, ) from .converters import Messages,...
from msrest.serialization import Model class ApplicationGatewaySku(Model): """SKU of an application gateway. :param name: Name of an application gateway SKU. Possible values are: 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', and 'WAF_Large'. Possible values include: 'Standard_Sm...
""" @author: Rinze de Laat Copyright © 2013 Rinze de Laat, Delmic This file is part of Odemis. Odemis 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. Odemis is distributed in the hope that it will be use...
from django.test import TestCase from django.test.utils import override_settings from rest_framework import status from rest_framework.test import APIClient from axes.signals import user_locked_out import json import time from family_tree.models.family import Family from family_tree.models.person import Person from cus...
"""A lexical analyzer class for simple shell-like syntaxes. This version has been modified slightly to work better with unicode. It was forked from the version of shlex that ships with python 3.2.2. A few minor features and functions have been added. """ import os.path import sys from collections import deque ...
"""Read a STL file and do simple manipulations""" from os import path from PyFoam.Error import error from PyFoam.ThirdParty.six import next as iterNext class STLFile(object): """Store a complete STL-file and do simple manipulations with it""" noName="<no name given>" def __init__(self,fName=None): "...
"""Profile of the User connecting to the service, as well as the profile of contacts in his/her contact list. @sort: Profile, Contact, Group, ClientCapabilities @group Enums: Presence, Membership, Privacy, NetworkID @sort: Presence, Membership, Privacy, NetworkID""" from papyon.util.decorator import rw_prop...
"""Registry definition for fixture datasets.""" from flask.ext.registry import RegistryProxy from invenio.ext.registry import ModuleAutoDiscoveryRegistry from invenio.utils.datastructures import LazyDict fixtures_proxy = RegistryProxy( 'fixtures', ModuleAutoDiscoveryRegistry, 'fixtures') def fixtures_loader(): ...
""" Created on 17 Aug 2012 @author: Éric Piel Copyright © 2012 Éric Piel, Delmic This file is part of Odemis. Odemis 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. Odemis is distributed in the hope that...
""" VirtualBox Validation Kit - Additions Basics #1. """ __copyright__ = \ """ Copyright (C) 2010-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify it under the terms of the GN...
""" Script to cache anonymous houseprint data into hp_anonymous.pkl Created on 05/07/2014 by Roel De Coninck """ import os, sys import inspect script_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) sys.path.append(os.path.join(script_dir, os.pardir, os.pardir)) from opengrid.library.hous...
import dis def myFunc(): x = 1 y = 2 z = 'abc' # noqa return x + y print(myFunc.__name__) print(myFunc.__code__.co_varnames) print(myFunc.__code__.co_consts) print(myFunc.__code__.co_code) dis.disassemble(myFunc.__code__)
""" sphinx.directives ~~~~~~~~~~~~~~~~~ Handlers for additional ReST directives. :copyright: 2007-2008 by Georg Brandl. :license: BSD. """ import re import sys import string import posixpath from os import path from docutils import nodes from docutils.parsers.rst import directives from sphinx import...
import copy import string import sys from spacewalk.common.usix import raise_with_tb from spacewalk.common import rhn_rpm from spacewalk.common.rhnConfig import CFG from spacewalk.common.rhnException import rhnFault from spacewalk.server import rhnSQL, rhnChannel, taskomatic from importLib import Diff, Package, Incompl...
from test import test_support import unittest import sys import difflib import gc def basic(): return 1 basic.events = [(0, 'call'), (1, 'line'), (1, 'return')] def arigo_example(): x = 1 del x while 0: pass x = 1 arigo_example.events = [(0, 'call'), ...
import os import re import shutil import tempfile import urllib import urllib2 try: from python_libtorrent import get_libtorrent lt = get_libtorrent() except Exception, e: import libtorrent as lt import xbmc import xbmcgui from core import config from core import scrapertools from core import filetools def ...
"""WebSearch Flask Blueprint.""" import cStringIO from functools import wraps from flask import g, render_template, request, flash, redirect, url_for, \ current_app, abort, Blueprint, send_file from flask_breadcrumbs import register_breadcrumb from flask_breadcrumbs import default_breadcrumb_root from flask_login i...
__license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' """ Edit metadata in RTF files. """ import re, cStringIO, codecs from calibre import force_unicode from calibre.ebooks.metadata import MetaInformation, string_to_authors title_pat = re.compile(r'\{\\info.*?\{\\title(.*?)(?<!\\)\}'...
''' Functions to determine which resources to update. ''' import datetime import logging import tornado.log import iso8601 LOG_LEVEL = logging.DEBUG _log = tornado.log.app_log def _now_wrapper(): ''' A wrapper function for datetime.datetime.utcnow() that can be mocked for automated tests. ''' return dat...
import re import six import requests import base64 from json import dumps from json import loads from .NotifyBase import NotifyBase from ..URLBase import PrivacyMode from ..common import NotifyType from ..utils import parse_list from ..utils import parse_bool from ..AppriseLocale import gettext_lazy as _ D7NETWORKS_HTT...
type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Small Projectile Turret"), "maxRange", ship.getModifiedItemAttr("shipBonusMF"), skill="Minmatar Frigate")
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 M2M table for field followed_by on 'Exercise' db.delete_table('exercise_followed_by') def backwards(self, orm): ...
"""Unittests reading various PPS data files """ import os import unittest from pypps_reader import NwcSafPpsData class Test(unittest.TestCase): """Unit testing the pps reading""" def setUp(self): """Set up""" return def test_read(self): """Test that it is possible to read pps product...
import os import sys import signal import logging import pytest import latus.logger import test_latus.tstutil os.environ["PYTHONPATH"] = '.' g_keep_running = True def control_key_handler(signal, frame): global g_keep_running print('%s : ctrl-c detected - exiting' % __file__) g_keep_running = False def run_p...
from __future__ import unicode_literals import logging import babelfish import requests from . import Provider from .. import __version__ from ..exceptions import InvalidSubtitle, ProviderNotAvailable, ProviderError from ..subtitle import Subtitle, is_valid_subtitle, detect logger = logging.getLogger(__name__) class Th...
del x
from odoo import api, models, _ class ResCompany(models.Model): _inherit = "res.company" @api.model def create(self, vals): new_company = super(ResCompany, self).create(vals) ProductPricelist = self.env['product.pricelist'] pricelist = ProductPricelist.search([('currency_id', '=', ne...
from __future__ import absolute_import from django.contrib.auth.models import User, Group from navigation.api import register_multi_item_links from navigation.classes import Link from project_setup.api import register_setup from .links import (user_list, user_setup, user_edit, user_add, user_delete, user_multiple_d...
import keystoneclient.v2_0.client as keystone from keystoneauth1.identity import v2 from keystoneauth1 import session import novaclient.client as nova import cinderclient.client as cinder from glanceclient.v1 import client as glance import neutronclient.v2_0.client as neutron import heatclient.client as heat import tim...
import re import os from typing import ( NamedTuple, Optional ) from kiwi.command import Command from kiwi.exceptions import KiwiKernelLookupError kernel_type = NamedTuple( 'kernel_type', [ ('name', str), ('filename', str), ('version', str) ] ) xen_hypervisor_type = NamedTuple( '...
from __future__ import absolute_import import csv from copy import copy from typing import List, Dict import typesystem from .types import PartialActor, ActorIssue, PartialIssue, IssuePosition, IssueDescription, Comment types = { PartialActor.starts_with: PartialActor, ActorIssue.starts_with: ActorIssue, Pa...
""" Created on Fri Mar 30 09:53:39 2018 @author: mayank """ from forms import SignupForm from flask import Flask, request, render_template from flask_login import LoginManager, login_user, login_required, logout_user app = Flask(__name__) app.secret_key = 'gMALVWEuxBSxQ44bomDOsWniejrPbhDV' app.config['SQLALCHEMY_DATABA...
import unittest import numpy as np from numpy.testing import assert_array_equal from dgw.evaluation.resampling import extend_point, shrink_to_a_single_point class TestExtending(unittest.TestCase): def test_extend_point(self): a = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) ans = np.array([0, 1, 2, ...
""" Module implementing a dialog for editing IRC network definitions. """ from __future__ import unicode_literals import copy from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QTreeWidgetItem from E5Gui import E5MessageBox from .Ui_IrcNetworkEditDialog import Ui_IrcNetworkEditDial...
from setuptools import find_packages, setup __plugin_name__ = "WebUi" __author__ = "Damien Churchill" __author_email__ = "damoxc@gmail.com" __version__ = "0.1" __url__ = "http://deluge-torrent.org" __license__ = "GPLv3" __description__ = "Allows starting the web interface within the daemon." __long_description__ = """"...
__doc__ = """External interface to the BeautifulSoup HTML parser. """ __all__ = ["fromstring", "parse", "convert_tree"] from lxml import etree, html from calibre.ebooks.BeautifulSoup import \ BeautifulSoup, Tag, Comment, ProcessingInstruction, NavigableString def fromstring(data, beautifulsoup=None, makeelement=No...
""" Filter Xroar trace files. see README for more information. :created: 2014 by Jens Diemer - www.jensdiemer.de :license: GNU GPL v3 or above, see LICENSE for more details. """ import os import time import sys import argparse class XroarTraceFilter(object): def __init__(self, infile, outfile): ...
''' Created on 08/09/2012 @author: Luis Ariel Vega Soliz (ariel.vega@uremix.org) @contact: Uremix Team (http://uremix.org) '''
../../../../../../share/pyshared/mx/DateTime/mxDateTime/test.py
from spec.python import db_connection import sam.common import sam.constants import web app = web.application(sam.constants.urls, globals(), autoreload=False) sam.common.session_store = web.session.DBStore(db_connection.db, 'sessions') sam.common.session = web.session.Session(app, sam.common.session_store) def test_404...
async def ev_mention(ev, message): def_stat_data = { 'event': 'mention', 'count': 0 } collection = 'EventStats' database = ev.bot.cfg.db.database check = ev.db[database][collection].find_one({"event": 'mention'}) if not check: ev.db[database][collection].insert_one(def_st...
from setuptools import setup PACKAGE_NAME = 'mozdevice' PACKAGE_VERSION = '0.44' deps = ['mozfile >= 1.0', 'mozlog >= 2.1', 'moznetwork >= 0.24', 'mozprocess >= 0.19', ] setup(name=PACKAGE_NAME, version=PACKAGE_VERSION, description="Mozilla-authored device management", l...
""" By default, this module uses the pre-built Ember model from https://pubdata.endgame.com/ember/ember_dataset.tar.bz2. Documentation about training a new model can be found on the Ember GitHub page (https://github.com/endgameinc/ember). After training a new model, place the resulting txt file in `multiscanner/etc` an...
import json from . import check_input_attribute, standard_error_message from pyipasnhistory import IPASNHistory from pymisp import MISPAttribute, MISPEvent, MISPObject misperrors = {'error': 'Error'} mispattributes = {'input': ['ip-src', 'ip-dst'], 'format': 'misp_standard'} moduleinfo = {'version': '0.2', 'author': 'R...
import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('base', '0526_unique_together_groupelementyear'), ] operations = [ migrations.AlterField( model_name='groupelementyear', name='parent', ...
from . import models
import re from . import unit_base from decimal import Decimal from flask_babel import lazy_gettext def convert(feet, inches): """Converts from feet and inches to cm or m If feet contains '-' then inches won't have '-' If inches contains '-' then feet value will be 0 :param feet: Feet value in string ...
from yaml import dump from twisted.internet.defer import succeed, fail from txaws.s3.exception import S3Error from juju.lib.testing import TestCase from juju.providers.ec2.tests.common import EC2TestMixin class EC2StateTest(TestCase, EC2TestMixin): def setUp(self): EC2TestMixin.setUp(self) super(EC2...
import json import unittest try: # NOTE need to import capnp first to activate the magic necessary for # PythonDummyRegion_capnp, etc. import capnp except ImportError: capnp = None else: from nupic.proto.NetworkProto_capnp import NetworkProto import nupic.bindings.engine_internal as engine from nupic.bindings...
import urllib2 import re def get_glossary(res_num): html_lowered = res_num.lower(); begin = html_lowered.find('<!-- .alphabet -->') end = html_lowered.find('<!-- .idx-1 -->') if begin == -1 or end == -1: return None else: return res_num[begin+len('<!-- .alphabet -->'):end].strip() def get_title(res_num): html...
__title__ = "Command GMSH Mesh From Shape" __author__ = "Bernd Hahnebach" __url__ = "http://www.freecadweb.org" import FreeCAD from FemCommands import FemCommands import FreeCADGui import FemGui from PySide import QtCore class _CommandFemMeshGmshFromShape(FemCommands): # the FEM_MeshGmshFromShape command definition...
import glob import os import sys import unittest import common if len(sys.argv) > 1: builddir = sys.argv[1] no_import_hooks = True else: builddir = '..' no_import_hooks = False common.run_import_tests(builddir, no_import_hooks) SKIP_FILES = ['common', 'runtests'] dir = os.path.split(os.path.abspath(__fi...
from yandextank.plugins.Aggregator import SecondAggregateData from yandextank.plugins.Autostop import AutostopPlugin from Tank_Test import TankTestCase import tempfile import unittest class AutostopTestCase(TankTestCase): def setUp(self): core = self.get_core() core.load_configs(['config/autostop.co...
""" Driver for EPSON Esc/P and Esc/P2 printers. """ import struct ESC = '\x1b' CMD_INIT = '@' CMD_PRINT_QUALITY = 'x' CMD_PROPORTIONAL = 'p' CMD_FORM_FEED = '\xff' CMD_EJECT = '\x19' QUALITY_DRAFT = '0' QUALITY_LQ = '1' QUALITY_NLQ = '1' class EscPPrinter(object): def __init__(self, device): self.device = d...
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobileTe...
import sys from resources.datatables import Options from resources.datatables import State def addPlanetSpawns(core, planet): stcSvc = core.staticService objSvc = core.objectService stcSvc.spawnObject('romovax_henchman', 'tatooine', long(0), float(-5079.1), float(47.9), float(-6970.5), float(0), float(0), float(0), ...
""" Azure Utility Classes """ import os import re import time import base64 import string import tempfile import fnmatch from azure import * from azure.servicemanagement import * from pprint import pprint from tethyscluster import image from tethyscluster import utils from tethyscluster import static from tethyscluster...
import logging from django.core.management.base import BaseCommand from django.apps import apps from django.db import connection from django_pgviews.view import clear_view, View, MaterializedView log = logging.getLogger('django_pgviews.sync_pgviews') class Command(BaseCommand): help = """Clear Postgres views. Use t...
import numpy as np import pylab p1, p2, p3, p4 = (50 - 30j, 18 + 8j, 12 - 10j, -14 - 60j ) p5 = 40 + 20j # eyepiece def fourier(t, C): f = np.zeros(t.shape) A, B = C.real, C.imag for k in range(len(C)): f = f + A[k]*np.cos(k*t) + B[k]*np.sin(k*t) return f def elephant(t, p1, p2, p3, p4, p5): ...
"""Functional tests for convolutional operations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import os import time import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.contrib import l...
""" Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.enums import PRIORITY __priority__ = PRIORITY.LOW def dependencies(): pass def tamper(payload, **kwargs): """ Replaces space character (' ') with comments '/**/' Tested ...
from nailgun.db.sqlalchemy.models.cluster_plugin_link import ClusterPluginLink from nailgun.test.base import BaseIntegrationTest from nailgun.utils import reverse from oslo_serialization import jsonutils class TestHandlers(BaseIntegrationTest): def setUp(self): super(TestHandlers, self).setUp() self...
"""Tests for tensorflow.ops.tf.scatter_nd.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import numpy as np from tensorflow.python.client import session from tensorflow.python.eager import context from tensorflow.python.framework import ...