code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
from turtle import *
from itertools import cycle
from math import sqrt, sin
def cercle(rayon, couleur):
fillcolor(couleur)
pencolor(couleur)
begin_fill()
circle(rayon)
end_fill()
def positionne_tortue(pas):
penup()
left(90)
forward(pas)
right(90)
pendown()
colormode(255)
bl... | TGITS/programming-workouts | erri/python/lesson_39/bouclier.py | Python | mit | 1,438 |
from .base_encrypted_field import BaseEncryptedField
from .irreversible_rsa_encryption_field import IrreversibleRsaEncryptionField
from .restricted_rsa_encryption_field import RestrictedRsaEncryptionField
from .local_aes_encryption_field import LocalAesEncryptionField
from .local_rsa_encryption_field import LocalRsaEnc... | botswana-harvard/edc-crypto-fields | edc_crypto_fields/fields/__init__.py | Python | gpl-2.0 | 953 |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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 the rights to use, copy, modify, merge, publish,
... | andrewyoung1991/scons | test/scons-time/mem/chdir.py | Python | mit | 1,948 |
"""Stocastic graph."""
# Copyright (C) 2010-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils import not_implemented_for
__author__ = "Aric Hagberg <aric.hagberg@g... | jni/networkx | networkx/generators/stochastic.py | Python | bsd-3-clause | 1,460 |
"""Appliance update plugin
If update_urls is set in the env, re-trigger the update_rhel configuration
step to update the appliance with the new URLs
"""
import os
import pytest
def pytest_parallel_configured():
if pytest.store.parallelizer_role != 'master' and 'update_urls' in os.environ:
pytest.store.... | thom-at-redhat/cfme_tests | fixtures/update_appliance.py | Python | gpl-2.0 | 460 |
import matplotlib.pyplot as plt
import numpy as np
import urllib
SDSS_File = '/Users/compastro/jenkins/SDSS_z+04_no_4363.csv'
SDSS_Data = np.genfromtxt(SDSS_File,skip_header=2, delimiter = ',',dtype=float,unpack=True)
NII_6583 = SDSS_Data[28,:]
Ha_6562 = SDSS_Data[27,:]
OIII_5006 = SDSS_Data[20,:]
Hb_4861 = SDSS_Data[1... | crichardson17/emgtemp | den_u_sims/no_4363_no_sims_plots.py | Python | mit | 1,383 |
""" Discovers Belkin Wemo devices. """
from . import SSDPDiscoverable
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Belkin WeMo platform devices. """
def info_from_entry(self, entry):
""" Returns most important info from a uPnP entry. """
device = entry.description.f... | toddeye/netdisco | netdisco/discoverables/belkin_wemo.py | Python | mit | 658 |
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.utils import timezone
from datetime import timedelta
from sslscout.models import Profile, SiteGroup, Site, CheckEngine, SiteCheck, SiteCheck
from sslscout.engines import www_ssllabs_com, sslcheck_globalsign_co... | tykling/sslscout | src/sslscout/management/commands/runengines.py | Python | bsd-3-clause | 4,070 |
from flask import current_app
from simplecoin import create_app
from simplecoin.tasks import celery
from celery.bin.worker import main
app = create_app(celery=True)
with app.app_context():
# import celerybeat settings
celery.conf.update(current_app.config['celery'])
current_app.logger.info("Celery worke... | simplecrypto/simplecoin | simplecoin/celery_entry.py | Python | mit | 371 |
import os
from utils.enums import DeployStrategy
DEBUG = False
# Server primary configuration
SERVER_CONFIG = {
# Port of service
"PORT": 7722,
# Mongo Section
"MONGO_HOST": "192.168.100.1",
"MONGO_PORT": 27017,
"MONGO_USER": "superuser",
"MONGO_PWD": "******",
# Resource
"RESOU... | magus0219/niner | config/example.py | Python | mit | 5,016 |
import webapp2
from handlers import MainPage, BlogFront, NewPost, PostPage, Register
from handlers import Login, Logout, Like, PostEdit, PostDelete, CommentEdit
from handlers import CommentDelete
app = webapp2.WSGIApplication([('/', MainPage),
('/blog/?', BlogFront),
... | YuhanLin1105/Multi-User-Blog | multi_blog.py | Python | mit | 940 |
# Generated by Django 2.2 on 2021-06-11 08:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('donation', '0004_donorinfo'),
]
operations = [
migrations.AddField(
model_name='donorinfo',
name='is_indian',
... | PARINetwork/pari | donation/migrations/0005_donorinfo_is_indian.py | Python | bsd-3-clause | 383 |
# Copyright 2014 OpenCore LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | jhorey/ferry | ferry/config/hadoop/hadoopconfig.py | Python | apache-2.0 | 21,276 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-22 10:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('server', '0001_initial'),
]
operations = [
migrations.AddField(
... | jgsogo/neutron | webapp/server/migrations/0002_auto_20160522_1236.py | Python | gpl-2.0 | 863 |
# let setuptools to the monkeypatching for wheel
import setuptools
import distutils.core
import os
from platform import system
import shutil
from distutils.core import Extension
from distutils.command.install_lib import install_lib
from distutils.command.build_ext import build_ext
from os.path import join, isdir, exis... | raffber/capnqml | setup.py | Python | mpl-2.0 | 3,678 |
import Base
import sys
import industrial_lib
time_of_day='_day'
(landing_platform,bar,weap) = industrial_lib.MakeCorisc (time_of_day,'bases/bartender_union.py')
| vinni-au/vega-strike | data/bases/university_ISO_sunset.py | Python | gpl-2.0 | 162 |
from pybeans.const import UNDEFINED
from pybeans.exceptions import EncodingException
from pybeans.nodes import *
class SchemaEncoder(object):
visitors = None
@classmethod
def create_instance(cls):
instance = cls()
instance.visitors = {
StrNode: instance._visit_value,
... | cordis/pybeans | pybeans/encoder.py | Python | mit | 2,421 |
#!/usr/bin/env python
#=========================================================================
# This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
# License (GPL) version 3, as described at www.opensource.org.
# Copyright (C)2017 William H. Majoros (martiandna@gmail.com).
#==============================... | ReddyLab/POPSTARR2 | make-trim-slurms.py | Python | gpl-3.0 | 2,439 |
#
# Copyright (c) 2008--2011 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... | dmacvicar/spacewalk | backend/server/rhnImport.py | Python | gpl-2.0 | 3,346 |
"""
Tests for transformers.py
"""
from mock import MagicMock, patch
from nose.plugins.attrib import attr
from unittest import TestCase
from ..block_structure import BlockStructureModulestoreData
from ..exceptions import TransformerException
from ..transformers import BlockStructureTransformers
from .helpers import (
... | Learningtribes/edx-platform | openedx/core/lib/block_structure/tests/test_transformers.py | Python | agpl-3.0 | 3,251 |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/cr/crvserver_binding.py | Python | apache-2.0 | 4,757 |
from .core import jackknife
from .parallel import fold
| obmarg/toolz | toolz/sandbox/__init__.py | Python | bsd-3-clause | 55 |
# -*- coding: utf-8 -*-
def toflat(obj, ns=""):
res = {}
for key in obj:
if type(obj[key]) is dict:
subdict = toflat(obj[key], "%s%s" % (ns,key[0].upper()+key[1:]))
for k in subdict:
res[k[0].upper()+k[1:]] = subdict[k]
else:
res["%s%s" % (n... | fraoustin/flask-monitor | flask_monitor/util.py | Python | gpl-2.0 | 634 |
import sys
import unittest
import threading
import os
from nose.tools import eq_
from pydev_imports import StringIO, SimpleXMLRPCServer
from pydev_localhost import get_localhost
from pydev_console_utils import StdIn
import socket
# make it as if we were executing from the directory above this one
sys.argv[0] = os.path... | AMOboxTV/AMOBox.LegoBuild | script.module.pydevd/lib/tests/test_pydev_ipython_011.py | Python | gpl-2.0 | 7,272 |
import numpy as nm
from sfepy.terms.terms import Term, terms
from sfepy.base.base import get_default
def grad_as_vector(grad):
grad = grad.transpose((0, 1, 3, 2))
sh = grad.shape
return grad.reshape((sh[0], sh[1], sh[2] * sh[3], 1))
class AdjDivGradTerm(Term):
r"""
Gateaux differential of :math:`... | RexFuzzle/sfepy | sfepy/terms/terms_adj_navier_stokes.py | Python | bsd-3-clause | 22,730 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "storytest.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| rich9005/CmpE_272_Text_to_Braille | storytest/manage.py | Python | gpl-2.0 | 252 |
#!/usr/bin/env python3
""" NumPy is the fundamental package for array computing with Python.
It provides:
- a powerful N-dimensional array object
- sophisticated (broadcasting) functions
- tools for integrating C/C++ and Fortran code
- useful linear algebra, Fourier transform, and random number capabilities
- and muc... | endolith/numpy | setup.py | Python | bsd-3-clause | 17,447 |
from __future__ import absolute_import
import datetime
import time
from celery.events.state import Task
from .search import satisfies_search_terms
def iter_tasks(events, limit=None, type=None, worker=None, state=None,
sort_by=None, received_start=None, received_end=None,
started_start... | raphaelmerx/flower | flower/utils/tasks.py | Python | bsd-3-clause | 2,482 |
# vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2015 Andrew Ziem
# http://bleachbit.sourceforge.net
#
# 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... | uudiin/bleachbit | tests/TestWorker.py | Python | gpl-3.0 | 4,656 |
# NOTE: this should inherit from (object) to function correctly with python 2.7
class CachedProperty(object):
""" A property that is only computed once per instance and
then stores the result in _cached_properties of the object.
Source: https://github.com/bottlepy/bottle/commit/fa7733e075da0d790d809aa3... | psy0rz/zfs_autobackup | zfs_autobackup/CachedProperty.py | Python | gpl-3.0 | 1,252 |
#!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Functionality to build scripts, as well as signature hash functions.
This file is modified from python... | ahmedbodi/vertcoin | test/functional/test_framework/script.py | Python | mit | 21,580 |
# -*- coding: utf-8 -*-
"""
An email representation based on a database record.
"""
from html2text import HTML2Text
from django.template.loader import render_to_string
from modoboa.lib.email_utils import Email
from .sql_connector import SQLconnector
from .utils import fix_utf8_encoding, smart_text
class SQLemail(... | modoboa/modoboa-amavis | modoboa_amavis/sql_email.py | Python | mit | 2,249 |
from PyQt4 import QtGui
from dynamics_ui import Ui_dynamic
from config import Config
class DynamicsWindow(QtGui.QDialog):
def __init__(self, parent = None):
QtGui.QWidget.__init__(self,parent)
self.ui = Ui_dynamic()
self.ui.setupUi(self)
self.init_table()
self.ui.addButton_2... | elliott-wen/LocalizationSystemGUI | dynamicswindow.py | Python | apache-2.0 | 1,526 |
# coding: utf-8
import base64
import flynn.decoder
import flynn.encoder
import flynn.data
__all__ = [
"decoder",
"encoder",
"dump",
"dumps",
"dumph",
"load",
"loads",
"loadh",
"Tagging",
"Undefined"
]
dump = flynn.encoder.dump
dumps = flynn.encoder.dumps
load = flynn.decoder.load
loads = flynn.decoder.lo... | fritz0705/flynn | flynn/__init__.py | Python | mit | 572 |
import logging
from ..topology import TopologyChangeError
log = logging.getLogger(__name__)
def set_pos(eptm, geom, pos):
"""Updates the vertex position of the :class:`Epithelium` object.
Assumes that pos is passed as a 1D array to be reshaped as (eptm.Nv, eptm.dim)
"""
log.debug("set pos")
if ... | CellModels/tyssue | tyssue/solvers/base.py | Python | gpl-2.0 | 607 |
#!/usr/bin/env python
"""
Script for generating distributables based on platform skeletons.
User supplies path for pyfa code base, root skeleton directory, and where the
builds go. The builds are automatically named depending on the pyfa config
values of `version` and `tag`. If it's a Stable release, the naming
... | Ebag333/Pyfa | scripts/dist.py | Python | gpl-3.0 | 9,587 |
# Find Eulerian Tour
#
# Write a function that takes in a graph
# represented as a list of tuples
# and return a list of nodes that
# you would follow on an Eulerian Tour
#
# For example, if the input graph was
# [(1, 2), (2, 3), (3, 1)]
# A possible Eulerian tour would be [1, 2, 3, 1]
from collections import defaultd... | codecakes/algorithms_monk | graphs/find_eulerian_path.py | Python | mit | 5,531 |
import sys, py
import pycmd
pytest_plugins = "pytest_pytester"
def pytest_generate_tests(metafunc):
multi = getattr(metafunc.function, 'multi', None)
if multi is not None:
assert len(multi.kwargs) == 1
for name, l in multi.kwargs.items():
for val in l:
metafunc.addc... | blindroot/pycmd | test_pycmd.py | Python | mit | 5,157 |
#!/usr/bin/env python
# encoding: utf-8
"""
redis_utils.py
"""
import inspect
import os
import redis
import redis.sentinel
import redis_lock
import time
import traceback
from redis.exceptions import ConnectionError, RedisError
class StoneRedis(redis.client.Redis):
def __init__(self, *args, **k... | stoneworksolutions/stoneredis | stoneredis/client.py | Python | mit | 13,287 |
import bucket
import unittest
class BucketTestCase(unittest.TestCase):
def setUp(self):
self.app = bucket.app.test_client()
def test_set(self):
response = self.app.post('/set/foobar', data={'foobar': 'wangskata'})
assert response.status_code == 200
assert response.data == 'OK'... | marconi/blog-post-bucket | bucket_test.py | Python | mit | 529 |
import sys
sys.path.append("../naive_bayes/")
from kl_distance import KLDistanceEvaluator
INPUT = {
"word_threshold": 10,
"tag_threshold": 5,
"base_path": "../../data/stat/",
}
CLASSIFIER = {
"retrain_model": False,
"beta" : 0.5,
"train_count": 300000,
"sample_count": 50
}
| StackResys/Stack-Resys | src/evaluation/config.py | Python | bsd-3-clause | 304 |
import espressomd
import espressomd.checkpointing
import espressomd.electrostatics
import espressomd.virtual_sites
import espressomd.accumulators
import espressomd.observables
checkpoint = espressomd.checkpointing.Checkpointing(checkpoint_id="mycheckpoint", checkpoint_path="@CMAKE_CURRENT_BINARY_DIR@")
system = espre... | KonradBreitsprecher/espresso | testsuite/save_checkpoint.py | Python | gpl-3.0 | 1,491 |
#!/usr/bin/env python
import os
import re
import sys
import glob
import argparse
from copy import copy
from decimal import Decimal,InvalidOperation
number_pattern = re.compile("(-?\d+\.?\d*(e[\+|\-]?\d+)?)", re.IGNORECASE)
# Search an input value for a number
def findNumber(value):
try:
return Decimal(va... | scoky/pytools | data_tools/files.py | Python | mit | 8,781 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
# ######################################################################
#
# odoo-italia-bot: #odoo-it IRC BOT
#
# Copyright 2014 Francesco OpenCode Apruzzese <cescoap@gmail.com>
#
# This program is free software; you can redistribute it and/or modi... | OpenCode/odoo-italia-bot-irc | bot.py | Python | gpl-3.0 | 3,461 |
from NodeDefender.mqtt.message.respond.icpe import sys, zwave
def event(topic, payload):
if topic['node'] == '0':
zwave.event(topic, payload)
elif topic['node'] == 'sys':
sys.event(topic, payload)
| CTSNE/NodeDefender | NodeDefender/mqtt/message/respond/icpe/__init__.py | Python | mit | 222 |
__author__ = "Zhenzhou Wu"
__copyright__ = "Copyright 2012, Zhenzhou Wu"
__credits__ = ["Zhenzhou Wu"]
__license__ = "3-clause BSD"
__email__ = "hyciswu@gmail.com"
__maintainer__ = "Zhenzhou Wu"
"""
Functionality for preprocessing Datasets. With Preprocessor, GCN, Standardize adapted from pylearn2
"""
import sys
imp... | hycis/Pynet | pynet/datasets/preprocessor.py | Python | apache-2.0 | 12,105 |
#!/usr/bin/env python
"""
A proxy server which enables multiple interactive wiring sessions to interact
with the same SpiNNaker machine.
"""
import argparse
import logging
from spinner.scripts import arguments
from spinner.probe import WiringProbe
from spinner.proxy import ProxyServer, DEFAULT_PORT
from rig.mach... | SpiNNakerManchester/SpiNNer | spinner/scripts/proxy_server.py | Python | gpl-2.0 | 2,389 |
#! /usr/bin/python3
def main():
try:
while True:
line1 = input().strip().split(' ')
n = int(line1[0])
name_list = []
num_list = [0]
for i in range(1, len(line1)):
if i % 2 == 1:
name_list.append(line1[i... | zyoohv/zyoohv.github.io | code_repository/tencent_ad_contest/tencent_contest/model/main.py | Python | mit | 1,329 |
#!/usr/bin/env python
'''
'''
import unittest
from testRoot import RootClass
from noink.user_db import UserDB
from noink.role_db import RoleDB
from noink.activity_table import get_activity_dict
class AssignRole(RootClass):
def test_AssignRole(self):
user_db = UserDB()
role_db = RoleDB()
... | criswell/noink | src/tests/test_RevokeRole.py | Python | agpl-3.0 | 939 |
#!/usr/bin/env python
"""
Common utility functions
"""
import os
import re
import sys
import gzip
import bz2
import numpy
def init_gene_DE():
"""
Initializing the gene structure for DE
"""
gene_det = [('id', 'f8'),
('chr', 'S15'),
('chr_num', 'f8'),
... | ratschlab/oqtans_tools | mTIM/0.2/tools/helper.py | Python | mit | 6,635 |
from django.conf.urls import patterns, url
from ..core import TOKEN_PATTERN
from . import views
urlpatterns = patterns(
'',
url(r'^%s/$' % (TOKEN_PATTERN,), views.details, name='details'),
url(r'^%s/payment/(?P<variant>[-\w]+)/$' % (TOKEN_PATTERN,),
views.start_payment, name='payment'),
url(r... | hongquan/saleor | saleor/order/urls.py | Python | bsd-3-clause | 417 |
import yaml
import sys
from os import path
from pylaas_core.interface.core.service_interface import ServiceInterface
from pylaas_core.interface.technical.container_configurable_aware_interface import ContainerConfigurableAwareInterface
from pylaas_core.interface.technical.container_interface import ContainerInterface
... | Agi-dev/pylaas_core | pylaas_core/technical/container.py | Python | mit | 3,339 |
"""
You can use TeX to render all of your matplotlib text if the rc
parameter text.usetex is set. This works currently on the agg and ps
backends, and requires that you have tex and the other dependencies
described at http://matplotlib.org/users/usetex.html
properly installed on your system. The first time you run a ... | bundgus/python-playground | matplotlib-playground/examples/pylab_examples/tex_demo.py | Python | mit | 996 |
import numpy as np
from scipy.optimize import minimize
from scipy import optimize
# array operations
class OrthAE(object):
def __init__(self, views, latent_spaces, x = None, knob = 0):
# x: input, column-wise
# y: output, column-wise
# h: hidden layer
# views and late... | tengerye/orthogonal-denoising-autoencoder | python/orthAE.py | Python | apache-2.0 | 7,509 |
#!/usr/bin/env python
########################################
#Globale Karte fuer tests
# from Rabea Amther
########################################
# http://gfesuite.noaa.gov/developer/netCDFPythonInterface.html
import math
import numpy as np
import pylab as pl
import Scientific.IO.NetCDF as IO
import matplotlib as ... | CopyChat/Plotting | Downscaling/bias.TCC.GCMs.py | Python | gpl-3.0 | 4,182 |
def extractShurimtranslationWordpressCom(item):
'''
Parser for 'shurimtranslation.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
if '(manga)' in item['title'].lower():
return None
tag... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractShurimtranslationWordpressCom.py | Python | bsd-3-clause | 1,576 |
#!/usr/bin/env python
"""
This is the main function to call for disambiguating between a human and
mouse BAM files that have alignments from the same source of fastq files.
It is part of the explant RNA/DNA-Seq workflow where an informatics
approach is used to distinguish between human and mouse RNA/DNA reads.
For rea... | roryk/disambiguate | disambiguate.py | Python | mit | 15,496 |
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from django.utils.datetime_safe import date
from django.db.models import Q
from open_municipio.people.models import *
from open_municipio.votations.admin import VotationsInline
from open_municipio.acts.models import Speech
from op... | openpolis/open_municipio | open_municipio/people/admin.py | Python | agpl-3.0 | 10,689 |
# Generated by Django 3.1.1 on 2020-11-26 12:00
import uuid
import django.core.validators
import django.db.models.deletion
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, models
import grandchallenge.core.validators
class Migration(migrations.Migration):
in... | comic/comic-django | app/grandchallenge/workstation_configs/migrations/0001_squashed_0008_auto_20201001_0758.py | Python | apache-2.0 | 20,933 |
from django.conf.urls import patterns, url
import views
urlpatterns = patterns('',
url('^login/cancelled/$', views.login_cancelled,
name='socialaccount_login_cancelled'),
url('^login/error/$', views.login_error, name='socialaccount_login_error'),... | houssemFat/bloodOn | bloodon/accounts/social/urls.py | Python | mit | 643 |
"""
Django settings for odyseja project.
Generated by 'django-admin startproject' using Django 1.8.
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/
"""
# _*_ coding: u... | superdyzio/PWR-Stuff | AIR-ARR/Bazy Danych/odyseja/odyseja/settings.py | Python | mit | 2,937 |
# coding: utf-8
from sqlalchemy import Column, DateTime, ForeignKey, Integer, SmallInteger, String, text, Enum
from sqlalchemy.orm import relationship
from Houdini.Data import Base
metadata = Base.metadata
class RedemptionAward(Base):
__tablename__ = 'redemption_award'
CodeID = Column(ForeignKey(u'redemption... | TunnelBlanket/Houdini | Houdini/Data/Redemption.py | Python | mit | 1,567 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | kobejean/tensorflow | tensorflow/contrib/opt/python/training/matrix_functions.py | Python | apache-2.0 | 5,984 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-17 20:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('payment', '0013_payment_failed'),
]
operations = [
migrations.RemoveField(
... | katyaeka2710/python2017005 | payment/migrations/0014_auto_20161117_2011.py | Python | mit | 643 |
#!/usr/bin/env python3
from source.modules._generic_module import *
class Module(GenericModule):
def __init__(self):
self.authors = [
Author(name='Vitezslav Grygar', email='vitezslav.grygar@gmail.com', web='https://badsulog.blogspot.com'),
]
self.name = 'crypto.language... | lightfaith/locasploit | source/modules/crypto_language.py | Python | gpl-2.0 | 4,349 |
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
class DatosPyThemePlugin(plugins.SingletonPlugin):
'''An example theme plugin.
'''
# Declare that this class implements IConfigurer.
plugins.implements(plugins.IConfigurer)
def update_config(self, config):
# Add thi... | datospy/ckanext-datospy_theme | ckanext/datospy_theme/plugin.py | Python | mit | 700 |
__author__ = 'mcharbit'
import pickle
import os
import sys
import subprocess
import urllib2
import logging
from time import sleep, time
from datetime import date
auto_run_config_file_name = "auto_run_config.txt"
auto_run_config = os.path.join(os.path.dirname(sys.argv[0]), auto_run_config_file_name)
last_... | atadlate/movie_torrent_parser | torrent_parser/scripts/auto_run.py | Python | gpl-3.0 | 4,041 |
# -*- coding: utf-8 -*-
__doc__ = """
WebSocket within CherryPy is a tricky bit since CherryPy is
a threaded server which would choke quickly if each thread
of the server were kept attached to a long living connection
that WebSocket expects.
In order to work around this constraint, we take some advantage
of some inter... | xuhdev/WebSocket-for-Python | ws4py/server/cherrypyserver.py | Python | bsd-3-clause | 14,368 |
# -*- coding: utf-8 -*-
# Copyright © 2007-2013, All rights reserved. GoodData® Corporation, http://gooddata.com
__author__ = "miroslav.hedl@gooddata.com"
__maintainer__ = __author__
'''
Primary goal of this module is function `plugins_to_xml` that solves issue PCI-1385.
This module converts plugins dictionary from... | pbenas/smoker | smoker/client/out_junit/__init__.py | Python | bsd-3-clause | 4,926 |
#
# Evy - a concurrent networking library for Python
#
# Unless otherwise noted, the files in Evy are under the following MIT license:
#
# Copyright (c) 2012, Alvaro Saurin
# Copyright (c) 2008-2010, Eventlet Contributors (see AUTHORS)
# Copyright (c) 2007-2010, Linden Research, Inc.
# Copyright (c) 2005-2006, Bob Ippo... | inercia/evy | evy/patched/subprocess.py | Python | mit | 4,674 |
softwareName = 'PyBitmessage'
softwareVersion = '0.6.3.2'
| PeterSurda/PyBitmessage | src/version.py | Python | mit | 58 |
################################################################################
# Name: PyZenity.py
# Author: Brian Ramos
# Created: 10/17/2005
# Revision Information:
# $Date: $
# $Revision: $
# $Author: bramos $
#
# Licence: MIT Licence
#
# Copyright (c) 2010 Brian Ramos
# Permission is hereby g... | dleicht/PSB | PyZenity.py | Python | mit | 15,175 |
# -*- coding: utf-8 -*-
"""Run test to import camt.053 import."""
##############################################################################
#
# Copyright (C) 2015 Therp BV <http://therp.nl>.
#
# All other contributions are (C) by their respective contributors
#
# All Rights Reserved
#
# This program is... | acsone/bank-statement-import-camt | bank_statement_import_camt/tests/test_import_bank_statement.py | Python | agpl-3.0 | 2,725 |
import click
import os
import penguin.pdf as pdf
import penguin.utils as utils
def check_src(src):
if not all((map(utils.is_valid_source, src))):
raise click.BadParameter("src arguments must be either a valid directory"
" or pdf file.")
@click.group()
def penguin():
... | zrluety/penguin | penguin/scripts/penguin_cli.py | Python | mit | 1,738 |
# -*- coding: utf-8 -*-
"""
Script: GotoLineCol.py
Utility: 1. Moves the cursor position to the specified line and column for a file in Notepad++.
Especially useful for inspecting data files in fixed-width record formats.
2. Also, displays the character code (SBCS & LTR) in decimal... | bruderstein/PythonScript | scripts/Samples/GotoLineCol.py | Python | gpl-2.0 | 6,088 |
########################################################################
#
# File Name: NodeFilter.py
#
# Documentation: http://docs.4suite.com/4DOM/NodeFilter.py.html
#
"""
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved.
... | iCarto/siga | extScripting/scripts/jython/Lib/xml/dom/NodeFilter.py | Python | gpl-3.0 | 1,284 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it... | Comunitea/alimentacion | eln_product_samples/product_product.py | Python | agpl-3.0 | 2,066 |
##########################################################################
#
# Copyright (c) 2016, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | hradec/gaffer | python/GafferUI/_PlugAdder.py | Python | bsd-3-clause | 3,063 |
import pytest
from bluesky import Msg
from bluesky.plans import fly, count
from bluesky.run_engine import IllegalMessageSequence
from bluesky.tests import requires_ophyd
from ophyd import Component as Cpt, Device
from ophyd.sim import NullStatus, TrivialFlyer
@requires_ophyd
def test_flyer_with_collect_asset_documen... | ericdill/bluesky | bluesky/tests/test_flyer.py | Python | bsd-3-clause | 10,262 |
#!/usr/bin/env python
#
# texttable - module for creating simple ASCII tables
# Copyright (C) 2003-2011 Gerome Fournier <jef(at)foutaise.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundat... | bossiernesto/uLisp | texttable/texttable.py | Python | bsd-3-clause | 18,426 |
'''
Functions for comparing basis sets and pieces of basis sets
'''
import operator
from ..sort import sort_shell
def _reldiff(a, b):
"""
Computes the relative difference of two floating-point numbers
rel = abs(a-b)/min(abs(a), abs(b))
If a == 0 and b == 0, then 0.0 is returned
Otherwise if a o... | MOLSSI-BSE/basis_set_exchange | basis_set_exchange/curate/compare.py | Python | bsd-3-clause | 10,431 |
# Copyright (c) 2020 University of Chicago
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | ChameleonCloud/blazar | blazar/utils/openstack/zun.py | Python | apache-2.0 | 2,836 |
from collections import OrderedDict
from datetime import timedelta
from django import forms
from django.db.models import Q
from django.db.models.constants import LOOKUP_SEP
from django.forms.utils import pretty_name
from django.utils.itercompat import is_iterable
from django.utils.timezone import now
from django.utils... | alex/django-filter | django_filters/filters.py | Python | bsd-3-clause | 24,652 |
from django.contrib.auth.models import User
from django.conf import settings
from timestack import facebook
from timestack.models import *
class FacebookBackend:
supports_object_permissions = False
supports_anonymous_user = False
supports_inactive_user = False
def authenticate(self, token... | flashycud/timestack | timestack/backends.py | Python | mit | 1,755 |
from random import randrange
from time import sleep
class Game:
def __init__(self,cash=100):
self.p = Player(cash)
self.dealer = Dealer()
self.beginning = True
self.is_bj = False
def deal(self):
print "Cash:",self.p.cash
self.p.hit()
self.p.hit()
de... | jobini/blackjack | classes.py | Python | mit | 3,464 |
'''
-------------------------------------------------------------------------------
This function simply converts a file to UTF-8 from UTF-16. It's needed for
Solarwinds integration
-------------------------------------------------------------------------------
'''
def conv(filename):
"""Takes a file name string a... | admiralspark/NetSpark-Scripts | Example_Scripts/Utilities/convencoding.py | Python | gpl-3.0 | 665 |
# Python module for control of VELMEX stepper motor
from serial import Serial
import time
import sys
import re
def Clear(port):
""" Clear current program from VELMEX memory."""
port.write("C")
def Run(port):
""" Run current program in VELMEX memory."""
port.write("R");
def JogMode(port):
""" Put VELMEX control... | goett/MJDCalibrationPack | GLITCH/GLITCHv1.3.py | Python | mit | 6,053 |
############################################################################
# Joshua R. Boverhof, LBNL
# See Copyright for copyright notice!
# $Id: $
###########################################################################
import os, sys, types, inspect
from StringIO import StringIO
# twisted & related imports
fro... | rameshg87/pyremotevbox | pyremotevbox/ZSI/twisted/wsgi.py | Python | apache-2.0 | 9,882 |
# -*- coding: utf-8 -*-
from shoop.xtheme.layout import LayoutCell
from shoop.xtheme.views.forms import (
LayoutCellFormGroup, LayoutCellGeneralInfoForm
)
from shoop_tests.xtheme.utils import plugin_override
def test_pluginless_lcfg():
with plugin_override():
cell = LayoutCell(None)
assert not... | taedori81/shoop | shoop_tests/xtheme/test_editor_forms.py | Python | agpl-3.0 | 1,697 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# vim: foldlevel=0
# Copyright (C) 2016, Art SoftWare
#
# 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 ... | Art-SoftWare/discordBot | bot.py | Python | gpl-3.0 | 4,234 |
# Copyright 2014 Rackspace, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | supermari0/ironic | ironic/dhcp/none.py | Python | apache-2.0 | 1,015 |
import random
from django.conf import settings
def inject_settings(request):
return {
'DEBUG': settings.DEBUG,
'MIN_DONATION': settings.MIN_DONATION
}
info_tips = (
# RECAP
'<a href="http://www.recapthelaw.org" target="_blank">RECAP</a> is our browser extension that saves you money w... | shashi792/courtlistener | alert/lib/context_processors.py | Python | agpl-3.0 | 4,085 |
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
#############################################################################
#
# Copyright (c) 2007 Martin Reisenhofer <martin.reisenhofer@funkring.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | funkring/fdoo | addons-funkring/commission_sale/commission.py | Python | agpl-3.0 | 11,057 |
import sys
import getopt
import random
import numpy as np
import utils as utils
import scipy.stats as stats
def expectation(K, means, points, stddev):
points_size = len(points)
expectations = np.zeros((points_size, K))
for i in range(points_size):
total = 0
current_point = points[i]
... | anamariad/ML | Clusterization/clusterization/em1d.py | Python | apache-2.0 | 4,140 |
__author__ = 'bromix'
from resources.lib import nightcrawler
from resources.lib import content
nightcrawler.run(content.Provider())
| azumimuo/family-xbmc-addon | plugin.audio.soundcloud/addon.py | Python | gpl-2.0 | 134 |
# package
from pulpy.tests.integration.base import IntegrationTestBase
from pulpy.tests.integration.base import _initTestingDB
from pulpy.tests.integration.basic import IntegrationBasicViews
from pulpy.tests.integration.auth import IntegrationAuthViews
from pulpy.tests.integration.note import IntegrationNoteViews
fro... | plastboks/Pulpy | pulpy/tests/integration/__init__.py | Python | mit | 385 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from werkzeug import urls
from odoo import _, api, models
from odoo.exceptions import ValidationError
from odoo.tools.float_utils import float_compare
from odoo.addons.payment_alipay.controllers.main import AlipayController
_... | jeremiahyan/odoo | addons/payment_alipay/models/payment_transaction.py | Python | gpl-3.0 | 7,132 |
# flake8: noqa
from __future__ import absolute_import
# This will make sure the celery app is always imported when
# Django starts so that tasks can use this celery app.
# Without this Django wouldn't know which celery app to use.
# See http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html
from .... | aksh1/wagtail-cookiecutter-foundation | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/__init__.py | Python | mit | 352 |
import sys,numpy,matplotlib
import matplotlib.pyplot, scipy.stats
import library
def colorDefiner(epoch):
if epoch == '0':
theColor='blue'
elif epoch == '0.5':
theColor='red'
elif epoch == '1':
theColor='green'
elif epoch == '1.5':
theColor='orange'
else:
pr... | adelomana/viridis | growthAnalysis/epochGrapher.py | Python | gpl-2.0 | 2,642 |
from .base import YarhBase
class DTD(YarhBase):
def __init__(self, content, **kwargs):
super().__init__(None)
self.content = content
def html(self):
return "<!DOCTYPE %s>\n" % self.content
def yarh(self):
for k, v in doctypes.items():
if self.content == v.con... | minacle/yarh | yarh/dtd.py | Python | bsd-2-clause | 1,012 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.