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 |
|---|---|---|---|---|---|
#
# Copyright (C) 2013-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... | KaiSzuttor/espresso | samples/p3m.py | Python | gpl-3.0 | 5,654 |
from django.conf.urls import url
from item.views import CategoryDetailView, ScriptDetailView
urlpatterns = [
url(r'^category/(?P<pk>\d+)?$', CategoryDetailView.as_view(), name='category'),
url(r'^script/(?P<pk>\d+)?$', ScriptDetailView.as_view(), name='script'),
] | DanteOnline/free-art | project/free_art/item/urls.py | Python | gpl-3.0 | 273 |
# This file is part of Lithium-Projman.
#
# Lithium-Projman 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.
#
# Lithi... | GabMus/lithium-projman | server/projman/models.py | Python | gpl-3.0 | 3,701 |
# -*- coding: utf-8 -*-
# Mathmaker Lib offers lualatex-printable mathematical objects.
# Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com>
# This file is part of Mathmaker Lib.
# Mathmaker Lib is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | nicolashainaux/mathmakerlib | tests/00_main/01_exceptions_test.py | Python | gpl-3.0 | 2,289 |
from uuid import uuid4
from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import User, Group
from django.test import RequestFactory
from txtalert.core.clinic_admin import VisitAdmin, PatientAdmin
from txtalert.core.models import Visit, Clinic, Patient
from txtalert.core.tests.base import... | praekelt/txtalert | txtalert/core/tests/test_clinic_admin.py | Python | gpl-3.0 | 5,959 |
#!/usr/bin/python2.6
#
# filters a fasta file (from standard input), pulling out sequences by name
#
from Bio import SeqIO
import sys
usage = "usage : cat some_file.fa | fasta_yank.py file_of_names "
if len(sys.argv) != 2:
print usage
sys.exit(1)
SeqIO.write ((r for r in SeqIO.parse(sys.stdin, "fasta") if... | AgResearch/prbdf | database_paper/figure_4/fasta_yank.py | Python | gpl-3.0 | 467 |
from PIL import Image
import sys
def resize(img, baseheight, newname):
hpercent = (baseheight / float(img.size[1]))
wsize = int((float(img.size[0]) * float(hpercent)))
img = img.resize((wsize, baseheight), Image.ANTIALIAS)
img.save(newname)
def makethumbnails(fname):
img = Image.open(fname)
x... | ejegg/FractalEditorSite | util/image.py | Python | gpl-3.0 | 519 |
"""
Stores application data.
"""
# standard libraries
import copy
import json
import pathlib
import threading
import typing
# third party libraries
from nion.swift.model import Utility
from nion.utils import Event
from nion.utils import StructuredModel
class ApplicationData:
"""Application data is a singleton t... | nion-software/nionswift | nion/swift/model/ApplicationData.py | Python | gpl-3.0 | 3,883 |
#!/usr/bin/python
import telepot
TOKEN = 'sua chave'
bot = telepot.Bot(TOKEN)
mensagem = 'Esta eh uma mensagem enviada \n automaticamente por: \n Intel Edison'
bot.sendMessage(111111111, mensagem)
| MuriloFerraz/Intel-Edison-Webcam-Bot-Telegram | msg_sender.py | Python | gpl-3.0 | 199 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-11 02:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contacts', '0002_auto_20170911_0251'),
]
operations = [
migrations.AlterFie... | alexeib2014/aphone | backend/contacts/migrations/0003_auto_20170911_0253.py | Python | gpl-3.0 | 806 |
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
DBSession = scoped_session(sessionmaker())
Base = declarative_base()
def initialize_sql(engine):
from user import User # NOQA
from contract import Contract # NOQA
from evaluation import Eval... | Backfeed/backfeed-protocol | backfeed_protocol/models/__init__.py | Python | gpl-3.0 | 850 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'qhangups/qhangupsbrowser.ui'
#
# Created by: PyQt5 UI code generator 5.7
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_QHangupsBrowser(object):
def setupUi(self, QHangupsBr... | xmikos/qhangups | qhangups/ui_qhangupsbrowser.py | Python | gpl-3.0 | 1,146 |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 31 16:47:23 2013
@author: root
"""
from dbdscrpp3 import *
import itertools
import matplotlib.pyplot as plt
# import pdb
if __name__=="__main__":
fname='../Results/result_tppk.res.pkl'
pdbpklpath='../PDBPKLP3'
(auc,(fp,tp),(A,Rx,Dx,Lx,cids,r,dkey))=getAUC(fn... | foxtrotmike/pairpred | getBSR.py | Python | gpl-3.0 | 1,525 |
"""Plugins defining Flas apps.
Each python module in this folder should have an `app` variable at top level,
with a flask.Blueprint in it.
# TODO(cyrille): DRY up with modules/__init__.py
"""
import importlib
import pkgutil
import logging
import os
import typing
import flask
# Import behind guard to enable flask a... | bayesimpact/bob-emploi | frontend/server/apps/__init__.py | Python | gpl-3.0 | 1,728 |
# Author: Leo Vidarte <http://nerdlabs.com.ar>
#
# This file is part of lai-client.
#
# lai-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Free Software Foundation.
#
# lai-client is distributed in the hope that it wi... | lvidarte/lai-client | tests/db/test_sqlite_database.py | Python | gpl-3.0 | 4,289 |
# -*- coding: utf-8 -*-
"""
Discord API Wrapper
~~~~~~~~~~~~~~~~~~~
A basic wrapper for the Discord API.
:copyright: (c) 2015-2016 Rapptz
:license: MIT, see LICENSE for more details.
"""
__title__ = 'discord'
__author__ = 'Rapptz'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015-2016 Rapptz'
__version__ = '0.11... | Aurous/Magic-Discord-Bot | discord/__init__.py | Python | gpl-3.0 | 1,365 |
# -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE 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
# any later version.
#
# NIN... | open-motivation/motivation-ide | ninja_ide/gui/dialogs/preferences.py | Python | gpl-3.0 | 87,573 |
from django.test import TestCase
from datetime import datetime, timedelta, timezone
from initialize.init_data import add_old_alignment, set_last_run_at_to_overdue
from base.models import Alignment
from formalign.settings import CLEAN_OLDER
class InitDataTestCase(TestCase):
"""
Tests add_to_alignment
"""
... | globz-eu/formalign | base/tests/test_initialize.py | Python | gpl-3.0 | 963 |
# Copyright (c) 2012-2013 Paul Tagliamonte <paultag@debian.org>
# Copyright (c) 2014 Jon Severinsson <jon@severinsson.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restr... | lkorigin/laniakea-spark | spark/utils/deb822.py | Python | gpl-3.0 | 2,748 |
# -*- coding: utf-8 -*-
##############################################################################
#
# document_csv module for OpenERP, Import structure in CSV
# Copyright (C) 2011 SYLEAM (<http://www.syleam.fr/>)
# Christophe CHAUVET <christophe.chauvet@syleam.fr>
# Copyright (C) 2011 Camptoc... | syleam/document_csv | wizard/launch.py | Python | gpl-3.0 | 3,320 |
from random import randint
from projectiles import Star
from math import sqrt
from pygame.color import THECOLORS
class Explosion(object):
range = 6
radius = 4
damage = 2, 5
heal = False
name = "Explosion"
icon = "firebolt"
cooldown = 7
def __init__(self, caster, location, item):
self.item = item
self.r... | Greymerk/python-rpg | src/abilities/explosion.py | Python | gpl-3.0 | 3,489 |
# -*- coding:utf-8 -*-
# Cyril Fournier
# 10/08/2016
# =======================================
# Update the trackList.json of a JBrowse,
# by adding category, description, color
# =======================================
import os,sys
import json
from Hero import Hero
from Monster import Monster
from Item import Item... | Jidgdoi/MythologyQuest | src/JsonParser.py | Python | gpl-3.0 | 1,734 |
#!/usr/bin/env python
#
# barman - Backup and Recovery Manager for PostgreSQL
#
# Copyright (C) 2011-2015 2ndQuadrant Italia (Devise.IT S.r.l.) <info@2ndquadrant.it>
#
# 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... | terrorobe/barman | setup.py | Python | gpl-3.0 | 3,778 |
# Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg
#
# This file is part of Timeline.
#
# Timeline 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... | linostar/timeline-clone | test/specs/plugin/PluginFactory.py | Python | gpl-3.0 | 1,487 |
from mpd import MPDClient
from time import sleep
import RPi.GPIO as GPIO
currentSong = None
bingoMPD = None
selfMPD = None
def setupGPIO():
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7, GPIO.IN)
def fadeOver(newSong):
global selfMPD
global bingoMPD
oldVol = int(selfMPD.status()["volume"])
#fade out
for vol in range(... | Bytewerk/mpdsync | mpdsync.py | Python | gpl-3.0 | 2,455 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
import unittest
from mantid.py3compat import... | mganeva/mantid | scripts/test/MultiPlotting/MultiPlottingContext_test.py | Python | gpl-3.0 | 2,543 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2016 Savoir-faire Linux Inc.
# Author(s): Adrien Béraud <adrien.beraud@savoirfairelinux.com>
# Simon Désaulniers <sim.desaulniers@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the... | nkgeorgiev/tarator | old/modules/DHT/opendht/python/tools/benchmark.py | Python | gpl-3.0 | 9,414 |
from django.contrib import admin
from blog.models import Post
class PostAdmin(admin.ModelAdmin):
#fields display on change list
list_display = ('title', 'description')
#fields to filter the change list with
list_filter = ('published', 'created')
#fields to search in change list
search_fields =... | luiseiherrera/jsmd | blog/admin.py | Python | gpl-3.0 | 653 |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickchill.github.io
#
# This file is part of SickChill.
#
# SickChill 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... | coderbone/SickRage-alt | sickchill/views/config/anime.py | Python | gpl-3.0 | 2,470 |
def zwgll(p):
"""
computes the p+1 Gauss-Lobatto-Legendre nodes z on [-1,1]
i.e. the zeros of the first derivative of the Legendre polynomial
of degree p plus -1 and 1
and the p+1 weights w
"""
import numpy as np
n = p + 1
z = np.zeros(n, dtype=np.float64)
w = np.zeros(n, dtype=np.float64)
z[0] ... | maxhutch/sem | sem.py | Python | gpl-3.0 | 4,045 |
# Copyright (C) 2105 wysiwyng
#
# 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 d... | wysiwyng/sr14 | mai_sr14/robot.py | Python | gpl-3.0 | 10,128 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""@package docstring
Yowsup connector for wxpyWha (a simple wxWidgets GUI wrapper atop yowsup).
Uses WhaLayer to build the Yowsup stack.
This is based on code from the yowsup echo example, the yowsup cli and pywhatsapp.
"""
SECONDS_RECONNECT_DELAY = 10
import sys
# ... | hoehermann/wxpyWha | whastack.py | Python | gpl-3.0 | 3,522 |
import matplotlib.pyplot as plt
import numpy as np
import schwalbe_couplings
import experiment_loader
import matplotlib
matplotlib.rcParams.update({'font.size': 20})
outdir = "/home/kyleb/src/pymd/Papers/maxent/figures/"
alpha = 0.2
num_grid = 500
phi = np.linspace(-180,180,num_grid)
O = np.ones(num_grid)
colors = ["... | kyleabeauchamp/EnsemblePaper | code/figures/old/plot_ALA3_karplus.py | Python | gpl-3.0 | 1,981 |
''' E-book management software'''
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import sys, os, re, time, random, __builtin__, warnings
__builtin__.__dict__['dynamic_property'] = lambda func: func(None)
from math import floor
from functools im... | jelly/calibre | src/calibre/__init__.py | Python | gpl-3.0 | 22,869 |
from geoalchemy2.types import Geometry
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.ext.declarative import declarative_base
from ThreeDiToolbox.utils.threedi_database import ThreediDatabase
import logging
import os.path
import tempfile
import unittest
log... | nens/threedi-qgis-plugin | tests/test_spatialalchemy.py | Python | gpl-3.0 | 2,234 |
# vim: ts=4:sw=4:expandtab
# -*- coding: UTF-8 -*-
# BleachBit
# Copyright (C) 2008-2021 Andrew Ziem
# https://www.bleachbit.org
#
# 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... | bleachbit/bleachbit | tests/TestWindows.py | Python | gpl-3.0 | 19,770 |
import pytest
import logging
import tempfile
from iotile.core.hw.hwmanager import HardwareManager
from iotile.core.hw.transport.adapter.sync_wrapper import SynchronousLegacyWrapper
from iotile.core.hw.transport import VirtualDeviceAdapter
from iotile.core.utilities import BackgroundEventLoop
from iotile_transport_socke... | iotile/coretools | transport_plugins/socket_lib/test/unix/conftest.py | Python | gpl-3.0 | 2,316 |
# Sample 5
import socket
import sys
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error as msg:
print('Failed to create socket!')
print('Error code: ' + str(msg[0]) + ', error message: ' + msg[1])
sys.exit()
print('Socked created successfully.')
# Part 1
host = ''
port = 8888
try:
s.... | jessicayuen/cmput410-lab2 | sample5.py | Python | gpl-3.0 | 1,165 |
# -*- coding: utf-8 -*-
from setuptools import setup
# There is a problem with unicode characters in setup.cfg under Python 3.5 and 3.6
# See https://github.com/pypa/setuptools/issues/1062
# Try$ LC_ALL=C python3 setup.py --description
setup(author='Vlastimil Zíma')
| ziima/polint | setup.py | Python | gpl-3.0 | 269 |
# -*- coding: utf-8 -*-
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
#
# Tryton documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 23 13:25:32 2010.
#
# This file is execfile()d with the curre... | openlabs/trytond | doc/conf.py | Python | gpl-3.0 | 6,548 |
# -*- coding: utf-8 -*-
'''Verification test taken from example 2-005 of
the SAP 2000 verification manual.'''
__author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)"
__copyright__= "Copyright 2015, LCPT and AOO"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@gmail.com"
# feProblem.setVerbosit... | lcpt/xc | verif/tests/elements/shell/test_shell_mitc4_15.py | Python | gpl-3.0 | 3,522 |
import wx
import eos.db
import gui.mainFrame
from gui import globalEvents as GE
from gui.fitCommands.calc.drone.localAdd import CalcAddLocalDroneCommand
from gui.fitCommands.helpers import InternalCommandHistory, DroneInfo
from service.fit import Fit
class GuiImportLocalMutatedDroneCommand(wx.Command):
def __in... | pyfa-org/Pyfa | gui/fitCommands/gui/localDrone/mutatedImport.py | Python | gpl-3.0 | 1,558 |
# -*- coding: utf-8 -*-
"""
Test script for doctest.
"""
from test import test_support
import doctest
import warnings
# NOTE: There are some additional tests relating to interaction with
# zipimport in the test_zipimport_support test module.
#####################################################################... | mancoast/CPythonPyc_test | cpython/265_test_doctest.py | Python | gpl-3.0 | 77,423 |
#
# BTZen - library to asynchronously access Bluetooth devices.
#
# Copyright (C) 2015-2021 by Artur Wroblewski <wrobell@riseup.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 vers... | wrobell/btzen | btzen/bluez.py | Python | gpl-3.0 | 1,239 |
from electrum.i18n import _
fullname = 'Joinmarket coinjoins'
description = _(" ".join(["Ability to send payments as coinjoins with counterparties.",
"Paying minimal fees, you can immediately send your coins",
"with much better privacy. See https://github.com/joinmar... | AdamISZ/electrum-joinmarket-plugin | joinmarket/__init__.py | Python | gpl-3.0 | 721 |
import os
from django.core.exceptions import ImproperlyConfigured
try:
from plexshowsilencer import configuration
except ImportError:
raise ImproperlyConfigured(
"Configuration file is not present. Please define plexshowsilencer/plexshowsilencer/configuration.py per the documentation."
)
VERSION =... | DirtyCajunRice/PlexShowSilencer | plexshowsilencer/plexshowsilencer/settings.py | Python | gpl-3.0 | 3,863 |
import unittest
from datetime import timedelta, datetime
import sys
import json
sys.path.append("../../config")
sys.path.append("../../html")
import ghObjects
import ghObjectRecipe
class testObjects(unittest.TestCase):
def setUp(self):
# nothin yet
self.test = "rad"
def test_spawnHTML(self):
# arrange
spawn... | pwillworth/galaxyharvester | test/pyunit/testObjects.py | Python | gpl-3.0 | 2,899 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Carlos Cesar Caballero Diaz <ccesar@linuxmail.org>
#
# 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 ve... | cccaballero/services-manager | services-manager.py | Python | gpl-3.0 | 5,938 |
from mididings import *
from launchpad_utils import *
config(
backend='jack-rt',
client_name='launchpad',
in_ports=[
'Pad Keys',
],
out_ports=[
'To Pad',
'To PC',
]
)
# FROM PAD TO PC
# First the controls
active = 0
muted = 127
UpperRow = (Filter(CTRL) >> CtrlValueF... | m4773rcl0ud/launchpaddings | launchpaddings.py | Python | gpl-3.0 | 4,694 |
#!/usr/bin/env python
from circuits import Component, Debugger, Event, handler
from circuits.io.serial import Serial
#from time import sleep
class helloEv(Event):
"""hello Event"""
class SerInput(Component):
def __init__(self, device = '/dev/ttyUSB0'):
super(SerInput, self).__init__()
Serial(... | webhamster/pidart | gamemanager/receive-test-circuits.py | Python | gpl-3.0 | 722 |
# encoding: utf-8
from __future__ import print_function
import collections
import sys
import warnings
# import bcolz
import numpy as np
import tables
import config
from data import (merge_arrays, get_fields, ColumnArray, index_table,
build_period_array)
from expr import (Variable, Var... | benjello/liam2 | liam2/entities.py | Python | gpl-3.0 | 33,581 |
from django.template import RequestContext
from django.shortcuts import render_to_response,get_object_or_404
from django.core.mail import send_mail
from questionnaire.models import *
import re,os
body_template = """
Thank you %s for your sumbission for the %s.
We appreciate your help in improving the OpenShift Mobile... | openshift-mobile/openshift-mobile-app-demo | wsgi/osmdemo/questionnaire/views.py | Python | gpl-3.0 | 2,536 |
from matplotlib import pyplot
import pylab
from mpl_toolkits.mplot3d import Axes3D
import random
fig = pylab.figure()
ax = Axes3D(fig)
sequence_containing_x_vals = range(0,500)
sequence_containing_y_vals = range(0,500)
sequence_containing_z_vals = range(0,500)
random.shuffle(sequence_containing_x_vals)
random.shuff... | sumukharm/Python---Neuroconstruct | integration/plot.py | Python | gpl-3.0 | 504 |
#!/usr/bin/env python
from ethereum.tools import tester
from ethereum.tools.tester import TransactionFailed
from pytest import fixture, mark, raises
@fixture(scope='session')
def testerSnapshot(sessionFixture):
sessionFixture.uploadAndAddToController('solidity_test_helpers/ReentrancyGuardHelper.sol')
Reentran... | AugurProject/augur-core | tests/libraries/test_reentrancy_guard.py | Python | gpl-3.0 | 855 |
__author__ = 'Davide'
import random
from collatz import collatz_len
def main():
R = [random.randint(10 ** 0, 10 ** 10) for _ in range(1000000)]
lenghts = [(x, collatz_len(x)) for x in R]
lenghts.sort(key=lambda x: x[1])
for (x, c) in lenghts[-10:]:
print(c, x)
if __name__ == "__main__":
... | DavideCanton/Python3 | num/collatz/main.py | Python | gpl-3.0 | 326 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# kate: space-indent on; indent-width 4; mixedindent off; indent-mode python;
"""This module provides a general interface to EFI variables using platform-
specific methods. Current Windows and Linux (with sysfs and efivars) are
supported.
Under Windows the pywin32 extensions ... | aroth-arsoft/arsoft-python | python3/arsoft/efi/__init__.py | Python | gpl-3.0 | 4,063 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2018 Jonathan Peirce
# Distributed under the terms of the GNU General Public License (GPL).
"""Utility functions to support Experiment classes
"""
import re
# this needs to be accessed from __str__ method of Param
scriptTarg... | hoechenberger/psychopy | psychopy/experiment/utils.py | Python | gpl-3.0 | 1,018 |
from .constants import Color
class ParsingException(Exception):
def __init__(self, reason=''):
self.reason = reason
def __str__(self):
return Color.BOLD + Color.RED + self.reason + Color.END
| FerreroJeremy/ln2sql | ln2sql/parsingException.py | Python | gpl-3.0 | 218 |
# -*- encoding: utf-8 -*-
"""Unit tests for the Docker feature."""
from fauxfactory import gen_choice, gen_string, gen_url
from nailgun import entities
from random import randint, shuffle
from requests.exceptions import HTTPError
from robottelo.api.utils import promote
from robottelo.constants import DOCKER_REGISTRY_HU... | abalakh/robottelo | tests/foreman/api/test_docker.py | Python | gpl-3.0 | 47,259 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import unittest
from datetime import datetime, timedelta
from yamlns.dateutils import Date
from yamlns import namespace as ns
from .scheduling import (
weekday,
weekstart,
nextweek,
choosers,
Scheduling,
)
class Scheduling_Test(unittest.TestCase):
... | Som-Energia/somenergia-tomatic | tomatic/scheduling_test.py | Python | gpl-3.0 | 24,860 |
#!/usr/bin/env python
import io
import os
import sys
from efesto.Version import version
from setuptools import find_packages, setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
sys.exit()
readme = io.open('README.md', 'r', enco... | getefesto/efesto | setup.py | Python | gpl-3.0 | 1,723 |
import os
import shutil
import tempfile
from crashstats.base.tests.testbase import DjangoTestCase
from crashstats.crashstats.pipelinecompilers import GoogleAnalyticsCompiler
from crashstats import crashstats
SOURCE_FILE = os.path.join(
crashstats.__path__[0], # dir of the module
'static/crashstats/js/socorro... | Tayamarn/socorro | webapp-django/crashstats/crashstats/tests/test_pipelinecompilers.py | Python | mpl-2.0 | 1,590 |
#! /usr/bin/env python
# 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/.
"""
SQLAlchemy models for Socorro
"""
from __future__ import unicode_literals
from sqlalchemy im... | Tayamarn/socorro | socorro/external/postgresql/models.py | Python | mpl-2.0 | 55,980 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2013 Alexandre Bulté <alexandre[at]bulte[dot]net>
#
# 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/.
from fl... | abulte/Flask-Bootstrap-Fanstatic | application/__init__.py | Python | mpl-2.0 | 730 |
# 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/.
from marionette_driver.by import By
from marionette_harness import MarionetteTestCase
class TestPosition(MarionetteTe... | Yukarumya/Yukarum-Redfoxes | testing/marionette/harness/marionette_harness/tests/unit/test_position.py | Python | mpl-2.0 | 664 |
from django.contrib import messages
from django.shortcuts import render
from app.plugins import PluginBase, Menu, MountPoint
from django.contrib.auth.decorators import login_required
from django import forms
from plugins.openaerialmap.api import Info, Share
class TokenForm(forms.Form):
token = forms.CharField(l... | pierotofy/WebODM | plugins/openaerialmap/plugin.py | Python | mpl-2.0 | 2,293 |
import pytest
from shelver.image import Image
from shelver.provider.test import TestProvider
@pytest.fixture
def provider():
return TestProvider({})
@pytest.fixture
def images():
return {
'fedora': Image.from_dict({
'name': 'fedora',
'current_version': '25',
'envi... | Cobliteam/shelver | shelver/test/conftest.py | Python | mpl-2.0 | 2,676 |
#
# Copyright 2017 Sangoma Technologies Inc.
#
# 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/.
"""
Handy utilities
"""
from builtins import map
import os
import string
... | sangoma/pytestlab | lab/utils.py | Python | mpl-2.0 | 1,650 |
# member/apps.py
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class MemberConfig(AppConfig):
name = 'person'
verbose_name = _('Personal Info')
| neuromat/nira | person/apps.py | Python | mpl-2.0 | 199 |
import parsley
_grammar = r"""
parse = pair:head (' '+ pair)*:tail -> dict([head] + tail)
pair = ident:i '=' value:v -> (i, v)
ident = <letter letterOrDigit*>
value = string | regex | number | word
string = '"' (escapedChar | ~'"' anything)*:c '"' -> ''.join(c)
| "'" (escapedChar | ~"'" anything)*:c "'" -> ''.... | hamperbot/factoids2 | hamper_factoids/parser.py | Python | mpl-2.0 | 1,049 |
# Copyright 2009-2010 Doug Orleans. Distributed under the GNU Affero
# General Public License v3. See COPYING for details.
from google.appengine.api import urlfetch
import urllib
from xml.dom import minidom
import time
mbns = 'http://musicbrainz.org/ns/mmd-1.0#'
extns = 'http://musicbrainz.org/ns/ext-1.0#'
# Since... | dougo/chugchanga-poll | musicbrainz.py | Python | agpl-3.0 | 3,581 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016-2017 Ircam
# Copyright (c) 2016-2017 Guillaume Pellerin
# Copyright (c) 2016-2017 Emilie Zawadzki
# This file is part of mezzanine-organization.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | Ircam-Web/mezzanine-organization | organization/job/test/tests.py | Python | agpl-3.0 | 10,376 |
# Copyright 2010, 2012 Canonical Ltd. This software is licensed under
# the GNU Affero General Public License version 3 (see the file
# LICENSE).
import logging
import re
from datetime import datetime
from django.core.validators import validate_email
from django.db import models
from django.utils.translation import... | miing/mci_migo | identityprovider/models/emailaddress.py | Python | agpl-3.0 | 4,191 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-03-11 21:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('parking', '0007_auto_20170311_2028'),
]
operations = [
migrations.AlterFiel... | Mandrilux/GOC_2017 | api/polydevs/parking/migrations/0008_auto_20170311_2109.py | Python | agpl-3.0 | 1,364 |
# -*- coding:Utf-8 -*-
from mongoengine import EmbeddedDocument, fields
__all__ = (
'ReminderEntry',
'ReminderSettings',
)
class ReminderEntry(EmbeddedDocument):
"""
Per-event reminders settings
"""
METHODS = (
'EMAIL',
'POPUP'
)
method = fields.StringField(choices... | Naeka/vosae-app | www/organizer/models/embedded/reminder.py | Python | agpl-3.0 | 830 |
# -*- 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.
# ###
from __future__ import print_function
import os
import sys
import psycopg2
__all__ = ('DB_CONNECTION_STR... | Connexions/cnx-upgrade | cnxupgrade/tests/__init__.py | Python | agpl-3.0 | 2,755 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/OSIS-Louvain | base/tests/models/test_session_exam_calendar.py | Python | agpl-3.0 | 14,621 |
# -*- encoding: utf-8 -*-
import time
import logging
from openerp import tools
from dateutil.relativedelta import relativedelta
from datetime import datetime, timedelta
from openerp.tools.translate import _
from openerp.osv import fields,osv
import json
import hashlib
from openerp.addons.ebiz_cn.top import setDefaultA... | vnsofthe/odoo-dev | addons/ebiz_cn/ebiz.py | Python | agpl-3.0 | 45,688 |
# The Hazard Library
# Copyright (C) 2013-2022 GEM Foundation
#
# 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 later version.
#... | gem/oq-engine | openquake/hazardlib/source/non_parametric.py | Python | agpl-3.0 | 10,119 |
"""
Tests for Discussion API serializers
"""
from __future__ import absolute_import
import itertools
import ddt
import httpretty
import mock
import six
from django.test.client import RequestFactory
from six.moves.urllib.parse import urlparse # pylint: disable=import-error
from lms.djangoapps.discussion.django_comme... | ESOedX/edx-platform | lms/djangoapps/discussion/rest_api/tests/test_serializers.py | Python | agpl-3.0 | 34,613 |
from . import test_purchase_order_line_description_picking
| OCA/purchase-workflow | purchase_order_line_description_picking/tests/__init__.py | Python | agpl-3.0 | 59 |
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Julius Network Solutions SARL <contact@julius.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under th... | noemis-fr/old-custom | product_tags/product.py | Python | agpl-3.0 | 1,476 |
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Partner Identification - BPJS",
"version": "8.0.1.0.0",
"author": "OpenSynergy Indonesia",
"website": "https://opensynergy-indonesia.com",
"license": "AGPL-3",
... | open-synergy/opnsynid-l10n-indonesia | l10n_id_partner_identification_bpjs/__openerp__.py | Python | agpl-3.0 | 635 |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('rdrf', '0013_auto_20151201_1410'),
]
operations = [
migrations.CreateModel(
name='RDRFContex... | muccg/rdrf | rdrf/rdrf/migrations/0014_rdrfcontext.py | Python | agpl-3.0 | 1,093 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) 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.
#
# This program is distributed in the hope that it will ... | tic-ull/defensatfc-proto | tfc_webapps/packages/suds-timestamp/suds/xsd/sxbasic.py | Python | agpl-3.0 | 31,569 |
"""split gsm signal in two analytics, one per sim card
Revision ID: 31d36774c549
Revises: 528f90a47515
Create Date: 2019-01-23 15:16:58.514742
"""
# revision identifiers, used by Alembic.
revision = '31d36774c549'
down_revision = '528f90a47515'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.... | rootio/rootio_web | alembic/versions/31d36774c549_first_and_second_sim.py | Python | agpl-3.0 | 673 |
# This file is part of Maker Keeper Framework.
#
# Copyright (C) 2017-2018 reverendus
# Copyright (C) 2018 bargst
#
# 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... | makerdao/keeper | pymaker/numeric.py | Python | agpl-3.0 | 14,935 |
import pytest
import datetime
from django.template import Context
from django.template import Engine
from django.template import Template
from django.template import TemplateDoesNotExist
from django.urls import reverse
from django.core.files.uploadedfile import SimpleUploadedFile
from planotrabalho.models import Plan... | culturagovbr/sistema-nacional-cultura | gestao/tests/test_componentes.py | Python | agpl-3.0 | 11,165 |
# Copyright 2012, 2013 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for `MAASTestCase`."""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ = type
__all__ = []
... | cloudbase/maas | src/maastesting/tests/test_testcase.py | Python | agpl-3.0 | 2,071 |
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2015-2019 by Inteos Sp. z o.o.
# All rights reserved. See LICENSE file for details.
#
from __future__ import unicode_literals
import copy
from django import forms
from django.forms import fields
INTERVALS = (
('seconds', 'Seconds'),
('minutes', 'Minutes'),
('ho... | inteos/IBAdmin | libs/forms.py | Python | agpl-3.0 | 5,342 |
"""
Implementation of custom django template tags for
automatically caching template fragments.
"""
from django import template
from django.core.cache import cache
from django.template import Node, TemplateSyntaxError, Variable
from django.template import resolve_variable # lint-amnesty, pylint: disable=no-name-in-m... | stvstnfrd/edx-platform | openedx/core/djangoapps/cache_toolbox/templatetags/cache_toolbox.py | Python | agpl-3.0 | 2,618 |
# -*- coding: utf-8 -*-
# © 2004-2009 Tiny SPRL (<http://tiny.be>).
# © 2015 Agile Business Group <http://www.agilebg.com>
# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html).
import os
import shutil
import tempfile
import traceback
from... | eezee-it/server-tools | auto_backup/models/db_backup.py | Python | agpl-3.0 | 10,250 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2016 GEM Foundation
#
# OpenQuake 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... | vup1120/oq-hazardlib | openquake/hazardlib/scalerel/__init__.py | Python | agpl-3.0 | 3,196 |
from collections.abc import Sequence
from contextlib import contextmanager
from datetime import datetime
from difflib import Differ
import inspect
from itertools import product
import json
import multiprocessing
import operator
import os
from pathlib import Path
import pydoc
import re
import shlex
import shutil
import ... | TheBB/badger | grevling/__init__.py | Python | agpl-3.0 | 38,535 |
# -*- coding: utf-8 -*-
# ###
# Copyright (c) 2013-2016, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
from pyramid import httpexceptions
from pyramid.view import view_config
from ..db import poke_publica... | Connexions/cnx-publishing | cnxpublishing/views/moderation.py | Python | agpl-3.0 | 3,154 |
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
def handle(self, *args, **kwargs):
from alcide.personnes.models import Holiday
from alcide.ressources.models import Service
all_services = list(Service.objects.all())
for holiday in Holi... | ZTH1970/alcide | alcide/personnes/management/commands/fix-group-holiday-services.py | Python | agpl-3.0 | 450 |
# -*- encoding: UTF-8 -*-
#
# Copyright 2014-2015
#
# STIC-Investigación - Universidad de La Laguna (ULL) <gesinv@ull.edu.es>
#
# This file is part of Portal del Investigador.
#
# Portal del Investigador is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero Gen... | tic-ull/portal-del-investigador | core/tests/test_user.py | Python | agpl-3.0 | 1,261 |
#!/usr/bin/env python
import sys
from os.path import normpath, join, dirname, abspath
machine_file = normpath(join(dirname(abspath(__file__)),
'../files/machine-images.csv'))
def read_machine_file():
amis = {}
with open(machine_file) as fp:
for l in fp:
type... | Cadasta/cadasta-platform | deployment/scripts/ami.py | Python | agpl-3.0 | 1,182 |
# -*- coding: utf-8 -*-
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils.text import Truncator
from django.utils.html import strip_tags
import os
from account.models import User
from tag.models import Tag
from dateo.models import Dateo
from campaign.models im... | lafactura/datea-api | datea_api/apps/seo/views.py | Python | agpl-3.0 | 5,300 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
#
# 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
#... | MostlyOpen/odoo_addons | myo_summary/models/annotation.py | Python | agpl-3.0 | 1,419 |