content
string
""" .. module stratumgs.config Loads the configuration and provides a method for accessing it. """ import configparser import os # The default value and type of each configuration parameter _CONFIG_VALUES = { "global": { "debug": (bool, True) }, "web_server": { "host": (str, ""), ...
from nose.tools import assert_equal import networkx as nx class TestBFS: def setUp(self): # simple graph G = nx.Graph() G.add_edges_from([(0, 1), (1, 2), (1, 3), (2, 4), (3, 4)]) self.G = G def test_successor(self): assert_equal(dict(nx.bfs_successors(self.G, source=0...
import re from reportlab import platypus from facturapdf import flowables, helper def element(item): elements = { 'framebreak': {'class': platypus.FrameBreak}, 'simpleline': {'class': flowables.SimpleLine, 'cast': {0: float, 1: float}}, 'paragraph': {'class': flowables.Paragraph}, ...
import collections import contextlib import itertools import weakref import eventlet import eventlet.event from oslo_log import log as logging import six from yaql.language import specs from yaql.language import utils from murano.common.i18n import _LW from murano.dsl import attribute_store from murano.dsl import con...
"""CLI configuration.""" # :license: MIT, see LICENSE for more details. from SoftLayer.CLI import formatting def _resolve_transport(transport): """recursively look for transports which refer to other transports.""" nested_transport = getattr(transport, 'transport', None) if nested_transport is not None: ...
__author__ = "Felix Brezo, Yaiza Rubio <<EMAIL>>" __version__ = "2.0" import osrframework.utils.browser as browser from osrframework.utils.platforms import Platform class Dailymotion(Platform): """ A <Platform> object for Dailymotion. """ def __init__(self): self.platformName = "Dailymo...
# -*- encoding: utf-8 -*- from supriya.tools.synthdeftools.CalculationRate import CalculationRate from supriya.tools.ugentools.UGen import UGen class MaxLocalBufs(UGen): r'''Sets the maximum number of local buffers in a synth. Used internally by LocalBuf. :: >>> max_local_bufs = ugentools.MaxLo...
''' /* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "...
from fabric.api import * import pytest import time from common import * from common_setup import * from helpers import Helpers from MenderAPI import adm, deploy, image, logger from common_update import common_update_procedure from mendertesting import MenderTesting @pytest.mark.usefixtures("standard_setup_one_client_b...
from tests.beeswax.impala_beeswax import ImpalaBeeswaxClient, QueryResult from thrift.transport.TSocket import TSocket from thrift.protocol import TBinaryProtocol from thrift.transport.TTransport import TBufferedTransport, TTransportException from getpass import getuser import abc import logging import os LOG = loggi...
from __future__ import absolute_import, division, print_function import numpy as np from .common import Benchmark, get_squares_, get_indexes_rand, TYPES1 class Eindot(Benchmark): def setup(self): self.a = np.arange(60000.0).reshape(150, 400) self.ac = self.a.copy() self.at = self.a.T ...
import sys from collections import MutableMapping from .platform import PY3, IRONPYTHON from .robottypes import is_dict_like def normalize(string, ignore=(), caseless=True, spaceless=True): """Normalizes given string according to given spec. By default string is turned to lower case and all whitespace is re...
print("Todas las universidades de España dicen DAMe, nosotros dependemos directamente del MEC al igual que CRUE(l)") print("Soy una indígena vasca") i = input("¿Te gusto? ( S | N ): ") if (i == 'S'): print("El sentimiento vasco está fuertemente reprimido por la derecha rancia, el opus dei, etc.") print("Solo s...
""" experiment_poincare_1b.py Poincare map generation on 4x4 system, multiple start points plotted at same time. Author: Yuan Wang """ from thesis_utils import * from thesis_defaults import * from thesis_poincare_utils import * from thesis_plot_utils import * import scipy.integrate as integrate import scipy.special a...
import sys import time import os sys.path.insert(0, "bin/python") from ldb import SCOPE_BASE import drs_base class DrsFsmoTestCase(drs_base.DrsBaseTestCase): def setUp(self): super(DrsFsmoTestCase, self).setUp() # we have to wait for the replication before we make the check self.fsmo_w...
"""Tests of commerce utilities.""" import json import unittest from urllib import urlencode import ddt import httpretty from django.conf import settings from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_settings from mock import patch from waffle.test...
""" Methods for updating the mapping of a doctype by reindexing and updating the alias https://github.com/elastic/elasticsearch-dsl-py/blob/fcd8988d0b0fccf92e5b67f4ecf9ea1ce2e0387f/examples/alias_migration.py """ from datetime import datetime from elasticsearch_dsl.connections import get_connection def setup_index(...
""" This is an example of a BSE calculation for MoS2 using the new Flow/Task methods of yambopy. The approach is the same as the one implemented in Abipy. """ from yambopy.data.structures import MoS2 from qepy.pw import PwIn from yambopy.flow import YambopyFlow, PwTask, P2yTask, YamboTask #create a QE scf task and...
import time from datetime import datetime from math import floor from django.conf import settings from django.test import RequestFactory from django.test.utils import override_settings from django.utils.http import parse_http_date from bedrock.base.urlresolvers import reverse from mock import patch from nose.tools im...
#!/usr/bin/env python # # A script for unpacking and installing different historic versions of # Python in a consistent manner for side-by-side development testing. # # This was written for a Linux system (specifically Ubuntu) but should # be reasonably generic to any POSIX-style system with a /usr/local # hierarchy. f...
""" Test for source method. """ import logging import tempfile import os import os.path import shutil import sys import unittest from roadie import source # pylint: disable=import-error REPO_SSH = "<EMAIL>:jkawamoto/roadie-gcp.git" REPO_HTTPS = "https://github.com/jkawamoto/roadie-gcp.git" CHECK_FILE = "README.md" ...
# -*- coding: iso-8859-15 -*- # import the server implementation from pymodbus.client.sync import ModbusSerialClient as ModbusClient from pymodbus.mei_message import * from pyepsolartracer.registers import registerByName #---------------------------------------------------------------------------# # Logging #--------...
# -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from util.models import BaseModel from django.db.models.signals import post_delete, post_save from django.dispatch import receiver from dbaas_dbmonitor.provider import DBMonitorProvider import logging LOG = lo...
"""A Sinkhorn implementation for 1D Optimal Transport. Sinkhorn algorithm was introduced in 1967 by R. Sinkhorn in the article "Diagonal equivalence to matrices with prescribed row and column sums." in The American Mathematical Monthly. It is an iterative algorithm that turns an input matrix (here the kernel matrix co...
# -*- coding: utf-8 -*- import math import cairo import xc_base import geom from geom_utils import auxCairoPlot import matplotlib.pyplot as plt from matplotlib.path import Path import matplotlib.patches as patches from miscUtils import LogMessages as lmsg __author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AO_O)"...
import paddle.fluid as fluid from paddle.fluid import ParamAttr import numpy as np from .ctcn_utils import get_ctcn_conv_initializer as get_init DATATYPE = 'float32' class FPNCTCN(object): def __init__(self, num_anchors, concept_size, num_classes, mode='train'): self.num_anchors = num_anchors sel...
"""Leetcode 17. Letter Combinations of a Phone Number Medium URL: https://leetcode.com/problems/letter-combinations-of-a-phone-number/ Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho...
class SortieStatus: not_takeoff = 'not_takeoff' landed = 'landed' in_flight = 'in_flight' ditched = 'ditched' crashed = 'crashed' # air_crash = 'air_crash' shotdown = 'shotdown' def __init__(self, is_airstart=False): self.status = self.in_flight if is_airstart else sel...
# test user defined iterators class MyStopIteration(StopIteration): pass class myiter: def __init__(self, i): self.i = i def __iter__(self): return self def __next__(self): if self.i <= 0: # stop in the usual way raise StopIteration elif self.i...
# -*- coding: utf-8 -*- from collections import defaultdict import itertools from operator import itemgetter from django.contrib import admin from django.db.models import Q from django.utils.encoding import smart_text from . import models from organizations.models import Facility DEFAULT_FILTER_ROLES = (models.Membe...
from xml.etree.ElementTree import Element from plugins import PluginBase from utils.ThreadPool import ThreadPool from nassl import SSL_OP_NO_TICKET from utils.SSLyzeSSLConnection import create_sslyze_connection class PluginSessionResumption(PluginBase.PluginBase): interface = PluginBase.PluginInterface( ...
# -*- coding: utf-8 -*- """ *************************************************************************** ogrinfo.py --------------------- Date : November 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *****************************...
import os import time from reportlab.pdfgen import canvas from reportlab.platypus.paragraph import Paragraph from reportlab.lib.styles import ParagraphStyle from fontTools.pens.basePen import BasePen try: from cElementTree import fromstring except ImportError: from elementtree.ElementTree import fromstring cl...
import pandas as pd left = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3'], 'A': ['A0', 'A1', 'A2', 'A3'], 'B': ['B0', 'B1', 'B2', 'B3']}) right = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3'], 'C': ['C0', 'C1', 'C2', 'C3'], 'D':...
import gpsnavi import unittest import datetime import mox3 import go_f import os class Testgpsnavi(unittest.TestCase): #lon = 139.649867 lon = 141.24322166666667 lat = 43.123041666666666 #lat = 35.705385 goal = [[lon, lat]] gps = gpsnavi.gpsparser(goal=goal) #getdis = go_f.getdistance() ...
from unlock import SpritePositionComputer, PygletSprite, FlickeringPygletSprite, PygletWindow, Canvas, UnlockController, AlternatingBinaryStateModel import unittest import pyglet import multiprocessing as mp class PygletSpriteTests(unittest.TestCase): def testMSequencePygletSprite(self): #window =...
from __future__ import absolute_import, unicode_literals import copy import logging import random import string from functools import reduce from django.core.servers.basehttp import get_internal_wsgi_application from django.db import transaction from django.http import HttpResponseRedirect, QueryDict from django.temp...
from .services.instance_admin import InstanceAdminClient from .services.instance_admin import InstanceAdminAsyncClient from .types.spanner_instance_admin import CreateInstanceMetadata from .types.spanner_instance_admin import CreateInstanceRequest from .types.spanner_instance_admin import DeleteInstanceRequest from .t...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from datetime import datetime import pytz def lines_to_event(lines): # Unescape double escapes lines = [line.replace('\\', '') for line in lines] # Transform lines to event event = {} key = None for line in lines: if not line.startswith(' ...
''' Created on Jun 2, 2014 @author: dbhage Factory to create Celex objects ''' import os from celex.phonology.english_celex import EnglishCelex from celex.phonology.dutch_celex import DutchCelex from celex.phonology.german_celex import GermanCelex def build_celex(celex_path, language, version): ''' Build t...
""" :copyright: (c) 2011 Local Projects, all rights reserved :license: Affero GNU GPL v3, see LICENSE for more details. """ import json from framework import util from lib import twilio from lib import web from framework.log import log #from framework.config import * from framework.config import Config #from f...
import socket import os import sys import time import errno from urlparse import urlparse import roster def main(): client = roster.Client.new() conn = None endpoint_data = None message_count = 1 while True: try: service, err = client.Discover('echo') if err: ...
""" Bitcoin information service that uses blockchain.info and its online wallet. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.bitcoin/ """ import logging from datetime import timedelta from homeassistant.helpers.entity import Entity from homeas...
import unittest from king_phisher import testing from king_phisher.server.database import manager as db_manager from king_phisher.server.database import models as db_models from king_phisher.utilities import random_string get_tables_with_column_id = db_models.get_tables_with_column_id class ServerDatabaseTests(testi...
from datetime import date class trans: def __init__(self,d,a,b,n): self.date = d self.amt = a self.bal = b self.note = n def getDate(self): return self.date def getAmt(self): return self.amt def getBal(self): return self.bal def getNote(self): return self.note def printIt(self): print '%s %s %s %s' %...
# -*- coding: utf-8 -*- # # Django documentation build configuration file, created by # sphinx-quickstart on Thu Mar 27 09:06:53 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
import cffi from cffi import FFI class PythonFFI(FFI): def __init__(self, backend=None): FFI.__init__(self, backend=backend) self._pyexports = {} def pyexport(self, signature): tp = self._typeof(signature, consider_function_as_funcptr=True) def decorator(func): ...
from __future__ import division, absolute_import, unicode_literals from PyQt4 import QtGui, QtCore from PyQt4.QtCore import Qt, SIGNAL from cola import hotkeys from cola import qtutils from cola.compat import ustr from cola.i18n import N_ from cola.models import prefs from cola.widgets import defs def get_value_str...
# -*- coding: utf-8 -*- from collections.abc import Container import ipaddress import itertools class InternalIPS(Container): """ InternalIPS allows to specify CIDRs for INTERNAL_IPS. It takes an iterable of ip addresses or ranges. Inspiration taken from netaddr.IPSet, please use it if you can since...
from __future__ import absolute_import from pyface.action.action import Action from pyface.tasks.action.task_action import TaskAction from pychron.envisage.view_util import open_view from pychron.lasers.laser_managers.ilaser_manager import ILaserManager from pychron.lasers.laser_managers.pychron_laser_manager import ...
import os # access operating system commands import urlparse # splits up the directory path - much easier importing this than coding it up ourselves import xbmc # the base xbmc functions, pretty much every add-on is going to need at least one function from here import xbmcaddon # pull addon spe...
__author__ = 'Zander' import math import numpy as np class Vector3: def __init__(self, x, y, z): self.x = x self.y = y self.z = z self.length = math.sqrt(x**2 + y**2 + z**2) def __add__(self, other): return Vector3(self.x + other.x, self.y + other.y, self.z + other.z) ...
import json import logging import requests import time import transaction from ZODB.DB import DB from papaye.factories.root import repository_root_factory from papaye.models import Package, Release, ReleaseFile from papaye.proxy import download_file from papaye.tasks import task logger = logging.getLogger(__name__)...
# -*- coding: utf-8 -*- import logging from soya.core.core import SoyaToolkit from soya.apps.api import ( bp, render_json, ) from soya.utils.validate import ( validator, FloatField, IntField, StringField, ) logger = logging.getLogger(__name__) def __reconstruct_movie_info(is_new, is_imax...
# Detect present Python & Boost-python libraries on Linux import os, struct class PkgConfig(dict): _paths = [ '/usr/lib/pkgconfig', '/usr/lib/%s-linux-gnu/pkgconfig' % (os.uname()[4]), '/usr/lib%i/pkgconfig' % (struct.calcsize('P')*8) ] def __init__(self, name): for path in...
from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @add_test_categories(["libc++"]) @skipIf(compiler=no_match("clang")) def test(self): self.build() lldb...
import os from os import path as op import zipfile from sys import stdout from ...utils import _fetch_file, _url_to_local_path, verbose from ..utils import _get_path, _do_path_update from .urls import (url_match, valid_data_types, valid_data_formats, valid_conditions) @verbose def data_path(url, p...
""" File: piecewise_linear_function.py Purpose: Defines a piecewise linear function based on a set of transition points that define the steps. """ from function.univariate_function import UnivariateFunction from misc.ordered_map import OrderedMap from misc.utility import convert_to_numeric class LinearSegment(obje...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ mysql_query_tool tool to perform mysql queries copyright: 2015, (c) sproutsocial.com author: Nicholas Flink <<EMAIL>> """ import argparse import contextlib import logging import MySQLdb import pprint import re import sys logger = logging.getLogger(__name__) # Qu...
from __future__ import print_function import argparse import logging import os import sys # -- begin path_setup -- import ms.version BINDIR = os.path.dirname(os.path.realpath(sys.argv[0])) LIBDIR = os.path.join(BINDIR, "..", "lib") if LIBDIR not in sys.path: sys.path.append(LIBDIR) # -- end path_setup -- impor...
''' Unit tests for GaussObsModel ''' from bnpy.data import XData from bnpy.obsmodel import GaussObsModel from bnpy.distr import GaussWishDistr from bnpy.util.RandUtil import mvnrand import unittest import numpy as np class TestGaussObsModel(unittest.TestCase): def shortDescription(self): pass def setUp(se...
import os,sys from sklearn import svm import numpy as np import utils as cu import libLearning as learn import libDetection as det ######################################## ## IMPLEMENTATION OF LINEAR DETECTOR ######################################## class LinearDetector(det.Detector): def __init__(self,params=None):...
import os from StringIO import StringIO import fastchardet import fnmatch from validator import decorator from validator.chromemanifest import ChromeManifest from validator.constants import PACKAGE_EXTENSION, PACKAGE_LANGPACK from validator.xpi import XPIManager from .l10n import dtd, properties # The threshold th...
import os import Tkinter as tk from Tkinter import Frame, Label, Button import ViewModel from sqlenergy import core from sqlenergy import plot from ttk import * class FrameQuery(tk.Frame): def __init__(self, parent, ctx, *args, **kwargs): tk.Frame.__init__(self, parent, *args, **kwargs) self.paren...
import webapp2 from jinja2 import Environment, FileSystemLoader from os.path import dirname, join import os import json import base64 import hashlib import StringIO from google.appengine.api import users import numpy as np if not os.environ.get('SERVER_SOFTWARE','').startswith('Development'): import PIL import...
# -*- coding: utf-8 -*- import os import unittest import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk from blivet.devicelibs.raid import RAID0, RAID1, RAID5, Single, Linear from blivet.devicelibs import crypto from blivetgui.dialogs.widgets import RaidChooser, EncryptionChooser from blivetgui.i...
from mesonbuild import environment import sys, os, subprocess def remove_dir_from_trace(lcov_command, covfile, dirname): tmpfile = covfile + '.tmp' subprocess.check_call([lcov_command, '--remove', covfile, dirname, '-o', tmpfile]) os.replace(tmpfile, covfile) def coverage(source_root, build_root, log_dir...
import khmer import argparse import collections from math import log import json try: from simplesam import Reader except: pass CIGAR_TO_STATE = {'M': 'M', 'I': 'Ir', 'D': 'Ig'} def extract_cigar(cigar): ret = [] for length, cig in cigar: for i in range(length): ret.append(CIGAR_T...
""" This enables -L, --language and -W for docbook output. Additionally the magic word IMAGENAME will contain the imagename instead of "IMAGE:imagename" Example: mw-render -w docbook -L de -W debug=True;imagesrcresolver=/home/images/IMAGENAME The content of writer() belongs to the mwlib. """ from mwlib.docbookw...
#!/usr/bin/python3 ''' (C) Copyright 2018-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent ''' import time import traceback from apricot import TestWithServers from pydaos.raw import DaosContainer, DaosApiError, c_uuid_to_str class BasicTxTest(TestWithServers): """ A very simple te...
import os DEFAULT_EDITOR_PATH = "/usr/bin/editor" def locate_editor(): editor = None # check /usr/bin/editor if os.path.exists(DEFAULT_EDITOR_PATH): editor = DEFAULT_EDITOR_PATH # check EDITOR variable editor = os.environ.get('EDITOR') or editor # check VISUAL variable editor = ...
import sys import os from couchbase.admin import Admin from couchbase.result import HttpResult from couchbase.connstr import ConnectionString from couchbase.exceptions import ( ArgumentError, AuthError, CouchbaseError, CouchbaseNetworkError, HTTPError) from couchbase.tests.base import CouchbaseTestCase, SkipTe...
""" Storage service catalog (SSC) functions and classes for NetApp cDOT systems. """ import copy import re from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _ LOG = logging.getLogger(__name__) # NOTE(cknight): The keys in this map are tuples that contain arguments...
from rx.observable import Producer import rx.linq.sink class MinBy(Producer): def __init__(self, source, keySelector, compareTo): self.source = source self.keySelector = keySelector self.compareTo = compareTo def run(self, observer, cancel, setSink): sink = self.Sink(self, observer, cancel) s...
""" Payment module for cash on delivery handling Automatically completes every order passed. """ from datetime import datetime import logging from django.shortcuts import redirect from django.utils.translation import ugettext_lazy as _ from plata.payment.modules.base import ProcessorBase from plata.product.stock.mo...
from JumpScale import j descr = """ Checks disks' status """ organization = "jumpscale" author = "<EMAIL>" license = "bsd" version = "1.0" category = "monitor.healthcheck" async = True queue = 'process' roles = [] enable = True period = 600 log = True def action(): result = dict() pattern = None if j...
import threading from .util import run_test import webview def test_mixed(): run_test(main_func, mixed_test) def test_array(): run_test(main_func, array_test) def test_object(): run_test(main_func, object_test) def test_string(): run_test(main_func, string_test) def test_int(): run_test(ma...
from __future__ import division, print_function, unicode_literals from odoo.report import report_sxw from odoo import fields from odoo.addons.report_xlsx.report.report_xlsx import ReportXlsx from decimal import Decimal class ReportXlsxStyle(object): def __init__(self, *args, **kwargs): self.align_left ...
# pylint: disable=too-many-public-methods """Test for certbot_nginx.configurator.""" import os import shutil import unittest import mock import OpenSSL from acme import challenges from acme import messages from certbot import achallenges from certbot import errors from certbot_nginx.tests import util class NginxC...
from zope.interface import Interface class IConverter(Interface): """ interface for converters """ def getDescription(): """ return a string describing what the converter is for """ def getType(): """ returns a list of supported mime-types """ def getDependency(): ...
import glob from optparse import OptionParser import os import shutil import sys import tempfile import pmenv import tap import util __author__ = "Aurelien FORET" __version__ = "0.4" def resolve_binary_path(option, opt_str, value, parser): setattr(parser.values, option.dest, os.path.abspath(value)) def create_p...
# NameSpace class wraps low-level functionality from termcolor import colored class NameSpace: def __init__(self): self._ns = { '__words__' : { }, '__vars__' : { }, '__inst__' : { }, '__links__' : [ ], '__loadList__' : [ ...
# -*- coding: utf-8 -*- """Exercises tab for main frame's notebook""" import wx import wx.html from wx import xrc import wx.animate import webbrowser import wx.lib.mixins.listctrl as listmix import os, sys from Hercules.exercises import * from Hercules.gui.exercisedialog import * from Hercules.exercises import Exe...
from org.sikuli.script import Region as JRegion from org.sikuli.script import Location from org.sikuli.script import Settings from org.sikuli.script import SikuliEventAdapter from org.sikuli.script import SikuliEventObserver from Constants import * import inspect import types import time import java.lang.String import ...
from tempest.lib import exceptions from mistralclient.tests.functional.cli.v2 import base_v2 class StandardItemsAvailabilityCLITests(base_v2.MistralClientTestBase): def test_std_workflows_availability(self): wfs = self.mistral_admin("workflow-list") self.assertTableStruct( wfs, ...
import pytest from unittest.mock import patch, MagicMock from UM.FileHandler.FileHandler import FileHandler @pytest.fixture def file_handler(application): FileHandler._FileHandler__instance = None with patch("UM.FileHandler.FileHandler.PluginRegistry.addType"): handler = FileHandler(application, writ...
import os, sys, getopt, traceback, json, re from py4j.java_gateway import java_import, JavaGateway, GatewayClient from py4j.protocol import Py4JJavaError from pyspark.conf import SparkConf from pyspark.context import SparkContext from pyspark.rdd import RDD from pyspark.files import SparkFiles from pyspark.storageleve...
import java import javax.swing class HeljanCrane(jmri.jmrit.automat.AbstractAutomaton) : # init() is called exactly once at the beginning to do # any necessary configuration. def init(self): # define crane addresses loAddr = 80 hiAddr = 81 self.status.text = "...
__title__="FreeCAD OpenSCAD Workbench - GUI Commands" __author__ = "Sebastian Hoogen" __url__ = ["http://www.freecadweb.org"] ''' This Script includes the GUI Commands of the OpenSCAD module ''' import FreeCAD,FreeCADGui from PySide import QtCore, QtGui def translate(context,text): "convenience function for Qt tr...
"""Test for the go by majority strategy.""" import axelrod from .test_player import TestPlayer C, D = axelrod.Actions.C, axelrod.Actions.D class TestGoByMajority(TestPlayer): name = "Soft Go By Majority" player = axelrod.GoByMajority expected_classifier = { 'stochastic': False, 'memor...
from boto.connection import AWSAuthConnection from concurrent.futures._base import Future class ConnectionsMapping(dict): """Exposes a region name to connection mapping If connection is a future, it's evaluated value will be returned. Be aware it could potentially block. :param default: name of the...
# # -*- coding: utf-8 -*- """setuptools based setup for tomcatmanager """ from os import path from setuptools import setup, find_packages # # get the long description from the README file here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_descriptio...
import argparse import os import libcst as cst import pathlib import sys from typing import (Any, Callable, Dict, List, Sequence, Tuple) def partition( predicate: Callable[[Any], bool], iterator: Sequence[Any] ) -> Tuple[List[Any], List[Any]]: """A stable, out-of-place partition.""" results = ([], [])...
import locale import os import urllib import urllib2 import urlparse import wx from os.path import basename, dirname from threading import Thread from time import clock class TransferDialog(wx.Dialog): """ The progress dialog that is shown while the file is transfered. """ def __init__(self, parent, tr...
"""Example Airflow DAG that creates a Cloud Dataflow workflow which takes a text file and adds the rows to a BigQuery table. This DAG relies on four Airflow variables https://airflow.apache.org/concepts.html#variables * project_id - Google Cloud Project ID to use for the Cloud Dataflow cluster. * gce_zone - Google Com...
# Implement (a subset of) Sun XDR -- RFC1014. try: import struct except ImportError: struct = None Long = type(0L) class Packer: def __init__(self): self.reset() def reset(self): self.buf = '' def get_buf(self): return self.buf def pack_uint(self, x): se...
title = 'Pmw.ComboBox demonstration' # Import Pmw from this directory tree. import sys sys.path[:0] = ['../../..'] import Tkinter import Pmw class Demo: def __init__(self, parent): parent.configure(background = 'white') # Create and pack the widget to be configured. self.target = Tkinter.Label(...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function import copy import datetime import logging import random import re import string import sys import argparse import mock import simplejson import yaml from elastalert.config import load_modules f...
class MinStack(object): def __init__(self): """ initialize your data structure here. """ self.stack = [] self.minStack = [] def push(self, x): """ :type x: int :rtype: nothing """ self.stack.append(x) if not self.minStack o...
"""Tests for module :class:`stoqlib.database.viewable.Viewable`""" import datetime from storm.expr import LeftJoin, Sum from stoqlib.database.viewable import Viewable from stoqlib.domain.account import AccountTransaction from stoqlib.domain.commission import Commission from stoqlib.domain.payment.method import Check...