code stringlengths 1 199k |
|---|
import os
import smtplib
import requests
from datetime import datetime
package_url = "https://store.data.threesixtygiving.org/grantnav_packages/latest_grantnav_data.tar.gz"
def send_alert(text):
to = os.environ.get("TO", "inbox+opendataservices+443f+threesixtygiving-app-alerts@plan.io")
from_ = os.environ.get("... |
print('gunicorn hook')
hiddenimports = ['gunicorn.glogging', 'gunicorn.workers.sync'] |
class SectionModel(Query):
def __init__(self, db):
self.db = db
self.table_name = "section"
super(SectionModel, self).__init__() |
__all__ = ["test"] |
from .state import State
from ..messages.request_vote import RequestVoteResponseMessage
from ..messages.client import ClientFollowerResponse
class Voter(State):
def __init__(self, timeout=1.0):
super(Voter, self).__init__(timeout=timeout)
self._last_vote = None
def on_vote_request(self, message)... |
import numpy as np
import scipy.signal as sig
import matplotlib.pyplot as plt
from ..datasets import synthetic as synth
from ..utils.arrays import zNormalizeRows
def tryTriangle():
l = 3
n = 100
m = 60
startIdx = 25
nIters = 30
# X = synth.randconst((l,n))
X = synth.randwalk((l,n))
for i in range(len(X)):
ins... |
import time
from xmlrpc.client import ServerProxy
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtWidgets import QPushButton
from electrum import util, keystore, ecc, crypto
from electrum import transaction
from electrum.bip32 import BIP32Node
from electrum.plugin import BasePlugin, hook
from electrum.i18n im... |
from .SCPISignalGenerator import SCPISignalGenerator
from .helper import SignalGenerator, amplitudelimiter
class AgilentN5181A(SCPISignalGenerator, SignalGenerator):
"""Agilent N5181A 100e3, 1,3,6e9.
.. figure:: images/SignalGenerator/AgilentN5181A.jpg
"""
def __init__(self, inst):
super().__in... |
'''
Audits logfiles to determine the parent of a derivative package.
This script can aid in automating large accessioning procedures that involve
the accessioning of derivatives along with masters, eg a Camera Card and
a concatenated derivative, or a master file and a mezzanine.
order.py will be able to determine if so... |
from __future__ import division
import os
from iotbx.pdb.multimer_reconstruction import multimer
import mmtbx.ncs.ncs_utils as nu
import iotbx.ncs
import iotbx.pdb
ncs_1_copy="""\
MTRIX1 1 1.000000 0.000000 0.000000 0.00000 1
MTRIX2 1 0.000000 1.000000 0.000000 0.00000 1
MTRIX3 1 0.0000... |
import os.path
project_dir = '/Users/josh/dev/kaggle/sf-crime'
conf_dir = __file__
data_dir = os.path.join(project_dir, 'data')
data_raw_dir = os.path.join(data_dir, 'raw')
submission_dir = os.path.join(project_dir, 'sub')
train_raw = os.path.join(data_raw_dir, 'train.csv')
test_raw = os.path.join(data_raw_dir, 'test.c... |
import collections
import numpy as np
class Colors(object):
yellow = "yellow"
red = "red"
purple = "purple"
brown = "brown"
green = "green"
dark_green = "dark green"
orange = "orange"
creamy_white = "creamy white"
class Color(object):
def __init__(self, color, attribute = None):
self.color = color
self.col... |
from setuptools import setup, find_packages
setup(name='MODEL1112110000',
version=20140916,
description='MODEL1112110000 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/MODEL1112110000',
maintainer='Stanley Gu',
maintainer_url='stanleygu@gmail.com',
packages=find_packages()... |
from setuptools import setup, find_packages
setup(name='BIOMD0000000453',
version=20140916,
description='BIOMD0000000453 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/BIOMD0000000453',
maintainer='Stanley Gu',
maintainer_url='stanleygu@gmail.com',
packages=find_packages()... |
class Pedido(object):
def __init__(self, nome, endereco='vira retirar', observacoes=None):
self.nome = nome
self.endereco = endereco
self.observacoes = observacoes |
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'MODEL0847999575.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
return... |
from armor import pattern
dbz = pattern.DBZ
plt = pattern.plt
a = dbz('201406140.0530')
a.loadImage(type='charts2', rawImage=False) # i am showing the default arguments for clarity
b=a.copy()
b.load(type='charts2', rawImage=True)
a.show(block=True)
b.show(block=True)
if a.imageTopDown:
origin = 'upper'
else:
or... |
from django.contrib import admin
from .models import SourceVideo
admin.site.register(SourceVideo) |
import ConfigParser as configparser
import cPickle as pickle
import commands
import datetime
import getpass
import logging
import optparse
import os
import random
import re
import simplejson
import sys
import time
import unittest
import xmlrpclib
try:
import hashlib # python 2.5+
def hexdigest(s):
retur... |
fname = 'S10_L1000_z1.5_hx250_F500.gcode'
f=open(fname,'w')
laserPower = 10 #% max power
dwellTime = 1 #ms
x_start = 418
y_start = 340
z_start = 122.60 #mm above home
pauseTime = 500 #ms; time paused after movement before ablation
feedRate = 500 #movement speed
rectLength = ... |
import logging_util
from models.user_base import UserBase
def generate_user_class(db, users_tasks_table):
class DbUser(db.Model, UserBase):
_logger = logging_util.get_logger_by_name(__name__, 'DbUser')
__tablename__ = 'user'
id = db.Column(db.Integer, primary_key=True)
email = db.Col... |
"""Execute PoMo10.
This script executes PoMo. Run this script with `--help` to print help
information and exit.
"""
import argparse
import sys
import os
import logging
import re
import libPoMo as lp
import pdb
import time
ver = '1.1.0'
parser = argparse.ArgumentParser(prog='PoMo',
descr... |
"""
Unit tests for hooks.py
@author: Kenneth Hoste (Ghent University)
"""
import os
import sys
from test.framework.utilities import EnhancedTestCase, TestLoaderFiltered
from unittest import TextTestRunner
import easybuild.tools.hooks
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools im... |
from __future__ import unicode_literals
from django.db import migrations, models
import swampdragon.models
class Migration(migrations.Migration):
dependencies = [
('Test', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Foo',
fields=[
(... |
"""
example_geodynamic_adiabat
----------------
This example script demonstrates how burnman can be used to
self-consistently calculate properties along 1D adiabatic profiles
for use in geodynamics simulations.
We use interrogate a PerplexMaterial for material properties
as a function of pressure and temperature, and c... |
"""
/***************************************************************************
QuickOSM
A QGIS plugin
OSM Overpass API frontend
-------------------
begin : 2014-06-11
copyright : (C) 2014 by 3Liz
email : info at 3liz dot ... |
import os
import string
import tempfile
from vdsm import utils
from testrunner import VdsmTestCase as TestCaseBase
import storage.remoteFileHandler as rhandler
HANDLERS_NUM = 10
class RemoteFileHandlerTests(TestCaseBase):
def setUp(self):
self.pool = rhandler.RemoteFileHandlerPool(HANDLERS_NUM)
def test... |
"""
Copyright (C) 2013 Project Hatohol
This file is part of Hatohol.
Hatohol 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 v... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='api_usage_type',
field=models.CharField(blank=True, ma... |
import random
'''
ELO CALULCATION
ScoreToGive = Qa / (Qa+Qb)
Qa = 10 ^ Ra/400
Qb = 10 Rb/400
Ra = Player 1 rating
Rb = Player 2 rating
'''
players = { "p":2400, "p2":2000}
games = { "p":0, "p2":0 }
def calculateKFactor(playername):
if (games[playername] < 2100):
return 32
elif(games[playername] >= 2100... |
from voluptuous import Schema, REMOVE_EXTRA, Required, All, Range, Length
from service.db import get_db, next_id
FAN_MODE_OFF = 0
FAN_MODE_ON = 1
def edit(data):
db = get_db()
if 'id' not in data or data.get('id', -1) not in db:
raise Exception('thermometer with id {} not found. '
... |
import pytest
from nav import pwhash
class TestPwHash(object):
"""Tests for nav.pwhash.Hash class"""
def test_methods_are_callable(self):
"""All values in the known_methods dictionary must be callable"""
for method in pwhash.KNOWN_METHODS.values():
assert callable(method)
def tes... |
import math
start_frame = 1
end_frame = 300
resolution_x = 1920
resolution_y = 1080
resolution_percentage = 50
render_samples = 30
lamp_shadow_size = 0.1
lamp_strength = 1
plane_scale = 1
background_strength = 0.6
species_radius_delta = 0.01
visible_planes = [1, 1, 1, 1, 1, 1]
camera_rotation = (140.79*math.pi/180.0,ma... |
from base import Persistence
class TypeI18n(Persistence):
pass |
import numpy as np
from xiangliang import vocab_processer
import jieba
ccc = open('./cc_1.txt','rb').read().decode('utf-8')
ccc = ccc.split('\n')[:-1]
x_ceshi=[]
for x_fenci_1 in ccc:
c1=jieba.cut(x_fenci_1,cut_all=False)
dd1 = " ".join(c1)
x_ceshi.append(dd1)
x=np.array(list(vocab_processer.fit... |
from django.conf.urls import include, url
from django.contrib import admin
from django.utils.translation import ugettext_lazy
urlpatterns = [
# Examples:
# url(r'^$', 'pycon_library.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^libadmin/', include(admin.site.urls)),
]
admin.s... |
import sys
from subprocess import call
gw = '.1'
mask = '255.255.255.0'
net = '.0'
broadcast = '.255'
dns = '8.8.8.8'
network_file = '/etc/network/interfaces'
reboot_text = ''
netdata = {}
def verify(ip_components):
if ip_components[0] == '0':
return False
for octet in ip_components:
if int(octe... |
import scrapy
class QuotesSpider(scrapy.Spider):
name = "quotes"
def start_requests(self):
urls = [
'http://quotes.toscrape.com/page/1/',
'http://quotes.toscrape.com/page/2/',
]
for url in urls:
yield scrapy.Request(url=url, callback=self.parse)
de... |
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
APP = ['nyctos.py']
DATA_FILES = []
OPTIONS = {'argv_emulation': True}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
) |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('eighth', '0042_auto_20160829_1242')]
operations = [
migrations.AddField(
model_name='eighthactivity',
name='admin_comments',
field... |
"""Runs FilesystemWatcher application
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 hope th... |
import os
import sys
import ctx_config
from ctx_common import *
from ctx_log import *
import hashlib
class CTXBuildParams:
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
def __init__(self):
# \member{ prepDefines }
self.prepDefines = list()
# \member {as... |
"""templates.unix.archive.write Module"""
import cairn
from cairn import Options
def getSubModuleString(sysdef):
str = "Prep; Tools; Excludes; %s; PrepMeta; LogMeta; WriteMeta; RunArchiver; FinalizeMeta;"
if Options.get("quick"):
str = str % "EstimateSizeQuick"
else:
str = str % "EstimateSize"
return str |
__author__ = 'laurogama'
EXCHANGES = [{"name": 'logs', "type": 'fanout'}]
SQLITE_TEST_DB = 'sqlite:///test.db' |
'''
Config file for SHMUP.py
The default values are in the comment to the right of the value
IMPORTANT:
Do NOT delete this file.
It will break the game.
'''
music_volume = 0.4 # 0.4
sound_volume = 0.5 # 0.5
wind_pos_x = 100 # 100
wind_pos_y = 50 # 50
hat = False # False (May make game slow on some com... |
from PySide import QtCore
class _InvokeEvent(QtCore.QEvent):
EVENT_TYPE = QtCore.QEvent.Type(QtCore.QEvent.registerEventType())
def __init__(self, fn, *args, **kwargs):
QtCore.QEvent.__init__(self, _InvokeEvent.EVENT_TYPE)
self.fn = fn
self.args = args
self.kwargs = kwargs
class ... |
from .main import recurse_features |
import unittest
import sys
import os
import copy
import cStringIO
import socorro.lib.ConfigurationManager as CM
import optionfile
class HelpHandler:
def __init__(self):
self.data = ''
def handleHelp(self, config):
self.stringIO = cStringIO.StringIO()
config.outputCommandSummary(self.stringIO,False)
... |
from django.contrib import admin
from ce.models import Agent, Commission, Activitee, Participation, Mendat, CommissionMembre
class AgentAdmin(admin.ModelAdmin):
list_display = ('nom', 'prenom', 'contrat')
list_filter = ('nom', 'prenom', 'contrat')
ordering = ('nom',)
search_fields = ('nom', 'prenom')
cl... |
"""
Config objects stores configuration information and methods to read/write the
./config.json file.
"""
import json, sys, traceback, time
from cjh import cli
__author__ = 'Chris Horn <hammerhorn@gmail.com>'
__license__ = 'GPL'
try:
from cjh.dialog_gui import DialogGui
from cjh.tk_template import TkTemplate
... |
from Adafruit_PWM_Servo_Driver import PWM
import time
import numpy as np
pwm = PWM(0x40, debug=False)
servoMin = 1735 # Min pulse length out of 4096
servoLow = 2000
servoMax = 3047
servoStop = 0
motorChannel = 0
def setServoPulse(channel, pulse):
pulseLength = 1000000 # 1,000,000 us per second
... |
from consts import *
from configured import *
OWS_STATIC = 'http://cherokee-market.com'
OWS_APPS = 'http://www.octality.com/api/v%s/open/market/apps/' %(OWS_API_VERSION)
OWS_APPS_AUTH = 'http://www.octality.com/api/v%s/market/apps/' %(OWS_API_VERSION)
OWS_APPS_INSTALL = 'http://www.octality.com/ap... |
import os
from katello.client.api.distribution import DistributionAPI
from katello.client.core.base import BaseAction, Command
from katello.client.api.utils import get_repo
from katello.client.lib.ui import printer
from katello.client.cli.base import opt_parser_add_product, opt_parser_add_org, \
opt_parser_add_envi... |
import argparse
parser = argparse.ArgumentParser(description='xxxx.')
parser.add_argument('--file',type=argparse.FileType('r'),help='File to be pushed into the cache.',required=True)
parser.add_argument('--url',help='Push url.',required=True)
parser.add_argument('-bs',type=int,help='Blocksize.',default=1024*1024)
args ... |
"""Start up db
Revision ID: a16e3bc17dc2
Revises:
Create Date: 2016-10-19 00:03:41.848723
"""
from alembic import op
import sqlalchemy as sa
revision = 'a16e3bc17dc2'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_... |
"""Tests REST checkout API methods in the item api_views."""
from datetime import datetime, timedelta
import ciso8601
from invenio_accounts.testutils import login_user_via_session
from utils import postdata
from rero_ils.modules.items.models import ItemStatus
def test_checkout_missing_parameters(
client,
... |
import gmpy
import Utils
class CommonModulus(object):
'''
Hastad Broadcast Attack
'''
def __init__(self, n, es, cs):
'''
n: common modulus
e: array of public exponent
cs: array of cipher text
'''
self.n = n
self.es = es
self.cs = cs
def... |
from zope.interface import Interface
from foolscap.api import StringConstraint, TupleOf, SetOf, DictOf, Any, \
RemoteInterface
FURL = StringConstraint(1000)
Announcement = TupleOf(FURL, str, str,
str, str, str)
class RIIntroducerSubscriberClient(RemoteInterface):
__remote_name__ = "RIIntr... |
__author__ = 'M.X'
from scrapy.http import Request
from scrapy.selector import Selector
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from knows.items import ArticleItem
from baseFunctions import judge_link
import re
class IfanrDemoCrawler(CrawlSpi... |
import os
import os.path
import socket
import time
from socket import error
import shutil
import sys
import select
import hashlib
import json
import threading
import logging
from time import gmtime, strftime
from configobj import ConfigObj
import syncscrypto
import utils
class SocketFileClient(object):
"""
Para... |
__author__ = 'mbaxpac2'
from fractions import gcd
divisor = gcd(gcd(gcd(2400000000, 80000), 320000), 8000)
N_ITEMS = 4
C = 2400000//divisor
w = (80000//divisor, 320000//divisor, 120000//divisor, 8000//divisor)
V = N_ITEMS * [None]
keep = N_ITEMS * [None]
for i in range(N_ITEMS):
V[i] = (C + 1) * [0]
keep[i] = (... |
"""
Expand device.fw_version column
Revision ID: 348daa35773c
Revises: 292b2e042673
Create Date: 2018-09-24 13:51:26.257198
"""
revision = '348daa35773c'
down_revision = '292b2e042673'
from alembic import op
from sqlalchemy import Unicode
def upgrade():
op.alter_column('device', 'fw_version', type_=Unicode(241), nu... |
import fs
import six
from fs.opener import opener
from invenio.modules.jsonalchemy.wrappers import SmartJson
from invenio.modules.jsonalchemy.jsonext.engines.sqlalchemy import SQLAlchemyStorage
from invenio.modules.jsonalchemy.reader import Reader
from . import signals, errors
from .models import Document as DocumentMo... |
import numpy as np
class Solution:
def palindromePartition(self, s, k):
dp_pals = {}
def partition(st, k):
nonlocal dp_pals
if (st, k) in dp_pals: return dp_pals[(st, k)]
if len(st) == k: return 0 # if number of chars is equal to k, no partitioning needed
... |
import spidev
import time
import threading
import RPi.GPIO as GPIO
from events_base import EventsBase
from debouncer import Debouncer
class PibEvents(EventsBase):
POT_CHANNEL = 0
JOY_CHANNELS = [2, 3]
LIGHT_CHANNEL = 5
SELECT_SWITCH_PIN = 17
ROTARY_SWITCH_PINS = (22, 27)
VOL_TOLERANCE = 2
HI... |
import pylab as pl
import numpy as np
from astropy.io import fits
import sys, os, time
import re
single_time = True
c_speed_of_light = 299792458. # m/s
tauw_sign = +1.
metafits = '/data/1130642936/1130642936_metafits_ppds.fits'
ms_dir= '/data/1130642936/1130642936_c113-114_f08_t0329430-0329435_caltest.MS/'
hl = fits.op... |
"""empty message
Revision ID: 43aac6a8018
Revises: 527e6a16a4
Create Date: 2015-07-04 21:23:22.444106
"""
revision = '43aac6a8018'
down_revision = '527e6a16a4'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Colu... |
import os
import copy
import shutil
import os.path
from geobricks_modis.core import modis_core as c
from geobricks_processing.core import processing_core
from geobricks_common.core.date import day_of_the_year_to_date
from geobricks_downloader.core.downloader_core import Downloader
from eco_countries_demo.config.process... |
from pyramid.scaffolds import PyramidTemplate
class BasicN6SDKTemplate(PyramidTemplate):
_template_dir = 'basic_n6sdk_scaffold'
summary = '*n6sdk*-based REST API project'
def pre(self, command, output_dir, vars):
vars['capitalized_package'] = self._smart_capitalize(vars['package'])
return Py... |
import os
import time
import unittest
import re
from test_utils import execute, wc, grep
class TestPtTableUsage(unittest.TestCase):
def setUp(self):
os.environ['PGHOST'] = 'localhost'
os.environ['PGPORT'] = '5432'
os.environ['PGUSER'] = 'postgres'
os.environ['PGDATABASE'] = 'testdb'
... |
""" Utilities to manage colors. """
import re
from functools import partial
import click
from click_log.core import ColorFormatter
from . import CLI_NAME, logger
colors = {
"cli": dict(fg="bright_white"),
"title": dict(fg="bright_green", bold=True),
"subtitle": dict(fg="green"),
"option": dict(fg="cyan"... |
"""
@file
@author Chrisitan Urich <christian.urich@gmail.com>
@version 1.0
@section LICENSE
This file is part of DynaMind
Copyright (C) 2011-2012 Christian Urich
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 ... |
import os
from uds.sensors.twitter import TwitterSensor
class _MyTwitterSensor(TwitterSensor):
def __init__(self, project_home):
super(_MyTwitterSensor, self).__init__(project_home)
# ~~~ Initialize sensor parameters here ~~~
pass
# Method overriding (mandatory)
def parse_data(self, ... |
from flask import Blueprint
marshal = Blueprint('marshal', __name__)
from . import views
from ..main import errors |
dic = {}
dic["a"] = "1"
dic["b"] = "2"
dic["c"] = "3"
check = raw_input("What to check?")
for key in dic.keys(): print "......."
if check in dic.keys(): print "Its in the dictionary!!!"
else: print "Sorry not in the dictionary :(" |
"""Tests for the Hello World"""
from autopilot.matchers import Eventually
from textwrap import dedent
from testtools.matchers import Is, Not, Equals
from testtools import skip
import os
from ubuntu-irc import UbuntuTouchAppTestCase
class GenericTests(UbuntuTouchAppTestCase):
"""Generic tests for the Hello World"""
... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^$', 'BTA.views.home', name='home'),
url(r'^update$', 'BTA.views.update'),
url(r'^street$', 'BTA.views.street'),
url(r'^start$', 'BTA.views... |
"""
Builds out filesystem trees/data based on the object tree.
This is the code behind 'cobbler sync'.
Copyright 2006-2009, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
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 ... |
def read_housing_data(r):
""" Read housing data from reader r, returning lists of starts,
contracts, and rates."""
starts = []
contracts = []
rates = []
for line in r:
start, contract, rate = line.split()
starts.append(float(start))
contracts.append(float(contract))
... |
"""
this file is part of ppp-tools, https://github.com/aewallin/ppp-tools
Licensed under GPLv2
Anders Wallin 2018
common classes and functions for all ppp-implementations.
"""
import math
import os
import datetime
import station
import ftp_tools
import jdutil
def diff_stations(prefixdir, station1, stati... |
from __future__ import unicode_literals, print_function, absolute_import
__author__ = 'Andres andresmt [at] ut [dot] ee'
import re
categoryRegEx = re.compile(r'\[\[Kategooria:(.+?)\]\]', re.I)
def categoryParser(text):
kat = []
#[[K:Antsla|Antsla, Antsla|
for x in categoryRegEx.finditer(text):
catNa... |
# -*- coding: utf-8 -*-
from Plugins.Extensions.MediaPortal.plugin import _
from Plugins.Extensions.MediaPortal.resources.imports import *
from Plugins.Extensions.MediaPortal.resources.twagenthelper import twAgentGetPage
from Plugins.Extensions.MediaPortal.resources.playrtmpmovie import PlayRtmpMovie
BASE_URL = "https... |
"""
WSGI config for markovtunes 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/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "markovtunes.settings")
from django.co... |
import logging
log = logging.getLogger("Thug")
def Install(self, arg):
if len(arg) > 1024:
log.ThugLogging.log_exploit_event(self._window.url,
"NamoInstaller ActiveX",
"Overflow in Install method")
if str([arg]).find('ht... |
from distutils.core import setup
setup(name="StereoVision",
version="1.0.0",
description=("Library and utilities for 3d reconstruction from stereo "
"cameras."),
long_description=open("README.rst").read(),
author="Daniel Lee",
author_email="lee.daniel.1986@gmail.com",
... |
import string
import os
import re
def header(n) :
return "//\n\
// BAGEL - Brilliantly Advanced General Electronic Structure Library\n\
// Filename: MSCASPT2" + n + ".cc\n\
// Copyright (C) 2014 Toru Shiozaki\n\
//\n\
// Author: Toru Shiozaki <shiozaki@northwestern.edu>\n\
// Maintainer: Shiozaki group\n\
//\n\
// ... |
"""SSH into a running appliance and install Netapp SDK
"""
import argparse
import sys
import time
import os
from urlparse import urlparse
from utils.conf import cfme_data, credentials, env
from utils.db import get_yaml_config, set_yaml_config
from utils.ssh import SSHClient
def parse_if_not_none(o):
if o is None:
... |
from django.db import models
from djoosh import SearchMixin
from django.core import urlresolvers
class Pessoa(models.Model):
nome = models.CharField(max_length=200)
endereco = models.CharField(max_length=300)
#TODO municipio =
observacao = models.CharField(max_length=300)
data_cadastro = models.Date... |
import re
import string
def language(hdr):
"Parse an Accept-Language header."
# parse the header, storing results in a _LanguageSelector object
return _parse(hdr, _LanguageSelector())
_re_token = re.compile(r'\s*([^\s;,"]+|"[^"]*")+\s*')
_re_param = re.compile(r';\s*([^;,"]+|"[^"]*")+\s*')
_re_split_param = re.co... |
""" Tests for pre-training with pixiv-1M and fine-tuning on da-180.
"""
import unittest
import numpy as np
import cPickle as pickle
import theano
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from dataset import ListDataset, load_da_180
from optimize import SGD
from cnn_classifier import CNNClas... |
from functools import partial
import codecs
open = partial(codecs.open, encoding='utf-8')
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
sys.stdin = codecs.getreader('utf-8')(sys.stdin)
sys.stderr = codecs.getwriter('utf-8')(sys.stderr) |
__title__ = "make Valve 3D models"
__author__ = "Stefan, based on DIP script"
__Comment__ = 'make varistor 3D models exported to STEP and VRML for Kicad StepUP script'
___ver___ = "1.3.3 14/08/2015"
from collections import namedtuple
import math
import sys, os
import datetime
from datetime import datetime
sys.path.appe... |
from collections import OrderedDict
import copy
import logging
import os
import shutil
import stat
import sys
import tempfile
from unittest.mock import (
call,
Mock,
MagicMock,
patch,
)
import fixtures
import snapcraft
from . import mocks
from snapcraft.internal.errors import SnapcraftPartConflictError
... |
import dropbox
import os
import sys
import webbrowser
from colores import bcolors
import ficheros
class DropObj(object):
"""
Dropbox object that can access your dropbox folder,
as well as download and upload files to dropbox
"""
#----------------------------------------------------------------------
def __init__(... |
'''
Plot Phase Portraits
Author : Jithin B.P, jithinbp@gmail.com
License : GNU GPL version 3
Date : june-2012
'''
from widgets import *
import math,os,time,pygame,time,string,Tkinter
import numpy as np
import scipy
WIDTH=800
HEIGHT=650
YSHIFT=200
size = [WIDTH,HEIGHT]
flags=pygame.SRCALPHA|pygame.NOFRAME|pygame.HWSURF... |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(720, 603)
self.horizontalLayout = QtGui.QHBoxLayout(Form)
... |
"""
pyexcel_io.base
~~~~~~~~~~~~~~~~~~~
The io interface to file extensions
:copyright: (c) 2014-2016 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
"""
import sys
import datetime
from abc import ABCMeta, abstractmethod, abstractproperty
if sys.version_info[0] == 2 and... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wechat_user', '0003_wechatuser_morning_greeting'),
]
operations = [
migrations.AddField(
model_name='wechatuser',
name='notify_su... |
__author__ = "Michael Imelfort"
__copyright__ = "Copyright 2012"
__credits__ = ["Michael Imelfort"]
__license__ = "GPL3"
__version__ = "0.0.1"
__maintainer__ = "Michael Imelfort"
__email__ = "mike@mikeimelfort.com"
__status__ = "Development"
from sys import exc_info, exit
import pysam
import errno
import gzip
from os.p... |
from setuptools import setup
setup(
name='bibos_client',
# Keep this in sync with bibos_client/jobmanager.py
version='0.0.5.0',
description='Clients for the BibOS system',
url='https://github.com/magenta-aps/',
author='C. Agger and J.U.B. Krag, Magenta ApS',
author_email='carstena@magenta-ap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.