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 |
|---|---|---|---|---|---|
from wake import Vulture
def test_function_object1():
v = Vulture()
v.scan("""\
def func():
pass
a = func
""")
assert v.defined_funcs == ['func']
assert v.unused_funcs == []
def test_function_object2():
v = Vulture()
v.scan("""\
def func():
pass
func
""")
assert v.defined_funcs... | myint/vulture | tests/test_scavenging.py | Python | gpl-3.0 | 6,238 |
# #START_LICENSE###########################################################
#
#
#
# #END_LICENSE#############################################################
# Note that the use of "from x import *" is safe here. Modules include
# the __all__ variable.
from sys import stderr
from coretype.tree import *
from coretype.... | jhcepas/npr | ete_dev/__init__.py | Python | gpl-3.0 | 1,245 |
import bpy
from . import tree_info
from mathutils import Vector
from . utils.nodes import idToSocket
from . sockets.info import toBaseIdName, isList
from . tree_info import getAllDataLinkIDs, getDirectlyLinkedSocket
def correctForbiddenNodeLinks():
for dataOrigin, target in iterLinksThatNeedToBeCorrectedOrRemoved(... | Thortoise/Super-Snake | Blender/animation_nodes-master/node_link_conversion.py | Python | gpl-3.0 | 11,610 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Import system libs
import re
class WWW():
def __init__(self):
pass
def get_domain(self, site):
if site.startswith('https://'):
site = site[8:-1]
elif site.startswith('http://'):
site = site[7:-1]
return s... | soarpenguin/python-scripts | www-url.py | Python | gpl-3.0 | 823 |
#!/usr/bin/env python
import argparse
import os, sys, time
panX_script_dir= os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0,panX_script_dir+'/scripts/')
from pangenome_computation import pangenome
from sf_miscellaneous import times, check_dependency
'''
panX clusters genes from a set of microbial genomes... | wdingx/pan-genome-analysis | panX.py | Python | gpl-3.0 | 17,982 |
# -*- coding:UTF-8 -*-
""" pyBox Modbus"""
# !/usr/bin/python
# Python: 3.5.2
# Platform: Windows/ARMv7
# Author: Heyn
# Program: Modbus RTU & TCP
# History: 2017/02/14 V1.0.0 [Heyn]
# 2017/03/08 V1.0.1 [Heyn] Send return string.
# 2017/04/07 V1.0.2 [Heyn] Redesign PBoxModbus class functions.
... | Heyn2016/Python | ApalisT30/Pbox/proto/PBoxModbus.py | Python | gpl-3.0 | 4,314 |
# Acceder a google
# buscar tiempo+ciudad
# acceder al dato de precipitaciones de google (a traves del id que esta dentro de un span id="wob_pp")
#dato >40% es que va a llover!
# enviar ese dato por correo
#import requests
from bs4 import BeautifulSoup
import requests
#class="dia d-2 clearfix dlD"
#class=... | bristoll/Scripts-python | RainCordatory.py | Python | gpl-3.0 | 1,187 |
import datetime
from .models import Note, Sujet
from utilisateurs.models import Professionnel
from django import forms
from django_select2.forms import Select2Widget
# NOTES
class NoteForm(forms.ModelForm):
""" Generic Note form """
class Meta:
model = Note
fields = ['sujet', 'text', 'create... | artus40/maraudes_project | notes/forms.py | Python | gpl-3.0 | 2,575 |
#!/usr/bin/env python
# BittrexAPI: Python Bittrex API implementation
#
# Copyright (c) 2014 - Albert Puigsech Galicia (albert@puigsech.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software... | apuigsech/BittrexAPI | BittrexAPI/__init__.py | Python | gpl-3.0 | 1,505 |
'''
Created on Sep 30, 2017
@author: colin
'''
#===============================================================================
# Import
#===============================================================================
import os
from string import Template
import shutil
import logging
import subprocess
logger = logg... | cbitterfield/JobCard | archive/boxcover.py | Python | gpl-3.0 | 8,699 |
"""
Synapse Dynamics classes for nest
:copyright: Copyright 2006-2016 by the PyNN team, see AUTHORS.
:license: CeCILL, see LICENSE for details.
"""
import nest
from pyNN.standardmodels import synapses, build_translations
from pyNN.nest.synapses import NESTSynapseMixin
import logging
from ..conversion import make_sl... | anupkdas-nus/global_synapses | pyNN-dispackgaes/nest/standardmodels/synapses.py | Python | gpl-3.0 | 7,616 |
# -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in... | estaban/pyload | module/plugins/hooks/UnSkipOnFail.py | Python | gpl-3.0 | 4,031 |
from math import pi
def fractal_area(r,n):
first = r**2
if n == 1:
return first * pi
second = 4 * (r/2)**2
if n == 2:
return (first + second) * pi
rest = sum((r/2**i)**2 * 4*3**(i-1) for i in range(2,n))
return (first + second + rest) * pi
def main():
for _ in range(int(inp... | JonSteinn/Kattis-Solutions | src/Fractal Area/Python 3/main.py | Python | gpl-3.0 | 448 |
# (C) British Crown Copyright 2014, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | scollis/iris | lib/iris/tests/unit/fileformats/pp/test_save.py | Python | gpl-3.0 | 4,803 |
# coding: utf-8
"""
Kipartman
Kipartman api specifications
OpenAPI spec version: 1.0.0
Contact: --
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class Part(object):
"""
NOTE: This class is auto gener... | turdusmerula/kipartman | kipartman/swagger_client/models/part.py | Python | gpl-3.0 | 13,785 |
import math
import numpy as np
from collections import defaultdict
import json
from sklearn.naive_bayes import MultinomialNB, GaussianNB, BernoulliNB
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClassi... | amilcarsj/analytic | analytic/classify_all.py | Python | gpl-3.0 | 3,695 |
#!/usr/bin/env python3
import dns.resolver
import dns.rdatatype
# This shouldn't be necessary, but for some reason __import__ when
# called from a coroutine, doesn't always work, and I haven't been
# able to figure out why. Possibly this is a 3.4.0 bug that's fixed
# later, but googling for it hasn't worked.
import ... | Abhayakara/minder | smtpd/smtpd.py | Python | gpl-3.0 | 27,553 |
'''
Copyright 2015 - 2018 University College London.
This file is part of Nammu.
Nammu 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.
Nam... | oracc/nammu | python/nammu/test/test_yaml_update.py | Python | gpl-3.0 | 2,813 |
#!/usr/bin/env python3
# coding:utf-8
"""
### Editer:Mogu ###
This class supports fundamental class for reading and writing files.
environment:
Pyton3.5.1
requirement:
"""
class FileIO(object):
"""
This class fundamental class for reading and writing files.
Don't support command line usages.
""... | Moguf/cafepy | cafepy/files/file_io.py | Python | gpl-3.0 | 688 |
#!/usr/bin/env python
# Copyright 2015 Jason Edelman <jason@networktocode.com>
# Network to Code, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | joergullrich/virl-lab | library/ntc_reboot.py | Python | gpl-3.0 | 6,997 |
from django.db import models
from inventory.models import Product_variant
from suppliers.models import Supplier
# Create your models here.
class Purchase_order( models.Model ):
supplier_id = models.ForeignKey(Supplier)
created_at = models.DateTimeField('date published')
class Item( models.Model ):
purchase = m... | sodhancha/Godown | purchase_orders/models.py | Python | gpl-3.0 | 480 |
from django.conf.urls import url, include
app_name = "studies"
urlpatterns = [
url(r"^api/v1/", include("normandy.studies.api.v1.urls", namespace="v1")),
url(r"^api/v3/", include("normandy.studies.api.v3.urls", namespace="v3")),
]
| mozilla/normandy | normandy/studies/urls.py | Python | mpl-2.0 | 242 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Nico Epp and Ralf Funk
# 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 pickle
import requests
import time
from htt... | nico-ralf-ii-fpuna/paper | waf/test_2_waf_speed/destination.py | Python | mpl-2.0 | 6,276 |
import difflib
import json
import connexion
from flask import Response, abort, jsonify
from auslib.blobs.base import BlobValidationError, createBlob
from auslib.db import OutdatedDataError, ReadOnlyError
from auslib.global_state import dbo
from auslib.web.admin.views.base import AdminView, requirelogin, serialize_sig... | testbhearsum/balrog | src/auslib/web/admin/views/releases.py | Python | mpl-2.0 | 26,017 |
# -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as plt
from procedural_city_generation.building_generation.cuts import *
from procedural_city_generation.building_generation.building_tools import *
from procedural_city_generation.buil... | josauder/procedural_city_generation | procedural_city_generation/building_generation/roofs.py | Python | mpl-2.0 | 6,492 |
##
# Copyright 2016 DECaF Project Group, University of Paderborn
# This file is part of the decaf orchestration framework
# All Rights Reserved.
#
# 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 htt... | CN-UPB/OpenBarista | utils/decaf-utils-protocol-stack/decaf_utils_protocol_stack/rpc/json_rpc_application.py | Python | mpl-2.0 | 7,693 |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http:# mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divis... | klahnakoski/jx-sqlite | vendor/jx_base/expressions/base_inequality_op.py | Python | mpl-2.0 | 1,864 |
"""
These are filters placed at the end of a tunnel for watching or modifying
the traffic.
"""
##############################################################################
from __future__ import absolute_import
LICENSE = """\
This file is part of pagekite.py.
Copyright 2010-2020, the Beanstalks Project ehf. and Bja... | pagekite/PyPagekite | pagekite/proto/filters.py | Python | agpl-3.0 | 8,412 |
# -*- coding: utf-8 -*-
from contextlib import contextmanager
import pytest
from django.contrib.auth.models import AnonymousUser
from django.test.client import RequestFactory
from shuup.apps.provides import override_provides
from shuup.utils.excs import Problem
from shuup.xtheme import XTHEME_GLOBAL_VIEW_NAME
from sh... | hrayr-artunyan/shuup | shuup_tests/xtheme/test_editor_view.py | Python | agpl-3.0 | 6,457 |
# -*- coding: utf-8 -*-
from datetime import datetime
import json
from pytz import UTC
from django.core.urlresolvers import reverse
from django.test import TestCase
from edxmako import add_lookup
import mock
from django_comment_client.tests.factories import RoleFactory
from django_comment_client.tests.unicode import ... | mtlchun/edx | lms/djangoapps/django_comment_client/tests/test_utils.py | Python | agpl-3.0 | 33,221 |
# -*- coding: utf-8 -*-
import collections
import copy
from . import formulas, legislations, periods, taxbenefitsystems, columns
class AbstractReform(taxbenefitsystems.AbstractTaxBenefitSystem):
"""A reform is a variant of a TaxBenefitSystem, that refers to the real TaxBenefitSystem as its reference."""
CU... | sgmap/openfisca-core | openfisca_core/reforms.py | Python | agpl-3.0 | 13,388 |
#!/usr/bin/python -S
#
# Copyright 2009 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Perform auto-approvals and auto-blocks on translation import queue"""
import _pythonpath
from lp.translations.scripts.import_queue_gardener import Impor... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/cronscripts/rosetta-approve-imports.py | Python | agpl-3.0 | 523 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Odoo RTL support
# Copyright (C) 2016 Mohammed Barsi.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publ... | barsi/odoo-rtl | web_rtl/__manifest__.py | Python | agpl-3.0 | 1,405 |
#------------------------------------------------------------------------------
# Copyright (C) 2009 Richard Lincoln
#
# 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; version 2 dated June... | rwl/openpowersystem | cpsm/topology/connectivity_node.py | Python | agpl-3.0 | 2,078 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import funct... | m038/superdesk-content-api | content_api/items/service.py | Python | agpl-3.0 | 17,471 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2013 Acysos S.L. (http://acysos.com) All Rights Reserved.
# Ignacio Ibeas <ignacio@acysos.com>
# $Id$
#
# This program i... | BorgERP/borg-erp-6of3 | verticals/garage61/acy_mrp_procurement_virtual_stock/procurement.py | Python | agpl-3.0 | 4,154 |
import random
def read(file):
with open(file) as f:
return f.read()
HUMAN_FRIENDLY_CHARS = '234679ABCDEFGHJKLMNPRSTUVWXYZabcdefghijkmnpqrstuvwxyz'
def random_string(length):
return ''.join(random.choice(HUMAN_FRIENDLY_CHARS) for x in range(length))
| JaapJoris/bps | bps/utils.py | Python | agpl-3.0 | 267 |
# -*- coding: utf-8 -*-
# ###
# Copyright (c) 2016, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
from __future__ import unicode_literals
import hashlib
import json
import logging
import sys
from io import... | Connexions/cnx-epub | cnxepub/formatters.py | Python | agpl-3.0 | 33,743 |
import json
from collections import OrderedDict
from contextlib import suppress
from datetime import date, timedelta
from django.conf import settings
from django.db import models
from django.db.models import Case, Count, When
from . import utils
CIVILITY_CHOICES = (
('Madame', 'Madame'),
('Monsieur', 'Monsie... | epcoullery/epcstages | stages/models.py | Python | agpl-3.0 | 27,475 |
import sys
import pytest
from flask import current_app
from flask_wtf import Form
from wtforms import TextField
from faker import Faker
import arrow
import uuid
from unifispot.core.models import Wifisite,Device,Guesttrack
from tests.helpers import get_guestentry_url,randomMAC,loggin_as_admin
def test_guest_portal(se... | Spotipo/spotipo | tests/modules/unifi/test_main.py | Python | agpl-3.0 | 2,218 |
import os
import sys
import time
from bs4 import BeautifulSoup
from progressbar import ProgressBar
class RatingsParser:
def __init__(self, site, args):
self.site = site
self.args = args
if not self.site.CREDENTIALS_VALID:
return
self.movies = []
self.movies_co... | StegSchreck/RatS | RatS/base/base_ratings_parser.py | Python | agpl-3.0 | 7,162 |
# -*- coding: utf-8 -*-
@auth.requires_membership('admin')
def starts():
grid = SQLFORM.grid(db.typ_zacatku,
showbuttontext=False)
return dict(grid=grid)
@auth.requires_membership('admin')
def contacts():
grid = SQLFORM.grid(db.typ_kontaktu,
showbuttontext=F... | zvolsky/akce | controllers/keys.py | Python | agpl-3.0 | 1,007 |
# Django
from django.contrib.auth.models import User
from common.utils import get_sentinel_user
from toggleproperties.models import ToggleProperty
try:
# Django < 1.10
from django.contrib.contenttypes.generic import GenericForeignKey
except ImportError:
# Django >= 1.10
from django.contrib.contenttype... | astrobin/astrobin | nested_comments/models.py | Python | agpl-3.0 | 2,677 |
#coding:utf8
"""
Helper module to get easy access to the path where resources are stored.
This is because the resource location is depended on the packaging method and OS
"""
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import os
import sys
import glob
import platform
i... | alephobjects/Cura | Cura/util/resources.py | Python | agpl-3.0 | 9,176 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-03-13 11:24
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 = [
('organization_projects', '0049_... | Ircam-Web/mezzanine-organization | organization/projects/migrations/0050_auto_20170313_1224.py | Python | agpl-3.0 | 1,569 |
#!/usr/bin/env python
import os.path
import unittest
import pep8
SRC_PATH = os.path.dirname(os.path.dirname(__file__))
EXCLUDE = ['.svn', 'CVS', '.bzr', '.hg', '.git',
'Paste-1.7.5.1-py2.6.egg', 'PasteDeploy-1.5.0-py2.6.egg', 'data']
class AdhocracyStyleGuide(pep8.StyleGuide):
def ignore_code(self, ... | SysTheron/adhocracy | src/adhocracy/tests/test_pep8.py | Python | agpl-3.0 | 2,111 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2008-2013 AvanzOSC (Daniel). All Rights Reserved
# Date: 25/09/2013
#
# This program is free software: you can redistribute it and/or... | avanzosc/avanzosc6.1 | avanzosc_product_default_location/wizard/__init__.py | Python | agpl-3.0 | 1,106 |
"""
Views for the course_mode module
"""
import decimal
import json
import urllib
import waffle
from babel.dates import format_datetime
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from django.db import transaction
from django.http import HttpResponse, HttpResponseBadReque... | Edraak/edraak-platform | common/djangoapps/course_modes/views.py | Python | agpl-3.0 | 15,273 |
# coding: utf-8
from rest_framework import viewsets
from kpi.models import UserAssetSubscription
from kpi.serializers.v2.user_asset_subscription import (
UserAssetSubscriptionSerializer,
)
from kpi.utils.object_permission import get_database_user
class UserAssetSubscriptionViewSet(viewsets.ModelViewSet):
que... | kobotoolbox/kpi | kpi/views/v2/user_asset_subscription.py | Python | agpl-3.0 | 863 |
from __future__ import unicode_literals
import json
def test_get_version(app, client, current_version):
headers = [('Accept', 'application/json'),
('Content-Type', 'application/json')]
res = client.get('/api/v0/version', headers=headers)
assert res.status_code == 200
data = json.loads(... | ecolell/pfamserver | tests/api/v0/test_version.py | Python | agpl-3.0 | 394 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Xibo - Digitial Signage - http://www.xibo.org.uk
# Copyright (C) 2010-11 Alex Harrington
#
# This file is part of Xibo.
#
# Xibo 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... | xibosignage/xibo-pyclient | plugins/media/MicroblogMedia.py | Python | agpl-3.0 | 27,626 |
import sys
sys.path.append('..')
sys.path.append('.')
import cProfile
from jumper.blueprints.backends.fixture_data import test_cities_eleven_tuples as test_11_cities
from jumper.blueprints.backends.modules.cython \
import ffi_cython_py_compat as ffi_py
from jumper.blueprints.backends.modules.cython \
import ... | tristanfisher/ffi4wd | tests/test_cython.py | Python | agpl-3.0 | 647 |
import io, tempfile
from django.core import management
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.utils import LayerMapping
from locations.models import Region
class Command(management.BaseCommand):
help = 'Allows the import of regions'
def check_current_status(self):
""... | greenstone/keadatabase-back | src/locations/management/commands/loadregions.py | Python | agpl-3.0 | 1,458 |
import subprocess
from datetime import datetime
from flask import session, current_app, abort, g
from threading import Thread
import crypto_util
import i18n
import store
from db import Source, db_session
def logged_in():
return 'logged_in' in session
def valid_codename(codename):
try:
filesystem_... | micahflee/securedrop | securedrop/source_app/utils.py | Python | agpl-3.0 | 3,398 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django import forms
from djang... | shawnadelic/shuup | shuup/admin/modules/shops/views/edit.py | Python | agpl-3.0 | 4,592 |
"Generic Crawler object to read from a url"
# coding: utf8
import re
from BeautifulSoup import BeautifulSoup
import urllib2
MAXTRIES = 4
def removewhitespaces(string):
"Removes whitespaces, newlines and carriage returns from string"
return re.sub('\s', '', string)
def removewhitespacesstartandend(string):
... | SuperNovaPOLIUSP/supernova | aeSupernova/crawler/Crawler.py | Python | agpl-3.0 | 2,029 |
from django.core.management.base import BaseCommand, CommandError
from django.core.cache import cache
class Command(BaseCommand):
help = 'Clears the cache'
def handle(self, *args, **options):
print("Clearing cache!")
cache.clear()
| classam/threepanel | threepanel/dashboard/management/commands/clear_cache.py | Python | agpl-3.0 | 258 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import loggi... | vied12/superdesk | server/superdesk/services.py | Python | agpl-3.0 | 4,269 |
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import LayerView, LayerViewProxy
from PyQt5.QtQml import qmlRegisterType, qmlRegisterSingletonType
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
... | lo0ol/Ultimaker-Cura | plugins/LayerView/__init__.py | Python | agpl-3.0 | 997 |
# coding: utf-8
# 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.
#
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public transport:
# a non ending quest to... | CanalTP/navitia | source/tyr/tests/integration/ridesharing_service_test.py | Python | agpl-3.0 | 9,935 |
"""Add fields for MIVS show_info checklist item
Revision ID: 53b71e7c45b5
Revises: ad26fcaafb78
Create Date: 2019-11-25 19:37:15.322579
"""
# revision identifiers, used by Alembic.
revision = '53b71e7c45b5'
down_revision = 'ad26fcaafb78'
branch_labels = None
depends_on = None
from alembic import op
import sqlalche... | magfest/ubersystem | alembic/versions/53b71e7c45b5_add_fields_for_mivs_show_info_checklist_.py | Python | agpl-3.0 | 1,940 |
import unittest
from butler_offline.core import time
from butler_offline.test.RequestStubs import GetRequest
from butler_offline.test.core.file_system_stub import FileSystemStub
from butler_offline.core import file_system
from butler_offline.views.core import dashboard
from butler_offline.viewcore.state import persist... | RosesTheN00b/BudgetButlerWeb | butler_offline/test/views/core/dashboard_test.py | Python | agpl-3.0 | 1,661 |
# -*- coding: utf-8 -*-
# Copyright (c) 2001-2017, 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 mob... | CanalTP/navitia | source/jormungandr/tests/instant_system_new_default_routing_tests.py | Python | agpl-3.0 | 19,389 |
# -*- coding: utf-8 -*-
# pylint: disable=C0321,E1120,E1123,W0223
"""
Inbound webhook handlers.
"""
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from django_fixmystreet.fixmystreet.models import FMSUser, Report, ReportAttachment, ReportComment, ReportEvent... | IMIO/django-fixmystreet | django_fixmystreet/webhooks/inbound.py | Python | agpl-3.0 | 6,983 |
import os
from setuptools import find_packages, setup
from pip.req import parse_requirements
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
#... | eamoncaddigan/Leverage | setup.py | Python | agpl-3.0 | 1,490 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) cgstudiomap <cgstudiomap@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | cgstudiomap/cgstudiomap | main/local_modules/res_partner_phone_missing_details/__openerp__.py | Python | agpl-3.0 | 1,443 |
#
# Copyright (C) 2013-2015 RoboIME
#
# 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.
#
# This program is distrib... | roboime/pyroboime | roboime/clients/iris.py | Python | agpl-3.0 | 1,711 |
from pyramid.response import Response
from pyramid.view import view_config
from sqlalchemy.exc import DBAPIError
from .models import (
DBSession,
MyModel,
)
@view_config(route_name='home', renderer='templates/mytemplate.pt')
def my_view(request):
try:
one = DBSession.query(MyModel).filter(My... | Spindel/python-deployments | mypyramid/mypyramid/views.py | Python | agpl-3.0 | 1,090 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-06 10:09
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import munch.core.utils.models
class Migration(migrations.Migration):
initial = True
dep... | crunchmail/munch-core | src/munch/core/migrations/0001_initial.py | Python | agpl-3.0 | 1,697 |
# -*- coding: utf8 -*-
#
# Copyright (C) 2017 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
# Licen... | ndp-systemes/odoo-addons | stock_change_quant_lot/stock_change_quant_lot.py | Python | agpl-3.0 | 3,168 |
# Copyright 2017 PESOL (http://pesol.es) - Angel Moya (angel.moya@pesol.es)
# Copyright 2020 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class AccountMoveLine(models.Model):
_name = "account.move.line"
_inherit = ["analytic.dimension.line"... | OCA/account-analytic | analytic_tag_dimension/models/account_move_line.py | Python | agpl-3.0 | 393 |
#! /usr/bin/env python
"""
Author: Gary Foreman
Created: September 18, 2016
This script scrapes image urls, thread titles, user names, and thread
ids from thread links in the For Sale: Bass Guitars forum at
talkbass.com. Information from each thread is saved as a document in a
MongoDB database.
"""
from __future__ im... | garyForeman/LHBassClassifier | mongodb/thread_data.py | Python | agpl-3.0 | 4,209 |
from setuptools import setup, find_packages
AUTHOR = 'petanne'
AUTHOR_EMAIL = 'lywxj1992@gmail.com'
URL = 'petanne.com'
VERSION = '1.8.1'
setup(
name="prometheus-pgbouncer-exporter",
version=VERSION,
url=URL,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
packages=find_packages(),
entry_points=... | petanne/prometheus-pgbouncer-exporter | setup.py | Python | agpl-3.0 | 457 |
"""add default nurture tubes values
Revision ID: c747d6f9d206
Revises: c9b69c2c665d
Create Date: 2017-05-16 10:21:00.181786
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from radar.models.nurture_tubes import PROTOCOL_OPTION_TYPE, SampleOption
# revision identifiers, ... | renalreg/radar | migrations/versions/c747d6f9d206_add_default_nurture_tubes_values.py | Python | agpl-3.0 | 4,010 |
#!/usr/bin/python
#
# Urwid container widget classes
# Copyright (C) 2004-2012 Ian Ward
#
# 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 Licen... | mountainstorm/urwid | urwid/container.py | Python | lgpl-2.1 | 84,566 |
# libavg - Media Playback Engine.
# Copyright (C) 2003-2011 Ulrich von Zadow
#
# 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 your option) any l... | pararthshah/libavg-vaapi | src/python/coordcalibrator.py | Python | lgpl-2.1 | 5,321 |
# This import fixes sys.path issues
from . import parentpath
from datawrap import tablewrap
import unittest
class TableWrapTest(unittest.TestCase):
'''
Tests the capability to wrap 2D objects in Tables and transpose them.
'''
def setUp(self):
# self.table doesn't need the tablewrap.Table objec... | OpenGov/python_data_wrap | tests/table_wrap_test.py | Python | lgpl-2.1 | 4,724 |
"""WebDAV interface to the document repository."""
from __future__ import annotations
from .views import webdav # noqa
| abilian/abilian-sbe | src/abilian/sbe/apps/documents/webdav/__init__.py | Python | lgpl-2.1 | 121 |
# encoding: utf-8
class Table(object):
def config_db(self, pkg):
tbl = pkg.table('item_category', pkey='id', name_long='!!Item category',
name_plural='!!Item category')
self.sysFields(tbl)
tbl.column('item_id', size='22', group='_', name_long='Item id').relation('ite... | poppogbr/genropy | packages/flib/model/item_category.py | Python | lgpl-2.1 | 781 |
# pib.py - functions for handling Serbian VAT numbers
# coding: utf-8
#
# Copyright (C) 2017 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 L... | arthurdejong/python-stdnum | stdnum/rs/pib.py | Python | lgpl-2.1 | 1,963 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
* Copyright (C) 2017 Hendrik van Essen
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
"""
import os
import sys
from shutil import copytree, ... | HendrikVE/riotam-backend | riotam_backend/common/ModuleCache.py | Python | lgpl-2.1 | 1,659 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for similarity algorithms (the similarities package).
"""
import logging
import unittest
import os
import tempfile... | tzoiker/gensim | gensim/test/test_similarities.py | Python | lgpl-2.1 | 21,672 |
""" BasePlugin definitions. """
import logging
import threading
import traceback
import os
import queue
from sjutils import threadpool
class BasePluginError(Exception):
"""Raised by BasePlugin."""
def __init__(self, error):
"""Init method."""
Exception.__init__(self, error)
class BasePlugi... | SmartJog/spvd | share/baseplugin.py | Python | lgpl-2.1 | 11,049 |
# python
# This file is generated by a program (mib2py).
import HP_SN_IGMP_MIB
OIDMAP = {
'1.3.6.1.4.1.11.2.3.7.11.12.2.6.1': HP_SN_IGMP_MIB.snIgmpMIBObjects,
'1.3.6.1.4.1.11.2.3.7.11.12.2.6.1.1': HP_SN_IGMP_MIB.snIgmpQueryInterval,
'1.3.6.1.4.1.11.2.3.7.11.12.2.6.1.2': HP_SN_IGMP_MIB.snIgmpGroupMembershipTime,
'1.3... | xiangke/pycopia | mibs/pycopia/mibs/HP_SN_IGMP_MIB_OID.py | Python | lgpl-2.1 | 626 |
# Copyright (C) 2009-2010 Raul Jimenez
# Released under GNU LGPL 2.1
# See LICENSE.txt for more information
import sys
import threading
import logging
try:
import core.ptime as time
from core.querier import Query
import core.identifier as identifier
import core.message as message
except ImportError:
... | egbertbouman/tribler-g | Tribler/Core/DecentralizedTracking/pymdht/plugins/lookup_a16.py | Python | lgpl-2.1 | 10,785 |
"""Brief description of what this file should test"""
import pytest
from Calculator import operations
def test_addition():
assert operations.add(1, 2) == 3
def test_subtraction():
assert operations.subtract(1 ,2) == -1
def test_multiplication():
assert operations.multiply(2, -1) == -2
def test_divide... | ImWalkinHere/Calculator | tests/test_operations.py | Python | lgpl-2.1 | 1,523 |
from webapp2_extras.appengine.auth.models import User
from google.appengine.ext import ndb
class User(User):
"""
Universal user model. Can be used with App Engine's default users API,
own auth or third party authentication methods (OpenID, OAuth etc).
based on https://gist.github.com/kylefinley
""... | mats116/ElasticBigQuery | boilerplate/models.py | Python | lgpl-3.0 | 5,145 |
from pycp2k.inputsection import InputSection
class _basis4(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Default_keyword = []
self._name = "BASIS"
self._repeated_default_keywords = {'Default_keyword': 'DEFAULT_KEYWORD'}
self._attributes = ['Default_key... | SINGROUP/pycp2k | pycp2k/classes/_basis4.py | Python | lgpl-3.0 | 328 |
# Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import io
from typing import List, Optional, Union
from UM.FileHandler.FileHandler import FileHandler
from UM.FileHandler.FileWriter import FileWriter
from UM.FileHandler.WriteFileJob import WriteFileJob
from UM.Logger imp... | Ultimaker/Cura | plugins/DigitalLibrary/src/ExportFileJob.py | Python | lgpl-3.0 | 2,208 |
#! /usr/bin/python3
import subprocess ;# exec commands, which replaces other discard methods, e.g. `cmd`, os.system(args), os.spawnXX(), os.popenN()
### examples, referred to http://docs.python.org/2/library/subprocess.html#subprocess.Popen
## basic example - call, returns error_code
rtn = subprocess.call( ["ls",... | mkatsoho/LearnByExamples | pythonExamples/execOsCommands.py | Python | lgpl-3.0 | 1,782 |
# /*******************************************************************************
# * (c) Andrew Robinson (andrewjrobinson@gmail.com) 2014 *
# * *
# * This file is part of SportsReview. ... | andrewjrobinson/SportsReview | sportsreview/common/modulemanager.py | Python | lgpl-3.0 | 6,326 |
import zipfile
import os
import array
import collections
from struct import unpack
from ctypes import c_ubyte
import pygp.utils as utils
import pygp.constants as constants
import pygp.crypto as crypto
class Loadfile(object):
'''
This class builds a LoadFile object from a disk-based file.
and provides bas... | GPContributors/PyGP | pygp/loadfile.py | Python | lgpl-3.0 | 19,068 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Liblarch - a library to handle directed acyclic graphs
# Copyright (c) 2011-2012 - Lionel Dricot & Izidor Matušov
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the... | getting-things-gnome/liblarch | tests/signals_testing.py | Python | lgpl-3.0 | 5,708 |
"""Backtracking example: 8-queens problem."""
if __name__ == "__main__":
import sys
import os.path as op
sys.path.append(op.abspath(op.join('..', 'packages')))
from pycog.statemachine import *
from pycog.exceptions import *
from pycog.backtrack import *
from pycog.utility.diagram import diagram
# Strateg... | CodieCodemonkey/PyCog | examples/eight_queens.py | Python | lgpl-3.0 | 5,809 |
from itertools import product
import numpy as np
from concert.quantities import q
from concert.tests import assert_almost_equal, TestCase
from concert.devices.motors.dummy import LinearMotor
from concert.processes.common import scan, ascan, dscan
def compare_sequences(first_sequence, second_sequence, assertion):
... | ufo-kit/concert | concert/tests/integration/test_scan.py | Python | lgpl-3.0 | 4,356 |
import django
from django.contrib import admin
from authentication.models import LoginUser, Group
@admin.register(LoginUser)
class AdminLoginUser(admin.ModelAdmin):
list_display = ('username', 'email', 'get_orgs')
search_fields = [
'username', 'email'
]
def get_orgs(self, obj):
retu... | to-bee/members_python | web/authentication/admin.py | Python | lgpl-3.0 | 821 |
from copy import deepcopy
from distutils.spawn import find_executable
class Settings(object):
_upload_limit = 0
def __init__(self, settings=None):
if settings:
self._upload_limit = settings.up_kbytes_sec
@property
def upload_limit(self):
""" Returns the value as required ... | MatiasSM/fcb | fcb/utils/trickle.py | Python | lgpl-3.0 | 1,657 |
###############################################################################
# Copyright 2016 - Climate Research Division
# Environment and Climate Change Canada
#
# This file is part of the "EC-CAS diags" package.
#
# "EC-CAS diags" is free software: you can redistribute it and/or modify
# it under... | neishm/EC-CAS-diags | eccas_diags/diagnostics/movie_zonal.py | Python | lgpl-3.0 | 2,094 |
""" :mod:`eleve.segment`
==========================
The segmenter is available by importing ``eleve.Segmenter``. It is used to
segment sentences (regroup tokens that goes together).
"""
import logging
from math import isnan
logger = logging.getLogger(__name__)
class Segmenter:
def __init__(self, storage, max_... | kodexlab/eleve | eleve/segment.py | Python | lgpl-3.0 | 6,623 |
#!/usr/bin/env python
from distutils.core import setup
setup(name='runBucket',
version='1.0.0',
license='LGPLv3',
author='Dylan Telford',
author_email='dylantelford@gmail.com',
url='https://github.com/ubccr/student-projects/tree/dtelford/dtelford/xmlScripts',
packages=['runBucket']... | dylantelford/ccr-summer-internship | xmlBuckets/setup.py | Python | lgpl-3.0 | 395 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.