code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# Generated by Django 2.2.12 on 2020-05-09 06:28
from django.db import migrations
# Can't use fixtures because load_fixtures method is janky with django-tenant-schemas
def load_initial_data(apps, schema_editor):
Grade = apps.get_model('courses', 'Grade')
# add some initial data if none has been created yet
... | timberline-secondary/hackerspace | src/courses/migrations/0016_grades_initialdata.py | Python | gpl-3.0 | 963 |
import re
import sys
import traceback
import copy
import json
from distutils import file_util
from grammalecte.echo import echo
DEF = {}
FUNCTIONS = []
JSREGEXES = {}
WORDLIMITLEFT = r"(?<![\w.,–-])" # r"(?<![-.,—])\b" seems slower
WORDLIMITRIGHT = r"(?![\w–-])" # r"\b(?!-—)" seems slower
def pre... | SamuelLongchamps/grammalecte | compile_rules.py | Python | gpl-3.0 | 24,371 |
"""Pygame event handler by J.
This module consists of the EventHandler class, which is used to assign
callbacks to events and keypresses in Pygame.
Release: 12.
Licensed under the GNU General Public License, version 3; if this was not
included, you can find it here:
http://www.gnu.org/licenses/gpl-3.0.txt
"""
... | ikn/brjaf | brjaf/ext/evthandler.py | Python | gpl-3.0 | 12,404 |
#!/usr/bin/env python
import os
import argparse
from os.path import join, abspath
from sh import which
import sleuth_automation as sleuth
from jinja2 import Environment, PackageLoader
description = """
This script will create a condor submit file for a batch of SLEUTH runs.
"""
parser = argparse.ArgumentParser(descr... | sostenibilidad-unam/sleuth_automation | bin/create_sleuth_condor_batch.py | Python | gpl-3.0 | 1,461 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013,2014 Rodolphe Quiédeville <rodolphe@quiedeville.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 ver... | rodo/django-perf | foo/offset/management/commands/keypage_prepare_fields.py | Python | gpl-3.0 | 2,395 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2018-12-04 15:13
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('anagrafica', '0049_auto_20181028_1639')... | CroceRossaItaliana/jorvik | survey/migrations/0001_initial.py | Python | gpl-3.0 | 2,602 |
# -*- coding: utf-8 -*-
# +---------------------------------------------------------------------------+
# | 01001110 01100101 01110100 01111010 01101111 01100010 |
# | |
# | Netzob : Inferring communication prot... | dasbruns/netzob | src/netzob/Common/Models/Types/Raw.py | Python | gpl-3.0 | 7,876 |
import libhfst
transducers = []
istr = libhfst.HfstInputStream()
while not istr.is_eof():
transducers.append(istr.read())
istr.close()
if not len(transducers) == 3:
raise RuntimeError('Wrong number of transducers read.')
i = 0
for re in ['föö:bär','0','0-0']:
if not transducers[i].compare(libhfst.regex(r... | unhammer/hfst3 | python/test/test_streams_2.py | Python | gpl-3.0 | 615 |
# coding: utf-8
from gui import *
import thread
import color
import time
import os
from PyQt4 import QtGui
from PyQt4 import QtCore
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import YaoSpeech
from dialogue import *
class dialogue_thread(QThread):
def __init__(self):
QThread.__init__(self)
self.voi... | strin/yaotalk | main.py | Python | gpl-3.0 | 1,714 |
from django.shortcuts import render
from .models import GeoLocation
from django.http import HttpResponse
def log_location(request):
"""
:params
:lat - latitude
:lon - longitude
:user_agent - useful for IOT applications that needs to log the client
that send the location
"""
if request.method == 'G... | abhijithmannath/ml-ceeri | geo/views.py | Python | gpl-3.0 | 594 |
import io
import os
import pickle
import sys
import tempfile
import unittest
import numpy as np
import pystan
from pystan.tests.helper import get_model
from pystan.experimental import unpickle_fit
class TestPickle(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.pickle_file = os.path.join(te... | ariddell/pystan | pystan/tests/test_pickle.py | Python | gpl-3.0 | 4,607 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | ingenieroariel/geonode | geonode/groups/forms.py | Python | gpl-3.0 | 5,314 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# === This file is part of RateItSeven ===
#
# Copyright 2015, Paolo de Vathaire <paolo.devathaire@gmail.com>
#
# RateItSeven 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... | AltarBeastiful/rateItSeven | rateItSeven/scan/legacy/moviescanner.py | Python | gpl-3.0 | 1,660 |
# -*- coding: utf-8 -*-
'''
@author: Hung-Hsin Chen
@mail: chenhh@par.cse.nsysu.edu.tw
kelly multivariate investment
'''
if __name__ == '__main__':
pass | chenhh/PySPPortfolio | PySPPortfolio/KellySPPortfolio.py | Python | gpl-3.0 | 159 |
"""Database interface module.
app/db.py
"""
# standard imports
import os
import sqlite3
from sqlite3 import Error
from ast import literal_eval
# 3rd party imports
from termcolor import cprint
# local imports
from app.room import Office, Living
from app.person import Staff, Fellow
def create_connection(database):
... | Mbarak-Mbigo/cp1_project | app/db.py | Python | gpl-3.0 | 6,719 |
# -*- coding: utf-8 -*-
"""
Django settings for app-framework project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/r... | tjm-1990/blueking | conf/default.py | Python | gpl-3.0 | 11,273 |
# -*- coding: UTF-8 -*-
# Syntax definition automatically generated by hljs2xt.py
# source: ruby.js
name = 'Ruby'
file_patterns = ['*.ruby', '*.rb', '*.gemspec', '*.podspec', '*.thor', '*.irb']
keyword = """
and false then defined module in return redo if BEGIN retry end for
true self when next until do begin ... | editxt/editxt | resources/syntax/ruby.syntax.py | Python | gpl-3.0 | 6,546 |
# Copyright (C) 2017 Xavier Lucas
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in ... | xlucas/confluence-python-cli | confluenceclient/plugins/credentials/keyring/plugin.py | Python | gpl-3.0 | 1,553 |
# solflag.py:
#
# Copyright (C) 2007
# 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 the GNU General Public L... | kernsuite-debian/lofar | CEP/Calibration/BBSControl/scripts/solflag.py | Python | gpl-3.0 | 8,453 |
from __future__ import (absolute_import, division, print_function)
from mantid.kernel import logger
import AbinsModules
import six
from mantid.kernel import Atom
class GeneralAbInitioProgramName(type):
def __str__(self):
return self.__name__
# noinspection PyMethodMayBeStatic
@six.add_metaclass(GeneralA... | ScreamingUdder/mantid | scripts/AbinsModules/GeneralAbInitioProgram.py | Python | gpl-3.0 | 10,789 |
#!/usr/bin/python
# Welcome to CLRenew, a simple python script that automates mouse clicks to
# renew craigslist postings credit to https://github.com/yuqianli for base code
import pyautogui
import os
# Set a counter to count the # of exceptions occur
counter = 0
# Start the while loop
while True:
try:
pri... | calexil/CLRenew | renew.py | Python | gpl-3.0 | 1,501 |
import data
from utils import assert_403, assert_404, assert_200, parse_xml, xpath
PRD = 'prd'
def test_sharing(IndivoClient):
DS = 'ds'
def get_datastore(obj):
if hasattr(obj, DS):
return getattr(obj, DS).values()
return False
def set_datastore(obj, **kwargs):
if hasattr(obj, DS):
d... | newmediamedicine/indivo_server_1_0 | indivo/tests/integration/test_modules/sharing.py | Python | gpl-3.0 | 7,841 |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
fig, ax = plt.subplots()
#ax = plt.gca()
#ax.set_autoscale_on(False)
polygons = []
color = []
c = (np.random.random((1, 3))*0.6+0.4).tolist()[0]
# polygon
my... | CivilNet/Gemfield | src/python/pascal_voc_xml2json/seg.py | Python | gpl-3.0 | 1,609 |
# Copyright (C) 2008 David Bern
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed... | odie5533/Python-RTSP | rdt.py | Python | gpl-3.0 | 21,513 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-05 09:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rules', '0057_auto_20180302_1312'),
]
operations = [
migrations.AddField(
model_name='source',
... | StamusNetworks/scirius | rules/migrations/0058_source_public_source.py | Python | gpl-3.0 | 440 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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... | ROIV/ViorCoin-ElectrumWallet | lib/transaction.py | Python | gpl-3.0 | 27,739 |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.github.io
# Git: https://github.com/SickRage/SickRage.git
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free... | p0psicles/SickRage | sickbeard/helpers.py | Python | gpl-3.0 | 59,494 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 The ProteinDF development team.
# see also AUTHORS and README if provided.
#
# This file is a part of the ProteinDF software package.
#
# The ProteinDF is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | ProteinDF/ProteinDF_bridge | proteindf_bridge/modeling.py | Python | gpl-3.0 | 24,765 |
#!/usr/bin/python
def kvadraticka(a, b, c):
return 20
def kubicka(a, b, c, d):
return 77
x = 16
y = 'ahoj'
print 'Inicializuji se'
| tlapicka/2013-2014.3A | rovnice.py | Python | gpl-3.0 | 145 |
"""Business logic for all URLs in the ``main`` application.
For details on what each function is responsible for, see ``main/urls.py``.
That module documents both URL-to-function mappings and the exact
responsiblities of each function.
"""
from django.core import urlresolvers
from django import http
def index(reques... | Ichimonji10/elts | apps/main/views.py | Python | gpl-3.0 | 472 |
# -*- coding: utf-8 -*-
"""Copyright (C) 2013 COLDWELL AG
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 dist... | MoroGasper/client | tests/test_recaptcha.py | Python | gpl-3.0 | 1,831 |
# Copyright (C) 2016 Red Hat, Inc
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in ... | cooktheryan/commissaire | test/test_handlers_status.py | Python | gpl-3.0 | 2,512 |
import os
from iotile.core.dev import ComponentRegistry
from iotile.ship.recipe import RecipeObject
from iotile.ship.exceptions import RecipeNotFoundError
class RecipeManager:
"""A class that maintains a list of installed recipes and recipe actions.
It allows fetching recipes by name and auotmatically buildi... | iotile/coretools | iotileship/iotile/ship/recipe_manager.py | Python | gpl-3.0 | 4,144 |
#!/usr/bin/env python2.7
# Author: echel0n <echel0n@sickrage.ca>
# URL: https://sickrage.ca
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of t... | gborri/SickRage | tests/test_xem.py | Python | gpl-3.0 | 2,900 |
from django.db import models
from django.utils.timezone import now
# Create your models here.
class Pagina(models.Model):
titulo = models.CharField(max_length=200, unique=True)
contenido = models.TextField()
imagen = models.ImageField(upload_to='pagina_img', default='media/default.png')
orden = models.PositiveInt... | jenriquezdeceano/asit.mx | src/pagina/models.py | Python | gpl-3.0 | 502 |
import numpy as np
import exceptions
import healpy
from file import read
def read_map(filename, HDU=0, field=0, nest=False):
"""Read Healpix map
all columns of the specified HDU are read into a compound numpy MASKED array
if nest is not None, the map is converted if need to NEST or RING ordering.
thi... | zonca/pycfitsio | pycfitsio/healpix.py | Python | gpl-3.0 | 1,092 |
from __future__ import (absolute_import, division, print_function)
import unittest
import sys
from sans.gui_logic.models.beam_centre_model import BeamCentreModel
from sans.common.enums import FindDirectionEnum, SANSInstrument
if sys.version_info.major == 3:
from unittest import mock
else:
import mock
class ... | ScreamingUdder/mantid | scripts/test/SANS/gui_logic/beam_centre_model_test.py | Python | gpl-3.0 | 5,587 |
# 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 'Hardwarerelease.medium'
db.add_column('ashop_hardwarerelease', 'medium', self.gf('django.d... | hzlf/openbroadcast | website/apps/ashop/migrations/0015_auto__add_field_hardwarerelease_medium.py | Python | gpl-3.0 | 23,666 |
# -*- coding: utf-8 -*-
import kivymd.snackbar as Snackbar
from kivy.app import App
from kivy.lang import Builder
from kivy.metrics import dp
from kivy.properties import ObjectProperty
from kivy.uix.image import Image
from kivymd.bottomsheet import MDListBottomSheet, MDGridBottomSheet
from kivymd.button import MDIconBu... | jmadajian/CinemaFlowWorks | Examples/kitchen_sink.py | Python | gpl-3.0 | 41,711 |
'''
Construct and manipulate multilayer representations of configuration vectors
Created by: Ankit Khambhati
Change Log
----------
2016/02/03 - Implement functions to construct multilayer networks
'''
import numpy as np
import scipy.sparse as sp
from ....Common import errors
from ...Transforms import configuration
... | akhambhati/Echobase | Echobase/Network/Partitioning/Module/modularity.py | Python | gpl-3.0 | 3,949 |
# Copyright (C) 2010-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 v... | KaiSzuttor/espresso | testsuite/python/constraint_shape_based.py | Python | gpl-3.0 | 36,175 |
"""
Setup Module
This module is used to make a distribution of
the game using distutils.
"""
from distutils.core import setup
setup(
name = 'Breakout',
version = '1.0',
description = 'A remake of the classic video game',
author = 'Derek Morey',
author_email = 'dman... | Oisota/Breakout | setup.py | Python | gpl-3.0 | 2,098 |
#!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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 y... | edb1rd/BTC | plugins/trustedcoin.py | Python | gpl-3.0 | 25,459 |
# Generated by Django 3.0.4 on 2020-04-15 23:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('config', '0026_hardware_id_not_unique')]
operations = [
migrations.AlterField(
model_name='device',
name='last_ip',
f... | nemesisdesign/openwisp2 | openwisp_controller/config/migrations/0027_add_indexes_on_ip_fields.py | Python | gpl-3.0 | 982 |
# coding: utf-8
#
# Copyright 2012 NAMD-EMAP-FGV
#
# This file is part of PyPLN. You can get more information at: http://pypln.org/.
#
# PyPLN 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 o... | fccoelho/pypln.backend | pypln/backend/workers/tokenizer.py | Python | gpl-3.0 | 1,140 |
# -*- coding: utf-8 -*-
# Author: Matías Bordese
"""Tests for the unified diff parser process."""
import os.path
import unittest2
from nlg4patch.unidiff import parser
class TestUnidiffParser(unittest2.TestCase):
"""Tests for Unified Diff Parser."""
def setUp(self):
samples_dir = os.path.dirname(o... | DrDub/nlg4patch | nlg4patch/unidiff/tests/test_parser.py | Python | gpl-3.0 | 1,824 |
# -*- coding: utf-8 -*-
from resources.lib.parser import cParser
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.gui.gui import cGui
from resources.lib.util import cUtil
from resources.lib.handler.ParameterHandler import Parameter... | dbiesecke/plugin.video.xstream | sites/bundesliga_de.py | Python | gpl-3.0 | 7,292 |
import maya.cmds;mc = maya.cmds
import pymel.core;pm = pymel.core
from pytaya.core.general import listForNone
from pytd.util.logutils import logMsg
from pytd.util.sysutils import grouper
def fileNodesFromObjects(oObjList):
return fileNodesFromShaders(shadersFromObjects(oObjList))
def fileNodesFromShaders(oMatL... | sebcourtois/pypeline-tool-devkit | pytaya/core/rendering.py | Python | gpl-3.0 | 12,494 |
# -*- coding: utf-8 -*-
"""
"""
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
# testing if we are preserving task_data between wf jumps
def main_wf(current):
current.task_data['from_main'] = True
current.output['... | zetaops/zengine | tests/views/jump_to.py | Python | gpl-3.0 | 692 |
TestNet = False
Address = "1MjeEv3WDgycrEaaNeSESrWvRfkU6s81TX"
workerEndpoint = "3333"
DonationPercentage = 0.0
Upnp = True
BitcoindConfigPath = "/opt/bitcoin/bitcoindata/bitcoin.conf"
WORKER_STATUS_REFRESH_TIME = 10
dbService = {}
workerStatus = {}
NodeService = {
'authentication': 'http://127.0.0.1:8080/servi... | bitmaintech/p2pool | config.py | Python | gpl-3.0 | 545 |
#!/usr/bin/env python3
import asm, datetime, os
"""
Import script for Shelterpro databases in DBF format
Requires my hack to dbfread to support VFP9 -
copy parseC in FieldParser.py and rename it parseV, then remove
encoding so it's just a binary string that can be ignored.
Requires address.dbf, addrlink.dbf, anim... | bobintetley/asm3 | import/shelterpro_dbf.py | Python | gpl-3.0 | 18,704 |
import time
start = time.time()
def prime_factors(n):
l = []
i = 2
while n != 1:
if n % i == 0:
l.append(i)
while n % i == 0:
n = n // i
i += 1
return l
print(prime_factors(600851475143)[-1])
elapsed = time.time() - start
print("time elapsed... | libranwizard/projecteuler | euler3.py | Python | gpl-3.0 | 344 |
"""TBD
"""
import os
import sys
import time
import subprocess
import xmlrpc.client
class ApplicationMonitor(object):
"""Responsible for launching, monitoring, and terminating the FLDIGI application process, using subprocess.Popen()
:param hostname: The FLDIGI XML-RPC server's IP address or hostname (usuall... | KM4YRI/pyFldigi | pyfldigi/appmonitor.py | Python | gpl-3.0 | 6,913 |
# PPFem: An educational finite element code
# Copyright (C) 2015 Matthias Rambausek
#
# 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 ... | mrambausek/PPFem | ppfem/__init__.py | Python | gpl-3.0 | 1,648 |
from random import random, seed
import numpy as np
from skued import biexponential, exponential, with_irf
seed(23)
def test_exponential_tzero_limits():
"""Test that the output of ``exponential`` has the correct time-zero"""
tzero = 10 * (random() - 0.5) # between -5 and 5
amp = 5 * random() + 5 # bet... | LaurentRDC/scikit-ued | skued/time_series/tests/test_fitting.py | Python | gpl-3.0 | 6,251 |
#!/usr/bin/env python
# - * - mode: python; coding: utf-8 - * -
# Copyright (C) 2013 Andrey Degtyarev <ad.dycost@gmail.com>
# This program is distributed licensed under the GNU General Public License v.3
# as published by the Free Software Foundation.
import manage_pressure.constants, manage_pressure.work_device, ti... | ad-dycost/mindhouse | manage_pressure/watching.py | Python | gpl-3.0 | 576 |
# -*- coding: utf-8 -*-
from queue import Queue
from lxml import etree
import requests
import random
from settings import *
import time
import socket
from pybloom_live import BloomFilter
from settings import log
import os
from settings import REFRESH_BF
from settings import MIN_NUM
import redis
import threading
import... | yutian2011/IPProxy | proxy.py | Python | gpl-3.0 | 5,041 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Performing mathematical calculations """
WEEKS = (((19 % 10) + 100) + (2 ** 8)) / 7
| nparrilla/is210-week-03-warmup | task_02.py | Python | mpl-2.0 | 135 |
__all__ = ["sqlite_dump", "sqlite_merge"]
from random import Random
import math
def random_expectations(depth=0, breadth=3, low=1, high=10, random=Random()):
"""
Generate depth x breadth array of random numbers where each row sums to
high, with a minimum of low.
"""
result = []
if depth == 0:... | greenape/risky-aging-model | disclosuregame/Util/__init__.py | Python | mpl-2.0 | 3,317 |
# encoding: utf-8
#
#
# 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divisi... | klahnakoski/ActiveData | vendor/jx_elasticsearch/es52/painless/not_op.py | Python | mpl-2.0 | 1,218 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 21:26
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers
class Migration(migrations.Migration):
initial = True
dependenci... | VWApplications/VWCourses | forum/migrations/0001_initial.py | Python | mpl-2.0 | 2,693 |
"""
sandman_pasta reimplements the behaviour of decaf-masta, but instead evaluates all calls to deployable heat templates
"""
import json
from decaf_storage.json_base import StorageJSONEncoder
from decaf_storage import Endpoint
from decaf_utils_components.base_daemon import daemonize
import yaml
import time
import u... | CN-UPB/OpenBarista | components/sandman-pasta/sandman_pasta/sandman_pasta.py | Python | mpl-2.0 | 14,698 |
# -*- coding: utf-8 -*-
# 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 __future__ import absolute_import
from datetime import datetime, timedelta
from flask impo... | srfraser/services | src/releng_notification_policy/releng_notification_policy/api.py | Python | mpl-2.0 | 8,694 |
#
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2014 Star2Billing S.L.
#
# The primar... | tarikgwa/nfd | newfies/agent/forms.py | Python | mpl-2.0 | 5,036 |
# 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/.
"""
Audit groups and removes inactive users.
"""
import datetime
from django.contrib.auth.models import Group, User
fr... | lonnen/socorro | webapp-django/crashstats/authentication/management/commands/auditgroups.py | Python | mpl-2.0 | 4,373 |
# Copyright (c) 2015-2016 Contributors as noted in the AUTHORS file
#
# 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 signal
import sys
from functools import par... | Alidron/demo-zwave-react | demo-zwave-react.py | Python | mpl-2.0 | 1,436 |
try:
import unittest.mock as mock
except ImportError:
import mock
import subprocess
import dags.utils.helpers as helpers
from dags.operators.postgres_to_s3_transfer import PostgresToS3Transfer
class TestPostgresToS3Transfer(object):
def test_its_created_successfully(self):
operator = PostgresToS3T... | opentrials/opentrials-airflow | tests/dags/operators/test_postgres_to_s3_transfer.py | Python | mpl-2.0 | 2,927 |
# Django settings for tests2 project.
import django
import sys
sys.path.append("../..")
sys.path.append("../../../../..")
from siteconf import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'djan... | EduPepperPDTesting/pepper2013-testing | lms/djangoapps/djangosaml2/unit_tests/settings.py | Python | agpl-3.0 | 5,559 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, _
from odoo.addons.http_routing.models.ir_http import url_for
class Website(models.Model):
_inherit = "website"
@api.model
def page_search_dependencies(self, page_id=False):
... | ygol/odoo | addons/website_blog/models/website.py | Python | agpl-3.0 | 2,036 |
# -*- coding: utf-8 -*-
# Copyright 2016 Eficent Business and IT Consulting Services S.L.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).
from openerp.tests import common
from openerp.tools import SUPERUSER_ID
class TestPurchaseRequest(common.TransactionCase):
def setUp(self):
super(... | SerpentCS/purchase-workflow | purchase_request/tests/test_purchase_request.py | Python | agpl-3.0 | 1,728 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) Open Solutions Finland 2013.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gen... | OpenSolutionsFinland/exporting | __openerp__.py | Python | agpl-3.0 | 1,635 |
from datetime import datetime
from collections import defaultdict
DEFAULT_RELEASE = datetime(1970, 1, 1)
_SORT_KEY = lambda eps: eps[0].released or DEFAULT_RELEASE
class PodcastGrouper(object):
"""Groups episodes of two podcasts based on certain features
The results are sorted by release timestamp"""
... | gpodder/mygpo | mygpo/administration/group.py | Python | agpl-3.0 | 1,212 |
import where_query
| galtys/galtys-addons | account_move_line_where_query/__init__.py | Python | agpl-3.0 | 19 |
# This file is part of django-popularity.
#
# django-popularity: A generic view- and popularity tracking pluggable for Django.
# Copyright (C) 2008-2010 Mathijs de Bruin
#
# 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 ... | carschar/django-popularity | popularity/models.py | Python | agpl-3.0 | 22,870 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2012 Jens Hoffmann (hoffmaje)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from django.db import models
from django.contrib.auth.models import User
| hoffmaje/layla | layla/vocabularymanager/models.py | Python | agpl-3.0 | 240 |
# PAPAS Access Point Administration System
# Copyright (c) 2010 Revolution Linux inc. <info@revolutionlinux.com>
#
# 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
... | veloutin/papas | apmanager/genericsql/models.py | Python | agpl-3.0 | 8,678 |
#!/usr/bin/env python3
# noinspection PyUnresolvedReferences
import init_django
from django.db import transaction
from common.utils import utcnow
from main.archive import DataArchiver
from main.delete import DataDeleter
from main.models import Ranking
from main.purge import purge_player_data
from tasks.base import C... | andersroos/rankedftw | tasks/delete_data_for_sample.py | Python | agpl-3.0 | 2,383 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2014-2022 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... | gem/oq-engine | openquake/hazardlib/gsim/arroyo_2010.py | Python | agpl-3.0 | 9,135 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | titasakgm/brc-stock | openerp/addons/bangkok_rubber/__openerp__.py | Python | agpl-3.0 | 1,546 |
import re
from django.contrib.auth.models import User
from django.db import models
from common.models import ExtraBase
CHALLENGES_TYPE = (
('p', 'playable player'),
('np', 'not playable player'),
)
class Challenge(models.Model, ExtraBase):
name = models.CharField(max_length=200, blank=True, null=True)... | wadobo/socializa | backend/game/models.py | Python | agpl-3.0 | 3,494 |
from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
## OOPS this is a custom widget that works for initializing
## tinymce instances on stacked and tabular inlines
## for flatpages, just use the tinymce packaged one... | voer-platform/vp.web | vpw/admin.py | Python | agpl-3.0 | 724 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015-2017 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... | ecino/compassion-accounting | account_analytic_attribution/models/__init__.py | Python | agpl-3.0 | 499 |
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
import deform
import colander
from pyramid.view import view_config
from dace.objectofcollaboration.principal.util import get_current
from dace.processinstance.core im... | ecreall/lagendacommun | lac/views/lac_view_manager/questionnaire/improve.py | Python | agpl-3.0 | 3,097 |
#-*- encoding=utf-8 -*-
'''
Created on Jan 18, 2013
@author: brian
'''
import openid
from openid.fetchers import HTTPFetcher, HTTPResponse
from urlparse import parse_qs, urlparse
from django.conf import settings
from django.test import TestCase, LiveServerTestCase
from django.core.cache import cache
from django.test.... | caesar2164/edx-platform | openedx/core/djangoapps/external_auth/tests/test_openid_provider.py | Python | agpl-3.0 | 21,198 |
# -*- coding: utf-8 -*-
# Copyright© 2016 ICTSTUDIO <http://www.ictstudio.eu>
# License: AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
{
"name": 'Operating Unit - Changeable Invoice Line',
"version": "8.0.1.0.0",
"summary": "Default use operating unit of Invoice but be able to change per line",
... | ICTSTUDIO/accounting-addons | account_operating_unit_invoice_line/__openerp__.py | Python | agpl-3.0 | 588 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-04-16 16:39
from __future__ import unicode_literals
import base.models.learning_unit_year
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
... | uclouvain/osis_louvain | base/migrations/0260_auto_20180416_1839.py | Python | agpl-3.0 | 4,812 |
#!/usr/bin/python2.7
# encoding: utf-8
from __future__ import division
import numpy as np
# from pyproj import Proj, pj_list, pj_ellps
import cv2
def geo_ref_tracks(tracks, frame, uav, debug=False):
"""
Geo-references tracks'points
:param tracks: list of drifters' trajectories
:param frame: CV2 frame... | theelectricbrain/Drones-Drifters | drones_n_drifters/georef/geo_referencing.py | Python | agpl-3.0 | 4,964 |
from django.urls import reverse
from course_discovery.apps.api.v1.tests.test_views.mixins import APITestCase, SerializationMixin
from course_discovery.apps.core.tests.factories import USER_PASSWORD, UserFactory
from course_discovery.apps.course_metadata.models import LevelType
from course_discovery.apps.course_metadat... | edx/course-discovery | course_discovery/apps/api/v1/tests/test_views/test_level_types.py | Python | agpl-3.0 | 1,985 |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Greeting(models.Model):
when = models.DateTimeField('date created', auto_now_add=True)
class Material(models.Model):
name = models.CharField(max_length=200)
price = models.FloatField(blank=True, null... | Emrals/matter | hello/models.py | Python | agpl-3.0 | 900 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
###########################################################
# © 2011 Daniel 'grindhold' Brendle and Team
#
# This file is part of Skarphed.
#
# Skarphed is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as ... | skarphed/skarphed | admin/src/skarphedadmin/gui/skarphed/Role.py | Python | agpl-3.0 | 4,713 |
"""Utilities for working with ID tokens."""
import json
from time import time
from django.conf import settings
from django.utils.functional import cached_property
from jwkest import jwk
from jwkest.jws import JWS
from student.models import UserProfile, anonymous_id_for_user
class JwtBuilder(object):
"""Utility ... | ahmedaljazzar/edx-platform | openedx/core/lib/token_utils.py | Python | agpl-3.0 | 4,328 |
from telecommand import Telecommand
class GetCompileInfoTelecommand(Telecommand):
def __init__(self):
Telecommand.__init__(self)
def apid(self):
return 0x27
def payload(self):
return [] | PW-Sat2/PWSat2OBC | integration_tests/telecommand/compile_info.py | Python | agpl-3.0 | 236 |
"""
The latest version of this package is available at:
<http://github.com/jantman/webhook2lambda2sqs>
################################################################################
Copyright 2016 Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
This file is part of webhook2lambda2sqs, also kno... | jantman/webhook2lambda2sqs | webhook2lambda2sqs/version.py | Python | agpl-3.0 | 1,938 |
from odoo import api, fields, models, tools
class UnrelatedDocumentsReport(models.Model):
_name = "sicon.unrelated_documents.report"
_description = 'Documents not related yet to any concession'
_auto = False
dependence_id = fields.Many2one(comodel_name='tmc.dependence',
... | tmcrosario/odoo-sicon | sicon/report/unrelated_documents.py | Python | agpl-3.0 | 2,065 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | hivam/l10n_co_doctor | report/doctor_disability_half.py | Python | agpl-3.0 | 3,267 |
from annoying.functions import get_object_or_None
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.db.models import Q
# Class to permit the authentication using email or username, with case sensitive and insensitive matches.
class CustomBackend(ModelBack... | astrobin/astrobin | astrobin/auth.py | Python | agpl-3.0 | 1,134 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('ccx', '0017_auto_20170721_0437'),
]
operations = [
migrations.AlterField(
model_name='customcour... | mbareta/edx-platform-ft | lms/djangoapps/ccx/migrations/0018_auto_20170721_0611.py | Python | agpl-3.0 | 472 |
"""Auth pipeline definitions.
Auth pipelines handle the process of authenticating a user. They involve a
consumer system and a provider service. The general pattern is:
1. The consumer system exposes a URL endpoint that starts the process.
2. When a user visits that URL, the client system redirects the user t... | CredoReference/edx-platform | common/djangoapps/third_party_auth/pipeline.py | Python | agpl-3.0 | 35,110 |
#!python3.3
# -*- coding: utf-8 -*-
"""
.. module:: examples.benchmarks
:platform: Agnostic, Windows
:synopsis: Full suite of benchmarks
Created on 10/08/2013
"""
def standard_iges_setup(system, filename):
system.StartSection.Prolog = " "
system.GlobalSection.IntegerBits = int(32)
syst... | mdecourse/2016fallcadp | data/pyIGES/docs/examples/benchmarks/__init__.py | Python | agpl-3.0 | 1,103 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-06 11:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='NewsIt... | nmunro/azathoth | news/migrations/0001_initial.py | Python | agpl-3.0 | 603 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.