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 |
|---|---|---|---|---|---|
# 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 field 'Group.auth'
db.add_column('people_group', 'auth', self.gf('django.db.models.fields.Boolean... | pizzapanther/Church-Source | churchsource/people/migrations/0013_auto__add_field_group_auth.py | Python | gpl-3.0 | 6,849 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- mode: python -*-
# This file is part of opensearch.
# Copyright © 2009, Dansk Bibliotekscenter a/s,
# Tempovej 7-11, DK-2750 Ballerup, Denmark. CVR: 15149043
#
# opensearch is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | DBCDK/opensearch | tools/transformDir.py | Python | gpl-3.0 | 3,672 |
import abc
from ..control import BufferController
from ..buffers import Buffer
from .application import app, AbstractApplication
from ..control.interactive import interactive
from ..core import Signal
import logging
class AbstractEditor(metaclass=abc.ABCMeta):
def __init__(self, view, config):
self.__vie... | sam-roth/Keypad | keypad/abstract/editor.py | Python | gpl-3.0 | 4,153 |
"""Abstract estimator module, will contain just 1 class."""
import os
import logging
import warnings
import time
import numpy as np
from sklearn.utils import shuffle
from sklearn.externals import joblib
class Classifier(object):
"""Abstract estimator class"""
PERSIST_FILENAME = 'classifier.pkl'
OK = 0
... | dmonllao/moodleinspire-python-backend | moodleinspire/processor/estimator.py | Python | gpl-3.0 | 4,622 |
#-*- coding:utf-8 -*-
class EventThrower:
def __init__(self):
self.events = {}
def on(self, name, callback, priority=99):
if name in self.events:
self.events[name].append({
'fct': callback,
'priority': priority
})
self.events[name] = sorted(self.events[name], key=lambda x: x['priority'], rever... | Choko256/pysfmlengine | util.py | Python | gpl-3.0 | 528 |
import SqlReader
def main():
reader=SqlReader.SqlReader("SELECT p.objid,p.ra,p.dec,p.r,s.z as redshift FROM galaxy as p join specobj as s on s.bestobjid=p.objid WHERE p.ra BETWEEN 194.138787 AND 195.548787 AND p.dec BETWEEN 27.259389 AND 28.709389")
reader.dataCollect()
if __name__ =="__main__":
main() | chshibo/CosData_Tools | test_SqlReader.py | Python | gpl-3.0 | 316 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'blogCMS.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| huliyou/blogCMS | blogCMS/blogCMS/urls.py | Python | gpl-3.0 | 298 |
import sys
from subprocess import call
for f in sys.argv[2:]:
ret = call([sys.argv[1], f])
if ret == 0:
print "Extraction to Coq (%s): SUCCESS." % f
else:
print "Extraction to Coq (%s): ERROR." % f
sys.exit(1)
| picnic/RelationExtraction | test/test_coq_files.py | Python | gpl-3.0 | 247 |
import ujson
def json_load(file_name):
with open(file_name, 'r') as f:
data = ujson.loads(f.read())
return data
def json_dump(file_name, data):
with open(file_name, 'w') as f:
f.write(ujson.dumps(data))
test_dict = {
1: '1',
2: '2',
3: '3',
4: '4',
5: '5',
}
json_... | ShaunKarran/homesense | esp8266/micropython/main.py | Python | gpl-3.0 | 403 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012,2013 Thibault VINCENT <tibal@reloaded.fr>
#
# This file is part of Agipibi.
#
# Agipibi 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, e... | LunarLanding/agipibi | python/example_tektronix_2432.py | Python | gpl-3.0 | 6,565 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from lib.meos import MEoS
from lib import unidades
class R134a(MEoS):
"""Multiparameter equation of state for R134a"""
name = "1,1,1,2-tetrafluoroethane"
CASNumber = "811-97-2"
formula = "CF3CH2F"
synonym = "R134a"
rhoc = unidades.Density(511.9)
T... | edusegzy/pychemqt | lib/mEoS/R134a.py | Python | gpl-3.0 | 32,882 |
import sys
import lofarpipe.support.lofaringredient as ingredient
from lofarpipe.support.baserecipe import BaseRecipe
from lofarpipe.support.remotecommand import RemoteCommandRecipeMixIn
from lofarpipe.support.remotecommand import ComputeJob
from lofarpipe.support.data_map import DataMap, validate_data_maps, \
... | kernsuite-debian/lofar | CEP/Pipeline/recipes/sip/master/imager_finalize.py | Python | gpl-3.0 | 7,155 |
# -*- coding: utf-8 -*-
#
# Monk is an unobtrusive data modeling, manipulation and validation library.
# Copyright © 2011—2015 Andrey Mikhaylenko
#
# This file is part of Monk.
#
# Monk is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License ... | neithere/monk | monk/__init__.py | Python | gpl-3.0 | 1,160 |
import os
import json
import urllib
import socket
import subprocess as sub
import string
import sys
MPCONF = "/etc/magicpool.conf"
MPURL = "https://magicpool.org/main/download_config/${U}/${W}/${G}"
SGCONF = "/home/crypto/.sgminer/sgminer.conf"
def niceprint(data):
return json.dumps(data,sort_keys=True,indent=4, se... | p4u/magicOS | files/home/crypto/mp-agent.py | Python | gpl-3.0 | 2,955 |
from PyQt4.QtGui import *
from electrum_frc.i18n import _
class HistoryWidget(QTreeWidget):
def __init__(self, parent=None):
QTreeWidget.__init__(self, parent)
self.setColumnCount(2)
self.setHeaderLabels([_("Amount"), _("To / From"), _("When")])
self.setIndentation(0)
def empt... | Kefkius/electrum-frc | gui/qt/history_widget.py | Python | gpl-3.0 | 765 |
"""apple URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... | tejasjadhav/django-scheduler | examples/basic/apple/urls.py | Python | gpl-3.0 | 747 |
class ReversiLogic(object):
def __init__(self):
self.turn = 'b'
self.board = Board()
# Check if the current self.turn can play. If not, change to the other
# player. If he can't play either, return None (game over).
def get_whose_turn(self):
if self.can_play():
... | tupes/School | CS175/Asn2/Reversi/model.py | Python | gpl-3.0 | 5,899 |
"""The Pirate Bay Module."""
import logging
import sys
from torrench.utilities.Config import Config
class LimeTorrents(Config):
"""
LimeTorrents class.
This class fetches torrents from LimeTorrents proxy,
and diplays results in tabular form.
All activities are logged and stored in a log file.
... | kryptxy/torrench | torrench/modules/limetorrents.py | Python | gpl-3.0 | 7,173 |
import datetime
def main(num):
for a in range(1, num // 3):
for b in range(a + 1, num // 2 if num % 2 == 0 else num // 2 + 1):
c = num - a - b
if a ** 2 + b ** 2 == c ** 2:
return a * b * c
try:
para = int(input())
except:
para = 1000
beg = datetime.datetim... | nowsword/ProjectEuler | p009.py | Python | gpl-3.0 | 424 |
import pygame
import time
import functools
from pygame import locals
from threading import Thread
from enum import Enum
'''
Utility classes and exceptions.
version: 1.0
author: Daniel O'Grady
'''
# CONSTANTS
ALARMS_FILE = "alarms.json"
CONFIG_FILE = "config.cfg"
LOG_FILE = "goodmorning.log"
# CONFIG DEFAULTS
C_D... | ogrady/GoodMorning | util.py | Python | gpl-3.0 | 6,532 |
from collections import defaultdict
from os.path import dirname, normpath
from shlex import quote
from bundlewrap.exceptions import BundleError
from bundlewrap.items import Item
from bundlewrap.utils.remote import PathInfo
from bundlewrap.utils.text import mark_for_translation as _
from bundlewrap.utils.text import is... | bundlewrap/bundlewrap | bundlewrap/items/symlinks.py | Python | gpl-3.0 | 6,528 |
# Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for the Decim... | mancoast/CPythonPyc_test | fail/301_test_decimal.py | Python | gpl-3.0 | 53,155 |
__all__ = ["list", "rename", "search", "create", "move", "copy", "delete"] | yusufb/file-manager | modules/__init__.py | Python | gpl-3.0 | 74 |
# 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 | source/timelinelib/plugin/pluginbase.py | Python | gpl-3.0 | 1,075 |
#!/usr/bin/env python3
# fileencoding: utf-8
import os
import sys
import unittest
cafepypath = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(cafepypath)
from cafepy.files import Ninfo
class TestReadNinfo(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.testdata = os.path.join... | Moguf/cafepy | test/test_ninfofile.py | Python | gpl-3.0 | 1,662 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('replays', '0013_replaypack_file'),
]
operations = [
migrations.AddField(
model_name='player',
name='... | rocket-league-replays/rocket-league-replays | rocket_league/apps/replays/migrations/0014_auto_20151013_2217.py | Python | gpl-3.0 | 1,589 |
import socket
import base64
def read_lines():
global client_socket
lines_buffer = ""
data = True
while data:
try:
data = client_socket.recv(4096)
lines_buffer += data
except socket.timeout:
break
return lines_buffer
print("thermeq3 delete devic... | autopower/thermeq3 | support/del_dev.py | Python | gpl-3.0 | 972 |
import numpy as np
#import scipy.io.wavfile
#import scipy.signal
import pysndfile
import matplotlib.pyplot as plt
plt.ion()
def db2mag(d):
return 10.0**(d/20.0)
if __name__ == "__main__" :
print('Synthesise clicks and sinusoids at regular time and frequencies')
fs = 16000
syn = np.zeros(4*fs)
... | gillesdegottex/dfasma | test/synth_grid.py | Python | gpl-3.0 | 1,049 |
"""
Django settings for practica4 project.
Generated by 'django-admin startproject' using Django 1.9.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os,... | acasadoquijada/bares | practica4/settings.py | Python | gpl-3.0 | 4,257 |
import bpy
from bpy.props import *
from mathutils import Vector
from ... base_types.node import AnimationNode
from . spline_evaluation_base import SplineEvaluationBase
class EvaluateSplineNode(bpy.types.Node, AnimationNode, SplineEvaluationBase):
bl_idname = "an_EvaluateSplineNode"
bl_label = "Evaluate Spline"... | Thortoise/Super-Snake | Blender/animation_nodes-master/nodes/spline/evaluate_spline.py | Python | gpl-3.0 | 1,278 |
import os
import logging
import re
from typing import Final
logger: Final = logging.getLogger("Npo.Utils")
pattern: Final = re.compile('[a-z0-9]{2,}', re.IGNORECASE)
def looks_like_form(form: str):
"""
Checks if the given string looks like a form. E.g. it represents json, xml, a file, or 'stdin'.
Otherw... | npo-poms/pyapi | npoapi/utils.py | Python | gpl-3.0 | 1,076 |
#!/usr/bin/python
import wave
import struct
def slice(f,w,init,end):
outFile = wave.open('cutted_'+f,'w')
outFile.setparams((2,2,44100,0,'NONE','not compressed'))
w.setpos(init)
for i in range((end-w.tell())):
frames = w.readframes(1)
outFile.writeframes(frames)
outFile.clo... | essteban/Auto-DJ | Python Scripts/sliceWav.py | Python | gpl-3.0 | 327 |
#!/usr/bin/env python
#
# Copyright (C) 2012 by the Free Software Foundation, Inc.
#
# Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foun... | savoirfairelinux/ring-daemon | tools/jamictrl/sippwrap.py | Python | gpl-3.0 | 5,229 |
import logging
import re
from pathlib import Path
def find_by_name(path, name):
if type(path) is str:
path = Path(path)
for child in path.iterdir():
if child.name == name:
return child
elif child.is_dir():
ret = find_by_name(child, name)
if ret:
... | zydiig/CKAN.py | libckan/fs.py | Python | gpl-3.0 | 1,487 |
# -*- coding: UTF-8 -*-
# Copyright (C) 2008 David Versmisse <david.versmisse@itaapy.com>
# Copyright (C) 2008 Juan David Ibáñez Palomar <jdavid@itaapy.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software... | kennym/itools | xapian/catalog.py | Python | gpl-3.0 | 14,778 |
"""Property is a single CSS property in a CSSStyleDeclaration."""
__all__ = ['Property']
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from cssutils.helper import Deprecated
from value import PropertyValue
import cssutils
import xml.dom
class Property(cssutils.util.Base):
"""A CSS property in a StyleDec... | kgn/cssutils | src/cssutils/css/property.py | Python | gpl-3.0 | 18,511 |
from distutils.core import setup
setup(name='cucmAxlWriter',
version='0.4',
description='cucm object writer using AXL',
author='Christopher Phillips',
author_email='christopherphillips+cucmAxlWriter@gmail.com',
url='https://github.com/ChristopherUC/cucmAxlWriter',
license='GNU GENERA... | ChristopherUC/cucmAxlWriter | setup.py | Python | gpl-3.0 | 494 |
#!/usr/bin/env python
# encoding: utf-8
"""
Generic stock functions
"""
class Stock(object):
"""
Generic Stock information
"""
def __init__(self, symbol, name, sector):
super(Stock, self).__init__()
self.symbol = symbol
self.name = name
self.sector = sector
| kevinkirkup/hedge | python/hedge/stock.py | Python | gpl-3.0 | 309 |
import helper, mainProg, constants
| mmulazzani/alibiFramework | simulator/scheduler/__init__.py | Python | gpl-3.0 | 36 |
import os.path
for root, dirs, files in os.walk(os.path.dirname(os.path.realpath(__file__))):
for file in files :
if file.endswith('.prog') :
os.chdir(root)
f1 = open(file, 'r')
output = file.split(".")
f2 = open(output[0]+'.py', 'w')
indent = 0
... | wahur666/kodok | python/bead5/mian.py | Python | gpl-3.0 | 1,500 |
#-*- coding: utf-8 -*-
"""Algorithm for post-collate processing.
"""
from __future__ import print_function
from functools import partial
import copy
import decimal
import re
import importlib
from collation.regulariser import Regulariser
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwar... | scribe777/collation_editor | python/collation/postprocessor.py | Python | gpl-3.0 | 24,405 |
# vim:set tabstop=3 shiftwidth=3 expandtab:
# vim:set autoindent smarttab nowrap:
from django.conf.urls.defaults import *
import settings
urlpatterns = patterns('',
(r'^$', 'webreview.views.index'),
(r'^skip/(?P<skip>.*)$', 'webreview.views.changes'),
(r'^diff/... | oseemann/cvsreview | app/urls.py | Python | gpl-3.0 | 1,023 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
import os
from tempfile import NamedTemporaryFile
import numpy as np
import morfessor
from six import PY2
from six.moves import cPickle as pickle
from . import polyglot_path
from .decorators import memoize
from .downloader import downloader
from .map... | alantian/polyglot | polyglot/load.py | Python | gpl-3.0 | 4,095 |
import time
from netCDF4 import Dataset
from oceansar.ocs_io import NETCDFHandler
class ProcFile(NETCDFHandler):
""" Processed raw data file generated by the OASIS Simulator
:param file_name: File name
:param mode: Access mode (w = write, r = read, r+ = read + append)
:param proc_dim: Pr... | pakodekker/oceansar | oceansar/ocs_io/processed.py | Python | gpl-3.0 | 3,344 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
It downloads the fusion genes from article:
D. Robison et al., Integrative Clinical Genomics of Advanced Prostate Cancer, Cell, Vol. 161, May 2015, http://dx.doi.org/10.1016/j.cell.2015.05.001
Author: Daniel Nicorici, Daniel.Nicorici@gmail.com
Copyright (c) 2009-20... | ndaniel/fusioncatcher | bin/get_prostates.py | Python | gpl-3.0 | 12,533 |
# -*- coding: utf-8 -*-
# FROM https://github.com/mozilla/bedrock/blob/master/bedrock/base/tests/test_simple_dict_cache.py
# Tests for our custom local memory cache backend that does not use pickle
# and instead uses a simple dict for in-memory storage. These were adapted
# from the cache backend tests in Django itse... | schalkneethling/snippets-service | snippets/base/tests/test_simple_dict_cache.py | Python | mpl-2.0 | 27,353 |
"""Contain utility functions and tools."""
| mozilla-lockbox/lockbox-extension | test/integration/pages/util/__init__.py | Python | mpl-2.0 | 43 |
import os
from setuptools import setup, find_packages
__dirname = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(__dirname, 'README.md')) as readme:
README = readme.read()
with open(os.path.join(__dirname, 'app', 'requirements.txt')) as reqs:
REQUIREMENTS = reqs.read()
setup(name='ghos... | chuckharmston/ghosttown | setup.py | Python | mpl-2.0 | 788 |
from product.models import *
from django.shortcuts import render_to_response
from django.views.generic import ListView, DetailView
from datetime import datetime
class ListDrink(ListView):
model = Drink
context_object_name = "product_list"
template_name = "product_list.html"
paginate_by = 5
class DetailDrink(Deta... | Elfhir/apero-imac | product/views.py | Python | mpl-2.0 | 671 |
"""
Copyright (C) 2017-2021 Vanessa Sochat.
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 django.contrib.sitemaps import Sitemap
from shub.apps.main.models imp... | singularityhub/sregistry | shub/apps/base/sitemap.py | Python | mpl-2.0 | 917 |
import unittest
import os
import shutil
import json
import memcache
import testUtils
testUtils.addSymServerToPath()
import quickstart
LIB_NAME = "xul.pdb"
BREAKPAD_ID = "44E4EC8C2F41492B9369D6B9A059577C2"
EXPECTED_HASH = "6e5e6e422151b7b557d913c0ff86d7cf"
class testDiskCache(unittest.TestCase):
def setUp(self):... | bytesized/Snappy-Symbolication-Server | tests/test_DiskCache.py | Python | mpl-2.0 | 6,210 |
#!/usr/bin/env python
# coding=utf-8
from toughlogger.common import pyforms
from toughlogger.common.pyforms import rules
from toughlogger.common.pyforms.rules import button_style, input_style
password_update_form = pyforms.Form(
pyforms.Textbox("tra_user", description=u"管理员名", size=32, readonly="readonly", **inp... | talkincode/toughlogger | toughlogger/console/handlers/password_forms.py | Python | agpl-3.0 | 789 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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... | eirmag/weboob | weboob/tools/misc.py | Python | agpl-3.0 | 4,575 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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 So... | ddurieux/alignak | alignak/db_oracle.py | Python | agpl-3.0 | 4,741 |
# A few functions that turn out to be useful in many of the Scottish
# Parliament scraping scripts.
import sys
import datetime
sys.path.append('../')
from BeautifulSoup import NavigableString
from BeautifulSoup import Tag
from BeautifulSoup import Comment
import re
# A number of SPIDs have a 0 (zero) in place of an ... | spudmind/parlparse | pyscraper/sp/common.py | Python | agpl-3.0 | 3,970 |
# -*- coding: utf-8 -*-
##############################################################################
#
# 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 L... | trabacus-softapps/docker-magicecommerce | additional_addons/product_pricelist_fixed_price/model/__init__.py | Python | agpl-3.0 | 909 |
# -*- coding: utf-8 -*-
"""
Class for transmitting learner data to Blackboard.
"""
from integrated_channels.blackboard.client import BlackboardAPIClient
from integrated_channels.integrated_channel.transmitters.learner_data import LearnerTransmitter
class BlackboardLearnerTransmitter(LearnerTransmitter):
"""
... | edx/edx-enterprise | integrated_channels/blackboard/transmitters/learner_data.py | Python | agpl-3.0 | 2,331 |
# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
import datetime
from testtools import TestCase
from testtools.matchers import Contains
from lp.services.webapp.login import (
isFreshLogin,
OpenIDCallbackView,
)... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/services/webapp/tests/test_session.py | Python | agpl-3.0 | 3,740 |
from ..base import WLElement
class NaglowekScena(WLElement):
SECTION_PRECEDENCE = 2
TXT_TOP_MARGIN = 4
TXT_BOTTOM_MARGIN = 2
TXT_LEGACY_TOP_MARGIN = 4
TXT_LEGACY_BOTTOM_MARGIN = 0
HTML_TAG = 'h3'
EPUB_TAG = 'h2'
EPUB_CLASS = 'h3'
EPUB_START_CHUNK = False
| fnp/librarian | src/librarian/elements/headers/naglowek_scena.py | Python | agpl-3.0 | 297 |
__copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from django.db import models
from django.utils import timezone
from events import logic as event_logic
from utils import ... | BirkbeckCTP/janeway | src/proofing/models.py | Python | agpl-3.0 | 9,317 |
import json
import requests
class SearchTypeNotSupportedError(Exception):
pass
class SafebrowsingClient:
"""Simple API to Google Safebrowsing and historic.
:param key: API key for google safebrowsing
:param client_id: ClientId for Safebrowsing API
:param client_version: ClientVersion for Safebr... | BSI-CERT-Bund/cortex-analyzers | analyzers/GoogleSafebrowsing/safebrowsing.py | Python | agpl-3.0 | 2,689 |
"""
Acceptance tests for Studio's Settings Details pages
"""
from unittest import skip
from acceptance.tests.studio.base_studio_test import StudioCourseTest
from ...fixtures.course import CourseFixture
from ...pages.studio.settings import SettingsPage
from ...pages.studio.overview import CourseOutlinePage
from ...test... | mtlchun/edx | common/test/acceptance/tests/studio/test_studio_settings_details.py | Python | agpl-3.0 | 6,290 |
""":mod:`favien.canvas` --- Canvas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import boto3
from botocore.client import Config
from flask import current_app
from sqlalchemy.orm import deferred, dynamic_loader, relationship
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.sql.functions import now
from sqlalc... | favien/favien | favien/canvas.py | Python | agpl-3.0 | 3,524 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-08 15:05
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('role', '0005_auto_20160906_1029'),
]
operations = [
... | wearespindle/flindt | backend/flindt/role/migrations/0006_auto_20160908_1705.py | Python | agpl-3.0 | 657 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# This file is part of weboob.
#
# weboob 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 opt... | blckshrk/Weboob | modules/grooveshark/test.py | Python | agpl-3.0 | 1,879 |
# -*- encoding: utf-8 -*-
#Caliope Entities
from cid.core.forms import FormNode
from cid.core.entities import (VersionedNode, RelationshipFrom,
CaliopeUser, One, NotConnected, DateTimeProperty,
StringProperty, IntegerProperty, FloatProperty, CaliopeJSONPro... | CaliopeProject/CaliopeServer | src/cid/forms/siim2/ficha_catastral/models.py | Python | agpl-3.0 | 6,118 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py
#
#################################################... | ecino/compassion-switzerland | muskathlon/forms/partner_coordinates_form.py | Python | agpl-3.0 | 3,075 |
from odoo import models, fields, api
class StockImmediateTransfer(models.TransientModel):
_inherit = 'stock.immediate.transfer'
_description = 'Immediate Transfer'
pick_to_backorder_ids = fields.Many2many('stock.picking', help='Picking to backorder')
@api.multi
def process(self):
backord... | Aravinthu/odoo | addons/stock_picking_batch/wizard/stock_immediate_transfer.py | Python | agpl-3.0 | 1,110 |
# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for `DirectBranchCommit`."""
__metaclass__ = type
from testtools.testcase import ExpectedException
from zope.security.proxy import removeSecurityProxy
from lp.code... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/code/tests/test_directbranchcommit.py | Python | agpl-3.0 | 14,147 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from shuup.utils.patterns import _compile_pattern, P... | suutari/shoop | shuup_tests/utils/test_patterns.py | Python | agpl-3.0 | 4,026 |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | odoousers2014/odoo_addons-2 | clv_tray/wkf/clv_tray_wkf.py | Python | agpl-3.0 | 3,291 |
"""
Django template context processors.
"""
from __future__ import absolute_import
from django.conf import settings
from django.utils.http import urlquote_plus
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
def configuration_context(request):
"""
Configuration contex... | ESOedX/edx-platform | openedx/core/djangoapps/site_configuration/context_processors.py | Python | agpl-3.0 | 626 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-02 11:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0022_query_amcat_options'),
]
operations = [
migrations.Alter... | amcat/amcat-dashboard | dashboard/migrations/0023_auto_20180702_1140.py | Python | agpl-3.0 | 696 |
"""
Webhook models.
"""
import uuid
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class ActiveManager(models.Manager):
"""
Manager which returns only enabled webhooks.
"""
def get_queryset(self, *args, **kwargs):
"""
Returns only enabled web... | mitodl/ccxcon | webhooks/models.py | Python | agpl-3.0 | 992 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest, frappe, json
from frappe.utils import flt
test_dependencies = ["Item"]
class TestPaymentTool(unittest.TestCase):
def test_make_jo... | suyashphadtare/test | erpnext/accounts/doctype/payment_tool/test_payment_tool.py | Python | agpl-3.0 | 6,947 |
import re
import string
def replaceIt(file):
out = ''
with open(file, 'r') as f:
for line in f:
repl = '[' + re.escape(''.join(string.punctuation)) + ']'
out += re.sub(repl, '', line)
return out
print (replaceIt('test.txt'))
# output
'''
cobaanu231339 91102
1212086mcmn... | agusmakmun/Some-Examples-of-Simple-Python-Script | regex/remove-all-characters.py | Python | agpl-3.0 | 413 |
import os
from nose.tools import (assert_equal,
assert_true)
from ckantoolkit import config
import ckan.tests.helpers as helpers
import ckan.tests.factories as factories
import ckanapi
import boto
from moto import mock_s3
import logging
log = logging.getLogger(__name__)
class TestS3Control... | okfn/ckanext-s3filestore | ckanext/s3filestore/tests/test_controller.py | Python | agpl-3.0 | 3,472 |
#!/usr/bin/env python
from __future__ import absolute_import, unicode_literals
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"securethenews.settings.dev")
from django.core.management import execute_from_command_line
execute_from... | freedomofpress/securethenews | manage.py | Python | agpl-3.0 | 344 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | marionleborgne/nupic.research | tests/layers/physical_objects_test.py | Python | agpl-3.0 | 4,977 |
#!/usr/bin/env python3
# The MIT License (MIT)
# Copyright (c) 2016 Michael Sasser <Michael.Sasser@Real-Instruments.de>
#
# 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 restriction... | Real-Instruments/fflib | fflib/peer.py | Python | agpl-3.0 | 26,829 |
import datetime
import xml.dom.minidom
import pytz
from .models import (
Action, Bounds, Diff, Node, OSMElement, Relation,
RelationMember, Tag, Way, WayNode)
class FileFormatError(Exception):
pass
zulu_tz = pytz.timezone('Zulu')
def parse_iso8601(s):
return zulu_tz.localize(datetime.datetime.strpti... | Cartocite/osmada | osmdata/parsers.py | Python | agpl-3.0 | 8,389 |
# -*- coding: utf-8 -*-
# © 2016 ClearCorp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import l10n_cr_hr_holidays
| ClearCorp/odoo-costa-rica | l10n_cr_hr_holidays/models/__init__.py | Python | agpl-3.0 | 140 |
"""Create mandate table
Revision ID: 32f5eec11778
Revises: 3a41443d8839
Create Date: 2015-06-29 22:49:29.941746
"""
# revision identifiers, used by Alembic.
revision = '32f5eec11778'
down_revision = '3a41443d8839'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table(
'mandate'... | scorphus/politicos | politicos/migrations/versions/32f5eec11778_create_mandate_table.py | Python | agpl-3.0 | 1,317 |
# -*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url
from django.utils.translation import ugettext_lazy as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.attachments import views
from wiki.plugins.attachments import models
from wiki.plugi... | GbalsaC/bitnamiP | django-wiki/wiki/plugins/attachments/wiki_plugin.py | Python | agpl-3.0 | 2,509 |
import superdesk
from flask.ext.script import Manager
class SuperdeskManager():
"""Superdesk scripts manager."""
def __init__(self, app, commands):
self.manager = Manager(app)
self.commands = commands
def run(self):
"""Run manager with predefined set of commands."""
self... | akintolga/superdesk-core | superdesk/factory/manager.py | Python | agpl-3.0 | 540 |
# TmLibrary - TissueMAPS library for distibuted image analysis routines.
# Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen
#
# 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 Softwa... | TissueMAPS/TmLibrary | tmlib/workflow/imextract/cli.py | Python | agpl-3.0 | 1,460 |
from django.test import TestCase
from django.core.management import call_command
from wagtail.tests.utils import WagtailTestUtils, WagtailPageTests
from wagtail.core.models import Page
from pages.models import (HomePage,
HigherEducation,
ContactUs,
... | openstax/openstax-cms | pages/tests.py | Python | agpl-3.0 | 9,623 |
# Copyright 22011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""All the interfaces that are exposed through the webservice.
There is a declaration in ZCML somewhere that looks like:
<webservice:register module="lp.patchwebservice" />
wh... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/services/temporaryblobstorage/webservice.py | Python | agpl-3.0 | 959 |
"""
Command to retrieve aggregated student forums data in a .csv
"""
import csv
import optparse
import os
from django.core.management.base import BaseCommand, CommandError
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from instructor.utils import collect_studen... | jbassen/edx-platform | lms/djangoapps/instructor/management/commands/collect_student_forums_data.py | Python | agpl-3.0 | 1,826 |
"""
LMS specific monitoring helpers.
"""
| msegado/edx-platform | lms/djangoapps/monitoring/__init__.py | Python | agpl-3.0 | 41 |
"""
This file contains (or should), all access control logic for the courseware.
Ideally, it will be the only place that needs to know about any special settings
like DISABLE_START_DATES.
Note: The access control logic in this file does NOT check for enrollment in
a course. It is expected that higher layers check f... | jolyonb/edx-platform | lms/djangoapps/courseware/access.py | Python | agpl-3.0 | 32,665 |
# Copyright (c) 2011, 2012 Free Software 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 vers... | gnowledge/ncert_nroer | demo/urls.py | Python | agpl-3.0 | 9,860 |
# Copyright (C) 2018 - TODAY, Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class MaintenanceEquipment(models.Model):
_inherit = 'maintenance.equipment'
_description = 'Maintenance Equipment'
backend_id = fields.Many2one('bac... | OCA/vertical-isp | connector_equipment/models/maintenance_equipment.py | Python | agpl-3.0 | 1,795 |
# Copyright 2016-17 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class StockChangeStandardPrice(models.TransientModel):
_inherit = "stock.change.standard.price"
@api.model
... | Vauxoo/stock-logistics-warehouse | stock_inventory_revaluation/wizards/stock_change_standard_price.py | Python | agpl-3.0 | 974 |
# -*- coding: utf-8 -*-
"""
Created on Thu May 19 12:10:57 2016
@author: sergio
"""
from shaolin.shaolin.widgets import Widget
#from .dashboards import ToggleMenu
from shaolin.core.dashboard import Dashboard
from shaolin.core.stateless_dashboard import StatelessDashboard
from shaolin.core.css import LayoutHacker | HCsoft-RD/shaolin | shaolin/dashboards/context.py | Python | agpl-3.0 | 316 |
"""Transforms data from third party services to Lutris compatible data"""
def clean_name(name):
"""Clean up a game name"""
extras = (
"tech demo",
"demo",
"demo 2",
"gold pack",
"complete pack",
"the final cut",
"enhanced edition",
"free preview"... | lutris/website | providers/processors.py | Python | agpl-3.0 | 1,084 |
#
# 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 business involves the administration of students, teachers,
# courses, progr... | uclouvain/osis | infrastructure/tests/shared_kernel/academic_year/repository/in_memory/test_academic_year.py | Python | agpl-3.0 | 2,533 |
# -*- coding: utf-8 -*-
u"""
Copyright 2015 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
1flow 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 ... | 1flow/1flow | oneflow/core/admin/processor.py | Python | agpl-3.0 | 5,116 |
import binascii
import datetime
import hashlib
import os
from pymongo import ReturnDocument
from vj4 import db
from vj4.util import argmethod
TYPE_REGISTRATION = 1
TYPE_SAVED_SESSION = 2
TYPE_UNSAVED_SESSION = 3
TYPE_LOSTPASS = 4
TYPE_CHANGEMAIL = 5
def _get_id(id_binary):
return hashlib.sha256(id_binary).digest... | vijos/vj4 | vj4/model/token.py | Python | agpl-3.0 | 3,999 |
# MyGeom Module - API for easier Salome geompy usage
# Types.py: Extended Data Types for MyGeom
#
# Copyright (C) 2013 Stefan Reiterer - maldun.finsterschreck@gmail.com
#
# 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 ... | maldun/MyGeom | Types.py | Python | lgpl-2.1 | 16,096 |