code stringlengths 1 199k |
|---|
from typing import Any, Tuple
from gi.repository import Gtk, Gdk
from opendrop.app import keyboard
from opendrop.app.common.image_processing.image_processor import ImageProcessorPluginViewContext
from opendrop.mvp import ComponentSymbol, View, Presenter
from opendrop.utility.bindable.gextension import GObjectPropertyBi... |
"""User-activatable actions for :class:`gaupol.Application`."""
from gaupol.actions.audio import * # noqa
from gaupol.actions.edit import * # noqa
from gaupol.actions.file import * # noqa
from gaupol.actions.help import * # noqa
from gaupol.actions.projects import * # noqa
from gaupol.actions.text im... |
from . import _plotting_mess
data = _plotting_mess.complex_data
databoxes = _plotting_mess.complex_databoxes
files = _plotting_mess.complex_files
function = _plotting_mess.complex_function |
import sys
import struct
import socket
import json
import math
from tactile import IR
class ID:
SQUEEZEBOX = 2
SOFTSQUEEZE = 3
SQUEEZEBOX2 = 4
TRANSPORTER = 5
SOFTSQUEEZE3 = 6
RECEIVER = 7
SQUEEZESLAVE = 8
CONTROLLER = 9
SQUEEZEBOX3 = 104 # not reported by firmware, but infered from HELO msg.
debu... |
import os
from os.path import join, expanduser, isdir
__author__ = 'jdorleans'
class FileSystemAccess(object):
"""
A class for providing access to the boomer FS sandbox. Intended to be
attached to skills
at initialization time to provide a skill-specific namespace.
"""
def __init__(self, path):
... |
import os
from common_helper_files import get_dir_of_file
from pluginbase import PluginBase
import logging
class FilterSystem():
FILTER_TYPE = None
def __init__(self, selected_filters):
self._init_plugins()
if selected_filters == 'all':
self._set_all_filters()
else:
... |
from __future__ import division
import numpy as np
import pylab
def PCA(Z, verbose = 0):
"""
PCA Mc Vean style
Parameters
----------
Z : (L, n) array
SNP array matrix. Matrix of 0s and 1s that represent the two alleles.
Returns
-------
Y : (n, p) array
Configuration matri... |
"""
Created on 11.09.2014
@author: benjamin@boerngen-schmidt.de
"""
from abc import ABCMeta, abstractmethod
import random
import datetime
class BaseCar(metaclass=ABCMeta):
"""
Represents the fundamentals of a car
"""
def __init__(self, env, tank_size):
"""
Constructor
:type tank_... |
import os
def again(request,*args,**kw):
get = request.GET.copy()
for k,v in kw.items():
if v is None: # value None means "remove this key"
if get.has_key(k):
del get[k]
else:
get[k] = v
path = request.path
if len(args):
path += "/" + "/".j... |
import AI.pad
import AI.state
class Character:
def __init__(self, pad_path):
self.action_list = []
self.last_action = 0
self.pad = AI.pad.Pad(pad_path)
self.state = AI.state.State()
#Set False to enable character selection
self.test_mode = True
self.sm = AI.st... |
"""
3.8 将 KMeans 用于离群点检测
http://git.oschina.net/wizardforcel/sklearn-cb/blob/master/3.md
"""
import numpy as np
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans
(x, labels) = make_blobs(100, centers=1)
kms = KMeans(n_clusters=1)
kms.fit(x)
dist = kms.transform(x)
sortedIdx = np.argsort(dist.ra... |
import sys
sys.path = ['.'] + sys.path
from test.test_support import verbose, run_unittest
import re
from re import Scanner
import sys, os, traceback
from weakref import proxy
import unittest
class ReTests(unittest.TestCase):
def test_weakref(self):
s = 'QabbbcR'
x = re.compile('ab+c')
y = p... |
"""Show information about the OpenGL setup."""
from PyQt5.QtGui import (QOpenGLContext, QOpenGLVersionProfile,
QOffscreenSurface, QGuiApplication)
app = QGuiApplication([])
surface = QOffscreenSurface()
surface.create()
ctx = QOpenGLContext()
ok = ctx.create()
assert ok
ok = ctx.makeCurrent(sur... |
from __future__ import print_function
import os
import cgi
from subprocess import Popen, PIPE, STDOUT
SCRIPTDIR = 'javaprolog'
import platform
if platform.system()=='Windows':
SCRIPT = ['java', '-cp', 'json-simple-1.1.1.jar;gnuprologjava-0.2.6.jar;.', 'Shrdlite']
else:
SCRIPT = ['java', '-cp', 'json-simple-1.1.... |
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Title: logger
Author: David Leclerc
Version: 0.1
Date: 13.04.2018
License: GNU General Public License, Version 3
(http://www.gnu.org/licenses/gpl.html)
Overview: This is a script that ge... |
import re, logging, copy
from threading import Lock
class Tagger(object):
def __init__(self, hosts_attr="fields.hosts", hosts_sep=":", tag_file="tags_jobs.safe"):
self.tags_by_host = {}
self.hosts_sep = str(hosts_sep)
self.hosts_attr = str(hosts_attr)
self.tag_file = tag_file
... |
import argparse
import code
import readline
import signal
import sys
from parse import Argparser, premain, SigHandler_SIGINT,PythonInterpreter
from utils import ParseFlags
def getWASMModule():
module_path = sys.argv[1]
interpreter = PythonInterpreter()
module = interpreter.parse(module_path)
def main():
... |
import unittest
import decodes.core as dc
from decodes.core import *
from decodes.extensions.voxel import *
class Tests(unittest.TestCase):
def test_constructor(self):
bounds = Bounds(center=Point(),dim_x=8,dim_y=8,dim_z=8)
vf = VoxelField(bounds,4,4,4)
vf.set(0,0,0,10.0)
vf.set(3,3,... |
from __future__ import print_function
import os
from ftplib import FTP
def place_file(ftp, filename):
ftp.storbinary('STOR ' + filename,open(filename, 'rb'))
if __name__ == '__main__':
url = 'ftp.k-bits.com'
ftp = FTP(url)
user = 'usuario1@k-bits.com'
passw = 'happy1234'
ftp.login(user, passw)
... |
from vsg.rules import token_case
from vsg import token
lTokens = []
lTokens.append(token.package_body.body_keyword)
class rule_501(token_case):
'''
This rule checks the **body** keyword has proper case.
|configuring_uppercase_and_lowercase_rules_link|
**Violation**
.. code-block:: vhdl
packag... |
import xml.etree.ElementTree as ElementTree
from model.dynamic.api import api
from model.dynamic.skills.skill_queue_item import SkillQueueItem
class SkillQueue(object):
def __init__(self, user_id, api_key, character_id):
api.fetch("char", "SkillQueue", user_id, api_key, character_id)
tree = ElementT... |
"""Copyright (C) 2013 COLDWELL AG
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 is distributed in the hope that i... |
import percolation as P
import rdflib as r
import os
import time
from rdflib import ConjunctiveGraph
TT = time.time()
class PercolationServer:
def __init__(self, percolationdir="~/.percolation/"):
percolationdir = os.path.expanduser(percolationdir)
if not os.path.isdir(percolationdir):
o... |
"""
Utilities for running data through the TM, and analyzing the results.
"""
from prettytable import PrettyTable
class TemporalMemoryTestMachine(object):
"""
Base TM test machine class.
"""
def __init__(self, tm):
"""
@param tm (TM) Temporal memory
"""
# Save member variables
self.tm = tm
... |
from callback_event import *
def getOddNumber(k,getEvenNumber): return 1+getEvenNumber(k)
def main():
k=1
i=getOddNumber(k,double);
print(i)
i=getOddNumber(k,quadruple);
print(i)
i=getOddNumber(k,lambda x:x*8)
print(i)
if __name__=="__main__":main() |
import subprocess, sys
def run_doxygen(folder):
"""Run the doxygen make command in the designated folder"""
try:
retcode = subprocess.call("cd %s; make" % folder, shell=True)
if retcode < 0:
sys.stderr.write("doxygen terminated by signal %s" % (-retcode))
except OSError as e:
... |
from __future__ import print_function, absolute_import
from PySide2 import QtGui,QtCore,QtWidgets
from math import *
import pickle, os, json
import learnbot_dsl.guis.EditVar as EditVar
from learnbot_dsl.learnbotCode.Block import *
from learnbot_dsl.learnbotCode.Language import getLanguage
from learnbot_dsl.learnbotCode... |
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import versioneer
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
se... |
"""
Test Result
-----------
Provides a TextTestResult that extends unittest._TextTestResult to
provide support for error classes (such as the builtin skip and
deprecated classes), and hooks for plugins to take over or extend
reporting.
"""
import logging
from unittest import _TextTestResult
from nose.config import Conf... |
"""
Implementation of the ssh-userauth service.
Currently implemented authentication types are public-key and password.
Maintainer: Paul Swartz
"""
import struct, warnings
from twisted.conch import error, interfaces
from twisted.conch.ssh import keys, transport, service
from twisted.conch.ssh.common import NS, getNS
fr... |
"""Restore a change to a refpkg immediately after being reverted
Restore the last ``N`` rolled back operations on ``refpkg``, or the
last operation if ``-n`` is omitted. If there are not at least ``N``
operations that can be rolled forward on this refpkg, then an error is
returned and no changes are made to the refpkg... |
from asyncore import write
import serial
import sys
import time
import strutils
from datafile import DataFile
__author__ = 'Trol'
def _bytes(i):
return divmod(i, 0x100)
class Bootloader:
CMD_SYNC = 0
CMD_ABOUT = 1
CMD_READ_FLASH = 2
CMD_READ_EEPROM = 3
CMD_READ_FUSES = 4
CMD_START_APP = 5
... |
"""PySnapSync client.
This package implements the pysnapsync client.
The package exports the following modules:
o `snapsync` main backup script.
See the module doc strings for more information.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from pysnapsy... |
"""zip source directory tree"""
import argparse
import fnmatch
import logging
import os
import re
import subprocess
import zipfile
def get_version():
command = ['git', 'describe', '--tags', '--dirty', '--always']
return subprocess.check_output(command).decode('utf-8')
def source_walk(root):
root = os.path.a... |
"""
Author: RedFantom
Contributors: Daethyra (Naiii) and Sprigellania (Zarainia)
License: GNU GPLv3 as in LICENSE
Copyright (C) 2016-2018 RedFantom
"""
from ast import literal_eval
def config_eval(value):
"""
Safely evaluate a string that can be a in a configuration file to a
valid Python value. Performs er... |
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class MenuButton(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self)
self.connect("destroy", Gtk.main_quit)
menubutton = Gtk.MenuButton("MenuButton")
self.add(menubutton)
menu = Gtk.Menu()
... |
f = open("data/planetsc.txt", "r")
earth = 0
for line in f:
planet = line.strip().lower()
if planet[0] == "#":
continue
earth += 1
if planet == "earth":
break
print "Earth is planet #%d" % earth |
import xmlrpclib as xml
import time
e = xml.ServerProxy('http://localhost:8001')
def sense():
return e.do('sense', {'agent':'Ralph'})
def step(time):
e.do('meta_step', {'seconds':time})
def do(command, args = None):
if not args:
args = {}
args['agent'] = 'Ralph'
return e.do(command, args)
la... |
import logging,sys
logger = logging.getLogger()
X10Checkers = {
'RF' : 'x10chk(args)' ,
'PL' : 'x10chk(args)' ,
}
X10Encoders = {
'RF' : ('', 'x10rf2hex(args)', '') ,
'PL' : ('', 'x10pl2hex(args)', '') ,
} |
"""A Backend class defines the core low-level functions required by a Window
class, such as the ability to create an OpenGL context and flip the window.
Users simply call visual.Window(..., winType='pyglet') and the winType is then
used by backends.getBackend(winType) which will locate the appropriate class
and initial... |
import os
import sys
import time
import json
import numpy as np
import tensorflow as tf
from tensorflow.contrib.tensorboard.plugins import projector
from mixlm.lm_train import *
from mixlm.clstmdnn import CLSTMDNN
from bmlm.common import CheckpointLoader
def load_from_checkpoint(saver, logdir):
sess = tf.get_defau... |
import os
from flask import Flask, url_for, request, render_template, jsonify, send_file
from werkzeug.utils import secure_filename
import deepchem as dc
import subprocess
from shutil import copyfile
import csv
import rdkit
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import Draw
STATIC_DIR = o... |
"""TODO"""
import copy
import json
from argparse import RawTextHelpFormatter
from linshareapi.cache import Time
from vhatable.cell import CellBuilder
from vhatable.cell import ComplexCell
from vhatable.cell import ComplexCellBuilder
from vhatable.filters import PartialOr
from linsharecli.user.core import DefaultCommand... |
import os, gzip, StringIO, time, csv, datetime
from flask import Flask, request, redirect, url_for, render_template
from werkzeug.utils import secure_filename
from wtforms import Form, DecimalField, validators
class UpdateForm(Form):
weight = DecimalField('Weight', [validators.DataRequired()])
fat = DecimalFiel... |
"""
resourcetool.py
Simple utility to list or update RADB resource availability values.
Essentially a tool around RADB getResources(), updateResourceAvailability(), getResourceClaims() and (parts of) updateResourceClaims().
Can also figure out available capacity for a mounted storage resource and update it in the RADB ... |
"""
Python implementation of the matrix information measurement examples from the
StackExchange answer written by WilliamAHuber for
"Measuring entropy/ information/ patterns of a 2d binary matrix"
http://stats.stackexchange.com/a/17556/43909
Copyright 2014 Cosmo Harrigan
This program is free software, distributed under... |
import dbus
import dbus.service
from gi.repository import GLib
from dbus.mainloop.glib import DBusGMainLoop
from usb_inhibit import USB_inhibit
class USB_Service_Blocker(dbus.service.Object):
inhibitor_work = False
def __init__(self):
self.usb_monitor = USB_inhibit(True)
bus_name = dbus.service.BusName('org.g... |
import argparse
import ui.output
def help_format_cloudcredgrab(prog):
kwargs = dict()
kwargs['width'] = ui.output.columns()
kwargs['max_help_position'] = 34
format = argparse.HelpFormatter(prog, **kwargs)
return (format)
def parse(args):
parser = argparse.ArgumentParser(prog="cloudcredgrab", add... |
from rambutan3.check_args.base.RAbstractTypeMatcher import RAbstractTypeMatcher
from rambutan3.check_args.set.RSetEnum import RSetEnum
from rambutan3.check_args.set.RSetOfMatcher import RSetOfMatcher
def BUILTIN_SET_OF(type_matcher: RAbstractTypeMatcher) -> RSetOfMatcher:
x = RSetOfMatcher(RSetEnum.BUILTIN_SET, typ... |
'''
基本工具
Created on 2014年5月14日
@author: Exp
'''
''' 获取系统时间 '''
def getSysTime(format = "%Y-%m-%d %H:%M:%S"):
import time
return time.strftime(format)
''' 判断是否为本地运行环境,否则为SAE运行环境 '''
def isLocalEnvironment():
from os import environ
return not environ.get("APP_NAME", "")
''' 加密字符串 '''
def encrypt(plaintext... |
from __future__ import division, print_function, unicode_literals
import re
import unicodedata
h1_start = re.compile(r"^\s*=(?P<title>[^=]+)=*[ \t]*")
valid_title = re.compile(r"[^=]+")
general_heading = re.compile(r"^\s*(={2,6}(?P<title>" + valid_title.pattern +
")=*)\s*$", flags=re.MULTIL... |
import sys
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
if PY3:
import urllib.parse as urlparse # Es muy lento en PY2. En PY3 es nativo
else:
import urlparse #... |
"""
Django settings for eproweb project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
import os
import... |
'''Test for DDNS forwarding'''
from dnstest.test import Test
t = Test()
master = t.server("knot")
slave = t.server("knot")
zone = t.zone("example.com.")
t.link(zone, master, slave, ddns=True)
t.start()
master.zones_wait(zone)
seri = slave.zones_wait(zone)
update = slave.update(zone)
update.add("forwarded.example.com.",... |
"""
WSGI config for fitch 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", "fitch.settings")
from django.core.wsgi impo... |
import gammalib
import ctools
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import test_ctobssim
import test_ctselect
import test_ctphase
import test_ctfindvar
import test_ctbin
import test_ctlike
import test_cttsmap
import test_ctmodel
import test_ctskymap
import test_ctexpcube
impor... |
from bisect import bisect_left
from lib import argmax, bin_search_left, yield_while
from math import inf
def search(arr): # binary search, length only. O(n\log n) time
st = [arr[0]] # st[i]: smallest tail of LIS of length i + 1. naturally sorted, and all elements are distinct
for x in arr:
if x > st[-... |
資料 = [1, 2, 3, 4, 5]
'''
program: list1.py
'''
print(資料[:3])
print(資料[2:])
print(資料[1:2])
a = [3, 5, 7, 11, 13]
for x in a:
if x == 7:
print('list contains 7')
break
print(list(range(10)))
for 索引 in range(-5, 6, 2):
print(索引)
squares = [ x*x for x in range(0, 11) ]
print(squares)
a = [10, 'sage'... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('app', '0002_auto_20170105_0206'),
]
operations = [
migrations.AddField(
model_name='submission',
... |
import json
import sys
if sys.version_info >= (3, 0):
from urllib.request import urlopen
else:
from urllib2 import urlopen
class Blocks:
def __init__(self):
self.version = None
self.block_hash = None
def load_info(self, block_number):
raise NotImplementError
def read_url(self... |
from common import fileio
def main():
ADJ = 4
fileio.FILE_ADDRESS = "../../res/problem011/grid.txt"
matrix = fileio.readFileAsMatrix()
products = []
products.extend(checkVertical(matrix, ADJ))
products.extend(checkHorizontal(matrix, ADJ))
products.extend(checkDiagonal(matrix, ADJ))
products.extend(checkReverseD... |
'''
Plot distribution of each feature,
conditioned on its bfeature type
'''
import argparse
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from common import *
from information import utils
from scipy.stats import itemfreq
nbins = 100
def opts():
parser = argparse.ArgumentParse... |
import os
import datetime
import lib.maglib as MSG
PATH_SUFFIX = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
print(PATH_SUFFIX)
PATH_SUFFIX = PATH_SUFFIX[::-1]
PATH_SUFFIX = PATH_SUFFIX[PATH_SUFFIX.find('\\'):]
PATH_SUFFIX = PATH_SUFFIX[::-1]
print(PATH_SUFFIX)
PATH_RESULT_FILE = PAT... |
import base64
import codecs
import collections
import contextlib
import hashlib
import html
import io
import logging
import os
import re
import sys
from urllib.parse import urlparse
from diffoscope import VERSION
from diffoscope.config import Config
from diffoscope.diff import SideBySideDiff, DIFFON, DIFFOFF
from ..ico... |
import view
from world import *
DEFAULT_CAMERA_AREA = view.View.CAMERA_AREA
class LevelZero(view.View):
lives = 50
name = "Level 0: Grossini's return"
target = 5
order = 0
CAMERA_AREA=(0, -90, 0, -90)
mountainScale = 0.4
def setup_level(self):
self.step = 0.15
self.energyRege... |
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... |
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import cm
import numpy as np# reshape
from cstoolkit import drange
from matplotlib.colors import LinearSegmentedColormap
"""
cmap_cs_precp = [ (242, 242, 242), (191, 239, 255), (178, 223, 238),
(154, 192, 205), ( 0, 235, 235), ( 0, 163, 247),
... |
import bench
class Stats(bench.Bench):
def __init__(self, league):
bench.Bench.__init__(self)
self.league = league
self.type = 'stats'
def list(self, team=False, player=False):
"""
Lists all stats for the current season to date. Can be filtered by team or by player. Defau... |
from django.conf.urls import url
from rpi.beehive.views import AddBeehiveView, delete_readering_view, \
ChartReaderingView, export_view, ListReaderingView, DeleteBeehiveView, \
ModifyBeehiveView, summary_view
urlpatterns = [
url(r'^ajouter$', AddBeehiveView.as_view(), name='add-beehive'),
url(r'^(?P<pk>... |
"""Define related tools for web.archive.org (aka Wayback Machine)."""
import logging
from threading import Thread
from datetime import date
from urllib.parse import urlparse
from regex import compile as regex_compile
from requests import ConnectionError as RequestsConnectionError
from lib.commons import dict_to_sfn_cit... |
import glob
import os
import pytest
def pytest_generate_tests(metafunc):
"""Replace the xmltestcases fixture by all *.case.xml files in tests/cases"""
if "xmltestcase" in metafunc.fixturenames:
location = os.path.dirname(os.path.realpath(__file__))
testcases = glob.glob(location + "/cases/*.case... |
import re
import json
import requests
from util import irc
from util.handler_utils import cmdhook, authenticate, get_target
from qtbot3_common.types.message import Message
def scrape(board: str, filtertext: str):
try:
data = requests.get("http://boards.4chan.org/{board}/catalog".format(board=board)).text
... |
""" Image Label. """
import datetime
from PyQt4 import QtCore, QtGui
from note import Note
from constants import *
from icons import *
class ImageLabel(QtGui.QLabel):
"""
The ImageLabel class holds PDF QPixmap to be displayed in DocumentWidget.
"""
remove_trigger = QtCore.pyqtSignal()
toggle_source_... |
""" Curriculum-based course timetabling solver;
solves timetabling problems formulated in .ectt file format (http://tabu.diegm.uniud.it/ctt/)
Copyright (C) 2013 Stephan E. Becker
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as... |
from roars.gui.pyqtutils import PyQtWidget, PyQtImageConverter
from WBaseWidget import WBaseWidget
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4 import QtCore
class WAxesButtons(WBaseWidget):
def __init__(self, name='axes', label='Axes Buttons', changeCallback=None, step=0.001):
super(WAxe... |
'''
Wammu - Phone manager
Image displaying classes to be embdeded inside wxHTML
'''
import io
import wx
import wx.lib.throbber
import base64
defaultbmp = [
'20 20 2 1',
'. c Black',
' c None',
' ',
' .. .. ',
' ... ... ',
' ... ... ',
... |
__author__ = 'Liam'
import types
def flag(func):
func.is_flag = True
return func
class BadSearchOp(Exception):
def __init__(self, value = "bad search operation"):
self.value = value
def __str__(self):
return "BadSearchOp: %s" % self.value
class ImapSearchQueryParser(object):
"""
... |
__prog_name__ = 'generate_date_table.py'
__prog_desc__ = 'Generate table with LPSN year or priority for species and subspecies names.'
__author__ = 'Pierre Chaumeil'
__copyright__ = 'Copyright 2018'
__credits__ = ['Pierre Chaumeil']
__license__ = 'GPL3'
__version__ = '0.0.2'
__maintainer__ = 'Pierre Chaumeil'
__email__... |
"""Test class for Host Collection CLI"""
import csv
import os
import re
import tempfile
from fauxfactory import gen_string
from itertools import product
from random import sample
from robottelo import ssh
from robottelo.cli.base import CLIReturnCodeError
from robottelo.cli.contenthost import ContentHost
from robottelo.... |
'''
Wammu - Phone manager
Main Wammu application
'''
from __future__ import unicode_literals
from __future__ import print_function
import wx
import sys
import Wammu.Main
import Wammu.Error
from Wammu.Locales import StrConv
from Wammu.Locales import ugettext as _
class WammuApp(wx.App):
'''
Wammu appliction clas... |
""" Convert an OpenTripPlanner json itinerary response into something that's more suitable for rendering via a webpage
"""
import re
import sys
import math
from decimal import *
import datetime
from datetime import timedelta
import simplejson as json
from ott.utils import object_utils
from ott.utils import date_utils
f... |
"""The third Multimedia Data Manager.
This module stores the metadata from XML files to a SQLite database.
The video generator uses this database to create the actual video clips"""
import sys
p_v = 2 if sys.version_info < (3,) else 3
if p_v == 2:
import urllib, urllib2
import ConfigParser as cp
else:
impor... |
"""
Handles Google Service Authentication
"""
__author__ = "Rob Rayborn"
__copyright__ = "Copyright 2014, The Mozilla Foundation"
__license__ = "MPLv2"
__maintainer__ = "Rob Rayborn"
__email__ = "rrayborn@mozilla.com"
__status__ = "Development"
from OpenSSL.crypto import load_pkcs12, dump_privatekey, FILETYPE_PEM
from ... |
from __future__ import absolute_import, print_function, unicode_literals
import copy
import logging
from . import transform
from ..util.yaml import load_yaml
logger = logging.getLogger(__name__)
class TestTask(transform.TransformTask):
"""
A task implementing a Gecko test.
"""
@classmethod
def get_i... |
import argparse
import fcntl
import hashlib
import os
import random
import socket
import tempfile
import time
import traceback
import urllib.parse
from urllib.parse import urlparse
from urllib.parse import urlunparse
from collections import namedtuple
from datetime import datetime, timedelta
from multiprocessing import... |
import os
import sys
config = {
"options": [
"--prefs-root=%(test_path)s/prefs",
"--processes=1",
"--config=%(test_path)s/wptrunner.ini",
"--ca-cert-path=%(test_path)s/certs/cacert.pem",
"--host-key-path=%(test_path)s/certs/web-platform.test.key",
"--host-cert-path=%(... |
from FireGirlOptimizer import *
FGPO = FireGirlPolicyOptimizer()
FGPO.createFireGirlPathways(10,50)
FGPO.NORMALIZED_WEIGHTS_OBJ_FN = False
FGPO.NORMALIZED_WEIGHTS_F_PRIME = False
FGPO.AVERAGED_WEIGHTS_OBJ_FN = True
FGPO.AVERAGED_WEIGHTS_F_PRIME = True
print(" ")
print("Initial Values")
print("objfn: " + str(FGPO.calcOb... |
"""
Account balance report templates
Generic account balance report template that will be used to define
accounting concepts with formulas to calculate its values/balance.
Designed following the needs of the Spanish/Spain localization.
"""
from openerp.osv import orm, fields
from openerp.tools.translate import _
_BALAN... |
"""Added initial tables
Revision ID: initial
Revises: None
Create Date: 2013-10-25 16:52:12.150570
"""
revision = 'initial'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table(u'radio_language',
sa.Col... |
from datetime import datetime
from django.core.mail import send_mail, mail_managers
from django.conf import settings
from django.contrib.sites.models import Site
from django.db import models
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _, override
import getp... |
from __future__ import division
import numpy as np
from math import pi
from scipy.misc import comb
from mpi4py import MPI
import pulp.em as em
import pulp.utils.parallel as parallel
import pulp.utils.tracing as tracing
import pulp.utils.accel as accel
from pulp.utils.datalog import dlog
from pulp.em.camodels import CAM... |
import datetime
from django.contrib.auth.models import User
from django.urls import reverse
from wger.core.tests.base_testcase import WgerTestCase
from wger.utils.helpers import (
make_token,
next_weekday
)
class IcalToolsTestCase(WgerTestCase):
"""
Tests some tools used for iCal generation
"""
... |
from __future__ import absolute_import
"""
Module for running scrapers
"""
import logging;log = logging.getLogger(__name__)
from collections import namedtuple
from amcat.models import Article, Project
ScrapeError = namedtuple("ScrapeError", ["i", "unit", "error"])
class Controller(object):
def __init__(self):
... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('autodidact', '0002_auto_20161004_1251'),
]
operations = [
migrations.CreateModel(
name='RightAnswer',
fields=[
('... |
from gi.repository import Gtk
import os
class ExportDialog(Gtk.Dialog):
def __init__(self,parent,*args):
Gtk.Dialog.__init__(self, "Exportieren", parent, 0,
(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OK, Gtk.ResponseType.OK))
self.set_default_size(150,150)
self.contentarea=self.get_content_area(... |
"""
Name : Stegano Extract and Read File From Image
Created By : Agus Makmun (Summon Agus)
Blog : bloggersmart.net - python.web.id
License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
Documentation : https://github.com/agusmakmun/Some-Examples-of-Simple-Python-Script/
"... |
__author__ = "Yaiza Rubio and Félix Brezo <contacto@i3visio.com>"
__version__ = "1.1"
import argparse
import json
import re
import sys
import urllib2
import osrframework.utils.browser as browser
from osrframework.utils.platforms import Platform
class Streakgaming(Platform):
"""
A <Platform> object for Strea... |
from django.core.urlresolvers import reverse
from taiga.base.utils import json
from tests import factories as f
from tests.utils import disconnect_signals, reconnect_signals
import pytest
pytestmark = pytest.mark.django_db
def setup_module(module):
disconnect_signals()
def teardown_module(module):
reconnect_sig... |
__version__ = '1.1.0'
default_app_config = 'ipware.apps.AppConfig' |
from __future__ import division
import math
import time
from datetime import datetime, timedelta
import pytz
from openerp import api, fields, models
from openerp.exceptions import Warning as UserError
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.tools.translate import _
class HrAttendance(model... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.