content
string
#!/usr/bin/python # -*- coding: utf-8 -*- from mozart.works.models import Work from mozart.events.models import Event from mozart.profiles.models import Address, Contact, Birthday, ExtendedUser from .mixins import GenericUserFilter class AddressFilter(GenericUserFilter): class Meta(GenericUserFilter.Meta): ...
import getpass, poplib, time def read_auto_tester(mail_line, user): title_line = -8 score_line = -6 index = 0 for line in mail_line: if 'student,init,compile,' in line: title_line = index if (user+',') in line: score_line = index index += 1 split_line...
# -*- coding: utf-8 -*- __author__ = 'Aleksi Palomäki' from json import dumps from db_handler import error_handler # This class expects High class DB_handler. class Test_editable: def __init__(self, db): self.db = db # self.consent_test() self.initialize() # logging.shutdown() ...
from __future__ import unicode_literals import json import re from slugify import slugify from django.conf import settings from django.contrib import messages from django.core.urlresolvers import reverse from django.db import transaction from django.http import ( HttpResponseRedirect, HttpResponsePermanentRedire...
# -*- encoding: utf-8 -*- import os import webbrowser from abjad.tools import systemtools from abjad.tools.documentationtools import DocumentationManager from abjad.tools.developerscripttools.DeveloperScript import DeveloperScript class BuildApiScript(DeveloperScript): r'''Builds the Abjad APIs. .. shell:: ...
''' Convenience class for storing and describing experimental results ''' import numpy as np class PersistentResultsMatrix: shape = None def __init__(self, *args, **kwargs): self.path = kwargs['path'] self._results = np.ones(args) * -1 self.shape = self._results.shape de...
from __future__ import print_function, division import os,unittest,numpy as np from pyscf.nao import mf as mf_c from pyscf import gto, scf, tddft from pyscf.data.nist import HARTREE2EV class KnowValues(unittest.TestCase): def test_0069_vnucele_coulomb_water_ae(self): """ This """ mol = gto.M(verbose=1,atom...
""" .. codeauthor:: Tsuyoshi Hombashi <<EMAIL>> """ from textwrap import dedent from typing import TYPE_CHECKING from pathvalidate.error import ErrorReason, ValidationError from ._common import extract_table_metadata from ._logger import logger from ._validator import validate_sqlite_attr_name, validate_sqlite_table...
import librosa import librosa.filters import math import numpy as np from scipy import signal from jarbas_models.tf_tacotron.hparams import hparams def load_wav(path): return librosa.core.load(path, sr=hparams.sample_rate)[0] def save_wav(wav, path): wav *= 32767 / max(0.01, np.max(np.abs(wav))) librosa...
## roster.py ## # {мαғια•тєaм™ 2ό13-2ό14 ©} By <EMAIL> """ Simple roster implementation. Can be used though for different tasks like mass-renaming of contacts. """ from protocol import * from client import PlugIn class Roster(PlugIn): """ Defines a plenty of methods that will allow you to manage roster. ...
"""Messages used in the dashboard.""" __author__ = 'Mike Gainer (<EMAIL>)' AVAILABILITY_AVAILABILITY_DESCRIPTION = """ Content defaults to the availability of the course, but may also be restricted to admins (Private) or open to the public (Public). """ AVAILABILITY_SHOWN_WHEN_UNAVAILABLE_DESCRIPTION = """ If check...
""" pyClanSphere.utils.crypto ~~~~~~~~~~~~~~~~~~~~~~~~~ This module implements various cryptographic functions. :copyright: (c) 2009 - 2010 by the pyClanSphere Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import string from random import choi...
# FIXME: more intelligent fault raises """ cert master listener Copyright 2007, Red Hat, Inc see AUTHORS This software may be freely redistributed under the terms of the GNU general public license. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free S...
from openerp import models, fields, api, _ import logging _logger = logging.getLogger(__name__) class sale_order(models.Model): _inherit = "sale.order" workflow_process_id = fields.Many2one(comodel_name='sale.workflow.process', string='Automatic Workflow', ...
from flask import Flask from flask import jsonify from flask.json import dumps from flask import flash from flask import url_for from flask import request from flask import render_template from flask import redirect from flask_oauthlib.client import OAuth from flask import session from urlparse import urlparse import ...
class Category: """ A taxonomy category node A category node is bound by a minimum and maximum LC Call number and contains a dictionary of terms describing the category. E.g. min_lcc: RC 0581 max_lcc: RC 0607 terms: {1: "Science", 2: "Biology", 3: "Microbiology and Immunology"} ...
"""Download original citibike data. This application downloads the original citibike data and reencodes it from a zip to a bz2 file.""" from pipes import quote from tempfile import TemporaryFile from distutils.dir_util import mkpath from os import environ, makedirs, unlink from os.path import join, exists import errn...
#! /usr/bin/env python """ Basic propagation model for wireless channel; contains `Propagation` class. Revision Info ============= * $LastChangedBy: mandke $ * $LastChangedDate: 2011-05-19 23:09:01 -0500 (Thu, 19 May 2011) $ * $LastChangedRevision: 4985 $ :author: Ketan Mandke <<EMAIL>> :copyright: Copyright 2...
# coding: utf-8 """Client for the Nuxeo REST API.""" import base64 import json import urllib2 from nxdrive.client.base_automation_client import get_proxy_handler from nxdrive.logging_config import get_logger log = get_logger(__name__) class RestAPIClient(object): """Client for the Nuxeo REST API.""" appli...
from setuptools import setup import codecs import os import re here = os.path.abspath(os.path.dirname(__file__)) # Read the version number from a source file. # Why read it, and not import? # see https://groups.google.com/d/topic/pypa-dev/0PkjVpcxTzQ/discussion def find_version(*file_paths): # Open in Latin-1 so...
from PyQt4 import QtCore, QtGui from gui_graphicsscene import GraphicsScene from gui_spinbox import SpinBox import gui_settings_experimental import gui_settings_compatible class Settings(QtGui.QDockWidget): """ Settings panel docked on the left side of the main window. """ def __init__(self, parentWind...
# -*- coding: utf-8 -*- from ..lbutils.pyutils import Property, isiterable class lbtype(object): """ Base for all lbtype classes lbtype classes are special classes that mimics strong typing in python """ # A type or list of types that this lbtype should allow inner_type = None ...
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline ...
""" This module provides the `GooglePage` class. This class represents an abstract web page downloaded by the GoogleSearchUniv class. The attributes represented are: keywords, position, language, date, url, title, snippet, text and total results. """ import pdb ######################################...
#!/usr/bin/env python from __future__ import division from random import uniform import numpy as np try: import scipy.special except ImportError: scipy = None import IMP from IMP.isd import FStudentT import IMP.test def evaluate_fstudentt(fxs, jxs, fm, s, v): n = float(fxs.size) sumfx = np.sum(fxs) ...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource from twilio.base.page import Page class HighriskSpecialP...
# coding: utf-8 # my_utils for Intro to Data Science with Python # -------------------------------------- ## Stage 2 begin import csv # open a file and return a double list def open_with_csv(filename, d='\t'): uuids = [] with open(filename, encoding='utf-8') as tsvin: tsvin = csv.reader(tsvin, deli...
# -*- coding: utf-8 -*- from contextlib import closing from pyramid import testing import pytest from journal import connect_db from journal import DB_SCHEMA import datetime from journal import INSERT_ENTRY import os from cryptacular.bcrypt import BCRYPTPasswordManager TEST_DSN = 'dbname=test_learning_journal user=e...
# # mod-h2 test suite # check handling of trailers # import copy import os import re import sys import time import pytest from datetime import datetime from TestEnv import TestEnv from TestHttpdConf import HttpdConf from TestNghttp import Nghttp def setup_module(module): print("setup_module: %s" % module.__name_...
import socket import sys import os import re from netaddr import IPNetwork from subprocess import check_output, CalledProcessError HOSTNAME_ENV = "HOSTNAME" """ Compile Regexes """ # Splits into groups that start w/ no whitespace and contain all lines below that start w/ whitespace INTERFACE_SPLIT_RE = re.compile(r'(...
import re import json from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin_rfc from product_spiders.items import Product, ProductLoaderWithNameStrip as Produc...
from tornado import web from handlers.BaseHandler import BaseHandler, wrap_async_rpc, wrap_catch from core import FM class RenameFileHandler(BaseHandler): @wrap_async_rpc @wrap_catch @web.authenticated def post(self): session = self.get_post('session') source_path = self.get_post('s...
"""empty message Revision ID: 44fe26926437 Revises: 171b15035012 Create Date: 2016-03-23 16:41:49.660096 """ # revision identifiers, used by Alembic. revision = '44fe26926437' down_revision = '171b15035012' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(engine_na...
{ 'name': 'OpenERP Health: Person - Brazilian Localization', 'version': '1.0.0', 'author': 'Carlos Eduardo Vercelino - CLVsol', 'category': 'Generic Modules/Others', 'license': 'AGPL-3', 'website': 'http://oehealth.org', 'description': ''' ''', 'images': [], 'depends': ['oehealth...
# globals # g.py - globals for Numbers """ Copyright (C) 2010 Peter Hewitt 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 op...
from tests.lib import create_test_package_with_setup def matches_expected_lines(string, expected_lines): def predicate(line): return line and not line.startswith('DEPRECATION') output_lines = set(filter(predicate, string.splitlines())) # Match regardless of order return set(output_lines) == s...
# -*- coding: utf-8 -*- #!/usr/bin/python ################################################## # CREATED_AT : 2015-11-12 # LAST_MODIFIED : 2015年11月14日 星期六 16时39分20秒 # USAGE : python test_core.py # PURPOSE : TODO ################################################## import sys, time, random import tou...
import re from ztag.annotation import Annotation from ztag.annotation import OperatingSystem from ztag import protocols import ztag.test class FtpTypesoftFtpd(Annotation): protocol = protocols.FTP subprotocol = protocols.FTP.BANNER port = None impl_re = re.compile( "^220 TYPSoft FTP Server \d...
from boto.gs.user import User from boto.exception import InvalidAclError ACCESS_CONTROL_LIST = 'AccessControlList' ALL_AUTHENTICATED_USERS = 'AllAuthenticatedUsers' ALL_USERS = 'AllUsers' DISPLAY_NAME = 'DisplayName' DOMAIN = 'Domain' EMAIL_ADDRESS = 'EmailAddress' ENTRY = 'Entry' ENTRIES = 'Entries' GROUP_BY_DOMAIN =...
""" Represents an SDB Domain """ from boto.sdb.queryresultset import QueryResultSet, SelectResultSet class Domain: def __init__(self, connection=None, name=None): self.connection = connection self.name = name self._metadata = None def __repr__(self): return 'Domain:%s' % s...
#!/usr/bin/env python """ @package mi.dataset.driver.ctdpf_j.cspp @file mi/dataset/driver/ctdpf_j/cspp/ctdpf_j_cspp_telemetered_driver.py @author Chris Goodrich @brief Driver for the ctdpf_j_cspp instrument Release notes: Initial Release """ from mi.dataset.dataset_parser import DataSetDriverConfigKeys from mi.datase...
# coding=utf8 import os import errno import shutil import subprocess import sys try: from setuptools import setup, find_packages, Extension except ImportError: from distutils.core import setup, find_packages, Extension __HERE__ = os.path.dirname(__file__) __VERSION_FILE__ = os.path.join(__HERE__, 'VERSION') ...
import networkx as nx import idaapi from sark import CodeBlock, FlowChart, get_block_start, get_nx_graph try: from sark.ui import ActionHandler use_new_ui = True except: use_new_ui = False COLOR_REACHABLE = 0x66EE11 COLOR_UNREACHABLE = 0x6611EE COLOR_REACHING = 0x11EE66 COLOR_NOT_REACHING = 0x1166EE CO...
""" Functionality to convert between different representations of geo-coordinates. """ import re import math __all__ = ['Coordinates', 'dec2degminsec', 'degminsec2dec', 'degminsec'] DEGREES = "°" MINUTES = "\u2032" SECONDS = "\u2033" PATTERNS = { 'lat_alnum': re.compile(r"(?P<deg>\d+)d(?P<min>[0-9]+)?(?P<sec>'\d...
""" Module :mod:`openquake.hazardlib.source.base` defines a base class for seismic sources. """ import abc from openquake.hazardlib.slots import with_slots @with_slots class BaseSeismicSource(object): """ Base class representing a seismic source, that is a structure generating earthquake ruptures. :p...
import numpy as np class VoxelGrid: """A 3 dimensional grid representation of a point cloud. This is analagous to the rasterizer.Grid class, but with three axes instead of two. VoxelGrids are generally used to produce VoxelRaster objects.""" def __init__(self, cloud, cell_size): self.cell_size = ...
from __future__ import absolute_import, unicode_literals import os import sys from collections import OrderedDict from virtualenv.util.path import Path from virtualenv.util.six import ensure_text from ..via_template import ViaTemplateActivator class PythonActivator(ViaTemplateActivator): def templates(self): ...
import pytz from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.forms.models import model_to_dict from django.http import HttpResponseRedirect, HttpResponseNotAllowed from django.shortcuts import get_object_or_404, rende...
from django.db.models import Aggregate from django.contrib.gis.db.backend import SpatialBackend from django.contrib.gis.db.models.sql import GeomField class GeoAggregate(Aggregate): def add_to_query(self, query, alias, col, source, is_summary): if hasattr(source, 'geom_type'): # Doing ...
""" Apply access on a harmonization dataset. """ import sys import mica.core import mica.access def add_arguments(parser): """ Add command specific options """ mica.access.add_permission_arguments(parser, True) parser.add_argument('id', help='Harmonization dataset ID') def do_command(args): "...
"""Tests for Overpass API requests.""" from qgis.PyQt.QtCore import QUrl, QUrlQuery from qgis.testing import unittest from QuickOSM.core.api.connexion_oapi import ConnexionOAPI from QuickOSM.core.exceptions import ( OverpassBadRequestException, OverpassMemoryException, OverpassRuntimeError, OverpassTi...
import proto # type: ignore __protobuf__ = proto.module( package='google.cloud.automl.v1beta1', manifest={ 'AnnotationSpec', }, ) class AnnotationSpec(proto.Message): r"""A definition of an annotation spec. Attributes: name (str): Output only. Resource name of the an...
"""Runner script for environments located in flow/benchmarks. The environment file can be modified in the imports to change the environment this runner script is executed on. Furthermore, the rllib specific algorithm/ parameters can be specified here once and used on multiple environments. """ import json import argpa...
# coding: utf-8 from __future__ import unicode_literals, print_function import json from collections import defaultdict from copy import deepcopy from oar.lib import config from oar.lib.compat import iteritems from oar.lib.interval import itvs_size, intersec import oar.lib.resource as rs quotas_rules = {} quotas_job_t...
# -*- coding: utf-8 -*- """ PiDashboard Lexer """ import datetime, re from fractions import Fraction from lib import utils BYTES1024 = ((2**50,'PB'), (2**40,'TB'), (2**30,'GB'), (2**20,'MB'), (2**10,'KB'), (1,'B')) HERTZ = ((10**12,'THz'), (10**9,'GHz'), (10**6,'MHz'), (10**3,'kHz'), (1,'Hz')) MILLISECONDS = ((6048000...
"""Script for the conversion of raw reference data (discrete Green operators) to *.npz. """ import os import os.path import re import sys import numpy as np DEPTH = 8 RAW_EXT = '.dat' def raw2npz(raw_filename): npz_filename = os.path.abspath(raw_filename).replace(RAW_EXT, '.npz') print('Converting {0} to {1...
import cStringIO import json import logging import os import shutil import sys import tempfile import unittest THIS_DIR = os.path.dirname(os.path.abspath(__file__)) # For 'test_env'. sys.path.insert( 0, os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..', 'unittests'))) # For 'collect_gtest_task.py'. sys.path...
import json from datetime import datetime from time import sleep import numpy as np from flask import Flask, Response, make_response, request from bokeh.models import CustomJS, ServerSentDataSource from bokeh.plotting import figure, output_file, show # Bokeh related code adapter = CustomJS(code=""" const result...
#! python3 ''' PhoneAndEmail.py - Finds phone numbers and email addresses on the clipboard. ''' import re import pyperclip PHONE_REGEX = re.compile(r'''( (\d{3}|\(\d{3}\))? # area code (\s|-|\.)? # separator (\d{3}) # first 3 digits (\s|-|\.) ...
import datetime, sys from metno.bdiana import BDiana, InputFile if __name__ == "__main__": if len(sys.argv) != 4: sys.stderr.write("Usage: %s <setup file> <input file> <output file>\n" % sys.argv[0]) sys.exit(1) setup_path = sys.argv[1] input_path = sys.argv[2] output_path = ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (c) 2016 Ryan Fan 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, c...
"""Common utilities and settings used by tfdbg v2's op callbacks.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # The ops that are skipped by tfdbg v2's op callbacks. # They belong to TensorFlow's control flow ops (e.g., "Enter", "StatelessIf") # and o...
"""Simple HTTP Server. This module builds on BaseHTTPServer by implementing the standard GET and HEAD requests in a fairly straightforward manner. """ __version__ = "0.6" __all__ = ["SimpleHTTPRequestHandler"] import os import posixpath import BaseHTTPServer import urllib import cgi import sys i...
"""byterange.py tests""" # $Id: test_byterange.py,v 1.6 2004/03/31 17:02:00 mstenner Exp $ import sys from cStringIO import StringIO from urlgrabber.byterange import RangeableFileObject from base_test_code import * class RangeableFileObjectTestCase(TestCase): """Test range.RangeableFileObject class""" ...
import logging log = logging.getLogger(__name__) import numpy import time from spacq.interface.resources import Resource from spacq.interface.units import Quantity from spacq.tool.box import Synchronized from ..abstract_device import AbstractDevice, AbstractSubdevice from ..tools import quantity_unwrapped, quantity_...
import base64 import hashlib from unittest.mock import MagicMock from unittest.mock import patch from trove.common import exception from trove.dns.designate import driver from trove.dns import driver as base_driver from trove.tests.unittests import trove_testtools class DesignateDriverV2Test(trove_testtools.TestCas...
from torouterui import app, __version__ import argparse def main(): """Primary entry-point for torouterui. """ parser = argparse.ArgumentParser() parser.add_argument('--debug', action='store_true', help="enable debugging interface") parser.add_argument('--host', default="127...
"""Hash table in python.""" import timeit class HashTable: """Hash table use str for keys, val can be anything.""" def __init__(self, bucket_count=100, hash_fun=None): """Init an instance of Hash Table.""" self.bucket_count = int(bucket_count) # must be whole num self.size = 0 ...
"""Connectors""" __copyright__ = "Copyright (C) 2014 Ivan D Vasin" __docformat__ = "restructuredtext" import abc as _abc import hashlib as _hashlib import json as _json import sys as _sys import threading as _threading from functools import wraps as _wraps import ldap as _ldap try: import memcache as _memcache e...
# -*- coding: utf-8 -*- from openerp import _, api, fields, models from openerp import tools class Followers(models.Model): """ mail_followers holds the data related to the follow mechanism inside Odoo. Partners can choose to follow documents (records) of any kind that inherits from mail.thread. Followin...
import os from calibre.ebooks.rtf2xml import copy from calibre.utils.cleantext import clean_ascii_chars from calibre.ptempfile import better_mktemp class FixLineEndings: """Fix line endings""" def __init__(self, bug_handler, in_file=None, copy=None, run_level=...
""" Easyconfig templates module that provides templating that can be used within an Easyconfig file. :author: Stijn De Weirdt (Ghent University) :author: Fotis Georgatos (Uni.Lu, NTUA) :author: Kenneth Hoste (Ghent University) """ import copy import re import platform from easybuild.base import fancylogger from easyb...
import unittest from hamcrest import is_, assert_that, contains, close_to from lib.service import Department, Service from test.service import details class TestDepartment(unittest.TestCase): def test_department_creation(self): d = Department("Agency for Beautiful Code", []) assert_that(d.name, i...
from openerp import fields, models, api, _ class ProjectMilestone(models.Model): _inherit = 'project.milestone' nb_issues = fields.Integer(u"Number of issues", compute='_compute_nb_issues') issue_ids = fields.One2many('project.issue', 'milestone_id', u"Issues", readonly=True) @api.multi def _com...
#!/usr/bin/env python from __future__ import print_function import os,sys import tacc_stats.cfg as cfg from tacc_stats.pickler import batch_acct,job_stats from datetime import datetime,timedelta import time import cPickle as pickle import multiprocessing, functools import argparse, traceback def job_pickle(reader_in...
from .base import * import sys DEBUG = True INTERNAL_IPS = ('127.0.0.1', '10.0.2.2') # Writes the e-mail that would be sent to standard output. Don't # use this in production! EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # ADMINS = ( # ('Your Name', '<EMAIL>'), # ) MIDDLEWARE_CLASSES += ('d...
#!/usr/bin/env python import codecs import contextlib import fcntl import json import os import shlex import subprocess import sys C_COMPILER_KEY = "CC" CPP_COMPILER_KEY = "CXX" C_LINKER_KEY = "LD" CPP_LINKER_KEY = "LDPLUSPLUS" CLANG_PATH_KEY = "COMPILATION_DB_CLANG_PATH" DB_FILENAME = "compile_commands.json" DB_PATH...
from odoo import _, api, exceptions, fields, models from odoo.exceptions import ValidationError from odoo.tools import config from odoo import release import contextlib import os import tempfile import base64 import logging _logger = logging.getLogger(__name__) try: import OpenSSL.crypto if tuple(map(int, Op...
#!/usr/bin/env python # ZBWarDrive # rmspeers 2010-13 # ZigBee/802.15.4 WarDriving Platform import logging from subprocess import call from time import sleep from usb import USBError from killerbee import KillerBee, kbutils from scanning import doScan def goodLat(lat): return lat > -180.00000005 and lat < 180...
__author__ = 'saeedamen' # Saeed Amen # # Copyright 2016 Cuemacro # # 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 l...
from olv_dialog_controller import OlvDialogController from algorithm_defaults import AlgorithmDefaults from sqlalchemy import and_ class AlgorithmDefaultsController(OlvDialogController): """ Controller class for Wound Assessment Dialogs which performs various queries, adds, updates, and deletes records fr...
from troposphere import Parameter, Ref, Template, GetAZs, Select, ImportValue, Sub, Tags from troposphere.rds import DBInstance, DBSubnetGroup import boto3 import os t = Template() t.add_description( "AWS CloudFormation Sample Template RDS_with_DBParameterGroup: Sample " "template showing how to create an Ama...
import os import sys import pygame import random import model import planningScreen import background import scrollingBackground import incint import soundSystem from constants import * class Model(model.Model): def __init__(self, characters): super(Model, self).__init__() self.goBack = False ...
import fpectl from JSBSim_utils import JSBSimTestCase, CreateFDM, RunTest, ExecuteUntil class CheckScripts(JSBSimTestCase): def testScripts(self): fpectl.turnon_sigfpe() for s in self.script_list(['737_cruise_steady_turn_simplex.xml']): fdm = CreateFDM(self.sandbox) try: ...
import os import sys import time import random import argparse from contextlib import closing from poppy.creatures import PoppyErgo from utils import timeit MAX_TRIALS = 5 if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--board', type=str, default='unknown') parser.ad...
import sys import tkinter import logging import threading from time import sleep from threading import Thread, Lock # Zynthian specific modules from . import zynthian_gui_config #------------------------------------------------------------------------------ # Zynthian Auto-EQ GUI Class #-----------------------------...
# -*- coding: utf-8 -*- """ *************************************************************************** GridInvDist.py --------------------- Date : October 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com *************...
from oslo_config import cfg from nova.openstack.common import log as logging from nova.scheduler import filters from nova.scheduler import utils LOG = logging.getLogger(__name__) CONF = cfg.CONF CONF.import_opt('weight_setting', 'nova.scheduler.weights.metrics', group='metrics') cla...
# -*- coding: utf-8 -*- """ This module contains all the quality of healthcare (QOHC) questionnaire models :subtitle:`Class definitions:` """ from django.db import models from django.utils.translation import ugettext as _ from apps.questionnaire.models import QuestionnaireBase DEFAULT_TEN_SCORE = ( (1, 1), (2...
from __future__ import absolute_import from collections import namedtuple import tornado import tornado.gen from tchannel.messages import common from tornado.iostream import StreamClosedError from tchannel import retry from ..glossary import DEFAULT_TIMEOUT from ..messages import ErrorCode from ..messages.common im...
from sympy.core.containers import Tuple from types import FunctionType class TableForm(object): """ Create a nice table representation of data. Example:: >>> from sympy import TableForm >>> t = TableForm([[5, 7], [4, 2], [10, 3]]) >>> print t 5 7 4 2 10 3 You can use the ...
# -*- coding: utf-8 -*- """ instabot example Workflow: Follow user's followers by username. """ import sys import os import argparse sys.path.append(os.path.join(sys.path[0], '../')) from instabot import Bot parser = argparse.ArgumentParser(add_help=True) parser.add_argument('-u', type=str, help="us...
# -*- encoding: utf-8 -*- # Made by http://www.elmalabarista.com # This will teach about how use parse.com as your database # About # parse.com is a SAAS that provide a ready-to-use NOSQL backend # and related services, great for quick prototypes. Also, can be used # from several plataforms and languages # Official ...
"""Test transaction signing using the signrawtransaction* RPCs.""" from test_framework.address import check_script, script_to_p2sh from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error, find_vout_for_address, hex_str_to_bytes from test_fram...
#!/usr/bin/env Python """ Definition List Extension for Python-Markdown ============================================= Added parsing of Definition Lists to Python-Markdown. A simple example: Apple : Pomaceous fruit of plants of the genus Malus in the family Rosaceae. : An american computer co...
import os, random, requests import psycopg2 import urllib.parse from random import randint, choice, shuffle from urllib.parse import urlparse from flask import Flask, session from flask_restful import Resource, Api from flask_assistant import Assistant, ask, tell, event, context_manager, request from flask_assistant...
import os from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand import sys import uuid from taskwarrior_context_capsule import __version__ as version_string requirements_path = os.path.join( os.path.dirname(__file__), 'requirements.txt', ) try: from pip.req i...
import csv, re, codecs, cStringIO from pattern.web import URL, DOM class UnicodeWriter: def __init__(self, f, dialect=csv.excel, encoding="utf-8-sig", **kwds): self.queue = cStringIO.StringIO() self.writer = csv.writer(self.queue, dialect=dialect, **kwds) self.stream = f self.encode...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'FlickrConfigWidget.ui' # # by: pyside-uic 0.2.13 running on PySide 1.1.0 # # WARNING! All changes made in this file will be lost! from PySide import QtCore, QtGui class Ui_FlickrConfigWidget(object): def setupUi(self, FlickrConfig...
"""Fava's main WSGI application. when using Fava's WSGI app, make sure to set ``app.config['BEANCOUNT_FILES']``. To start a simple server:: from fava.application import app app.config['BEANCOUNT_FILES'] = ['/path/to/file.beancount'] app.run('localhost', 5000) Attributes: app: An instance of :class:`f...