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 |
|---|---|---|---|---|---|
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from collections import Mapping
import unittes... | klahnakoski/intermittents | pyLibrary/testing/fuzzytestcase.py | Python | mpl-2.0 | 5,448 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-24 00:53
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Menus', '0002_auto_20170824_0051'),
]
operations =... | AlexHagerman/code_louisville_django | LouiePizza/Menus/migrations/0003_menuitem.py | Python | mpl-2.0 | 780 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-02-17 10:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('astrobin', '0003_auto_20180217_0933'),
]
operations = [
migrations.AddField(
model_name='userprofile',... | astrobin/astrobin | astrobin/migrations/0004_userprofile_updated.py | Python | agpl-3.0 | 432 |
"""This file is part of DING0, the DIstribution Network GeneratOr.
DING0 is a tool to generate synthetic medium and low voltage power
distribution grids based on open data.
It is developed in the project open_eGo: https://openegoproject.wordpress.com
DING0 lives at github: https://github.com/openego/ding0/
The docume... | openego/dingo | ding0/core/network/cable_distributors.py | Python | agpl-3.0 | 2,143 |
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2010-2016 (ita)
"""
Classes and functions enabling the command system
"""
import os, re, imp, sys
from waflib import Utils, Errors, Logs
import waflib.Node
# the following 3 constants are updated on each new release (do not touch)
HEXVERSION=0x1090100
"""Constan... | hlange/LogSoCR | .waf/waflib/Context.py | Python | agpl-3.0 | 20,118 |
"""
Test that old keys deserialize just by importing opaque keys
"""
from unittest import TestCase
from opaque_keys.edx.keys import CourseKey, LearningContextKey, UsageKey
class TestDefault(TestCase):
"""
Check that clients which merely import CourseKey can deserialize the expected keys, etc
"""
def t... | edx/opaque-keys | opaque_keys/edx/tests/test_default_deprecated.py | Python | agpl-3.0 | 1,382 |
# -*- coding: utf-8 -*-
##HEADER/FOOTER
def get_default_homepage_template():
template ="""
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css"
href="%(dotdot)s%(STATIC_PATH)sabe.css" />
<link rel="shortcut icon" href="%(dotdot)s%(STATIC_PATH)sfavicon.... | solarcoin/blockchain-explorer | Abe/view_templates.py | Python | agpl-3.0 | 19,325 |
from crm import model
from endpoints_proto_datastore.ndb import EndpointsModel
from google.appengine.api import search
from google.appengine.ext import ndb
from crm.model import Userinfo
from protorpc import messages
from crm.iograph import Edge
# The message class that defines the author schema
class AuthorSchema(m... | ioGrow/iogrowCRM | crm/iomodels/notes.py | Python | agpl-3.0 | 13,724 |
# -*- coding: utf-8 -*-
# See LICENSE file for full copyright and licensing details.
from . import hotel_wizard
from . import sale_make_invoice_advance
| JayVora-SerpentCS/vertical-hotel | hotel/wizard/__init__.py | Python | agpl-3.0 | 153 |
# Copyright 2008-2015 Canonical
# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
#
# 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
# Licens... | magicicada-bot/magicicada-server | magicicada/filesync/tests/test_gateway.py | Python | agpl-3.0 | 192,932 |
# Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# Make this directory into a Python package.
| abramhindle/UnnaturalCodeFork | python/testdata/launchpad/lib/lp/services/webapp/doc/__init__.py | Python | agpl-3.0 | 186 |
# -*- coding: utf-8 -*-
# © 2014 Elico Corp (https://www.elico-corp.com)
# Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
{
'name': 'Account Alternate Invoice',
'version': '7.0.1.0.0',
'author': 'Elico Corp',
'website': 'https://www.elico-corp.com',
'description': """
Acco... | Elico-Corp/openerp-7.0 | account_alternate_invoice/__openerp__.py | Python | agpl-3.0 | 580 |
##
# Copyright (C) 2017 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/views/styleguide.py | Python | agpl-3.0 | 3,472 |
from __future__ import with_statement
import logging
import types
import urllib
import sys
import weakref
import UserList
import newrelic.api.application
import newrelic.api.object_wrapper
import newrelic.api.transaction
import newrelic.api.web_transaction
import newrelic.api.function_trace
import newrelic.api.error_... | galaxy-team/website | newrelic/hooks/framework_twisted.py | Python | agpl-3.0 | 20,328 |
# -*- coding: utf-8 -*-
"""
project............: meat-a
description........: web application for sharing meta information
date...............: 04/2013
copyright..........: Sebastian Fedrau
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation f... | 20centaurifux/meat-a | controller.py | Python | agpl-3.0 | 29,635 |
from setuptools import setup
setup(
name="agentarchives",
description="Clients to retrieve, add, and modify records from archival management systems",
url="https://github.com/artefactual-labs/agentarchives",
author="Artefactual Systems",
author_email="info@artefactual.com",
license="AGPL 3",
... | artefactual-labs/agentarchives | setup.py | Python | agpl-3.0 | 1,074 |
# -*- coding: utf-8 -*-
import logging
from openerp import api, fields, models, _
_logger = logging.getLogger(__name__)
class View(models.Model):
_inherit = 'ir.ui.view'
@api.model
def render_template(self, template, values=None, engine='ir.qweb'):
if template in ['web.login', 'web.webclient_bo... | luoguizhou/gooderp_addons | app_odoo_customize/models/ir_ui_view.py | Python | agpl-3.0 | 576 |
# -*- coding: utf-8 -*-
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Jairo Llopis <jairo.llopis@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ResPartnerTurnoverRange(models.Model):
_name = 'res.part... | sergiocorato/partner-contact | partner_capital/models/res_partner_turnover_range.py | Python | agpl-3.0 | 431 |
# coding=utf-8
from __future__ import unicode_literals, print_function
from datetime import datetime
from celery import group
from urlobject import URLObject
from webhookdb import db, celery
from webhookdb.process import process_label
from webhookdb.models import IssueLabel, Repository, Mutex
from webhookdb.exceptions... | singingwolfboy/webhookdb | webhookdb/tasks/label.py | Python | agpl-3.0 | 4,696 |
import logging
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from survey.exporter.tex.question2tex import Question2Tex
LOGGER = logging.getLogger(__name__)
class Question2TexChart(Question2Tex):
"""
This class permit to generate latex code directly from the Questi... | Pierre-Sassoulas/django-survey | survey/exporter/tex/question2tex_chart.py | Python | agpl-3.0 | 4,424 |
# -*- coding: utf-8 -*-
"""
Test cases to cover Accounts-related behaviors of the User API application
"""
import datetime
import hashlib
import json
from copy import deepcopy
import unittest
import ddt
import mock
import pytz
import six
from django.conf import settings
from django.test.testcases import TransactionT... | appsembler/edx-platform | openedx/core/djangoapps/user_api/accounts/tests/test_views.py | Python | agpl-3.0 | 46,567 |
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields
from openerp import tools
class FleetWorkOrderAnalysis(models.Model):
_name = "fleet.work_order_analysis"
_description = "Fleet Work Order Analysis... | open-synergy/opensynid-fleet | fleet_work_order/reports/fleet_work_order_analysis.py | Python | agpl-3.0 | 3,619 |
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),
('challenge', '0007_auto_20150902_1636'),
]
operations = [... | defivelo/db | apps/challenge/migrations/0008_qualification_helpers.py | Python | agpl-3.0 | 576 |
#
# Copyright (C) 2021 by frePPLe bv
#
# This library 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.
#
# This library is distri... | frePPLe/frePPLe | freppledb/common/migrations/0026_permissions.py | Python | agpl-3.0 | 1,300 |
import sak.sak
def self(*args):
sak.sak.pull(*args)
| aureooms/sak | sak/update.py | Python | agpl-3.0 | 58 |
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import hr_overtime_request
from . import tier_definition
| open-synergy/opnsynid-hr | hr_attendance_overtime_request_tier_validation/models/__init__.py | Python | agpl-3.0 | 192 |
#!/usr/bin/env python
import itertools
from operator import attrgetter, itemgetter
class ClusterRecommendation(object):
__slots__ = ("cluster_id", "papers")
def __init__(self, cluster_id, papers):
self.cluster_id = cluster_id
self.papers = [(p.pid, p.score) for p in papers]
def __str__(s... | jevinw/rec_utilities | babel_util/recommenders/ef2.py | Python | agpl-3.0 | 1,698 |
import gc
import pandas as pd
import numpy as np
import os
import arboretum
import lightgbm as lgb
import json
import sklearn.metrics
from sklearn.metrics import f1_score, roc_auc_score
from sklearn.model_selection import train_test_split
from scipy.sparse import dok_matrix, coo_matrix
from sklearn.utils.multiclass imp... | sh1ng/imba | lgbm_submition.py | Python | agpl-3.0 | 14,927 |
import os
from unittest import TestCase
from unittest.mock import patch
from RatS.icheckmovies.icheckmovies_ratings_inserter import ICheckMoviesRatingsInserter
TESTDATA_PATH = os.path.abspath(
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, "assets")
)
class ICheckMoviesInserterTest(TestCase):
... | StegSchreck/RatS | tests/unit/icheckmovies/test_icheckmovies_ratings_inserter.py | Python | agpl-3.0 | 1,934 |
"""
Django admin page for CourseOverviews, the basic metadata about a course that
is used in user dashboard queries and other places where you need info like
name, and start dates, but don't actually need to crawl into course content.
"""
from __future__ import absolute_import
from config_models.admin import Configura... | ESOedX/edx-platform | openedx/core/djangoapps/content/course_overviews/admin.py | Python | agpl-3.0 | 2,543 |
# coding: utf-8
#
# This file is part of Progdupeupl.
#
# Progdupeupl 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.
#
# Progdu... | progdupeupl/pdp_website | pdp/utils/tests.py | Python | agpl-3.0 | 3,776 |
# -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import os
import mock
from odoo.modules import get_module_path
from odoo.tests.common import TransactionCase
from odoo.tools import mute_logger
from odoo.addons.module_auto_update.addon_hash import ... | ovnicraft/server-tools | module_auto_update/tests/test_module_deprecated.py | Python | agpl-3.0 | 8,365 |
from collections import defaultdict
import mock
from searx.engines import deviantart
from searx.testing import SearxTestCase
class TestDeviantartEngine(SearxTestCase):
def test_request(self):
dicto = defaultdict(dict)
query = 'test_query'
dicto['pageno'] = 0
dicto['time_range'] = ... | jcherqui/searx | tests/unit/engines/test_deviantart.py | Python | agpl-3.0 | 770 |
# -*- coding: utf-8 -*-
# Copyright 2017 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_activity_based_costing
| VitalPet/addons-onestein | account_activity_based_costing/tests/__init__.py | Python | agpl-3.0 | 189 |
# -*- coding: utf-8 -*-
# © 2016 ClearCorp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import re
from openerp.report import report_sxw
from openerp import models, _
from openerp.exceptions import Warning
CURRENCY_NAMES = {
'USD': {
'en': 'Dollars',
'es': 'DOLARES',
},
... | ClearCorp/odoo-clearcorp | account_payment_report/report/account_payment_report.py | Python | agpl-3.0 | 2,163 |
from datetime import datetime as dt
from moulinette.interfaces import JSONExtendedEncoder
def test_json_extended_encoder(caplog):
encoder = JSONExtendedEncoder()
assert encoder.default({1, 2, 3}) == [1, 2, 3]
assert encoder.default(dt(1917, 3, 8)) == "1917-03-08T00:00:00+00:00"
assert encoder.defau... | YunoHost/moulinette | test/test_serialize.py | Python | agpl-3.0 | 434 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2016 Didotech srl (<http://www.didotech.com>).
#
# All Rights Reserved
#
# This program is free software: you can redistr... | iw3hxn/LibrERP | product_extended/models/__init__.py | Python | agpl-3.0 | 1,187 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Pexego All Rights Reserved
# $Jesús Ventosinos Mayor <jesus@pexego.es>$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affer... | Pexego/PXGO_00053_2013_VT | project-addons/sale_product_customize/wizard/mrp_create_prod.py | Python | agpl-3.0 | 2,350 |
import pytest
from ..base_test import SeleniumTestCase
from ..entities import Project, Organization
pytestmark = pytest.mark.skip
class AnonymousUserOrganizationView(SeleniumTestCase):
def test_anonymous_user_project_view(self):
self.open("")
self.wd.wait_for_css(".organizations")
self.... | Cadasta/cadasta-test | cadasta/test/permission_tests/test_anonymous_user_permissions.py | Python | agpl-3.0 | 1,231 |
# pylint: skip-file
import datetime
import json
import sys
from unittest import mock
from unittest.mock import Mock, patch
import ddt
import pytest
from django.test import RequestFactory, TestCase
from django.urls import reverse
from edx_django_utils.cache import RequestCache
from opaque_keys.edx.keys import CourseK... | stvstnfrd/edx-platform | lms/djangoapps/discussion/django_comment_client/tests/test_utils.py | Python | agpl-3.0 | 78,549 |
"""
Course API Serializers. Representing course catalog data
"""
import urllib
from django.core.urlresolvers import reverse
from django.template import defaultfilters
from rest_framework import serializers
from lms.djangoapps.courseware.courses import course_image_url, get_course_about_section
from xmodule.course_... | pomegranited/edx-platform | lms/djangoapps/course_api/serializers.py | Python | agpl-3.0 | 3,293 |
# -*- coding: utf-8 -*-
from odoo.exceptions import AccessError
from odoo import api, fields, models, _
from odoo import SUPERUSER_ID
from odoo.exceptions import UserError, ValidationError
from odoo.http import request
from odoo.addons.account.models.account_tax import TYPE_TAX_USE
import logging
_logger = logging.g... | ddico/odoo | addons/account/models/chart_template.py | Python | agpl-3.0 | 68,522 |
'''
Test cases for 'GET' views and actions available for admins.
They include all cases for teachers through inheritance.
'''
from .cases import SubmitAdminTestCase
from .helpers.user import create_user, get_student_dict
from .helpers.testmachine import create_test_machine
class Admin(SubmitAdminTestCase):
def t... | troeger/opensubmit | web/opensubmit/tests/test_admin.py | Python | agpl-3.0 | 1,230 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.core.management import setup_environ
import settings
setup_environ(settings)
import os
import sys
import time
import random
import datetime
from quizbowl.models import *
from quizbowl.views import notify_user
from django.contrib.auth.models impor... | cristilav/FLEQ | websocket-client.py | Python | agpl-3.0 | 15,128 |
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, api, fields
class ProjectTask(models.Model):
... | ingadhoc/project | project_ux/models/project_task.py | Python | agpl-3.0 | 2,136 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import random
import math
import model
import utils
import gen
default_paraphrase = u"Niestety, psy czasem się mylą. Może ich zgubić choćby zapach palącego papierosy."
parser = argparse.ArgumentParser(description='... | mafik/pargen | pargen.py | Python | agpl-3.0 | 2,144 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2017 Didotech SRL
import logging
from openerp.osv import fields, orm
import tools
from openerp import addons
_logger = logging.getLogger(__name__)
... | iw3hxn/LibrERP | res_users_kanban/models/inherit_res_users.py | Python | agpl-3.0 | 2,957 |
import os, sys, inspect
import unittest
import ConfigParser
from KalturaClient import KalturaClient, KalturaConfiguration
from KalturaClient.Base import KalturaObjectFactory, KalturaEnumsFactory
from KalturaClient.Base import IKalturaLogger
from KalturaClient.Plugins.Core import KalturaSessionType
from KalturaClient.... | ivesbai/server | generator/sources/python/KalturaClient/tests/utils.py | Python | agpl-3.0 | 2,114 |
"""
Grades Service Tests
"""
from datetime import datetime
import ddt
import pytz
from freezegun import freeze_time
from lms.djangoapps.grades.constants import GradeOverrideFeatureEnum
from lms.djangoapps.grades.models import (
PersistentSubsectionGrade,
PersistentSubsectionGradeOverride,
PersistentSubsecti... | jolyonb/edx-platform | lms/djangoapps/grades/tests/test_services.py | Python | agpl-3.0 | 12,114 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Module exports :class:`NBCC2015_AA13`
"""
import io
import os
import numpy as np
from openquake.hazardlib.gsim.gmpe_table import (
GMPETable, _get_mean, _get_stddev)
from openquake.hazardlib.gsim.base import CoeffsTable
from openquake.hazardlib import const
from op... | gem/oq-engine | openquake/hazardlib/gsim/can15/nbcc2015_aa13.py | Python | agpl-3.0 | 7,068 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-present Taiga Agile LLC
#
# 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 ver... | taigaio/taiga-back | taiga/events/backends/rabbitmq.py | Python | agpl-3.0 | 2,914 |
default_app_config = 'work.apps.WorkAppConfig'
| FreedomCoop/valuenetwork | work/__init__.py | Python | agpl-3.0 | 47 |
# Copyright 2017 Ignacio Ibeas <ignacio@acysos.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, exceptions, fields, models
class AeatSiiMap(models.Model):
_name = "aeat.sii.map"
_description = "Aeat SII Map"
@api.constrains("date_from", "date_to")
def _un... | OCA/l10n-spain | l10n_es_aeat_sii_oca/models/aeat_sii_map.py | Python | agpl-3.0 | 2,146 |
"""
Student Views
"""
import datetime
import feedparser
import json
import logging
import random
import re
import string # pylint: disable=W0402
import urllib
import uuid
import time
from django.conf import settings
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.models impor... | pdehaye/theming-edx-platform | common/djangoapps/student/views.py | Python | agpl-3.0 | 51,566 |
#!/usr/bin/python
import shtest, sys, common
from common import *
from math import *
def frac_test(p, types=[]):
if is_array(p):
result = [a - floor(a) for a in p]
else:
result = [a - floor(a)]
return shtest.make_test(result, [p], types)
def insert_into(test):
test.add_test(frac_test(... | libsh-archive/sh | test/regress/frac.cpp.py | Python | lgpl-2.1 | 1,097 |
#!/usr/bin/env python
# Notes:
# 1) ini file items:
# NGCGUI_PREAMBLE
# NGCGUI_SUBFILE
# NGCGUI_POSTAMBLE
# NGCGUI_OPTIONS
# nonew disallow new tabs
# noremove disallow removal of tabs
# noauto don't automatically send result file
# ... | bmwiedemann/linuxcnc-mirror | lib/python/pyngcgui.py | Python | lgpl-2.1 | 128,675 |
# __init__.py - collection of Luxembourgian numbers
# coding: utf-8
#
# Copyright (C) 2012 Arthur de Jong
#
# 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 Lic... | arthurdejong/python-stdnum | stdnum/lu/__init__.py | Python | lgpl-2.1 | 954 |
# -*- coding: utf-8 -*-
import fcntl
import glob
import json
import os
import random
import shutil
import socket
import subprocess
import sys
import tempfile
import time
TEST_DIR = os.path.normpath(os.path.dirname(os.path.realpath(os.path.join(__file__, ".."))))
def browser_path(headless=True):
"""Return path t... | stefwalter/cockpit | test/common/cdp.py | Python | lgpl-2.1 | 9,003 |
# JoeAgent - A Multi-Agent Distributed Application Framework
# Copyright (C) 2004 Rhett Garber
# 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... | rhettg/JoeAgent | director.py | Python | lgpl-2.1 | 9,402 |
from __future__ import print_function, division
import json
import socket
import random
import time
import numpy as np
class Client(object):
SYNC_ON = b'1'
SYNC_OFF = b'2'
EVENT_ON = b'A'
EVENT_OFF = b'D'
ACQ = b'Y'
QUIT = b'X'
def __init__(self, cfgfile='servic... | viktorbahr/jaer | server/client.py | Python | lgpl-2.1 | 3,600 |
class Config:
# specific (for this development instance)
# SERVER_NAME = 'localhost:5000'
SQLALCHEMY_DATABASE_URI = "sqlite:///data.db"
ANTIVIRUS_CHECK_REQUIRED = False
SECRET_KEY = "toto"
# develop settings
DEBUG = True
ASSETS_DEBUG = True
DEBUG_TB_ENABLED = True
# TEMPLATE_DEB... | abilian/abilian-core | demo/config.py | Python | lgpl-2.1 | 1,105 |
#! /usr/bin/env python
"""
# control_get_firmware.py: get firmware version of Gemalto readers
# Copyright (C) 2009-2012 Ludovic Rousseau
"""
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foun... | sixtyfive/pcsc-ctapi-wrapper | PCSC/UnitaryTests/control_get_firmware.py | Python | lgpl-2.1 | 2,053 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name = "icebox",
version = "0.1",
description = "Search, Play and Record Icecast & Shoutcast Streams - On the Linux Console",
keywords = "media, icecast, shoutcast, radio, icecream, mpg123, player, st... | pythonhacker/icebox | setup.py | Python | lgpl-2.1 | 639 |
"""
This file is a modification of the pygear project (https://sourceforge.net/projects/pygear/)
and is distribuited under the same license of his parent
license:
This code is published under the terms of the GNU General Public License v3
http://www.gnu.org/licenses/gpl-3.0.html
"""
from copy import deepcopy
from math... | efirvida/python-gearbox | gearbox/libs/gearprofile.py | Python | lgpl-2.1 | 41,407 |
"""
@author David W.H. Swenson
"""
from __future__ import absolute_import
from builtins import object
from nose.tools import (assert_equal, assert_not_equal, assert_is, raises,
assert_true, assert_false)
from nose.plugins.skip import Skip, SkipTest
from .test_helpers import (CallIdentity, raise... | choderalab/openpathsampling | openpathsampling/tests/test_volume.py | Python | lgpl-2.1 | 17,171 |
# fMBT, free Model Based Testing tool
# Copyright (c) 2013-2019, Intel Corporation.
#
# Author: antti.kervinen@intel.com
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software... | 01org/fMBT | pythonshare/pythonshare/server.py | Python | lgpl-2.1 | 30,835 |
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# 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.
#
# This library ... | FedoraScientific/salome-paravis | test/VisuPrs/dump_study/A5.py | Python | lgpl-2.1 | 7,364 |
import unittest
import mock
import lvmlib
class ExecResultMixIn(object):
def assertExecutionSucceeded(self, exec_result):
returncode, stdout, stderr = exec_result
self.assertEquals(0, returncode)
def assertExecutionFailed(self, exec_result):
returncode, stdout, stderr = exec_result
... | xapi-project/sm | tests/test_lvmlib.py | Python | lgpl-2.1 | 6,561 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake, tools, RunEnvironment
import os
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
cmake.configure()
cmak... | uilianries/conan-libusb | test_package/conanfile.py | Python | lgpl-2.1 | 829 |
#!/usr/bin/env python
#
# @file CppFiles.py
# @brief class for generating cpp files
# @author Frank Bergmann
# @author Sarah Keating
#
# <!--------------------------------------------------------------------------
#
# Copyright (c) 2013-2015 by the California Institute of Technology
# (California, USA), the Euro... | hovo1990/deviser | generator/code_files/CppFiles.py | Python | lgpl-2.1 | 4,388 |
# SPDX-License-Identifier: LGPL-3.0-only
"""Unit tests for the doorstop.cli.utilities module."""
import sys
import unittest
from argparse import ArgumentTypeError
from unittest.mock import Mock, patch
from warnings import catch_warnings
from doorstop import common, settings
from doorstop.cli import utilities
from do... | michaelnt/doorstop | doorstop/cli/tests/test_utilities.py | Python | lgpl-3.0 | 7,856 |
#!/usr/bin/python3
#Copyright Xoristzatziki
import configparser
import os,sys
class MyConfigs():
def __init__(self,filename):
self.myconfigfilename = filename
def readconfigvalue(self, wichsection, wichoption, default):
try:
cp = configparser.ConfigParser()
c... | Xoristzatziki/Sample-App | _lib/forconfig.py | Python | lgpl-3.0 | 1,587 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('protocoltool', '0023_auto_20161208_1723'),
]
operations = [
migrations.RenameField(
model_name='basicdataset',
... | switchonproject/sip-html5-protocol-tool | protocoltool/migrations/0024_auto_20161212_1645.py | Python | lgpl-3.0 | 399 |
# wsse/client/requests/tests/test_auth.py
# coding=utf-8
# pywsse
# Authors: Rushy Panchal, Naphat Sanguansin, Adam Libresco, Jérémie Lumbroso
# Date: September 1st, 2016
# Description: Test the requests authentication implementation
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.c... | PrincetonUniversity/pywsse | wsse/client/requests/tests/test_auth.py | Python | lgpl-3.0 | 2,780 |
#-*- coding: utf8 -*-
import pymongo, time as T, threading as t, sys
from twython import TwythonStreamer
from twython import Twython
from maccess import TW, mdc
HTAG=["#aao0","#arenaNETmundial","#Participabr"]
HTAG_=[i.replace("#","H") for i in HTAG]
class MyStreamer(TwythonStreamer):
def on_success(self, data):
... | ttm/indicadores-participativos | puxaTweets.py | Python | lgpl-3.0 | 5,174 |
import pytest
import psi4
from forte.solvers import solver_factory, HF, ActiveSpaceSolver, SpinAnalysis
def test_aci_3():
"""Test FCI on H4/STO-3G. Reproduces the test aci-1"""
ref_hf_energy = -2.0310813811962456
ref_aci_energy = -2.115455548674
ref_acipt2_energy = -2.116454734743
spin_val = 1.0... | evangelistalab/forte | tests/pytest-methods/aci/test_aci-3.py | Python | lgpl-3.0 | 1,464 |
"""Conf format
The conf format is registered by default. It reads and writes settings
using :mod:`ConfigParser` at locations that are similar to typical Unix
configuration files---that is, in :file:`.conf` files specific to each
component scope under :file:`/etc/{organization}` for system-wide
settings and under :fil... | nisavid/spruce-settings | spruce/settings/_conf.py | Python | lgpl-3.0 | 3,013 |
#!/usr/bin/env python
"""
A convinience wrapper around mysql connector.
This file is part of open-ihm.
open-ihm is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at y... | snim2mirror/openihm | src/openihm/model/database.py | Python | lgpl-3.0 | 949 |
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Matthias Luescher
#
# Authors:
# Matthias Luescher
#
# This file is part of edi.
#
# edi 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... | lueschem/edi | edi/commands/version.py | Python | lgpl-3.0 | 1,351 |
# -*- Mode:python; coding: utf-8; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2016 Endless Mobile, Inc.
# Author: Niv Sardi <xaiki@endlessm.com>
#
# 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
# ... | endlessm/endless-ndn | demo/mock-usb-producer.py | Python | lgpl-3.0 | 1,550 |
# telegram-bot-server
# Copyright (C) 2017 quasiyoke
#
# You should have received a copy of the GNU Lesser General Public License v3
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import asyncio
import logging
import traceback
from .error import BotError
from .middleware import AuthMiddleware,... | quasiyoke/telegram-bot-server | telegram_bot_server/server.py | Python | lgpl-3.0 | 6,225 |
import tp
import mm
def thing_init(t):
return
def snow_deco1_init(name, short_name, tiles=[]):
x = tp.Tp(name)
x.set_short_name(short_name)
x.set_z_depth(mm.Z_DEPTH_SNOW)
x.set_is_snow_deco(True)
if tiles is not None:
for t in tiles:
x.set_tile(t, delay_ms=50)
else:
... | goblinhack/MundusMeus | python/things/snow_deco.py | Python | lgpl-3.0 | 875 |
# -*- coding: utf-8 -*-
"""
Some Python tools for reading select data from Nastran .op2 files.
Converted from the Yeti version.
Can read files in big or little endian format.
@author: Tim Widrick
"""
from __future__ import print_function
import sys
import struct
import itertools as it
import warnings
from six import... | saullocastro/pyNastran | pyNastran/op2/dev/op2.py | Python | lgpl-3.0 | 118,219 |
#!/usr/bin/env python
#
# @copyright Ipdea Land, S.L.
#
# LGPL v3 - GNU LESSER GENERAL PUBLIC LICENSE
#
# 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 3 of the License.
#... | teenvio/SOAP-API | examples/example_soap.py | Python | lgpl-3.0 | 1,984 |
###############################################################################
# volumina: volume slicing and editing library
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# modify it und... | jakirkham/volumina | volumina/volumeEditor.py | Python | lgpl-3.0 | 10,423 |
def add(x, y):
return x + y
x = 0
import pdb; pdb.set_trace()
x = add(1, 2)
| fengbohello/practice | python/pdb/sample.py | Python | lgpl-3.0 | 81 |
"""
WSGI config for project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
from django.core.wsgi impo... | sv0/django-markdown-app | example/project/wsgi.py | Python | lgpl-3.0 | 389 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Author: sansna
# Date : 2020 Aug 01 17:42:43
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../../")))
import re
# App Config
# XXX: https://stackoverflow.com/questions/3536620/how-to-change-a-module-variable-from-another... | sansna/PythonWidgets.py | lib3/web/server.py | Python | lgpl-3.0 | 3,623 |
import logging
from datetime import datetime
from io import BytesIO, BufferedReader
from telegram.ext import Updater, CommandHandler, RegexHandler, \
MessageHandler, Filters, CallbackQueryHandler
from telegram.ext.dispatcher import run_async
from telegram import ParseMode, ReplyKeyboardMarkup, ReplyKeyboardHide, \... | jh0ker/scambot | bot.py | Python | lgpl-3.0 | 21,774 |
#!/usr/bin/env python
# Copyright (C) 2015 Swift Navigation Inc.
# Contact: Fergus Noble <fergus@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITH... | madsryvang/LVsbp | python/sbp/navigation.py | Python | lgpl-3.0 | 28,612 |
from __future__ import print_function
import numpy as np
from numpy import ma
from matplotlib.cbook import dedent
from matplotlib.ticker import (NullFormatter, ScalarFormatter,
LogFormatterMathtext)
from matplotlib.ticker import (NullLocator, LogLocator, AutoLocator,
... | cactusbin/nyt | matplotlib/lib/matplotlib/scale.py | Python | unlicense | 15,950 |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
"default": {
# Ends with "postgresql_psycopg2", "mysql", "sqlite3" or "oracle".
"ENGINE": "django.db.backends.sqlite3",
# DB name or path to database file if using sqlite3.
"NAME": "dev.db",
# Not used with sqlite3.
... | orlenko/bccf | src/bccf/local_settings_sample.py | Python | unlicense | 572 |
"""Artist puzzles from <http://code.org> built on `tkinter` only.
Artist is similar to the great `turtle` standard module for teaching
programming but builds on a foundation of puzzle and solution, (which
`turtle` does not):
- Subset of basic Python turtle commands (all needed for puzzles).
- Puzzles created by stu... | skilstak/code-dot-org-python | codestudio/artist.py | Python | unlicense | 10,452 |
# Create your views here.
# CCUser.views include user managing
from django.http import HttpResponse
from django.shortcuts import render
def signin(request):
if request.method == 'POST':
return HttpResponse('success')
else:
return render(request, 'signin.html')
| NeilSoul/CrowdConnection | WebServer/ccuser/views.py | Python | unlicense | 271 |
from pages.internal_page import InternalPage
from pages.blocks.film_form import FilmForm
from selenium.webdriver.support.select import Select
class CreateFilmPage(InternalPage):
def __init__(self, driver, base_url):
super(CreateFilmPage, self).__init__(driver, base_url)
self.film_form = FilmForm(... | katyast/Se-Python-17-Stoliarova | pages/create_film_page.py | Python | apache-2.0 | 347 |
import unittest
class ExampleTest(unittest.TestCase):
def test_a(self):
self.assertEqual(1, 1)
self.assertEqual([1, 2, 3], [1, 2, 3])
| fkmhrk/kiilib_python | test/sample_test.py | Python | apache-2.0 | 155 |
#
# cocos2d:
# http://cocos2d.org
#
# An example of how to generate a 3D scene manually
# Of course, the easiest way is to execute an Waves3D action,
# but this example is provided to show the
# 'internals' of generating a 3D effect.
#
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__... | shadowmint/nwidget | lib/cocos2d-0.5.5/samples/demo_flag3d.py | Python | apache-2.0 | 7,097 |
"""convert between game types"""
import argparse
import itertools
import json
import sys
from gameanalysis import gambit
from gameanalysis import gamereader
from gameanalysis import matgame
from gameanalysis import paygame
from gameanalysis import rsgame
_TYPES = {
'emptygame': (
['empty'], 'Strip payoff... | egtaonline/GameAnalysis | gameanalysis/script/conv.py | Python | apache-2.0 | 4,062 |
import os
import json
import urllib.request
import mimetypes
from pathlib import Path
from distutils.dir_util import copy_tree
HTML_PAGE_HEADER = '<!DOCTYPE html> \n <html> \n <head> \
<title> Physical Web Exhibit </title>\
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/shoelace-css/1.0.0-beta13/... | mkyl/Physical-Web-CMS-Server | server/presentation.py | Python | apache-2.0 | 5,186 |
import os
import json
import random
import unittest
import numpy as np
import sys
import tempfile
import shutil
from unittest.mock import MagicMock
import ray
from ray.tune.result import TRAINING_ITERATION
from ray.tune.schedulers import (HyperBandScheduler, AsyncHyperBandScheduler,
Po... | stephanie-wang/ray | python/ray/tune/tests/test_trial_scheduler.py | Python | apache-2.0 | 47,249 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.