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 |
|---|---|---|---|---|---|
import unittest
from mock import MagicMock
import sys
sys.path.insert(0, "..")
from pysmear.smear_utils import SmearUtils as utils
from pysmear.card_counting import CardCounting
import pydealer
class TestSafeToPlay(unittest.TestCase):
def setUp(self):
self.cc = CardCounting(num_players = 4)
self.... | mkokotovich/pysmear | tests/test_card_counting.py | Python | gpl-3.0 | 5,165 |
import itertools
import logging
import urllib.parse
from datetime import timedelta, datetime, date
import requests
from django.conf import settings
from django.contrib import messages
from django.core.exceptions import PermissionDenied
from django.utils.translation import gettext_lazy as _
from django.views.generic im... | ChantyTaguan/zds-site | zds/tutorialv2/views/statistics.py | Python | gpl-3.0 | 10,353 |
from twisted.internet import defer
from moira.api.request import delayed
from moira.api.resources.redis import RedisResource
class Login(RedisResource):
def __init__(self, db):
RedisResource.__init__(self, db)
self.putChild("settings", Settings(db))
@delayed
def render_GET(self, request... | moira-alert/worker | moira/api/resources/user.py | Python | gpl-3.0 | 1,046 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''Pychemqt, Chemical Engineering Process simulator
Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Softwar... | jjgomera/pychemqt | lib/mEoS/R152a.py | Python | gpl-3.0 | 39,124 |
from enum import IntEnum
import logging
import os
from django.conf import settings as main_settings
from django.db import models
from django.db.models import Q
from django.utils import timezone as tz
from django.utils.translation import gettext_lazy as _
from taggit.managers import TaggableManager
from aircox import... | lordblackfox/aircox | aircox/models/sound.py | Python | gpl-3.0 | 8,350 |
from test import support
import enum
import locale
import platform
import sys
import sysconfig
import time
import unittest
try:
import threading
except ImportError:
threading = None
try:
import _testcapi
except ImportError:
_testcapi = None
# Max year is only limited by the size of C int.
SIZEOF_INT =... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/test/test_time.py | Python | gpl-3.0 | 38,764 |
#!/usr/bin/env python
"""
Exports various methods used to initialize motion configuration. These methods
have been moved to this seperate module to reduce issues when the motion API
changes. All changes should be in just this module.
"""
import logger
from mutex_parsers import *
import os
log = logger.Logger('kmoti... | dvor85/kmotion | core/init_motion.py | Python | gpl-3.0 | 11,843 |
import pdb
import datetime
from .models import AnnounceType, Announce
from sched_core.sched_log import sched_log
from sched_core .const import DAY
from sched_core .config import TZ_LOCAL, local_time_str
from .config import AnnounceChannel, channel_name
from .config_func ... | sjaa/scheduler | sched_announce/gen.py | Python | gpl-3.0 | 5,734 |
# tPythonStep.py: Test python DPPP class
# Copyright (C) 2015
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of... | jjdmol/LOFAR | CEP/DP3/PythonDPPP/test/tPythonStep.py | Python | gpl-3.0 | 3,123 |
import csv
import sys
from phyltr.commands.base import PhyltrCommand
from phyltr.plumbing.sinks import NullSink
from phyltr.utils.misc import dicts_from_csv
class Annotate(PhyltrCommand):
"""Annotate a the trees in a tree stream with information from a file"""
__options__ = [
(
('-e', '--... | lmaurits/phyltr | src/phyltr/commands/annotate.py | Python | gpl-3.0 | 4,014 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | V155/qutebrowser | tests/helpers/utils.py | Python | gpl-3.0 | 5,712 |
import os
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
from MyConfig import MyConfig
from Utilities import debug_msg
class Initialization:
class __Initialization:
app = None
db = None
config = MyConfig()
def global_create_app(self, name, db_pat... | pipicold/BlockyTime | server_new/Initialization.py | Python | gpl-3.0 | 1,720 |
from driverpower import __version__
from setuptools import setup, find_packages
setup(
name='DriverPower',
version=__version__,
author='Shimin Shuai',
author_email='sshuai@oicr.on.ca',
url='https://github.com/smshuai/DriverPower',
license='GPL',
python_requires='>= 3.5.2',
packages=find... | smshuai/DriverPower | setup.py | Python | gpl-3.0 | 880 |
# ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM 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 Founda... | mmariani/dream | dream/simulation/MachineManagedJob.py | Python | gpl-3.0 | 11,355 |
'''Use tap function to build data in loop'''
'''f='/mnt/nfs/comeg2/0611/tap/01%01%01@01:01/1/c,rfDC'
ch=channel.index(f, 'ext')
t=tapbuild.get(f,f)
t.avg(700, ch)'''
# Copyright 2008 Dan Collins
#
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | badbytes/pymeg | pdf2py/tapbuild.py | Python | gpl-3.0 | 9,756 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-18 02:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('overseas', '0015_auto_20160918_0011'),
]
operations = [
migrations.AlterField... | nevermoreluo/privateoverseas | overseas/migrations/0016_auto_20160918_1038.py | Python | gpl-3.0 | 638 |
get_ipython().magic("run 'symbols.py'")
df = nm('/home/naumov/w/ogs/build/bin/ogs')
count_equal(df)
cost_by_count_and_size(df)
libs = nm('/home/naumov/w/ogs/build/lib/libApplicationsLib.a')
lib_files=['/home/naumov/w/ogs/build/lib/libApplicationsLib.a', '/home/naumov/w/ogs/build/lib/libAssemblerLib.a', '/home/naumov/w/... | endJunction/CppDevTools | object_analysis/tmp.py | Python | gpl-3.0 | 1,006 |
"""
# This 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. #
# ... | gaboth22/find_my_course | find_course.py | Python | gpl-3.0 | 10,562 |
'''
adm.py - this file is part of S3QL (http://s3ql.googlecode.com)
Copyright (C) 2008-2009 Nikolaus Rath <Nikolaus@rath.org>
This program can be distributed under the terms of the GNU GPLv3.
'''
from __future__ import division, print_function, absolute_import
from . import CURRENT_FS_REV, REV_VER_MAP
from .backends... | thefirstwind/s3qloss | src/s3ql/adm.py | Python | gpl-3.0 | 12,482 |
import numpy as np
import cv2
import time
windows = [(64, 128), (128, 128), (128, 64)]
def pyramid(image, scale=1.5, minSize=(20, 20)):
# yield the original image
# yield image
# keep looping over the pyramid
while True:
# compute the new dimensions of the image and resize it
w = int... | evamy/learning_to_see | VA4/utils.py | Python | gpl-3.0 | 2,358 |
#!/usr/bin/env python3
## TODO(alexr): We need to get these run through the whole preprocessing
## pipeline so we can evaluate the semeval test set.
## We need to be able to call freeling programmatically.
## And probably also cdec's tokenizer.
## XXX: magic string pointing into my files on my one particular comput... | alexrudnick/chipa | src/preprocessing.py | Python | gpl-3.0 | 2,570 |
# -*- coding: UTF-8 -*-
#author: James Zo
#email: james_email@sina.cn
import MySQLdb
from py.db import *
class Mysql(DB):
def __init__(self, host, user, passwd, port=3306):
self._conn = MySQLdb.connect(
host=host,
port = port,
user=user,
p... | jameszo/kit | py/mysql.py | Python | gpl-3.0 | 384 |
# ! /usr/bin/env python
# _*_ coding:utf-8 _*_
"""
@author = lucas.wang
@create_time = 2018-03-15
"""
# 引入selenium中的webdriver
from bs4 import BeautifulSoup
from selenium import webdriver
import time
from multiprocessing.dummy import Pool, Lock, freeze_support
import os
import sys
import json
def input_page_url_with_... | Lucas-Wong/ToolsProject | Crawler/xmly-2.py | Python | gpl-3.0 | 5,214 |
from duckomatic.utils.resource import Resource
class Gps(Resource):
def __init__(self, *vargs, **kwargs):
super(Gps, self).__init__(*vargs, **kwargs)
self.count = 0
self.latitude = 49.289324
self.longitude = -123.129219
def get_message_to_publish(self):
self.count += ... | morgangalpin/duckomatic | duckomatic/platform/resources/gps.py | Python | gpl-3.0 | 619 |
import pilas
import json
from pilas.escena import Base
class Individual(Base):
def iniciar(self):
archivo = open("data/archivos/usuarios.json","r")
self.datos_usuarios = json.load(archivo)
archivo.close()
archivo1 = open("data/archivos/estadisticas.json","r")
self.datos_estadisticas = json.l... | gercordero/va_de_vuelta | src/individual.py | Python | gpl-3.0 | 6,051 |
from __future__ import print_function
import httplib2
import os
import re
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
from DateTime import DateTime
import base64
import email
import csv
import pandas as pd
global mail_SNIPPET
glo... | Mayurji/Machine-Learning | Email Classification Using ML/Email_Classifier.py | Python | gpl-3.0 | 6,955 |
import logging
indexerLogFile = 'indexer.log'
indexerlogFormat = '%(asctime)s - %(levelname)s - %(message)s'
indexerLogLevel = logging.WARNING
indexWorkerNumber = 4
indexFolders = ['D:\\Repository\\R_2_10_0\\doc\\examples\\service\\MS_LTE']
solrURL = 'http://135.251.142.115:8983/solr/myworkspace'
| zhongzhu/searchmyworkspace | src/myconfig.py | Python | gpl-3.0 | 300 |
#!/usr/bin/env python3
import numpy as np
def diamond(n):
temp = np.eye(n, dtype=int)
fliped = np.fliplr(temp)
concat = np.concatenate((np.fliplr(temp), temp), axis=1)
concat = np.delete(concat, n, 1)
reverse_flipped= np.flip(concat)
return np.concatenate((concat, np.flip(concat)[1:,]))
d... | mohanprasath/Course-Work | data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part02-e13_diamond/src/diamond.py | Python | gpl-3.0 | 379 |
"""
Description: A module that represents "spots" on the skewer.
Author: Sean Strout
Author: James Heliotis
Author: Jon O'Brien
"""
import food
class NoneNode():
"""A class to represent no node"""
__slots__ = ()
"""A global constant for no node"""
NONE_NODE = NoneNode()
class KebabSpot(object):
"""... | jonobrien/School_Backups | cs1-python/Labs/week 9/kebab_spot.py | Python | gpl-3.0 | 3,998 |
import requests
user_auth = ('natas30','wie9iexae0Daihohv8vuu3cei9wahf0e')
target = 'http://natas30.natas.labs.overthewire.org/index.pl'
payload = 'username=natas31&password=2&password=1\' OR 1=1&password=2'
payload2 = 'username=natas31&password=1'
payload3 = "username='natas31' OR '1'='1'&username=3&password='1'"... | lcy2/otwPython | natas30/natas30.py | Python | gpl-3.0 | 516 |
# URL
# https://www.hackerrank.com/challenges/sock-merchant
import unittest
def main():
data = readFromStdin()
print(sock_pairs(data))
def readFromStdin():
_ = int(input().strip())
data = [int(c_temp) for c_temp in input().strip().split(' ')]
return data
def sock_pairs(data):
sdic = {}
pa... | tuergeist/HackerRank | challenges/sock_merchant.py | Python | gpl-3.0 | 769 |
"""
Performance test created using multi-mechnize to analyze time
for query processing with MySQL.
"""
import random
import time
from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB
class Transaction(object):
def __init__(self):
self.JobDB = JobDB()
self.custom_timers = {}
def run(sel... | DIRACGrid/DIRAC | tests/Performance/MySQLJobMonitoring/test_scripts/query.py | Python | gpl-3.0 | 711 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import zipfile
from flask import url_for, render_template
from mini_fiction.utils import misc
class BaseDownloadFormat(object):
extension = None
name = None
content_type = 'application/octet-stream'
debug_content_type = 'text/plain; charset=utf... | andreymal/mini_fiction | mini_fiction/downloads/base.py | Python | gpl-3.0 | 3,025 |
# Custom markers for robottelo tests
def pytest_configure(config):
"""Register custom markers to avoid warnings."""
markers = [
"deselect(reason=None): Mark test to be removed from collection.",
"skip_if_open(issue): Skip test based on issue status.",
"tier1: Tier 1 tests", # CRUD tes... | rplevka/robottelo | pytest_plugins/markers.py | Python | gpl-3.0 | 1,342 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import random
x = random.randint(1,10)
y = random.choice(["jablka", "hrušky", "třešně", "švestky", "angrešt"])
print("Náhodné číslo: ", x)
print("Náhodná položka: ", y)
| rludva/katara | python/kihon/fceRandom.py | Python | gpl-3.0 | 226 |
import numpy as np
import scipy.special as sps
import matplotlib.pyplot as plt
from pylab import rcParams
def make_beta(zer, gam):
return lambda x: 1.0 / (np.pi * gam * (1 + (x - zer / gam) ** 2))
def main():
rcParams['figure.figsize'] = 8, 6
# figure(num=None, facecolor='w', edgecolor='k')
ax = pl... | octoalmawaukh/math-waffle | work in progress/## 60 list of probability distributions/imgsrc/pdf_cauchy.py | Python | gpl-3.0 | 825 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# title : rescale.py
# description : Normalize data into a defined range/type
# copyright : (c) 2017 I3MTO laboratory. All Rights Reserved
# author(s) : Thomas Janvier
# creation : 01 December 2017
# modification : 17 December 2017
#
#... | Bone-Imaging-ToolKit/BItk | bitk/core/rescale.py | Python | gpl-3.0 | 2,205 |
__author__ = 'Sergey Tomin'
import sys
import matplotlib
from ocelot.rad import *
from ocelot.gui import *
from ocelot import *
from ocelot.rad.radiation_py import *
from ocelot.rad.undulator_params import *
import copy
sigma_tau = 100e-6/2.36
tau_p_cor = 0.013/2.36
tau = np.array([-1, 0, 1])*sigma_tau
phi = tau/1.... | ocelot-collab/ocelot | demos/sr/coherent_rad.py | Python | gpl-3.0 | 1,014 |
"""Tests for the Docker feature.
:Requirement: Docker
:CaseAutomation: Automated
:CaseLevel: Component
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from random import choice
from random import randint
import pytest
from fauxfactory import gen_string
from fauxfactory import gen_url
from wait_for ... | jyejare/robottelo | tests/foreman/cli/test_docker.py | Python | gpl-3.0 | 62,994 |
"""
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import argparse
import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib.animation as animation
_S_THK = 1.1
_D_DIA = 120
WDY_MAX_POSITION = 30000
WDY_STRAP_DEAD_OFFS... | exmachina-dev/WDY-firmware | tools/graph_spiral.py | Python | gpl-3.0 | 1,683 |
####################################################################################################
#
# 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/__init__.py | Python | gpl-3.0 | 1,070 |
#
# Copyright (C) 2013,2014,2015,2016 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... | tbereau/espresso | samples/python/minimal-polymer.py | Python | gpl-3.0 | 1,764 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
#
# Copyright (C) Bitergia
#
# 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... | sanacl/GrimoireELK | grimoire/elk/kitsune.py | Python | gpl-3.0 | 8,313 |
###########################################################################
#
# Copyright (c) 2010 Davide Pesavento <davidepesa@gmail.com>
#
# This file is part of FORSE.
#
# FORSE 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 ... | Pesa/forse | src/forse/weather_station/WeatherModel.py | Python | gpl-3.0 | 4,250 |
# -*- coding: utf-8 -*-
#
# Grid cell modeling and data analysis documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 31 21:47:10 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
... | MattNolanLab/ei-attractor | doc/conf.py | Python | gpl-3.0 | 11,016 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from builtins import range
import warnings
import unittest
import sys
import itertools as it
import copy
import time
import math
import logging
import os.path
import os
import shutil
import contextlib
try:
... | ViennaRNA/forgi | test/forgi/threedee/model/coarse_grain_test.py | Python | gpl-3.0 | 34,193 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'hackYourOwn.ui'
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, tex... | jithinbp/pslab-desktop-apps | psl_res/GUI/E_MISCELLANEOUS/B/templates/hackYourOwn.py | Python | gpl-3.0 | 4,707 |
# -*- coding: utf-8 -*-
'''
DynamoDB KeyConditionExpression and FilterExpression
http://boto3.readthedocs.io/en/stable/reference/customizations/dynamodb.html#ref-dynamodb-conditions
'''
from __future__ import print_function
from decimal import Decimal
from boto3.dynamodb.conditions import Key, Attr
from .errors impo... | gusibi/dynamodb-py | dynamodb/expression.py | Python | gpl-3.0 | 9,252 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import calendar
from frappe import _
from frappe.desk.form import assign_to
from dateutil.relativedelta import relativedel... | mbauskar/erpnext | erpnext/subscription/doctype/subscription/subscription.py | Python | gpl-3.0 | 7,116 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2017 Vincent Noel (vincent.noel@butantan.gov.br)
#
# This file is part of libSigNetSim.
#
# libSigNetSim 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... | vincent-noel/libSigNetSim | libsignetsim/model/sbml/RuledVariable.py | Python | gpl-3.0 | 1,666 |
#standard packages
import pandas as pd
import numpy as np
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
matplotlib.use('Agg')
import sqlite3
import pickle
import re
from flask import json
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import TfidfVectorize... | discipl/NAML | app/ml_model_v1.py | Python | gpl-3.0 | 14,098 |
from django.db import models
from django.contrib.auth.models import User
class Announcement(models.Model):
author = models.ForeignKey(
User,
related_name='+',
verbose_name='Reporter'
)
title = models.CharField(
verbose_name='Title',
max_length=256
)
create... | freieslabor/info-display | info_display/screens/announcer/models.py | Python | mpl-2.0 | 498 |
# -*- coding: utf-8 -*-
"""Tests for the Source class."""
from __future__ import unicode_literals
import mock
import pytest
from kuma.scrape.sources import Source
from . import mock_requester, mock_storage
class FakeSource(Source):
"""A Fake source for testing shared Source functionality."""
PARAM_NAME = ... | jwhitlock/kuma | kuma/scrape/tests/test_source.py | Python | mpl-2.0 | 9,151 |
# -*- coding: utf-8 -*-
'''
Library for JSON RPC 2.0 and BSON RPC
'''
from bsonrpc.exceptions import BsonRpcError
from bsonrpc.framing import (
JSONFramingNetstring, JSONFramingNone, JSONFramingRFC7464)
from bsonrpc.interfaces import (
notification, request, rpc_notification, rpc_request, service_class)
from bs... | seprich/py-bson-rpc | bsonrpc/__init__.py | Python | mpl-2.0 | 843 |
# -*- coding: utf-8 -*-
params = {
'volume': 19,
'title': u'全新影音平台「Firefox Vision 狐電視」正式上線、Firefox OS App 開發入門系列影片 (中文字幕)',
}
| elin-moco/bedrock | bedrock/newsletter/templates/newsletter/2014-04-14/config.py | Python | mpl-2.0 | 191 |
# 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 pytest
from pages.firefox.new.download import DownloadPage
# ?v=a param added temporarily to evade a traffic co... | ericawright/bedrock | tests/functional/firefox/new/test_download.py | Python | mpl-2.0 | 1,718 |
# 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/.
"""This is an extension to configman for Socorro. It creates a ValueSource
object that is also a 'from_string_converter... | willkg/socorro-collector | collector/app/for_application_defaults.py | Python | mpl-2.0 | 3,980 |
#!/usr/bin/env python
#
# Copyright (c) 2011-2013, Shopkick Inc.
# All rights reserved.
#
# 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/.
#
# ---
# Author: John Egan <jw... | shopkick/flawless | flawless/lib/config/__init__.py | Python | mpl-2.0 | 530 |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# 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/.
# ***** END LICENSE BLOCK *****
import os
import re
from mozhar... | cstipkovic/spidermonkey-research | testing/mozharness/mozharness/mozilla/testing/unittest.py | Python | mpl-2.0 | 12,660 |
# 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 import Wait
from firefox_ui_harness.decorators import skip_if_e10s, skip_under_xvfb
from firefox... | sr-murthy/firefox-ui-tests | firefox_ui_tests/remote/security/test_ssl_status_after_restart.py | Python | mpl-2.0 | 4,773 |
# vim: fileencoding=utf-8 et ts=4 sts=4 sw=4 tw=0
"""
Base RPC client class
Authors:
* Brian Granger
* Alexander Glyzov
* Axel Voitier
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2012-2014. Brian Granger, Min Ragan-Kelley, Alexander Glyzov,
# Axel Voitier
#
#... | Alidron/demo-nao | alidron-env/lib/python2.7/site-packages/netcall/base_client.py | Python | mpl-2.0 | 6,703 |
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
import re
from collections import OrderedDict
from webob.multidict import MultiDict
from zope.interface import implementer
from pyramid.view import view_config
import ... | ecreall/pontus | pontus/view.py | Python | agpl-3.0 | 12,126 |
# -*- coding: utf-8 -*-
import time
import datetime
from report import report_sxw
class diseases_report(report_sxw.rml_parse):
_name = 'report.patient.diseases'
def __init__(self, cr, uid, name, context):
super(diseases_report, self).__init__(cr, uid, name, context=context)
sel... | eneldoserrata/marcos_openerp | oemedical/hms_lite/medical/report/patient_diseases.py | Python | agpl-3.0 | 554 |
############################################################################
#
# Copyright (C) 2013 tele <tele@rhizomatica.org>
#
# REST API Interface to RCCN Modules
# This file is part of RCCN
#
# RCCN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License as pub... | saycel/saycel | rccn/rapi.py | Python | agpl-3.0 | 19,438 |
# https://eli.thegreenplace.net/2009/03/07/computing-modular-square-roots-in-python
def modular_sqrt(a, p):
""" Find a quadratic residue (mod p) of 'a'. p
must be an odd prime.
Solve the congruence of the form:
x^2 = a (mod p)
And returns x. Note that p - x is also a root.
... | aweinstock314/aweinstock-ctf-writeups | cccamp_2019/prejudiced/bendersky_modsqrt.py | Python | agpl-3.0 | 2,433 |
# Copyright (C) 2010 Wil Mahan <wmahan+fatics@gmail.com>
#
# This file is part of FatICS.
#
# FatICS 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 optio... | ecolitan/fatics | src/session.py | Python | agpl-3.0 | 5,365 |
from flask import Blueprint, render_template, abort, request, jsonify
from sqlalchemy import func, distinct
from skylines.database import db
from skylines.lib.dbutil import get_requested_record
from skylines.lib.vary import vary
from skylines.model import User, Club, Flight, Airport
statistics_blueprint = Blueprint('... | kerel-fs/skylines | skylines/frontend/views/statistics.py | Python | agpl-3.0 | 2,573 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | ecino/compassion-switzerland | partner_communication_switzerland/models/partner_communication.py | Python | agpl-3.0 | 28,550 |
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
def page_filters_validator(val):
if not isinstance(val, dict):
raise ValidationError
if not all(isinstance(v, list) for v in val.values()):
raise ValidationError
if not all(isinstance(v,... | amcat/amcat-dashboard | dashboard/util/validators.py | Python | agpl-3.0 | 1,205 |
# -*- coding: utf-8 -*-
from copy import deepcopy
from datetime import datetime
import os
from pprint import pprint
from dlstats.fetchers.insee import INSEE as Fetcher
from dlstats import constants
import unittest
from unittest import mock
import httpretty
from dlstats.tests.fetchers.base import BaseFetcherTestCase... | Widukind/dlstats | dlstats/tests/fetchers/test_insee.py | Python | agpl-3.0 | 13,284 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'd2w#o#(!antcw5e%(#p5*pu(x=zhw60^byh$)ps+4#e8m#-fj!'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = TEMPLATE_DEBUG = True
ALLOWE... | GISAElkartea/amv2 | antxetamedia/settings.py | Python | agpl-3.0 | 4,765 |
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api
DIGITS = (16, 2)
class ReportJournalLedger(models.TransientModel):
_name = 'report_journal_ledger'
date_from = fields.Date(
required=True
)
date_to = fields.Da... | BT-astauder/account-financial-reporting | account_financial_report/report/journal_ledger.py | Python | agpl-3.0 | 24,510 |
from django.apps import AppConfig
class ChangeanalysisConfig(AppConfig):
name = 'diffanalysis'
| Cartocite/osmada | diffanalysis/apps.py | Python | agpl-3.0 | 101 |
#!/usr/bin/env python3
from tja_info import *
from sys import argv, stderr
if __name__ == '__main__':
info = None
parse_level = 3
try:
parse_level = TJAInfo.parse_course(argv[2])
except:
pass
for codec in ['utf-8', 'shift-jis', 'gbk']:
try:
with open(argv[1], e... | Saren-Arterius/textage2bms | tja2bms.py | Python | agpl-3.0 | 3,766 |
# Copyright 2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Figure out server address for the maas_url setting."""
from __future__ import (
absolute_import,
print_function,
unicode_literals,
)
str = None
__metaclass__ ... | cloudbase/maas | src/metadataserver/address.py | Python | agpl-3.0 | 2,953 |
# Copyright © 2017 Tom Hacohen
#
# 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, version 3.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY;... | etesync/journal-manager | journal/apps.py | Python | agpl-3.0 | 700 |
from paste.deploy.converters import asbool
from pylons import tmpl_context as c, config
from adhocracy.lib.auth.authorization import has
from adhocracy.lib.auth.authorization import NOT_LOGGED_IN
def index(check):
check.perm('user.view')
def show(check, u):
check.perm('user.view')
check.other('user_dele... | SysTheron/adhocracy | src/adhocracy/lib/auth/user.py | Python | agpl-3.0 | 1,569 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-present Taiga Agile LLC
#
# 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 ver... | taigaio/taiga-back | taiga/importers/management/commands/import_from_trello.py | Python | agpl-3.0 | 4,032 |
# Migmig Constant variables
# Usually, constants are defined at module level ...
OK = '200'
DONE = '199'
UNKNOWN = '666'
UNKNOWN_HEADER = '667'
BAD_IDENTIFIER = '97'
BAD_URL = '98'
NOT_FOUND = '404'
RANGE_NOT_SUPPORTED = '198'
| dotamin/migmig | server/constants.py | Python | agpl-3.0 | 232 |
import ConfigParser
import smtplib, email, email.encoders, email.mime.text, email.mime.base
import string
config = ConfigParser.ConfigParser()
config.read('/etc/chronojump.conf')
def user_comments_from_log(log):
user_comment_separator = "----------"
if log.startswith(user_comment_separator):
text = l... | GNOME/chronojump-server | email_error_log.py | Python | agpl-3.0 | 2,145 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | jmesteve/saas3 | openerp/addons/mail/mail_thread.py | Python | agpl-3.0 | 96,273 |
"""
Helper classes and methods for running modulestore tests without Django.
"""
import io
import os
from contextlib import contextmanager
from contextlib2 import ExitStack
from importlib import import_module
from shutil import rmtree
from tempfile import mkdtemp
from unittest import TestCase
from uuid import uuid4
... | cpennington/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/utils.py | Python | agpl-3.0 | 17,084 |
import shutil
from os.path import isfile
from os import remove
from coalib.results.result_actions.ShowPatchAction import ShowPatchAction
from coalib.results.result_actions.ResultAction import ResultAction
class ApplyPatchAction(ResultAction):
SUCCESS_MESSAGE = "Patch applied successfully."
is_applicable = ... | sils1297/coala | coalib/results/result_actions/ApplyPatchAction.py | Python | agpl-3.0 | 1,931 |
# -*- coding: UTF-8 -*-
# Copyright 2012-2015 Luc Saffre
# This file is part of Lino Welfare.
#
# Lino Welfare 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 y... | khchine5/lino-welfare | lino_welfare/modlib/debts/fields.py | Python | agpl-3.0 | 2,249 |
from django.conf.urls.defaults import *
from django.conf import settings
from django.views.generic.simple import direct_to_template, redirect_to
UUID_REGEX = '[\w]{8}(-[\w]{4}){3}-[\w]{12}'
urlpatterns = patterns('main.views',
# Index
(r'^$', 'home'),
# Forbidden
(r'forbidden/$', 'forbid... | artefactual/archivematica-history | src/dashboard/src/main/urls.py | Python | agpl-3.0 | 5,306 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'root'
import unittest
from mock import Mock
from Protocol import Protocol
import json
import os
from settings import settings
class ProtocolTest (unittest.TestCase):
def setUp(self):
self.protocol = Protocol(True)
def tearDown(self):
... | cloudspaces/eyeos-u1db | eyeos/extern/u1db/ProtocolTest.py | Python | agpl-3.0 | 25,065 |
# Copyright (C) 2020 Terrabit
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from . import test_ro_city
| OCA/l10n-romania | l10n_ro_city/tests/__init__.py | Python | agpl-3.0 | 126 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# res_partner
# Copyright (c) 2013 Codeback Software S.L. (http://codeback.es)
# @author: Miguel García <miguel@codeback.es>
# @author: Javier Fuentes <javier@codeback.es>
#
# This program is fr... | codeback/openerp-cbk_product_web_visible | product.py | Python | agpl-3.0 | 1,398 |
# This file is part of VoltDB.
# Copyright (C) 2008-2014 VoltDB Inc.
#
# This file contains original code and/or modifications of original code.
# Any modifications made by VoltDB Inc. are licensed under the following
# terms and conditions:
#
# Permission is hereby granted, free of charge, to any person obtaining
# a... | eoneil1942/voltdb-4.7fix | lib/python/voltcli/voltdb.d/create.py | Python | agpl-3.0 | 1,894 |
from haystack.indexes import SearchIndex, CharField
from haystack import site
from serie.models import Serie
class SerieIndex(SearchIndex):
text = CharField(document=True, use_template=True)
name = CharField(model_attr='name')
name_es = CharField(model_attr='name_es')
name_en = CharField(model_attr='n... | alabs/petateca | petateca/apps/serie/search_indexes.py | Python | agpl-3.0 | 363 |
# -*- coding: utf-8 -*-
# Django settings for basic pinax project.
import os.path
import posixpath
import pinax
PINAX_ROOT = os.path.abspath(os.path.dirname(pinax.__file__))
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
# tells Pinax to use the default theme
PINAX_THEME = "default"
DEBUG = False
TEMPLAT... | markherringer/waywayd | settings.py | Python | agpl-3.0 | 7,189 |
from django_restapi.model_resource import Collection
from django_restapi.responder import XMLResponder
from django_restapi.resource import Resource
from django_restapi.authentication import *
from django.contrib.auth.models import User
from django.shortcuts import render_to_response,get_object_or_404
from uwcs_websit... | UWCS/uwcs-website | uwcs_website/rest.py | Python | agpl-3.0 | 889 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author Vincent Renaville. Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publis... | OpenPymeMx/account-financial-tools | account_tax_analysis/__openerp__.py | Python | agpl-3.0 | 1,265 |
from django import forms
from utils import setting_handler
from core.homepage_elements.about import plugin_settings
class AboutForm(forms.Form):
title = forms.CharField(
help_text='The title of the about block eg. "About this Journal"',
)
description = forms.CharField(
widget=forms.Textar... | BirkbeckCTP/janeway | src/core/homepage_elements/about/forms.py | Python | agpl-3.0 | 921 |
# Generated by Django 2.2.20 on 2021-07-08 14:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cornerstone', '0006_auto_20191001_0742'),
]
operations = [
migrations.AlterField(
model_name='cornerstoneenterprisecustomerconf... | edx/edx-enterprise | integrated_channels/cornerstone/migrations/0007_auto_20210708_1446.py | Python | agpl-3.0 | 1,174 |
'''
Created on 04.12.2017
@author: sebastian
'''
from flask import render_template
from flask import redirect
from requests.exceptions import ConnectionError
from butler_offline.viewcore.state import persisted_state
from butler_offline.viewcore import request_handler
from butler_offline.viewcore import viewcore
from ... | RosesTheN00b/BudgetButlerWeb | butler_offline/viewcore/request_handler.py | Python | agpl-3.0 | 3,268 |
# Based on https://bitbucket.org/jokull/django-email-login/
from django.contrib.auth import authenticate
from django.contrib.auth import forms as auth_forms
from django.contrib.auth.models import User
from django import forms
from django.utils.translation import ugettext_lazy as _
attrs_dict = {'class': 'required'}
... | datagutten/comics | comics/accounts/forms.py | Python | agpl-3.0 | 3,543 |
# Ariane ProcOS plugin
# Gears
#
# Copyright (C) 2015 echinopsii
#
# 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... | echinopsii/net.echinopsii.ariane.community.plugin.procos | ariane_procos/gears.py | Python | agpl-3.0 | 104,388 |
# -*- coding: utf-8 -*-
# Copyright 2016-2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
'name': 'MFA Support',
'summary': 'Allows users to enable MFA and add optional trusted devices',
'version': '8.0.1.0.0',
'category': 'Extra Tools',
'website': 'https://l... | acsone/server-tools | auth_totp/__openerp__.py | Python | agpl-3.0 | 869 |
from collections import deque
from nltk.corpus import wordnet as wn
from grafeno.transformers.wordnet import Transformer as WNGet
from grafeno.transformers.__utils import Transformer as Utils
class Transformer (WNGet, Utils):
'''Adds to the graph all WordNet hypernyms of every possible concept node.
The hype... | agarsev/grafeno | grafeno/transformers/extend.py | Python | agpl-3.0 | 1,585 |