code stringlengths 1 199k |
|---|
from jinja2 import Template
class SupervisorJob(object):
"""docstring for SupervisorJob"""
def __init__(self, config):
""" Specify the configuration options for a job.
'config' must be a dictionary containing the following keys:
- env_vars: dict containing the key/value pairs to ... |
from distutils.core import setup
setup(
name = "cnccontrol-driver",
description = "CNC-Control device driver",
author = "Michael Buesch",
author_email = "m@bues.ch",
py_modules = [ "cnccontrol_driver", ],
) |
from xbmctorrentV2 import plugin
from xbmctorrentV2.scrapers import scraper
from xbmctorrentV2.ga import tracked
from xbmctorrentV2.caching import cached_route
from xbmctorrentV2.utils import ensure_fanart
from xbmctorrentV2.library import library_context
BASE_URL = "%s/" % plugin.get_setting("base_bitsnoop")
HEADERS =... |
"""
Python module defining a class for creating movies of matplotlib figures.
This code and information is provided 'as is' without warranty of any kind,
either express or implied, including, but not limited to, the implied
warranties of non-infringement, merchantability or fitness for a particular
purpose.
"""
from fu... |
__author__ = 'andrucuna'
import simplegui
WIDTH = 600
HEIGHT = 400
BALL_RADIUS = 20
init_pos = [WIDTH / 2, HEIGHT / 2]
vel = [0, 3] # pixels per tick
time = 0
def tick():
global time
time = time + 1
def draw(canvas):
# create a list to hold ball position
ball_pos = [0, 0]
# calculate ball position
... |
from supervisorerrormiddleware import SupervisorErrorMiddleware
import os
import sys
import paste.fixture
class DummyOutput:
def __init__(self):
self._buffer = []
def write(self, data):
self._buffer.append(data)
def flush(self):
self._buffer = []
def bad_app(environ, start_response):... |
import os
import sys
import time
import numpy as np
import bge.logic as GameLogic
import settings
import nicomedilib as ncl
import arduino_serial
import serial
import xinput
import random
import copy
from PIL import Image
import gnoomcomm as gc
import gnoomio as gio
import gnoomutils as gu
import chooseWalls
if setting... |
import Gears as gears
from .. import *
from .Base import *
class Solid(Base) :
def applyWithArgs(
self,
spass,
functionName,
*,
color : 'Solid pattern color, or Interactive.*'
= 'white'
) :
... |
import logging
import os
import threading
import time
import usb
import plac
import sim_shell
import sim_ctrl_2g
import sim_ctrl_3g
import sim_reader
import sim_card
from util import types_g
from util import types
from util import hextools
ROUTER_MODE_DISABLED = 0
ROUTER_MODE_INTERACTIVE = 1
ROUTER_MODE_TELNET = 2
ROUT... |
import re
import sys
sys.path.append('..')
from src.link import Link
from src.node import Node
class Network(object):
def __init__(self, config):
self.config = config
self.nodes = {}
self.address = 1
self.build()
def build(self):
state = 'network'
with open(self.c... |
from frontend import views
from rest_framework import routers
from django.conf.urls import patterns, url, include
router = routers.DefaultRouter()
router.register(r'categories', views.CategoryViewSet)
router.register(r'packages', views.PackageViewSet)
router.register(r'files', views.FileViewSet)
router.register(r'clien... |
from olpc import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80))
email = db.Column(db.String(120), unique=True)
def __init__(self, name, email):
self.name = name
self.email = email
def __repr__(self):
return '<Name %r>' % ... |
import distribute_setup
distribute_setup.use_setuptools()
import setuptools
setuptools.setup(
name='gae-console',
description=('Powerful Interactive Console for App Engine applications.'),
version='0.1.0',
packages=setuptools.find_packages(),
author='Dmitry Sadovnychyi',
author_email='gae-console@dmit.ro',
... |
""" Unit tests for script argument utilities. """
from __future__ import print_function, unicode_literals
import pytest
import argparse
from Cerebrum.utils.scriptargs import build_callback_action
class CallbackCalled(Exception):
pass
def test_build_callback_action():
def callback(*args, **kwargs):
raise... |
import openwns
import openwns.logger
from openwns.pyconfig import attrsetter
import openwns.interface
class NeedsFilename(openwns.interface.Interface):
@openwns.interface.abstractmethod
def setFilename(self, filename):
pass
class MeasurementSource(object):
def __init__(self):
object.__init__... |
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import cgi
import SocketServer
import ssl
import re
import setproctitle
import others.dict2xml as dict2xml
import sober.config
import sober.settings
import sober.rule
__version__ = 'Sober HTTP/1.0'
__service__ = 'sober'
class WS... |
__author__ = 'eduardoluz' |
"""
hooking - various stuff useful when writing vdsm hooks
A vm hook expects domain xml in a file named by an environment variable called
_hook_domxml. The hook may change the xml, but the "china store rule" applies -
if you break something, you own it.
before_migration_destination hook receives the xml of the domain f... |
from __future__ import absolute_import
import os
import six
from nose.plugins.attrib import attr
from vdsm.network import errors as ne
from vdsm.network.link import iface as link_iface
from .netfunctestlib import NetFuncTestCase, NOCHK, SetupNetworksError
from .nettestlib import dummy_device, dummy_devices
from .nmnett... |
"""
WSGI config for yookan_todo project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... |
import logging
import os
import imp
from dionaea.core import g_dionaea
import dionaea.tftp
import dionaea.cmd
import dionaea.emu
import dionaea.store
import dionaea.test
import dionaea.ftp
logger = logging.getLogger('ihandlers')
logger.setLevel(logging.DEBUG)
global g_handlers
def start():
logger.warn("START THE IHAND... |
import string
import sys
import types
from xml.sax import saxexts
from xml.sax import saxlib
from xelement import XElement, XTreeHandler
class XElementParser:
def __init__(self, outer_env={}, parser=None):
if parser == None:
self.parser = saxexts.XMLValParserFactory.make_parser()
else:
... |
from DublinCore import DublinCore
import csv
from sys import argv
from xml.dom.minidom import Document
from os.path import basename
DC_NS = 'http://purl.org/dc/elements/1.1/'
XSI_NS = 'http://www.w3.org/2001/XMLSchema-instance'
MACREPO_NS = 'http://repository.mcmaster.ca/schema/macrepo/elements/1.0/'
class TabFile(obje... |
from abc import abstractmethod
class VIFDriver(object):
@abstractmethod
def after_device_destroy(self, environ, domxml):
return domxml
@abstractmethod
def after_device_create(self, environ, domxml):
return domxml
@abstractmethod
def after_network_setup(self, environ, json_content... |
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import numpy as np
import os.path as op
import util
import yt
import MPI_taskpull2
import logging
logging.getLogger('yt').setLevel(logging.ERROR)
dirs = ['/home/ychen/data/0only_0529_h1/',\
'/home/ychen/data/0only_0605_h0/',\
'... |
from __future__ import unicode_literals, print_function, absolute_import
"""JSON flat file database system."""
import codecs
import os
import os.path
import re
from fcntl import flock, LOCK_EX, LOCK_SH, LOCK_UN
import redis
import json
import time
from rophako.settings import Config
from rophako.utils import handle_exc... |
from pymuco.midiio import *
from pymuco.midi import representation
class MidiParser(MidiOutStream.MidiOutStream):
"""
This class listens to a select few midi events relevant for a simple midifile containing a pianomelody
"""
def __init__(self, midifile):
self.midifile = midifile
self.notes_on = {}
s... |
"""MouseTrap's settings handler."""
__id__ = "$Id$"
__version__ = "$Revision$"
__date__ = "$Date$"
__copyright__ = "Copyright (c) 2008 Flavio Percoco Premoli"
__license__ = "GPLv2"
import os
import ConfigParser
import mousetrap.app.environment as env
class Settings( ConfigParser.ConfigParser ):
def ... |
from django.conf.urls import patterns, url
from iyoume.waybill import views as dr
urlpatterns = patterns('',
url(r'^add/', dr.make_waybill),
url(r'^del/', dr.remove_waybill),
url(r'^find/', dr.search_waybill),
url(r'^take/', dr.take_place),
url(r'^trips/', dr.trips),
url(r'^cancel_trip/', dr.can... |
""" cryptopy.cipher.rijndael_test
Tests for the rijndael encryption algorithm
Copyright (c) 2002 by Paul A. Lambert
Read LICENSE.txt for license information.
"""
from cryptopy.cipher.rijndael import Rijndael
from cryptopy.cipher.base import noPadding
from binascii import a2b_hex
import uni... |
import csv, os
from Products.CMFCore.utils import getToolByName
def get_folder(self, type, name):
folder_brains = self.queryCatalog({'portal_type':type, 'title':name})[0]
return folder_brains.getObject()
def create_object_in_directory(self, container, type):
id = container.generateUniqueId(type)
contain... |
import glob,re,sys,math,pyfits
import numpy as np
import utils
if len( sys.argv ) < 2:
print '\nconvert basti SSP models to ez_gal fits format'
print 'Run in directory with SED models for one metallicity'
print 'Usage: convert_basti.py ez_gal.ascii\n'
sys.exit(2)
fileout = sys.argv[1]
sfh = ''; tau = ''; met = ''; ... |
max = A[1]
for i in range(len(A)):
if A.count(A[i]) > A.count(max):
max = A[i]
print(max) |
"""
Created on Fri Aug 29 15:52:33 2014
@author: raffaelerainone
"""
from time import clock
from math import sqrt
def is_prime(n):
check=True
i=2
while check and i<=sqrt(n):
if n%i==0:
check=False
i+=1
return check
start = clock()
lim=50*(10**6)
A=[]
prime_2 = [i for i in rang... |
def main():
print "hola"
print "Como te llmas?"
nombre = raw_input()
print "Buenos dias", nombre
print "Que edad tienes?"
edad = raw_input()
print "que bien te conservas para tener", edad
main() |
"""
EDENetworks, a genetic network analyzer
Copyright (C) 2011 Aalto University
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.... |
import os
from glob import glob
from pyramid.path import AssetResolver
from reportlab.lib.units import mm
from reportlab.pdfgen import canvas
from ..models import generate_random_digest
__all__ = [
'generate_random_filename',
'delete_files',
'NumberedCanvas'
]
def generate_random_filename(path=None, extensi... |
"""
***************************************************************************
ExportGeometryInfo.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************************************... |
import vim
def func_header_snippet(row):
cmt = "//!"
cb = vim.current.buffer
start = row
while start >= 0:
line = cb[start-1].strip()
if not line.startswith(cmt):
break
start -= 1
print("HDR")
def select_snippet(line):
line = line.strip()
if line.startswit... |
import yaml
data = """
f5:
- ip: 192.168.0.1
dc: lx
credentials:
username: huzichun
password: huzichun!@#
role: master
- ip: 192.168.0.2
dc: sjhl
credentials:
username: huzichun
password: huzichun!@#
role: slave
- ip: 192.168.0.3
dc: yd
credentials:
username: huzichun
password: h... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('taxonomy', '0003_auto_20150720_1937'),
]
operations = [
migrations.AddField(
model_name='taxon',
name='extant',
field... |
"""
Authorization module that allow users listed in
/etc/cobbler/users.conf to be permitted to access resources, with
the further restriction that cobbler objects can be edited to only
allow certain users/groups to access those specific objects.
Copyright 2008-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaa... |
"""
Usage: %s [ database_filename ]
"""
import config
import copy
import os
import os.path
import re
import socket
import sqlite3
import ssl
import sys
import thread
import time
import Queue
import select
import xmlrpclib
import logging
import traceback
import struct
import rpc
import netfilter
import malloryevt
import... |
import os.path
import csv
from math import log, exp, pi, sqrt, ceil, floor
from numpy import mean, std, shape
import numpy as np
import random
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from mpl_toolkits.mplot3d import Axes3D
import itertools
annotdir = "output"
plotfontsize = "large" #"xx-small"
namelo... |
import re
import urllib2
import urllib
import cgi
import HTMLParser
try: import simplejson as json
except ImportError: import json
MAX_REC_DEPTH = 5
def Clean(text):
text = text.replace('–', '-')
text = text.replace('’', '\'')
text = text.replace('“', '"')
text = text.replace('”'... |
import sys
import calcoo
import calcoohija
import csv
if __name__ == "__main__":
calc = calcoohija.CalculadoraHija()
with open(sys.argv[1]) as fichero:
reader = csv.reader(fichero)
for operandos in reader:
operacion = operandos[0]
if operacion == "suma":
r... |
from smart.const import BLOCKSIZE
from smart import *
class Uncompressor(object):
_handlers = []
def addHandler(self, handler):
self._handlers.append(handler())
addHandler = classmethod(addHandler)
def getHandler(self, localpath):
for handler in self._handlers:
if handler.que... |
class PGeoException(Exception):
status_code = 400
def __init__(self, message, status_code=None, payload=None):
Exception.__init__(self, message)
self.message = message
if status_code is not None:
self.status_code = status_code
self.payload = payload
def to_dict(se... |
"""text_file
provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes."""
__revision__ = "$Id$"
from types import *
import sys, os, string
class TextFile:
"""Provides a file-like object that takes... |
"""
Created on Thu Jan 21 04:00:41 2016
@author: irnakat
"""
import IOfile
from TFCalculator import TFCalculator as TFC
import TFDisplayTools
fname = 'sampleinput_linear_elastic_1layer_halfspace.dat'
fname2 = 'sampleinput_psv_s_linear_elastic_1layer_halfspace.dat'
datash = IOfile.parsing_input_file(fname)
datapsvs = IO... |
"""
plot magnetic lattice
"""
import matplotlib.pylab as plt
import numpy as np
f12 = 'AWDall.lat'
data12 = np.loadtxt(f12)
plt.plot(data12[:,0], data12[:,1], 'r-',
data12[:,0], data12[:,2], 'b-',
linewidth=2)
plt.xlim([110,240])
plt.ylim([1.5,1.53])
plt.legend([r'$a_u$',r'$a_d$'],1)
plt.xlabel(r'$z\,\mathrm{[m]}... |
from __future__ import with_statement
from collections import defaultdict
from copy import deepcopy
import axiom_rules
import fact_groups
import instantiate
import pddl
import sas_tasks
import simplify
import timers
ALLOW_CONFLICTING_EFFECTS = True
USE_PARTIAL_ENCODING = True
DETECT_UNREACHABLE = True
ADD_IMPLIED_PRECO... |
import Blender
import bpy
def example_function(body_text, save_path, render_path):
sce= bpy.data.scenes.active
txt_data= bpy.data.curves.new('MyText', 'Text3d')
# Text Object
txt_ob = sce.objects.new(txt_data) # add the data to the scene as an object
txt_data.setText(body_text) # set the body text to the com... |
'''
Created on 2/3/2015
@author: Antonio Hermosilla Rodrigo.
@contact: anherro285@gmail.com
@organization: Antonio Hermosilla Rodrigo.
@copyright: (C) 2015 by Antonio Hermosilla Rodrigo
@version: 1.0.0
'''
def UTC2GPS(fecha):
'''
@brief: Método para convertir un objeto de la clase datetime a tiempo GPS
@par... |
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 field 'User.is_admin'
db.add_column(u'accounts_user', 'is_admin',
self.gf('django.db.models.fields.Boole... |
from __future__ import print_function
import sys
from Shine.Configuration.Globals import Globals
from Shine.FSUtils import create_lustrefs
from Shine.Lustre.FileSystem import FSRemoteError
from Shine.Commands.Base.Command import Command, CommandHelpException
from Shine.Commands.Base.CommandRCDefs import RC_OK, RC_FAILU... |
import string
import random
import time
import json
import re
from Config import config
from Plugin import PluginManager
if "sessions" not in locals().keys(): # To keep sessions between module reloads
sessions = {}
def showPasswordAdvice(password):
error_msgs = []
if not password or not isinstance(password... |
"""Subclass of wx.Panel"""
try:
#wxPython
import wx
import wx.grid
import wx.lib.scrolledpanel
#python std library
import sys
#our modules and packages
except ImportError as err:
print(u"ImportError: {}".format(err))
sys.exit("-1")
class ReclassifyPanel(wx.Panel):
"""
Subclas... |
from typing import Any, Dict, List, Union
from flask import abort, flash, g, render_template, url_for
from flask_babel import format_number, lazy_gettext as _
from werkzeug.utils import redirect
from werkzeug.wrappers import Response
from openatlas import app
from openatlas.database.connect import Transaction
from open... |
import os, fcntl, signal
dirlist = []
def notified(sig, stack):
for d in dirlist:
fcntl.fcntl(d.fd, fcntl.F_NOTIFY, (fcntl.DN_MODIFY|fcntl.DN_RENAME|
fcntl.DN_CREATE|fcntl.DN_DELETE))
d.check()
class dir():
def __init__(self, dname):
self.dname ... |
import sys
sys.path.append('code')
import pygame
from pygame.constants import *
import sockgui
sockgui.setDataPath('code')
from converterbase import ConverterBase
import os
import time
import obj2vxp
import obj2vxptex
from error import SaveError,LoadError
import ConfigParser
import vxpinstaller
class obj2vxpGUI(Convert... |
Skip to content
Search or jump to…
Pull requests
Issues
Marketplace
Explore
@zhejoe
9
3028PacktPublishing/Intelligent-Projects-Using-Python
Code Issues 0 Pull requests 0 Wiki Security Insights
Intelligent-Projects-Using-Python/Chapter02/TransferLearning.py
@santanupattanayak santanupattanayak chapter02 changes
67a9665... |
"""
/***************************************************************************
GeobricksTRMM
A QGIS plugin
Download TRMM daily data.
-------------------
begin : 2015-10-06
copyright : (C) 2015 by Geobricks
... |
import scipy.integrate as intg
import numpy as np
h = 6.6261e-34
kB = 1.3806e-23
c = 299792458.0
PI = 3.14159265
eps0 = 8.85e-12
rho=2.417e-8
GHz = 10 ** 9
Tcmb = 2.725
def bbSpec(freq,temp,emis):
occ = 1.0/(np.exp(h*freq/(temp*kB)) - 1)
if callable(emis):
e = emis(freq)
else:
e = emis
r... |
""" wkssvc DCE/RPC """
import dcerpc as __dcerpc
import talloc as __talloc
class NetWkstaInfo1059(__talloc.Object):
# no doc
def __init__(self, *args, **kwargs): # real signature unknown
pass
@staticmethod # known case of __new__
def __new__(S, *more): # real signature unknown; restored from __d... |
from __future__ import unicode_literals
import wx
import widgetUtils
class audio_album(widgetUtils.BaseDialog):
def __init__(self, *args, **kwargs):
super(audio_album, self).__init__(title=_("Create a new album"), parent=None)
panel = wx.Panel(self)
sizer = wx.BoxSizer(wx.VERTICAL)
l... |
"""
uds.utils.dict
~~~~~~~~~~~~~~
Utility functions to parse string and others.
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import copy
def override_dict(new, old):
"""Override old dict object ... |
from __future__ import print_function, division, absolute_import
import six
IDENTITY = "IDENTITY"
CERT_SORTER = "CERT_SORTER"
PRODUCT_DATE_RANGE_CALCULATOR = "PRODUCT_DATE_RANGE_CALCULATOR"
ENT_DIR = "ENT_DIR"
PROD_DIR = "PROD_DIR"
RHSM_ICON_CACHE = "RHSM_ICON_CACHE"
CONTENT_ACCESS_MODE_CACHE = "CONTENT_ACCESS_MODE_CAC... |
""" Defines common, low-level capabilities needed by the Traits package.
"""
from __future__ import absolute_import
import os
import sys
from os import getcwd
from os.path import dirname, exists, join
from string import lowercase, uppercase
from types import (ListType, TupleType, DictType, StringType, UnicodeType,
... |
import time
__author__ = 'mah'
__email__ = 'andrew.makhotin@gmail.com'
import MySQLdb as mdb
import sys
import ConfigParser
import logging
import logging.handlers
import re
import os
from ffprobe import FFProbe
logger = logging.getLogger('Logging for check_sound')
logger.setLevel(logging.DEBUG)
formatter = logging.Form... |
from django.conf.urls import url
urlpatterns = [
url(r'^itemsearch/(?P<index>.*)/(?P<concept_id>.*)/(?P<term>.*)$', 'wikidata.views.search_typed_items'),
] |
import re
import unittest
import jsbeautifier
class TestJSBeautifier(unittest.TestCase):
def test_unescape(self):
# Test cases contributed by <chrisjshull on GitHub.com>
test_fragment = self.decodesto
bt = self.bt
bt('"\\\\s"'); # == "\\s" in the js source
bt("'\\\\s'"); # ==... |
"""
Assorted utility functions for yum.
"""
from __future__ import print_function, absolute_import
from __future__ import unicode_literals
from dnf.pycomp import base64_decodebytes, basestring, unicode
from stat import *
import libdnf.utils
import dnf.const
import dnf.crypto
import dnf.exceptions
import dnf.i18n
import... |
import os
import sys
import math
import glob
import sql
import process_xls as p_xls
""" Change to whatever is needed. """
DEFAULT_DATE_STR = ''
DB_NAME = 'trost_prod'
TABLE_NAME = 'plants2'
TABLE = [
'id INT(11) AUTO_INCREMENT',
'aliquot INT(11)',
'name VARCHAR(45)',
'subspecies_id INT(11)',
'locati... |
'''
*
* Copyright (C) 2013 Simone Denei <simone.denei@gmail.com>
*
* This file is part of pyrsyncgui.
*
* pyrsyncgui 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 yo... |
import os
import pwd
import sys
import shutil
import subprocess
import optparse
import re
import datetime
import time
import openwns.wrowser.Configuration as conf
import openwns.wrowser.simdb.Database as db
import openwns.wrowser.simdb.Parameters as params
import openwns.wrowser.simdb.ProbeDB
import openwns.wrowser.Too... |
'''
Copyright (C) 2016 Quinn D Granfor <spootdev@gmail.com>
This program 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.
This program is distributed in the hope that it will be useful, but
W... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('itemreg', '0008_auto_20160828_2058'),
]
operations = [
migrations.AlterField(
... |
import unittest
from HandlerMock import HandlerMock
from zorpctl.szig import SZIG
class TestSzig(unittest.TestCase):
def setUp(self):
self.szig = SZIG("", HandlerMock)
def test_get_value(self):
self.assertEquals(self.szig.get_value(""), None)
self.assertEquals(self.szig.get_value("servic... |
import subprocess
from xml.dom import minidom
import imaplib
from pycious.lib.common import singleton
class Mail:
def __init__(self, username, password,\
server='imap.gmail.com', port=993):
"""
It returns -1 if there is no connection otherwise it returns
the number of unread... |
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.fixtures.provider import rhel7_minimal
from cfme.infrastructure.provider.rhevm import RHEVMProvider
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.markers.env_markers.provider import ONE_PER_TYPE
from cfme.mar... |
from .db import Database
__version__ = "0.1.1"
__maintainer__ = "Gunther Cox"
__email__ = "gunthercx@gmail.com" |
__author__ = 'snake'
from PyQt4 import QtGui, QtCore
class SiteItems(QtGui.QListWidget):
def __init__(self):
super(SiteItems, self).__init__()
def startDrag(self, dropAction):
# create mime data object
#get all selected items
selitems = ""
for i in self.selectedItems():
... |
"""
Dutch-specific classes for parsing and displaying dates.
"""
from __future__ import unicode_literals
import re
from ..lib.date import Date
from ._dateparser import DateParser
from ._datedisplay import DateDisplay
from ._datehandler import register_datehandler
class DateParserNL(DateParser):
month_to_int = DateP... |
import numpy as np
import fdasrsf as fs
from scipy.integrate import cumtrapz
from scipy.linalg import norm, expm
import h5py
fun = h5py.File('/home/dtucker/fdasrsf/debug_data_oc_mlogit.h5')
q = fun['q'][:]
y = fun['y'][:]
alpha = fun['alpha'][:]
nu = fun['nu'][:]
max_itr = 8000 # 4000
tol = 1e-4
deltag = .05
deltaO = ... |
import os
import sys
import json
import click
import serial
import pkg_resources
import serial.tools.list_ports
import logging.config
from educube.web import server as webserver
import logging
logger = logging.getLogger(__name__)
plugin_folder = os.path.join(os.path.dirname(__file__), 'commands')
def configure_logging(... |
import sys, time, datetime, re, threading
from electrum_creditbit.i18n import _
from electrum_creditbit.util import print_error, print_msg
import os.path, json, ast, traceback
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from electrum_creditbit import DEFAULT_SERVERS, DEFAULT_PORTS
from util import *
protocol_n... |
def horo(channel, user, args):
"""Send "success" message if everything is ok"""
return u'PRIVMSG {channel} :{user}: success'.format(channel=channel,
user=user) |
"""Archive commands for the shar program."""
from .. import util
def create_shar (archive, compression, cmd, verbosity, interactive, filenames):
"""Create a SHAR archive."""
cmdlist = [util.shell_quote(cmd)]
cmdlist.extend([util.shell_quote(x) for x in filenames])
cmdlist.extend(['>', util.shell_quote(a... |
'''
Predict missing words with n-gram model
'''
import sys, argparse
from itertools import izip
from util import tokenize_words
def opts():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('sample', type=argparse.FileType('r'),
help='Sentences with one missing word')
parser.... |
import pygame
import logging
from tools.action import Action
class Speaker(Action):
def __init__(self, id, params):
super(Speaker, self).__init__(id, params)
try:
self.path_to_audio = params["path_to_audio"]
self.repetitions = int(params["repetitions"])
except ValueError as ve: # if repetitions can't be pa... |
import json
import pymarc
from siskin.conversions import (de_listify, imslp_xml_to_marc, osf_to_intermediate)
def test_imslp_xml_to_marc():
example = """<?xml version="1.0"?>
<document docID="imslpvalsskramstadhans">
<localClass localClassName="col">imslp</localClass>
<localClass localClassName="vif... |
import os
import random
import time
import tushare as ts
import math
import pandas
import threading
from MYSORT import *
from programdiary import *
import Stock_config_kit as Skit
import ForgeModel
COLLECTORSHOWNUM=5
fgt={'a':0.01,'a_2':0.01,'lam':0.01}
DIARYNAME='DIARY_Ver.0.1_ty2_0.01_0.01'
def readsinatime(timestr):... |
import pygame
from tools import singleton
@singleton
class Audio(object):
def __init__(self, initial_musics={}, initial_sounds={}):
if pygame.mixer.get_init() is None:
pygame.mixer.init()
self.__mute = False
self.__sounds = initial_sounds
self.__musics = initial_musics
... |
import rospy
import roslib
roslib.load_manifest('clothing_type_classification')
import actionlib
import clothing_type_classification.msg
import std_msgs
from sensor_msgs.msg import Image
from clothing_type_classification.msg import ClothesArray, Clothes
result_clothes = [[0.5, 0.0, 0.7, 50]]
class ClothesDetectionDummy... |
from flask import current_app
from flask.ext.wtf import Form
from flask.ext.security.forms import RegisterForm, LoginForm, RegisterFormMixin
from wtforms import (SelectField, StringField, SubmitField, TextAreaField,
HiddenField, FileField, RadioField, SelectField, IntegerField, ValidationError,
... |
from datetime import datetime
from stacosys.model.comment import Comment
TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
def find_comment_by_id(id):
return Comment.get_by_id(id)
def notify_comment(comment: Comment):
comment.notified = datetime.now().strftime(TIME_FORMAT)
comment.save()
def publish_comment(comment: Commen... |
'''
A Mini-implementation of the Storlet middleware filter.
@author: josep sampe
'''
from swift.common.utils import get_logger
from swift.common.utils import register_swift_info
from swift.common.swob import Request
from swift.common.utils import config_true_value
from storlets.swift_middleware.handlers.base import Swi... |
from distutils.core import setup
from yamlweb import __version__, __progname as name
try:
with open('readme.rst') as f:
long_description = f.read()
except IOError:
long_description = ''
setup(
name = name,
version = __version__,
description = 'Converts YAML to HT... |
import gedit
import gtk
import re
ui_str = """
<ui>
<menubar name="MenuBar">
<menu name="EditMenu" action="Edit">
<placeholder name="EditOps_4">
<menuitem action="DuplicateLine" name="Duplicate line"/>
</placeholder>
</menu>
</menubar>
</ui>
"""
class BetterDefaultsWindowHelper:
def __init__(self, plug... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.