code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# Copyright 2012 VPAC, http://www.vpac.org
#
# This file is part of Patchman.
#
# Patchman 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 only.
#
# Patchman is distributed in the hope that it will b... | VPAC/patchman | patchman/domains/models.py | Python | gpl-3.0 | 813 |
# coding: utf-8
from app import db, app
from app.auth.models import Role
from app.user.models import User
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script import Server, Shell, Manager
__author__ = 'Jux.Liu'
manager = Manager(app)
migrate = Migrate(app, db)
def make_shell_context():
r... | MOOOWOOO/qblog | qblog.py | Python | gpl-3.0 | 633 |
from nbodykit.base.catalog import CatalogSource
from nbodykit.io.stack import FileStack
from nbodykit import CurrentMPIComm
from nbodykit import io
from nbodykit.extern import docrep
from six import string_types
import textwrap
import os
__all__ = ['FileCatalogFactory', 'FileCatalogBase',
'CSVCatalog', 'Bi... | nickhand/nbodykit | nbodykit/source/catalog/file.py | Python | gpl-3.0 | 7,330 |
# -*- coding: utf-8 -*-
# 中文对齐不能用python自带的函数,需要自己根据中文长度增/减空格
# Python 2.7.12 & matplotlib 2.0.0
import re
from urllib2 import *
import matplotlib.pyplot as plt
#Get a set of records from nba.hupu.com due to given team
def getDataSet(team):
statUserAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (K... | NickyChan/NBASchedule | main.py | Python | gpl-3.0 | 7,776 |
#!/usr/bin/env python
# Copyright (C) 2011 Statoil ASA, Norway.
#
# The file 'sum_test.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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... | iLoop2/ResInsight | ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_grdecl.py | Python | gpl-3.0 | 3,995 |
import os, sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # Parent directory
import Tokenizer
from Tokenizer import Token, EndpointToken
import unittest
class TokenizationTests(unittest.TestCase):
def test_base(self):
definition_code = 'base "this is a test file"'
expected... | Senyeah/APIEngine | tests/tokenizer.py | Python | gpl-3.0 | 4,135 |
"""Test for User related Upgrade Scenario's
:Requirement: UpgradedSatellite
:CaseAutomation: NotAutomated
:CaseLevel: Acceptance
:CaseComponent: UsersRoles
:Assignee: sganar
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
class TestScenarioPositiveCreateSSHKeyInExistingUsers:
"... | SatelliteQE/robottelo | tests/upgrades/test_user.py | Python | gpl-3.0 | 3,413 |
#!/usr/bin/env python3
# This file is part of OpenSoccerManager.
#
# OpenSoccerManager 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 ver... | OpenSoccerManager/opensoccermanager | uigtk/window.py | Python | gpl-3.0 | 3,411 |
# -*- encoding: utf-8 -*-
"""Test class for Host/System Unification
:Requirement: Hostunification
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: UI
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from fauxfactory import gen_string
from nailgun import entities
from robottelo.cli.... | sghai/robottelo | tests/foreman/ui/test_hostunification.py | Python | gpl-3.0 | 22,724 |
# -*- coding: utf-8 -*-
############################################################################
# Copyright (C) 2008 by Michael Goerz #
# http://www.physik.fu-berlin.de/~goerz #
# ... | goerz/texpreview | Texpreview/TexpreviewPrinter.py | Python | gpl-3.0 | 7,524 |
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from finance.models import Payment
from .models import BookingVehicle
@receiver([post_save, post_delete], sender=Payment)
def update_booking_payment_info(sender, instance, **kwargs):
if instance.item_content_type.ap... | rtnpro/opencabs | opencabs/signals.py | Python | gpl-3.0 | 635 |
#
# biblint - Static checking of BibTeX files to find errors or inconsistencies.
# Copyright (C) 2016-2016 Johannes Bauer
#
# This file is part of biblint.
#
# biblint 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 Found... | johndoe31415/biblint | BibUtils.py | Python | gpl-3.0 | 1,488 |
sedge_config_header = """
# :sedge:
#
# this configuration generated from `sedge' file:
# {}
#
# do not edit this file manually, edit the source file and re-run `sedge'
#
"""
| sthysel/sedge | sedge/templates.py | Python | gpl-3.0 | 177 |
from unittest import TestCase
from same.model.scorer import Scorer
class ScoreTestCase(TestCase):
def setUp(self):
self.scorer = Scorer()
class TestGetCurrentScore(ScoreTestCase):
def test_get_current_score(self):
score = 5
self.scorer.current_score = score
self.assertEqua... | opethe1st/SameGame | src/tests/test_model/test_scorer.py | Python | gpl-3.0 | 1,074 |
# -*- coding: utf-8 -*-
# Conexión a bases de datos
# Lección 6
# SQLAlchemy: Estados de una entidad
from Leccion_1 import Libro
from Leccion_2 import session
from sqlalchemy import inspect
def mostrar_estado(objeto):
estado = inspect(objeto)
print('Transient: {0}; Pending: {1}; Persistent: {2}; Detached: {3... | josuemontano/python_intro | tema_6/Leccion_6.py | Python | gpl-3.0 | 762 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from OpenSSL import crypto
from .base import BaseNetworkServiceScanModel
from ..types import *
from ..mixin import DomainNameMixin, S3Mixin
from lib import ConversionHelper
class SslSupportModel(BaseNetworkServiceScanModel):
"""
This is an Elast... | lavalamp-/ws-backend-community | wselasticsearch/models/services/ssl.py | Python | gpl-3.0 | 34,499 |
import supybot.callbacks as callbacks
import supybot.ircutils as ircutils
import supybot.ircmsgs as ircmsgs
from parthial.vals import LispSymbol, LispList, LispFunc, LispBuiltin
from parthial.errs import LimitationError
from parthial import built_ins
import re
import threading
parseMessage = re.compile('%s: (?P<conten... | benzrf/Lispnoria | parthial_ext.py | Python | gpl-3.0 | 3,208 |
# -*- coding: latin1 -*-
################################################################################################
import datetime, sys, time, json, os, os.path, shutil, time, struct, random
import subprocess
import numpy as np
reload(sys)
sys.setdefaultencoding('utf-8')
#######################################... | amaurywalbert/twitter | evaluation/with_ground_truth/jaccard_modified/hashmap_jaccard_modified_v1.0.py | Python | gpl-3.0 | 12,147 |
from chessQuest.movements import left_right_cross, right_left_cross, horizontal, vertical, knight_move
FREE = 0
FORBIDDEN = 1
KING = 'K'
QUEEN = 'Q'
ROOK = 'R'
BISHOP = 'B'
KNIGHT = 'N'
PIECES_ORDER = [QUEEN, KING, ROOK, BISHOP, KNIGHT]
# Do not need an actual class for pieces.
PIECES = {
KING: {
'movem... | RedXBeard/chessQuest | chessQuest/__init__.py | Python | gpl-3.0 | 724 |
from pyui.stack_images import Ui_StackImages
from PyQt5.QtWidgets import QDialog, QAction, QLineEdit, QProgressDialog, QApplication, QToolBar
from PyQt5.QtGui import QIcon, QStandardItemModel, QStandardItem
from PyQt5.QtCore import Qt, QObject, pyqtSignal, QStandardPaths, QByteArray
from pyspectrum_commons import *
fro... | GuLinux/PySpectrum | stack_images.py | Python | gpl-3.0 | 9,262 |
# Copyright 2016 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
# This plugin subclasses CurrencyProviderPlugin to provide additional curre... | fokusov/moneyguru | core/plugin/stale_currency_provider.py | Python | gpl-3.0 | 3,715 |
# Nameless A.I. Version E editor
from panda3d.core import *
from direct.showbase.DirectObject import DirectObject
import direct.directbase.DirectStart
from direct.gui.DirectGui import *
import json
from dijkstra2 import Graph
from vis_ninth import VisibilityPolygon
from direct.gui.OnscreenText import OnscreenText
impor... | wezu/Avolition | naive_editor.py | Python | gpl-3.0 | 14,742 |
import sys
import urllib
import urllib2
import urlparse
import xbmcgui
import xbmcplugin
import xbmcaddon
import xbmcvfs
import json
import base64
addonID = 'plugin.audio.radiobrowser'
addon = xbmcaddon.Addon(id=addonID)
base_url = sys.argv[0]
addon_handle = int(sys.argv[1])
args = urlparse.parse_qs(sys.argv[2][1:])
... | segler-alex/kodi-radio-browser | main.py | Python | gpl-3.0 | 10,729 |
# -*- coding: utf-8 -*-
"""Tests for psychopy.compatibility"""
from builtins import object
import os
from psychopy import constants, compatibility
import pytest
pytestmark = pytest.mark.skipif(
constants.PY3,
reason='Python3 cannot import the old-style pickle files')
thisPath = os.path.split(__file__)[0]
fixt... | hoechenberger/psychopy | psychopy/tests/test_compatibility/test_compatibility.py | Python | gpl-3.0 | 1,242 |
from setuptools import setup
setup(
name='lifepim',
version='0.0.3',
author='Duncan Murray',
author_email='djmurray@acutesoftware.com.au',
packages=['lifepim', 'lifepim.web_app'],
url='https://github.com/acutesoftware/lifepim',
license='GNU General Public License v3 (GPLv3)',
descriptio... | acutesoftware/lifepim | setup.py | Python | gpl-3.0 | 1,101 |
# -*- encoding: utf-8 -*-
"""Test class for Login UI"""
from ddt import ddt
from robottelo.decorators import data
from robottelo.helpers import gen_string
from robottelo.test import UITestCase
@ddt
class Login(UITestCase):
"""Implements the login tests rom UI"""
def test_successful_login(self):
"""@... | abalakh/robottelo | tests/foreman/ui/test_login.py | Python | gpl-3.0 | 1,168 |
# Generated by Django 2.2.17 on 2021-01-31 06:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('conversation', '0032_twitterusertimeline'),
]
operations = [
migrations.AddField(
model_name='twitterusertimeline',
... | jeromecc/doctoctocbot | src/conversation/migrations/0033_twitterusertimeline_last_api_call.py | Python | mpl-2.0 | 423 |
from setuptools import setup
setup(
name="logstash2csv",
version="0.1",
install_requires=["elasticsearch"])
| KIWIKIGMBH/logstash2csv | setup.py | Python | mpl-2.0 | 122 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""module that copies from another module"""
from task_01.peanut import BUTTER
JELLY = BUTTER
| sdavlenov/is210-week-05-warmup | task_03.py | Python | mpl-2.0 | 142 |
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Copyright (c) 2014 Mozilla Corporation
from lib.alerttask import AlertTask
from mozdef_util.qu... | jeffbryner/MozDef | alerts/ldap_add.py | Python | mpl-2.0 | 1,114 |
# 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 logging
import jinja2
from django.template.loader import render_to_string
from django_jinja import library
from... | ericawright/bedrock | bedrock/newsletter/templatetags/helpers.py | Python | mpl-2.0 | 2,361 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-11-01 19:27
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | teknologkoren/Strequelistan | password_reset_email/migrations/0001_initial.py | Python | mpl-2.0 | 946 |
import http.cookiejar
import urllib
import urllib.request
import re
import gzip
__author__ = 'bochen'
def makeMyOpener(head):
header = []
cookieJar = http.cookiejar.CookieJar()
processor = urllib.request.HTTPCookieProcessor(cookieJar)
opener = urllib.request.build_opener(processor)
for key, valu... | whileLooper/MangaSpider | withCookie.py | Python | mpl-2.0 | 1,694 |
# 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 unicode_literals
import ... | klahnakoski/SpotManager | vendor/jx_elasticsearch/rollover_index.py | Python | mpl-2.0 | 13,558 |
from plugins.dbupload.uploaddb import upload
from plugins.dbupload.dbprofile import *
from config import DATABASE_URI
'''
Change filepath = your data file from ncbi
Change column_num = Column number of data file
'''
filepath = r""
column_num = 0
if not DATABASE_URI.startswith('mysql+pymysql://'):
DATABASE_URI = ... | igemsoftware2016/USTC-Software-2016 | ncbiuploader.py | Python | agpl-3.0 | 464 |
"""
Create base url for lms page objects.
While creating the url, basic authentication
username and basic authentication password
should be used.
"""
import os
from regression.pages import BASIC_AUTH_PASSWORD, BASIC_AUTH_USERNAME
LMS_STAGE_BASE_URL = 'courses.stage.edx.org'
# LMS_SANDBOX_BASE_URL = 'business.sandbo... | edx/edx-e2e-tests | regression/pages/lms/__init__.py | Python | agpl-3.0 | 1,126 |
from comics.aggregator.crawler import CrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "PartiallyClips"
language = "en"
url = "http://partiallyclips.com/"
start_date = "2002-01-01"
rights = "Robert T. Balder"
active = False
class Crawler(Cra... | jodal/comics | comics/comics/partiallyclips.py | Python | agpl-3.0 | 375 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Grigoriy Kramarenko <root@rosix.ru>
#
# This file is part of QuickAPI.
#
# QuickAPI 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 versi... | rosix-ru/django-quickapi | quickapi/apps.py | Python | agpl-3.0 | 1,015 |
"""
This is the default template for our main set of AWS servers. This does NOT
cover the content machines, which use content.py
Common traits:
* Use memcached, and cache-backed sessions
* Use a MySQL 5.1 database
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables fro... | sameetb-cuelogic/edx-platform-test | lms/envs/aws.py | Python | agpl-3.0 | 25,161 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
from itertools import chain
import data, datetime, argparse, sys
import numpy as np
import tensorflow as tf
from tensorflow.python.ops.rnn_cell import *
from utils import *
from kneser_ney import KneserNeyLM
from nltk.util import ... | mafik/pargen | stacked.py | Python | agpl-3.0 | 20,229 |
# -*- coding:utf-8 -*-
#
# Copyright (C) 2011 Governo do Estado do Rio Grande do Sul
#
# Author: Lincoln de Sousa <lincoln@gg.rs.gov.br>
# Author: Rodrigo Sebastiao da Rosa <rodrigo-rosa@procergs.rs.gov.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Aff... | gabinetedigital/gd | gd/govpergunta/__init__.py | Python | agpl-3.0 | 11,253 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import timedelta
from decimal import Decimal
from django.db import models
from django.db import transaction
from django.utils.timezone import now
from django.db.models import Sum, Max, F
from audit_log.models.managers import AuditLog
cla... | tombs/Water-Billing-System | waterbilling/core/models.py | Python | agpl-3.0 | 53,833 |
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.conf import settings
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.utils.http import urlsafe_base64_encode
def send_activation_email(request, user):
b64uid = urlsafe_base64_encode(str(us... | editorsnotes/editorsnotes | editorsnotes/auth/utils.py | Python | agpl-3.0 | 1,133 |
from django.core.urlresolvers import reverse
from taiga.base.utils import json
from taiga.projects.services import stats as stats_services
from taiga.projects.history.services import take_snapshot
from taiga.permissions.permissions import ANON_PERMISSIONS
from taiga.projects.models import Project
from .. import factor... | astagi/taiga-back | tests/integration/test_projects.py | Python | agpl-3.0 | 13,485 |
from .gcc_executor import GCCExecutor, MAX_ERRORS
class ClangExecutor(GCCExecutor):
arch = 'clang_target_arch'
def get_flags(self):
return self.flags + ['-ferror-limit=%d' % MAX_ERRORS]
@classmethod
def get_version_flags(cls, command):
return ['--version']
| DMOJ/judge | dmoj/executors/clang_executor.py | Python | agpl-3.0 | 293 |
#!/usr/bin/env python
"""
A linting tool to check if templates are safe
"""
from enum import Enum
import os
import re
import sys
_skip_dirs = (
'/node_modules',
'/vendor',
'/spec',
'/.pycharm_helpers',
'/test_root',
'/reports/diff_quality',
'/common/static/xmodule/modules',
)
_skip_mako_dir... | solashirai/edx-platform | scripts/safe_template_linter.py | Python | agpl-3.0 | 30,181 |
"""
Model to hold edx-video-pipeline configurations.
"""
from __future__ import absolute_import
from config_models.models import ConfigurationModel
from django.contrib.auth import get_user_model
from django.db import models
from django.utils.translation import ugettext_lazy as _
from opaque_keys.edx.django.models impor... | jolyonb/edx-platform | openedx/core/djangoapps/video_pipeline/models.py | Python | agpl-3.0 | 3,579 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.editor, name="editor"),
url(r'^game/$', views.edit_game, name="add_game"),
url(r'^game/(?P<gameid>\d+)/$', views.edit_game, name="edit_game"),
url(r'^event/$', views.edit_event, name="add_event"),
url(r'^event... | wadobo/socializa | backend/editor/urls.py | Python | agpl-3.0 | 775 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('textjokes', '0002_auto_20150323_1524'),
... | asm-products/pants-party | textjokes/migrations/0003_auto_20150323_2213.py | Python | agpl-3.0 | 1,299 |
#!/usr/bin/env python
# Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... | MTG/essentia | test/src/unittests/streaming/test_tensortopool.py | Python | agpl-3.0 | 7,481 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-22 09:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('polls', '0013_auto_20180109_1302'),
]
operations ... | stadtgestalten/stadtgestalten | grouprise/features/polls/migrations/0014_auto_20180222_1033.py | Python | agpl-3.0 | 1,195 |
"""Public interface managing the workflow for peer assessments.
The Peer Assessment Workflow API exposes all public actions required to complete
the workflow for a given submission.
"""
import logging
from django.db import DatabaseError, IntegrityError, transaction
from django.utils import timezone
from dogapi impo... | Edraak/edx-ora2 | openassessment/assessment/api/peer.py | Python | agpl-3.0 | 37,163 |
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License GPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo.tests.common import TransactionCase
class TestSaleOrder(TransactionCase):
def setUp(self):
super(TestSaleOrder, self).setUp()
self.sale_7 = self.env.ref(
... | laslabs/vertical-medical | sale_medical_prescription/tests/test_sale_order.py | Python | agpl-3.0 | 1,725 |
# -*- 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 shuup.xtheme.editing import could_edit, is_edit_mode, set_edit_mode
fro... | shawnadelic/shuup | shuup_tests/xtheme/test_edit.py | Python | agpl-3.0 | 681 |
import factory
class PersonFactory(factory.django.DjangoModelFactory):
class Meta:
model = "people.Person"
name = factory.Faker("name")
versions = []
class PersonIdentifierFactory(factory.django.DjangoModelFactory):
class Meta:
model = "people.PersonIdentifier"
person = factory... | DemocracyClub/yournextrepresentative | ynr/apps/people/tests/factories.py | Python | agpl-3.0 | 347 |
# -*- coding: utf-8 -*-
"""
This file is part of checkmate, a meta code checker written in Python.
Copyright (C) 2015 Andreas Dewes, QuantifiedCode UG
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 Fou... | programmdesign/checkmate | checkmate/contrib/plugins/git/lib/repository.py | Python | agpl-3.0 | 19,633 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2015 Elico Corp (<http://www.elico-corp.com>)
# Authors: Siyuan Gu
#
# This program is free software: you can redistribute it and/or modify... | Elico-Corp/odoo-addons | multiprice_to_product_form/__openerp__.py | Python | agpl-3.0 | 1,385 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('pppcemr', '0072_auto_20160218_1228'),
]
operations = [
migrations.RemoveField(
model_name='treatment',
... | sstebbins/pppcpro | pppcemr/migrations/0073_auto_20160218_1232.py | Python | agpl-3.0 | 548 |
# Copyright: Damien Elmes <anki@ichi2.net>
# -*- coding: utf-8 -*-
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import sys
from anki.hooks import runHook
from aqt.qt import *
from aqt.utils import openLink
from anki.utils import isMac, isWin
import anki.js
# Bridge for Qt<->JS
######... | timrae/anki | aqt/webview.py | Python | agpl-3.0 | 5,072 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2014-2015, 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 ... | g-weatherill/oq-risklib | openquake/calculators/scenario_risk.py | Python | agpl-3.0 | 5,466 |
##python package initialization
# -*- coding: utf-8 -*-
import models
#import calculation
| mohamedhagag/dvit-odoo8 | hr_annual_increase/__init__.py | Python | agpl-3.0 | 90 |
from . import hr_analytic_timesheet
from . import global_timesheet_state
from . import crm_lead_suivi_gdoc | nuxly/nuxly-odoo-addons | nuxly/models/__init__.py | Python | agpl-3.0 | 106 |
from PyQt5.QtCore import QThread, pyqtSignal
from API.CurseAPI import CurseAPI, CurseFile, CurseModpack
from PyQt5.QtWidgets import *
from GUI.Strings import Strings
strings = Strings()
translate = strings.get
class FileDownloaderWindow(QWidget):
def __init__(self, file: str, curse: CurseAPI, path: str, fname=F... | Brain888/OpenMineMods | GUI/Downloader.py | Python | agpl-3.0 | 4,748 |
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
from parliament.core.sitemap import sitemaps
from parliament.core.views import SiteNewsFeed
urlpatterns = patterns('',
(r'^search/', include('parliament.search.urls')),
(r'^debates/',... | michaelsmit/openparliament | parliament/urls.py | Python | agpl-3.0 | 2,327 |
"""
Views for the course home page.
"""
from __future__ import absolute_import
import six
from django.template.context_processors import csrf
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.views.decorators.cache impo... | ESOedX/edx-platform | openedx/features/course_experience/views/course_home.py | Python | agpl-3.0 | 11,063 |
# Copyright 2021 Akretion (http://www.akretion.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "No automatic deletion of SMS",
"summary": "Avoid automatic delete of sended sms",
"author": "Akretion,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/conn... | OCA/connector-telephony | sms_no_automatic_delete/__manifest__.py | Python | agpl-3.0 | 543 |
# Generated by Django 3.0.7 on 2020-12-07 08:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inventory', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='article',
name='packing_content',
... | tuxite/pharmaship | pharmaship/inventory/migrations/0002_item_packing.py | Python | agpl-3.0 | 1,592 |
from pixelated.adapter.services.mail_service import MailService
from pixelated.adapter.model.mail import InputMail
from pixelated.adapter.services.mail_sender import MailSender
from pixelated.adapter.services.mailboxes import Mailboxes
from pixelated.adapter.soledad.soledad_querier import SoledadQuerier
from pixelated.... | alabeduarte/pixelated-user-agent | service/pixelated/config/services.py | Python | agpl-3.0 | 2,509 |
def get_menu_titles(page) -> list:
page.wait_for_load_state()
menu_list = page.query_selector_all("//*[@class='toctree-wrapper compound']/ul/li/a")
return [title.as_element().inner_text() for title in menu_list]
flag = True
def test_check_titles(page):
global flag
if flag:
page.goto("in... | PyAr/PyZombis | tests/test_navigation.py | Python | agpl-3.0 | 874 |
"""
prepare prediction:
filtered pws -> filtered pws
Uses:
PROCESSED_DATA_DIR/neural_networks/training_data_filtered.csv
"""
import os
import random
import logging
import platform
import pandas
from filter_weather_data.filters import StationRepository
from filter_weather_data import get_repository_parameters
from f... | 1kastner/analyse_weather_data | interpolation/interpolator/prepare/neural_network_single_group_filtered.py | Python | agpl-3.0 | 3,132 |
import logging
from django.conf import settings
from elasticsearch_old.exceptions import RequestError
from elasticutils import S
from lily.accounts.models import Account
from lily.contacts.models import Contact
from lily.messaging.email.utils import get_shared_email_accounts
from lily.search.connections_utils import ... | HelloLily/hellolily | lily/search/lily_search.py | Python | agpl-3.0 | 11,226 |
# Copyright 2020 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import fields, models, api
from odoo.addons import decimal_precision as dp
class StockMove(models.Model):
_inherit = 'stock.move'
@api.multi
def _compute_current_date(self):
... | oihane/odoo-addons | product_availability_report/models/stock_move.py | Python | agpl-3.0 | 3,082 |
# Author: Julien Coux
# Copyright 2016 Camptocamp SA
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests import common
class TestTrialBalanceReport(common.TransactionCase):
def setUp(self):
super(TestTrialBalance... | OCA/account-financial-reporting | account_financial_report/tests/test_trial_balance.py | Python | agpl-3.0 | 33,159 |
"""
Module implementing `xblock.runtime.Runtime` functionality for the LMS
"""
from completion.services import CompletionService
from django.conf import settings
from django.urls import reverse
from edx_django_utils.cache import DEFAULT_REQUEST_CACHE
import xblock.reference.plugins
from badges.service import BadgingSe... | jolyonb/edx-platform | lms/djangoapps/lms_xblock/runtime.py | Python | agpl-3.0 | 8,551 |
# Copyright 2011-2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for `PackageCopyingMixin`."""
__metaclass__ = type
from zope.component import getUtility
from zope.security.proxy import removeSecurityProxy
from lp.registry.inter... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/soyuz/browser/tests/test_package_copying_mixin.py | Python | agpl-3.0 | 8,305 |
# -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models
class MrpProduction(models.Model):
_inherit = 'mrp.production'
sale_id = fields.Many2one(
'sale.order',
string='Sale order',
copy=... | Gebesa-Dev/Addons-gebesa | sale_order_everywhere/models/mrp_production.py | Python | agpl-3.0 | 716 |
from django.views import generic
from django.core.urlresolvers import reverse_lazy
from .models import LotteryUser
class LotteryUserList(generic.ListView):
template_name = 'index.html'
context_object_name = 'number_list'
def get_queryset(self):
"""Return all numbers"""
return LotteryUser.... | munikes/loteria_lgb | loteria/web/views.py | Python | agpl-3.0 | 891 |
from podserve import create_app
__author__ = 'dwcaraway'
if __name__ == '__main__':
import logging
import sys
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
app = create_app()
app.run()
| dwcaraway/podserve | start.py | Python | agpl-3.0 | 223 |
# IPP, Plataforma web del Índice de Precios Popular
# Copyright (c) 2016 Nicolás Echániz and contributors.
#
# This file is part of IPP
#
# IPP 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 Foun... | nicoechaniz/IPP | bdd/features/environment.py | Python | agpl-3.0 | 3,472 |
import gpbo
xrange=range
from gpbo.core import GPdc as GPdc
import scipy as sp
class eimledefault():
"""
fixed s, space is [-1,1]^D
"""
def __init__(self,f,D,n,s,path,fname):
self.aqfn = gpbo.core.acquisitions.EIMAPaq
self.aqpara= {
'ev': {'s': s, 'd': [sp.NaN]},
... | markm541374/gpbo | gpbo/core/config.py | Python | agpl-3.0 | 19,809 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('utils', '0015_auto_20161121_1831'),
('notes', '0010_remove_polymorphic_cleanup')
]
operations = [
migrations.RemoveField(
... | HelloLily/hellolily | lily/utils/migrations/0016_remove_historylistitem.py | Python | agpl-3.0 | 606 |
# coding: utf-8
# enum mappers: To be able to search e.g. a route with a rating between
# 'AD' and 'ED', certain enum values are converted to integers using the
# mappers listed below, and stored as number in ElasticSearch. This allows
# to do range queries.
sortable_quality_types = {
'empty': 0,
'draft': 1,
... | c2corg/v6_api | c2corg_api/models/common/sortable_search_attributes.py | Python | agpl-3.0 | 4,890 |
from typing import Dict
import random
from . import HardwareAdapter, POWER
from hedgehog.protocol.messages import io
class SimulatedHardwareAdapter(HardwareAdapter):
def __init__(self, *args, simulate_sensors=False, **kwargs):
super().__init__(*args, **kwargs)
self.simulate_sensors = simulate_se... | PRIArobotics/HedgehogServer | hedgehog/server/hardware/simulated.py | Python | agpl-3.0 | 2,565 |
default_app_config = 'ain7.annuaire.management.FillDb'
| ain7/www.ain7.org | ain7/annuaire/__init__.py | Python | lgpl-2.1 | 55 |
import subprocess
import re
import copy
from StringIO import StringIO
import os
import doug
from doug.config import DOUGConfigParser, ControlFile
from scripts import ScriptException
import logging
LOG = logging.getLogger('doug')
_defaultConfig = None
def getDefaultConfig():
global _defaultConfig
if _default... | ogbash/doug | scripts/doug/execution.py | Python | lgpl-2.1 | 8,926 |
#!/usr/bin/env python
import gtk
from kiwi.ui.gadgets import quit_if_last
from kiwi.ui.views import BaseView
app = BaseView(gladefile="hey", delete_handler=quit_if_last)
app.show()
gtk.main()
| Schevo/kiwi | examples/framework/hey/heyglade.py | Python | lgpl-2.1 | 194 |
"""SCons.Script.SConscript
This module defines the Python API provided to SConscript and SConstruct
files.
"""
#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), ... | Uli1/mapnik | scons/scons-local-2.4.0/SCons/Script/SConscript.py | Python | lgpl-2.1 | 24,468 |
# -*- Mode: Python; coding: iso-8859-1 -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Stoqdrivers
# Copyright (C) 2005 Async Open Source <http://www.async.com.br>
# All rights reserved
#
# 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
# ... | stoq/stoqdrivers | stoqdrivers/printers/base.py | Python | lgpl-2.1 | 6,610 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | var/spack/repos/builtin/packages/py-rope/package.py | Python | lgpl-2.1 | 1,561 |
"""Conditional Event item definition."""
from gaphor.diagram.presentation import (
Classified,
ElementPresentation,
from_package_str,
)
from gaphor.diagram.shapes import Box, IconBox, Text
from gaphor.diagram.support import represents
from gaphor.diagram.text import FontStyle, FontWeight
from gaphor.RAAML ... | amolenaar/gaphor | gaphor/RAAML/fta/conditionalevent.py | Python | lgpl-2.1 | 1,442 |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Red Hat, Inc.
#
# 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 (at your option) any later version.... | lubomir/productmd | productmd/compose.py | Python | lgpl-2.1 | 4,093 |
#!/usr/bin/env python
import os
pack = open('BlackBeltSorviHero.dat', 'w')
length = 0
offset = 0
for i in [1, 2]:
length = 0
for fname in os.listdir('data'):
f = open('data/' + fname)
f.seek(0, 2)
size = f.tell()
f.close()
length += len("%s %d %d\n" % (fname, offset, size))
offset += size
offset = len... | japeq/blackbeltsorvihero | create-pack.py | Python | lgpl-2.1 | 689 |
__author__ = 'Ethan A. Hill'
import copy
import string
import re
import itertools
import logging
from xml.etree import cElementTree as ElementTree
from ..constants import ccg_values
from ..models.rewrite import Rewrite
from ..utilities import reversal_utilities
__logger = logging.getLogger(__name__)
def find_parse... | hill1303/CCGParaphraseGenerator | novel_disambiguation/utilities/rewrite_utilities.py | Python | lgpl-2.1 | 17,853 |
#!/usr/bin/python
"""Test of multiline editable text."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(KeyComboAction("<Control>f"))
sequence.append(TypeAction("Application main window"))
sequence.append(KeyComboAction("Return"))
sequence.append(KeyComboAction("Tab"))
sequ... | pvagner/orca | test/keystrokes/gtk-demo/role_text_multiline.py | Python | lgpl-2.1 | 10,142 |
#!/usr/bin/python
import random
import datetime
import os
import sys
import time
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import connection, reset_queries
from django.db.transaction import commit_on_success, rollback
from djang... | chrisspen/asklet | asklet/management/commands/asklet_estimate.py | Python | lgpl-3.0 | 1,688 |
# -*- coding: utf-8 -*-
import sys
import os.path
import subprocess
import json
import string
import tempfile
import shutil
import threading
import exceptions
import errno
from collections import defaultdict
from xml.etree import ElementTree
import nixops.statefile
import nixops.backends
import nixops.logger
import ni... | beni55/nixops | nixops/deployment.py | Python | lgpl-3.0 | 46,436 |
import Tkinter as tk
import random
NOMOVE = {
'Left': 'Right',
'Right': 'Left',
'Up': 'Down',
'Down': 'Up',
}
OFF = 0
PLACE = 1
DELETE = 2
# TODO
# 1. speed management
# 3. not empty field by default, additional borders
# 5. menu configure before start
# 6. levels and egg counter
class Snake(object):
def __ini... | lordnord/tkSnake | main.py | Python | lgpl-3.0 | 7,825 |
from MoveMe.Canvas.Objects.Base.CanvasObject import CanvasObject
import wx
import numpy as np
from MoveMe.Canvas.Objects.Base.DeletableObject import DeletableObject
from MoveMe.Canvas.Objects.Base.SelectableObject import SelectableObject
class Connection(SelectableObject, DeletableObject, CanvasObject):
def __ini... | zyxer/Nodes-tree | MoveMe/Canvas/Objects/Connection.py | Python | lgpl-3.0 | 3,057 |
# -*- coding: utf-8 -*-
import inspect
import random
import numpy as np
from django.contrib import messages
from django.views.generic import RedirectView
from django.contrib.contenttypes.models import ContentType
from django.http import Http404
from django.contrib.auth.mixins import UserPassesTestMixin
class RunAct... | math-a3k/django-ai | django_ai/base/views.py | Python | lgpl-3.0 | 2,787 |
############################################################################
# LGPL License #
# #
# This file is part of the Machine Learning Framework. #
# Copyright ... | flashpixx/MachineLearning | examples/other/build.py | Python | lgpl-3.0 | 2,333 |