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 django.conf import settings
from django import forms
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from captcha_registration.recaptcha.widgets import ReCaptcha
from captcha_registration.recaptcha.client import captcha
class ReCaptchaField(forms.CharField)... | lambdamusic/testproject | konproj/libs/captcha_registration/recaptcha/fields.py | Python | gpl-2.0 | 1,066 |
from enigma import ePicLoad, eTimer, getDesktop, gMainDC, eSize
from Screens.Screen import Screen
from Tools.Directories import resolveFilename, pathExists, SCOPE_MEDIA, SCOPE_CURRENT_SKIN
from Components.Pixmap import Pixmap, MovingPixmap
from Components.ActionMap import ActionMap, NumberActionMap
from Components.So... | kingvuplus/ops | lib/python/Plugins/Extensions/PicturePlayer/ui.py | Python | gpl-2.0 | 22,711 |
#!/usr/bin/env python
import sys
from pfsense_api import PfSenseAPI
from datetime import datetime
from pfsense_cmdline import PfSenseOptionParser
from ConfigParser import ConfigParser
from pfsense_logger import PfSenseLogger as logging
import os.path
parser = PfSenseOptionParser()
parser.add_option("--id", dest="c... | stanleyz/pfsense-2.x-tools | pfsense-updateCRL.py | Python | gpl-2.0 | 2,863 |
import ujson
from unittest import mock
from unittest.mock import MagicMock
from flask import url_for
from flask_login import login_required, AnonymousUserMixin
from requests.exceptions import HTTPError
from werkzeug.exceptions import BadRequest, InternalServerError, NotFound
from pika.exceptions import ConnectionClose... | Freso/listenbrainz-server | listenbrainz/webserver/views/test/test_index.py | Python | gpl-2.0 | 12,732 |
# -*- coding: utf-8 -*-
# daemon/runner.py
# Part of python-daemon, an implementation of PEP 3143.
#
# Copyright © 2009 Ben Finney <ben+python@benfinney.id.au>
# Copyright © 2007–2008 Robert Niederreiter, Jens Klein
# Copyright © 2003 Clark Evans
# Copyright © 2002 Noah Spurrier
# Copyright © 2001 Jürgen Hermann
#
# T... | elephantum/python-daemon | daemon/runner.py | Python | gpl-2.0 | 7,087 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 24 11:17:25 2014
@author: kshmirko
"""
import pandas as pds
import numpy as np
def seasons(x):
month = x.month
ret = None
if month in [12,1,2]:
ret = "Winter"
elif month in [3,4,5]:
ret = "Spring"
elif month in [... | kshmirko/sageII-stat | make-stat.py | Python | gpl-2.0 | 4,462 |
import glob
import os
from qgis.core import QgsApplication
from command import command, complete_with
from PyQt4.QtCore import QUrl
from PyQt4.QtGui import QDesktopServices
folder = os.path.join(QgsApplication.qgisSettingsDirPath(), "python",
"commandbar")
def packages(argname, data):
retu... | NathanW2/qgiscommand | package_commands.py | Python | gpl-2.0 | 1,552 |
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from tkinter import messagebox
from PDFManager.PDFMangerFacade import PDFMangerFacade
class PDFManager_UI:
def __init__(self):
self.i= -1;
self.files=[]
self.root = Tk()
self.root.title('PDFManager')
... | DevilSeven7/PDFManager | PDFManager/UI.py | Python | gpl-2.0 | 8,592 |
from django.test import TestCase
# No tests
| HughMcGrade/eusay | votes/tests.py | Python | gpl-2.0 | 45 |
from django.test import TestCase
from ..models import l_artist_release
class test_l_artist_release(TestCase):
def setUp(self):
"""
Set up the test subject.
"""
self.subject = l_artist_release()
def test__l_artist_release__instance(self):
self.assertIsInstance(self.subj... | marios-zindilis/musicbrainz-django-models | musicbrainz_django_models/tests/test_l_artist_release.py | Python | gpl-2.0 | 451 |
# -*- coding: utf-8 -*-
"""
Usage: (python) parse_full_xml_report.py <.xml files>
Example:
$ python parse_full_xml_report.py ncbi_full_report.xml
"""
import sys
WATSON_INDId = 30346
VENTER_INDId = 30342
THOUSAND_GENOME_popId = [13148, 13149, 13150, 16651, 16652, 16653, 16654, 16655];
def parse... | kl2532/csi_columbia | Assignment_4/parse_full_xml_report.py | Python | gpl-2.0 | 1,662 |
# -*- coding: UTF-8 -*-
# Pluma External Tools plugin
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.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 versi... | monsta/pluma | plugins/externaltools/tools/__init__.py | Python | gpl-2.0 | 10,313 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib.sitemaps import Sitemap
from . import models
class BlogSitemap(Sitemap):
changefreq = "daily"
priority = 0.5
def items(self):
return models.Post.objects.filter(is_draft=False)
def lastmod(self, obj):
return obj.update... | flyhigher139/mayblog | blog/main/sitemaps.py | Python | gpl-2.0 | 968 |
import urllib
from django.http import HttpResponseRedirect
from django.http.response import HttpResponseBadRequest, HttpResponse
from django.shortcuts import get_object_or_404, render
from django.core.urlresolvers import reverse
from rest_framework import viewsets
from csinterop.forms import InteropServiceForm
from csi... | cloudspaces/interop-protocol | csinterop/csinterop/views.py | Python | gpl-2.0 | 6,787 |
# Portions Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# __init__.py - Startup and module loading logic for Mercurial.
#
# Copyright 2015 Gregory Szorc <gregory.szorc@gmail.com>
#
# This software ma... | facebookexperimental/eden | eden/hg-server/edenscm/mercurial/__init__.py | Python | gpl-2.0 | 1,173 |
# This file is part of PooPyLab.
#
# PooPyLab is a simulation software for biological wastewater treatment processes using International Water Association
# Activated Sludge Models.
#
# Copyright (C) Kai Zhang
#
# PooPyLab is free software: you can redistribute it and/or modify it under the terms of the GNU Gener... | toogad/PooPyLab_Project | PooPyLab/ASMModel/asm_2d.py | Python | gpl-3.0 | 24,192 |
#!/usr/bin/env python
import sys
from utils.file_system import *
from calculations.beatmap_metadata import BeatmapMetadata
from database.database_wrapper import DatabaseWrapper
def hello(msg):
print("Hello world! " + msg)
def print_help():
print("Usage: ./beatmap_processor.py [songs_folder]")
print("This... | altur13/osu-Assistant | beatmap_processor.py | Python | gpl-3.0 | 1,817 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='MissingTeacherEntry',
fields=[
('id', models.Au... | AlexandreDecan/Dashbird | widgets/schoolwidget/migrations/0001_initial.py | Python | gpl-3.0 | 2,474 |
# -*- coding: utf-8 -*-
# -*- mode: python -*-
"""Sources of random data
Copyright (C) 2013 Dan Meliza <dmeliza@uchicago.edu>
Created Wed May 29 14:50:02 2013
"""
from mspikes import util
from mspikes.types import DataBlock, Source, Node, tag_set
from numpy.random import RandomState
class rand_samples(Source):
... | melizalab/mspikes | mspikes/modules/random_sources.py | Python | gpl-3.0 | 1,590 |
import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), "README.md")) as readme:
README = readme.read()
with open(os.path.join(os.path.dirname(__file__), "requirements.in")) as requirements:
REQUIREMENTS = [
req.split("#egg=")[1] if "#egg=" in req else req
for... | nim65s/django-cineclub | setup.py | Python | gpl-3.0 | 1,266 |
# Put libraries such as Divisi in the PYTHONPATH.
import sys, pickle, os
sys.path = ['/stuff/openmind'] + sys.path
from csc.divisi.cnet import *
from csc.divisi.graphics import output_svg
from vendor_db import iter_info
from csamoa.corpus.models import *
from csamoa.conceptnet.models import *
# Load the OMCS language ... | commonsense/divisi | doc/demo/vendor_only_svd.py | Python | gpl-3.0 | 1,871 |
#-*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url
from filer import settings as filer_settings
urlpatterns = patterns('filer.server.views',
url(r'^' + filer_settings.FILER_PRIVATEMEDIA_STORAGE.base_url.lstrip('/') + r'(?P<path>.*)/$',
'serve_protected_file',),
url(r'^' + filer... | hzlf/openbroadcast | website/__filer/server/urls.py | Python | gpl-3.0 | 449 |
import os
import subprocess
# This is an example for using Kataja to launch a visualisation from a python script that doesn't use kataja
# structures, but can output bracket trees. Kataja is launched as a separate process so it doesn't stop the
# main script.
def send_to_kataja(tree, image_file=''):
# return os... | jpurma/Kataja | kataja/runner.py | Python | gpl-3.0 | 1,380 |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2011, Max Leuthaeuser
License: GPL (see LICENSE.txt for details)
"""
__author__ = 'Max Leuthaeuser'
__license__ = 'GPL'
from CodeGeneration.AbstractMetaModel.AbstractMetaClass import MethodInvocationNotAllowedError
class Modifier:
'''
Simple enumeration of available ... | max-leuthaeuser/naoservice | CodeGeneration/AbstractMetaModel/Modifier.py | Python | gpl-3.0 | 719 |
#!/usr/bin/env python
#
###############################################################################
# Copyright (C) 2016-2018 Cortney T. Buffington, N0MJS <n0mjs@me.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publishe... | n0mjs710/DMRlink | ipsc/dmrlink_config.py | Python | gpl-3.0 | 11,481 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'LikedComment'
db.delete_table('forum_likedcomment')
# Deleting... | CLLKazan/iCQA | qa-engine/forum/migrations/0019_auto__del_likedcomment__del_comment__add_field_node_abs_parent__chg_fi.py | Python | gpl-3.0 | 27,368 |
# A file to contain exclusively dependencies of the NeuroML package.
# See:
# https://github.com/NeuralEnsemble/libNeuroML
# http://neuroml.org
from __future__ import print_function
from collections import defaultdict
try:
from neuroml import Cell, Segment, SegmentParent, Morphology, \
NeuroMLD... | dwitvliet/CATMAID | django/applications/catmaid/control/exportneuroml.py | Python | gpl-3.0 | 3,874 |
from vec2d import vec2d
from math import e, exp, pi, cos, sin, sqrt, atan2
class Goal:
def __init__(self, pos):
self.pos= pos
self.size = 8
self.theta = atan2(pos.y,pos.x)
class Landmark:
def __init__(self):
self.pos= vec2d(0,0)
self.size = 4
class Pipe:
... | degoldcode/PyNaviSim | objects.py | Python | gpl-3.0 | 424 |
from ase import Atom, Atoms
from gpaw import GPAW
from gpaw.test import equal
a = 4.05
d = a / 2**0.5
bulk = Atoms([Atom('Al', (0, 0, 0)),
Atom('Al', (0.5, 0.5, 0.5))], pbc=True)
bulk.set_cell((d, d, a), scale_atoms=True)
h = 0.25
calc = GPAW(mode='pw',
nbands=2*8,
kpts=(2, 2, 2),... | robwarm/gpaw-symm | gpaw/test/pw/davidson_pw.py | Python | gpl-3.0 | 1,034 |
from test_support import *
do_flow(opt=["--mode=flow"])
| ptroja/spark2014 | testsuite/gnatprove/tests/PC07-016__flow_write_object_to_ali/test.py | Python | gpl-3.0 | 56 |
####################################################################################################
#
# Patro - A Python library to make patterns for fashion design
# Copyright (C) 2017 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gene... | FabriceSalvaire/PyValentina | Patro/GeometryEngine/Rectangle.py | Python | gpl-3.0 | 3,505 |
#!/usr/bin/env python
# encoding: utf-8
"""
Waf tool for defining ardupilot's submodules, so that they are kept up to date.
Submodules can be considered dynamic sources, since they are updated during the
build. Furthermore, they can be used to generate other dynamic sources (mavlink
headers generation, for example). T... | aesaae/ardupilot_str | Tools/ardupilotwaf/git_submodule.py | Python | gpl-3.0 | 3,169 |
#!/usr/bin/env python
#coding:utf-8
##
# @file longestPalindrome.py
# @brief Find longest palindrome string
# @author unlessbamboo
# @version 1.0
# @date 2016-02-15
def secondHelper(str1, left, right):
"""secondHelper:Find a palindrome string from one point
:param str1:source string
:param left:
:... | unlessbamboo/grocery-shop | algorithm/search/stringHandlePy.py | Python | gpl-3.0 | 2,790 |
#!/usr/bin/env python
##################################################
# Parallel MLMC: Config class #
# #
# Jun Nie #
# Last modification: 19-09-2017 #
##########################################... | henrynj/PMLMC | v0.0/config.py | Python | gpl-3.0 | 2,156 |
""" Telewall. This application connects to asterisk and provides Statis-Apps.
It has a user interface using a button, display and led. It also provides
a web interface.
The Application should be run using python 2.7, because ARI (Asterisk REST Interface) does not support python 3.
"""
| synox/telewall | telewall/telewall/__init__.py | Python | gpl-3.0 | 290 |
# coding: utf-8
__author__ = "@strizhechenko"
import sys
from morpher import Morpher
from twitterbot_utils import Twibot
from apscheduler.schedulers.blocking import BlockingScheduler
sched = BlockingScheduler()
bot = Twibot()
morphy = Morpher()
def tweets2words(tweets):
string = " ".join([tweet.text for tweet ... | strizhechenko/twitterbots | memes_zaebali.py | Python | gpl-3.0 | 857 |
from sqlalchemy import Column, String, Integer
from BusTrack.repository import Base, session
from BusTrack.repository.models import STRING_LEN_SMALL
class UserType(Base):
__tablename__ = 'user_type'
id = Column(Integer, primary_key=True)
role_name = Column(String(STRING_LEN_SMALL))
@staticmethod
... | Rjtsahu/School-Bus-Tracking | BusTrack/repository/models/UserType.py | Python | gpl-3.0 | 743 |
# -*- coding: utf-8 -*-
# Copyright 2007-2011 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | pburdet/hyperspy | hyperspy/_signals/eels.py | Python | gpl-3.0 | 48,505 |
# coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Flood Vector Impact on
Buildings using QGIS.
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 So... | MariaSolovyeva/inasafe | safe/impact_functions/inundation/flood_vector_building_impact/impact_function.py | Python | gpl-3.0 | 10,048 |
from django.conf.urls import url
from .views import HomePage, PlayerList, PlayerDetail, SignUpForm
urlpatterns = [
url(r'^$', HomePage.as_view(),
name='home'),
url(r'^list$', PlayerList.as_view(),
name='player_list'),
url(r'signup/$', SignUpForm.as_view(),
na... | biddellns/litsl | players/urls.py | Python | gpl-3.0 | 437 |
# -*- coding: utf-8 -*-
from django import template
from CanteenWebsite.models import Category
from CanteenWebsite.utils.functions import setting_get
register = template.Library()
@register.simple_tag
def get_setting(name, default=None):
return setting_get(name, default)
@register.inclusion_tag('CanteenWebsit... | jinyu121/Canteen | CanteenWebsite/templatetags/canteen_website_tags.py | Python | gpl-3.0 | 1,773 |
import sys
import argparse
import time
sys.path.append('./bin/moabc')
import optimizer
#引数の処理
#parserの初期化
parser = argparse.ArgumentParser(description='This script optimizes bayesian network graph structure by MOABC')
#強化成功率表
parser.add_argument("infile_pt", type=str)
#一回の強化費用
parser.add_argument("-pg","--pricegri... | curiburn/pso2_grind_optimizer | py/main.py | Python | gpl-3.0 | 2,887 |
# coding: utf-8
# Copyright 2017 CERN. This software is distributed under the
# terms of the GNU General Public Licence version 3 (GPL Version 3),
# copied verbatim in the file LICENCE.md.
# In applying this licence, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergo... | blond-admin/BLonD | unittests/beams/test_beam_object.py | Python | gpl-3.0 | 14,105 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:set et sts=4 sw=4:
__all__ = (
"WeaselSession",
"WeaselService",
"service",
)
import logging
import logging.config
import os
import time
import threading
logfile = os.path.join(os.path.dirname(__file__), "logging.conf")
logging.config.fileConfig(logfil... | lotem/rime.py | weasel/weasel.py | Python | gpl-3.0 | 9,656 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'spellcheck.ui'
#
# Created: Thu Jul 30 01:27:24 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Att... | lucidlylogicole/scope | plugins/spellcheck/spellcheck_ui.py | Python | gpl-3.0 | 7,193 |
import pytest
from cli_config.tag import tag
from utility.nix_error import NixError
def test_tag_show_no_tag(capsys):
with pytest.raises(SystemExit) as _excinfo:
tag.tag("nixconfig", ["show"])
_out, _err = capsys.readouterr()
assert "2" in str(_excinfo.value), "Exception doesn't contain expecte... | mbiciunas/nix | test/cli_config/tag/test_tag_show.py | Python | gpl-3.0 | 1,291 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import os
import re
import sys
from io import BytesIO
from PIL import Image
from triptools import config, DB
from triptools.common import Trackpoint, tp_dist, distance, get_names
from triptools.exif_support import get_location
logging.basicConfig(level=lo... | Eierkopp/triparchive | triptools/photoimport.py | Python | gpl-3.0 | 1,597 |
# Environment configuration
# Copyright (c) 2016, Tieto Corporation
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
#
# Currently static definition, in the future this could be a config file,
# or even common database with host management.
#
import logging
logge... | s0lst1c3/eaphammer | local/hostapd-eaphammer/tests/remote/config.py | Python | gpl-3.0 | 3,543 |
#!/usr/bin/python
from pyliferisk import MortalityTable
from pyliferisk.mortalitytables import GKM95
import numpy as np
mt = MortalityTable(nt=GKM95)
x = 40 #age
n = 20 #horizon
C = 10000 #capital
i = 0.03 #interest rate
payments = []
for t in range(0,n):
payments.append((mt.lx[x+t] - mt.lx[x+t+1]) / mt.lx[x]... | franciscogarate/pyliferisk | Examples/Example_2_2_3b.py | Python | gpl-3.0 | 608 |
# -*- coding: utf-8 -*-
from openerp import models, fields, api
from datetime import datetime, timedelta, date
from dateutil.relativedelta import relativedelta
class Inspection(models.Model):
_name = 'property.inspection'
_order = 'date desc'
_inherit = ['mail.thread', 'ir.needaction_mixin']
propert... | ichi23de5/ichi_Repo | property/models/inspection.py | Python | gpl-3.0 | 2,328 |
import re
import sys
class SrtSection:
"""
This class is used to stock a section from a srt file (subtitle frames).
- self.beginning is the time (in seconds) where the subframe begins
- self.duration is the duration (in seconds) of the subframe
- self.content is the content of the s... | octarin/PySrt | PySrt.py | Python | gpl-3.0 | 3,556 |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import utool as ut
from os.path import join, basename, splitext, exists, dirname
# from utool import util_inject
# print, rrr, profile = util_inject.inject2(__file__)
@ut.reloadable_class
class SourceDir(ut.Nice... | Erotemic/local | misc/file_organizer.py | Python | gpl-3.0 | 15,764 |
#!/usr/bin/python
"""
An interface to the web-based PROvider Direct Access (PRODA) system
of Medicare Australia
"""
import mechanize # available via PIP
import re
m = mechanize.Browser()
m.open("https://proda.humanservices.gov.au/prodalogin/pages/public/login.jsf?TAM_OP=login&USER")
m.select_form(name="loginFormAn... | ihaywood3/easygp | db/proda.py | Python | gpl-3.0 | 882 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
**database_operations.py**
**Platform:**
Windows, Linux, Mac Os X.
**Description:**
Defines the :class:`DatabaseOperations` Component Interface class and others helper objects.
**Others:**
"""
from __future__ import unicode_literals
import os
from PyQt4.Q... | KelSolaar/sIBL_GUI | sibl_gui/components/addons/database_operations/database_operations.py | Python | gpl-3.0 | 19,077 |
from django.http import HttpResponseRedirect
from django.shortcuts import redirect
from django.urls import reverse_lazy, reverse
from django.views.generic import ListView, DetailView, FormView, CreateView, \
UpdateView
from django.views.generic.base import TemplateView, View
from django.contrib.auth.mixins import L... | Iliricon/hero-manager | src/hero/views.py | Python | gpl-3.0 | 7,791 |
# -*- coding: utf-8 -*-
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2015 Andrew Colin Kissa <andrew@topdog.za.net>
# vim: ai ts=4 sts=4 et sw=4
"status tasks"
import os
import datetime
import psutil
from StringIO import StringIO
from pylons import config
from celery.task import task
from sqlalc... | akissa/baruwa2 | baruwa/tasks/status.py | Python | gpl-3.0 | 13,729 |
#!/usr/bin/env python
import json
import argparse
from webapollo import WAAuth, WebApolloInstance, AssertUser, accessible_organisms
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="List all organisms available in an Apollo instance"
)
WAAuth(parser)
parser.add_argument(... | TAMU-CPT/galaxy-tools | tools/webapollo/list_organism_data.py | Python | gpl-3.0 | 951 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from gobspy import main
main()
| arypbatista/gobspy | gobspy.py | Python | gpl-3.0 | 75 |
import numpy as np
import pandas as pd
# from matplotlib.pyplot import plot,show,draw
import scipy.io
from functions import *
from pylab import *
from sklearn.decomposition import PCA
import _pickle as cPickle
import time
import os, sys
import ipyparallel
import matplotlib.cm as cm
from scipy.optimize import curve_fi... | gviejo/ThalamusPhysio | python/main_pop_corr_fig.py | Python | gpl-3.0 | 9,516 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2014 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
from httplib import FORBIDDEN, INTERNAL_SERVER_ERROR, OK
from json impor... | alirizakeles/zato | code/zato-server/src/zato/server/service/internal/pubsub/__init__.py | Python | gpl-3.0 | 12,954 |
"""
Legalese
--------
Copyright (c) 2015, 2016 Genome Research Ltd.
Author: Colin Nolan <cn13@sanger.ac.uk>
This file is part of Cookie Monster.
Cookie Monster 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; ei... | wtsi-hgi/cookie-monster | cookiemonster/tests/processor/_mocks.py | Python | gpl-3.0 | 2,448 |
import uuid
from unithelper import DBTestCase
from unithelper import mocker
from unithelper import requestor
from unithelper import hashable_dict
from bc import database
from bc import metrics
from bc_wapi import wapi_metrics
class Test(DBTestCase):
def test_metric_get(self):
"""Check getting metric with metri... | legionus/billing | tests/test_wapi_metrics.py | Python | gpl-3.0 | 2,622 |
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.views.generic import TemplateView
from . import views
app_name = 'web'
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name="front.html"), name='front'),
url(r'^index$', views.IndexView.as_view(), name='... | FacundoAcevedo/gondolero | gondolero/web/urls.py | Python | gpl-3.0 | 2,275 |
from django.http import HttpResponseRedirect
def anonymous_required(view, redirect_to= None):
return AnonymousRequired(view, redirect_to)
class AnonymousRequired(object):
def __init__(self, view, redirect_to):
if redirect_to is None:
from django.conf import settings
redirect_to... | ZwaConnection/TheGuildWeb | apps/member/decorators.py | Python | gpl-3.0 | 646 |
#
#
# Copyright (c) 2009-2019 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""Generate fake data used by the tests.
The idea is to create a deterministic database that reports
can be run against, resulting in predictable, expected results"""
from __future__ import absolute... | gjr80/weewx | bin/weewx/tests/gen_fake_data.py | Python | gpl-3.0 | 9,588 |
import datetime
from rest_framework.authentication import TokenAuthentication
from rest_framework import exceptions
from factotum.environment import env
class ExpiringTokenAuthentication(TokenAuthentication):
keyword = "Bearer"
def authenticate_credentials(self, key):
model = self.get_model()
... | HumanExposure/factotum | apps_api/core/authentication.py | Python | gpl-3.0 | 854 |
# -*- coding: utf-8 -*-
import argparse
import six
parser = argparse.ArgumentParser(description="Minecraft Package Manager")
sub = parser.add_subparsers(help="command help")
# package commands
sync_parser = sub.add_parser("sync",
description="Synchronize local mod archive.",
... | qwattash/mpm | mpm/cli/mpm.py | Python | gpl-3.0 | 1,756 |
import contextlib
import logging
import os.path
import sqlalchemy
from sqlalchemy import schema as sql_schema
from sqlalchemy import types as sql_types
from sqlalchemy.ext import declarative as sql_declarative
from sqlalchemy.orm import session as sql_session
from dancebooks.config import config
_Base = sql_declarat... | georgthegreat/dancebooks-bibtex | dancebooks/db.py | Python | gpl-3.0 | 1,449 |
#!/usr/bin/env python
# -*-coding:utf-8-*-
'''
Author : ming
date : 2016/11/27 上午12:20
role : Version Update
'''
from tornado import web
from tornado.web import HTTPError
class IndexHandler(web.RequestHandler):
def get(self, room):
if room == 'get':
raise HTTPError(500)
self.room ... | mk8310/im_demo | views/index.py | Python | gpl-3.0 | 405 |
class Membro(object):
nome = None
cargo = None
def __init__(self, nome, cargo):
self.nome = nome
self.cargo = cargo
| TeamWorkQualityReport/TeamWorkQualityReport | Backend/Analise/entidades/membro.py | Python | gpl-3.0 | 125 |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.github.io
# Git: https://github.com/SickRage/SickRage.git
#
# This file is part of SickRage.
#
# SickRage 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... | jackkiej/SickRage | sickbeard/helpers.py | Python | gpl-3.0 | 59,002 |
# -*- coding: utf-8 -*-
#*****************************************************************************
# Copyright (C) 2010 Fredrik Strömberg <fredrik314@gmail.com>,
# Stephan Ehlen <>
# Distributed under the terms of the GNU General Public License (GPL)
#
# This code is distributed in the hope that it will be us... | sehlen/modforms-db | wmf/web_modform_space_computing.py | Python | gpl-3.0 | 18,193 |
import pytest
from united_states_of_browsers.db_merge.db_search import (
check_fts5_installed,
search,
)
pytestmark = pytest.mark.skipif(
not check_fts5_installed(),
reason="FTS5 not available. Search disabled",
)
def test_search_with_keywords_and_dates(searchable_db_path):
actual_search_result... | kchawla-pi/united-states-of-browsers | tests/tests/test_db_search.py | Python | gpl-3.0 | 3,037 |
########################################################################
# $HeadURL $
# File: RequestDB.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2012/12/04 08:06:30
########################################################################
""" :mod: RequestDB
=======================
.. module: Request... | avedaee/DIRAC | RequestManagementSystem/DB/RequestDB.py | Python | gpl-3.0 | 26,378 |
import shutil
import os
import errno
class file_exporter:
def __init__(self):
self.error_message = ''
def get_error_message (self):
return self.error_message
def tally_path_segments (self, file):
while (file != ''):
(first, last) = os.path.split (file)
if... | jpriebe/qooxtunes | addon/python/file_exporter.py | Python | gpl-3.0 | 2,670 |
"""
Django settings for asucourses project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | asucourses/asucourses.com | asucourses/settings.py | Python | gpl-3.0 | 1,495 |
__version__ = "0.0.2a3"
| trueneu/swiss-knife | swk_plugins/swk_casp/swk_casp/version.py | Python | gpl-3.0 | 24 |
#!/usr/bin/env python
import socket
import sys
import os
import time
import random
import csv
import json
import random
from sentence_generator import make_sentence
from copy import deepcopy
from subprocess import check_output
# csv file columns are timestamp, pressure, CO2, ...
SAMPLE_DATA_DIR = os.path.join(os.pat... | breathe-free/breathe-see | example_publisher/__main__.py | Python | gpl-3.0 | 10,411 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Repacking Instaseis databases.
Requires click, h5py, and numpy.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2016
Simon Stähler (staehler@geophysik.uni-muenchen.de), 2016
:license:
GNU Lesser General Public License, Version 3 [non-comme... | seismology/mc_kernel | UTILS/repack_database.py | Python | gpl-3.0 | 9,908 |
"""
Unit tests for the base mechanism class.
"""
import pytest
from azmq.mechanisms.base import Mechanism
from azmq.errors import ProtocolError
@pytest.mark.asyncio
async def test_expect_command(reader):
reader.write(b'\x04\x09\x03FOOhello')
reader.seek(0)
result = await Mechanism._expect_command(reade... | ereOn/azmq | tests/unit/test_mechanisms/test_base.py | Python | gpl-3.0 | 2,577 |
# -*- coding: utf-8 -*-
#
# Total Open Station documentation build configuration file, created by
# sphinx-quickstart on Sat Feb 28 23:03:04 2015.
#
# 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 ... | steko/totalopenstation | docs/conf.py | Python | gpl-3.0 | 9,411 |
#!/usr/bin/env python3
'''Khronos OpenVG parent image binding for EGL.
http://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_vg_parent_image.txt
'''
# Copyright © 2012-13 Tim Pederick.
#
# This file is part of Pegl.
#
# Pegl is free software: you can redistribute it and/or modify it
# under the terms of the GNU... | perey/pegl | src/pegl/ext/khr_vgimage.py | Python | gpl-3.0 | 983 |
#!/usr/bin/env python
# encoding: utf-8
###
# Copyright 2011 University of Warsaw, Krzysztof Rusek
#
# This file is part of SegmEdit.
#
# SegmEdit 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 versi... | CeON/SegmEdit | SegmEditGUI/config.py | Python | gpl-3.0 | 3,901 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# rn.py - load network of routes from OSM
#
# Copyright (C) 2012, Stefan Schramm <mail@stefanschramm.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 Fou... | stefanschramm/osm_oepnv_validator | rn.py | Python | gpl-3.0 | 4,325 |
#author :haiyfu
#date:April 14
#description:
#contact:haiyangfu512@gmail.com
"""
This little part is to check how many different values in
a column and store the unqiue values in a list.
For FCBF initially.
The last column is the class .
"""
from sys import argv
#only count the target file and return... | haiy/XF_PRISM | src/XF-Prism/rc_generator.py | Python | gpl-3.0 | 1,587 |
from paste.session import make_session_middleware
from webapp.app import *
from webapp.check import Check, environ_has
Request.session = property(lambda self: self.environ['paste.session.factory']())
def session_has(*args, **kwargs):
"""
Check for the presense and, optionally, value of a session variable.
... | sj26/webapp | build/lib/webapp/session.py | Python | gpl-3.0 | 1,477 |
from xivo_admin import BasePlugin
from views import home
class XiVOHome(BasePlugin):
def load(self, app):
app.register_blueprint(home)
| sboily/xivo-admin-ivr-plugins | xivo_ivr/plugins/home/load.py | Python | gpl-3.0 | 148 |
#!/usr/bin/env python3
import sys
import os
import deadpool_dfa
import phoenixAES
import binascii
def processinput(iblock, blocksize):
#p=b'%0*x' % (2*blocksize, iblock) # Requires python3.5
p=('%0*x' % (2*blocksize, iblock)).encode('utf8')
open('foo', 'wb').write(binascii.unhexlify(p)*4)
return (Non... | SideChannelMarvels/Deadpool | wbs_aes_plaidctf2013/DFA/attack_plaidctf.py | Python | gpl-3.0 | 1,049 |
import math
Deleted = math.inf
def hash_delete(T, k, h):
m = T.length
i = 0
while True:
j = h(k, i, m)
if T[j] == k:
T[j] = Deleted
return
i = i + 1
if T[j] is None or i == m:
break
def hash_insert_(T, k, h):
m = T.length
i = 0... | wojtask/CormenPy | src/chapter11/exercise11_4_2.py | Python | gpl-3.0 | 565 |
#!/usr/bin/python
import numpy as np
from sklearn.metrics import mutual_info_score
import MDAnalysis
import os
import re
import math
import sys
from itertools import combinations_with_replacement,permutations
from concurrent.futures import ProcessPoolExecutor, Future, wait
usecpus = 10#how many cores to use
frms_num ... | id4zs2008/blob-dyn | ca-multicore.py | Python | gpl-3.0 | 4,857 |
# -*- coding: utf-8 -*-
#
# tm1640-rpi documentation build configuration file, created by
# sphinx-quickstart on Fri Apr 12 19:52:17 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.
#
# ... | micolous/tm1640-rpi | doc/source/conf.py | Python | gpl-3.0 | 8,144 |
###############################################################################
import numpy
import time
###############################################################################
def matrixFactorization(R, P, Q, K, epochMax=1000, alpha=0.0002, beta=0.02):
Q = Q.T
for step in xrange(epochMax):
f... | mgodek/music_recommendation_system | matrixFactor.py | Python | gpl-3.0 | 3,252 |
import json
from bson.errors import InvalidId
from flask import Blueprint, jsonify, request, g
item_api = Blueprint('itemApi', __name__)
def get_item_as_object(item) -> dict:
return_item = {
"_id": str(item['_id']),
"name": item['name'],
"description": item['description'],
"imageU... | project-hopkins/Westworld | hopkin/routes/items.py | Python | gpl-3.0 | 8,707 |
# Copyright (C) 2020 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from collections import Counter, deque
from functools import partial
impor... | SoftwareHeritage/swh-storage | swh/storage/proxies/tenacious.py | Python | gpl-3.0 | 6,681 |
"""
WSGI config for ShroomsAPI 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.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | AtelierSoude/shrooms | ShroomsAPI/ShroomsAPI/wsgi.py | Python | gpl-3.0 | 398 |
#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: UHD FFT Qt
# Author: Johannes Demel
# Generated: Wed Jan 29 13:51:16 2014
##################################################
from PyQt4 import Qt
from gnuradio import eng_notation
from gnuradio import gr
from... | jdemel/gr-misc | examples/uhd_fft_qt.py | Python | gpl-3.0 | 16,000 |
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
# single_thread_download.py
import os
import urllib.request
import urllib.error
import shutil
# 单线程
def single_thread_download(url, file_name=None, overwrite=False):
# 如果文件名为空,则从 URL 中获取文件名
if file_name is None:
file_name = url.rpartition('/')[-1]
# 潜在 bug:如果不覆盖己有文件,而... | zeekvfu/sip_tea | single_thread_download.py | Python | gpl-3.0 | 813 |
# Tests:
# assign ::= expr store
pass
| rocky/python-uncompyle6 | test/simple_source/stmts/00_pass.py | Python | gpl-3.0 | 38 |
# This file is part of django-doubleoptin-contactform.
# django-doubleoptin-contactform 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 Foundation, either version 3 of the License, or
# (at your opt... | MyersGer/django-doubleoptin-contactform | doptincf/urls.py | Python | gpl-3.0 | 1,171 |
#
# Copyright 2005,2007,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, filter
import math
import cmath
class fm_deemph(gr.hier_block2):
r"""
FM Deemphasis IIR filter
Args:
fs: sampling frequen... | trabucayre/gnuradio | gr-analog/python/analog/fm_emph.py | Python | gpl-3.0 | 9,632 |