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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Third Party Stuff
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('certificate', '0003_auto_20160816_1148'),
]
operations = [
migrations.DeleteModel(
name='Dwsim_participant',
),
mig... | Spoken-tutorial/spoken-website | certificate/migrations/0004_auto_20160818_1609.py | Python | gpl-3.0 | 2,044 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frédéric Rodrigo 2015 ##
## ... | tyndare/osmose-backend | analysers/analyser_osmosis_bad_intersection.py | Python | gpl-3.0 | 4,639 |
# coding: utf-8
"""
Kipartman
Kipartman api specifications
OpenAPI spec version: 1.0.0
Contact: --
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class DistributorData(object):
"""
NOTE: This class is... | turdusmerula/kipartman | kipartman/swagger_client/models/distributor_data.py | Python | gpl-3.0 | 7,136 |
#!/usr/bin/env python
# Script for processing with map reduce the Open Street Map datasets.
# Counts the number of GPS hits in a discretized and scaled coordinates space.
# Example of input row: -778591613,1666898345 [as described here: http://blog.osmfoundation.org/2012/04/01/bulk-gps-point-data/ ]
# Example of out... | pviotti/osm-viz | map_points.py | Python | gpl-3.0 | 1,183 |
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gio
UI_PATH = '/io/github/ImEditor/ui/'
class ImEditorHeaderBar():
__gtype_name__ = 'ImEditorHeaderBar'
def __init__(self):
builder = Gtk.Builder.new_from_resource(UI_PATH + 'headerbar.ui')
self.header_bar = builder.get... | ImEditor/ImEditor | src/interface/headerbar.py | Python | gpl-3.0 | 711 |
# -*- encoding: utf-8 -*-
"""Test for Roles CLI
@Requirement: Filter
@CaseAutomation: Automated
@CaseLevel: Acceptance
@CaseComponent: CLI
@TestType: Functional
@CaseImportance: High
@Upstream: No
"""
from robottelo.cli.base import CLIReturnCodeError
from robottelo.cli.factory import (
make_filter,
make... | Ichimonji10/robottelo | tests/foreman/cli/test_filter.py | Python | gpl-3.0 | 6,479 |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse_urlencode,
)
from ..utils import (
ExtractorError,
int_or_none,
qualities,
)
class FlickrIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.|secure\.)?flickr\.com/photos/[\w\-_@]+/(?... | valmynd/MediaFetcher | src/plugins/youtube_dl/youtube_dl/extractor/flickr.py | Python | gpl-3.0 | 3,980 |
'''
'''
import sys
import os
import gzip
import regex
# 'borrowed' from CGAT - we may not need this functionality
# ultimately. When finalised, if req., make clear source
def openFile(filename, mode="r", create_dir=False):
'''open file called *filename* with mode *mode*.
gzip - compressed files are recognized... | k3yavi/alevin | testing/src-py/Utilities.py | Python | gpl-3.0 | 3,040 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010 Christophe Benz
#
# 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, version 3 of the License.
#
# This program is distributed in the hope that it will... | jocelynj/weboob | weboob/tools/config/iniconfig.py | Python | gpl-3.0 | 4,039 |
#!/usr/bin/python
# 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 th... | orlandov/parpg-game | local_loaders/xmlmap.py | Python | gpl-3.0 | 13,207 |
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of the G... | espressopp/espressopp | src/Tensor.py | Python | gpl-3.0 | 3,339 |
'''
This file is part of python-libdeje.
python-libdeje is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
python-libdeje is distribute... | campadrenalin/python-libdeje | deje/quorum.py | Python | gpl-3.0 | 5,211 |
# -*- coding: utf-8 -*-
import os
# a simple cubic spline example.
#
# generate some random data in 10 intervals -- note the data changes
# each time this is run.
#
# Our form of the spline polynomial comes from Pang, Ch. 2
#
# solve the matrix system for the splines
#
# plot the splines
#
# M. Zingale (2013-02-10)
... | NicovincX2/Python-3.5 | Analyse (mathématiques)/Analyse numérique/Interpolation numérique/Spline/Spline cubique d'Hermite/cubic_spline_tri.py | Python | gpl-3.0 | 3,203 |
"""
@file sumoConfigGen.py
@author Craig Rafter
@date 29/01/2016
Code to generate a config file for a SUMO model.
"""
def sumoConfigGen(modelname='simpleT', configFile='./models/simpleT.sumocfg',
exportPath='../', AVratio=0, stepSize=0.01,
run=0, port=8813):
configXML ... | cbrafter/CrowdTLL | generalCode/sumoConfigGen.py | Python | gpl-3.0 | 1,642 |
#!/usr/bin/env python3
import sys
import os
import re
useful_codes = []
with open(sys.argv[1]) as f:
for l in f.readlines():
useful_codes.append(l.rstrip())
# Read from sqlite3.h (from stdin)
# only codes that exist in useful_codes are included in consts.c
for line in sys.stdin.readlines():
# fields = [ "#de... | pekingduck/emacs-sqlite3-api | tools/gen-consts.py | Python | gpl-3.0 | 908 |
class WeightSensor:
weight = 0 #weight in grams
def __init__(self):
self.weight = 0
def getWeight(self):
if(self.weight < 700):
self.weight = self.weight + 5
return self.weight
| SYSC-3010-F5/AVA-SH | src/coffee-maker/WeightStub.py | Python | gpl-3.0 | 274 |
# coding=utf-8
"""
General database interfacing abstractions.
"""
| bigbangdev/cityhelpdeskdjango | cityhelpdesk/utility/db/__init__.py | Python | gpl-3.0 | 66 |
# -*- coding: utf-8 -*-
# django-po2xls
# tests/management/commands/test_po-to-xls.py
import os
import pathlib
from typing import List
from importlib import import_module
from django.test import TestCase
# po-to-xls management command imported on the fly
# because we can't import something from the module that co... | vint21h/django-po2xls | tests/management/commands/test_po-to-xls.py | Python | gpl-3.0 | 1,479 |
#! /usr/bin/python3
# -*- coding:utf-8 -*-
"""
Define the "status" sub-command.
"""
from lib.transaction import *
from lib.color import color
import sys
import yaml
def status(conf, args):
"""Print staging transactions.
"""
if not conf:
# The account book is not inited
print("There is n... | a2ohm/picsou | sub/status.py | Python | gpl-3.0 | 1,333 |
# encoding: utf-8
import socket
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class RDLaser(object):
BUF_SIZE = 4096
CLIENT_PORT = 40200
SERVER_PORT = 50200
CMD_STOP = "d801".decode("HEX")
CMD_PAUSE_CONTINUE = "d803".decode("HEX")
CMD_HOME_XY = "d910000000000000000000... | soundstorm/RDWorksFileserver | RDWorks/RDLaser.py | Python | gpl-3.0 | 10,961 |
# -*- coding: utf-8 -*-
import unittest
from pathlib import Path
from .. import persons
from .asteriskfake import AsteriskFake
class AsteriskFake_Test(unittest.TestCase):
from yamlns.testutils import assertNsEqual
def setUp(self):
self.persons = Path('p.yaml')
self.persons.write_text(u"""\
... | Som-Energia/somenergia-tomatic | tomatic/pbx/asteriskfake_test.py | Python | gpl-3.0 | 6,875 |
class intersperse:
'''Generator that inserts a value before each element of an iterable
'''
def __init__(self, value, iterable):
self.value = value
self.iterable = iterable
self.return_value = True
def __iter__(self):
return self
def __next__(self):
... | orting/emphysema-estimation | Scripts/Util.py | Python | gpl-3.0 | 538 |
"""
WSGI config for captain project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | mozilla/captain | captain/wsgi.py | Python | mpl-2.0 | 1,653 |
#encoding: utf-8
from responsemodule import IModule
import urllib
import httplib2
import socket
import xmltodict
import re
'''
Example config
[walpha]
app_id=1LALAL-2LALA3LAL4
timeout=6
'''
settings_name_g = u'walpha'
api_key_g = u'app_id'
timeout_g = u'timeout'
class Wolfram(IModule):
def __init__(self):
... | undu/query-bot | wolfram/wolfram.py | Python | mpl-2.0 | 4,435 |
#from flask import Flask, request, Response
import argparse
import ConfigParser
import flask
import logging
import os
import shutil
import sys
import tempfile
import time
import senbonzakura.backend.core as core
import senbonzakura.cache.cache as cache
import senbonzakura.database.db as db
import senbonzakura.backend.... | ffledgling/Senbonzakura | senbonzakura/frontend/api.py | Python | mpl-2.0 | 10,807 |
from flask import current_app, flash, abort
from willow.app import willow_signals
from slugify import slugify
from willow.models import db, mixins
class Venue(db.Model, mixins.WLWMixin):
pass
| undergroundtheater/willow | willow/models/venue.py | Python | mpl-2.0 | 198 |
import os
config = {
# mozconfig file to use, it depends on branch and platform names
"platform": "macosx64",
"update_platform": "Darwin_x86_64-gcc3",
"mozconfig": "%(branch)s/browser/config/mozconfigs/macosx-universal/l10n-mozconfig",
"bootstrap_env": {
"SHELL": '/bin/bash',
"MOZ_O... | armenzg/build-mozharness | configs/single_locale/macosx64.py | Python | mpl-2.0 | 2,942 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop 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.
from __future__ import unicode_literals
from django.http import JsonRespons... | shawnadelic/shuup | shuup/simple_supplier/admin_module/views.py | Python | agpl-3.0 | 6,626 |
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
from samklang_menu.widgets import Widget
from samklang_pages.models import Page
class Image(Widget):
"""Image widget for adding an ... | sigurdga/samklang-pages | samklang_pages/widgets.py | Python | agpl-3.0 | 3,204 |
# -*- coding: utf-8 -*-
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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 ... | wger-project/wger | wger/nutrition/views/bmi.py | Python | agpl-3.0 | 7,575 |
# -*- coding: utf-8 -*-
import is_suivi_facture
import is_suivi_refacturation_associe
import is_suivi_intervention
import is_account_invoice_line
| tonygalmiche/is_coheliance | report/__init__.py | Python | agpl-3.0 | 147 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Santi Argüeso
# Copyright 2014 Pexego Sistemas Informáticos S.L.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | jgmanzanas/CMNT_004_15 | project-addons/stock_deposit/stock_deposit.py | Python | agpl-3.0 | 10,814 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Docente'
db.create_table('cadastro_docente', (
('id', self.gf('django.db.models.... | UFRB/chdocente | cadastro/migrations/0001_initial.py | Python | agpl-3.0 | 11,352 |
# -*- 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... | frankrousseau/weboob | modules/arte/browser.py | Python | agpl-3.0 | 9,423 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
#
# This program is free software: y... | Elico-Corp/odoo-addons | website_recaptcha/models/__init__.py | Python | agpl-3.0 | 1,075 |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from odoo import api, SUPERUSER_ID
_logger = logging.getLogger(__name__)
def post_init_hook(cr, registry):
"""
Create a payment group for every existint payment
"""
env = api.Environment(cr, SUPERUSER_ID, {})
# payments... | ingadhoc/account-payment | account_payment_group/hooks.py | Python | agpl-3.0 | 1,366 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | rschnapka/partner-contact | partner_relations_in_tab/model/__init__.py | Python | agpl-3.0 | 1,051 |
from django.utils.html import format_html
from django.utils.translation import ugettext as _
from django.contrib import admin
from django.urls import reverse
from rdrf.models.definition.models import Registry
from rdrf.models.definition.models import RegistryForm
from rdrf.models.definition.models import QuestionnaireR... | muccg/rdrf | rdrf/rdrf/admin.py | Python | agpl-3.0 | 19,470 |
# -*- coding:utf-8 -*-
#
#
# Copyright (C) 2015 Clear ICT Solutions <info@clearict.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either ver... | Clear-ICT/odoo-addons | sale_line_code/models.py | Python | agpl-3.0 | 1,037 |
# -*- coding: utf-8 -*-
# © 2015 Eficent - Jordi Ballester Alomar
# © 2015 Serpent Consulting Services Pvt. Ltd. - Sudhir Arya
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp.osv import fields, orm
class ProcurementOrder(orm.Model):
_inherit = 'procurement.order'
def _chec... | Eficent/odoo-operating-unit | mrp_operating_unit/models/procurement.py | Python | agpl-3.0 | 1,509 |
# 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 'CourseImage.year'
db.add_column('profiles_courseimage', 'year', self.gf('dj... | ParsonsAMT/Myne | datamining/apps/profiles/migrations/0008_auto__add_field_courseimage_year__add_field_courseimage_type__chg_fiel.py | Python | agpl-3.0 | 21,539 |
"""
Convenience functions built on top of boto that are useful
when we deploy using asgard.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import logging
import time
from datetime import datetime, timedelta
import backoff
import boto
from boto.exception import EC2ResponseE... | eltoncarr/tubular | tubular/ec2.py | Python | agpl-3.0 | 19,451 |
# encoding: utf-8
import datetime
import re
from south.db import db
from south.v2 import DataMigration
from django.db import models
import logging
VIDEO_SERVICE_REGEXES = (
('YouTube', r'http://gdata\.youtube\.com/feeds/'),
('YouTube', r'http://(www\.)?youtube\.com/'),
('blip.tv', r'http://(.+\.)?blip\.tv... | pculture/mirocommunity | localtv/migrations/0047_populate_calculated_source_type.py | Python | agpl-3.0 | 18,280 |
# Copyright (c) 2020 Aldo Hoeben / fieldOfView
# OctoPrintPlugin is released under the terms of the AGPLv3 or higher.
from cura.PrinterOutput.GenericOutputController import GenericOutputController
try:
# Cura 4.1 and newer
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice, ConnectionState... | fieldOfView/OctoPrintPlugin | OctoPrintOutputController.py | Python | agpl-3.0 | 1,276 |
import os.path
from common.base import INGIniousConfiguration
from common.task_file_managers.yaml_manager import TaskYAMLFileManager
_task_file_managers = [TaskYAMLFileManager]
def get_readable_tasks(courseid):
""" Returns the list of all available tasks in a course """
tasks = [
task for task in os... | GuillaumeDerval/INGInious | common/task_file_managers/manage.py | Python | agpl-3.0 | 1,952 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | frouty/odoogoeen | openerp/osv/orm.py | Python | agpl-3.0 | 272,006 |
import getpass
import statsd
import logging
LOG = logging.getLogger(__name__)
def increment_as_user(*label_components):
try:
statsd.increment(assemble_label(label_components, getpass.getuser()))
statsd.increment(assemble_label(label_components, 'total'))
except:
LOG.exception('failed ... | genome/flow-core | flow/util/stats.py | Python | agpl-3.0 | 685 |
from core.techniques.LFIExec import LFIExec
from base64 import b64encode
class LFIDataURI (LFIExec):
files_exec = [
# input
{ 'path' : '', 'type' : 'data_uri' },
]
# find LFI code execution path
def check (self):
return super(LFIDataURI, self)._check (prepare_check_data_uri)
... | m101/lfipwn | core/techniques/LFIDataURI.py | Python | agpl-3.0 | 1,128 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-07-28 13:17
from __future__ import unicode_literals
from django.db import migrations
import ideascube.models
class Migration(migrations.Migration):
dependencies = [
('library', '0005_auto_20160712_1324'),
]
operations = [
migra... | ideascube/ideascube | ideascube/library/migrations/0006_auto_20160728_1317.py | Python | agpl-3.0 | 3,408 |
"""Test Entitlements models"""
import unittest
from datetime import timedelta
from django.conf import settings
from django.test import TestCase
from django.utils.timezone import now
from lms.djangoapps.certificates.models import CertificateStatuses # pylint: disable=import-error
from lms.djangoapps.certificates.api... | proversity-org/edx-platform | common/djangoapps/entitlements/tests/test_models.py | Python | agpl-3.0 | 9,335 |
# -*- coding: utf-8 -*-
# © 2016 ClearCorp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Sale Order Terms & Conditions',
'version': '1.0',
'category': 'sales',
'sequence': 20,
'summary': '',
'description': """
Add Terms & Conditions to the sale order
==========... | ClearCorp/odoo-clearcorp | sale_order_terms_and_conds/__openerp__.py | Python | agpl-3.0 | 776 |
# -*- coding: utf-8 -*-
"""
Tests for the EnterpriseCourseEnrollmentview of the enterprise_learner_portal app.
"""
from collections import OrderedDict
import mock
from pytest import mark
from django.test import RequestFactory, TestCase
from enterprise.utils import NotConnectedToOpenEdX
from enterprise_learner_porta... | edx/edx-enterprise | tests/test_enterprise_learner_portal/api/test_serializers.py | Python | agpl-3.0 | 3,984 |
import csv
import hashlib
import hmac
import os
import re
from babel.dates import format_date
from codecs import getincrementalencoder
from imp import load_source
from numbers import Number
from os.path import splitext, join
from random import choice
import sys
from searx.version import VERSION_STRING
from searx.lang... | misnyo/searx | searx/utils.py | Python | agpl-3.0 | 9,614 |
# -*- coding: UTF-8 -*-
# Copyright 2014-2021 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
SETUP_INFO = dict(
name='lino-cosi',
version='21.3.0',
install_requires=['lino-xl', 'django-iban', 'lxml'],
# tests_require=['beautifulsoup4'], # satisfied by lin... | lsaffre/lino-cosi | lino_cosi/setup_info.py | Python | agpl-3.0 | 3,193 |
# -*- coding: utf-8 -*-
# Copyright 2017-2019 Barroux Abbey (www.barroux.org)
# Copyright 2017-2019 Akretion France (www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
class BaseConfigSettings(mo... | OCA/vertical-abbey | mass/base_config_settings.py | Python | agpl-3.0 | 793 |
# -*- coding: utf-8 -*-
'''
Django settings for foodcheck project
'''
# Copyright (C) 2013 Timothy James Austen, Eileen Qiuhua Lin,
# Richard Esplin <richard-oss@esplins.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Ge... | esplinr/foodcheck | wsgi/foodcheck_proj/settings.py | Python | agpl-3.0 | 8,249 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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... | runt18/nupic | src/nupic/regions/TestRegion.py | Python | agpl-3.0 | 15,152 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | SKIRT/PTS | modeling/component/component.py | Python | agpl-3.0 | 19,107 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('search', '0003_auto_20150826_0632'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | brianwc/courtlistener | cl/visualizations/migrations/0001_initial.py | Python | agpl-3.0 | 3,649 |
import ipgetter
from discord.ext import commands
from cogs.utils import checks
class WhatsMyIP:
"""
Assign roles based on trust rating
"""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
@checks.is_owner()
async def whatsmyip(self, ctx: commands.Cont... | bobloy/Fox-Cogs | whatsmyip/whatsmyip.py | Python | agpl-3.0 | 546 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from . import models
from dal import autocomplete
class NominationForm(forms.ModelForm):
class Meta:
model = models.Nomination
fields = ['plan', 'cv', 'certificates', 'gpa']
# To be used in the adm... | SAlkhairy/trabd | voting/forms.py | Python | agpl-3.0 | 633 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('stories', '0011_story_photo'),
]
operations = [
migrations.AlterField(
model_name='story',
name='pho... | storiesofsolidarity/story-database | stories/migrations/0012_auto_20151124_0442.py | Python | agpl-3.0 | 458 |
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Gunnerkrigg Court"
language = "en"
url = "http://www.gunnerkrigg.com/"
start_date = "2005-08-13"
rights = "Tom Siddell"
class Crawler(CrawlerBa... | jodal/comics | comics/comics/gunnerkrigg.py | Python | agpl-3.0 | 793 |
# Copyright (C) 2009 - TODAY Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import api, fields, models
class AccountTax(models.Model):
_inherit = 'account.tax'
fiscal_tax_ids = fields.Many2many(
comodel_name='l10n_br_fiscal.tax',
relation='l... | akretion/l10n-brazil | l10n_br_account/models/account_tax.py | Python | agpl-3.0 | 4,286 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Asgard Ledger Export (ALE) module,
# Copyright (C) 2005 - 2013
# Héonium (http://www.heonium.com). All Right Reserved
#
# Asgard Ledger Export (ALE) module
# is free software: you can redistribute it and/or modif... | noemis-fr/old-custom | e3z_account_export_grouped/account_export.py | Python | agpl-3.0 | 28,581 |
# -*- coding: utf-8 -*-
__license__ = "GNU Affero General Public License, Ver.3"
__author__ = "Pablo Alvarez de Sotomayor Posadillo"
# This file is part of Kirinki.
#
# Kirinki 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 ... | i02sopop/Kirinki | kirinki/mainviewer.py | Python | agpl-3.0 | 2,339 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
Bitcharts - ORM classes and functions
Copyright(c) 2014 - Lisandro Gallo (lisogallo)
liso@riseup.net
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 Found... | lisogallo/bitcharts-core-legacy | bitcharts.py | Python | agpl-3.0 | 24,568 |
from django.urls import reverse_lazy
from django.utils import timezone
from django.utils.translation import gettext as _
from django.views.generic import TemplateView
from .components import DashboardBaseMixin, DashboardAppMixin
from .dashboard_widgets import DashboardWidgets
from .shortcuts import check_permissions
... | d120/pyophase | dashboard/views.py | Python | agpl-3.0 | 3,245 |
from labonneboite.scripts import prepare_mailing_data as script
from labonneboite.tests.test_base import DatabaseTest
from labonneboite.common.models import Office
class PrepareMailingDataBaseTest(DatabaseTest):
"""
Create Elasticsearch and DB content for the unit tests.
"""
def setUp(self, *args, **k... | StartupsPoleEmploi/labonneboite | labonneboite/tests/scripts/test_prepare_mailing_data.py | Python | agpl-3.0 | 761 |
# coding: utf-8
import ui
import model
import console
import threading
from datetime import datetime, timedelta
@ui.in_background
def send_action(sender):
global main_view
weight = main_view['textfield_weight'].text
try:
model.register_weight(float(weight))
weight_changed_action(sender)
except BaseException a... | maurelio1234/weightreg | main.py | Python | agpl-3.0 | 1,841 |
# -*- coding: utf-8 -*-
# © 2011 Pexego Sistemas Informáticos (<http://www.pexego.es>)
# © 2015 Avanzosc (<http://www.avanzosc.es>)
# © 2015 Pedro M. Baeza (<http://www.serviciosbaeza.com>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import api, fields, models
class AccountInvoice(m... | Antiun/commission | sale_commission/models/account_invoice.py | Python | agpl-3.0 | 5,904 |
# Google (Web)
#
# @website https://www.google.com
# @provide-api yes (https://developers.google.com/custom-search/)
#
# @using-api no
# @results HTML
# @stable no (HTML can change)
# @parse url, title, content, suggestion
import re
from flask_babel import gettext
from lxml import html, etree
fro... | misnyo/searx | searx/engines/google.py | Python | agpl-3.0 | 13,491 |
from __future__ import absolute_import, unicode_literals
import traceback
from django.db import transaction
from django.utils import timezone, translation
from temba.orgs.models import Org
from temba.contacts.models import Contact
from temba.settings import BRANDING, DEFAULT_BRAND, HOSTNAME
class ExceptionMiddlewar... | praekelt/rapidpro | temba/middleware.py | Python | agpl-3.0 | 5,397 |
# -*- coding: utf-8 -*-
# Copyright 2020 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import (
purchase_request,
tier_definition,
)
| open-synergy/opnsynid-purchase-workflow | purchase_request_multiple_approval/models/__init__.py | Python | agpl-3.0 | 236 |
# -*- coding: utf-8 -*-
# Law-to-Code -- Extract formulas & parameters from laws
# By: Emmanuel Raviart <emmanuel@raviart.com>
#
# Copyright (C) 2013 OpenFisca Team
# https://github.com/openfisca/LawToCode
#
# This file is part of Law-to-Code.
#
# Law-to-Code is free software; you can redistribute it and/or modify
# ... | openfisca/LawToCode | lawtocode/texthelpers.py | Python | agpl-3.0 | 2,921 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Message'
db.create_table('controller_message', (
('id', self.gf('django.db.model... | edx/edx-ora | controller/migrations/0013_auto__add_message.py | Python | agpl-3.0 | 5,456 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/osis | base/views/entity/detail.py | Python | agpl-3.0 | 5,701 |
from datetime import date
import random
from radar.fixtures.utils import add, random_date
from radar.models.groups import Group, GROUP_TYPE
from radar.models.transplants import Transplant, TRANSPLANT_MODALITIES
def create_transplants_f():
hospitals = Group.query.filter(Group.type == GROUP_TYPE.HOSPITAL).all()
... | renalreg/radar | radar/fixtures/transplants.py | Python | agpl-3.0 | 1,019 |
"""check for method without self as first argument
"""
__revision__ = 0
class Abcd(object):
"""dummy class"""
def __init__(self):
pass
def abcd(yoo):
"""another test"""
abcd = classmethod(abcd)
def edf(self):
"""justo ne more method"""
print('y... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/pylint/test/input/func_e0203.py | Python | agpl-3.0 | 339 |
from django.conf import settings
from django.conf.urls import include, patterns, url
# There is a course creators admin table.
from ratelimitbackend import admin
from cms.djangoapps.contentstore.views.organization import OrganizationListView
admin.autodiscover()
# Pattern to match a course key or a library key
COURS... | fintech-circle/edx-platform | cms/urls.py | Python | agpl-3.0 | 9,697 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-08-03 13:15
# Django
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0041_profile_avatar_url'),
]
operations = [
migrations.RemoveField(
model_name='p... | MuckRock/muckrock | muckrock/accounts/migrations/0042_auto_20180803_0915.py | Python | agpl-3.0 | 709 |
import subprocess
import shutil
from unittest import TestCase
if shutil.which('flake8'):
class TestCodeQuality(TestCase):
def test_flake8(self):
self.assertEqual(0, subprocess.call('flake8'))
else:
print("I: skipping flake8 test (flake8 not available)")
| Linaro/squad | test/test_code_quality.py | Python | agpl-3.0 | 285 |
# © 2013 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import models
from .post_install import set_default_initiating_party
| OCA/bank-payment | account_banking_pain_base/__init__.py | Python | agpl-3.0 | 267 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import contextlib
import gzip
import json
import logging
import re
import sys
@contextlib.contextmanager
def smart_open_out(filename=None):
if filename and filename != '-':
fn = filename
fo = open(filename, 'w')
... | AlgoLab/PIntron-scripts | Postprocessing/pintron-output-2-json.py | Python | agpl-3.0 | 9,511 |
# -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * Copyright (c) 2016 sliptonic <shopinthewoods@gmail.com> *
# * ... | wood-galaxy/FreeCAD | src/Mod/Path/PathScripts/PathProfileEdges.py | Python | lgpl-2.1 | 32,805 |
from flask import Flask, render_template, request, redirect, Response, url_for, session, abort
import time, os, json, base64, hmac, urllib, random, string, datetime
from hashlib import sha1
from ConfigParser import SafeConfigParser
from logging import Formatter
import requests
import boto3
application = Flask(__name__... | igg/filedrop | filedrop/filedrop.py | Python | lgpl-2.1 | 5,365 |
# setup.py - distutils configuration for esm and esmre modules
# Copyright (C) 2007 Tideway Systems Limited.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the... | mangelin/esmre | setup.py | Python | lgpl-2.1 | 2,313 |
from lcapy import R, C
n = C('C1') | (R('R1') + (C('C2') | (R('R2') + (C('C3') | (R('R3') + C('C4'))))))
n.draw(__file__.replace('.py', '.png'), layout='ladder')
| mph-/lcapy | doc/examples/networks/ladderRC3.py | Python | lgpl-2.1 | 163 |
#
# Kiwi: a Framework and Enhanced Widgets for Python
#
# Copyright (C) 2005 Async Open Source
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (a... | Schevo/kiwi | examples/hyperlink/hyperlink_demo.py | Python | lgpl-2.1 | 5,936 |
"""Card class.
__author__ = "gemalto http://www.gemalto.com"
Copyright 2001-2012 gemalto
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com
This file is part of pyscard.
pyscard is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as publ... | moreati/pyscard | smartcard/Card.py | Python | lgpl-2.1 | 2,621 |
#!/usr/bin/python
# 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... | emonty/ola | tools/rdm/ola_rdm_test.py | Python | lgpl-2.1 | 8,131 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import eq_
from utilities import run_all
import mapnik
# Map initialization
def test_layer_init():
l = mapnik.Layer('test')
eq_(l.name,'test')
eq_(l.srs,'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')
eq_(l.envelope(),mapnik.Box2d())
... | rouault/mapnik | tests/python_tests/layer_test.py | Python | lgpl-2.1 | 745 |
"""
Records who we trust to sign feeds.
Trust is divided up into domains, so that it is possible to trust a key
in some cases and not others.
@var trust_db: Singleton trust database instance.
"""
# Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from zeroinstall i... | dsqmoore/0install | zeroinstall/injector/trust.py | Python | lgpl-2.1 | 9,078 |
#
# Copyright 2015-2016 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distr... | mojaves/convirt | tests/xmlfile_test.py | Python | lgpl-2.1 | 3,016 |
#!/usr/bin/env python2
from distutils.core import setup, Extension
import os
import subprocess
import sys
def check_output(*args):
"""subprocess.check_output, for Python 2.6 compatibility"""
p = subprocess.Popen(*args, stdout=subprocess.PIPE)
out, err = p.communicate()
exitstatus = p.poll()
if exi... | 01org/fMBT | utils/setup.py | Python | lgpl-2.1 | 4,418 |
import logging
from tornado.web import RequestHandler
from NXTornadoWServer.ControlSocketHandler import ControlSocketHandler
class ClientsHandler(RequestHandler):
def get(self):
try:
controller_i = ControlSocketHandler.clients.index(ControlSocketHandler.client_controller)
except Value... | spseol/DOD-2014 | NXTornadoWServer/NXTornadoWServer/ClientsHandler.py | Python | lgpl-2.1 | 775 |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2017 Ghent University
#
# This file is part of vsc-base,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# the Flem... | rjeschmi/vsc-base | test/exceptions.py | Python | lgpl-2.1 | 8,315 |
"""A modest set of tools to work with Django models."""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant f... | damienjones/sculpt-model-tools | setup.py | Python | lgpl-2.1 | 1,198 |
import unittest
import uptide.tidal as ut
import datetime
import math
class TestTidal(unittest.TestCase):
"""Tests the uptide.tidal module (basic astronomical calculations)"""
def setUp(self):
# a random, insignificant date
self.date = datetime.datetime(1975, 10, 24, 1, 2, 3)
# I can s... | stephankramer/uptide | tests/test_tidal.py | Python | lgpl-3.0 | 1,855 |
# ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | pyfa-org/eos | eos/restriction/restriction/resource.py | Python | lgpl-3.0 | 4,071 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.