code
stringlengths
1
199k
import msc def basic_call(): sts = [("A", "UA A"), ("AP", "P-CSCF A"), ("AI", "I-CSCF A"), ("H", "HSS"), ("ASC", "S-CSCF A"), ("BP", "P-CSCF B"), ("B", "UA B") ] cfg = msc.Config(outdir="./basic_call", outfile="basic_call%d", ...
from flask.views import View from flask import Response from bson import json_util from bson.son import SON from mpada import mongo import flask_pymongo class DeclararedPartyMPsAggregate(View): methods = ['GET'] def dispatch_request(self): ''' Get the asset declaration of a Party for the given Party slu...
from pyramid.config import Configurator def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ config = Configurator(settings=settings) # Get tht Python stuff inside the crdppf_core folder (it's the crdppf folder which contains __init__.py) # this includes all...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cali_water', '0017_hydrologicregion'), ] operations = [ migrations.AddField( model_name='watersupplier', name='april_18_reduction...
def nextpreviterator(i): it = iter(i) def _(): prev, cur, nxt = None, next(it, None), next(it, None) if cur is None: return while cur is not None: yield (prev, cur, nxt) prev, cur, nxt = cur, nxt, next(it,None) return _()
__author__ = """unknown <unknown>""" __docformat__ = 'plaintext' from AccessControl import ClassSecurityInfo from Products.Archetypes.atapi import * from Products.UWOshCommitteeOnCommittees.content.Constituency import Constituency from Products.ATBackRef.BackReferenceField import BackReferenceField, BackReferenceWidget...
from __future__ import unicode_literals, print_function import numpy as np from jinja2 import Template from molbiox.io import tabular from molbiox.frame import interactive from molbiox.frame.locate import locate_template def format_points(data): """ :param data: n*k*2 :return: """ if not isinstance(...
'''The ExportLinker object translates links in zim pages to URLS for the export content ''' import logging logger = logging.getLogger('zim.exporter') from .layouts import ExportLayout from zim.formats import BaseLinker from zim.fs import File, PathLookupError from zim.config import data_file from zim.notebook import Pa...
import fauxfactory import pytest from cfme import test_requirements from cfme.automate.simulation import simulate from cfme.intelligence.reports.dashboards import DefaultDashboard from cfme.intelligence.reports.widgets import AllDashboardWidgetsView from cfme.utils.appliance.implementations.ui import navigate_to from c...
import os import time import cPickle as pickle from enigma import eServiceReference, eServiceCenter, eTimer, eSize, iPlayableService, iServiceInformation, getPrevAsciiCode, eRCInput, pNavigation from Screen import Screen from Components.Button import Button from Components.ActionMap import HelpableActionMap, ActionMap,...
import numpy as np from bokeh.plotting import * from bokeh.models import BlazeDataSource from bokeh.transforms import line_downsample from blaze.server.client import Client from blaze import Data output_server("blaze_source") c = Client('http://localhost:5006') d = Data(c) source = BlazeDataSource() source.from_blaze(d...
from flask import Flask, request from flask.ext.restful import Resource, Api import json app = Flask(__name__) api = Api(app) class ServeResult(Resource): items = 'ERROR' def get(self, lang): if lang == 'en': with open('EN.json') as f: items = json.load(f) elif lang == 'es': with open('E...
import fauxfactory import pytest from cfme import test_requirements from cfme.automate.explorer import Namespace, Class, Method, Domain from utils import error from utils.update import update pytestmark = [test_requirements.automate] def _make_namespace(domain): name = fauxfactory.gen_alphanumeric(8) descriptio...
from django.utils.translation import ugettext_lazy as _ import horizon from openstack_dashboard.dashboards.admin import dashboard class Aggregates(horizon.Panel): name = _("Host Aggregates") slug = 'aggregates' img = '/static/dashboard/img/nav/aggregates1.png' # permissions = ('openstack.services.compute...
import matplotlib.pyplot as plt import numpy as np datafileS = open('3DHiiRegions.csv', 'r') csvFileS = [] for row in datafileS: csvFileS.append(row.strip().split(',')) print len(csvFileS) longS = list() lumS = list() indexS = 0 srcCount = 0 zeroBin = 0 oneBin = 0 twoBin = 0 threeBin = 0 fourBin = 0 fiveBin = 0 six...
""" Tests to validate chargeback costs for resources(memory, cpu, storage) allocated to VMs. The tests to validate resource usage are in : cfme/tests/intelligence/reports/test_validate_chargeback_report.py Note: When the tests were parameterized, it was observed that the fixture scope was not preserved in parametrized ...
import urllib from bs4 import BeautifulSoup debug = True # 设置是否打印log def log(message): if debug: print message def download_image(url, save_path): ''' 根据图片url下载图片到save_path ''' try: urllib.urlretrieve(url, save_path) log('Downloaded a image: ' + save_path) except Exception, e: ...
import numpy as np import serial as ser from Tkinter import * import tkFileDialog as fd from threading import Timer from serial.tools import list_ports from time import sleep import threading import datetime as dt ports = list_ports.comports() port = ports[-1][0] notes = [] minute = [] def getFile(): root = Tk() ...
print "Hello World" print "I'd much rather you 'not'" print "I could have code like this." # comment print "I will now count my chickens:" print "Hens", 25 + 30 / 6 print "What is 3+2?", 3+2 print "Is it greater?". 5 > -2 cars = 100 space_in_acar = 4.0 drivers = 30 passengers = 90 cars_not_driven = cars - drivers cars_...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('LBloggerRoy_db', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='category', options={'verbose_name_plural':...
import os import shutil import tempfile import unittest from cygit2._cygit2 import Repository, GitStatus, LibGit2RepositoryError, \ GitObjectType, LibGit2InvalidError from cygit2.tests.fixtures import RepositoryFixture, Cygit2RepositoryFixture class TestEmptyRepository(RepositoryFixture): def setUp(self): ...
import os import sys from ovirtnode.ovirtfunctions import * from ovirtnode.storage import * from ovirtnode.install import * from ovirtnode.network import * from ovirtnode.log import * from ovirtnode.kdump import * from ovirtnode.snmp import * from ovirt_config_setup.collectd import * print "Performing automatic disk pa...
import os import sys import platform import time import mutagen import quodlibet from quodlibet.util import logging from quodlibet.util.path import mkdir from quodlibet.util.dprint import print_exc, format_exception def format_dump_header(exc_info): """Returns system information and the traceback Args: ...
from config import * from framework import * import os, shutil cwd = os.getcwd() def operations(exchlist=[], removelist=[]): if len(exchlist) == 0 and len(removelist) == 0: return os.chdir(getclonedir()) for a, b in exchlist: os.rename(a, a+'.tmp') os.rename(b, a) os.rename(a...
from urllib import urlopen from BeautifulSoup import BeautifulSoup import re webpage = urlopen('http://www.mustardseed7.org/obstacles_and_incentives_to_faith.html').read() patFinderAffirm = re.compile('<p><em>') patFinderLink = re.compile('<a href="(.*)">') findPatAffirm = re.findall(patFinderAffirm, webpage) findPatLi...
from timeit import timeit tstat = timeit('fn.stat().st_size', setup="from pathlib import Path;fn=Path('../LEDcleaner.pdf')", number=100000) print(f'Time to stat filesize: {tstat:.1f} [sec].') tread = timeit('with fn.open('r') as f: f.seek(1000);', setup="from pathlib import ...
import math import util import pygame from applesauce.sprite import effects class Player(effects.SpriteSheet): def __init__(self, big, location, constraint, flyers, bombs, boomboxes, turkeyshakes, *groups): if big == True: effects.SpriteSheet.__init__(self, util.load_image( "playerBigMove_sheet....
class Bit(object): def __init__(self, start=0, mask=1, register=None): self.register = register self.start = start self.mask = mask << start def set_register(self, register): assert self.register is None self.register = register return self def set(self, value): self.register.value = (...
import sys import urlparse import xbmcaddon class Env: def __init__(self): self.__addon = xbmcaddon.Addon("plugin.audio.mpdclient2") self.__addon_handle = int(sys.argv[1]) self.__base_url = sys.argv[0] self.__addon_args = urlparse.parse_qs(sys.argv[2][1:]) print sys.argv ...
import time import Ice import IceStorm from rich.console import Console, Text console = Console() Ice.loadSlice("-I ./src/ --all ./src/IMU.ice") import RoboCompIMU Ice.loadSlice("-I ./src/ --all ./src/IMUPub.ice") import RoboCompIMUPub import imupubI class Publishes: def __init__(self, ice_connector, topic_manager)...
source("../../shared/qtcreator.py") qmlEditor = ":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget" outline = ":Qt Creator_QmlJSEditor::Internal::QmlJSOutlineTreeView" def main(): sourceExample = os.path.abspath(os.path.join(sdkPath, "Examples", "4.7", "declarative", "k...
from PyQt4.QtGui import * from PyQt4.QtCore import * import PyQt4.QtCore as QtCore from electrum_exe.i18n import _ from electrum_exe import Wallet, Wallet_2of2, Wallet_2of3 import electrum_exe.bitcoin as bitcoin import seed_dialog from network_dialog import NetworkDialog from util import * from amountedit import Amount...
"""Copyleft 2010-2015 Forrest Sheng Bao http://fsbao.net Copyleft 2010 Xin Liu Copyleft 2014-2015 Borzou Alipour Fard PyEEG, a Python module to extract EEG feature. Project homepage: http://pyeeg.org **Data structure** PyEEG only uses standard Python and numpy data structures, so you need to import numpy before u...
from Bio import SeqIO import os, sys from math import floor from itertools import product import numpy as np class Data: def __init__(self, alignment_file, gene_to_orlg_file, seq_index_file = None, two_sites = False, space_list = None, cdna = False, allow_same_codon = False): self.nsites ...
CHAR_MAP = { '0': 0x7e, '1': 0x30, '2': 0x6d, '3': 0x79, '4': 0x33, '5': 0x5b, '6': 0x5f, '7': 0x70, '8': 0x7f, '9': 0x7b, 'a': 0x77, 'b': 0x1f, 'c': 0x4e, 'd': 0x3d, 'e': 0x4f, 'f': 0x47, 'g': 0x7b, 'h': 0x37, 'i': 0x30, 'j': 0x3c, 'k': 0x57, 'l': 0x0e, 'm': 0x54, 'n': 0x15, 'o': 0x1d, 'p':...
"""Process "file:*" sections in node of a metomi.rose.config_tree.ConfigTree. """ from fnmatch import fnmatch from glob import glob from io import BytesIO import os import shlex from shutil import rmtree import sqlite3 import sys from tempfile import mkdtemp from typing import Any, Optional from urllib.parse import url...
def permute9(vals): for a in range(0,len(vals)): for b in range(0,len(vals)): if b in [a]: continue for c in range(0,len(vals)): if c in [a,b]: continue for d in range(0,len(vals)): if d in [a,b,c]: continue for ...
''' Init class Created on 23 aug. 2015 @author: Seko @summary: ''' import os import sys import xbmc import xbmcaddon import xbmcgui import strUtil import constant import miscFunctions import timeit from item import StreamItem from difflib import SequenceMatcher as SM from sourceTemplate import streaming...
from workflow.workflow_component import AbstractWorkflowComponent import Image class Writer(AbstractWorkflowComponent): def pre_invoke(self): pass def invoke(self, context): """Write a GIF file's contents.""" try: img = Image.fromarray(context[self.slots[0]]["uri"], 'w') ...
from PySide import QtGui, QtCore class Display(QtGui.QWidget): def __init__(self, parent, monitor): options = (QtCore.Qt.Window | QtCore.Qt.CustomizeWindowHint | QtCore.Qt.WindowTitleHint) super(Display, self).__init__(parent, options) self.monitor = mon...
"""Miscellaneous utilities. """ import time import socket import re import random import os import warnings from cStringIO import StringIO from types import ListType from email._parseaddr import quote from email._parseaddr import AddressList as _AddressList from email._parseaddr import mktime_tz from email._parseaddr i...
import json import gestalt settings = gestalt.LoadConfig() def test_loadconfig(): assert settings.protocol == 'http' assert settings.host == '0.0.0.0' assert settings.port == '8080' assert settings.index == 'http://0.0.0.0:8080' assert settings.api == 'http://0.0.0.0:8080/api' def test_checkresponse...
try: from setuptools import setup except ImportError: from distribute_setup import use_setuptools use_setuptools() from setuptools import setup setup( setup_requires=['d2to1>=0.2.5', 'stsci.distutils>=0.3'], d2to1=True, use_2to3=True, zip_safe=False )
"""Main object implementations.""" import os import sys import warnings from ubuntu_sso import NO_OP from ubuntu_sso.account import Account from ubuntu_sso.credentials import (Credentials, HELP_TEXT_KEY, PING_URL_KEY, TC_URL_KEY, UI_CLASS_KEY, UI_MODULE_KEY, WINDOW_ID_KEY, SUCCESS_CB_KEY, ERROR_CB_KEY, DENIAL_C...
import sys from setuptools import find_packages from setuptools import setup PY33 = sys.version_info >= (3, 3) version = '0.0.1' long_description = '\n\n'.join([open(f).read() for f in [ 'README.rst', 'LICENSE.rst', 'CHANGELOG.rst', ]]) requires = [ 'pgpdump3', # python3 compatible pgpdump 'pyt...
from cloudbot import hook from cloudbot.event import EventType from plugins import grab import random db_ready = [] def db_init(db, conn_name): """Check to see if the DB has the herald table. Connection name is for caching the result per connection. :type db: sqlalchemy.orm.Session """ global db_ready ...
import mocker import datetime import unittest2 import transaction from pyramid import testing from pyramid.httpexceptions import HTTPServerError from stalker import (db, Project, Status, StatusList, Repository, Task, User, Asset, Type, TimeLog, Ticket) from stalker.db.session import DBSession from ...
""" BORIS Behavioral Observation Research Interactive Software Copyright 2012-2022 Olivier Friard This file is part of BORIS. BORIS 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 Lic...
import os import ycm_core flags = [ '-Wall', '-Wextra', '-Werror', '-Wno-long-long', '-Wno-variadic-macros', '-fexceptions', '-DNDEBUG', '-std=c++11', '-x', 'c++', '-isystem', '../BoostParts', '-isystem', '-isystem', '../llvm/include', '-isystem', '../llvm/tools/clang/include', '-I', '.', '-I', './ClangCompleter', '-I'...
import random class DNA(object): genesLength = 5 energy = { 'name': 'energy', 'min': 100, 'max': 140 } mass = { 'name': 'mass', 'min': 2.4, 'max': 4.2 } maxspeed = { 'name': 'maxspeed', 'min': 2.5, 'max': 1.0 } maxfo...
__author__ = "Frederic F. MONFILS" __version__ = "$Revision: $".split()[1] __revision__ = __version__ __date__ = "$Date: $" __copyright__ = "Copyright (c) 2008-2009 Junior (Frederic) FLEURIAL MONFILS" __license__ = "GPLv3" __contact__ = "ffm at cetic.be" import compiler from core.metric import Metric from core.utils im...
import re import time from collections import deque from sqlalchemy import Table, Column, String, PrimaryKeyConstraint, Float, select, and_ from cloudbot import hook from cloudbot.event import EventType from cloudbot.util import timeformat, database table = Table( 'seen_user', database.metadata, Column('nam...
adi = False save = True formato = 'jpg' dircg = 'fig-sen' nome = 'leme-acel-r-cg' titulo = ''#'Curva de Giro' pc = 'k' r1c = 'b' r2c = 'y' r3c = 'r' ps = '-' r1s = '-' r2s = '-' r3s = '-' import os import scipy as sp import matplotlib.pyplot as plt from libplot import * acehis = sp.genfromtxt('../entrada/padrao/CurvaGi...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: influxdb_user short_description: Manage InfluxDB users descrip...
""" colletion of functions for gce networking https://cloud.google.com/compute/docs/reference/latest/networks """ from googleapiclient import errors import buttlib def list_networks(client): networks = [] request = client.connection.networks().list(project=client.project) while request is not None: ...
import os import json import sqlite3 import tempfile from web.common import Extension from web.database import Database class SqliteViewer(Extension): # Paths should be relative to the extensions folder extension_type = 'filedetails' extension_name = 'SqliteViewer' def run(self): db = Database()...
extensions = [ 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', ] source_suffix = '.rst' master_doc = 'index' project = u'pyrenn' copyright = u'2016, Dennis Atabay' author = u'Dennis Atabay' version = '0.1' release = '0.1' exclude_patterns = ['_build'] htmlhelp_basename = 'pyrenndoc' latex_elements = { 'pape...
s = "Hello" c = ["H", 2, "Hello"] print(c) print(c[2]) print(type(c[2])) print(dir(list)) c.append(3) print(c)
from mock import Mock, call from datetime import datetime from utils import strip_the_lines from countyapi.court_date_info import CourtDateInfo class TestCourtDateInfo: """ Tests CourtDateInfo class. ::_parse_court_location - incorrect # of lines or other unknown format results in ...
from isat.rules import * from isat.tools import isat_filename from game import GameState from os.path import exists import unittest class TestHit(unittest.TestCase): def setUp(self): self.mock_1 = GameState(['AB', 'CD'], 301, 'fake1', True) self.mock_1.advance_player() self.mock_1.add_dart('...
"""This is a WeeWX extension that uploads data to WindGuru. http://www.windguru.cz/ Station must be registered first by visiting: https://stations.windguru.cz/register.php The preferred upload frequency (post_interval) is one record every 5 minutes. Minimal Configuration: [StdRESTful] [[WindGuru]] station_i...
from friture.analyzer import main if __name__ == '__main__': main()
import argparse import logging from pyctools.core.compound import Compound import pyctools.components.arithmetic import pyctools.components.colourspace.yuvtorgb import pyctools.components.deinterlace.halfsize import pyctools.components.fft.fft import pyctools.components.fft.tile import pyctools.components.fft.window im...
import subprocess from ansible import utils, errors class LookupModule(object): def __init__(self, basedir=None, **kwargs): self.basedir = basedir def run(self, terms, **kwargs): p = subprocess.Popen(terms, cwd=self.basedir, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) (std...
import os import patreon from django.core.management.base import BaseCommand from ...models import Patron class Command(BaseCommand): def process_pledges(self, data): processed = 0 pledges = (pledge for pledge in data['data'] if pledge['type'] == 'pledge') patrons = { patron['id'...
from datetime import datetime, timedelta from flask import url_for, render_template from flask.ext.babel import lazy_gettext from flask.ext.login import current_user from flask.ext.mail import Message from pytz import timezone from enum import Enum from dudel import db, mail from dudel.models.choice import Choice from ...
from __future__ import unicode_literals from wtforms.fields.html5 import URLField from wtforms.validators import URL from indico.web.forms.base import IndicoForm from indico_importer_invenio import _ class SettingsForm(IndicoForm): server_url = URLField(_("Invenio server URL"), validators=[URL()])
""" Simplexml module provides xmpppy library with all needed tools to handle XML nodes and XML streams. I'm personally using it in many other separate projects. It is designed to be as standalone as possible """ from __future__ import annotations from typing import Dict from typing import List from typing import Option...
""" Copyright (c) 2012-2014 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 lat...
"""Modulo para interactuar con base de datos. Puede definirse un motor""" import MySQLdb import sqlite3 import ConfigParser class Datos(): """Encapsula llamadas al motor de base de datos""" def __init__(self, host = "", data = "", motor = ""): """Experimental: posibilidad de inclir como motor SQLite"""...
''' This is the GNU Radio BACHELOR module. Place your Python package description here (python/__init__.py). ''' try: # this might fail if the module is python-only from bachelor_swig import * except ImportError: pass
""" ACCURATE TIME ============= This module defines an AccurateTime object for storing arbitrary precision floating point posix time while keeping the same information as a standard datetime object, keeping consistency between the two INSTALLATION ============ You are free to clone the public git repo as:: $ git cl...
from lxml.html.clean import Cleaner tags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'h7', 'h8', 'br', 'b', 'i', 'strong', 'em', 'a', 'pre', 'code', 'img', 'tt', 'div', 'ins', 'del', 'sup', 'sub', 'p', 'ol', 'ul', 'table', 'thead', 'tbody', 'tfoot', 'blockquote', 'dl', 'dt', 'dd', 'kbd', 'q',...
__all__ = ["CompileRunner"] import sys import platform from utils import runCMD from runner import Runner from logger import log _COMPILE_LOG_FILE = "lastCompileRun.log" class CompileRunner(Runner): # TODO: Create base class for CmakeRunner and Compiler runner that encapsulate common behaviour def __init__(self...
import sys from GnuRadio2 import Demod_RX_Channel import cjson print sys.argv args_orig = cjson.decode(sys.argv[1]) kwords = cjson.decode(sys.argv[2]) print args_orig, kwords args = [] for a in args_orig: if isinstance(a, str): args.append(a.replace('\\', '')) else: args.append(a) for a in kword...
from flask import Blueprint,make_response,jsonify,request,g from models import users from flask_peewee.db import Database from flask.views import MethodView UserAppApi = Blueprint("userapi",__name__) class UserApi(MethodView): #decorators = [] #get the inforamtion of this user /post def get(self,userid,*ar...
if __name__ == '__main__': import ctypes import sys if sys.platform.startswith('linux'): try: x11 = ctypes.cdll.LoadLibrary('libX11.so') x11.XInitThreads() except: print "Warning: failed to XInitThreads()" import os import sys sys.path.append(os.environ.ge...
import logging from heralding.capabilities.handlerbase import HandlerBase from heralding.capabilities.imap import Imap logger = logging.getLogger(__name__) class Imaps(Imap, HandlerBase): """ This class will get wrapped in SSL. This is possible because we by convention wrap all capabilities that ends with th...
import os from starcluster import node from starcluster import volume from starcluster import static from starcluster import exception from base import CmdBase class CmdCreateVolume(CmdBase): """ createvolume [options] <volume_size> <volume_zone> Create a new EBS volume for use with StarCluster """ ...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.ext.associationproxy import association_proxy db = SQLAlchemy() class Course(db.Model): __tablename__ = 'course' id = db.Column(db.Integer, primary_key=True) code = db.Column(db.String(80), unique=True) name = db.Column(db.String(120)) exam...
import django.contrib.postgres.indexes from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('scoping', '0333_auto_20200417_1556'), ] operations = [ migrations.RemoveIndex( model_name='doc', name='gist_trgm_t_idx', ), ...
""" Module to parse NAMD log files. """ from __future__ import absolute_import try: from future_builtins import zip except ImportError: pass from .basefile import ReadOnlyTextFile __all__ = ['NamdLogFile'] class NamdLogFile(ReadOnlyTextFile): """Parse a NAMD log file.""" filetype = "NAMD log" def re...
import time from timeit import default_timer as timer import chess from Board import Board import logging logging.basicConfig() log = logging.getLogger('Battle') log.setLevel(logging.getLevelName('INFO')) STATS_STRING = "\n\tStalemates:\t{0}\n\tPlayer 1 wins:\t{1}\n\tPlayer 2 wins:\t{2}\n" RESULT_STRING = "\n\tResult: ...
from django.shortcuts import render from django.contrib.auth.models import User, Group from rest_framework import viewsets from api.serializers import UserSerializer, GroupSerializer, EventSerializer, GuestSerializer from api.models import Event, Guest class UserViewSet(viewsets.ModelViewSet): ''' 允许用户查看或编辑的API端点 '...
""" Wrapper to run R scripts processing scenario results. """ import os import sys import argparse import subprocess from pkg_resources import resource_filename def main(): parser = argparse.ArgumentParser(description='Run the chitwanabm agent-based model (ABM).') parser.add_argument(dest="directory", metavar="...
import os import re import urllib.parse import time import logging from collections import UserDict, defaultdict from fnmatch import fnmatch from xon_db.crc import crc_block KEYPAIR_RE = re.compile(r'\\([^\\"]+)\\([^\\"]+)') DB_BUCKETS = 8192 logger = logging.getLogger(__name__) class XonoticDBException(Exception): ...
import sys import platform import os.path import unittest if sys.version_info[0] != 3: sys.exit('\nERROR: You are using an unsupported version of Python. ' 'Python3 is required.\n') PATH = os.path.realpath(os.path.abspath(__file__)) sys.path.insert(0, os.path.dirname(os.path.dirname(PATH))) try: fr...
""" Repository tree items that are read using import routines of Scipy See http://docs.scipy.org/doc/scipy-0.16.0/reference/io.html """ from __future__ import absolute_import import logging, os import scipy import scipy.io import scipy.io.wavfile from argos.repo.memoryrtis import ArrayRti, SliceRti, MappingRti from...
import sys from PySide import * class GenericWorker(QtCore.QObject): kill = QtCore.Signal() def __init__(self, mprx): super(GenericWorker, self).__init__() self.proxyData = mprx["proxyData"] self.name = mprx["name"] self.mutex = QtCore.QMutex(QtCore.QMutex.Recursive) self.Period = 30 self.timer = QtCore.Q...
import numpy as np import pandas as pd import scipy as sp import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import os, sys try: import cPickle as pickle except: import pickle pathdir='../echoRD' #path to echoRD lib_path = os.path.abspath(pathdir) sys.path.append('/home/ka/ka_iwg/ka_oj4748/ec...
from __future__ import unicode_literals import base64 import json import re from .common import InfoExtractor from .theplatform import ThePlatformIE from .adobepass import AdobePassIE from ..compat import compat_urllib_parse_unquote from ..utils import ( int_or_none, js_to_json, parse_duration, smuggle_...
import pytest import numpy as np from cplpy import run_test, prepare_config, parametrize_file import os import sys import subprocess try: from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile except: "Error: PyFoam package is required to run the tests" sys.exit() MD_FNAME = "dummyMD_force...
""" ORCA Open Remote Control Application Copyright (C) 2013-2020 Carsten Thielepape Please contact me by : http://www.orca-remote.org/ 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 Foun...
import tkinter as tk #导入tkinter模块 import tkinter.scrolledtext as tst class Application(tk.Frame): #定义GUI应用程序类,派生于Frame类 def __init__(self, master=None): #构造函数,master为父窗口 tk.Frame.__init__(self, master) #调用父类的构造函数 self.grid() #调用组件的grid方法,调整其显示位置和大小 self.createW...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dogs', '0004_auto_20160812_2243'), ] operations = [ migrations.RenameField( model_name='dog', old_name='status', new_...
import numpy as np import os import pickle from multiprocessing import Pool import glob def filterRaw(path): print ' >> Unpacking files...' os.system( 'unzip ' + path + 'data_raw.zip -d ' + path + ' >> Filter_.log' ) HiveSizes = np.loadtxt(path + 'HiveSizes_tested.log') HiveSizes = np.array(HiveSizes, d...
import os from django.core.files.storage import FileSystemStorage from django.conf import settings class OverwriteStorage(FileSystemStorage): def get_available_name(self, name, *args, **kwargs): if self.exists(name): os.remove(os.path.join(settings.MEDIA_ROOT, name)) return name
import pkg_resources, os def get_data(path): ressource_name = os.path.join("data", path) return pkg_resources.resource_filename("Numerical_CFS", ressource_name) def get_config(path): ressource_name = os.path.join("config", path) return pkg_resources.resource_filename("Numerical_CFS", ressource_name)
import sys from model.Plane import Type import random from base_ai import BaseAI from command import BuildPlaneCommand, MoveCommand, LandCommand class AviationAI(BaseAI): destinations = {} def think(self): while True: self.game.updateSimFrame() self.save_snapshot() se...
import random class Scale(list): def __init__(self, *args): list.__init__(self, *args) def __getitem__(self, degree): assert(type(degree) == int or degree == R) assert(degree != 0) octave_shift = 0 if degree == R: degree = random.choice(self.indexes) i...