code
stringlengths
1
199k
""" *************************************************************************** aboutdialog.py --------------------- Date : July 2013 Copyright : (C) 2013-2018 by Alexander Bruy Email : alexander dot bruy at gmail dot com ************************************...
import command, json, xbmc, re _DEBUG_JSON=False strmall=lambda x,y: x.count(y) # >0 if substring matches strmlow=lambda x,y: x.lower().count(y.lower()) # >0 if substring matches case insensitive strmany=lambda x,y: all([False for i in y.lower().split() if i not in x.lower()]) # True if all components of substring matc...
from bs4 import BeautifulSoup import urllib2 import sched, time import os s = sched.scheduler(time.time, time.sleep) def getInfo(): os.system('cls') os.system('clear') resp = urllib2.urlopen("https://www.reddit.com/r/smashbros/comments/3dmmuq/evo_general_tournament_thread_live_updates_ft/") data = resp....
import atk as __atk import gio as __gio import gobject as __gobject import gobject._gobject as __gobject__gobject from VBox import VBox class ColorSelection(VBox): """ Object GtkColorSelection Signals from GtkColorSelection: color-changed () Properties from GtkColorSelection: has-palette -> ...
import json import logging from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.shortcuts import redirect, render from django.views.decorators.csrf import csrf_exempt import requests from .models i...
""" Kristoffer Langeland Knudsen rainbowponyprincess@gmail.com """ import os import re import sys import time import urllib import httplib import sqlite3 as sql import xml.etree.ElementTree as ElementTree import database as db import container global cache global cachedir global cfgtree global usrtree def initialize(co...
from modules.page_mount import Principal page = Principal() page.mount( page='distribution.detail', category='main', js=('ext.jquery', 'ext.json', 'loc', 'data_div_manipulation','feedback', 'open_popup'), css=('location', 'distribution.default','default.detail') ...
import requests import re prodid_re = re.compile("productionId\":\"(.+?)\",") stream_re = re.compile("<MediaFiles base=\"(.+?)\"") format_re = re.compile("mp4:production/priority/rtmpecatchup/.+?\\.mp4") srv_url = "http://mercury.itv.com/PlaylistService.svc" player_url = "https://www.itv.com/mediaplayer/releases/2.13...
prog='mp4plexname' version='0.4' author='Carl Edman (CarlEdman@gmail.com)' desc='Rename TV show extras Plex perferred format.' import argparse import glob import logging import logging.handlers import os import os.path import re from cetools import * parser = None args = None log = logging.getLogger() def plexRename(di...
from django.db import migrations import django_crypto_fields.fields.encrypted_char_field import django_crypto_fields.fields.encrypted_text_field import edc_base.model_validators.phone class Migration(migrations.Migration): dependencies = [ ('edc_locator', '0003_auto_20180103_1351'), ] operations = [...
from neolib.plots.Step import Step class GetBandage(Step): _paths = { 'door': '//area/@href', 'action': '//*[@id="content"]/table/tr/td[2]/center/form/@action', } def __init__(self, usr): super().__init__(usr, '', '', False) # Setup link self.link = 'http://www.neopet...
__author__ = 'Antons Rebguns' __copyright__ = 'Copyright (c) 2010-2011 Antons Rebguns' __license__ = 'BSD' __maintainer__ = 'Antons Rebguns' __email__ = 'anton@email.arizona.edu' import math import rospy from dynamixel_driver.dynamixel_const import * from dynamixel_controllers.srv import SetSpeed from dynamixel_control...
"""Comix - GTK Comic Book Viewer Copyright (C) 2005-2009 Pontus Ekberg <herrekberg@users.sourceforge.net> """ import os import sys import gettext import getopt try: import pygtk pygtk.require('2.0') import gtk assert gtk.gtk_version >= (2, 12, 0) assert gtk.pygtk_version >= (2, 12, 0) except Asserti...
''' zen Add-on Copyright (C) 2016 zen 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 option) any later version. This program i...
import os import sys import time import connection from spacewalk.common import rhnLib from spacewalk.common.rhnConfig import CFG sys.path.append("/usr/share/rhn") from up2date_client import config from syncLib import log, log2, RhnSyncException from rhn import rpclib class BaseWireSource: """ Base object for wire-...
from time import time import sys import os import re from glob import glob from sklearn.cross_validation import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.datasets import load_mlcomp from sklearn.feature_extraction.text import TfidfVectorizer import numpy as np from sklearn.neighbors...
""" WSQL ==== An asynchronous DB API v2.0 compatible interface to MySQL --------------------------------------------------------- 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 th...
import os.path from picard import config from picard.coverart.image import ( CoverArtImage, TagCoverArtImage, ) import picard.formats from picard.metadata import Metadata from .common import ( CommonTests, load_metadata, save_and_load_metadata, skipUnlessTestfile, ) def file_save_image(filename,...
""" *************************************************************************** RegularPoints.py --------------------- Date : September 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com **********************************...
import select import socket import time import sys import struct import getopt import signal import types import string import os import os.path import imp import pygraphviz as pgv from subprocess import * import threading import tools import plugger import timer from node import Node,EndNode,cleanRoute, uniq from impa...
""" help.py - contains menu structures for help menus in CP CellProfiler is distributed under the GNU General Public License. See the accompanying file LICENSE for details. Copyright (c) 2003-2009 Massachusetts Institute of Technology Copyright (c) 2009-2015 Broad Institute All rights reserved. Please see the AUTHORS f...
import askap.analysis.data from numpy import * import MySQLdb from optparse import OptionParser SKADS_host = "gijane.atnf.csiro.au" SKADS_user = "skads" SKADS_pass = "skads" SKADS_db = "S3SEX" if __name__ == '__main__': parser = OptionParser() parser.add_option("-H","--Host", dest="host", default=SKADS_host, he...
import MySQLdb import sys try: # Create connection to database db = MySQLdb.connect(host='rtdb',port=3306, passwd='toor',db='racktables',user='root') except MySQLdb.Error: e = sys.exc_info()[1] print("Error %d: %s" % (e.args[0],e.args[1])) sys.exit(1)
import os import sys os.chdir(os.path.dirname(os.path.abspath(__file__))) importPath = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../util')) if not importPath in sys.path: sys.path.insert(1, importPath) del importPath import FlatMeshGenerator def main(): FlatMeshGenerator.bifurcation = False ...
from core import * from config import HIRES __all__ = ['Sizer', 'HSizer', 'VSizer'] class BlankBox: ''' An empty space that you can put in a BoxSizer ''' def size(self, l, t, r, b): pass class Box: ''' A box that holds a window. It should not be used directly, but it is used when you pass ...
from System import * from OgreDotNet import * from Math3D import * from System.IO import * from SwigTorcs import * class OAvatars(object): """ <summary> Load and display avatars. </summary> """ def __init__(self, ctx, scene, situ): """ <summary> Initialize the list of avatar according to current situation. ...
import os import six import warnings from rrmngmnt import errors from rrmngmnt.service import Service from rrmngmnt.resource import Resource class FileSystem(Service): """ Class for working with filesystem. It has same interface as 'os' module. """ def _exec_command(self, cmd): host_executor...
""" Caching of generated images. """ import time import weakref try: import popplerqt5 except ImportError: from . import popplerqt5_dummy as popplerqt5 from PyQt5.QtCore import Qt, QThread from . import render from . import rectangles from .locking import lock __all__ = ['maxsize', 'setmaxsize', 'image', 'gener...
thermostats = {} _next_id = 0 def next_id(): global _next_id _next_id += 1 return _next_id def get_db(): global thermostats return thermostats def clear_thermostats(): global thermostats, _next_id thermostats = {} _next_id = 0 return
import os import sys import subprocess cmd = [ 'git', '--git-dir=' + os.path.join(sys.argv[1], '.git'), '--work-tree=' + sys.argv[1], 'log', '--no-merges', '--date=short', '--max-count=200', '--pretty=tformat:%cd %an <%ae>%n%n %s%n%w(0,0,2)%+b', ] project_dist_root = os.getenv('MESON_PROJECT_DIST_ROO...
from django.core.validators import RegexValidator from django.db import models from edc_base.model.models import BaseUuidModel from .convert import Convert class ConfigurationManager(models.Manager): def get_attr_value(self, attribute_name): """Returns the attribute value in its original datatype assuming i...
import numpy as np import cvxpy as cvx import random n = 1000 #1000 serum samples ps = 20 #10 people are positive ntests = 100 #we have 100 tests ns= 10 #each person deposits a sample into 10 tests A = np.zeros((ntests,n)) #this matrix is the linear blend of the samples implemented by the pipette machine. We ...
from state import State from dictMgr import * class BitMgr: """ This is a serious worker class that provides lots of functionality. We will look at the static class variables and method first, then describe those of the instance. Static Class Variables: - cur: index value of the current bit array ...
if __name__ == "__main__": import subprocess import sys from os import system,unlink from glob import glob from optparse import OptionParser from myplot import errormess from ic import check_file, merge_atm_sfc ############################# ### Get options and variables parser = ...
""" pyblk.traversal =============== Traversing the sysfs hierarchy. .. moduleauthor:: mulhern <amulhern@redhat.com> """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import functools import os from py...
from qgis.core import QgsCoordinateReferenceSystem, QgsCoordinateTransform, QgsVectorLayer, QgsGeometry, QgsProject, QgsRectangle, QgsGeometry, QgsMapLayer, QgsWkbTypes, QgsPointXY from qgis.gui import QgsMapToolEmitPoint, QgsVertexMarker, QgsMapToolIdentifyFeature, QgsMapToolIdentify, QgsMapMouseEvent, QgsRubberBand f...
from django import forms from django.forms import ModelForm, TextInput, PasswordInput from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from my_qrcode.models import Item class CustomUserCreationForm(UserCreationForm): #email = forms.EmailField(required=True) # include t...
import sys import traceback import Ice Ice.loadSlice('Callback.ice') import Demo class CallbackI(Demo.Callback): def initiateCallback(self, proxy, current): print("initiating callback to: " + current.adapter.getCommunicator().proxyToString(proxy)) try: proxy.callback() except Exc...
""" parse the tddft stuff of gaussian """ import sys import argparse from pyparsing import * ParserElement.enablePackrat() def getinput(args): """parse the input""" parser = argparse.ArgumentParser(description="G09 to Table in docx-file converter.") parser.add_argument( "outputfile", metavar...
from PyQt4.QtCore import * from PyQt4.QtGui import * from B_Options import * import re import types import XMLHelper import sys import os.path import constants from xml.dom.minidom import * from MyStringIO import UnicodeStringIO from ScOptions import ScOptions class Options(QDialog, Ui_B_Options): def __init__(self...
from wfuzz.plugin_api.mixins import DiscoveryPluginMixin from wfuzz.plugin_api.base import BasePlugin from wfuzz.exception import FuzzExceptResourceParseError from wfuzz.externals.moduleman.plugin import moduleman_plugin import xml.dom.minidom @moduleman_plugin class sitemap(BasePlugin, DiscoveryPluginMixin): name ...
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 field 'MMCScript.real_time' db.add_column('mmc_mmcscript', 'real_time', ...
""" Module: State machine =========== Reads in sentences and splits them into sub-strings apropriately :copyright: (C) 2015 Katharina Sabel <SpaceKookie> :license: GPLv2 (See LICENSE) """ _A_ = 'A' _B_ = 'B' _C_ = 'C' class StateReader: def make(self, input_lang): input_lang += " " STATE = _A_ collection = [] ...
import scrapy class PhotoItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() pass
""" This is certainly the second simplest plugin ever. """ from peppy.yapsy.IPlugin import IPlugin class VersionedPlugin12(IPlugin): """ Only trigger the expected test results. """ def __init__(self): """ init """ # initialise parent class IPlugin.__init__(self) print("Version 1.2") def activate(self):...
""" Module to perform AM-FM on EEG data. """ __author__ = "Alvaro Ulloa" __copyright__ = "Copyright 2015, Mind Research Network" __credits__ = ["Alvaro Ulloa"] __licence__ = "3-clause BSD" __email__ = "aulloa@mrn.org" __maintainer__ = "Alvaro Ulloa" import argparse import logging import matplotlib matplotlib.use("Agg")...
import logging import datetime from time import sleep from threading import Thread import json from zoom.agent.predicate.simple import SimplePredicate from zoom.agent.predicate.time_window import TimeWindow from zoom.agent.entities.thread_safe_object import ThreadSafeObject from zoom.common.decorators import connected ...
from monstres import * from time import time image_joueur = sf.Image.from_file("images/joueur.png") image_joueur.create_mask_from_color(sf.Color(255, 255, 255)) JOUEUR = sf.Texture.from_image(image_joueur) class Joueur(EntiteMobile): def __init__(self): super(Joueur, self).__init__(w_image=64, h_image=128, ...
import sys import os import traceback import xbmc import xbmcaddon import xbmcgui if sys.version_info < (2, 7): import simplejson else: import json as simplejson __addon__ = xbmcaddon.Addon(id='script.sonos') __addonid__ = __addon__.getAddonInfo('id') __cwd__ = __addon__.getAddonInfo('path').decode("utf-8") __v...
""" Utilities for database connections Copyright 2005 Fourthought, Inc. (USA). Detailed license and copyright information: http://4suite.org/COPYRIGHT Project home, documentation, distributions: http://4suite.org/ """ __all__ = ['EscapeQuotes'] try: from EscapeQuotesc import escape as EscapeQuotes except ImportErro...
import unittest from TestServer import TestServer from spacewalk.server import xp, rhnSQL class ListMissingTestCase( unittest.TestCase ): def setUp( self ): self.directory = '/home/devel/wregglej/downloads/srcrpms' self.myserver = TestServer() self.myserver.upload_packages( self.directory, s...
try: # use python-libdiscid (http://pythonhosted.org/python-libdiscid/) from libdiscid.compat import discid except ImportError: try: # use python-discid (http://python-discid.readthedocs.org/en/latest/) import discid except ImportError: discid = None import traceback from PyQt5 i...
__all__ = ['Volatility-1.3_Beta']
__author__ = "Felix Wittmann" __copyright__ = "Copyright 2014, geoio - happy bits GmbH" __credits__ = ["Andrew Teil"] __version__ = "0.1" __maintainer__ = "Felix Wittmann" __email__ = "felix@geo.io" __status__ = "Development"
import subprocess from ..helpers.command import Command from ..helpers.orm import Scores def get_scores(cursor): rows = cursor.query(Scores).all() return {row.nick: row.score for row in rows} @Command(['bc', 'math'], ['db']) def cmd(send, msg, args): """Evaluates mathmatical expressions. Syntax: {comman...
inode = { size device_id user_id group_id file_mode timestamps link_count block_pointer} user_file = { file_name file_path user_id} inode = get_file(user_file)
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('monitor', '0004_auto_20141206_1911'), ] operations = [ migrations.RemoveField( model_name='downtime', name='checks', ), ...
"""Plotextractor API.""" from .api import process_tarball __all__ = ( "process_tarball", )
''' Created on 2 Apr 2012 @author: Éric Piel Copyright © 2012-2014 É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 ...
import six from contextlib import contextmanager from lxml import etree from translate.storage import base from translate.storage.placeables import StringElem, xliff from translate.storage.xml_extract import misc, xpath_breadcrumb class Translatable(object): """A node corresponds to a translatable element. A node m...
from base import ServerTests from operator import itemgetter from pulp.plugins.loader import api as plugin_api from pulp.server.managers import factory as managers from pulp.plugins.types import database as unit_db from pulp.server.db.model.repository import Repo from pulp.server.db.model.repository import RepoContentU...
''' scripts.paperdata.create_db creates tables outlined in database author | Immanuel Washington ''' from paper.data import dbi as pdbi if __name__ == '__main__': dbi = pdbi.DataBaseInterface() dbi.create_db()
""" Objects Module -------------- This module contains just a single function to collect all user specific bacpypes Objects. """ from __future__ import absolute_import from .basic import * from .define import get_initial_object_list from .hardware import discover_hardware_objects ModuleLogger() def get_object_list(): ...
""" Views related to contents """ from rest_framework.viewsets import ModelViewSet from linkitos.models import Content, Tag from linkitos.serializers import ContentSerializer, TagSerializer class ContentViewSet(ModelViewSet): """ Content API Views """ queryset = Content.objects.all() serializer_clas...
import os from cms.models import CMSPlugin, Page from cms.utils.compat.dj import python_2_unicode_compatible from django.core.exceptions import ValidationError from django.db import models from django.utils.translation import ugettext_lazy as _ try: from cms.models import get_plugin_media_path except ImportError: ...
""" PPP (Point to Point Protocol) [RFC 1661] """ import struct from kamene.packet import * from kamene.layers.l2 import * from kamene.layers.inet import * from kamene.fields import * class PPPoE(Packet): name = "PPP over Ethernet" fields_desc = [ BitField("version", 1, 4), BitField("type", 1...
from __future__ import print_function import os import redo import requests import sys try: from buildconfig import substs except ImportError: # Allow standalone use of this script, for use in TaskCluster from os import environ as substs url = 'https://crash-stats.mozilla.com/symbols/upload' if 'SOCORRO_SYM...
a = str(raw_input()) flag=0 b=a.find('h') if(b==-1): print "NO" flag=1 if(flag==0): a = a[b+1:] c = a.find('e') print if(c==-1): print "NO" flag=1 if(flag==0): a = a[c+1:] d = a.find('l') if(d==-1): print "NO" flag=1 if(flag==0): a = a[d+1:] e = a.find('l') if(e==-1): print "NO" flag=1 if(flag==...
from threading import Thread class OSCController(Thread): def __init__(self, port): Thread.__init__(self) import liblo self.port = port try: self.server = liblo.Server(self.port) except liblo.ServerError, err: print str(err) def add_method(self, pa...
from scipy.stats import genpareto import matplotlib.pyplot as plt fig, ax = plt.subplots(1, 1) c = 0.1 mean, var, skew, kurt = genpareto.stats(c, moments='mvsk') x = np.linspace(genpareto.ppf(0.01, c), genpareto.ppf(0.99, c), 100) ax.plot(x, genpareto.pdf(x, c), 'r-', lw=5, alpha=0.6, label='genp...
"""Module for checking entry fee.""" from game import food_checker from game import resource class TooMuchError(Exception): pass class FrancTooMuchError(TooMuchError): pass class FoodTooMuchError(TooMuchError): pass class EntryFeeChecker(object): def __init__(self, fee): self._fee = fee def Check(self, re...
""" pyqt_distutils.pyqwt_sip_output_patch Patches the *.cpp, *.h and *.py files produced by sip. """ import os, re def pyqwt_sip_output_patch(directory, name): """Patch the output of the code generated by sip. """ print '... patching the code generated by sip' cpp_module = os.path.join(directory, '%scmo...
n=20 if n<0: print "Cannot generate factorial of negative numbers." else: a=1 while n>0: a=a*n n=n-1 print a
class setQuery(object): specialFields = {} operators = { 'default' : u'({field}={value})', 'conditions': { 'gt' : u'({field}>{value})', 'ge' : u'({field}>={value})', 'lt' : u'({field}<{value})', 'le' : u'({field}<={value})', 'eq' : u'({field}={value})', }, 'wrapper' : { 'not' : u'(!{query})'...
import sys import copy import numpy as np import talib as ta from myquant.series.BarSeries import BarSeries from myquant._log import logger class FeatureGenerator: def __gen_close(quotation, config): feat = {} length = quotation.length() close = quotation.get_close() win_len = config...
""" Input system module demo """ from doormon.input import Input if __name__ == "__main__": def open(): print "Open!" def close(): print "Close!" input = Input(open, close) input.start()
import Trees as Trees import random import TreeFunctions class TreeConfig: def __init__(self): self.functionProb = 0.6 self.parameterProb = 0.3 self.functions = TreeFunctions.arithFunctions DefaultTreeConfig = TreeConfig() class ExpressionNode: def __init__(self, data, nextnode, func, da...
''' Created on Dec 25, 2012 @author: Paulson McIntyre (GpMidi) <paul@gpmidi.net> ''' import logging DEFAULT_LOGGING_LEVEL = logging.DEBUG logging.basicConfig(level = DEFAULT_LOGGING_LEVEL) log = logging.getLogger("Fourchapy.tests.ConfigBase") log.setLevel(DEFAULT_LOGGING_LEVEL) DEFAULT_CONFIG_FILE = 'test.conf.ini' fro...
from pisi.actionsapi import shelltools, get, autotools, pisitools def setup(): autotools.configure () def build(): autotools.make () def install(): autotools.install () #pisitools.dodoc ("AUTHORS", "ChangeLog", "COPYING")
from twisted.internet.defer import Deferred, DeferredList from twisted.python.failure import Failure from twisted.trial.unittest import TestCase import smartanthill.litemq.exchange as ex from smartanthill.exception import LiteMQResendFailed class LiteMQCase(TestCase): g_resent_nums = 0 def test_declare_exchange...
from rest_framework import serializers from .models import Nota, Categoria class NotaSerializer(serializers.ModelSerializer): class Meta: model = Nota field = ('titulo','description','categoria') depth = 1
import sys lista = [] def push(item): lista.append(item) def pop(): return lista.pop() def lene(): return len(lista) def clean(): lista[:] = [] def item(x): return lista[x] test_cases = open(sys.argv[1], 'r') for test in test_cases: problem = test.rstrip().split(" ") for x in problem: push(x) for x in xrange...
import subprocess, os, time, random,resource import matplotlib.pyplot as plt import numpy import ROOT from ROOT import * from deap import base from deap import creator from deap import tools from deap import algorithms creator.create("FitnessMax", base.Fitness, weights=(-1.0,)) creator.create("Individual", list, fitnes...
from django.utils import timezone from edc_registration.models import RegisteredSubject from edc_appointment.models import Appointment from edc_constants.constants import YES, NO, NEG from microbiome.apps.mb.constants import INFANT from microbiome.apps.mb_infant.forms import InfantFuForm from microbiome.apps.mb_infant....
""" Copyright (C) 2015 John David Pressman This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the ho...
INTERNAL_IPS = ('0.0.0.0', '127.0.0.1', '::1') ALLOWED_HOSTS = ['127.0.0.1', 'localhost'] SECRET_KEY = '%5@l_k_=161v!k7$oe%4hw6khybi5x@5ct32sx95+#keb-#x)j' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'pbw', 'USER': 'app_pbw', 'PASSWORD': 'pbw', # ...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'List' db.create_table('lists', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ...
"""Loans."""
""" @copyright Copyright (c) 2014 Submit Consulting @author Angel Sullon (@asullom) @package utils Descripcion: Decorador para validar los permisos de los usuarios """ from django.utils.translation import ugettext as _ # , ungettext from functools import wraps from django.utils.decorators import available_a...
""" $Id: Lib.py,v 1.11.2.3 2007/05/22 20:27:40 customdesigned Exp $ This file is part of the pydns project. Homepage: http://pydns.sourceforge.net This code is covered by the standard Python License. Library code. Largely this is packers and unpackers for various types. """ import string, types import Type import ...
"""网站配置文件""" site_name = u'海淀驾校沙河高教新城报名中心' channels = [ {'name': u'驾校简介', 'name_en': 'introduction', 'title': u'北京市海淀区汽车驾驶学校'}, {'name': u'学车价格', 'name_en': 'price'}, {'name': u'学车流程', 'name_en': 'procedure'}, {'name': u'班车路线', 'name_en': 'shuttlebus'}, {'name': u'联系方式', 'name_en': 'contact'}, {...
""" example code for properties using the decorator syntax """ class C(object): _x = None @property def x(self): return self._x @x.setter def x(self, value): self._x = value @x.deleter def x(self): del (self._x) if __name__ == "__main__": c = C() c.x = 5 p...
''' ThunderGate - an open source toolkit for PCI bus exploration Copyright (C) 2015-2016 Saul St. John 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 Licen...
DATABASE = 'tweepee.db' HOST = '0.0.0.0' PORT = 5000 DEBUG = False SECRET_KEY = 'hin6bab8ge25*r=x&amp;+5$0kn=-#log$pt^#@vrqjld!^2ci@g*b' USERNAME = 'admin' PASSWORD = 'asdf1234' PER_PAGE = 5
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import time import zlib from collections import defaultdict from multiprocessing import Lock from jinja2.exceptions import UndefinedError from ansible.compat.six.moves import queue as Queue from ansible.compat.six import...
import urllib2, re playlist="/var/local/bbc_radio/urls" radios={} radios["BBC1"]="http://www.radiofeeds.co.uk/bbcradio1.pls" radios["BBC1x"]="http://www.radiofeeds.co.uk/bbc1xtra.pls" radios["BBC2"]="http://www.radiofeeds.co.uk/bbcradio2.pls" radios["BBC3"]="http://www.radiofeeds.co.uk/bbcradio3.pls" radios["BBC4"]="ht...
import json with open('/home/prime/tika-classified.json','r') as opfile: total_files = 0 mydata = json.load(opfile) for k in mydata.keys(): v = mydata[k] total_files = total_files + len(v) print(" # of files of {mtype} = {value} ".format(mtype=k, value=len(v))) print(" Total # of files analyzed = {value}".for...
from unittest import TestCase import numpy as np import scipy.signal as scipysig from vrft.utils import * from vrft.extended_tf import ExtendedTF from vrft.vrft_algo import virtual_reference from vrft.iddata import iddata class TestUtils(TestCase): def test_deconvolve(self): t_start = 0 t_end = 10 ...
''' This package provides a python interface to the IBM Informix CISAM library (or alternatively the open source VBISAM replacement library). Additional modules add the ability to add table layout definitions and the idea of rowsets to the underlying library of choice. ''' from .isam import ISAMobject from .enums impor...
"""This is to load plugins, if you leave plugin as the default (None) it will go out and try and load them all. It doesn't return anything. Instead of returning anything it adds the plugins directly onto the connection by access through the connection parameter passed to main. """ import glob import imp import os impor...