repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
tbjohns/python-util | src/matrix.py | import numpy as np
from scipy import sparse as sp
def _get_sparse_save_kwargs(A):
return {
"data": A.data,
"indices": A.indices,
"indptr": A.indptr,
"shape": A.shape
}
def save_csr_matrix(filepath, A):
np.savez(filepath, **_get_sparse_save_kwargs(A))
def save_csc_matrix(filepath, A):
np.save... |
ltowarek/budget-supervisor | third_party/nordigen/test/test_jwt_obtain_pair.py | # coding: utf-8
"""
Nordigen Account Information Services API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 2.0 (v2)
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ i... |
loleg/dribdat | dribdat/admin/forms.py | # -*- coding: utf-8 -*-
from flask_wtf import FlaskForm
from wtforms import (
HiddenField, SubmitField, BooleanField,
StringField, PasswordField, SelectField,
TextAreaField, RadioField, IntegerField,
)
from wtforms.fields.html5 import (
DateField, TimeField,
URLField, EmailField,
)
from wtforms.vali... |
vgamula/breakyourantiques | antiques/core/utils.py | import json
from flask import request
from .hooks import before_request
def route(bp, rule, **kwargs):
def decorator(f):
endpoint = kwargs.pop('endpoint', None)
if isinstance(rule, list):
for url in rule:
bp.add_url_rule(url, endpoint, f, **kwargs)
elif isinsta... |
bueda/bueda-flickr-mashup | bueda_flickr_mashup/views.py | from django.views.generic.simple import direct_to_template
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest
import flickrapi
import flickrapi.shorturl
import simplejson
import bueda
import logging
def demo(request):
flickr_conn = flickrapi.FlickrAPI(settings.FLICKR_AP... |
TonkWorks/pepper_autocomplete | pepper_install.py | from .pepper import *
@async
def install_chromedriver():
if sublime.platform() == 'linux':
if sublime.arch() == 'x32':
dl_path = 'chromedriver-linux-32'
elif sublime.arch() == 'x64':
dl_path = 'chromedriver-linux-64'
elif sublime.platform() == 'windows':
dl_path... |
r0jsik/rinde | rinde/property/animation.py | """
Represents manager for every animation in the stage.
Every animation that is run in the Rinde thread, has to be inserted to this collection.
"""
class Animations:
"""
Collection of each animation that is being running.
"""
__ACTIVE = set()
"""
Buffer for each animation that could not be activated directly... |
keon/algorithms | algorithms/maths/recursive_binomial_coefficient.py | def recursive_binomial_coefficient(n,k):
"""Calculates the binomial coefficient, C(n,k), with n>=k using recursion
Time complexity is O(k), so can calculate fairly quickly for large values of k.
>>> recursive_binomial_coefficient(5,0)
1
>>> recursive_binomial_coefficient(8,2)
28
>>> recur... |
delink/TA-dnsbl | bin/external_dnsbl_lookup.py | #!/usr/bin/env python
import csv
import sys
import socket
""" This takes a CSV of IP addresses in and does DNSBL lookups on each
DNSBL in the dnsbl_config_lookup CSV file. It tries as hard as
possible to only call out to the OS DNS lookup facility when it has
to, taking advantage of any possible local cac... |
ctk3b/InterMol | intermol/forces/lj_c_pair_type.py | import simtk.unit as units
from intermol.decorators import accepts_compatible_units
from intermol.forces.abstract_pair_type import AbstractPairType
class LjCPairType(AbstractPairType):
__slots__ = ['C6', 'C12', 'scaleLJ', 'scaleQQ', 'long']
@accepts_compatible_units(None, None,
... |
gustavomazevedo/tbackup-server | server/models/__init__.py |
from .Backup import Backup
from .Origin import Origin
from .destination.BaseDestination import BaseDestination
from .destination.LocalDestination import LocalDestination
from .destination.SFTPDestination import SFTPDestination
from .destination.APIDestination import APIDestination
from django.contrib.auth.model... |
0111001101111010/cs595-f13 | assignment1/q2/q2.py | #Stanley Zheng
#CS495/595 Assignment 1
#Q2 Parse and grab scores from ESPN website
#usage python ./q2.py team time website
#sources
#using .encode('utf-8') to solve ascii errors
#http://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20
#Hany ~ office hours ... |
sivakumar-kailasam/Repeat-Macro | repeatMacro.py | #
# Sivakumar Kailasam and lowliet
#
import sublime, sublime_plugin
class RepeatMacroCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.window().show_input_panel("Repeat count or [Enter] to run till end of file", "", self.__execute, None, None)
def __execute(self, text):
if... |
daniel-ziegler/eamail | project/config/settings.py | from __future__ import unicode_literals
from os.path import abspath, dirname, expanduser, join
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'development_db',
'USER': 'development_user',
'OPTIONS': {
'sql_mode': 'STRICT_ALL_TABLES',
}... |
romka/leaderboards-server | http_responder.py | __author__ = 'Roman Arkharov'
from twisted.web.resource import Resource
from pymongo import MongoClient
import simplejson as json
class LeaderboardsWebserver(Resource):
isLeaf = True
def __init__(self, db_name, db_host, db_port):
self.db_name = db_name
self.db_host = db_host
... |
underscorephil/softlayer-python | SoftLayer/managers/cdn.py | """
SoftLayer.cdn
~~~~~~~~~~~~~
CDN Manager/helpers
:license: MIT, see LICENSE for more details.
"""
import six
from SoftLayer import utils
MAX_URLS_PER_LOAD = 5
MAX_URLS_PER_PURGE = 5
class CDNManager(utils.IdentifierMixin, object):
"""Manage CDN accounts."""
def __init__(self, client):
... |
dmwyatt/disney.api | pages/restaurant.py | import datetime
import logging
import os
import re
import webbrowser
from dateutil import parser
from selenium.common.exceptions import NoSuchElementException, WebDriverException
from selenium.webdriver.common.keys import Keys
from helpers import format_dt
from pages.datepicker import JqueryUIDatePicker
from pages.he... |
HoliestCow/ece692_deeplearning | project1/pd_test.py |
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import matplotlib._color_data as mcd
data = [
[1, 2, 1, 0.5],
[3, 4, 1, 0.5],
[5, 6, 1, 0.5]
]
result = pd.DataFrame.from_records(data,
columns=['number1', 'number2', 'label', 'sublabel'],
... |
trolldbois/ctypeslib | ctypeslib/codegen/handler.py | """Abstract Handler with helper methods."""
from clang.cindex import CursorKind, TypeKind
from ctypeslib.codegen import typedesc
from ctypeslib.codegen.util import log_entity
import logging
log = logging.getLogger('handler')
class CursorKindException(TypeError):
"""When a child node of a VAR_DECL is parsed as... |
hellolintong/LinDouFm | tests/test_database/test_music.py | # coding:utf-8
from database.music import music_model
import tempfile
def get_test_music():
cover = tempfile.TemporaryFile()
cover.write(u"test_cover")
cover.seek(0)
audio = tempfile.TemporaryFile()
audio.write(u"test_audio")
audio.seek(0)
music_information = {
u"tit... |
MIT-LCP/false-alarm-reduction | pyfar/ventricular_beat_stdev.py | from __future__ import print_function
from classifier import get_baseline, get_power, get_ksqi, get_pursqi
from fastdtw import fastdtw
from scipy.spatial.distance import euclidean
from scipy.stats import entropy
from datetime import datetime
from copy ... |
arnaudoff/watcher | users/forms.py | from django import forms
from django.contrib.auth import ( authenticate, get_user_model )
User = get_user_model()
class UserLoginForm(forms.Form):
username = forms.CharField()
password = forms.CharField(widget=forms.PasswordInput)
def clean(self, *args, **kwargs):
username = self.cleaned_data.get("use... |
reciprep/reciprep-server | flask-api/tests/test_ingredient.py | import time
import json
import unittest
import traceback
from api import db
from api.models.user import User
from tests.base_test_case import BaseTestCase
from tests.helpers.auth import req_user_login, req_user_register, req_user_status
from tests.helpers.ingredient import req_add_ingredient_to_pantry, get_ingredients... |
ncrocfer/whatportis | tests/test_utils.py | from whatportis.db import merge_protocols
def test_merge_protocols_different_ports():
ports = [
{
"description": "My description 1",
"name": "MyName 1",
"port": "1234",
"protocol": "udp",
},
{
"description": "My description 2",
... |
kapilgarg1996/mp3wav | tests/apptest.py | #ToDo : Write tests for application interface
import pytest
import os
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from mp3wav.application import Mp3WavApp
from mp3wav.exceptions.fileexception import FileTypeException
from mp3wav.exceptions.libraryexception import LibraryException
from mp3wav.exceptions.filenot... |
wbchen99/bitcoin-hnote0 | qa/rpc-tests/test_framework/test_framework.py | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Base class for RPC testing
import logging
import optparse
import os
import sys
import shutil
import te... |
douglascamata/passman_cli | test/test_passman-cli.py | """
Tests for `passman-cli` module.
"""
import pytest
from passman_cli import passman_cli
class TestPassmanCli(object):
@classmethod
def setup_class(cls):
pass
def test_something(self):
pass
@classmethod
def teardown_class(cls):
pass
|
levilucio/SyVOLT | UMLRT2Kiltera_MM/MT_pre__Site.py | """
__MT_pre__Site.py_____________________________________________________
Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY)
Author: gehan
Modified: Sun Feb 15 10:22:15 2015
______________________________________________________________________
"""
from ASGNode import *
from ATOM3Type import *
... |
cancan101/pynetdicom | netdicom/timer.py | #
# Copyright (c) 2012 Patrice Munger
# This file is part of pynetdicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pynetdicom.googlecode.com
#
# Timer class
import time
import logging
logger = logging.getLogger(__name__)
class... |
jmoreman/eTrack | qualification/migrations/0003_auto_20161224_2128.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-24 21:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('qualification', '0002_auto_20161224_2033'),
]
operations = [
migrations.Alt... |
jmcarp/smore | smore/validate/core.py | # -*- coding: utf-8 -*-
from marshmallow import ValidationError as MarshmallowValidationError
try:
from webargs import ValidationError as WebargsValidationError
except ImportError:
HAS_WEBARGS = False
else:
HAS_WEBARGS = True
if HAS_WEBARGS:
class ValidationError(WebargsValidationError, MarshmallowVal... |
N3X15/python-build-tools | buildtools/buildsystem/prebuild.py | '''
Prebuild Wrapper Classes
Copyright (c) 2015 Rob "N3X15" Nelson <nexisentertainment@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation... |
bpasero/electron | script/lib/git.py | #!/usr/bin/env python
"""Git helper functions.
Everything here should be project agnostic: it shouldn't rely on project's
structure, or make assumptions about the passed arguments or calls' outcomes.
"""
from __future__ import unicode_literals
import io
import os
import posixpath
import re
import subprocess
import ... |
pyhmsa/pyhmsa | pyhmsa/util/cookbook.py | """
Utility functions taken from Python Cookbook
"""
# Standard library modules.
from collections.abc import Iterable
# Third party modules.
# Local modules.
# Globals and constants variables.
def flatten(items, ignore_types=(str, bytes)):
for x in items:
if isinstance(x, Iterable) and not isinstance(x... |
amas0/patools | patools/gs.py | #!/usr/bin/python
import numpy as np
def _computeGreatCircleDistance(p1, config, rad):
"""
Given one particle on a sphere, computes the great circle distance between
it and the rest of the particles.
The strategy here is to take advantage of contiguous memory that numpy
provides, so we compute al... |
CianLR/pyRSA | RSA.py | from random import SystemRandom
class RSA:
def __init__(self, bits, RMiterations=64):
self.random = SystemRandom()
self.RMi = RMiterations
self.bits = bits
p, q = self.gen_primes()
self.n = p*q
totient = (p-1) * (q-1)
self.public_key = 65537
... |
prathamtandon/g4gproblems | DP/coin_change.py | import unittest
"""
Given a value N, if we want to make change for N cents, and we have an infinite supply
of each S = {S1, S2, ..., Sm} valued coins, how many ways can we make the change?
Input: N = 4, S = {1, 2, 3}
Output: {1,1,1,1}, {1,1,2}, {2,2}, {1,3} so total 4 ways.
"""
def coin_change_2(N, S):
num_denoms... |
abacusresearch/gitflow | test/unit/test_semver.py | from gitflow.const import VersioningScheme
from gitflow.procedures.scheme import scheme_procedures
from gitflow.version import VersionConfig
config = VersionConfig()
config.versioning_scheme = VersioningScheme.SEMVER
config.qualifiers = ['alpha', 'beta']
def test_major_increment():
assert scheme_procedures.versi... |
imk1/IMKTFBindingCode | makeDifferentialInteractionMatForBed.py | import sys
import argparse
import numpy as np
def parseArgument():
# Parse the input
parser =\
argparse.ArgumentParser(description = "Make a differential interaction matrix for regions in a bed file based on 2 long-distance interaction matrix files")
parser.add_argument("--bedFileName", required=True,
help='Be... |
Nexedi/neoppod | neo/tests/client/testClientApp.py | #
# Copyright (C) 2009-2019 Nexedi SA
#
# 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... |
cfobel/camip | camip/bin/place.py | # coding: utf-8
import hashlib
import sys
from path_helpers import path
from table_layouts import (get_PLACEMENT_TABLE_LAYOUT,
get_PLACEMENT_STATS_TABLE_LAYOUT,
get_PLACEMENT_STATS_DATAFRAME_LAYOUT)
from camip import CAMIP, VPRSchedule
from camip.timing import CAMI... |
schleichdi2/OPENNFR-6.3-CORE | bitbake/lib/bs4/element.py | __license__ = "MIT"
from pdb import set_trace
import collections.abc
import re
import sys
import warnings
from bs4.dammit import EntitySubstitution
DEFAULT_OUTPUT_ENCODING = "utf-8"
PY3K = (sys.version_info[0] > 2)
whitespace_re = re.compile(r"\s+")
def _alias(attr):
"""Alias one attribute name to another for b... |
credativ/pulp | server/test/unit/server/managers/repo/test_distributor.py | import mock
from .... import base
from pulp.devel import mock_plugins
from pulp.plugins.config import PluginCallConfiguration
from pulp.plugins.model import Repository
from pulp.server.db.model.repository import Repo, RepoDistributor
import pulp.server.exceptions as exceptions
import pulp.server.managers.repo.cud as r... |
zifu-wang/mesh2mesh | m2m/field_projection.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# field_projection.py
#
# Copyright (C) 2013-2015 Zifu Wang <z@mesh2mesh.com>
#
import sys
import numpy as np
import m2m.io_base as io
import m2m.mesh_tree as mt
import m2m.quadrature_class as qr
import m2m.reference_mapping as ref
import m2m.element_... |
zerovm/glibc | make_sysd_rules.py |
# Generates the makefile "sysd-rules" given a list of sysdeps
# subdirectories (the sysdirs search path). For every basename that
# appears in the search path, e.g. "vfork", it picks the source file
# that appears first, e.g. "sysdeps/unix/sysv/linux/i386/vfork.S".
# TODO(mseaborn): Handle check-inhibit-asm
# TODO(m... |
marcus-oscarsson/mxcube3 | mxcube3/blcontrol.py | """
Module that provides access to the underlying beamline control layer,
HardwareRepository. The HardwareRepository consists of several HardwareObjects
that can be directly accessed through this module. See the list of
HardwareObjects that are "exported" below.
"""
from __future__ import absolute_import
from __future_... |
soylentdeen/BlurryApple | Diagnostics/TT_test/compare_T+.py | import scipy
import numpy
import pyfits
import matplotlib.pyplot as pyplot
import looptools
fig = pyplot.figure(0)
IF_file = '../../Tools/IF_cube_HR.fits'
ifcube = pyfits.getdata(IF_file)
FISBA_datadir = '/home/deen/Data/GRAVITY/FISBA/TipTilt/refslope0/'
loopdir = '/home/deen/Data/GRAVITY/LoopClosure/'
flat_loop = lo... |
benoitclem/DiVi | DiVi.py | #!/usr/bin/env python3
from gi.repository import Gtk, Gdk, Gio, GObject
from libDiVi.ui.Styles import *
from libDiVi.ui.Drawables import *
from libDiVi.ui.Library import *
from libDiVi.ui.Project import *
from libDiVi.ui.FlowGraph import *
from libDiVi.lang.lang import *
import os
'''
class DirReader:
def __init_... |
dhavalmanjaria/dma-student-information-system | internal_assessment/models.py | from django.db import models
from curriculum.models import Subject
from user_management.models.group_info import StudentInfo
class Metric(models.Model):
"""
Represents a metric that can be assigned in a subject.
Theoretically these are mutli-valued attributes of the subject
entity
"""
name = m... |
udinfolab/ir-eval | import/db-import.py | # -*- coding: utf-8 -*-
'''
Import the data (assessors, queries, documents) into DB
'''
import os
import re
import sys
import csv
import json
import base64
import argparse
import traceback
import MySQLdb as mdb
import datetime
from collections import defaultdict
# global variables
# file paths
# query
ASSESSOR_FILE ... |
awinkgit/datavis | plotly/graph_plotly.py | #! /usr/bin/python
# prepare environment
import sys, psycopg2, datetime
# import visualizer
import plotly.plotly as py
from plotly.graph_objs import *
py.sign_in("plotlyuser", "plotlypass")
### demo 1: just plot something
print 'demo 1, started at %s' % str(datetime.datetime.now())
cur = None
try:
con = psycopg... |
rajul/tvb-framework | tvb/core/entities/transient/context_overlay.py | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... |
vpelletier/neoppod | neo/tests/zodb/testVersion.py | #
# Copyright (C) 2009-2016 Nexedi SA
#
# 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... |
sslab-gatech/avpass | src/modules/template_api.py | #!/usr/bin/env python2
from random import randint
import random
words = ['person', 'year', 'world', 'child', 'woman', 'place', 'week', 'case', 'point',
'number', 'group', 'problem', 'fact', 'part', 'hand', 'life', 'thing', 'stack', 'jobs'
, 'docu', 'users', 'every', 'develop', 'build', 'apks']
# java(1)
JAV... |
SCSSoftware/BlenderTools | addon/io_scs_tools/exp/pip/node.py | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 ... |
moio/spacewalk | backend/server/test/TestRedhat.py | #
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
gromacs/copernicus | cpc/lib/gromacs/grompp.py | # This file is part of Copernicus
# http://www.copernicus-computing.org/
#
# Copyright (C) 2011, Sander Pronk, Iman Pouya, Erik Lindahl, and others.
#
# 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 Soft... |
unapiedra/BBChop | BBChop/listUtils.py | # Copyright 2008 Ealdwulf Wuffinga
# This file is part of BBChop.
#
# BBChop 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 ... |
hugdiniz/anuarioDjango | yearbook/migrations/0006_auto_20141214_2225.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('yearbook', '0005_auto_20141214_0017'),
]
operations = [
migrations.AddField(
model_name='lotacao',
n... |
damaxwell/siple | examples/e2/coeff.py | import siple
from siple.gradient.forward import NonlinearForwardProblem
from siple.gradient.nonlinear import BasicInvertNLCG, BasicInvertIGN
from siple.linalg.linalg_numpy import NumpyVector
import numpy as np
from scipy import sparse
from scipy.sparse.linalg import spsolve
from siple.reporting import pause, endpause
f... |
hpparvi/PyTransit | pytransit/lpf/eclipselpf.py | # PyTransit: fast and easy exoplanet transit modelling in Python.
# Copyright (C) 2010-2020 Hannu Parviainen
#
# 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... |
spiceqa/virt-test | libvirt/tests/src/virsh_cmd/domain/virsh_setvcpus.py | import re
import os
import logging
import commands
from autotest.client.shared import error
from virttest import remote, virsh, libvirt_xml
from xml.dom.minidom import parse
def run_virsh_setvcpus(test, params, env):
"""
Test command: virsh setvcpus.
The conmand can change the number of virtual CPUs in t... |
Spitfire1900/meld | meld/vc/__init__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2002-2005 Stephen Kennedy <stevek@gnome.org>
# Copyright (C) 2012 Kai Willadsen <kai.willadsen@gmail.com>
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions o... |
yanshengli/weibo_information_diffusion | build_graph_curve.py | __author__ = 'LiGe'
#encoding:utf-8
import json
from networkx.readwrite import json_graph
import time
import numpy as np
default_encoding = 'utf-8'
def build_graph_curve():
day=list()
user_id=dict()
f1=open('./data/fixed_user_2_repost.txt','wb')
with open('./data/user_repost.txt','r') as f:
... |
ohjimijimijimi/vmachine-tools | vmlib/jsonconfig.py | import os
import shutil
import json
import re
from log import debug
class JSONConfig:
def __init__(self, path):
self.path = path
with open(self.path, 'r') as f:
self.data = json.load(f)
f.closed
#debug(self.data)
def get(self, key):
"""
Get the confi... |
jirikuncar/kwalitee | setup.py | # -*- coding: utf-8 -*-
#
# This file is part of kwalitee
# Copyright (C) 2014, 2015 CERN.
#
# kwalitee 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) an... |
auduny/chains | lib/chains/reactor/worker/ruleinstances.py | from chains.common import log
from chains.reactor.worker.rulerunner import RuleRunner
# RuleInstances
#
# List of instances for a single rule
# F.ex. if rule A has maxCount=2, then the RuleInstances for rule A
# has a list of 2 instances of RuleRunner for rule A.
#
# Starts out with 0 instances and each time the fir... |
azumimuo/family-xbmc-addon | plugin.video.showboxarize/resources/lib/modules/cleandate.py | # -*- coding: utf-8 -*-
'''
Flixnet Add-on
Copyright (C) 2016 Flixnet
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... |
perrys/WSRC | modules/wsrc/site/usermodel/data_purge.py | # This file is part of WSRC.
#
# WSRC 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.
#
# WSRC is distributed in the hope that it will ... |
mrniranjan/python-scripts | reboot/math13.py | num1 = 92
num2 = 392
num3 = 4456
num4 = 89742
print "let's find out which of the below numbers are bigger"
print " %d, %d, %d, %d" % (num1, num2, num3, num4)
result1 = num1 > num2
result2 = num2 > num3
result3 = num3 > num4
result4 = num4 > num1
mys = "Of numbers %d and %d , Is %d greater than %d:"
s1 = m... |
collinmelton/DDCloudServer | DDServerApp/ORM/Mappers/MappersTest.py | '''
Created on Nov 30, 2015
@author: cmelton
'''
import unittest
from DDServerApp.ORM.Mappers import orm, User, InstanceCommand, Client, Instance, AccessToken, WorkflowTemplate, Image, DiskTemplate, InstanceTemplate, CommandTemplate, Workflow, Disk, Credentials
from DDServerApp.Utilities.JobAndDiskFileReader import Jo... |
frugalware/pacman-g2 | pactest/tests/sync020.py | self.description = "Install a group from a sync db"
sp1 = pmpkg("pkg1")
sp1.groups = ["grp"]
sp2 = pmpkg("pkg2")
sp2.groups = ["grp"]
sp3 = pmpkg("pkg3")
sp3.groups = ["grp"]
for p in sp1, sp2, sp3:
self.addpkg2db("sync", p);
self.args = "-S grp"
self.addrule("PACMAN_RETCODE=0")
for p in sp1, sp2, sp3:
self.add... |
cjgibson/hkvguqktacuranriagqecvebgwbjnlakvhaqytvtbyuvxt | 83423257/make_readable.py | # coding=utf-8
###
# AUTHORS: CHRISTIAN GIBSON,
# PROJECT: EULER CHALLENGES
# UPDATED: JULY 24, 2015
# USAGE: ./make_readable keyfile.json
# EXPECTS: python 2.7.7
###
from Crypto.Cipher import AES
import hashlib
import json
import os
_DEFAULT_DECRYPTED_NAME = u'⁂.py_d'
_DEFAULT_ENCRYPTED_NAME = u'⁂.aes'
def decry... |
kartoza/stream_feature_extractor | plugin_upload.py | #!/usr/bin/env python
# coding=utf-8
"""This script uploads a plugin package on the server.
Authors: A. Pasotti, V. Picavet
"""
from future import standard_library
import sys
import getpass
import xmlrpc.client
from optparse import OptionParser
from builtins import input
standard_library.install_aliases()
# Confi... |
wangd/rhythmbox | plugins/artdisplay/PodcastCoverArtSearch.py | # -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*-
#
# Copyright (C) 2006 - Martin Szulecki
#
# 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, or (at you... |
nicolasgallardo/TECHLAV_T1-6 | bebop_ws/build/image_transport_tutorial/catkin_generated/generate_cached_setup.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/indigo/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.p... |
kernsuite-debian/obit | share/scripts/MKPlotSpec.py | # Plot Spectrum at a list of positions in a FITS ImageMF
# On either raw (no PBCor) or PBCorImageMF.py PB corrected
name = 'Abell_194' # Base of plot name
inFile = 'Abell_194.fits'; fdisk=0 # Input file on cwd
# Specify positions (name, ra, dec)
srcpos = [ \
('core', '01:26:00.597', '-01:20:43.71'), \... |
unioslo/cerebrum | Cerebrum/ChangeLog.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2003-2015 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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... |
gh-5225225/py3line | py3line.py | #!/usr/bin/env python3
import sys
import time
import json
import subprocess
import socket
import re
import os
import requests
import asyncio
from asyncio.tasks import iscoroutine
UPDATE_QUEUE = asyncio.Queue()
try:
os.chdir(sys.path[0])
except FileNotFoundError:
pass
class block_base:
def start(self)... |
jjardon/ybd | ybd/app.py | # Copyright (C) 2014-2016 Codethink Limited
#
# 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; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but... |
ablab/rectangles | utils/find_information_about_mis.py | import sys
if len(sys.argv) != 4:
print "<input nucmer report> <input mis_log> <output>"
exit(1)
tmp_file_name = "information_tmp.txt"
CONTIG = "CONTIG"
MISASSEMBL = "Extensive misassembly"
ALIG = "Real Alignment"
out = open(tmp_file_name, "w")
infos = []
for line in open(sys.argv[1]):
if CONTIG in line:
is_... |
mx3L/archivczsk | build/plugin/src/resources/libraries/youtube_dl/__main__.py | #!/usr/bin/env python
from __future__ import unicode_literals
# Execute with
# $ python youtube_dlc/__main__.py (2.6+)
# $ python -m youtube_dlc (2.7+)
import sys
if __package__ is None and not hasattr(sys, 'frozen'):
# direct call of __main__.py
import os.path
path = os.path.realpath(os.path.ab... |
cobbler/cobbler | cobbler/yumgen.py | """
Builds out filesystem trees/data based on the object tree.
This is the code behind 'cobbler sync'.
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... |
unioslo/cerebrum | contrib/create_flattened_group.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2020 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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 t... |
hfeeki/transifex | transifex/resources/tests/views/status.py | # -*- coding: utf-8 -*-
from django.test.client import Client
from transifex.languages.models import Language
from transifex.resources.models import Resource
from transifex.txcommon.tests.base import BaseTestCase
class StatusCodesTest(BaseTestCase):
"""Test that all app URLs return correct status code.
Moreo... |
prculley/gramps | gramps/plugins/webreport/statistics.py | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007 Johan Gonqvist <johan.gronqvist@gmail.com>
# Copyright (C) 2007-2009 Gary Burton <gary.burton@zen.co.uk>
# Copyright (C) 2007-2009 Stephane Charet... |
superkartoffel/fernbedienung | listPodcast.py | #!/usr/bin/python2
import xml.dom.minidom
import sys
from contextlib import closing
import urllib2
import pprint
def output(link, title=''):
if withtitle=="1":
print title.encode('utf-8'),"\n",link
else:
print link
withtitle = False
if len(sys.argv) > 2:
withtitle = sys.argv[2]
with closing(urllib2.urlope... |
MickaelBergem/pep8-autochecker | pep8runs/models.py | from django.db import models
from bsct.models import BSCTModelMixin
from django.utils import timezone
from jsonfield import JSONField
class Run(BSCTModelMixin, models.Model):
""" A PEP8 run on a project """
STATUS_CHOICES = [
('ok', 'ok'),
('err', 'err'),
('unknown', 'unknown'),
]... |
hyphaltip/GEN220_2015 | Examples/InClass_RE.py | import re
DNA = [ "AGGGATAGCGGAGTGACCC",
"AGGGATAGTGGAGTGACCC",
"AGGGATAGT--GAGTGACCC",
"AGGGATAGT-GAGTGACCC" ]
for dna in DNA:
m = re.search("G([CT]-{0,2}G)", dna)
if m:
print "dna string", dna, "had a match. It was", m.group(0), m.group(1)
# find stop codons
... |
zenoss/ZenPacks.mcgov.SiebelCRMMonitor | ZenPacks/mcgov/SiebelCRMMonitor/remote_agent/winservice.py | # winservice.py
from os.path import splitext, abspath
from sys import modules
import win32serviceutil
import win32service
import win32event
import win32api
import logging
class Service(win32serviceutil.ServiceFramework):
_svc_name_ = '_unNamed'
_svc_display_name_ = '_Service Template'
def __init__(s... |
mateuszmidor/GumtreeOnMap | src/geocoderwithcache.py | '''
Created on 03-08-2014
@author: mateusz
'''
from geocoder import Geocoder
from injectdependency import InjectDependency, Inject
@InjectDependency('logger')
class GeocoderWithCache():
logger = Inject
def __init__(self, geocoder=Geocoder, storage=dict()):
self.geocoder = geocoder
... |
juanpadan/algebra-facile | phrase.py | #!/usr/bin/python
LETT="qwertyuiopasdfghjklzxcvbnm"
NUM="1234567890"
import fractions
Frac = fractions.Fraction
#debug imports
import code
import readline
import rlcompleter
#fine debug imports
#TODO supporto divisione e frazioni
"""
lo scopo di questo modulo è fornire una classe Polinomio per gestire le
espressioni... |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/PyKDE4/kio/KFileMetaDataConfigurationWidget.py | # encoding: utf-8
# module PyKDE4.kio
# from /usr/lib/python2.7/dist-packages/PyKDE4/kio.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdeui as __PyKDE4_kdeui
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
class KFileMetaDataConfigurationWidget(__PyQt4_QtGui.QWidget):
# no d... |
fr34kyn01535/PyForum | app/administration.py | # coding: utf-8
import cherrypy
from app import datenbank,templates,authentifizierung
class Request(object):
exposed = True
def __init__(self):
self.db = datenbank.Datenbank()
def POST(self,action,originalusername=None,username=None,password=None,role=None):
authentifizierung.ValidateAdmin()
if acti... |
nict-isp/uds-sdk | tests/data.py | # -*- coding: utf-8 -*-
TEST_M2M_DATA1 = {
"primary": {
"format_version": 1.02,
"title": "SampleLocalFileSensor",
"provenance": {
"source": {
"info": "C:\\_Git_\\uds-sdk\\uds\\sample\\2013-44-zensu.csv",
"contact": ""
},
"c... |
sam-m888/gprime | gprime/test/test_util.py | #
# gPrime - A web-based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
#
# 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 optio... |
tongpo/Holle-World | py/python3-cookbook/cookbook/c03/p12_datatime.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: 日期时间转换
Desc :
"""
from datetime import timedelta
from datetime import datetime
from dateutil.relativedelta import relativedelta
def date_time():
a = timedelta(days=2, hours=6)
b = timedelta(hours=4.5)
c = a + b
print(c.days)
print(c.secon... |
cs2c-zhangchao/nkwin1.0-anaconda | pyanaconda/ui/gui/spokes/lib/passphrase.py | # Dialog for creating new encryption passphrase
#
# Copyright (C) 2012 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This pr... |
Execut3/CTF | IRAN Cert/2016/1- Easy/Crypto/10-40pt- crypto engine/crypto engine/ascii_art_40pt/views.py | from django.http import HttpResponse
from django.shortcuts import render, render_to_response
from django.template import RequestContext
from random import randint, shuffle
CHARACTERS = 'abcdefghijklmnopqrstuvwxyz'
CHARACTERS += CHARACTERS.upper()
CHARACTERS += '1234567890!@#$%^&*()-=_+{}'
char_mapper = {'!': 184, '#... |
ggm/vm-for-transfer | src/compiler/eventhandler.py | #Copyright (C) 2011 Gabriel Gregori Manzano
#
#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 distribute... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.