code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
from flask import Flask, request, session, g, redirect, url_for, abort, \ render_template, flash from flask_sqlalchemy import SQLAlchemy from datetime import datetime from flask_login import LoginManager, current_user, login_required app = Flask(__name__) app.config.from_object(__name__) # load config from this...
peterprokop/PimpBoard
pimp_board/pimp_board.py
Python
mit
3,272
__author__ = 'alexenko' from django.contrib import admin from .models import Poll admin.site.register(Poll)
alexenko/tdd_django_tut
tdd_polling/polls/admin.py
Python
mit
108
class RobotSuicide: def act(self, game): return ['suicide'] class RobotGuard: def act(self, game): return ['guard'] class RobotMoveRight: def act(self, game): return ['move', (self.location[0] + 1, self.location[1])] class RobotMoveLeft: def act(self, game): return ...
boztalay/RobotGameRobots
rgkit/test/bots.py
Python
mit
1,453
""" fizzbuzz.py Author: Daniel Wilson Credit: Morgan M Assignment: Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”. We will use a...
danielwilson2017/fizzbuzz
fizzbuzz.py
Python
mit
1,214
from app import setup_app app = setup_app() if __name__ == "__main__": """Run the application""" app.run(host=app.config.get("HOST"), port=app.config.get("PORT"))
RobertoPrevato/flask-three-template
server.py
Python
mit
172
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.MainPage.as_view(), name='index'), url(r'^GlobalMap/$', views.GlobalMap.as_view(), name='GlobalMap'), url(r'^(?P<ses_id>[a-zA-Z0-9]+)/$', views.SessionPage.as_view(), name='Session')...
alberand/tserver
src/gui/tserver-web/urls.py
Python
mit
762
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import logging import math import itertools import warnings from collections import OrderedDict import numpy as np from monty.json import jsanitize from pymatgen.core.periodic_table import Element from pymat...
montoyjh/pymatgen
pymatgen/electronic_structure/plotter.py
Python
mit
183,052
from collections import Counter N, M = map(int, input().split()) c = Counter(map(int, input().split())) a = c.most_common()[0] if a[1] > N / 2: print(a[0]) else: print('?')
knuu/competitive-programming
atcoder/corp/codefes2015qb_b.py
Python
mit
181
class Player: # add new player def __init__(self,name,color,cur_balance,cur_position): self.name = name self.color = color.upper() self.cur_balance = cur_balance self.cur_position = cur_position self.next_position = cur_position self.property_owned = ...
idnaninitesh/monopoly_python
test.py
Python
mit
664
import matplotlib.pyplot as plt import numpy as np from models.SimpleRecurrent import SimpleRecurrentModel from keras.callbacks import ModelCheckpoint def set_params(nturns = 3, input_wait = 3, quiet_gap = 4, stim_dur = 3, var_delay_length = 0, stim_noise = 0, rec_noise = .1, ...
ABAtanasov/KerasCog
tasks/FlipFlop_ID.py
Python
mit
4,235
from shipping import Address from shipping import Package from ups import PACKAGES import logging logging.basicConfig(level=logging.ERROR) from shipping import setLoggingLevel setLoggingLevel(logging.ERROR) logging.getLogger('%s.ups' % __name__).setLevel(logging.DEBUG) white_house = Address('Mr. President', '1600 Pen...
benweatherman/python-ship
test_tshroyer.py
Python
mit
1,159
class IDLError(Exception): def __init__(self, name, baseMessage, module=None, line=None): message = '%s error' % name if module: message += ' in module %r' % module.name if module.filePath: message += ' (File %r )' % mod...
spiricn/libIDL
idl/IDLError.py
Python
mit
1,097
from unittest import mock from asynqp import spec from asynqp import frames from asynqp import protocol from asynqp.exceptions import ConnectionLostError from .base_contexts import ProtocolContext, MockLoopContext class WhenStartingTheHeartbeat(ProtocolContext, MockLoopContext): def when_I_start_the_heartbeat(sel...
socketpair/asynqp
test/heartbeat_tests.py
Python
mit
3,321
#!/usr/bin/env python from cogent.struct.rna2d import ViennaStructure,wuss_to_vienna from cogent.util.transform import make_trans __author__ = "Shandy Wikman" __copyright__ = "Copyright 2007-2012, The Cogent Project" __contributors__ = ["Shandy Wikman"] __license__ = "GPL" __version__ = "1.5.3" __maintainer__ = "Sh...
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/cogent/parse/consan.py
Python
mit
1,807
# -*- coding: utf-8 -*- """ Facilities to help get Python entities and (code, document) pairs from installed labraries. """ __all__ = ['data'] from .data import *
jmzhao/smart-comment
src/data/__init__.py
Python
mit
165
# -*- coding: utf-8 -*- # # provy documentation build configuration file, created by # sphinx-quickstart on Sun Jan 20 04:54:01 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
python-provy/provy
docs/source/conf.py
Python
mit
8,100
from __future__ import unicode_literals from mock import patch, Mock, MagicMock from nose.tools import eq_ from boto.dynamodb.exceptions import DynamoDBKeyNotFoundError from tests import TestCase from catsnap.document.tag import Tag from catsnap import HASH_KEY class TestAddingFile(TestCase): def test_sends_to_d...
ErinCall/catsnap
tests/document/test_tag.py
Python
mit
2,379
from adashi import * from ccrm import * from eden import * from ftp import * from mcb import * from wrike import *
anurag-ks/eden
modules/s3/sync_adapter/__init__.py
Python
mit
115
from sklearn.metrics import roc_curve, roc_auc_score, precision_recall_curve, average_precision_score import numpy as np import matplotlib.pyplot as plt #fixed recall values rec_values = [0.8, 0.9, 0.95, 0.99] # precision at 10 or P@10 measures classification performance, # being the fraction of the top 10 scored...
helgako/cms-dqm
notebooks/evaluation.py
Python
mit
2,680
# tests.api_tests.sources_tests # Test the sources endpoint of the API. # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Sun Apr 12 14:04:12 2015 -0400 # # Copyright (C) 2015 University of Maryland # For license information, see LICENSE.txt # # ID: sources_tests.py [] benjamin@bengfort.com $ """ Tes...
bbengfort/jobs-report
tests/api_tests/sources_tests.py
Python
mit
6,699
VERSION = (1, 0, 0) VERSION_NAME = '1.0.0'
Govexec/django-odd-utilities
odd_utilities/__init__.py
Python
mit
42
from itertools import combinations, chain from collections import defaultdict f = open("input.txt") d = f.readlines() boss_dict = {} for l in d: s = l.split(":") if ("Hit" in s[0]): boss_dict["HP"] = int(s[1]) else: boss_dict[s[0]] = int(s[1]) shop_txt = """Weapons: Cost Damage Armor D...
pwicks86/adventofcode2015
day21/p2.py
Python
mit
2,151
""" WSGI config for lab_website 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.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_S...
ustc-mcc/lab_website
lab_website/wsgi.py
Python
mit
399
# vim: ts=4:sw=4:expandtabs __author__ = 'zach.mott@gmail.com' from About import About from Assignment import Assignment from AssignmentList import AssignmentList from Index import Index from NavLocationMixin import NavLocationMixin from Question import Question from Results import Results
E7ernal/quizwhiz
quizard/views/__init__.py
Python
mit
293
import subprocess #define cmds to run here MESSAGES= "tail /var/log/messages" SPACE = "df -h" #places cmds into a list cmds = [MESSAGES, SPACE] #iterates over list, running statements for each item in the list count = 0 for cmd in cmds: count+=1 print "Running Command Number %s" % count subprocess.call(cm...
frankcash/Misc
Python/sequenceOfBash.py
Python
mit
335
# -*- coding: utf-8 -*- """ This module is provide methods for searching item in a sorted list. Highlight: - :func:`find_last_true`: A magic pluggable method, read API reference for more info. - :func:`find_nearest`: Find the nearest item of x from sorted array. **中文文档** 下面是一些讨论: 原生的 ``bisect.bisect_left`` 和 ``...
MacHu-GWU/single_file_module-project
sfm/binarysearch.py
Python
mit
7,306
from unittest import TestCase, skip from configparser import ConfigParser import os import ticketpy from ticketpy.client import ApiException from math import radians, cos, sin, asin, sqrt def haversine(latlon1, latlon2): """ Calculate the great circle distance between two points on the earth (specified i...
arcward/ticketpy
ticketpy/tests/test_ticketpy.py
Python
mit
12,027
from ctypes import c_char_p import jieba from jieba.analyse import extract_tags import warnings warnings.filterwarnings(action='ignore', category=UserWarning, module='gensim') import gensim from gensim.models import word2vec import codecs import time import pandas as pd import numpy as np from wordcloud import WordClou...
jarvisqi/nlp_learn
gensim/gensim_jb.py
Python
mit
4,028
#!/usr/bin/python class Employee: 'Common base class for all employees' empCount = 0 def __init__(self, name, salary, age, className): self.name = name self.salary = salary self.age = age self.className = className Employee.empCount += 1 def displayCount(self): ...
CodyKelly-UCD/CSCI-2312
kellyHW6.py
Python
mit
855
""" The reader for Gaussian input files =================================== A primitive reader for Gaussian ``.gjf`` input files is defined here. Note that basically it just read the atomic coordinate and the connectivity if possible. And the atomic coordinate has to be in Cartesian format. """ import itertools imp...
tschijnmo/ccpoviz
ccpoviz/gjfreader.py
Python
mit
3,826
#!/usr/bin/env python3 import sys sys.path.append('/home/fedor/code/amm_code/numerical-analysis') from math import exp from typing import Callable, List from utils.draw import draw from utils.utils import create_xs def runge_kutta( f: Callable[[float, float], float], y: float, a: float = ...
FeodorM/amm_code
numerical-analysis/task2/main.py
Python
mit
3,665
from correlcalc import * bins = np.arange(0.002,0.062,0.002) #corrdr12flcdmls=tpcf('/usr3/vstr/yrohin/Downloads/galaxy_DR12v5_CMASS_North.fits',bins,randfile='/usr3/vstr/yrohin/randcat_dr12cmn_2x_pdf10k.dat',estimator='ls',cosmology='lcdm',weights='eq') print("--------------------------------------------") corrdr12flcl...
rohinkumar/correlcalc
clusterresults/rundr12xpdf10k.py
Python
mit
1,503
#!/usr/bin/env python import datetime import os import requests import signal import socket import time import yaml from subprocess import Popen from time import gmtime, strftime from perf import Performance class Manager(): def __init__(self): signal.signal(signal.SIGINT, self.terminate) self.r...
giovannivenancio/nfv-consensus
src/vnf-manager/vnf-manager.py
Python
mit
5,568
#!/usr/bin/python # -*- coding:utf-8 -*- """wechat URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r...
francisar/wechat
wechat/urls.py
Python
mit
860
# Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html from scrapy.item import Item, Field import datetime import time class BaseItem(Item): def __setitem__(self, key, value): if isinstance(value, basestring): value = valu...
iynaix/manga-downloader-flask
manga/items.py
Python
mit
938
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2018-12-15 14:20 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('library', '0018_auto_20180...
WarwickAnimeSoc/aniMango
library/migrations/0019_auto_20181215_1420.py
Python
mit
576
# Handlers import os import subprocess from time import sleep from subprocess import check_output,check_call from app import app,url_for import alsaaudio dbf_fmt = '%artist%;%title%;%album%;%year%' # Backend defs def pa_info(): ret = {} out = check_output(['pactl', 'info'], stderr = subprocess.STD...
ameiji/deadbeef-control
app/handlers.py
Python
mit
3,633
from collections import namedtuple import datetime import json from django.conf import settings from django.contrib.auth.models import User from django.core import mail from django.utils import six from django.core.urlresolvers import reverse from django.test import TestCase, Client from django.utils.timezone import n...
mauricioabreu/speakerfight
deck/tests/test_functional.py
Python
mit
53,336
"""autogenerated by genpy from wii_nunchuck/nunchuck.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct class nunchuck(genpy.Message): _md5sum = "ecf0e6fe033d1fb642fae3cb7ae41c86" _type = "wii_nunchuck/nunchuck" _has_header = False #flag to mark t...
eokeeffe/ros-arduino-gameshield
src/wii_nunchuck/msg/_nunchuck.py
Python
mit
4,048
import unittest from app.circunferencia import circunferencia class CircunferenciaTestCase(unittest.TestCase): def setUp(self): self.circunferencia = circunferencia(5) def test_calcular_area(self): self.assertEquals(self.circunferencia.calcular_area(),78.54, "Radio incorrecto") def test_c...
slenhern8/programacion_3
clase6/test/circunferencia_test.py
Python
mit
524
import os import flask import pytest from flask import escape, url_for from app import app as sc_app try: # pragma: no cover from urllib.parse import urlparse # pragma: no cover except ImportError: # pragma: no cover from urlparse import urlparse # pragma: no cover def test_homepage_status_code(client)...
DanielAndreasen/SWEETer-Cat
sweetercat/tests/test_app.py
Python
mit
9,617
twitter = "@alisonjo2786" print twitter[0] address = "123 Some Street Somewhere NY 13555" print address print address[-5:] phone = "315-555-5555" print "Call {0} for great pizza".format(phone[4:]) greeting = "Hello {0}" print greeting.format("Alison") print "Area code: {0}".format("131") email = "...
codelikeagirlcny/python-lessons-cny
code-exercises-etc/section_02_(strings)/z.ajm.strings-everything.20181222.py
Python
mit
1,127
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import csv from io import StringIO from itertools import count import sys try: # Python 2 from itertools import izip_longest except ImportError: # Python 3 from itertools import zip_longest as izip_longest def csvpp(csv_input): max_widths = [] ma...
jlubcke/csvpp
csvpp/csvpp.py
Python
mit
1,221
# ---------------------------------------------------------------------- # Copyright (c) 2014 Rafael Gonzalez. # # See the LICENSE file for details # ---------------------------------------------------------------------- #-------------------- # System wide imports # ------------------- from __future__ import division...
astrorafael/tessflux
tessflux/utils.py
Python
mit
2,684
""" WSGI config for conferam project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION``...
dvcolgan/ludumdare27
wsgi.py
Python
mit
1,425
class Solution(object): def binary_search(self, nums, target): if len(nums) == 0: return False # mid = round(len(nums) / 2) mid = len(nums) // 2 if target == nums[mid]: return True if target > nums[mid]: return self.binary_search(nums[mid+1:], target) if target < nums[mid]: return self.binary...
rush2catch/algorithms-leetcode
Searching/BinarySearch_recursion_with_bugs.py
Python
mit
617
""" Django settings for playlistdc project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import os import dj_database_url from decouple import config BASE_DI...
CorneliusIV/playlistdc
playlistdc/settings.py
Python
mit
3,770
""" This is to store the gadgets that have been found. TODO: Automate it using ropeme """ mov_edx_eax = '' pop_ecx_pop_ebx = '' add_eax_b = '' pop_ecx_pop_eax = '' mov_eax_ecx = '' pop_ebx_ret = '' xor_eax_eax = '' pop_ecx_pop_edx = '' mov_pedx_eax_mov_eax_edx = '' mov_edx_eax_mov_eax_edx = '' mov_ebx_edx = '' xor_ed...
torcellite/Stack-Smashing
src/rop/gadgets.py
Python
mit
5,628
# -*- coding:utf-8 -*- import os import sys from PyQt4.QtCore import (QFile, QString, QVariant, Qt) from PyQt4.QtCore import pyqtSignal as Signal from PyQt4.QtGui import (QApplication, QDialog, QDialogButtonBox, QMenu, QMessageBox, QTableView, QVBoxLayout) from PyQt4.QtSql import (QSqlDatabase, QSqlQuery, QSqlT...
janusnic/21v-python
unit_16/staff5/main2.py
Python
mit
5,549
def pre_build(shutit, virt_method='virtualbox'): if virt_method == 'virtualbox': if not shutit.command_available('VBoxManage'): if shutit.get_current_shutit_pexpect_session_environment().install_type == 'apt': shutit.send('echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -s -c) contrib...
ianmiell/shutit
shutit_session_setup/virtualization.py
Python
mit
894
from animal import Animal class Pet(Animal): def __init__(self, name, species, age=0): Animal.__init__(self, species, age) self._name = name def get_name(self): return self._name @staticmethod def lower(s): return s.lower() def __str__(self): return '%s %...
laffra/auger
sample/pet.py
Python
mit
635
# -*- coding: utf-8 -*- import asyncio import os import sys root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt.async as ccxt # noqa: E402 async def test(exchange): print(await exchange.fetch_balance()) kraken = ccxt.kraken({ ...
tritoanst/ccxt
examples/py/async-balances.py
Python
mit
992
import pulp import itertools as it import numpy as np import datetime from conference_scheduler.resources import Shape # According to David MacIver, using this function is more efficient than # using sum() or plain addition # This code is taken from his gist at: # https://gist.github.com/DRMacIver/4b6561c8e4776597bf7...
PyconUK/ConferenceScheduler
src/conference_scheduler/lp_problem/utils.py
Python
mit
4,111
import time import json import urllib import requests from zencore.utils.encoding import SimpleApplicationAuth from zencore.utils.encoding import DummyApplicationAuth from zencore.utils.types import smart_force_to_string from zencore import errors class ProxyServer(object): def __init__(self, api, app_key=None,...
zencore-dobetter/zencore-utils
src/zencore/utils/jsonrpc.py
Python
mit
1,406
import subprocess import click from codebuilder.helpers.docker import DockerHelper @click.group() @click.option('--image-name', help='Default: ${DOCKER_REGISTRY}/${IMAGE_NAME}') @click.option('--artifact-name', help='CodePipeline artifact name. Default: First artifact') @click.pass_context def docker(ctx, image_name...
wnkz/codebuilder
codebuilder/subcommands/docker.py
Python
mit
2,563
import json from sklearn.externals import joblib # load the training data with open ('data.json') as input: raw_data = json.load(input) texts = [] labels = [] count = 1 for entry in raw_data: texts.append(entry['summary']) labels.append(entry['policy_area']) print 'processing entey #' + str(count) count +=1 jo...
YangLiu928/NDP_Projects
Python_Projects/NLP/policy area prediction/transform_json_into_pickle.py
Python
mit
397
import logging.config LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'standard': { 'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s', }, }, 'handlers': { 'default': { 'level': 'INFO', ...
igor-kondratiev/spyfall-dealer-bot
settings/logging_configuration.py
Python
mit
629
import html5lib from .utils import is_string from .match import node_matches_bone __all__ = ['find', 'find_all', 'find_iter'] def find(skeleton, document): """ Return the first element that matches given skeleton in the document. """ return next(find_iter(skeleton, document), None) def find_all(s...
despawnerer/ankle
ankle/find.py
Python
mit
1,460
#!/usr/local/bin/python import basics import config import mbdata import models import useful def create_section(pif, attribute_type): def prep_mod(mod): mod = pif.dbh.modify_man_item(mod) mod['img'] = '/'.join(pif.render.find_image_file( mod['attribute_picture.mod_id'] + '-' + mod['a...
ddierschow/bamca
bin/others.py
Python
mit
11,692
from setuptools import setup, find_packages setup(name='BIOMD0000000116', version=20140916, description='BIOMD0000000116 from BioModels', url='http://www.ebi.ac.uk/biomodels-main/BIOMD0000000116', maintainer='Stanley Gu', maintainer_url='stanleygu@gmail.com', packages=find_packages(...
biomodels/BIOMD0000000116
setup.py
Python
cc0-1.0
377
import pygame #-------------------------- # Minecraft 2D -- Variables #-------------------------- #the maximum number of each resource that can be held #---------------------------------------------------- MAXTILES = 20 #the title bar text/image #------------------------ pygame.display.set_capti...
arve0/example_lessons
src/python/lessons/Minecraft2D/Project Resources/variables.py
Python
cc0-1.0
2,223
BROKER_TRANSPORT_OPTIONS = {'confirm_publish': True}
chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend
celeryconfig.py
Python
cc0-1.0
52
import OOMP newPart = OOMP.oompItem(8805) newPart.addTag("oompType", "CAPC") newPart.addTag("oompSize", "0402") newPart.addTag("oompColor", "X") newPart.addTag("oompDesc", "PF22") newPart.addTag("oompIndex", "V50") OOMP.parts.append(newPart)
oomlout/oomlout-OOMP
old/OOMPpart_CAPC_0402_X_PF22_V50.py
Python
cc0-1.0
244
import os path = os.path.dirname(os.path.realpath(__file__)) sbmlFilePath = os.path.join(path, 'BIOMD0000000441.xml') with open(sbmlFilePath,'r') as f: sbmlString = f.read() def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: ret...
biomodels/BIOMD0000000441
BIOMD0000000441/model.py
Python
cc0-1.0
427
#!/usr/bin/env python # -*- coding: utf-8 -*- '''flexicomps Copyright (C) 2008-2010 Geoffrey Biggs RT-Synthesis Research Group Intelligent Systems Research Institute, National Institute of Advanced Industrial Science and Technology (AIST), Japan All rights reserved. Licensed under the Eclipse ...
gbiggs/flexicomps
flexiselect/flexiselect.py
Python
epl-1.0
6,187
import sys sys.path.append( "../" ) from engine import MoviePlayer import time import pygame class VCallback: overlay = None def __init__(self, size=0): pygame.init() pygame.display.set_mode( size, 0 ) self.overlay = pygame.Overlay( pygame.YV12_OVERLAY, size ) def onVideo...
ilathid/ilathidEngine
vplayer/movie_testP.py
Python
epl-1.0
1,321
import yaml import os #import pdb filename = "/etc/rc.local" try: with open("data/startcommands.yaml", 'r') as stream: cmmds = yaml.load(stream) cmds = cmmds['cmd'] for cmd in cmds: with open(filename, 'a+') as stream1: cmd = cmd+'\n' if cmd not in stream1.readlin...
basfom/EcoLab
sys/startupcmds.py
Python
gpl-2.0
458
''' Comms Bandwidth Model ''' import os, datetime, shutil from os.path import join as pJoin import networkx as nx from omf import comms from omf.models import __neoMetaModel__ from omf.models.__neoMetaModel__ import * # Model metadata: tooltip = "Calculate the bandwidth requirements for a communications system on a ...
dpinney/omf
omf/models/commsBandwidth.py
Python
gpl-2.0
4,260
class obsdict(dict): """ Extend built-in ``dict`` to implement the observer pattern. Observers can implement the callbacks ``mapping_set`` and ``mapping_deleted`` to be notified of the corresponding events. Example:: >>> class Logger(object): ... @staticmethod ... ...
ltucker/melk.util
melk/util/obsdict.py
Python
gpl-2.0
3,709
# This file is part of pybliographer # # Original author of Ovid reader: Travis Oliphant <Oliphant.Travis@mayo.edu> # # Copyright (C) 1998-2004 Frederic GOBRY # Email : gobry@pybliographer.org # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public ...
zkota/pyblio-1.3
Legacy/Format/Ovid.py
Python
gpl-2.0
2,322
#! /usr/bin/python # # Copyright (c) 2006 by Aurelien Foret <orelien@chez.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any ...
frugalware/pacman-g2
pactest/pmfile.py
Python
gpl-2.0
1,665
# # Copyright (c) 2008--2017 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...
renner/spacewalk
client/tools/rhnpush/uploadLib.py
Python
gpl-2.0
26,741
# (c) 2007 Chris AtLee <chris@atlee.ca> # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php """ PAM module for python Provides an authenticate function that will allow the caller to authenticate a user against the Pluggable Authentication Modules (PAM) on the system. Implemented usi...
kadamski/func
funcweb/funcweb/identity/pam.py
Python
gpl-2.0
3,810
import re import os def _add_rst_manual_dependencies(ctx): manpage_sources_basenames = """ options.rst ao.rst vo.rst af.rst vf.rst encode.rst input.rst osc.rst lua.rst ipc.rst changes.rst""".split() manpage_sources = ['DOCS/man/'+x for x in manpage_sources_basenames] for manpage_source in...
torque/mpv
wscript_build.py
Python
gpl-2.0
25,949
# -*- coding:utf-8 -*- from django.conf.urls import patterns, url # UserListView, # UserCreateView, # UserUpdateView, # UserDeleteView, # UserChangePasswordView, # GenerateRandomPasswordView #) urlpatterns = patterns( '', """ url(r'^personal_mail/$', PersonalMailCreateView.as_vi...
Rondineli/django-sso
django_sso/accounts/urls.py
Python
gpl-2.0
800
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016, 2017 CERN. # # Invenio 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...
omelkonian/cds
cds/modules/fixtures/video_utils.py
Python
gpl-2.0
1,766
# -*- coding: utf-8 -*- # # Pulp Deb documentation build configuration file, created by # sphinx-quickstart on Wed May 21 09:44:51 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
rbarlow/pulp_deb
docs/conf.py
Python
gpl-2.0
8,794
#-*- coding:utf-8 -*- from .BaseType import * from .Plutos import * class MSGType: LOGINAPP = 1 << 12 class MSGID: #服务器发给客户端的包 MSGID_CLIENT_LOGIN_RESP = 1 #//服务器发给客户端的账号登录结果 MSGID_CLIENT_NOTIFY_ATTACH_BASEAPP = 2 #//连接baseapp通知 MSGID_CLIENT_ENTI...
hookehu/utility
snifer/Core/Pluto.py
Python
gpl-2.0
7,386
#!/usr/bin/env python3 # encoding: utf-8 ############################################################################# # This file is part of Maui Installer. # # Copyright (C) 2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> # # Author(s): # Pier Luigi Fiorini # # $BEGIN_LICENSE:GPL2+$ # # This program is free ...
mauios/maui-installer
modules/postinstall/main.py
Python
gpl-2.0
1,287
#################################################################################### # # STEPS - STochastic Engine for Pathway Simulation # Copyright (C) 2007-2017 Okinawa Institute of Science and Technology, Japan. # Copyright (C) 2003-2006 University of Antwerp, Belgium. # # See the file AUTHORS for d...
CNS-OIST/STEPS_Example
python_scripts/API_2/surface_diffusion/surface_diffusion_tetode.py
Python
gpl-2.0
4,802
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import womoobox.models class Migration(migrations.Migration): dependencies = [ ('womoobox', '0002_moo'), ] operations = [ migrations.AlterField( model_name='apikey', ...
Meuh-Factory/womoobox
migrations/0003_auto_20141113_1752.py
Python
gpl-2.0
481
""" Inverted Pendulum model. DO NOT MODIFY Created by: Dr. Paul Leonard Modified by: Roberto La Spina TO DO: -Figure out what to do with encoder sensor reading -CHECK IF ACCELEROMTER IS POSITIVE UP OR DOWN and edit accelModel and CompFilter accordingly -Acceleromter cross-talk? -Add motor inductance ...
pauljohnleonard/pod-world
Segway/robot.py
Python
gpl-2.0
14,957
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Contact', fields=[ ('id', models.AutoField(prim...
ncongleton/njcongleton.com
contact/migrations/0001_initial.py
Python
gpl-2.0
717
# The place where the thermostat runs. # system imports import commands import copy import datetime import json import logging import threading import time import urllib import urllib2 import mosquitto import socket from collections import deque # local imports import settings def uptime(): ''' get this system'...
jeffeb3/YunThermostat
linux/thermostat/Thermostat.py
Python
gpl-2.0
18,248
from tastypie.resources import ModelResource from tastypie.constants import ALL from tastypie.utils import trailing_slash from .models import Person class PersonResource( ModelResource ): class Meta: queryset = Person.objects.all() resource_name = 'person' filtering = { "person...
tigeorgia/CorpSearch
apps/person/api.py
Python
gpl-2.0
442
# -*- coding: UTF-8 -*- # /* # * Copyright (C) 2017 BrozikCZ # * # * # * 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 your option) # * any later version. #...
brozikcz/script.android.addon.installer
default.py
Python
gpl-2.0
2,394
# Copyright (c) 2017 Charles University in Prague, Faculty of Arts, # Institute of the Czech National Corpus # Copyright (c) 2017 Tomas Machalek <tomas.machalek@gmail.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License #...
tomachalek/kontext
lib/plugins/abstract/taghelper.py
Python
gpl-2.0
1,619
#!/usr/bin/python # -*- coding: utf-8 -*- import socket import urllib import urllib2 import cookielib import xbmcplugin import xbmcaddon import xbmcgui import json import sys import os import re addon = xbmcaddon.Addon() socket.setdefaulttimeout(60) pluginhandle = int(sys.argv[1]) addonID = addon.getAddonInfo('id') cj...
noba3/KoTos
addons/plugin.video.screen_yahoo_com/default.py
Python
gpl-2.0
20,315
import factory from datetime import datetime from edc.core.identifier.classes import SubjectIdentifier from edc.subject.registration.models import RegisteredSubject from ...models import Enrollment class EnrolledSubjectFactory(factory.DjangoModelFactory): FACTORY_FOR = Enrollment report_datetime = datetime....
botswana-harvard/bhp065_project
bhp065/apps/hnscc_subject/tests/factories/enrolled_subject_factory.py
Python
gpl-2.0
663
import os DEBUG = True DATADIR = os.path.join(os.path.dirname(__file__), ".data") LOGFILE = os.path.join(DATADIR, "log") CFGFILE = os.path.join(DATADIR, "config") TMPDIR = os.path.join(DATADIR, "tmp") ALBUM = 1 ARTIST = 2 # utility commands, used in emergency situations, with nearly zero dependencies def run(command...
camico/AmarokReader
conTEXT/common.py
Python
gpl-2.0
732
# # Softcam setup mod for openPLi # Coded by vlamo (c) 2012 # Version: 3.0-rc2 # Support: http://dream.altmaster.net/ # # Modified by Dima73 (c) 2012 # Support: Dima-73@inbox.lv # from . import _ from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.FileList import FileEntryCompon...
pli3/enigma2-plugins
PLi/SoftcamSetup/src/Sc.py
Python
gpl-2.0
18,959
# -*- 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...
azumimuo/family-xbmc-addon
plugin.video.showboxarize/resources/lib/sources/moviefree.py
Python
gpl-2.0
3,677
# ---------------------------------------------------------------------------- # # Sally BN: An Open-Source Framework for Bayesian Networks. # # ---------------------------------------------------------------------------- # GNU General Public License v2 # # This program is free software; you can redistribute it and/o...
dsaldana/sally-bn
lib_sallybn/disc_bayes_net/DiscreteBayesianNetworkExt.py
Python
gpl-2.0
11,564
# -*- mode: python -*- # -*- coding: iso8859-15 -*- ############################################################################## # # Gestion scolarite IUT # # Copyright (c) 2001 - 2011 Emmanuel Viennet. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the term...
denys-duchier/Scolar
sco_codes_parcours.py
Python
gpl-2.0
9,887
# Disk resizing dialog # # Copyright (C) 2012-2013 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 program is distributed...
sassoftware/anaconda
pyanaconda/ui/gui/spokes/lib/resize.py
Python
gpl-2.0
20,396
# -*- coding: utf-8 -*- """ Flixnet Add-on Copyright (C) 2016 Viper2k4 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) an...
azumimuo/family-xbmc-addon
plugin.video.showboxarize/resources/lib/sources_de/moviesever.py
Python
gpl-2.0
5,106
# coding: utf-8 from django.forms import Form, CharField, ChoiceField, EmailField from .models import Code class CodeCreationForm(Form): email = EmailField() semesters = ChoiceField(choices=Code.CHOICES) class CodeUseForm(Form): content = CharField(max_length=30, label=False) def is_valid(self): ...
SonicFrog/jdrpoly
members/forms.py
Python
gpl-2.0
538
## # Copyright 2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (http://w...
omula/easybuild-easyblocks
easybuild/easyblocks/generic/versionindependentpythonpackage.py
Python
gpl-2.0
3,853
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('kappahistory', '0008_auto_20150303_2155'), ] operations = [ migrations.CreateModel( name='Game', fie...
kappapolls/kappapolls
kappahistory/migrations/0009_auto_20150305_0040.py
Python
gpl-2.0
832
import wrtscrapper.items from scrapy_djangoitem import DjangoItem class WrtscrapperPipeline(object): def process_item(self, item, spider): if issubclass(type(item), DjangoItem): item.save() return item
rooterkyberian/wrtweb
wrtscrapper/pipelines.py
Python
gpl-2.0
236