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 -*- # ########################## Copyrights and license ############################ # # # Copyright 2013 AKFish <akfish@gmail.com> # # Copyright 2013 Peter Golm <golm.peter@gmail.com> ...
pombredanne/PyGithub
github/Notification.py
Python
gpl-3.0
5,674
from __future__ import absolute_import import mock import numpy as np from .MockPrinter import MockPrinter from redeem.Gcode import Gcode class G33_Tests(MockPrinter): def setUp(self): pass def test_G33_properties(self): self.assertGcodeProperties("G33", is_buffered=True, is_async=True) @mock.patch("...
intelligent-agent/redeem
tests/gcode/test_G33.py
Python
gpl-3.0
2,397
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup # fetch values from package.xml setup_args = generate_distutils_setup( packages=['uav_utils'], package_dir={'': 'src'}) setup(**setup_args)
jdrusso/last_letter
uav_utils/setup.py
Python
gpl-3.0
307
############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # T...
Donkyhotay/MoonPy
zope/tal/translationcontext.py
Python
gpl-3.0
1,523
from socket import * from pytroykaimu import TroykaIMU import time import datetime # Адрес HOST = '' PORT = 21567 BUFSIZ = 128 ADDR = (HOST, PORT) imu = TroykaIMU() tcpSerSock = socket(AF_INET, SOCK_STREAM) tcpSerSock.bind(ADDR) tcpSerSock.listen(5) # Запрет на ожидание # tcpSerSock.setblocking(False) def print_log...
Shatki/PyIMU
calibration/pyIMUCalibrationServer.py
Python
gpl-3.0
2,005
# Copyright 2019 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datetime import date import pytest from ..testutil import eq_, with_...
hsoft/moneyguru
core/tests/gui/transaction_panel_test.py
Python
gpl-3.0
11,860
class User: def __init__(self, name): self.name = name
syncloud/platform
src/syncloud_platform/rest/model/user.py
Python
gpl-3.0
67
# coding=utf-8 # URL: https://pymedusa.com # # This file is part of Medusa. # # Medusa 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....
Thraxis/pymedusa
sickbeard/indexers/indexer_exceptions.py
Python
gpl-3.0
1,776
print('Yes' if (lambda a,b : (lambda number: a == b or (a[1:] == b and a[0] in number and len(a)-1 == len(b)) or (a[:-1] == b and a[-1] in number and len(a)-1 == len(b)) or ''.join(x.upper() if x.islower() else x.lower() for x in b) == a)({str(i) for i in range(10)}))(input(), input()) else 'No')
JonSteinn/Kattis-Solutions
src/Soft Passwords/Python 3/main.py
Python
gpl-3.0
297
""" A list is a sequence 1.Can be any type 2.The values in a list are called elements or sometimes items 3.Declare with square brackets: [ ] 4.Can be nested. [x, y, [z1, z2]] """ myStr1 = 'aabbcc' myStr2 = 'aabbcc' print('myStr1 = ', myStr1) print('myStr2 = ', myStr2) print('myStr1 is myStr2 = ', myStr1 is myStr2,...
flake123p/ProjectH
Python/_Basics_/A11_Reference/test.py
Python
gpl-3.0
817
"""Provides methods for rendering the labelled model.""" import json import os import hashlib import glob import numpy as np import bpy # pylint: disable=import-error from . import helpers class Render(): """Configure and render the scene. Parameters are read from conf_file. During testing and setup one ...
jaantoots/bridgeview
render/render.py
Python
gpl-3.0
18,995
from __future__ import division import env engine = env.engine import interphase interphase.init(engine) class MatrixInterface(interphase.Interface): def __init__(self, identity, matrix, control): self.matrix = matrix self.control = control interphase.Interface.__init__(self, identity, p...
jggatc/nexus
interface.py
Python
gpl-3.0
4,260
#!/usr/bin/env python3 # # The MIT License (MIT) # # Copyright (C) 2015 - Francois Doray <francois.pierre-doray@polymtl.ca> # # 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 without restricti...
fdoray/tracecompare-benchmark
scripts/summary.py
Python
gpl-3.0
9,109
from helper.models import AgentMeta from django import forms class OAuthAgentMixinMeta(AgentMeta): def __init__(cls, name, bases, dct): if bases: # not 1st base class(the mixin), only subclasses from helper.utils.views import OAuth2Login class Login(OAuth2Login): ...
dschep/HELPeR
helper/utils/models.py
Python
gpl-3.0
1,457
import os import fnmatch def find_files(directory, pattern): for root, dirs, files in os.walk(directory): for basename in files: if fnmatch.fnmatch(basename, pattern): filename = os.path.join(root, basename) yield filename for fname in find_files('...
Erotemic/local
misc/code/TAing/fixcmake.py
Python
gpl-3.0
478
# # Copyright 2007 !j Incorporated # # This file is part of Canner. # # Canner 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. # # Cann...
pusateri/canner
canner/personalities/junos.py
Python
gpl-3.0
1,104
# Exceptions used throughout feedparser # Copyright 2010-2021 Kurt McKee <contactme@kurtmckee.org> # Copyright 2002-2008 Mark Pilgrim # All rights reserved. # # This file is a part of feedparser. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the follo...
rembo10/headphones
lib/feedparser/exceptions.py
Python
gpl-3.0
1,957
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import serialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import...
Vagab0nd/SiCKRAGE
lib3/twilio/rest/ip_messaging/v1/service/channel/invite.py
Python
gpl-3.0
15,284
"""! @brief Unit-tests for X-Means algorithm. @authors Andrei Novikov (pyclustering@yandex.ru) @date 2014-2020 @copyright BSD-3-Clause """ import unittest # Generate images without having a window appear. import matplotlib matplotlib.use('Agg') from pyclustering.cluster.tests.xmeans_templates im...
annoviko/pyclustering
pyclustering/cluster/tests/unit/ut_xmeans.py
Python
gpl-3.0
23,984
import sys import os import os.path import json import filelock import tempfile import logging import warnings import multiprocessing from django.core.exceptions import ImproperlyConfigured from django.utils.functional import LazyObject, empty from biohub.utils.collections import unique from biohub.utils.module impor...
igemsoftware2017/USTC-Software-2017
biohub/core/conf/__init__.py
Python
gpl-3.0
10,903
# Copyright (C) 2012 Alex Nitz, Josh Willis # # 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 distr...
tdent/pycbc
test/test_pnutils.py
Python
gpl-3.0
4,562
# -*- coding: utf-8 -*- # (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst. """ TODO Docstring. """ import argparse import logging import sys import h5py import numpy as np from PIL import Image from matplotlib import colors from matplotlib import cm from openradar import calc from openradar import config lo...
nens/openradar
openradar/scripts/elevation_image.py
Python
gpl-3.0
2,413
__all__ = ["Block", "Unknown", "Multitextured", "DataValues", "Stairs", "MultitexturedStairs", "Slab", "MultitexturedSlab", "Log"]
scribblemaniac/MCEdit2Blender
blocks/__init__.py
Python
gpl-3.0
132
while 1: arr=input().split(' ') k=arr[0] n=arr[1] if k=='0' and n=='0': break ans=int(int(k)**int(n)) print (int(ans))
ProgDan/maratona
SPOJ/UJ.py
Python
gpl-3.0
129
import squeakspace.common.util as ut import squeakspace.common.util_http as ht import squeakspace.proxy.server.db_sqlite3 as db import squeakspace.common.squeak_ex as ex import config def post_handler(environ): query = ht.parse_post_request(environ) cookies = ht.parse_cookies(environ) user_id = ht.get_re...
eek6/squeakspace
www/proxy/scripts/proxy/group_quota.py
Python
gpl-3.0
2,328
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749.grant_types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from __future__ import unicode_literals, absolute_import import json import logging from modules.oauthlib import common from modules.oauthlib.uri_validate import is_absolute_uri from .base import GrantTypeBase fr...
insiderr/insiderr-app
app/modules/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
Python
gpl-3.0
19,942
# __main__.py is used when a package is executed as a module, i.e.: `python -m pptx_downsizer` if __name__ == '__main__': from .pptx_downsizer import cli cli()
scholer/pptx-downsizer
pptx_downsizer/__main__.py
Python
gpl-3.0
170
from collections import defaultdict from PyQt5.QtCore import QModelIndex, Qt from urh.models.TableModel import TableModel from urh.signalprocessing.ProtocolAnalyzer import ProtocolAnalyzer class SimulatorMessageTableModel(TableModel): def __init__(self, compare_frame_controller, generator_tab_controller, parent=...
splotz90/urh
src/urh/models/SimulatorMessageTableModel.py
Python
gpl-3.0
3,129
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.website_event.tests.common import TestEventOnlineCommon class TestEventExhibitorCommon(TestEventOnlineCommon): @classmethod def setUpClass(cls): super(TestEventExhibitorCommon, cls).se...
jeremiahyan/odoo
addons/website_event_exhibitor/tests/common.py
Python
gpl-3.0
1,021
# -*- coding: utf-8 -*- # # Pikacon documentation build configuration file, created by # sphinx-quickstart on Wed Apr 3 22:19:40 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
pingviini/pikacon
docs/source/conf.py
Python
gpl-3.0
8,016
import numpy import warnings from trussme.physical_properties import materials, valid_member_name class Member(object): # Shape types shapes = ["pipe", "bar", "square", "box"] def __init__(self, joint_a, joint_b): # Save id number self.idx = -1 # Shape independent variables ...
jknesek/Balsa-Bridge-Optimizer
trussme/member.py
Python
gpl-3.0
7,229
# -*- coding: utf-8 -*- from control import WebController class ApiController(WebController): def __init__(self, session, path = ""): WebController.__init__(self, session, path) def prePageLoad(self, request): self.isJson = True
Speedy1985/enigmalight
build/python/plugin/EnigmaLight/remote/api.py
Python
gpl-3.0
238
import pyglet from init_game import * import random def get_4_random_xy_combo_coordinates(): qs = ( ( (width, 1.5*width), (0, height/2) ), ( (1.5*width, 2*width), (0, height/2) ), ( (width, 1.5*width), (height/2, height-150) ), ( (1.5*width, 2*widt...
khera-shanu/tap_to_survive
game.py
Python
gpl-3.0
5,559
# # Copyright (C) 2016 FreeIPA Contributors see COPYING for license # """ Base service installer module """ from ipalib.util import validate_domain_name from ipapython.install import common, core, typing from ipapython.install.core import group, knob def prepare_only(obj): """ Decorator which makes an inst...
apophys/freeipa
ipalib/install/service.py
Python
gpl-3.0
4,662
#!/usr/bin/env python import getopt import os import sys class GeniusError(Exception): def __init__(self, msg=None): self.msg = msg def __str__(self): return str(self.msg) def addDLPath(path): if os.sysname == 'Windows': pass else: if os.environ.has_key(os.varDLPa...
cogenda/Genius-TCAD-Open
bin/test.py
Python
gpl-3.0
4,691
#!/usr/bin/env python # -*- coding: utf-8 -*- """task 05""" def defaults(my_required, my_optional=True): """1. ``my_optional`` which has a default value of True 2. ``my_required`` which is a required param and has no default value""" return my_optional is my_required
DannySapz/is210-week-04-warmup
task_05.py
Python
mpl-2.0
285
import datetime from django.conf import settings from django.contrib.auth import get_user_model, login from django.shortcuts import get_object_or_404 from django.template.response import TemplateResponse from django.views.decorators.csrf import csrf_exempt from oauth2client import client, crypt from rest_framework.de...
openjck/distribution-viewer
viewer/api/views.py
Python
mpl-2.0
4,165
#!/usr/bin/env python import ConfigParser import hashlib import json import os import re import sys import tempfile import time import urllib2 import urlparse import boto.s3.connection import boto.s3.key # bring a URL to canonical form as described at # https://developers.google.com/safe-browsing/developers_guide_v2...
rtilder/shavar-list-creation
lists2safebrowsing.py
Python
mpl-2.0
13,448
# -* 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/. import configargparse from typing import Any, Type from gopythongo.utils import highlight, Er...
gopythongo/gopythongo
src/py/gopythongo/versioners/static.py
Python
mpl-2.0
1,614
""" A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.absp...
changyuheng/pywinwifi
setup.py
Python
mpl-2.0
3,930
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-31 06:38 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('classroom', '0001_initial'), ] operations = [ migrations.AlterField( ...
shmish/core-assess
classroom/migrations/0002_auto_20170730_2338.py
Python
mpl-2.0
436
rare_pokemon = ( "Dragonite", "Flareon", "Exeggutor", "Arcanine", "Victreebel", "Magmar", "Charizard", "Nidoking", "Gengar", "Vileplume", "Rapidash", "Raichu", "Machamp", "Venusaur", "Electabuzz", "Cloyster", "Golduck", "Starmie", "Gyarados", "Jolteon", "Weezing", "Weepinbell", "Kabutops", "Vaporeon", "Lapras", "Blasto...
darragjm/PokemonGo-Map
pogom/pokelists.py
Python
agpl-3.0
2,118
from django.conf import settings from ideascube.configuration import get_config # For unittesting purpose, we need to mock the Catalog class. # However, the mock is made in a fixture and at this moment, we don't # know where the mocked catalog will be used. # So the fixture mocks 'ideascube.serveradmin.catalog.Catalo...
ideascube/ideascube
ideascube/cards.py
Python
agpl-3.0
1,516
# Collection of adjectives # September 19 2014 # Christian Bauer d = { } drev = { } num = 0 def ins(x): global num,d,drev d[num] = x drev[x] = num num = num + 1 ins('abandoned') ins('able') ins('absolute') ins('adorable') ins('adventurous') ins('academic') ins('acceptable') ins('acclaimed') ins('acco...
cjbauer/brainphrase
adjectives.py
Python
agpl-3.0
20,322
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (C) 2014 Didotech srl (<http://www.didotech.com>). # # All Rights Reserved # # This program is free software: you can redistr...
iw3hxn/LibrERP
sale_order_version/models/__init__.py
Python
agpl-3.0
1,120
#-*- coding:utf-8 -*- from lampapp import LampApp from hardware.lamp import Color #FIXME odd import.. app = LampApp() app.need("lamp") @app.setup() def setup(): app.lamp.turn_on(20, Color.from_html('#009900')) app.lamp.turn_on(18, Color.from_html('#cc0000')) on = True @app.every(1) def loop(): global o...
enavarro222/bblamp
user_apps/blink.py
Python
agpl-3.0
492
from concurrent.futures import ThreadPoolExecutor import logging import sys import unittest import unittest.mock from coalib.settings.Section import Section from coalib.core.Bear import Bear from coalib.core.Core import initialize_dependencies, run from coala_utils.decorators import generate_eq from tests.core.CoreT...
coala/coala
tests/core/CoreTest.py
Python
agpl-3.0
35,897
# -*- coding: utf-8 -*- # © 2016 Eficent Business and IT Consulting Services S.L. - # Jordi Ballester Alomar # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from openerp.osv import fields, orm from openerp.addons.account.report.account_balance import account_balance from openerp.report import repo...
Eficent/odoo-operating-unit
account_operating_unit/wizard/account_report_account_balance.py
Python
agpl-3.0
1,755
import os import yaml import time from datetime import datetime def get_all_csv_paths(path): csv_paths = [] for root, dirs, files in os.walk(path): for file in files: if file.endswith(".csv"): csv_paths.append(os.path.join(root, file)) return csv_paths def date_str_to...
newspipe/newspipe
dags/dag_factory/components/utils.py
Python
agpl-3.0
1,480
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
Ichag/openerp-server
openerp/osv/fields.py
Python
agpl-3.0
69,883
# -*- Coding: utf-8; Mode: Python -*- # # storagelib.py - A simple and extensible storage library # # Copyright (C) 2010 Lincoln de Sousa <lincoln@comum.org> # # 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...
clarete/storagelib
storagelib.py
Python
agpl-3.0
10,480
""" Module rendering """ import hashlib import json import logging from collections import OrderedDict from functools import partial from completion.models import BlockCompletion from completion import waffle as completion_waffle from django.conf import settings from django.contrib.auth.models import User from django...
ahmedaljazzar/edx-platform
lms/djangoapps/courseware/module_render.py
Python
agpl-3.0
49,790
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
aimas/TuniErp-8.0
openerp/addons/base/res/res_users.py
Python
agpl-3.0
45,483
#!/usr/bin/env python """ regexbot: IRC-based regular expression evaluation tool. Copyright 2010 - 2012 Michael Farrell <http://micolous.id.au> 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, ...
keeperofdakeys/ircbots
regexbot.py
Python
agpl-3.0
15,901
""" MIT License Copyright (c) 2019 Claude SIMON (https://q37.info/s/rmnmqd49) 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 without restriction, including without limitation the rights ...
epeios-q37/epeios
other/libs/tortoise/PYH/setup.py
Python
agpl-3.0
2,114
# coding=utf-8 __author__ = "AstroPrint Product Team <product@astroprint.com>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2017 3DaGoGo, Inc - Released under terms of the AGPLv3 License" # singleton _instance = None def printerProfileManager(...
abinashk-inf/AstroBox
src/astroprint/printerprofile/__init__.py
Python
agpl-3.0
2,918
from ckan.controllers.package import PackageController from ckan.plugins import toolkit as tk from ckan.common import request import ckan.model as model import ckan.logic as logic import logging import requests import ConfigParser import os import json log = logging.getLogger(__name__) config = ConfigParser.ConfigPar...
memaldi/ckanext-sparql
ckanext/sparql/controller.py
Python
agpl-3.0
2,273
#!/usr/bin/env python import argparse import os import subprocess import sys import time from codecs import open from pelican.utils import slugify def wp2fields(xml): """Opens a wordpress XML file, and yield pelican fields""" try: from BeautifulSoup import BeautifulStoneSoup except ImportError:...
0x00f/pelican
pelican/tools/pelican_import.py
Python
agpl-3.0
11,582
from communityalmanac.tests import * class TestUsersController(TestController): def test_index(self): response = self.app.get(url(controller='users', action='index')) # Test response...
openplans/community-almanac
communityalmanac/tests/functional/test_users.py
Python
agpl-3.0
208
# -*- coding: utf-8 -*- # 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 ...
rolandgeider/wger
wger/nutrition/__init__.py
Python
agpl-3.0
862
import pytest import rules from adhocracy4.projects.enums import Access from adhocracy4.test.helpers import freeze_phase from adhocracy4.test.helpers import freeze_post_phase from adhocracy4.test.helpers import freeze_pre_phase from adhocracy4.test.helpers import setup_phase from adhocracy4.test.helpers import setup_u...
liqd/a4-meinberlin
tests/ideas/rules/test_rules_view.py
Python
agpl-3.0
4,529
from ..base.MagicOre import MagicOre from erukar.system.engine import Observation import erukar class Atherite(MagicOre): Probability = 200 Desirability = 4.0 InventoryDescription = "A whitish alloy infused with chaotic energies; enhances random effects by 25%" InventoryName = "Atherite" PriceMu...
etkirsch/legends-of-erukar
erukar/content/modifiers/material/random/Atherite.py
Python
agpl-3.0
1,596
import numpy as np import random import time from collections import defaultdict from memory_profiler import memory_usage def stop_condition(T,pop,Tmax,monitor_T): if T == monitor_T: print(memory_usage()) return (T >= Tmax) or (T>0 and len(pop) == 1) def new_stop_condition(T,pop,Tmax,monitor_T): if T == monito...
flowersteam/naminggamesal
naminggamesal/tools/efficient_minimal_ng.py
Python
agpl-3.0
4,257
import unittest from django.contrib.auth.models import User, Group from enhydris.hcore.models import Gentity class PermissionsTestCase(unittest.TestCase): def setUp(self): self.object = Gentity.objects.create(name='testgent') self.object.save() self.user = User.objects.create(username='test...
ellak-monades-aristeias/enhydris
enhydris/permissions/tests.py
Python
agpl-3.0
1,553
from django.contrib import admin from .models import Report @admin.register(Report) class ReportAdmin(admin.ModelAdmin): fields = ('content_type', 'content_object', 'description', 'creator') readonly_fields = ('creator', 'content_type', 'content_object') list_display = ('__str__', 'creator', 'created') ...
liqd/adhocracy4
adhocracy4/reports/admin.py
Python
agpl-3.0
350
# Copyright 2018 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import distribution_list_line_template from . import virtual_partner_involvement
mozaik-association/mozaik
mozaik_virtual_partner_involvement/models/__init__.py
Python
agpl-3.0
183
#!/usr/bin/env python3 # -*-coding:UTF-8 -* from pubsublogger import publisher from Helper import Process import datetime import time if __name__ == "__main__": publisher.port = 6380 publisher.channel = "Script" config_section = 'DumpValidOnion' dump_file = 'dump.out' p = Process(config_section)...
CIRCL/AIL-framework
bin/DumpValidOnion.py
Python
agpl-3.0
903
from django.forms.widgets import TextInput, Widget, MultiWidget from django_better_admin_arrayfield.forms.widgets import DynamicArrayWidget from django import forms class FactoryWidget(MultiWidget): template_name = "modelview/widgets/multiwidget.html" def __init__(self, factory): self.factory = facto...
openego/oeplatform
modelview/rdf/widget.py
Python
agpl-3.0
5,599
""" Tests for the lms_result_processor """ import six import pytest from lms.djangoapps.courseware.tests.factories import UserFactory from lms.lib.courseware_search.lms_result_processor import LmsSearchResultProcessor from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tes...
stvstnfrd/edx-platform
lms/lib/courseware_search/test/test_lms_result_processor.py
Python
agpl-3.0
3,315
""" Common test utilities for courseware functionality """ from abc import ABCMeta, abstractmethod from datetime import datetime, timedelta import ddt import six from mock import patch from six.moves.urllib.parse import urlencode from lms.djangoapps.courseware.field_overrides import OverrideModulestoreFieldData fro...
stvstnfrd/edx-platform
lms/djangoapps/courseware/testutils.py
Python
agpl-3.0
11,543
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # 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 #...
MostlyOpen/odoo_addons_jcafb
myo_professional_cst/__openerp__.py
Python
agpl-3.0
1,550
def json_headers(f): def wrapped(*args, **kwargs): resp = f(*args, **kwargs) resp.headers['Content-Type'] = 'application/json' return resp return wrapped def max_age_headers(f): def wrapped(*args, **kwargs): resp = f(*args, **kwargs) resp.headers['Access-Control-Max-...
ryepdx/scale_proxy_server
header_decorators.py
Python
agpl-3.0
376
# Copyright 2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Test behavior of the Librarian during a database outage. Database outages happen by accident and during fastdowntime deployments.""" __metaclass__ = type from cStringIO impor...
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/services/librarianserver/tests/test_db_outage.py
Python
agpl-3.0
3,628
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2019-07-31 15:53 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('sync', '0003_synctarget_lastrun'), ] operations = [ migrations.RenameModel( ...
tdfischer/organizer
sync/migrations/0004_auto_20190731_1553.py
Python
agpl-3.0
403
#!/usr/bin/env python # coding: utf-8 import re import bleach import passlib from sqlalchemy.exc import IntegrityError from sqlalchemy.orm.exc import NoResultFound # from flask import redirect, url_for, make_response from flask.ext.restplus import Resource from flask.ext.mail import Message from auths import get_aut...
okfn-brasil/viralata
viralata/views.py
Python
agpl-3.0
12,901
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-08-01 09:24 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('submission', '0047_auto_20200720_1415'), ] operations = [ migrations.AddFi...
BirkbeckCTP/janeway
src/submission/migrations/0048_submissionconfiguration_submission_file_text.py
Python
agpl-3.0
704
import numpy as np def is_power_of_two(num): """ Checks if num is power of two """ return ((num & (num - 1)) == 0) and num > 0 def rmse(x, y): """ Root mean square error. :param x: numpy array :param y: numpy array :return: RMSE(x,y) """ return np.sqrt(((x - y) ** 2).mean...
bzamecnik/sms-tools
smst/utils/math.py
Python
agpl-3.0
692
# -*- coding: utf-8 -*- # ##################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>). # Copyright (C) 2013 INIT Tech Co., Ltd (http://init.vn). # This program is free software: you can redistribute it a...
quanvm009/codev7
openerp/addons_quan/lifestyle/wizard/create_po_wizard.py
Python
agpl-3.0
7,812
from collections import OrderedDict from datetime import datetime from skylines.api import schemas def test_user_schema(test_user): """:type test_user: skylines.model.User""" data, errors = schemas.user_schema.dump(test_user) assert not errors assert isinstance(data, OrderedDict) assert data.ke...
kerel-fs/skylines
tests/api/schemas/user_test.py
Python
agpl-3.0
2,586
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from . import business_requirement from . import sale_order_line from . import sale_order
OCA/business-requirement
business_requirement_sale/models/__init__.py
Python
agpl-3.0
156
## # Copyright (C) 2014 Jessica Tallon & Matt Molyneaux # # This file is part of Inboxen. # # Inboxen is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
Inboxen/Inboxen
inboxen/account/views/otp.py
Python
agpl-3.0
3,760
# -*- coding: utf-8 -*- ## File autogenerated by SQLAutoCode ## see http://code.google.com/p/sqlautocode/ from sqlalchemy import * from sqlalchemy.dialects.postgresql import * from geoalchemy2 import Geography from models import metadata object_type = Table('object_type', metadata,*[ Column('id', INTEGER(), prima...
datanel/navitia
source/sql/models/navitia.py
Python
agpl-3.0
24,406
from list_tests import *
opendoor/django-comlink
comlink/tests/__init__.py
Python
agpl-3.0
25
# -*- coding: utf-8 -*- from __future__ import unicode_literals from flask import url_for from udata.core.dataset.factories import VisibleDatasetFactory from udata.core.organization.factories import OrganizationFactory from udata.core.spatial.factories import GeoZoneFactory, SpatialCoverageFactory from udata.core.spa...
davidbgk/udata
udata/tests/features/territories/test_territories_process.py
Python
agpl-3.0
21,564
""" ##BOILERPLATE_COPYRIGHT ##BOILERPLATE_COPYRIGHT """ import datetime from types import IntType from noink import mainDB from noink.data_models import Role, RoleMapping from noink.user_db import UserDB from noink.activity_table import get_activity_dict from noink.exceptions import DuplicateRole, RoleNotFound from...
criswell/noink
src/noink/role_db.py
Python
agpl-3.0
7,210
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
lepistone/vertical-ngo
__unported__/framework_agreement_sourcing/__openerp__.py
Python
agpl-3.0
2,442
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
Micronaet/micronaet-connector
prestashop-connector/agent/agent_mysql.py
Python
agpl-3.0
33,351
# Playhouse: Making buildings into interactive displays using remotely controllable lights. # Copyright (C) 2014 John Eriksson, Arvid Fahlström Myrman, Jonas Höglund, # Hannes Leskelä, Christian Lidström, Mattias Palo, # Markus Videll, Tomas Wickman, Emil Öhman. # # This progra...
smab/playhouse-web
src/config.py
Python
agpl-3.0
24,018
"""autogenerated by genpy from qbo_arduqbo/Mic.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct import std_msgs.msg class Mic(genpy.Message): _md5sum = "53acd43451f96e661169eddc90448bdc" _type = "qbo_arduqbo/Mic" _has_header = True #flag to mark...
HailStorm32/Q.bo_stacks
qbo_arduqbo/src/qbo_arduqbo/msg/_Mic.py
Python
lgpl-2.1
7,186
#!/usr/bin/env python # Mapnik uses the build tool SCons. # This python file is run to compile a plugin # It must be called from the main 'SConstruct' file like: # SConscript('path/to/this/file.py') # see docs at: http://www.scons.org/wiki/SConscript() import os # Give this plugin a name # here this happens to be...
mojodna/debian-mapnik
plugins/input/templates/helloworld/build.py
Python
lgpl-2.1
2,425
# # This file is part of Mapnik (c++ mapping toolkit) # # Copyright (C) 2015 Artem Pavlenko # # Mapnik 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 op...
mapycz/mapnik
plugins/input/gdal/build.py
Python
lgpl-2.1
2,194
# 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) """Components that manage Spack's installation tree. An install tree, or "build store" consists of two parts: 1. A pac...
rspavel/spack
lib/spack/spack/store.py
Python
lgpl-2.1
4,128
# pyui2 # Copyright (C) 2005 John Judd # # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT A...
Ripsnorta/pyui2
widgets/toolbar.py
Python
lgpl-2.1
2,460
#!/usr/bin/env python # # @file Constructors.py # @brief class for constructors for c++ and c # @author Frank Bergmann # @author Sarah Keating # # <!-------------------------------------------------------------------------- # # Copyright (c) 2013-2018 by the California Institute of Technology # (California, USA)...
sbmlteam/deviser
deviser/code_files/cpp_functions/Constructors.py
Python
lgpl-2.1
42,243
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
skosukhin/spack
var/spack/repos/builtin/packages/htop/package.py
Python
lgpl-2.1
1,706
# vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab smarttab autoindent # Altai API Service # Copyright (C) 2012-2013 Grid Dynamics Consulting Services, Inc # All Rights Reserved # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License ...
altai/altai-api
altai_api/exceptions.py
Python
lgpl-2.1
4,527
#!PYRTIST:VERSION:0:0:1 from pyrtist.lib2d import Point, Tri #!PYRTIST:REFPOINTS:BEGIN bbox1 = Point(0, 50); bbox2 = Point(100, 0) p1 = Point(25.7575757576, 30.3787878788) p2 = Point(19.814314022, 27.0345941837) p3 = Point(27.7318108704, 19.2297513487) p4 = Point(47.8787878788, 18.4090909091) p5 = Point(67.7272727273, ...
mfnch/pyrtist
pyrtist/examples/arcs.py
Python
lgpl-2.1
1,134
#!/usr/bin/python """Test of line navigation output of Firefox.""" from macaroon.playback import * import utils sequence = MacroSequence() #sequence.append(WaitForDocLoad()) sequence.append(PauseAction(5000)) # Work around some new quirk in Gecko that causes this test to fail if # run via the test harness rather t...
GNOME/orca
test/keystrokes/firefox/object_nav_descriptions_down.py
Python
lgpl-2.1
6,661
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## Contact: Nokia Corporation (qt-info@nokia.com) ## ## This file is part of the test suite of the Qt Toolkit. ## ## $QT_BEG...
radekp/qt
util/local_database/qlocalexml2cpp.py
Python
lgpl-2.1
18,286
""" Task-based implementation of :class:`.ContactFrequency`. The overall algorithm is: 1. Identify how we're going to slice up the trajectory into task-based chunks (:meth:`block_slices`, :meth:`default_slices`) 2. On each node a. Load the trajectory segment (:meth:`load_trajectory_task`) b. Run the analys...
dwhswenson/contact_map
contact_map/frequency_task.py
Python
lgpl-2.1
4,417