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 multiprocessing import Process, Pipe
import select
import time
from musio import open_file, open_device
class Player(Process):
""" Music player process.
"""
def __init__(self, loops: int = -1):
""" Start the player.
"""
super(Player, self).__init__()
in_pipe, out_... | zepto/musio | examples/musio_proc_test.py | Python | gpl-3.0 | 8,356 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Unity Autopilot Test Suite
# Copyright (C) 2015 Canonical
#
# 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 ... | yunit-io/yunit | tests/autopilot/unity8/greeter/tests/test_args.py | Python | gpl-3.0 | 1,901 |
#----------------------------------------------------------------------------------------
#
# This file is part of CosmicFish.
#
# Copyright (C) 2015-2017 by the CosmicFish authors
#
# The CosmicFish code is free software;
# You can use it, redistribute it, and/or modify it under the terms
# of the GNU General Public L... | CosmicFish/CosmicFish | python/apps/debug_plotter.py | Python | gpl-3.0 | 7,085 |
from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
bot = ChatBot(
"Math & Time Bot",
logic_adapters=[
'chatterbot.logic.BestMatch',
"chatterbot.logic.MathematicalEvaluation",
"chatterbot.logic.TimeLogicAdapter",
'chatterbot.logic.LowConfidenceAdapter'
... | roxana-lafuente/CursoAA | clase6_chatbox.py | Python | gpl-3.0 | 815 |
import nengo
import pm
import numpy as np
model = nengo.Network()
with model:
pacman = pm.pacman_world.PacmanWorld(
pm.maze.generateMaze(num_rows=5, num_cols=5,
num_ghosts=1, seed=1))
move = nengo.Ensemble(n_neurons=100, dimensions=2, r... | tcstewar/nengo_pacman | pacman.py | Python | gpl-3.0 | 2,082 |
#
# Copyright (C) 2009, 2010 JAGSAT Development Team (see below)
#
# This file is part of JAGSAT.
#
# JAGSAT 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 ... | arximboldi/jagsat | src/states/attack.py | Python | gpl-3.0 | 2,722 |
#
# Constants used throughout the library
#
######################
# P2P Server Commands
######################
REQ_FRIEND = 12012201
REQ_FILE = 99119840
RECV_FILE = 99119841
RECV_MSG = 78986713
RECV_AVATAR = 57383752
INVITE_CHAT = 86878161
#########################
# Quip Server Commands
#########################
LO... | cbrunker/quip | lib/Constants.py | Python | gpl-3.0 | 2,604 |
# coding=utf-8
"""InaSAFE Disaster risk assessment tool developed by AusAid -
**Utilities Tests implementation.**
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 ... | assefay/inasafe | safe/common/test_utilities.py | Python | gpl-3.0 | 9,078 |
"""
This page is in the table of contents.
Chop is a script to chop a shape into svg slice layers.
==Settings==
===Add Extra Top Layer if Necessary===
Default is on.
When selected, chop will add an extra layer at the very top of the object if the top of the object is more than half the layer thickness above the first... | tobykurien/MakerDroid | assetsrc/public.mp3/skeinforge/skeinforge_tools/craft_plugins/chop.py | Python | gpl-3.0 | 9,855 |
from django.conf.urls import patterns, include, url
contest_patterns = patterns('oioioi.oireports.views',
url(r'^oireports/$', 'oireports_view', name='oireports'),
url(r'^get_report_users/$', 'get_report_users_view',
name='get_report_users'),
)
| papedaniel/oioioi | oioioi/oireports/urls.py | Python | gpl-3.0 | 262 |
"""
Author: RedFantom
Contributors: Daethyra (Naiii) and Sprigellania (Zarainia)
License: GNU GPLv3 as in LICENSE
Copyright (C) 2016-2018 RedFantom
"""
# UI Libraries
import tkinter as tk
from tkinter import ttk, messagebox
class AddPhase(tk.Toplevel):
"""
Toplevel to show widgets for entering the data requir... | RedFantom/GSF-Parser | toplevels/strategy/add_phase.py | Python | gpl-3.0 | 2,346 |
from django.test import TestCase
from django.test import RequestFactory
from django.test import Client
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.options import (ModelAdmin, TabularInline,
HORIZONTAL, VERTICAL)
from baseuser.admin import (BaseUserAdmin, UserChangeForm,
UserCrea... | swim-fish/SQA_WEB | baseuser/tests/tests_admin.py | Python | gpl-3.0 | 4,868 |
"""!
@brief Module peak
Contains peak model def
"""
from __future__ import division
import numpy as np
import numdifftools as nd
from scipy.special import erf
class GaussModel(object):
"""!
@brief Gaussian model of the form:
\f[
y(x) = a\ e^{\frac{-(x - b)^2}{2c^2}}
\f]
Where $a$ is the scalin... | wgurecky/GammaSpy | gammaspy/gammaData/peak.py | Python | gpl-3.0 | 6,156 |
import os, sys, re
import dircache
"""
Generates a parser and header therefore from the .cc files in a given directory.
It is assumed that: 1 class -> 1 rule of the grammer.
These files must be beautiful - i.e. each function declaration on its own line
without the opening {
Any private members ar... | stephenrkell/dwarfpython | contrib/flex/ast/autogen.py | Python | gpl-3.0 | 10,893 |
# -*- coding: utf-8 -*-
# Based on code from Jannis Leidel's blog 2008 (http://jannisleidel.com/)
# Copyright (C) 2010: Sindre Røkenes Myren,
from django import VERSION, forms
from django.conf import settings
from django.utils.safestring import mark_safe
from django.utils.text import truncate_words
from django.templa... | smyrman/kikrit | django_kikrit/jquery_widgets/widgets.py | Python | gpl-3.0 | 2,377 |
#-!/usr/bin/python
#coding:utf-8
import threading
from time import sleep, time
loops=[4,2]
def loop(nloop,nsec):
print('start loop %s at: %s'%(nloop, time()))
sleep(nsec)
print('loop %s done at: %s'%(nloop,time()))
def main():
print('starting at:', time())
threads = []
nloops... | YuxuanLing/trunk | trunk/code/study/python/thread/mythreading0.py | Python | gpl-3.0 | 671 |
# Problem 44
# Pentagonal numbers are generated by the formula, Pn=n(3n−1)/2. The first ten pentagonal numbers are:
#
# 1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...
#
# It can be seen that P4 + P7 = 22 + 70 = 92 = P8. However, their difference, 70 − 22 = 48, is not pentagonal.
#
# Find the pair of pentagonal numbers, Pj... | chriscallan/Euler | Probs_1_to_50/044_PentagonNumbers.py | Python | gpl-3.0 | 1,910 |
import scipy.misc
import cv2
class WritePlate():
def __init__(self):
pass
def __call__(self, path_to_image = '', region = None, plate = ''):
if plate != 'NOPLATE':
path_to_new_image = path_to_image[:path_to_image.rfind('.')]
px0 = region[0]['x']
py0 = regio... | AlvaroRQ/prototipo | ownLibraries/cloudFiles/createPlate.py | Python | gpl-3.0 | 1,911 |
#!/usr/bin/env python
#----------------------------------------------------------------------------
# 01-Jun-2013 ShaneG
#
# This tool is used to generate image resources and corresponding palettes
# from image files.
#----------------------------------------------------------------------------
from sys import argv
fro... | thegaragelab/quickui | tools/mkimage.py | Python | gpl-3.0 | 2,626 |
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2017 Juliana Oliveira R <juliana.orod@gmail.org>
#
# diffoscope 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 Softwa... | ReproducibleBuilds/diffoscope | tests/comparators/test_containers.py | Python | gpl-3.0 | 3,004 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .dns import (
DomainsTextFileWrapper,
)
from .networks import (
NetworksCsvRowWrapper,
NetworksCsvWrapper,
)
| lavalamp-/ws-backend-community | lib/parsing/wrappers/uploads/__init__.py | Python | gpl-3.0 | 191 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2007 David Versmisse <david.versmisse@itaapy.com>
# Copyright (C) 2007-2008 Juan David Ibáñez Palomar <jdavid@itaapy.com>
# Copyright (C) 2008 Henry Obein <henry@itaapy.com>
# Copyright (C) 2008 Sylvain Taverne <sylvain@itaapy.com>
#
# This program is free s... | kennym/itools | scripts/ipkg-quality.py | Python | gpl-3.0 | 19,915 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import libvirt
from xml.etree import ElementTree
from ConfigParser import ConfigParser
from folavirt.virt.Pool import Pool
from folavirt.virt.Host import Host
class ImportIscsiPool():
"""
Zarządzanie pulami dyskowymi iscsi
"""
def __init__(self, iscsilis... | lokipl/folavirt | lib/folavirt/disks/iscsi/ImportIscsiPool.py | Python | gpl-3.0 | 5,701 |
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope th... | dMaggot/FeedToJoomla | src/feedtojoomla/feedtojoomla.py | Python | gpl-3.0 | 4,517 |
# asyncurl.py - Wrapper class for using pycurl objects in asyncore
#
# Copyright (c) 2009-2011 Antti Ajanki <antti.ajanki@iki.fi>
#
# 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... | vadmium/webvi | src/libwebvi/webvi/asyncurl.py | Python | gpl-3.0 | 11,780 |
"""NPC component."""
from component_objects import Component, Element
class NPCAddModal(Component):
"""Definition of NPC Add component."""
name_xpath = '//*[@id="addNPC"]/div/div/div[2]/form/div[1]/div/input'
race_xpath = '//*[@id="addNPC"]/div/div/div[2]/form/div[2]/div/input'
description_xpath = '... | adventurerscodex/uat | components/core/dm/npc.py | Python | gpl-3.0 | 2,085 |
#!/usr/bin/env python2
import os
import sys
def main():
"""For virtual environments, symlink sip.so and PyQt4 into the
site-packeges directory. Note that python-pyqt4 and python-sip must be
installed to your system for this to work.
"""
pyenv = sys.argv[1]
# commands will be issued from the root of your python... | smyrman/kikrit | dev_tools/post_install.py | Python | gpl-3.0 | 692 |
# -*- coding: utf-8 -*-
import os
import psutil
from trifle.base.sensor import BaseSensor, RDF, T, Literal
class ServicesSensor(BaseSensor):
path = "services"
def pull(self):
for interface in netifaces.interfaces():
interface_uri = self.uri_ref(interface)
self.graph.add((interface_u... | gloaec/trifle | src/trifle/sensors/services.py | Python | gpl-3.0 | 1,112 |
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... | Donkyhotay/MoonPy | zope/app/security/tests/test_ftpauth.py | Python | gpl-3.0 | 1,727 |
# 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):
# Adding model 'UploadedFile'
db.create_table('lizard_levee_uploadedfile', (
('id', self.gf('d... | lizardsystem/lizard-levee | lizard_levee/migrations/0041_auto__add_uploadedfile.py | Python | gpl-3.0 | 20,316 |
# -*- coding: utf-8 -*-
"""
Routines for quality control of GeoDanmark map data
Copyright (C) 2016
Developed by Septima.dk for the Danish Agency for Data Supply and Efficiency
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 F... | Septima/qgis-GeoDanmarkCheck | GeoDanmarkChecker/rules.py | Python | gpl-3.0 | 8,903 |
# -*- coding: utf8 -*-
import sys, os
sys.path.append(os.path.abspath('.'))
import re
import struct
import htmlentitydefs
import unicodedata
from operator import attrgetter
# Pylons model init sequence
import pylons.test
import logging
from quanthistling.config.environment import load_environment
from quanthistlin... | FrankNagel/qlc | src/webapp/quanthistling/scripts/importbook.py | Python | gpl-3.0 | 9,891 |
import os, re
from fabric.api import run
from fabric.context_managers import cd
from fabric.contrib.files import exists
def install_openssl(*args,**kwargs):
version = kwargs.get('version') or '1.0.2h'
package_name='openssl-%s' % version
if not exists(package_name + '.tar.gz'):
run('wget https://... | wservices/djangoeurope-fabfile | fabfile/misc.py | Python | gpl-3.0 | 1,063 |
# (C) British Crown Copyright 2014, Met Office
#
# This file is part of Iris.
#
# Iris 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 option) any later ve... | scollis/iris | lib/iris/tests/unit/fileformats/pyke_rules/__init__.py | Python | gpl-3.0 | 780 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-11 13:46
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0012_change_app_meta_name'),
]
operations = [
migrations.AlterModelOptions(
... | efornal/sdump | app/migrations/0013_change_meta_options.py | Python | gpl-3.0 | 1,082 |
# BFG Forge
# Based on Level Buddy by Matt Lucas
# https://matt-lucas.itch.io/level-buddy
# 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 opti... | jpcy/bfg_forge | export_map.py | Python | gpl-3.0 | 8,404 |
__author__ = 'Chris Hamm'
#GUI_SimpleMenu
from Tkinter import Tk,Frame, Menu
class guiSimpleMenu(Frame):
def __init__(self,parent):
Frame.__init__(self, parent)
self.parent = parent
self.initUI()
def initUI(self):
self.parent.title("Simple Menu")
menubar = Menu(self... | COCS4950G7/COSC4950 | Source/Network/Obsolete/GUI_TkinterExamples/GUI_SimpleMenu.py | Python | gpl-3.0 | 723 |
'''This script will perform a permutation test on the means and medians of
a given column of one or two files.'''
import argparse
from datetime import datetime
import permute
def buildList1(header,column, value, data, infile):
# Builds separate lists for condition 1 and condition 2
with open(infile, "r") as indata:... | WilsonSayresLab/AlignmentProcessor | manuscript/PermutationScripts/permutation.py | Python | gpl-3.0 | 4,293 |
# Licensed under a GNU general public license, see LICENSE.
"""
Author: Deepanshu Thakur
Date : Aug 21, 2017
"""
# -----------------------------------------------------------------------------
# Import statements
# -----------------------------------------------------------------------------
import unittest
import ra... | Deepanshu2017/temp | tests/test_phasespace.py | Python | gpl-3.0 | 7,394 |
"""
testModule.py
JCS 9/10/2013 Version 1.0
This program runs the data collection, graph preperation, housekeeping and actions
"""
# shelves:
# datacollect - sensor data collection - disabled to RAM
# graphprep - building system graphs
# housekeeping - fan check , general health and wellfare
# alarmchecks - che... | projectcuracao/projectcuracao | testSolarWindGraph.py | Python | gpl-3.0 | 893 |
#Implementation by Brian Beck from
# http://code.activestate.com/recipes/410692/
class switch(object):
def __init__(self, value):
self.value = value
self.fall = False
def __iter__(self):
"""Return the match method once, then stop"""
yield self.match
raise StopIteration... | mac389/brainpy | lib/switch.py | Python | gpl-3.0 | 627 |
"""
ESSArch is an open source archiving and digital preservation system
ESSArch
Copyright (C) 2005-2019 ES Solutions AB
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... | ESSolutions/ESSArch_Core | ESSArch_Core/WorkflowEngine/migrations/0016_processstep_task_set.py | Python | gpl-3.0 | 1,370 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | Geode/geonode | geonode/api/resourcebase_api.py | Python | gpl-3.0 | 19,776 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
from string import Template
from yaml import load
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
from managers import OpsWorksInstanceManager, EC2InstanceManager
def main():
args = vars(parse_ar... | victorcampos/simpleaws | simple_aws/main.py | Python | gpl-3.0 | 2,952 |
#!/usr/bin/env python3
"""make meta dir from meta file"""
import argparse
import itertools
import os
import re
import shutil
import sys
import pandas as pd
import scipy.spatial.distance
from geopy.distance import vincenty
# --------------------------------------------------
def get_args():
"""argparser"""
pa... | hurwitzlab/stampede-mash | scripts/make_metadata_dir.py | Python | gpl-3.0 | 6,637 |
'''
This file is part of python-libdeje.
python-libdeje 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 option) any later version.
python-libdeje is distribute... | campadrenalin/python-libdeje | deje/tests/test_event.py | Python | gpl-3.0 | 2,973 |
#!/usr/bin/python
# -*- coding:utf-8 -*-
# Este script es sofware libre. Puede redistribuirlo y/o modificarlo bajo
# los terminos de la licencia pública general de GNU, según es publicada
# por la free software fundation bien la versión 3 de la misma licencia
# o de cualquier versión posterior. (según su elección ).... | Diego-debian/FREE_POPS_1.0 | free_pops/bin/o_Carpetas.py | Python | gpl-3.0 | 1,406 |
#!/usr/bin/env python
import os
import sys
try:
from rol import settings_name
except ImportError:
settings_name = "settings"
settings_var = "musicPlayList."+settings_name
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_var)
from django.core.management import execu... | beren5000/musicPlayList | manage.py | Python | gpl-3.0 | 382 |
# Xsquare loves to play with strings a lot. Today, he has two strings S1 and S2 both consisting of lower case
# alphabets. Xsquare listed all subsequences of string S1 on a paper and all subsequences of string S2 on a
# separate paper. Xsquare wants to know whether there exists a string which is listed on both the pape... | OmkarPathak/Python-Programs | CompetitiveProgramming/HackerEarth/Bit_Manipulation/P02_XsquareAndTwoStrings.py | Python | gpl-3.0 | 1,841 |
# -*- coding:Utf-8 -*-
#####################################################################
#This file is part of RGPA.
#Foobar 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, ... | niamiot/RGPA | Util/Geomview.py | Python | gpl-3.0 | 2,545 |
from collections import Counter
from string import punctuation
from tqdm import tqdm
from retrieval.elastic_functions import getElasticTermScores
import json
import os
from models.keyword_features import FeaturesReader, getRootDir
c3_stopwords = ["~", "the", "and", "or", "not", "of", "to", "from", "by", "with", "a",... | danieldmm/minerva | proc/stopword_proc.py | Python | gpl-3.0 | 12,270 |
# -*- coding: utf-8 -*-
'''
Created on 9 ��� 2013
@author: tedlaz
'''
import utils
import utils_qt
import report_table
#import f_newEmployeeWizard
| tedlaz/pyted | misthodosia/m13a/imports.py | Python | gpl-3.0 | 164 |
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from hashmal_lib.core.script import Script, transform_human
from hashmal_lib.gui_utils import monospace_font
def transform_human_script(text, main_window):
"""Transform user input into something Script can read.
Main window is needed for tool integration."... | mazaclub/hashmal | hashmal_lib/widgets/script.py | Python | gpl-3.0 | 5,138 |
#!/usr/bin/env python
#
# Copyright (C) 2008 Ferry Boender
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This ... | fboender/miniorganizer | src/lib/miniorganizer/models/journal.py | Python | gpl-3.0 | 1,651 |
# -*- coding: utf-8 -*-
import sys
import re
import xml.etree.ElementTree as etree
import subprocess
import os
import resource
import utils
djvulibre_path = ''
djvutoxml = djvulibre_path + 'djvutoxml'
djvutxt = djvulibre_path + 'djvutxt'
converter = "djvu_text_to_hocr 0.00.00"
# All of these contain the needed inden... | WeftWiki/phetools | ocr/djvu_text_to_hocr.py | Python | gpl-3.0 | 11,623 |
# vim: set et sts=4 sw=4:
#
# Zanata Python Client
#
# Copyright (c) 2011 Jian Ni <jni@redhat.com>
# Copyright (c) 2011 Red Hat, Inc.
#
# 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 Foundation; eit... | jamesni/zanata-python-client | zanataclient/zanata.py | Python | gpl-3.0 | 46,918 |
# -*- coding: utf-8 -*-
"""
Robust statistics and estimators
"""
import numpy as np
def mad(arr):
"""
Element-wise median absolute deviation (MAD) of a signal.
.. math::
\\text{MAD}_i = | X_i - \\text{median}(X) |
Parameters
----------
arr : array-like
Array.
Returns
... | LaurentRDC/scikit-ued | skued/time_series/robust.py | Python | gpl-3.0 | 567 |
"""Collect employee information into a dictionary from a directory of files."""
import sys
import os
DELIM = ': '
class Employee(object):
"""Information for an employee."""
def __init__(self, emp_id, name, title):
self.id = emp_id
self.name = name
self.title = title
def __str__... | ConstantineLignos/constantinelignos.github.io | pybootcamp/examples/employee_info.py | Python | gpl-3.0 | 1,144 |
import logging
import random
import time
from sqlalchemy.exc import IntegrityError, InvalidRequestError
from community_share.models.search import Label, Search
from community_share.models.user import User, UserReview
from community_share.models.secret import Secret
from community_share.models.survey import Question, ... | seanastephens/communityshare | setup.py | Python | mpl-2.0 | 10,620 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import logging
import time
from worq.pool.thread import WorkerPool
from worq import get_broker, get_queue, TaskSpace
im... | mwobensmith/tls-canary | tlscanary/worker_pool.py | Python | mpl-2.0 | 6,851 |
from flask_script import Manager
from flask_migrate import MigrateCommand
from models import *
from . import app
manager = Manager(app)
manager.add_command('db', MigrateCommand)
@manager.command
def run():
from gevent.pywsgi import WSGIServer
http_server = WSGIServer(('', app.config['HTTP_PORT']), app)
if app.c... | MCProHosting/SpaceGDN | gdn/manage.py | Python | mpl-2.0 | 1,766 |
#!/usr/bin/env python
# encoding: utf-8
"""
admin.py
Created by Luan Fonseca on 2013-09-06.
Copyright (c) 2013 Unstarted-Ideas. All rights reserved.
"""
def _(x): return x
from django.db.models import *
from django.contrib.auth.models import User
from django_extensions.db.models import (AutoSlugField,
... | luanfonceca/Unstarted-Ideas | ideas/models.py | Python | mpl-2.0 | 2,867 |
import pyrat, os
import logging
from osgeo import gdal
import numpy as np
class AIRSAR(pyrat.ImportWorker):
"""
Import of JPL AIRSAR covariance files (\*.STK).
**author:** Andreas Reigber\n
**status:** --beta-- Mostly untested.
"""
gui = {'menu': 'File|Import airborne', 'entry': 'AIRSAR'}
... | birgander2/PyRAT | pyrat/load/Airborne_GDAL.py | Python | mpl-2.0 | 4,100 |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 5 12:46:00 2017
@author: cedric
"""
| onfinternational/QGISProcessingScripts | Scripts/S1Lib/__init__.py | Python | mpl-2.0 | 86 |
from remote import ResourceNotFoundError, MethodNotAllowedError
import tests
import utils
class SystemsTestCase (tests.TestCase):
def test_get_systems (self):
systems = self.client.get_systems()
def test_get_system (self):
system = self.client.get_system(system='chicago')
self.asser... | mozilla/badgekit-api-python-client | test/systems_test.py | Python | mpl-2.0 | 624 |
""" Adding `always_show_ticket_number` to display screen settings.
Revision ID: 1728b52497ba
Revises: 8f8e67fcbd9c
Create Date: 2020-02-12 05:47:13.140826
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1728b52497ba'
down_revision = '8f8e67fcbd9c'
branch_label... | mrf345/FQM | migrations/versions/1728b52497ba_.py | Python | mpl-2.0 | 839 |
import os
files = [f for f in os.listdir('.') if os.path.isfile(f)]
for filename in files:
if not filename.endswith('.ini'):
continue
if os.path.exists(filename):
with open(filename, 'r') as f:
data = f.read()
else:
print "unable to find: %s" % filename
continu... | jmaher/randomtools | replace.py | Python | mpl-2.0 | 603 |
#####################################################################################
#
# Copyright (C) Tavendo GmbH
#
# Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you
# have purchased a commercial license), the license terms below apply.
#
# Should you enter into a separate licen... | w1z2g3/crossbar | crossbar/router/router.py | Python | agpl-3.0 | 14,947 |
"""
WSGI config for open_notices 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
from whitenoise.django import Dja... | memespring/open-notices | open_notices/wsgi.py | Python | agpl-3.0 | 500 |
# Copyright 2021 Alfredo de la Fuente - AvanzOSC
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models, fields
class AccountMove(models.Model):
_inherit = 'account.move'
start_date_period = fields.Date(string='Start date period')
end_date_period = fields.Date(strin... | avanzosc/odoo-addons | account_invoice_with_start_end_date_period/models/account_move.py | Python | agpl-3.0 | 341 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import locale
from threading import Thread
from time import strftime, gmtime
from sys import exc_info
from types import MethodType
from pprint import pformat
from traceback import format_exc
from module.utils.fs import listdir, join, save_join, stat,... | swayf/pyLoad | module/threads/BaseThread.py | Python | agpl-3.0 | 4,361 |
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the GNU
# Affero General Public License version 3 (see the file LICENSE).
__all__ = [
'KeyServerTac',
]
from lp.testing.keyserver.harness import KeyServerTac
| abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/testing/keyserver/__init__.py | Python | agpl-3.0 | 238 |
__author__ = 'tbri'
from currency_lookup import currency_lookup_wizard | bringsvor/currency_lookup | __init__.py | Python | agpl-3.0 | 71 |
'''
This module provides utilities to get the absolute filenames so that we can be sure that:
- The case of a file will match the actual file in the filesystem (otherwise breakpoints won't be hit).
- Providing means for the user to make path conversions when doing a remote debugging session in
... | edxnercel/edx-platform | .pycharm_helpers/pydev/pydevd_file_utils.py | Python | agpl-3.0 | 13,202 |
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import responses
import odoo.tests.common as common
class TestGeolocalizeOpenstreetmap(common.TransactionCase):
def setUp(self):
super(TestGeolocalizeOpenstreetmap, self).setUp()
... | OCA/geospatial | base_geolocalize_openstreetmap/tests/test_geolocalize_openstreetmap.py | Python | agpl-3.0 | 5,144 |
# -*- coding: utf-8 -*-
# ###
# Copyright (c) 2013, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
"""\
rbit extensions for integration with oer.exports pdf generation code.
"""
import os
import sys
import... | Connexions/roadrunners | roadrunners/pdf.py | Python | agpl-3.0 | 3,744 |
# coding=utf-8
"""
Contains unit tests for resources. Resources
""" | MichalKononenko/MrFreeze | tests/unit/test_resources/__init__.py | Python | agpl-3.0 | 67 |
#############################################################################
#
# Copyright (c) 2007 Martin Reisenhofer <martinr@funkring.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 F... | funkring/fdoo | addons-funkring/at_base/__openerp__.py | Python | agpl-3.0 | 1,736 |
from gavel import app
from gavel.models import *
from gavel.constants import *
import gavel.settings as settings
import gavel.utils as utils
import gavel.crowd_bt as crowd_bt
from flask import (
redirect,
render_template,
request,
session,
url_for,
)
from numpy.random import choice, random, shuffle
... | anishathalye/gavel | gavel/controllers/judge.py | Python | agpl-3.0 | 8,177 |
"""
Tests for the Mgmt Commands Feature on the Sysadmin page
"""
import unittest
from mock import patch
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from dashboard.tests.test_sysadmin import SysadminBaseTestCase
from instructor.lti_grader import LTIGrader
@unittest.... | jbassen/edx-platform | lms/djangoapps/instructor/tests/test_lti_grader.py | Python | agpl-3.0 | 5,146 |
# -*- coding: utf-8 -*-
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ModelExportTemplateField(models.Model):
_description = 'Model Export Template Field'
_name = "clv.model_exp... | CLVsol/clvsol_odoo_addons | clv_export/models/model_export_template_field.py | Python | agpl-3.0 | 2,037 |
import enum
import logging
logging.getLogger(__name__).addHandler(logging.NullHandler())
class ConductorScheme(enum.Enum):
"""
Schemes for building urls. The value of each scheme is used for
prioritizing GET/POST/... operations, so the FILE scheme should be the
first one (meaning that since the local... | conductorproject/conductor | conductor/__init__.py | Python | agpl-3.0 | 970 |
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from student.models import CourseEnrollment
from openedx.core.djangoapps.c... | nttks/edx-platform | openedx/core/djangoapps/course_global/management/commands/enroll_global_course.py | Python | agpl-3.0 | 2,084 |
# -*- coding: utf-8 -*-
# © 2016 Comunitea Servicios Tecnologicos (<http://www.comunitea.com>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import purchase_order
| Comunitea/CMNT_00098_2017_JIM_addons | reconfirm_procurement_canceled_po/models/__init__.py | Python | agpl-3.0 | 185 |
"""
Test user retirement methods
"""
import json
import ddt
from django.apps import apps
from django.conf import settings
from django.contrib.auth.models import User
from django.urls import reverse
from django.test import TestCase
import pytest
from student.models import (
get_all_retired_emails_by_email,
get... | teltek/edx-platform | common/djangoapps/student/tests/test_retirement.py | Python | agpl-3.0 | 10,318 |
#!/usr/bin/env python
import json
import logging
import multiprocessing
import time
from submission_queue.models import Submission
import requests
from django.conf import settings
from django.utils import timezone
from requests.exceptions import ConnectionError, Timeout
try:
import newrelic.agent
except ImportErr... | edx/xqueue | submission_queue/consumer.py | Python | agpl-3.0 | 5,827 |
from django.db import models
from django.forms import MultipleChoiceField, ChoiceField, CheckboxSelectMultiple
from pkg_resources import EntryPoint, iter_entry_points
from pkgutil import iter_modules
import os
import squad
class PluginNotFound(Exception):
pass
class PluginLoader(object):
__plugins__ = No... | Linaro/squad | squad/core/plugins.py | Python | agpl-3.0 | 5,993 |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2015 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | Skytim/nccuTEG | pybossa/util.py | Python | agpl-3.0 | 16,075 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import csv
from os0 import os0
try:
from clodoo import clodoo
except ImportError:
import clodoo
try:
from z0lib.z0lib import z0lib
except ImportError:
try:
from z0lib import z0lib
except ImportError:
import z0lib
# i... | zeroincombenze/tools | clodoo/moduli_da_installare.py | Python | agpl-3.0 | 9,332 |
import main # noqa
| LikeMyBread/Saylua | saylua/modules/house/views/__init__.py | Python | agpl-3.0 | 19 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import telemeta.models.fields
import telemeta.models.resource
import dirtyfields.dirtyfields
class Migration(migrations.Migration):
dependencies = [
('telemeta', '0004_auto_20170718_1540'),
]
... | ANR-kamoulox/Telemeta | telemeta/migrations/0005_auto_20170919_1521.py | Python | agpl-3.0 | 1,636 |
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the ... | Micronaet/micronaet-campaign | campaign_base/__openerp__.py | Python | agpl-3.0 | 2,370 |
# -*- coding: utf-8 -*-
#
# Copyright 2015, Foxugly. All rights reserved.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any late... | Foxugly/MyTaxAccountant | years/urls.py | Python | agpl-3.0 | 760 |
# -*- coding: utf8 -*-
#
# Copyright (C) 2019 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# Licen... | ndp-systemes/odoo-addons | bus_integration/models/bus_message_log.py | Python | agpl-3.0 | 1,654 |
# © 2019 Comunitea
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.addons.component.core import Component
from odoo.addons.queue_job.job import job
from odoo import api, fields, models
import datetime
class ProductTemplate(models.Model):
_inherit = 'product.template'
web = fields.Se... | Comunitea/CMNT_004_15 | project-addons/flask_middleware_connector/models/product/common.py | Python | agpl-3.0 | 15,713 |
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models, fields, api
class AccountInvoiceIntegrationCancel(models.TransientModel):
_name = 'account.invoice.integration.cancel'
_description = 'Cancels a created integration'
integration_id = fi... | factorlibre/l10n-spain | l10n_es_facturae/wizard/account_invoice_integration_cancel.py | Python | agpl-3.0 | 720 |
from tikon.ecs import EcuaciónVacía
from tikon.móds.rae.orgs.ecs._plntll import SubcategEcOrg
from tikon.móds.rae.utils import RES_MOV
from .dif import DifusiónAleatoria
class Atracción(SubcategEcOrg):
nombre = 'Atracción'
cls_ramas = [
DifusiónAleatoria, EcuaciónVacía
]
_nombre_res = RES_MOV... | julienmalard/Tikon | tikon/móds/rae/orgs/ecs/mov/atr/_subcateg.py | Python | agpl-3.0 | 331 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from django_webtest import WebTest
from .auth import TestUserMixin
from .factories import (
AreaExtraFactory, CandidacyExtraFactory, PersonExtraFactory,
PostExtraFactory,
)
from .uk_examples import UK2015ExamplesMixin
class TestArea... | neavouli/yournextrepresentative | candidates/tests/test_areas_view.py | Python | agpl-3.0 | 10,691 |
# -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import stock_picking
from . import stock_move
| Gebesa-Dev/Addons-gebesa | stock_picking_move_id/models/__init__.py | Python | agpl-3.0 | 173 |
# -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2015 Scifabric LTD.
#
# PYBOSSA is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | PyBossa/pybossa | test/helper/sched.py | Python | agpl-3.0 | 2,263 |