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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
from strephit.web_sources_corpus.spiders import BaseSpider
from strephit.web_sources_corpus.items import WebSourcesCorpusItem
class ChineseBioSpider(BaseSpider):
name = "chinese_bio"
allowed_domains = ["en.wikisource.org"]
start_urls = (
'https://en.wikisource.org/wiki/A_Ch... | Wikidata/StrepHit | strephit/web_sources_corpus/spiders/chinese_bio.py | Python | gpl-3.0 | 887 |
from django.contrib import admin
# Register your models here.
from django.contrib import admin
from rango.models import Category, Page
class PageAdmin(admin.ModelAdmin):
list_display = ('title', 'category', 'url')
admin.site.register(Category)
admin.site.register(Page,PageAdmin)
| ramprasathdgl/TangoWithDjango | TangoWithDjango/rango/admin.py | Python | gpl-3.0 | 287 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from .keyboard import Keyboard
| psychopy/psychopy | psychopy/devices/__init__.py | Python | gpl-3.0 | 261 |
# Copyright (C) 2015 https://github.com/thof
#
# This file is part of decapromolist.
#
# decapromolist 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
# any later version.
#... | thof/decapromolist | src/get_subcategories.py | Python | gpl-3.0 | 3,880 |
# -*- coding: utf-8 -*-
#
# metahttp.py is part of MetaDoc (Client).
#
# All of MetaDoc 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 lat... | henrikau/metadoc | client/metahttp.py | Python | gpl-3.0 | 4,303 |
import requests
import wave
CUID = '7519663'
APIKEY = 'Ll0c53MSac6GBOtpg22ZSGAU'
SECRET = '44c8af396038a24e34936227d4a19dc2'
def get_token():
api_key = APIKEY
secret_key = SECRET
auth_url = 'https://openapi.baidu.com/oauth/2.0/token'
payload = {
'grant_type': 'client_credentials',
'cl... | SXKDZ/magic-mirror | backend/util/baidu.py | Python | gpl-3.0 | 1,267 |
import sqlite3 as lite
import sys
from datetime import datetime
#con = lite.connect('zthb.sqlite')
# with con:
# cur = con.cursor()
#
# cur.execute("UPDATE user_comment SET u_comment=? WHERE u_comment=?", ("__DOLLFACE__","OMG"))
# con.commit()
#
# print "Number of rows updated: %d" % cur.rowcount
# w... | onajafi/Cookie_Sharing_Bot | readDatas.py | Python | gpl-3.0 | 2,844 |
# -*- coding: utf-8 -*-
# Description: NSD `nsd-control stats_noreset` netdata python.d module
# Author: <383c57 at gmail.com>
from base import ExecutableService
import re
# default module values (can be overridden per job in `config`)
priority = 60000
retries = 5
update_every = 30
# charts order (can be overridden... | seamless-distribution-systems/galilei | galieli-netdata-installer/netdata/python.d/nsd.chart.py | Python | gpl-3.0 | 3,581 |
# -*- coding: utf-8 -*-
'''
Created on 23 mars 2014
@author: nestof
'''
class Parameter(object):
'''
classdocs
'''
tableName = 'parametrage'
colCodeName = 'code'
colTypeName = 'type'
colValueName = 'valeur'
colCommentName = 'commentaire'
def __init__(self):
... | nestof/domoCore | com/nestof/domocore/domain/Parameter.py | Python | gpl-3.0 | 482 |
from scripts.helperFuncs import *
# command line arguments and basic settings
# --------------------------------------------------------------------------------------------------
init()
# just in case... (may comment this out)
if not glob.annz["doBinnedCls"]:
log.info(red(" - "+time.strftime("%d/%m/%y %H:%M:%S")+" ... | IftachSadeh/ANNZ | examples/scripts/annz_binCls_quick.py | Python | gpl-3.0 | 8,873 |
#!/usr/bin/python
import sys
sys.path.insert(0, "..")
from qgis.PyQt import QtCore
from qgis.PyQt import QtGui
from qgis.PyQt import QtWidgets
from qgis_etri.mcda.types import Alternatives, AlternativePerformances, Criteria, PerformanceTable
from qgis_etri.table import qt_performance_table
from xml.etree import Element... | oso/qgis-etri | tests/test_table_pt.py | Python | gpl-3.0 | 4,538 |
'''
Author: Victor Mireles - Freie Universitaet Berlin
Email: syats.vm@gmail.com
Latest version: https://github.com/syats/ModuleReusability
Distributed under GPL V3.0
'''
import numpy as np
import pickle
import glob
import scipy as sci
from scipy.stats import entropy
import permutationsOfArtifi... | syats/ModuleReusability | aux/decompositionWithSurrogates.py | Python | gpl-3.0 | 10,182 |
from django.conf.urls import include, url
from . import views
urlpatterns = [
] | muepsilon/Stocks-Monitering-Tool | stocks/urls.py | Python | gpl-3.0 | 85 |
import sys
def main():
print sys.byteorder
print hex(42)
print bin(42)
if __name__ == '__main__':
main() | ruchikd/Algorithms | Python/findEndianness/findEndianness.py | Python | gpl-3.0 | 111 |
# coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online
OpenAPI spec version: 0.4.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class GetOpportunitiesTasksTaskIdOk(object):
"""
NOTE: T... | minlexx/pyevemon | esi_client/models/get_opportunities_tasks_task_id_ok.py | Python | gpl-3.0 | 5,602 |
# -*- coding: utf-8 -*-
# This file is part of emesene.
#
# emesene is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
#... | emesene/emesene | emesene/gui/common/TrayIcon.py | Python | gpl-3.0 | 14,327 |
x = []
d = 0
for _ in range(4):
x.append(int(raw_input()))
for i in range(input()):
if any(((i + 1) % j == 0) for j in x):
d += 1
print d
| yamstudio/Codeforces | 100/148A - Insomnia cure.py | Python | gpl-3.0 | 146 |
from os import curdir, sep
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from urlparse import urlparse, parse_qs
from subprocess import call
import SocketServer
import osc
import random
import json
import socket
import sys
class Drummers(object):
def __init__(self):
self.drummer_map = {}
... | aturley/spaceshooter | server-demogame.py | Python | gpl-3.0 | 4,932 |
# Authors:
# Jason Gerard DeRose <jderose@redhat.com>
# Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | apophys/freeipa | ipalib/rpc.py | Python | gpl-3.0 | 47,337 |
#!/usr/bin/env python3
# pylint: disable=C0103, C0325, C0301
"""
Zipped Agoda Hotel Data File Parser
-----------------------------------
This utility unzips and parses the Agoda hotel data file, in-memory,
and makes the data available
"""
import csv
import zipfile
import io
import sys
class AgodaParser(object):
... | egeland/agodaparser | agodaparser.py | Python | gpl-3.0 | 2,962 |
from __future__ import division
import errno
import json
import os
import sys
import time
import traceback
from twisted.internet import defer, reactor
from twisted.python import log
from twisted.web import resource, static
import p2pool
from bitcoin import data as bitcoin_data
from . import data as p2pool_data, p2p
... | andreasfaerber/p2pool-feathercoin | p2pool/web.py | Python | gpl-3.0 | 25,473 |
# -*- coding: utf-8 -*-
import unittest
from khayyam import algorithms_c as alg_c
from khayyam import algorithms_pure as alg_p
__author__ = 'vahid'
# TODO: test with negative values
class TestCAlgorithms(unittest.TestCase):
def test_get_julian_day_from_gregorian(self):
self.assertRaises(ValueError, alg_p... | pylover/khayyam | khayyam/tests/test_algorithms.py | Python | gpl-3.0 | 4,401 |
from django.test import SimpleTestCase
from datetime import date, time, datetime
from hav.apps.media.utils.dtrange import range_from_partial_date
class DateTimeRangeTest(SimpleTestCase):
def testYearOnly(self):
self.assertEqual(
range_from_partial_date(2017),
(
dat... | whav/hav | tests/media/test_media.py | Python | gpl-3.0 | 1,120 |
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo, mepinta@joaquinduo.com.ar
This file is part of Mepinta under GPL 3
'''
import unittest
from mepinta.pipelineview.actiontree.data_model import ActionTree
from mepinta.pipelineview.actiontree.ActionTreeManager import ActionTreeManager
from pprint import pprint, pforma... | joaduo/mepinta | core/python_core/mepinta/pipelineview/actiontree/tests/test_ActionTreeManager.py | Python | gpl-3.0 | 2,762 |
import os
import sys
import logging
import base64
from subprocess import check_call
from transparencyscript.constants import TRANSPARENCY_SUFFIX
from transparencyscript.utils import make_transparency_name, get_config_vars, get_password_vars, get_task_vars, \
get_transparency_vars, get_tree_head, get_lego_env, get_... | BrandonTang/binary-transparency | transparencyscript/script.py | Python | mpl-2.0 | 3,070 |
#
# CDR-Stats License
# http://www.cdr-stats.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2015 Star2Billing S.L.
#
# The Initial Develope... | Star2Billing/cdr-stats | cdr_stats/apirest/view_user.py | Python | mpl-2.0 | 1,041 |
# 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/.
"""
Transform the beetmover task into an actual task description.
"""
from __future__ import absolute_import, print_func... | Yukarumya/Yukarum-Redfoxes | taskcluster/taskgraph/transforms/beetmover.py | Python | mpl-2.0 | 10,596 |
from django.http import Http404
from django.views.generic.base import TemplateView
from treeherder.model.derived import JobsModel
class ResultsetStatusView(TemplateView):
template_name = "embed/resultset_status.html"
def get_context_data(self, **kwargs):
assert "repository" in kwargs and "revision"... | wlach/treeherder | treeherder/embed/views.py | Python | mpl-2.0 | 1,205 |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# 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/.
# ***** END LICENSE BLOCK *****
import sys
import os
# load mod... | cstipkovic/spidermonkey-research | testing/mozharness/scripts/b2g_desktop_multilocale.py | Python | mpl-2.0 | 9,106 |
from collections.abc import MutableMapping
MYPY = False
if MYPY:
# MYPY is set to True when run under Mypy.
from typing import Any
from typing import Dict
from typing import Iterator
from typing import List
from typing import Optional
from typing import Set
from typing import Text
... | KiChjang/servo | tests/wpt/web-platform-tests/tools/manifest/typedata.py | Python | mpl-2.0 | 10,877 |
# coding: utf-8
import base64
import pytest
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from tests_silverlight import SilverlightTestCase
By.XNAME = 'xname'
class TestGetCommands(SilverlightTestCase):
"""
Test GET commands that do not change an... | 2gis/Winium.StoreApps | Winium/TestApp.Test/py-functional/tests_silverlight/test_commands.py | Python | mpl-2.0 | 8,916 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington
# See opus_core/LICENSE
import os, sys
import imp
def opusRun(progressCB,logCB,params):
f, filename, description = imp.find_module('arcgisscripting', ['c:/Python25/Lib/site-p... | apdjustino/DRCOG_Urbansim | src/opus_gui/data_manager/run/tools/esri_feature_to_point.py | Python | agpl-3.0 | 1,487 |
import pytest
from dateutil.parser import parse
from django.urls import reverse
from adhocracy4.dashboard import components
from adhocracy4.test.helpers import assert_template_response
from adhocracy4.test.helpers import redirect_target
from adhocracy4.test.helpers import setup_phase
from meinberlin.apps.ideas.phases ... | liqd/a4-meinberlin | tests/offlineevents/dashboard_components/test_views_project_offlineevents.py | Python | agpl-3.0 | 3,388 |
import argparse
def parse():
parser = argparse.ArgumentParser()
parser.add_argument('--developer-mode', default='1', choices=['0', '1'], dest='developerMode')
parser.add_argument('--experimental', default=0, choices=['0', '1'])
parser.add_argument('--seeds', default=None, help="specify seeds - if left... | avikivity/scylla | dist/docker/redhat/commandlineparser.py | Python | agpl-3.0 | 2,930 |
# -*- coding: utf-8 -*-
# © 2016 Comunitea Servicios Tecnologicos (<http://www.comunitea.com>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Stock picking company sequence',
'version': '10.0',
'author': 'Comunitea, ',
"category": "",
'license': 'AGPL-3',
'descript... | Comunitea/CMNT_00098_2017_JIM_addons | picking_company_sequence/__manifest__.py | Python | agpl-3.0 | 632 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | browseinfo/odoo_saas3_nicolas | addons/email_template/wizard/mail_compose_message.py | Python | agpl-3.0 | 12,835 |
# -*- coding: utf-8 -*-
# Akvo RSR is covered by the GNU Affero General Public License.
# See more details in the license.txt file located at the root folder of the Akvo RSR module.
# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
from sorl.thumbnail.base import Thumbn... | akvo/akvo-rsr | akvo/thumbnail_backend.py | Python | agpl-3.0 | 1,113 |
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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 ... | sevein/archivematica | src/dashboard/src/components/api/views.py | Python | agpl-3.0 | 22,892 |
# -*- coding: utf-8 -*-
# Copyright 2017 Stein & Gabelgaard ApS
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, fields, models, _, exceptions
import logging
_logger = logging.getLogger(__name__)
class CamposActivitySignupMembers(models.TransientModel):
_name = 'campos.act... | sl2017/campos | campos_activity/wizards/campos_activity_signup_wiz.py | Python | agpl-3.0 | 10,652 |
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import stock_picking
| OCA/stock-logistics-warehouse | stock_picking_cancel_confirm/models/__init__.py | Python | agpl-3.0 | 156 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-12-13 15:23
# This is necessary because django-simple-history 2.6.0 changes the model
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('degreed', '0005_auto_20... | edx/edx-enterprise | integrated_channels/degreed/migrations/0006_upgrade_django_simple_history.py | Python | agpl-3.0 | 775 |
# thesquirrel.org
#
# Copyright (C) 2015 Flying Squirrel Community Space
#
# thesquirrel.org 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 la... | bendk/thesquirrel | events/tests/test_forms.py | Python | agpl-3.0 | 7,189 |
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | xlqian/navitia | source/jormungandr/jormungandr/scenarios/ridesharing/instant_system.py | Python | agpl-3.0 | 11,739 |
from flask import Blueprint, jsonify, request
routes_api = Blueprint('routes_api', __name__)
@routes_api.route('/v1/routes', methods=['GET'])
def routes_get():
'''
Get a list of routes
It is handler for GET /routes
'''
return jsonify()
| ridindirtyatl/truffle-api | routes.py | Python | agpl-3.0 | 261 |
# -*- coding: utf-8 -*-
#
# 2016-05-04 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Initial writup
#
# License: AGPLv3
# (c) 2016. Cornelius Kölbel
#
# This code is free software; you can redistribute it and/or
# modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
# License as publi... | jalr/privacyidea | privacyidea/lib/eventhandler/base.py | Python | agpl-3.0 | 2,637 |
# -*- coding: utf-8 -*-
# © 2013 - Guadaltech - Alberto Martín Cortada
# © 2015 - AvanzOSC - Ainara Galdona
# © 2014-2016 - Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
class L10nEsAeatMod303Report(models.Mode... | Endika/l10n-spain | l10n_es_aeat_mod303/models/mod303.py | Python | agpl-3.0 | 9,035 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redis... | h4wkmoon/shinken | shinken/objects/timeperiod.py | Python | agpl-3.0 | 31,954 |
"""Entitlement Models"""
import logging
import uuid as uuid_tools
from datetime import timedelta
from django.conf import settings
from django.contrib.sites.models import Site
from django.db import IntegrityError, models, transaction
from django.utils.encoding import python_2_unicode_compatible
from django.utils.time... | cpennington/edx-platform | common/djangoapps/entitlements/models.py | Python | agpl-3.0 | 21,559 |
# -*- coding: utf-8 -*-
# © 2017 Elico Corp (www.elico-corp.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import project_project_category
from . import project_task
| Elico-Corp/odoo-addons | business_requirement_deliverable_project_task_mandatory/models/__init__.py | Python | agpl-3.0 | 203 |
"""
For CommonsCloud copyright information please see the LICENSE document
(the "License") included with this software package. This file may not
be used in any manner except in compliance with the License
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed ... | CommonsCloud/Core-API | CommonsCloudAPI/models/oauth.py | Python | agpl-3.0 | 2,810 |
import RPi.GPIO as GPIO
import time
buzzer_pin = 27
notes = {
'B0' : 31,
'C1' : 33, 'CS1' : 35,
'D1' : 37, 'DS1' : 39,
'EB1' : 39,
'E1' : 41,
'F1' : 44, 'FS1' : 46,
'G1' : 49, 'GS1' : 52,
'A1' : 55, 'AS1' : 58,
'BB1' : 58,
'B1' : 62,
'C2' : 65, 'CS2' : 69,
'D2' : 73, 'DS2' : 78,
'EB2' : 78,
'E2' : 82,
... | lesscomplex/HomeSec | lock/buzz_anm.py | Python | agpl-3.0 | 2,986 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2017:
# Frederic Mohier, frederic.mohier@alignak.net
#
"""
Alignak - Checks pack for NRPE monitored Linux hosts/services
"""
| Alignak-monitoring-contrib/alignak-checks-nrpe | alignak_checks_nrpe/__init__.py | Python | agpl-3.0 | 200 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | inspyration/odoo | addons/crm/report/crm_phonecall_report.py | Python | agpl-3.0 | 3,856 |
import plyvel
import ast
import hashlib
import os
import sys
from processor import print_log, logger
from utils import bc_address_to_hash_160, hash_160_to_pubkey_address, hex_to_int, int_to_hex, Hash
global GENESIS_HASH
GENESIS_HASH = '0000074a757ce334e850ff46a695b96d4dc44ccdd0f6860f5c34c49ef9005dcc'
"""
Patricia tr... | ROIV/ViorCoin-ElectrumServer | src/storage.py | Python | agpl-3.0 | 18,187 |
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
from odoo.tools import file_open
import base64
class TestUblOrderImport(TransactionCase):
def test_ubl_order_import(self):
... | Comunitea/CMNT_004_15 | project-addons/purchase_order_import_ubl/tests/test_ubl_order_import.py | Python | agpl-3.0 | 1,222 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
from django.conf import settings
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODE... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/edx_proctoring/migrations/0001_initial.py | Python | agpl-3.0 | 13,525 |
# -*- coding: utf-8 -*-
#
# geoloc.py
#
# Copyright (C) 2010 Antoine Mercadal <antoine.mercadal@inframonde.eu>
# Copyright, 2011 - Franck Villaume <franck.villaume@trivialdev.com>
# This file is part of ArchipelProject
# http://archipelproject.org
#
# This program is free software: you can redistribute it and/or modify... | fr34k8/Archipel | ArchipelAgent/archipel-agent-hypervisor-geolocalization/archipelagenthypervisorgeolocalization/geoloc.py | Python | agpl-3.0 | 7,356 |
from pathlib import Path
from typing import List
from nassl._nassl import X509, X509_STORE_CTX
class CertificateChainVerificationFailed(Exception):
def __init__(self, openssl_error_code: int) -> None:
self.openssl_error_code = openssl_error_code
self.openssl_error_string = X509.verify_cert_error_s... | nabla-c0d3/nassl | nassl/cert_chain_verifier.py | Python | agpl-3.0 | 3,020 |
"""
The Enrollment API Views should be simple, lean HTTP endpoints for API access. This should
consist primarily of authentication, request validation, and serialization.
"""
import logging
from ipware.ip import get_ip
from django.core.exceptions import ObjectDoesNotExist
from django.utils.decorators import method_de... | mushtaqak/edx-platform | common/djangoapps/enrollment/views.py | Python | agpl-3.0 | 21,774 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2018 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Nicolas Badoux <n.badoux@hotmail.com>
# The licence is in the file __manifest__.p... | maxime-beck/compassion-modules | thankyou_letters/tests/__init__.py | Python | agpl-3.0 | 440 |
# -*- coding: utf-8 -*-
from openerp import models, fields, api
class CalendarEvent(models.Model):
_inherit = 'calendar.event'
meeting_reason_id = fields.Many2one(
'calendar.event.meeting.reason',
string="Meeting reason",
ondelete="restrict")
class CalendarEventMeetingReason(models.M... | sandrafig/addons | calendar_event_meeting_reason/models/calendar_event.py | Python | agpl-3.0 | 488 |
from collections import namedtuple
import ckan.plugins.toolkit as tk
from ckan import model
from ckan.model import Session
import json
OgdchDatasetInfo = namedtuple('OgdchDatasetInfo',
['name', 'belongs_to_harvester', 'package_id'])
def get_organization_slug_for_harvest_source(harvest_s... | opendata-swiss/ckanext-geocat | ckanext/geocat/utils/search_utils.py | Python | agpl-3.0 | 5,592 |
import website_forum
| lamaisondub/lamaisondub-custom | website_forum_private/models/__init__.py | Python | agpl-3.0 | 21 |
from odoo import fields, models
class AccountAnalyticLineToInvoice(models.Model):
_name = 'account.analytic.line.to.invoice'
name = fields.Char(string='Name', required=True)
factor = fields.Float(string='Discount (%)', required=True)
billable = fields.Boolean(string='Billable', default=True)
| multidadosti-erp/multidadosti-addons | hr_timesheet_to_invoice/models/account_analytic_line_to_invoice.py | Python | agpl-3.0 | 313 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# cbk_crm_information: CRM Information Tab
# Copyright (c) 2013 Codeback Software S.L. (http://codeback.es)
# @author: Miguel García <miguel@codeback.es>
# @author: Javier Fuentes <javier@codeback.... | codeback/openerp-cbk_sale_commission_filter | __openerp__.py | Python | agpl-3.0 | 1,616 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2012 TaPo-IT (http://tapo-it.at) All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the ... | tapo-it/odoo-addons-worktrail | addons_worktrail/tapoit_worktrail/model/tapoit_worktrail.py | Python | agpl-3.0 | 13,254 |
import datetime
import lxml
from lxml.html.clean import Cleaner
import re
from django.conf import settings
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.text import slugify
from markitup.fields import MarkupField
class ModelBase(models.Model):
created = models.DateTi... | hzj123/56th | pombola/info/models.py | Python | agpl-3.0 | 6,304 |
# -*- coding: utf-8 -*-
##############################################################################
#
# 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
#... | MarcosCommunity/odoo | comunity_modules/purchase_landed_cost/models/purchase_cost_distribution.py | Python | agpl-3.0 | 22,280 |
# django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2007 Simon Willison
# Copyright (C) 2008-2010 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions o... | nekohayo/snowy | lib/django_openid_auth/models.py | Python | agpl-3.0 | 2,355 |
#!/usr/bin/env python3
# -*- coding : utf-8 -*-
def mymodules2():
print("test module2!")
mymodules2() | kmahyyg/learn_py3 | modules/mymodule2/__init__.py | Python | agpl-3.0 | 107 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | kevin8909/xjerp | openerp/addons/crm/crm_lead.py | Python | agpl-3.0 | 53,864 |
from __future__ import unicode_literals
import json
from datetime import timedelta
from django.core.urlresolvers import reverse
from django.utils import timezone
from mock import patch
from temba.contacts.models import ContactField
from temba.flows.models import RuleSet
from temba.orgs.models import Language
from tem... | reyrodrigues/EU-SMS | temba/values/tests.py | Python | agpl-3.0 | 20,151 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/OSIS-Louvain | ddd/logic/learning_unit/tests/use_case/write/test_update_class_service.py | Python | agpl-3.0 | 8,871 |
# -*- coding: utf-8 -*-
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class AuthorizeController(http.Controller):
_relay_url = '/payment/authorize_net/complete'
_cancel_url = '/payment/authorize_net/... | sajadkk/odoo-addons | payment_authorize_net/controllers/main.py | Python | agpl-3.0 | 1,263 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import string
import re
import stdnum
from odoo import api, models, tools, _
from odoo.tools.misc import ustr
from odoo.exceptions import ValidationError
_eu_country_vat = {
'GR': 'EL'
}
_eu_countr... | ddico/odoo | addons/base_vat/models/res_partner.py | Python | agpl-3.0 | 19,705 |
# -*- coding: utf-8 -*-
"""Setup the remysmoke application"""
import logging
from tg import config
from remysmoke import model
import transaction
def bootstrap(command, conf, vars):
"""Place any commands to setup remysmoke here"""
pass
| Qalthos/remysmoke | remysmoke/websetup/bootstrap.py | Python | agpl-3.0 | 246 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# Copyright (C) 2010 - 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# ... | dufresnedavid/canada | account_tax_expense_include/__init__.py | Python | agpl-3.0 | 1,045 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.website_event.controllers.main import WebsiteEventController
from odoo import fields, http, modules, tools
from odoo.http import request
class WebsiteEventCommunityController(http.Controller):
@htt... | ygol/odoo | addons/website_event_track_online/controllers/community.py | Python | agpl-3.0 | 653 |
# -*- coding: utf-8 -*-
"""
This is the common settings file, intended to set sane defaults. If you have a
piece of configuration that's dependent on a set of feature flags being set,
then create a function that returns the calculated value based on the value of
FEATURES[...]. Modules that extend this one can change th... | raccoongang/edx-platform | cms/envs/common.py | Python | agpl-3.0 | 42,534 |
# -*- coding:Utf-8 -*-
from tastypie import fields as base_fields
from tastypie_mongoengine import fields
from core.api.utils import TenantResource
from invoicing.models import (
Payment, InvoicePayment, DownPaymentInvoicePayment
)
from invoicing.api.doc import HELP_TEXT
__all__ = (
'PaymentResource',
)
c... | Naeka/vosae-app | www/invoicing/api/resources/payment.py | Python | agpl-3.0 | 2,892 |
"""
Views related to the Custom Courses feature.
"""
import csv
import datetime
import functools
import json
import logging
import pytz
from copy import deepcopy
from cStringIO import StringIO
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import (
HttpResponse,
... | solashirai/edx-platform | lms/djangoapps/ccx/views.py | Python | agpl-3.0 | 20,568 |
"""
Progress Tab Serializers
"""
from rest_framework import serializers
from rest_framework.reverse import reverse
class GradedTotalSerializer(serializers.Serializer):
earned = serializers.FloatField()
possible = serializers.FloatField()
class SubsectionSerializer(serializers.Serializer):
display_name =... | stvstnfrd/edx-platform | lms/djangoapps/course_home_api/progress/v1/serializers.py | Python | agpl-3.0 | 3,620 |
# -*- coding: utf-8 -*-
import json
import os
import random
import requests
import re
import subprocess
import string
from django import forms
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.core.mail import send_mail
from djang... | osamak/medcloud-registration | register/temp/views.py | Python | agpl-3.0 | 9,644 |
import urllib.parse
import sys
from ccs import core
from ccs import constants
from . import response
def ticker(cur1, cur2):
s = __name__.split(".")[1]
r = sys._getframe().f_code.co_name
symbol = cur1.upper().strip() + cur2.upper().strip()
# complete request
cr = core.request(s, r).replace(const... | Honzin/ccs | dev/bitmarket/public/__init__.py | Python | agpl-3.0 | 4,152 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.utilities.transaction_base import TransactionBase
from frappe.utils import now, extract_email_id
import json
import reque... | gangadharkadam/tailorerp | erpnext/support/doctype/support_ticket/support_ticket.py | Python | agpl-3.0 | 8,287 |
# -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of mozaik_person, an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# mozaik_person is free software:
# you can redistribute it and/or
# modify it und... | acsone/mozaik | mozaik_person/tests/__init__.py | Python | agpl-3.0 | 1,096 |
# Copyright 2021 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
from odoo.tools.float_utils import float_compare, float_is_zero
class MrpProductionSerialMat... | OCA/manufacture | mrp_production_serial_matrix/wizards/mrp_production_serial_matrix.py | Python | agpl-3.0 | 13,579 |
#!/usr/bin/env python3
#
# dht.py: Distributed Hashtable abstraction layer
#
# (Similar motivation to the one in crypto.py, though there
# are actually some decent DHT implementation, I just still
# need to decide on one :)). Consideration: might as well use
# Python's dictionary interface for this.
#
# Copyright (C)... | almer-t/minglay | lib/dht.py | Python | agpl-3.0 | 903 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import submissions.models
class Migration(migrations.Migration):
dependencies = [
('submissions', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ScoreAnn... | Stanford-Online/edx-submissions | submissions/migrations/0002_auto_20151119_0913.py | Python | agpl-3.0 | 948 |
# Authors: See README.RST for Contributors
# Copyright 2015-2017
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class IrActionsReportDuplicate(models.TransientModel):
_name = "ir.actions.report.duplicate"
_description = "Duplicate Qweb report"
suffix... | OCA/server-tools | base_report_auto_create_qweb/wizard/report_duplicate.py | Python | agpl-3.0 | 755 |
from __future__ import absolute_import, unicode_literals
from datetime import timedelta
from django.db import models
from django.db.models import Model
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from smartmin.models import SmartModel
from temba.contacts.models import Cont... | reyrodrigues/EU-SMS | temba/campaigns/models.py | Python | agpl-3.0 | 22,625 |
# -*- coding: utf-8 -*-
# © 2015 Elico corp (www.elico-corp.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Contact Form CAPTCHA',
'version': '8.0.1.0.0',
'category': 'Website',
'depends': [
'website_crm',
'website_captcha_nogoogle',
],
'autho... | Elico-Corp/odoo-addons | website_captcha_nogoogle_crm/__openerp__.py | Python | agpl-3.0 | 517 |
#!/usr/bin/python
from math import exp
import shtest, sys
def exp_test(p, base, types=[], epsilon=0):
if base > 0:
result = [pow(base, a) for a in p]
else:
result = [exp(a) for a in p]
return shtest.make_test(result, [p], types, epsilon)
def insert_into(test, base=0):
test.add_test(e... | libsh-archive/sh | test/regress/exp.cpp.py | Python | lgpl-2.1 | 1,880 |
#!/usr/bin/python2.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
import ez_setup
ez_setup.use_setuptools()
from glob import glob
from setuptools import setup, Extension
NAME = "pycopia-SMI"
VERSION = "1.0a2"
ENAME = NAME.replace("-", "_")
DNAME = NAME.split("-", 1)[-1]
_libsmi = Extension("_libsmi", ["libs... | xiangke/pycopia | SMI/setup.py | Python | lgpl-2.1 | 1,514 |
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
... | zougloub/charade | charade/utf8prober.py | Python | lgpl-2.1 | 2,618 |
# 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 | src/PV_SWIG/paravis.py | Python | lgpl-2.1 | 3,020 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PySphinxcontribDevhelp(PythonPackage):
"""sphinxcontrib-devhelp is a sphinx extension whic... | rspavel/spack | var/spack/repos/builtin/packages/py-sphinxcontrib-devhelp/package.py | Python | lgpl-2.1 | 793 |
# This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2003-2011 Jan Decaluwe
#
# The myhdl 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 t... | palashahuja/myhdl | myhdl/_modbv.py | Python | lgpl-2.1 | 2,156 |
# -*- coding: UTF-8 -*-
#
"""css3make tester"""
class GnrCustomWebPage(object):
py_requires = "gnrcomponents/testhandler:TestHandlerBase"
dojo_theme = 'tundra'
def test_1_rounded(self, pane):
sl = pane.slotBar('k,*,test,*')
sl.k.verticalSlider(value='^.k',minimum=0,maximum='30',intermedi... | poppogbr/genropy | packages/test15/webpages/tools/css3make.py | Python | lgpl-2.1 | 5,203 |
PLUGIN_INFO = {
"versions": [
{
"plugin_version": 1,
"supported_mod_versions": ["0.6"],
"download_url": "https://www.myteamspeak.com/addons/01a0f828-894c-45b7-a852-937b47ceb1ed"
}
]
}
| jhakonen/wot-teamspeak-mod | test/fute/test_helpers/constants.py | Python | lgpl-2.1 | 199 |