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 |
|---|---|---|---|---|---|
# 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 datetime import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test.client import Req... | jicksy/oneanddone_test | vendor-local/lib/python/django_browserid/tests/test_base.py | Python | mpl-2.0 | 13,001 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette_driver.by import By
from marionette_driver.errors import NoAlertPresentException, ElementNotInteractable... | Yukarumya/Yukarum-Redfoxes | testing/marionette/harness/marionette_harness/tests/unit/test_modal_dialogs.py | Python | mpl-2.0 | 9,942 |
#!/usr/bin/python
# Script for generating the assembler code requried for virtual function
# stubs for SuperH processor in little-endian mode (perhaps it works big-endian
# too, I haven't checked).
f = open("xptcstubs_asm_shle.s", 'w')
prefix = "_ZN14nsXPTCStubBase"
minStub = 3
maxStub = 250
# Frequency with which ... | tmhorne/celtx | xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_shle.py | Python | mpl-2.0 | 2,387 |
from flask import render_template, Markup, request
from MyCapytain.common.reference import URN
from MyCapytain.common.constants import Mimetypes, RDF_NAMESPACES
from capitains_nautilus.apis.base import AdditionalAPIPrototype
from capitains_nautilus.errors import NautilusError, CtsMissingParameter, CtsInvalidURN
cla... | Capitains/Nautilus | capitains_nautilus/apis/cts.py | Python | mpl-2.0 | 9,304 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from PyQt4 import QtCore, QtGui
from ventanappal import MainWindow
class ShowWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QApplication.__init__(self, None)
self.ui = MainWindow()
self.ui.setupUi(self)
def main(argv):
... | juan-castano/pyefficient | src/view/main.py | Python | mpl-2.0 | 471 |
#!/usr/bin/python
#
# Copyright Friday Film Club. All Rights Reserved.
"""Forms unit tests."""
__author__ = 'adamjmcgrath@gmail.com (Adam McGrath)'
import json
import mock
import unittest
import webapp2
from google.appengine.ext import ndb
from wtforms import validators, Form, FormField
import base
import helpers... | adamjmcgrath/fridayfilmclub | src/tests/test_forms.py | Python | mpl-2.0 | 5,207 |
import re
import hashlib
# this is not intended to be an all-knowing IP address regex
IP_RE = re.compile('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')
def get_ip(request):
"""
Retrieves the remote IP address from the request data. If the user is
behind a proxy, they may have a comma-separated list of IP address... | mastizada/kuma | kuma/contentflagging/utils.py | Python | mpl-2.0 | 2,472 |
# 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 requests
import shutil
import structlog
import tempfile
from boto.s3.key import Key
from celery.task import curr... | Callek/build-relengapi | relengapi/blueprints/archiver/tasks.py | Python | mpl-2.0 | 3,254 |
#!/usr/bin/python
#
# Copyright 2014 Friday Film Club. All Rights Reserved.
"""Handles the realtime live scoring feature using the Channel API."""
__author__ = 'adamjmcgrath@gmail.com (Adam McGrath)'
from datetime import datetime, timedelta
import json
import logging
import baserequesthandler
from google.appengine.... | adamjmcgrath/fridayfilmclub | src/realtime.py | Python | mpl-2.0 | 2,327 |
import codecs
import json
import os
from glob import glob
from operator import attrgetter
from django.conf import settings
from django.core.cache import caches
from django.db import models, transaction
from django.http import Http404
from django.utils.dateparse import parse_datetime
from django.utils.functional import... | mkmelin/bedrock | bedrock/releasenotes/models.py | Python | mpl-2.0 | 9,706 |
#Copyright (C) 2017 Paolo Galeone <nessuno@nerdz.eu>
#
#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/.
#Exhibit B is not attached; this software is compatible with the
#lic... | galeone/dynamic-training-bench | dytb/models/utils.py | Python | mpl-2.0 | 5,387 |
# -*- coding: utf-8 -*-
#
# OpenCraft -- tools to aid developing and hosting free software projects
# Copyright (C) 2015-2021 OpenCraft <xavier@opencraft.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... | open-craft/opencraft | marketing/tests/test_views.py | Python | agpl-3.0 | 6,739 |
#!/usr/bin/env python
# broadcasters_finder.py
#
# Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io
#
# This file (broadcasters_finder.py) is part of BitDust Software.
#
# BitDust is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published ... | vesellov/bitdust.devel | broadcast/broadcasters_finder.py | Python | agpl-3.0 | 9,503 |
# Roundware Server is released under the GNU Affero General Public License v3.
# See COPYRIGHT.txt, AUTHORS.txt, and LICENSE.txt in the project root directory.
# The Django REST Framework Views for the V2 API.
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.shortcuts imp... | eosrei/roundware-server | roundware/api2/views.py | Python | agpl-3.0 | 21,159 |
"""
Views that implement a RESTful API for interacting with XBlocks.
Note that these views are only for interacting with existing blocks. Other
Studio APIs cover use cases like adding/deleting/editing blocks.
"""
from corsheaders.signals import check_request_enabled
from django.contrib.auth import get_user_model
from... | stvstnfrd/edx-platform | openedx/core/djangoapps/xblock/rest_api/views.py | Python | agpl-3.0 | 6,763 |
test_list = []
def reset_test_list():
del test_list[:]
def sample_fn(arg):
print 'sample', arg
test_list.append(arg)
| devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/before_after/tests/test_functions.py | Python | agpl-3.0 | 131 |
from databaker.constants import *
print PARAMS()
def per_file(tableset):
return "*"
def per_tab(tab):
obs = tab.filter("ANCHOR").assert_one().shift(DOWN).shift(RIGHT)
print obs
tab.filter("ANCHOR").shift(DOWN).assert_one().dimension(TIME, DIRECTLY, LEFT)
yield obs
| ONS-OpenData/ONSdatabaker | test/supersub.py | Python | agpl-3.0 | 287 |
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models
class PaymentReturnLine(models.Model):
_inherit = "payment.return.line"
@api.multi
def _find_match(self):
AccountMoveLine = self.env['account.move.lin... | kittiu/account-payment | account_payment_return_import_sepa_pain/models/payment_return.py | Python | agpl-3.0 | 610 |
# -*- coding: utf-8 -*-
"""
Views for enterprise api version 1 endpoint.
"""
from logging import getLogger
from smtplib import SMTPException
import requests
from django_filters.rest_framework import DjangoFilterBackend
from edx_rbac.decorators import permission_required
from edx_rest_framework_extensions.auth.jwt.aut... | edx/edx-enterprise | enterprise/api/v1/views.py | Python | agpl-3.0 | 67,040 |
from __future__ import absolute_import, unicode_literals
import json
import time
import urlparse
from datetime import timedelta
from uuid import uuid4
from urllib import quote_plus
import os
import phonenumbers
import plivo
import requests
from django.contrib.auth.models import User, Group
from django.core.urlresolve... | praekelt/rapidpro | temba/channels/models.py | Python | agpl-3.0 | 104,630 |
# Generated by Django 3.0.4 on 2020-03-16 20:26
from django.db import migrations
def setup_payment_configs(apps, schema_editor):
PagarmeFormConfig = apps.get_model('django_pagarme', 'PagarmeFormConfig')
PagarmeItemConfig = apps.get_model('django_pagarme', 'PagarmeItemConfig')
print()
setup_payment_co... | pythonprobr/pythonpro-website | pythonpro/checkout/migrations/0004_bootcamp_setup.py | Python | agpl-3.0 | 2,329 |
# -*- encoding: UTF-8 -*-
#
# Copyright 2015
#
# STIC-Investigación - Universidad de La Laguna (ULL) <gesinv@ull.edu.es>
#
# This file is part of CVN.
#
# CVN 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 ... | tic-ull/portal-del-investigador-cvn | management/commands/update_report_data.py | Python | agpl-3.0 | 2,290 |
import unittest
import pygame
Clock = pygame.time.Clock
class ClockTypeTest(unittest.TestCase):
def test_construction(self):
"""Ensure a Clock object can be created"""
c = Clock()
self.assertTrue(c, "Clock cannot be constructed")
def todo_test_get_fps(self):
# __doc__ (as o... | mark-me/Pi-Jukebox | venv/Lib/site-packages/pygame/tests/time_test.py | Python | agpl-3.0 | 6,908 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
from nose.tools import nottest
from openfisca_core.tools.test_runner import generate_tests
from openfisca_tunisia_pension.tests import base
nottest(generate_tests)
options_by_dir = {
'formulas': {},
}
def test():
for directory, options in optio... | openfisca/openfisca-tunisia-pension | openfisca_tunisia_pension/tests/test_yaml.py | Python | agpl-3.0 | 1,228 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | dayatz/taiga-back | taiga/projects/custom_attributes/validators.py | Python | agpl-3.0 | 5,982 |
"""
Test module for Entrance Exams AJAX callback handler workflows
"""
import json
from unittest.mock import patch
from django.conf import settings
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.test.client import RequestFactory
from milestones.tests.utils... | EDUlib/edx-platform | cms/djangoapps/contentstore/views/tests/test_entrance_exam.py | Python | agpl-3.0 | 13,805 |
__author__ = 'kwhatcher'
__author__ = 'kwhatcher'
"""Provide support for generating auth info for use in templates
"""
from werkzeug.local import LocalProxy
import vars
class Auth(object):
def __init__(self, app):
if app is not None:
self.init_app(app)
def init_app(self, app, *arg... | kerryhatcher/kerryhatcher.com | personal_site/auth/context.py | Python | agpl-3.0 | 1,005 |
##############################################################################
#
# Copyright (C) 2019 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Joel Vaucher <jvaucher@compassion.ch>
#
# The licence is in the file __manifest__.py
#
##################... | CompassionCH/compassion-modules | partner_communication/models/mail_template.py | Python | agpl-3.0 | 877 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | ecino/compassion-switzerland | wordpress_connector/models/contracts.py | Python | agpl-3.0 | 9,932 |
from coalib.bears.requirements.PackageRequirement import PackageRequirement
from coalib.misc.Shell import call_without_output
import platform
class GemRequirement(PackageRequirement):
"""
This class is a subclass of ``PackageRequirement``. It specifies the proper
type for ``ruby`` packages automatically a... | sils1297/coala | coalib/bears/requirements/GemRequirement.py | Python | agpl-3.0 | 1,541 |
# -*- coding: utf-8 -*-
# Copyright (c) 2016 CoNWeT Lab., Universidad Politécnica de Madrid
# This file is part of Wirecloud.
# Wirecloud 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 versio... | jpajuelo/wirecloud | src/wirecloud/platform/management/commands/populate.py | Python | agpl-3.0 | 3,431 |
#!/usr/bin/python
# coding=utf-8
###############################################################################
#
# Micronaet S.r.l., Migration script for PostgreSQL
# Copyright (C) 2002-2013 Micronaet SRL (<http://www.micronaet.it>).
# All Rights Reserved
#
# This program is free software: you can redistr... | Micronaet/micronaet-migration | script5_8/migrate.py | Python | agpl-3.0 | 52,918 |
# The Hazard Library
# Copyright (C) 2013-2022 GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#... | gem/oq-engine | openquake/hazardlib/tests/gsim/akkar_2014_test.py | Python | agpl-3.0 | 2,848 |
# -*- coding: utf8 -*-
#
# Copyright (C) 2016 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License,... | ndp-systemes/odoo-addons | web_drawing_free/__openerp__.py | Python | agpl-3.0 | 1,131 |
# encoding: utf-8
import nacl.encoding
import nacl.hash
import nacl.public
import nacl.secret
import nacl.signing
import nacl.utils
from base58 import b58encode
import logging
from .Errors import CodingException, SignatureException, ToBeImplementedException, EncryptionException
from .SmartDict import SmartDict
#NOT B... | ArchiveLabs/dweb_gateway | python/KeyPair.py | Python | agpl-3.0 | 29,045 |
import bleach
import os
import re
import requests
from tempfile import NamedTemporaryFile
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.http i... | openstate/yournextrepresentative | moderation_queue/views.py | Python | agpl-3.0 | 15,957 |
"""
RandomSelectors contains GroupSelector classes of random order of selections.
.. inheritance-diagram:: fullrmc.Selectors.RandomSelectors
:parts: 1
+------------------------------------------------------+------------------------------------------------------+
| Machine learning on group selection is shown here... | bachiraoun/fullrmc | Selectors/RandomSelectors.py | Python | agpl-3.0 | 16,379 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2019-01-13 20:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mailer', '0003_support_batches'),
]
operations = [
migrations.RenameField(... | Zahajamaan/Fudulbank | mailer/migrations/0004_group_level_relationships.py | Python | agpl-3.0 | 576 |
# BOREALISbot2 - a Discord bot to interface between SS13 and discord.
# Copyright (C) 2020 Skull132
# 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... | Aurorastation/BOREALISbot2 | core/subsystems/sql/subscriber.py | Python | agpl-3.0 | 1,315 |
__copyright__ = "Copyright 2017 Birkbeck, University of London"
__author__ = "Martin Paul Eve & Andy Byers"
__license__ = "AGPL v3"
__maintainer__ = "Birkbeck Centre for Technology and Publishing"
from production import models as production_models
from proofing import models as proofing_models
from submission import mo... | BirkbeckCTP/janeway | src/security/logic.py | Python | agpl-3.0 | 4,660 |
from core.permissions import BasePermissions
from core.util import InvalidScopeException
class ResourcePermissionsManager(BasePermissions):
def get_user(self, hashkey):
from app import db
from core.database.models import User
return db.session.query(User).filter_by(hashkey=hashkey).first(... | realizeapp/realize-core | core/resources/permissions.py | Python | agpl-3.0 | 1,946 |
# The Hazard Library
# Copyright (C) 2012-2014, GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
... | silviacanessa/oq-hazardlib | openquake/hazardlib/source/area.py | Python | agpl-3.0 | 7,552 |
# -*- coding: utf-8 -*-
#
# goauthc : mete0r's Google OAuth 2.0 client
# Copyright (C) 2014 mete0r <mete0r@sarangbang.or.kr>
#
# 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, ei... | mete0r/goauthc | mete0r_goauthc/models.py | Python | agpl-3.0 | 6,198 |
from user import User, Activity
from quora import Quora, try_cast_int
| sumit12dec/pyquora | quora/__init__.py | Python | agpl-3.0 | 70 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, getdate, cint
from webnotes.model.bean import getlist
from webnotes import msgprint
sql = webnotes.conn.sql
from ... | Yellowen/Owrang | selling/doctype/opportunity/opportunity.py | Python | agpl-3.0 | 7,687 |
import json
import ddt
from django.test import TestCase
from django.urls import reverse
from course_discovery.apps.api.tests.mixins import SiteMixin
from course_discovery.apps.core.tests.factories import USER_PASSWORD, UserFactory
from course_discovery.apps.ietf_language_tags.models import LanguageTag
# pylint: dis... | edx/course-discovery | course_discovery/apps/ietf_language_tags/tests/test_lookups.py | Python | agpl-3.0 | 1,940 |
from flask import url_for
from udata.core import storages
from udata.core.user.factories import AdminFactory, UserFactory
from udata.models import Follow
from udata.utils import faker
from udata.tests.helpers import create_test_image
from . import APITestCase
class UserAPITest(APITestCase):
modules = []
de... | opendatateam/udata | udata/tests/api/test_user_api.py | Python | agpl-3.0 | 12,368 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-10-07 13:12
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mezzanine.core.fields
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_co... | Ircam-Web/mezzanine-organization | organization/pages/migrations/0006_auto_20161007_1512.py | Python | agpl-3.0 | 1,692 |
#!/usr/bin/env python2
# -*- coding: latin-1 -*-
# Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U
#
# This file is part of Orion Context Broker.
#
# Orion Context Broker is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as
# published by t... | telefonicaid/fiware-orion | scripts/managedb/latest-updates.py | Python | agpl-3.0 | 3,793 |
from django.conf.urls import patterns, url
from notify.views import IndexView, UpdateView
urlpatterns = patterns('',
url(r'^$', IndexView.as_view(), name='index'),
url(r'^update/$', UpdateView.as_view(), name='update'),
)
| XeryusTC/lanciepos | notify/urls.py | Python | agpl-3.0 | 232 |
# Copyright 2021 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
def _prepare_invoice_line(self, qty):
vals = super()._prepare_invoice_line(qty)
vals['purchase_pr... | OCA/margin-analysis | account_invoice_margin_sale_delivered_sync/models/sale.py | Python | agpl-3.0 | 436 |
# -*- coding: utf-8 -*-
{
'name': 'Empty module for tests',
'license': 'AGPL-3',
'author': 'Odoo Community Association (OCA)',
'version': '8.0.0.1.0',
'depends': [
'base',
],
'data': [
'security/ir.model.access.csv',
],
}
| Vauxoo/maintainer-quality-tools | tests/test_repo/test_module/__openerp__.py | Python | agpl-3.0 | 270 |
# Copyright 2012-2013 Sebastien Maccagnoni-Munch
#
# This file is part of OSPFM.
#
# OSPFM 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 you... | tiramiseb/abandoned_ospfm | ospfm/helpers.py | Python | agpl-3.0 | 3,292 |
#!/usr/bin/python
import sys
from optparse import OptionParser
import tess.threedee.model.coarse_grain as ttmc
def main():
parser = OptionParser()
#parser.add_option('-o', '--options', dest='some_option', default='yo', help="Place holder for a real option", type='str')
#parser.add_option('-u', '--useles... | pkerpedjiev/ernwin | fess/scripts/stem_angles.py | Python | agpl-3.0 | 1,099 |
# sqlite/base.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: sqlite
:name: SQLite
.. _sqlite_datetime:
Date and Time Types... | skarra/PRS | libs/sqlalchemy/dialects/sqlite/base.py | Python | agpl-3.0 | 68,885 |
##
# Copyright 2013, 2015 Jessica Tallon, Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen 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
... | Inboxen/Inboxen | inboxen/router/server.py | Python | agpl-3.0 | 2,944 |
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Library functions for use in all scripts.
"""
__metaclass__ = type
__all__ = [
'db_options',
'dummy_logger_options',
'execute_zcml_for_scripts',
'log',
... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/services/scripts/__init__.py | Python | agpl-3.0 | 7,246 |
""
from __future__ import division
"""
This file is part of Cursed
Copyright (C) 2013 Gregor Vollmer <gregor@celement.de>
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, ei... | gregorv/cursed | item/__init__.py | Python | agpl-3.0 | 2,720 |
# pylint: disable=missing-docstring,redefined-outer-name
"""
Tests for user enrollment.
"""
import datetime
import itertools
import json
import unittest
import pytest
import ddt
import httpretty
import pytz
import six
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions imp... | stvstnfrd/edx-platform | openedx/core/djangoapps/enrollments/tests/test_views.py | Python | agpl-3.0 | 73,121 |
# -*- coding: utf-8 -*-
from osv import fields, osv
import time
class print_dispatch_form(osv.osv_memory):
_name='print.dispatch.form'
_columns={}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
result = super(print_dispatch_form,... | alangwansui/mtl_ordercenter | openerp/addons/001_outsource/wizard/print_dispatch_form.py | Python | agpl-3.0 | 2,102 |
"""graft loss cause move to transplant
Revision ID: ea9ca52c81d1
Revises: 751044a5528a
Create Date: 2019-03-06 07:21:39.852000
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'ea9ca52c81d1'
down_revision = '751044a5528a... | renalreg/radar | migrations/versions/ea9ca52c81d1_graft_loss_cause_move_to_transplant.py | Python | agpl-3.0 | 933 |
# This file is part of the GOsa framework.
#
# http://gosa-project.org
#
# Copyright:
# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de
#
# See the LICENSE file in the project's top-level directory for details.
from unittest import mock
from gosa.backend.objects.index import ObjectInfoIndex
from gosa.common.e... | gonicus/gosa | backend/src/tests/backend/objects/backend/test_back_object.py | Python | lgpl-2.1 | 5,412 |
__author__ = "janisto2"
__date__ = "$2015-02-17 12:14:31$" | MUNDO-platform/srccode | ckan-extensions/ckanext-mundo-pl/ckanext/mundo/templates/ajax_snippets/__init__.py | Python | lgpl-2.1 | 58 |
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright (C) 2015 National Institutes of Health
This library is free software; you can redistribute it and/or
modify it under the ... | colettace/wnd-charm | wndcharm/utils.py | Python | lgpl-2.1 | 17,908 |
#!/usr/bin/env python
#
# Copyright (C) Citrix Systems 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; version 2.1 only.
#
# This program is distributed in the hope that it will ... | simonjbeaumont/sm | drivers/blktap2.py | Python | lgpl-2.1 | 85,707 |
# Copyright (C) 2010 One Laptop Per Child
#
# Author: Sayamindu Dasgupta <sayamindu@laptop.org>
#
# 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 of the License, or (at... | ceibal-tatu/sugar-toolkit-gtk3 | src/sugar3/activity/i18n.py | Python | lgpl-2.1 | 5,516 |
# -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... | fifengine/fifengine-demos | rio_de_hola/scripts/world.py | Python | lgpl-2.1 | 16,079 |
"gameplay handler. for the main part of the game"
import pygame
from pygame.locals import *
import random
import var, gfx, input, snd
import gamehelp, gamepause
import ai, objs, agents, objtext, hud
Songs = [('arg.xm', 1.0), ('h2.ogg', 0.6)]
def load_game_resources():
snd.preload('gameover', 'startlife', 'leve... | kanaka/spacewar | python/gameplay.py | Python | lgpl-2.1 | 13,208 |
##############################################################################
# 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/mosh/package.py | Python | lgpl-2.1 | 2,030 |
# Written by Jan David Mol, Arno Bakker
# see LICENSE.txt for license information
import sys
import time
from math import ceil
from sets import Set
from Tribler.Core.simpledefs import *
# live streaming means wrapping around
LIVE_WRAPAROUND = True
DEBUG = False
class VideoStatus:
""" Info about... | egbertbouman/tribler-g | Tribler/Core/Video/VideoStatus.py | Python | lgpl-2.1 | 14,988 |
import rpm
def spec_from_file(spec):
return rpm.ts().parseSpec(spec)
def files_from_spec(basename, specpath):
"""The RPM library doesn't seem to give us access to the files section,
so we need to go and get it ourselves. This parsing algorithm is
based on build/parseFiles.c in RPM. The list of s... | euanh/planex-cleanhistory | planex/rpmextra.py | Python | lgpl-2.1 | 3,705 |
'''Binary IO designed to be compatible with C code
'''
import numpy as np
import struct
STRUCT_INT_CODE = 'i'
assert struct.calcsize(STRUCT_INT_CODE) == 4
class BinaryWriter(object):
def __init__(self, fp):
self.fp = fp
def write(self, frmt, *args):
self.fp.write(struct.pack(frmt, *args))... | matthagy/pointpot | python/pointpot/binio.py | Python | lgpl-2.1 | 1,344 |
# -*- coding: utf-8 -*-
from http.client import HTTPSConnection, HTTPResponse
from datetime import datetime
import time
from uuid import uuid4
import os
import pytz
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from pysignfe.corr_unicode import *
from pysig... | thiagopena/PySIGNFe | pysignfe/cte/processador_cte.py | Python | lgpl-2.1 | 32,015 |
#!/usr/bin/python
"""Test navigation out of the Dojo editor."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
#sequence.append(WaitForDocLoad())
sequence.append(PauseAction(5000))
sequence.append(PauseAction(3000))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboActi... | chrys87/orca-beep | test/keystrokes/firefox/aria_editor_navigation_dojo.py | Python | lgpl-2.1 | 1,689 |
"""
FMN uses rules to determine whether or not to dispatch a message. A filter is
composed of one or more rules. A rule is something like: "is a bodhi message"
or "pertains to a package owned by me." They are implemented as python functions.
The database model refers to them as ``fmn.rules:pertains_to_me`` or
``fmn.rul... | fedora-infra/fmn | fmn/rules/__init__.py | Python | lgpl-2.1 | 3,145 |
'''
Created on 02-01-2013
@author: jurek
'''
from hra_core.special import ImportErrorMessage
try:
from PyQt4.QtCore import * # @UnusedWildImport
from PyQt4.QtGui import * # @UnusedWildImport
from hra_core.collections_utils import empty_string
from hra_core.collections_utils import get_namedtuple_fiel... | TEAM-HRA/hra_suite | HRAGUI/src/hra_gui/qt/models/datasources.py | Python | lgpl-3.0 | 1,717 |
#example12 QtRPT, Aleksey Osipov, E-mail: aliks-os@ukr.net
# to pyside2 Numael Garay, mantrixsoft@gmail.com
import sys
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from PySide2 import QtCore
from PyQtRPT import PyQtRPT
#Report with Richtext Fields
@QtCore.Slot(... | numaelis/pyqtrpt | package/example12.py | Python | lgpl-3.0 | 1,870 |
import dataAccessSQLAlchemy as da
import pandas as pd
import random
import numpy as np
def get_room_groups(lab_group, theory_group):
"Forms 2 groups of rooms. lab_group contains rooms with roomCount < 25, all others in theory_group"
f_room = da.initialize('room');
for i in range(len(f_room)):
if... | aditipawde/TimeTable1 | TimeTable1/common.py | Python | lgpl-3.0 | 10,513 |
from django.contrib import admin
from django.utils import timezone
from datetime import timedelta, datetime
from .models import POI
from leaflet.admin import LeafletGeoAdmin
class POIAdmin(LeafletGeoAdmin):
list_display = ['name', 'status', 'genre', 'slug', 'stage', 'author']
prepopulated_fields = {'slug': ('... | DavidDzl/online_platform | test_app/admin.py | Python | lgpl-3.0 | 1,519 |
import rufino
import sys
print "uso:"
print "python monge_elkan.py <codigo ISO lengua> <umbral> <exponente> <largo max oracion> <oracion a buscar> <max operaciones edicion>"
print "ejemplo uso:"
print "python monge_elkan.py en 0.8 1 30 the theory was proposed by researchers"
codigo_ISO=sys.argv[1]
umbral=float(sys.arg... | DiplomadoACL/problemasenclase | approx_search/morph_monge_elkan.py | Python | lgpl-3.0 | 923 |
# coding:utf-8
from __base__ import System
from abc import ABCMeta, abstractproperty
class ConfigBase(object):
""" 配置基类 """
__metaclass__ = ABCMeta
class Config(ConfigBase, System):
""" 配置类 """
class ConfigDefault(Config):
""" 默认配置类 """
# TIME_COLUMN = abstractproperty()
_time_column = abs... | popoyz/charts | __base__/config.py | Python | lgpl-3.0 | 1,159 |
import urllib
import conf
import requests
import os
##Module for communicating to the slaves.
##Wraps long HTTPRequests
def send_encoder_steps(to_ip, steps):
'''
This will let the main RPi module know
that it is ready for the next motor
instruction.
'''
headers = {"Content-type": "... | ut-ras/robotticelli | src/hardware/robot/modules/com.py | Python | lgpl-3.0 | 1,416 |
import tensorflow as tf
import time
tf.set_random_seed(42)
A = tf.random_normal([10000,10000])
B = tf.random_normal([10000,10000])
def check():
start_time = time.time()
with tf.Session() as sess:
print(sess.run(tf.reduce_sum(tf.matmul(A,B))))
print("It took {} seconds".format(time.time() - start_t... | lablup/sorna-repl | tests/bm-tensorflow.py | Python | lgpl-3.0 | 335 |
# vim: set fileencoding=utf-8 :
from __future__ import unicode_literals
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from flask import current_app
from flask import _app_ctx_stack as stack
class SQLite3(object):
def __init__(self, app=None):
... | stephane-martin/quiet-reading | quiet/my_ext.py | Python | lgpl-3.0 | 1,229 |
#!/usr/bin/python3
# (C) 2016 Marcelo Soares Souza <marcelo.soares@colaborador.embrapa.br>
# This program is licensed under a LGPLv3 License.
import os
import sys
import csv
import datetime
from time import time
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import... | marcelo-soares-souza/bioinformatics-scripts | substr_csv_fasta_down_stream_with_name.py | Python | lgpl-3.0 | 1,898 |
# This file is adapted from python code released by WellDone International
# under the terms of the LGPLv3. WellDone International's contact information is
# info@welldone.org
# http://welldone.org
#
# Modifications to this file from the original created at WellDone International
# are copyright Arch Systems Inc.
# p... | iotile/typedargs | typedargs/types/path.py | Python | lgpl-3.0 | 1,293 |
from textwrap import dedent
try:
import unittest2 as unittest
except ImportError:
import unittest
from rope.refactor import multiproject, rename, move
from ropetest import testutils
class MultiProjectRefactoringTest(unittest.TestCase):
def setUp(self):
super(MultiProjectRefactoringTest, self).set... | python-rope/rope | ropetest/refactor/multiprojecttest.py | Python | lgpl-3.0 | 3,698 |
'''A camera class which remembers when the last camera shot occurred'''
from switch import Switch
''' Create a special camera class so we can keep track of when the last shot was
example usage:
Hamamatsu = Camera(
0, # time
39 # HSDIO channel
)
'''
class Camera(Switch):
... | QuantumQuadrate/CsPyController | python/exp_functional_waveforms/camera.py | Python | lgpl-3.0 | 883 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "DjangoWebsite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| sail3/Djangowebsite | source/DjangoWebsite/manage.py | Python | lgpl-3.0 | 256 |
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, Inc.
# Copyright (C) 2013 by Jerome Maye jerome.maye@mavt.ethz.ch
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met... | jmaye/rxbag_plugins_snappy | src/rxbag_plugins_snappy/python/lib/rxbag_plugins_snappy/plugins.py | Python | lgpl-3.0 | 2,102 |
from pyre import Pyre
from pyre import zhelper
import zmq
import uuid
import logging
import sys
def chat_task(ctx, pipe):
n = Pyre(ctx)
n.join("CHAT")
n.start()
poller = zmq.Poller()
poller.register(pipe, zmq.POLLIN)
poller.register(n.inbox, zmq.POLLIN)
while(True):
items = dict... | sphaero/pyre | examples/chat.py | Python | lgpl-3.0 | 1,711 |
# coding=utf-8
# Copyright © 2016 Computational Molecular Biology Group,
# Freie Universität Berlin (GER)
#
# This file is part of ReaDDy.
#
# ReaDDy 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 Softwar... | chrisfroe/readdy | wrappers/python/src/python/readdy/tests/test_internal_simulation_module.py | Python | lgpl-3.0 | 3,818 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#external imports
import sys
import optparse
#internal imports
from subuserlib.classes.user import User
import subuserlib.commandLineArguments
import subuserlib.removeOldImages
import subuserlib.profile
def parseCliArgs(realArgs):
usage = "usage: subuser remove-old-images"
... | shannara/subuser | logic/subuserlib/builtInCommands/remove-old-images.py | Python | lgpl-3.0 | 2,030 |
from grandma import jenny_wrapper
from nose.tools import assert_equals
def test_jenny():
"""Test that the interface of the jenny_wrapper works as expected."""
dims = {
"os": ["win32", "linux", "solaris"],
"cmd": ["ls", "rm", "cp", "del", "pwd"],
"prot": ["telnet", "ssh", "local-machine"],
... | markfink/grandma | tests/test_jenny.py | Python | lgpl-3.0 | 749 |
#! /usr/bin/env python
from __future__ import print_function
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
# Instanciate one distribution object
distribution = TruncatedNormal(0.5, 3.0, -2.0, 2.0)
print("Distribution ", distribution)
# Is this distribution elliptical ?
... | aurelieladier/openturns | python/test/t_TruncatedNormal_std.py | Python | lgpl-3.0 | 9,293 |
import datetime
import time
import os
import msg_pb2
import control_pb2
import cifsupport
import threading
import hashlib
"""
Routines that support client pinging
"""
class Ping:
def __init__ (self):
self._lock = threading.RLock()
@classmethod
def makereply(cls, msg):
p = control... | jeffmurphy/libcif | lib/CIF/CtrlCommands/Ping.py | Python | lgpl-3.0 | 1,495 |
# BlenderBIM Add-on - OpenBIM Blender Add-on
# Copyright (C) 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BlenderBIM Add-on.
#
# BlenderBIM Add-on 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 Foundati... | IfcOpenShell/IfcOpenShell | src/blenderbim/blenderbim/bim/module/brick/prop.py | Python | lgpl-3.0 | 2,552 |
from django.test import TestCase
from .models import Appointment, Doctor, TimeManager
from .forms import AppointmentForm
class TestFormAppointment(TestCase):
def setUp(self):
self.doctor = Doctor.objects.create(name="Gordon Freeman")
self.doctor2 = Doctor.objects.create(name="Isaac Kleiner")
... | Akay7/hospital | appointments/tests.py | Python | lgpl-3.0 | 2,998 |
'''
Created on Jan 13, 2016
simple day/night tariff calculator
@author: karcio
'''
def calculate():
day = counterState * 0.625 * D_TARIFF_COST
night = counterState * 0.375 * N_TARIFF_COST
calculation = day + night
return calculation
D_TARIFF_COST = 0.1436
N_TARIFF_COST = 0.0711
counterState = f... | karcio/DayNightTariffCalculator | bin/tariffCalclulatorCLI.py | Python | lgpl-3.0 | 521 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys,os
from twisted.python import log
from twisted.internet import reactor, defer
from txradius.radius import dictionary,packet,tools
from txradius.openvpn import CONFIG_FILE,ACCT_START
from txradius.openvpn import get_challenge
from txradius.openvpn import get_dicti... | talkincode/txradius | txradius/openvpn/client_connect.py | Python | lgpl-3.0 | 3,445 |