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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 - TODAY Denero Team. (<http://www.deneroteam.com>)
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... | odoousers2014/LibrERP | base_address_contacts/res_partner_address.py | Python | agpl-3.0 | 10,827 |
#! /usr/bin/env python
# vim:ts=4:sw=4:expandtab 2
# -*- coding: utf-8 -*-
'''
Based on https://github.com/mortnerDHCPv4v6
'''
# TODO:
# * refactor
# * read conf from dhclient.conf
# * daemonize
# * requests in loop
# * send renew according to renew time
# * implement release
# * implement nak case
# FIXME:
# * bui... | duy/dhcpscapy | scripts/dhcpclientscapy.py | Python | agpl-3.0 | 11,570 |
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
from pyramid.view import view_config
from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS
from pontus.view import BasicView
from pontus.form import Form... | ecreall/lagendacommun | lac/views/services_processes/selling_tickets_service/renew_service.py | Python | agpl-3.0 | 2,351 |
# -*- coding: utf-8 -*-
# © 2016 Comunitea - Javier Colmenero <javier@comunitea.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import res_partner
import account | Comunitea/CMNT_00098_2017_JIM_addons | partner_consolidate/models/__init__.py | Python | agpl-3.0 | 184 |
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import HttpCase
class UICase(HttpCase):
def test_ui_website(self):
"""Test frontend tour."""
tour = "website_sale_product_brand"
self.phantom_js(
url_path="/shop",
code="odoo._... | Vauxoo/e-commerce | website_sale_product_brand/tests/test_ui.py | Python | agpl-3.0 | 499 |
# -*- coding: utf-8 -*-
#
##################################################################################
#
# This program is part of OSRFramework. 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... | i3visio/osrframework | osrframework/utils/exceptions.py | Python | agpl-3.0 | 3,670 |
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
__author__ = 'Marek Stępniowski, <marek@stepniowski.com>'
__version__ = '0.1'
| fnp/wolnelektury | src/sponsors/__init__.py | Python | agpl-3.0 | 236 |
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from functools import wraps
TRANSIENT_USER_TYPES = []
def is_transient_user(user):
return isinstance(user, tuple(TRANSIENT_USER_TYPES))
def prevent_access_to_transient_users(view_func):
def _wrapped_view(re... | pu239ppy/authentic2 | authentic2/decorators.py | Python | agpl-3.0 | 764 |
import analytic
| dreispt/department | analytic_department/__init__.py | Python | agpl-3.0 | 16 |
"""add deleted bool to things
Revision ID: 4d8d18f311aa
Revises: 4e34b4290fbc
Create Date: 2019-02-27 21:31:09.575521
"""
# revision identifiers, used by Alembic.
revision = '4d8d18f311aa'
down_revision = '4e34b4290fbc'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated ... | rootio/rootio_web | alembic/versions/4d8d18f311aa_add_deleted_bool_to_.py | Python | agpl-3.0 | 1,319 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Trial.max_participants'
db.delete_column(u'trials_trial', 'max_participants')
def ba... | openhealthcare/randomise.me | rm/trials/migrations/0035_auto__del_field_trial_max_participants.py | Python | agpl-3.0 | 7,643 |
# -*- coding: utf-8 -*-
from flask import (Blueprint, redirect, url_for, render_template, flash,
request, abort, send_file, current_app)
from flask_babel import gettext
from sqlalchemy.orm.exc import NoResultFound
import crypto_util
import store
from db import db_session, Submission
from journalis... | micahflee/securedrop | securedrop/journalist_app/col.py | Python | agpl-3.0 | 3,437 |
#! /usr/bin/env python
#
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
# GENI Public License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without rest... | nmc-probe/emulab-nome | protogeni/test/version1/binduser.py | Python | agpl-3.0 | 1,946 |
from django.contrib.auth.models import User
from pandas import read_csv, notnull, DataFrame
from numpy import isnan
from django.test import TestCase
from rhizome.models.campaign_models import Campaign, CampaignType, \
DataPointComputed, AggDataPoint
from rhizome.models.location_models import Location, LocationType... | unicef/rhizome | rhizome/tests/test_agg.py | Python | agpl-3.0 | 38,994 |
##############################################################################
#
# 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 | base/forms/learning_unit_specifications.py | Python | agpl-3.0 | 3,409 |
import datetime
from django.db import models
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from simple_history.models import HistoricalRecords
from adesao.middleware import get_current_user
TIPOS_DILIGENCIA = (
('geral', 'Geral'),
... | culturagovbr/sistema-nacional-cultura | gestao/models.py | Python | agpl-3.0 | 2,555 |
# -*- encoding: utf-8 -*-
from openerp.osv import osv, fields
from idvalidator import is_ncf
from openerp.osv.osv import except_osv
from openerp import netsvc
from datetime import datetime
from openerp.tools.translate import _
import time
class account_invoice(osv.Model):
_inherit = "account.invoice"
_name =... | eneldoserrata/marcos_openerp | marcos_addons/marcos_ncf/account_invoice.py | Python | agpl-3.0 | 10,032 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0067_auto_20160411_1224'),
]
operations = [
migrations.CreateModel(
name='Brick',
fields=... | TudorRosca/enklave | server/backend/migrations/0068_auto_20160413_0650.py | Python | agpl-3.0 | 710 |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo.exceptions import UserError
class AccountMove(models.Model):
_inherit = "account.move"
pricelist_id = fields.Many2one(
comodel_name="product.pricelist",
string="Pricelist",
... | OCA/account-invoicing | account_invoice_pricelist/models/account_move.py | Python | agpl-3.0 | 9,635 |
# -*- 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... | ClearCorp/knowledge | document_page/models/document_page.py | Python | agpl-3.0 | 4,535 |
from comics.aggregator.crawler import CrawlerBase, CrawlerImage
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = "Lunch (e24.no)"
language = "no"
url = "http://www.e24.no/lunch/"
start_date = "2009-10-21"
rights = "Børge Lund"
class Crawler(CrawlerBase):
... | jodal/comics | comics/comics/lunche24.py | Python | agpl-3.0 | 607 |
"""
Views related to operations on course objects
"""
import copy
import json
import logging
import random
import string # pylint: disable=deprecated-module
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.core.u... | nttks/edx-platform | cms/djangoapps/contentstore/views/course.py | Python | agpl-3.0 | 75,601 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserProfile.receive_notification'
db.add_column('truekko_userprofile', 'receive_notification... | wadobo/etruekko | etruekko/truekko/migrations/0013_auto__add_field_userprofile_receive_notification.py | Python | agpl-3.0 | 15,657 |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | CLVsol/odoo_addons | clv_insured_ext/__init__.py | Python | agpl-3.0 | 1,546 |
# Settings for running unittests. These are optimized for speed.
from .settings_devel import * # noqa
COMPRESS_ENABLED = False
COMPRESS_PRECOMPILERS = []
MIGRATION_MODULES = {
"weight": "healthmonitor.migrations_not_used_in_tests"
}
| jorgenschaefer/healthmonitor | healthmonitor/settings_devel_fast.py | Python | agpl-3.0 | 240 |
# Author: Drone
import web
from app.helpers import utils
from app.helpers import formatting
projectName = 'Remote Function Trainer'
listLimit = 40
# connect to database
db = web.database(dbn='mysql', db='rft', user='root', passwd='1234')
t = db.transaction()
#t.commit()
# in development debug error messages and r... | gcobos/rft | config.py | Python | agpl-3.0 | 673 |
# -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Account Analytic Warehouse",
"summary": "Add analytic in stock_warehouse",
"version": "9.0.1.0.0",
"category": "Accounting",
"website": "https://odoo-community.org/",
... | Gebesa-Dev/Addons-gebesa | stock_warehouse_analytic_id/__openerp__.py | Python | agpl-3.0 | 763 |
"""Customized autocomplete widgets"""
# Standard Library
import re
# Third Party
from dal import autocomplete
# MuckRock
from muckrock.jurisdiction.models import Jurisdiction
class MRSelect2Mixin:
"""MuckRock Model Select2 mixin"""
def __init__(self, *args, **kwargs):
attrs = {
"data-h... | MuckRock/muckrock | muckrock/core/autocomplete.py | Python | agpl-3.0 | 1,730 |
# -*- coding: utf-'8' "-*-"
import base64
try:
import simplejson as json
except ImportError:
import json
import logging
import urlparse
import werkzeug.urls
import urllib2
from openerp.addons.payment.models.payment_acquirer import ValidationError
from openerp.addons.payment_paypal.controllers.main import Payp... | funkring/fdoo | addons/payment_paypal/models/paypal.py | Python | agpl-3.0 | 19,377 |
"""Tests for plugin.py."""
import ckanext.dictionary.plugin as plugin
def test_plugin():
pass | cmuphillycapstone/ckanext-dictionary | ckanext/dictionary/tests/test_plugin.py | Python | agpl-3.0 | 98 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Pupil.birthday'
db.add_column('gsaudit_pupil', 'birthday',
self.gf('dj... | schnapptack/gskompetenzen | features/gsaudit/migrations/0011_auto__add_field_pupil_birthday.py | Python | agpl-3.0 | 12,951 |
import urlparse
import sys,urllib
import xbmc, xbmcgui, xbmcaddon, xbmcplugin
import urlresolver
base_url = sys.argv[0]
addon_handle = int(sys.argv[1])
args = urlparse.parse_qs(sys.argv[2][1:])
_addon = xbmcaddon.Addon()
_icon = _addon.getAddonInfo('icon')
def build_url(query):
return base_url + '?' + urlli... | munchycool/forthelulz | plugin.video.v1d30play/playvideo.py | Python | agpl-3.0 | 2,398 |
""" Mixins for setting up particular course structures (such as split tests or cohorted content) """
from datetime import datetime
from pytz import UTC
from openedx.core.djangoapps.course_groups.models import CourseUserGroupPartitionGroup
from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory
f... | martynovp/edx-platform | openedx/core/djangoapps/util/testing.py | Python | agpl-3.0 | 8,831 |
import json
import os
import os.path
import types
from django.conf import settings
from models import FSExpirations
if settings.DJFS['type'] == 'osfs':
from fs.osfs import OSFS
elif settings.DJFS['type'] == 's3fs':
from fs.s3fs import S3FS
from boto.s3.connection import S3Connection
from boto.s3.key ... | edx/insights | src/edinsights/modulefs/modulefs.py | Python | agpl-3.0 | 3,765 |
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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.
#
# wger W... | rolandgeider/wger | wger/manager/tests/test_schedule.py | Python | agpl-3.0 | 23,910 |
# pylint: disable-all
# flake8: noqa
import sys
sys.path.append("..")
from todopagoconnector import TodoPagoConnector
from SendAuthorizeRequestData import SendAuthorizeRequestData
import unittest
from unittest import TestCase
if sys.version_info[0] >= 3:
from unittest.mock import patch, Mock
else:
from mock imp... | ingadhoc/website | payment_todopago/todopago/test/SendAuthorizeRequestTest.py | Python | agpl-3.0 | 2,473 |
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 opti... | frankrousseau/weboob | weboob/browser/filters/standard.py | Python | agpl-3.0 | 23,209 |
"""Test jail_code.py"""
import os
import shutil
import sys
import textwrap
import tempfile
import unittest
from nose.plugins.skip import SkipTest
from codejail.jail_code import jail_code, is_configured, Jail, configure, auto_configure
auto_configure()
def jailpy(code=None, *args, **kwargs):
"""Run `jail_code`... | StepicOrg/codejail | codejail/tests/test_jail_code.py | Python | agpl-3.0 | 11,655 |
# -*- coding: utf-8 -*-
import inspect
class Iterable:
# Jinja2 wants to iterate over all properties; __dict__ doesn't return the @property ones
def __iter__(self):
for attr, value in inspect.getmembers(self):
if not attr.startswith('_'):
yield attr, value
| pypt/shaibos | shaibos/util/iterable.py | Python | lgpl-2.1 | 304 |
#!/usr/bin/env python
import os
import codecs
from xml.dom import minidom
import subprocess
import sys
INKSCAPE = '/usr/bin/inkscape'
def list_layers(svg):
layers = [ ]
for g in svg.getElementsByTagName("g"):
if g.attributes.has_key("inkscape:label"):
layers.append(g.attributes["inkscape:... | stefwalter/cockpituous | tests/doc/inkscape-export.py | Python | lgpl-2.1 | 1,516 |
#!/usr/bin/env python
import sys
sys.path.insert(0, "../..")
DEBUG = 0
if len(sys.argv) > 1:
DEBUG = 1
from Kiwi.initgtk import gtk
from Kiwi.Proxies import Proxy
from Kiwi.Models import Model
class Foo(Model):
A = 1
B = 0
class CheckProxy(Proxy):
widgets = [":B", ":A"]
def __init__(self, model)... | Schevo/kiwi | tests/Proxies/CheckButton.py | Python | lgpl-2.1 | 1,404 |
#!/usr/bin/env python
import os
import sys
try:
import py2deb
except ImportError:
import fake_py2deb as py2deb
import constants
__app_name__ = constants.__app_name__
__description__ = """Very simple Audiobook player.
Supports playing, pausing, seeking (sort of) and saving state when changing book/... | epage/nqaap | support/builddeb.py | Python | lgpl-2.1 | 4,263 |
# Copyright (c) 2008-2010, Regents of the University of Colorado.
# This work was supported by NASA contracts NNJ05HE10G, NNC06CB40C, and
# NNC07CB47C.
# 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 Softwa... | ldm5180/hammerhead | data-manager/client/bdmplot2/bdmplot2_callback.py | Python | lgpl-2.1 | 7,139 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | skosukhin/spack | lib/spack/spack/test/sbang.py | Python | lgpl-2.1 | 6,406 |
from collections import OrderedDict, defaultdict, deque
from typing import List, Dict, Deque
from acbs.find import find_package
from acbs.parser import ACBSPackageInfo, check_buildability
# package information cache
pool: Dict[str, ACBSPackageInfo] = {}
def tarjan_search(packages: 'OrderedDict[str, ACBSPackageInfo]... | AOSC-Dev/acbs | acbs/deps.py | Python | lgpl-2.1 | 4,219 |
import random
from firedrake import *
from firedrake_adjoint import *
import sys
mesh = UnitSquareMesh(4, 4)
V3 = FunctionSpace(mesh, "CG", 3)
V2 = FunctionSpace(mesh, "CG", 2)
firedrake.parameters["adjoint"]["record_all"] = True
def main(ic, annotate=False):
soln = project(ic, V2, annotate=annotate)
return soln... | ellipsis14/dolfin-adjoint | tests_firedrake/projection/projection.py | Python | lgpl-3.0 | 886 |
# Copyright (C) 2015 Swift Navigation Inc.
# Contact: Mark Fine <mark@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" WITHOUT WARRANTY OF ANY KIND,
#... | swift-nav/libsbp | python/sbp/client/drivers/pyserial_driver.py | Python | lgpl-3.0 | 2,580 |
import pandas as pd
import numpy as np
from swiftnav.ephemeris import *
from swiftnav.single_diff import SingleDiff
from swiftnav.gpstime import *
def construct_pyobj_eph(eph):
return Ephemeris(
eph.tgd,
eph.crs, eph.crc, eph.cuc, eph.cus, eph.cic, eph.cis,
eph.dn, ep... | imh/gnss-analysis | gnss_analysis/mk_sdiffs.py | Python | lgpl-3.0 | 4,406 |
#!/usr/bin/python
import subprocess
code_dir = "."
subprocess.call([code_dir+"/release/simpleReact_moving_interface.out","10000","0.1"])
subprocess.call(["gnuplot",code_dir+"/scripts/simpleReact_moving_interface.gnu"])
subprocess.call(["cp",code_dir+"/simpleReact_moving_interface.eps",code_dir+"/plots/"])
| martinjrobins/RD_3D | scripts/simpleReact_moving_interface.py | Python | lgpl-3.0 | 311 |
import inspect
import traceback
import warnings
import functools
from shyft.api._api import *
import numpy as np
from math import sqrt
def deprecated(message: str = ''):
"""
This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the funct... | felixmatt/shyft | shyft/api/__init__.py | Python | lgpl-3.0 | 15,456 |
# (C) British Crown Copyright 2015 - 2016, Met Office
#
# This file is part of iris-grib.
#
# iris-grib 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 opt... | pp-mo/iris-grib | iris_grib/tests/unit/load_convert/test_grid_definition_template_40.py | Python | lgpl-3.0 | 6,813 |
# This file is part of KTBS <http://liris.cnrs.fr/sbt-dev/ktbs>
# Copyright (C) 2011-2012 Pierre-Antoine Champin <pchampin@liris.cnrs.fr> /
# Universite de Lyon <http://www.universite-lyon.fr>
#
# KTBS is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General ... | ktbs/ktbs | lib/ktbs/plugins/profiler.py | Python | lgpl-3.0 | 2,998 |
#!../venv/bin/python
import sys
print (sys.argv[1:])
| thinkl33t/mqtt2telegram | scripts/test.py | Python | lgpl-3.0 | 54 |
"""
test package copying
"""
import shutil
import time
import os.path
import os
from rez.system import system
from rez.build_process_ import create_build_process
from rez.build_system import create_build_system
from rez.resolved_context import ResolvedContext
from rez.packages_ import get_latest_package
from rez.packa... | cwmartin/rez | src/rez/tests/test_copy_package.py | Python | lgpl-3.0 | 10,779 |
# TODO: provide a transition checker that prevents a feedback loop, inconsistent state.
# in user db that way user can eliminate store step on the receive side.
from charm.core.engine.util import *
from charm.toolbox.enum import Enum
from math import log, ceil
debug = False
# standardize responses between client and ... | JHUISI/charm | charm/core/engine/protocol.py | Python | lgpl-3.0 | 10,994 |
###############################################################################
# lazyflow: data flow based lazy parallel computation framework
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/o... | stuarteberg/lazyflow | tests/testPathHelpers.py | Python | lgpl-3.0 | 6,093 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
for all "spoke" CASUs, they emit when reading one specific directional
IR sensor.
set the direction that is sensed by the -d flag, from NESW
this is borrowed from `examples/targeted_messaging`, with server setup
that happens behind the scenes (i.e. from RTC files!)
... | assisi/assisipy-examples | remote_sensors/spoke.py | Python | lgpl-3.0 | 3,590 |
# -*- coding: utf8 -*-
import math
from pycraft.common.util import ndarray, product
class GaussianKernel:
__slots__ = ['_size', '_kernel']
def __init__(self, size):
self._size = size
self._kernel = ndarray(2*size + 1, 2*size + 1)
bell_size = 1.0 / size
bell_height = 2 * ... | nosix/PyCraft | src/pycraft/service/primitive/fuzzy/gaussian.py | Python | lgpl-3.0 | 658 |
"""
Copyright (C) 2008-2013 Tomasz Bursztyka
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, or
(at your option) any later version.
This program ... | tbursztyka/python-elf | elf/program.py | Python | lgpl-3.0 | 5,074 |
# Copyright (C) 2009 Gaetan Guidet
#
# This file is part of pygl.
#
# luagl 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.... | gatgui/pygl | python/test_gl.py | Python | lgpl-3.0 | 6,380 |
#!/usr/bin/python
###############################################################################
#
#
# Project: ECOOP, sponsored by The National Science Foundation
# Purpose: this code is part of the Cyberinfrastructure developed for the ECOOP project
# http://tw.rpi.edu/web/project/ECOOP
# ... | epifanio/ecoop | ecooputil.py | Python | lgpl-3.0 | 10,832 |
# pyresample, Resampling of remote sensing image data in python
#
# Copyright (C) 2012, 2014, 2015 Esben S. Nielsen
#
# 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 ... | jhamman/pyresample | setup.py | Python | lgpl-3.0 | 2,103 |
# IfcOpenShell - IFC toolkit and geometry engine
# Copyright (C) 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of IfcOpenShell.
#
# IfcOpenShell 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 Foundat... | IfcOpenShell/IfcOpenShell | src/ifcopenshell-python/ifcopenshell/api/sequence/assign_process.py | Python | lgpl-3.0 | 2,464 |
'''
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
'''
# Building a Standard Primal Linear Progr... | jGaboardi/LP_MIP | Gurobi_Primal_Standard.py | Python | lgpl-3.0 | 3,759 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# === django_pgmp ---------------------------------------------------------===
# This file is part of django-pgpm. django-pgpm is copyright © 2012, RokuSigma
# Inc. and contributors. See AUTHORS and LICENSE for more details.
#
# django-pgpm is free software: you can redist... | monetizeio/django-pgmp | django_pgmp/__init__.py | Python | lgpl-3.0 | 1,587 |
#from satpy import Scene
from satpy.utils import debug_on
debug_on()
#from glob import glob
#base_dir="/data/COALITION2/database/meteosat/radiance_HRIT/case-studies/2015/07/07/"
#import os
#os.chdir(base_dir)
#filenames = glob("*201507071200*__")
#print base_dir
#print filenames
##global_scene = Scene(reader="hrit_ms... | meteoswiss-mdr/monti-pytroll | scripts/demo_satpy_ndvi_decorate.py | Python | lgpl-3.0 | 7,498 |
'''Copyright (C) 2015 by Wesley Tansey
This file is part of the GFL library.
The GFL 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 3 of the License, or
(at you... | tansey/gfl | pygfl/solver.py | Python | lgpl-3.0 | 10,478 |
import random, itertools, operator, types, pprint, contextlib, collections
import textwrap, string, pdb, copy, abc, functools
memoiziraj = functools.lru_cache(maxsize=None)
def djeljiv(m, n):
"""Je li m djeljiv s n?"""
return not m % n
def ispiši(automat):
"""Relativno uredan ispis (konačnog ili potisnog... | vedgar/ip | Chomsky/util.py | Python | unlicense | 14,523 |
def zip(*arg):
Result = []
Check = 1
#check if every item in arg has the same length
for i in arg:
if len(i) != len(arg[0]):
print 'please make sure enter all items with the same length'
Check = 0
break
while (Check):
for j in range(0,len(arg[0])):... | DataMonster/Python | exer/zipunzip/zip.py | Python | unlicense | 1,230 |
"""
WSGI config for board 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.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "board.settings")
from django.core.wsgi ... | Atom1c/home | board/board/wsgi.py | Python | unlicense | 385 |
from django.test import TestCase
from finance.models import Banking_Account
class IBANTestCase(TestCase):
def setUp(self):
pass
def test_iban_converter(self):
"""BBAN to IBAN conversion"""
self.assertEqual(Banking_Account.convertBBANToIBAN("091-0002777-90"), 'BE34091000277790')... | 317070/ppbe-finance | finance/tests.py | Python | unlicense | 725 |
"""Server API tests."""
import unittest
# Disable W0611: Unused import
import tests.treadmill_test_deps # pylint: disable=W0611
import mock
from treadmill import admin
from treadmill.api import server
class ApiServerTest(unittest.TestCase):
"""treadmill.api.server tests."""
def setUp(self):
self... | toenuff/treadmill | tests/api/server_test.py | Python | apache-2.0 | 2,316 |
# (C) Copyright 2014 Voyager Search
#
# 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/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | voyagersearch/voyager-py | processing/locale/make_mo_files.py | Python | apache-2.0 | 1,085 |
from django.utils.translation import ugettext as _
from django.utils.timezone import now as timezone_now
from django.conf import settings
from django.core import validators
from django.core.exceptions import ValidationError
from django.db import connection, IntegrityError
from django.http import HttpRequest, HttpRespon... | rishig/zulip | zerver/views/messages.py | Python | apache-2.0 | 69,921 |
from plone.app.testing import PloneWithPackageLayer
from plone.app.testing import IntegrationTesting
from plone.app.testing import FunctionalTesting
import groupdocs.comparison
GROUPDOCS_COMPARISON = PloneWithPackageLayer(
zcml_package=groupdocs.comparison,
zcml_filename='testing.zcml',
gs_profile_id='gr... | liosha2007/plone-groupdocs-comparison-source | src/groupdocs/comparison/testing.py | Python | apache-2.0 | 653 |
"""Resets the password for virtual machine. The virtual machine must be in a "Stopped" state and the template must already support this feature for this command to take effect. [async]"""
from baseCmd import *
from baseResponse import *
class resetPasswordForVirtualMachineCmd (baseCmd):
typeInfo = {}
def __i... | MissionCriticalCloud/marvin | marvin/cloudstackAPI/resetPasswordForVirtualMachine.py | Python | apache-2.0 | 24,253 |
from .base_backend import BaseBackend
class MlpBackend(BaseBackend):
def __init__(self, inpmulti, hidmulti, outmulti, learning_rate, inp96, hid96, out96, path, buffsize, mean, std, statspath):
from neupre.misc.builders import build_model_mlp
super(MlpBackend, self).__init__(int(buffsize))
... | horvathpeter/neural_prediction | neupre/backend/onlinemlp_backend.py | Python | apache-2.0 | 1,147 |
# Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# 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/LICENSE-2.0
#
# Unless required b... | ytsarev/rally | tests/deploy/engines/test_devstack.py | Python | apache-2.0 | 4,266 |
'''
@author: Team Alpha, <aa5186@nyu.edu>
Name: Customer Model
Purpose: This library is part of the customer REST API for the ecommerce website
'''
from customer import Customer
| devops-alpha-s17/customers | customers/__init__.py | Python | apache-2.0 | 184 |
__author__ = 'yinjun'
class Solution:
"""
@param nums: The integer array
@return: The length of LIS (longest increasing subsequence)
"""
def longestIncreasingSubsequence(self, nums):
# write your code here
if nums == None or nums == []:
return 0
l = len(nums)
... | shootsoft/practice | lintcode/NineChapters/04/longest-increasing-subsequence.py | Python | apache-2.0 | 646 |
from distutils.core import setup, Extension
from distutils.sysconfig import get_python_lib
import os, os.path
import sys
if 'sdist' in sys.argv and sys.platform != "win32":
assert os.system("git show-ref -s HEAD > .gitrev") == 0
if sys.platform == "darwin":
# Don't create resource files on OS X tar.
os.en... | bzzzz/cython | setup.py | Python | apache-2.0 | 12,175 |
from math import fabs
"""Kept these functions outside the class, since they are static
for the search and movement functions for board. The downside is it creates
an object for search purposes, which seems relatively heavy. I'll
optimize later if necessary
"""
def shift_up(pos):
"""returns new position... | aelkikhia/pyduel_engine | pyduel_engine/model/position.py | Python | apache-2.0 | 3,110 |
# Copyright 2013 OpenStack Foundation.
# All Rights Reserved.
#
# 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/LICENSE-2.0
#
# Unless req... | yanheven/cinder | cinder/brick/local_dev/lvm.py | Python | apache-2.0 | 28,909 |
# Copyright (c) 2015 Intel Corporation
#
# 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/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | enableiot/iotanalytics-rule-engine | pydeps/db/dataDao.py | Python | apache-2.0 | 2,301 |
# -*- coding: utf-8 -*-
import re
import unicodedata
def lower_text(text):
return text.lower()
def normalize_unicode(text, form='NFKC'):
normalized_text = unicodedata.normalize(form, text)
return normalized_text
def normalize_number(text):
"""
pattern = r'\d+'
replacer = re.compile(pattern... | chakki-works/elephant_sense | scripts/data/normalization.py | Python | apache-2.0 | 477 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of compono released under the Apache 2 license.
# See the NOTICE for more information.
from distutils.command.install_data import install_data
import os
import sys
if not hasattr(sys, 'version_info') or sys.version_info < (2, 5, 0, 'final'):
rai... | benoitc/mt-compono | setup.py | Python | apache-2.0 | 2,399 |
#!/usr/bin/env python2
'''
Copyright (c) 2012 Peter Andrews
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/LICENSE-2.0
Unless required by app... | aurule/Sociogram | src/sociogram.py | Python | apache-2.0 | 60,889 |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Results of coverage measurement."""
import collections
from coverage.backward import iitems
from coverage.misc import contract, format_lines, SimpleRepr
clas... | blueyed/coveragepy | coverage/results.py | Python | apache-2.0 | 10,222 |
# Copyright 2013 IBM Corp.
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# 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/LIC... | sajeeshcs/nested_quota_latest | nova/api/openstack/wsgi.py | Python | apache-2.0 | 44,219 |
from .stopper import EarlyStopper
from .progbar import ProgressBar
from .utils import split_arr
from .data_iterator import SequentialIterator
from tensorflow.python.framework import ops
import tensorflow as tf
import logging
logging.basicConfig(format='%(module)s.%(funcName)s %(lineno)d:%(message)s', level=logging.INF... | hycis/TensorGraph | tensorgraph/trainobject.py | Python | apache-2.0 | 3,080 |
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
#
# 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/LICENSE-2.0
#
# Unless required by appli... | mpeuster/son-emu | src/emuvim/dcemulator/son_emu_simple_switch_13.py | Python | apache-2.0 | 5,519 |
import kazoo.client
import kazoo.exceptions
class MockStruct(object):
"""
Basic object to allow adding arbitrary properties
"""
class MockKazooClient(object):
"""
In-memory version of the kazoo client for unit testing
"""
def __init__(self):
self.store = {'/': None}
self... | kanakb/pyhelix | tests/mockclient.py | Python | apache-2.0 | 4,413 |
# Copyright 2016 Hewlett Packard Enterprise Development, LP
#
# All Rights Reserved.
#
# 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/LICENS... | huntxu/neutron | neutron/services/segments/plugin.py | Python | apache-2.0 | 28,272 |
import time
import sqlite3
from base_model import BaseModel
from datetime import datetime
from contextlib import contextmanager
class SSIDTrafficHistory(BaseModel):
def __init__(self, dbfile, table_name, time_limit):
super(SSIDTrafficHistory, self).__init__(dbfile, table_name)
self.time_limit = time_limit
de... | putrasattvika/ssidstat | ssidstat/common/models/ssid_traffic_history.py | Python | apache-2.0 | 3,044 |
# Copyright 2019 DeepMind Technologies Limited. All Rights Reserved.
#
# 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/LICENSE-2.0
#
# Unless required by ... | deepmind/dm-haiku | haiku/_src/recurrent.py | Python | apache-2.0 | 27,760 |
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
"""check_i18n - compare texts in the source with the language files
Searches in the MoinMoin sources for calls of _() and tries to extract
the parameter. Then it checks the language modules if those parameters
are in the dictionary.
Usage: check_i18n.py [lang ...]
... | RealTimeWeb/wikisite | MoinMoin/i18n/tools/check_i18n.py | Python | apache-2.0 | 12,365 |
# Copyright 2019, Google LLC All rights reserved.
#
# 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/LICENSE-2.0
#
# Unless required by applicable law or a... | googleapis/python-pubsub | google/cloud/pubsub_v1/subscriber/client.py | Python | apache-2.0 | 11,505 |
#!/usr/bin/python
## Wrapper For transverse synapse detector workflow##
## This wrapper exists to facilitate workflow level parallelization inside the LONI pipeline until
## it is properly added to the tool. It is important for this step to do workflow level parallelization
## because of the order of processing.
##
... | gkiar/MR-devtools | tools/processSubjects.py | Python | apache-2.0 | 1,580 |
from ajenti.api import *
from ajenti.plugins import *
info = PluginInfo(
title='BIND9',
description='BIND9 DNS server',
icon='globe',
dependencies=[
PluginDependency('main'),
PluginDependency('services'),
BinaryDependency('named'),
],
)
def init():
import main
| lupyuen/RaspberryPiImage | usr/share/pyshared/ajenti/plugins/bind9/__init__.py | Python | apache-2.0 | 313 |
# -*- coding: utf-8 -*-
__author__ = 'itconsense@gmail.com'
from collections import OrderedDict
from math import pi
from Products.Five import BrowserView
from plone import api
import base64
import logging
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import six
LOG = logging.getLogger('eva... | tomgross/pp-site | src/itc.pptheme/itc/pptheme/browser/view.py | Python | apache-2.0 | 4,725 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.