repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
gridcf/gct
myproxy/oauth/source/myproxyoauth/views.py
4
14096
# # Copyright 2010-2011 University of Chicago # # 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...
apache-2.0
abhinavmoudgil95/root
interpreter/llvm/src/utils/abtest/abtest.py
30
8132
#!/usr/bin/env python # # Given a previous good compile narrow down miscompiles. # Expects two directories named "before" and "after" each containing a set of # assembly or object files where the "after" version is assumed to be broken. # You also have to provide a script called "link_test". It is called with a list # ...
lgpl-2.1
encukou/pytest-sourceorder
setup.py
1
1256
#!/usr/bin/python2 # # Copyright (C) 2014 pytest-sourceorder contributors. See COPYING for license # from setuptools import setup import io with io.open('README.rst', 'rt', encoding='utf-8') as f: readme_contents = f.read() setup_args = dict( name = "pytest-sourceorder", version = "0.5.1", descriptio...
gpl-3.0
UXJera/JeremiahNyman.com
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/MSVSToolFile.py
2736
1804
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml class Writer(object): """Visual Studio XML tool file writer.""" ...
cc0-1.0
maelnor/nova
nova/compute/vm_states.py
99
2089
# Copyright 2010 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 requ...
apache-2.0
purpleKarrot/fluorescence
gumps/spellbook.py
12
4103
import ui from data import Texture, TextureSource, rgba import client def create(args): g = ui.GumpMenu("spellbook", 100, 100) g.setFont("Devinne Swash", 16) g.addPage(0) g.addImage((0, 0), Texture(TextureSource.GUMPART, 2220)) # circle numbers g.addPageButton((58, 175), Texture(TextureSourc...
gpl-3.0
fabioz/Pydev
plugins/org.python.pydev.core/pysrc/_pydevd_bundle/pydevd_custom_frames.py
2
4396
from _pydevd_bundle.pydevd_constants import get_current_thread_id, Null, ForkSafeLock from pydevd_file_utils import get_abs_path_real_path_and_base_from_frame from _pydev_imps._pydev_saved_modules import thread, threading import sys from _pydev_bundle import pydev_log DEBUG = False class CustomFramesContainer: ...
epl-1.0
xiaoyexu/xCRM
setup.py
1
19311
# -*- coding: UTF-8 -*- import os, django os.environ['DJANGO_SETTINGS_MODULE'] = 'crm_site.settings' django.setup() from crm.models import * from crm.common import * # Demo initialize # UserRoleType userRoleTypes = [ ['SALES_ROLE', u"销售"], ['DEV_ROLE', u"CRM开发"] ] for userRoleType in userRoleTypes: p = ...
gpl-3.0
cloudbau/glance
glance/openstack/common/context.py
5
2664
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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.apac...
apache-2.0
chongtianfeiyu/kbengine
kbe/res/scripts/common/Lib/test/test_faulthandler.py
60
21327
from contextlib import contextmanager import datetime import faulthandler import os import re import signal import subprocess import sys from test import support, script_helper from test.script_helper import assert_python_ok import tempfile import unittest from textwrap import dedent try: import threading HAVE...
lgpl-3.0
carnotweat/cpupimp
libs/rsa/pem.py
216
3372
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # Unl...
gpl-3.0
alaski/nova
nova/api/openstack/compute/server_password.py
7
2555
# Copyright (c) 2012 Nebula, 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...
apache-2.0
naparuba/kunai
opsbro/misc/internalyaml/ruamel/_test/test_version.py
2
2164
# coding: utf-8 import pytest # NOQA import ruamel.yaml from roundtrip import dedent def load(s, version=None): return ruamel.yaml.round_trip_load(dedent(s), version) class TestVersions: def test_explicit_1_2(self): l = load("""\ %YAML 1.2 --- - 12:34...
mit
csdl/makahiki
makahiki/apps/widgets/notifications/tests.py
2
5060
"""Notification testing.""" from django.test import TransactionTestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User from apps.managers.challenge_mgr import challenge_mgr from apps.utils import test_utils from apps.widgets.notifications import get_unread_notifications from ...
mit
andrew-aladev/samba-talloc-debug
auth/credentials/tests/bind.py
11
5515
#!/usr/bin/env python # -*- coding: utf-8 -*- # This is unit with tests for LDAP access checks import optparse import sys import base64 import re import os import copy import time sys.path.insert(0, "bin/python") import samba samba.ensure_external_module("testtools", "testtools") samba.ensure_external_module("subunit...
gpl-3.0
Ouranosinc/Magpie
magpie/alembic/versions/2018-06-04_a395ef9d3fe6_reference_root_service.py
1
2200
""" reference root service. Revision ID: a395ef9d3fe6 Revises: ae1a3c8c7860 Create Date: 2018-06-04 11:38:31.296950 """ import sqlalchemy as sa from alembic import op from alembic.context import get_context # noqa: F401 from sqlalchemy.dialects.postgresql.base import PGDialect from sqlalchemy.orm.session import sess...
apache-2.0
geniusgogo/rt-thread
bsp/nrf5x/nrf51822/rtconfig.py
5
2499
import os # toolchains options ARCH='arm' CPU='cortex-m0' CROSS_TOOL='keil' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EX...
apache-2.0
arokem/PyEMMA
pyemma/_ext/sklearn/base.py
2
17484
""" -------------------------------------------------------------------------------------------- Extracted from skikit-learn to ensure basic compatibility without creating an explicit dependency. For the original code see http://scikit-learn.org/ and https://github.com/scikit-learn ----------------------------...
bsd-2-clause
OiNutter/microbit-scripts
runner/runner.py
1
4487
from microbit import * import random from math import ceil MAX_COLS = 5 PAUSE = 500 def init(): global blocks, wait, player, old_player, jump_counter, start, counter, lives, jump_held, jump_amount, jump_maxed, PAUSE blocks = [] wait = 0 player = [1, 4] old_player = None jump_counter = 0 s...
mit
ajyoon/brown
tests/test_interface/test_font_interface.py
1
1421
import unittest import pytest from PyQt5 import QtGui from brown.core import brown from brown.interface.font_interface import FontInterface from brown.utils.units import Unit class MockUnit(Unit): CONVERSION_RATE = 0.5 class TestFontInterface(unittest.TestCase): def setUp(self): brown.setup() ...
gpl-3.0
marcoantoniooliveira/labweb
tests/integration/partner/strategy_tests.py
51
4245
from django.test import TestCase from decimal import Decimal as D from oscar.apps.partner import strategy from oscar.apps.catalogue import models from oscar.test import factories from oscar.apps.basket.models import Line class TestDefaultStrategy(TestCase): def setUp(self): self.strategy = strategy.Defa...
bsd-3-clause
biothings/biothings_explorer
biothings_explorer/utils/networkx.py
1
4018
# -*- coding: utf-8 -*- """A collection of util functions related to networkx .. moduleauthor:: Jiwen Xin <kevinxin@scripps.edu> """ from collections import defaultdict def load_res_to_networkx(_res, G, labels, id_mapping, output_id_types): """Load restructured API response into a networkx MultiDiGraph. ...
apache-2.0
gdgellatly/server-tools
auth_admin_passkey/model/res_config.py
61
3206
# -*- encoding: utf-8 -*- ############################################################################## # # Admin Passkey module for OpenERP # Copyright (C) 2013-2014 GRAP (http://www.grap.coop) # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # # This program is free software: you can redistrib...
agpl-3.0
blaggacao/OpenUpgrade
addons/board/__init__.py
439
1144
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
gwparikh/cvgui
grouping_calibration.py
2
9402
#!/usr/bin/env python import os, sys, subprocess import argparse import subprocess import threading import timeit from multiprocessing import Queue, Lock from configobj import ConfigObj from numpy import loadtxt from numpy.linalg import inv import matplotlib.pyplot as plt import moving from cvguipy import trajstorage,...
mit
davidvon/pipa-pay-server
site-packages/jinja2/bccache.py
256
12289
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
apache-2.0
julianwang/cinder
cinder/openstack/common/fileutils.py
78
4135
# 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/LICENSE-2.0 # # Unless req...
apache-2.0
beni55/olympia
apps/amo/search.py
18
10622
import logging from django.conf import settings as dj_settings from django_statsd.clients import statsd from elasticsearch import Elasticsearch log = logging.getLogger('z.es') DEFAULT_HOSTS = ['localhost:9200'] DEFAULT_TIMEOUT = 5 DEFAULT_INDEXES = ['default'] DEFAULT_DUMP_CURL = None def get_es(hosts=None, tim...
bsd-3-clause
sankhesh/VTK
Filters/Hybrid/Testing/Python/TestPCA.py
20
8348
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # This example shows how to visualise the variation in shape in a set of objects using # vtkPCAAnalysisFilter. # # We make three ellipsoids by distorting and translating a sphere and ...
bsd-3-clause
svn2github/django
django/conf/locale/sr/formats.py
655
1980
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y.' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y. H:i' YEAR_MONTH_F...
bsd-3-clause
IllusionRom-deprecated/android_platform_external_chromium_org
tools/perf/benchmarks/spaceport.py
23
2422
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs spaceport.io's PerfMarks benchmark.""" import logging import os import sys from telemetry import test from telemetry.core import util from tele...
bsd-3-clause
ntt-sic/cinder
cinder/api/v2/router.py
2
4033
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
apache-2.0
sriprasanna/django-1.3.1
tests/regressiontests/get_or_create_regress/tests.py
88
2540
from django.test import TestCase from models import Author, Publisher class GetOrCreateTests(TestCase): def test_related(self): p = Publisher.objects.create(name="Acme Publishing") # Create a book through the publisher. book, created = p.books.get_or_create(name="The Book of Ed & Fred") ...
bsd-3-clause
kmoocdev/edx-platform
common/lib/xmodule/xmodule/tests/test_word_cloud.py
28
1793
# -*- coding: utf-8 -*- """Test for Word cloud Xmodule functional logic.""" from webob.multidict import MultiDict from xmodule.word_cloud_module import WordCloudDescriptor from . import LogicTest class WordCloudModuleTest(LogicTest): """Logic tests for Word Cloud Xmodule.""" descriptor_class = WordCloudDescr...
agpl-3.0
stu314159/pyNFC
partition_suggestion.py
1
5450
""" partition_suggestion.py purpose: Given Nx, Ny, Nz and a number of processes, suggest a partitioning strategy that would result in more-or-less cube-shaped partitions """ import random from collections import deque def random_partition(factors,n_factors): """ factors = list of prime factors of a number ...
mit
Softmotions/edx-platform
lms/djangoapps/instructor/tests/test_api_email_localization.py
64
3576
# -*- coding: utf-8 -*- """ Unit tests for the localization of emails sent by instructor.api methods. """ from django.core import mail from django.core.urlresolvers import reverse from nose.plugins.attrib import attr from courseware.tests.factories import InstructorFactory from lang_pref import LANGUAGE_KEY from stud...
agpl-3.0
hubertokf/lupsEdgeServer
projects/lupsEdgeServer/EngineRules/setuptools-20.10.1/setuptools/lib2to3_ex.py
907
1998
""" Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. """ from distutils.util import Mixin2to3 as _Mixin2to3 from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package import setuptools class DistutilsRefactorin...
mit
domsooch/mapreduce-python
mapreduce/handlers.py
4
68593
#!/usr/bin/env python # Copyright 2010 Google 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 ...
apache-2.0
josephcslater/scipy
scipy/ndimage/tests/test_regression.py
123
1429
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_array_almost_equal, run_module_suite import scipy.ndimage as ndimage def test_byte_order_median(): """Regression test for #413: median_filter does not handle bytes orders.""" a = np.arange(9,...
bsd-3-clause
UdK-VPT/Open_eQuarter
mole3/stat_corr/rb_present_roofprj1_uvalue_LMFH_by_building_age_lookup.py
2
2352
# coding: utf8 # OeQ autogenerated lookup function for 'U-Values of Roofs as Projection (method 1) in correlation to year of construction, based on the source data of the survey for the "German Building Typology developed by the "Institut für Wohnen und Umwelt", Darmstadt/Germany, 2011-2013' import math import numpy a...
gpl-2.0
Shengliang/mbed
workspace_tools/export/uvision5.py
3
4120
""" mbed SDK Copyright (c) 2016 ARM Limited 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 writing...
apache-2.0
provaleks/o8
addons/base_report_designer/wizard/__init__.py
421
1081
# -*- 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...
agpl-3.0
VladimirFilonov/django-yandex-kassa
setup.py
1
1336
# -*- coding: utf-8 -*- import os from distutils.core import setup from setuptools import find_packages __author__ = 'Alexei Kuzmin' __version__ = "0.9.13" os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-yandex-kassa', version=__version__, packages=find...
mit
rchrd2/markdown-keyval
key_val.py
1
2188
""" KeyValue Extension for Python-Markdown ============================================= A simple example: Apple: Pomaceous fruit of plants of the genus Malus in. Orange: The fruit of an evergreen tree of the genus Citrus. @todo get this to print out in a table """ from __future__ import absolute_import from __futu...
mit
kvesteri/flask-storage
flask_storage/amazon.py
1
9418
from functools import wraps import mimetypes from boto.s3.connection import S3Connection, SubdomainCallingFormat from boto.exception import S3ResponseError, S3CreateError from boto.s3.key import Key from flask import current_app from .base import ( FileNotFoundError, Storage, StorageException, Storag...
mit
kmonsoor/pyglet
contrib/wydget/wydget/widgets/menu.py
29
2966
import sys import xml.sax.saxutils from pyglet.gl import * from pyglet.window import mouse, key from wydget import event, layouts, loadxml from wydget.widgets.frame import Frame from wydget.widgets.label import Label class MenuItem(Label): name = 'menu-item' @event.default('menu-item') def on_element_enter(item...
bsd-3-clause
tomsilver/nupic
tests/unit/nupic/support/custom_configuration_test.py
4
42107
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0
jinnykoo/wuyisj.com
src/oscar/apps/dashboard/catalogue/forms.py
5
16311
from django import forms from django.core import exceptions from django.forms.models import inlineformset_factory from django.utils.translation import ugettext_lazy as _ from treebeard.forms import movenodeform_factory from oscar.core.loading import get_class, get_model from oscar.core.utils import slugify from oscar....
bsd-3-clause
aninternetof/bremen
bremenenv/lib/python3.5/site-packages/pip/_vendor/__init__.py
329
4670
""" pip._vendor is for vendoring dependencies of pip to prevent needing pip to depend on something external. Files inside of pip._vendor should be considered immutable and should only be updated to versions from upstream. """ from __future__ import absolute_import import glob import os.path import sys # Downstream r...
mit
atodorov/dnf
dnf/yum/history.py
9
63071
# Copyright (C) 2009, 2012-2013 Red Hat, Inc. # # 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 2 of the License, or # (at your option) any later version. # # This program is dis...
gpl-2.0
hip-odoo/odoo
addons/bus/models/bus_presence.py
38
2676
# -*- coding: utf-8 -*- import datetime import time from odoo import api, fields, models from odoo import tools from odoo.addons.bus.models.bus import TIMEOUT from odoo.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT DISCONNECTION_TIMER = TIMEOUT + 5 AWAY_TIMER = 1800 # 30 minutes class BusPresence(models.Model):...
agpl-3.0
stackforge/watcher
watcher/notifications/audit.py
2
12071
# -*- encoding: utf-8 -*- # Copyright (c) 2016 b<>com # # Authors: Vincent FRANCOISE <vincent.francoise@b-com.com> # # 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/li...
apache-2.0
rallylee/gem5
src/cpu/minor/MinorCPU.py
12
11679
# Copyright (c) 2012-2014 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
bsd-3-clause
SylvainCecchetto/plugin.video.catchuptvandmore
plugin.video.catchuptvandmore/resources/lib/channels/jp/ntvnews24.py
1
2396
# -*- coding: utf-8 -*- """ Catch-up TV & More Copyright (C) 2018 SylvainCecchetto This file is part of Catch-up TV & More. Catch-up TV & More 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 Foundat...
gpl-2.0
mrjaydee82/SinLessKernel-4.4.4
toolchains/a8483/share/gdb/python/gdb/__init__.py
110
3408
# Copyright (C) 2010-2013 Free Software Foundation, Inc. # 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 progr...
gpl-2.0
xuru/restler
lib/usr/sqlalchemy/dialects/mssql/pyodbc.py
2
9228
# mssql/pyodbc.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Support for MS-SQL via pyodbc. pyodbc is available at: http://pypi.python.or...
mit
seem-sky/kbengine
kbe/src/lib/python/Lib/test/test_generators.py
72
50910
import gc import sys import unittest import weakref from test import support class FinalizationTest(unittest.TestCase): def test_frame_resurrect(self): # A generator frame can be resurrected by a generator's finalization. def gen(): nonlocal frame try: yie...
lgpl-3.0
genedna/containerops
component/python/analysis/memory_profiler/memory_profiler.py
5
42427
"""Profile the memory usage of a Python program""" # .. we'll use this to pass it to the child script .. _CLEAN_GLOBALS = globals().copy() __version__ = '0.47' _CMD_USAGE = "python -m memory_profiler script_file.py" import time import sys import os import pdb import warnings import linecache import inspect import s...
apache-2.0
sdague/home-assistant
homeassistant/components/alarm_control_panel/device_condition.py
9
5397
"""Provide the device automations for Alarm control panel.""" from typing import Dict, List import voluptuous as vol from homeassistant.components.alarm_control_panel.const import ( SUPPORT_ALARM_ARM_AWAY, SUPPORT_ALARM_ARM_CUSTOM_BYPASS, SUPPORT_ALARM_ARM_HOME, SUPPORT_ALARM_ARM_NIGHT, ) from homeass...
apache-2.0
shenqicang/openmc
tests/test_cmfd_jfnk/test_cmfd_jfnk.py
8
2112
#!/usr/bin/env python import os from subprocess import Popen, STDOUT, PIPE, call import filecmp import glob from optparse import OptionParser parser = OptionParser() parser.add_option('--mpi_exec', dest='mpi_exec', default='') parser.add_option('--mpi_np', dest='mpi_np', default='3') parser.add_option('--exe', dest='...
mit
askhl/ase
ase/visualize/vtk/volume.py
14
2387
import numpy as np from vtk import vtkContourFilter, vtkDepthSortPolyData from ase.visualize.vtk.grid import vtkVolumeGrid from ase.visualize.vtk.module import vtkPolyDataModule from ase.visualize.vtk.pipeline import vtkSurfaceSmootherPipeline, \ vtkDepthSortPipeline # --------...
gpl-2.0
keflavich/pyspeckit-obsolete
pyspeckit/spectrum/models/ammonia.py
1
28836
""" ======================================== Ammonia inversion transition TKIN fitter ======================================== Ammonia inversion transition TKIN fitter translated from Erik Rosolowsky's http://svn.ok.ubc.ca/svn/signals/nh3fit/ .. moduleauthor:: Adam Ginsburg <adam.g.ginsburg@gmail.com> Module API ^^^...
mit
Yelp/pootle
tests/import_export/import.py
1
1745
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import os import pytes...
gpl-3.0
jakobj/nest-simulator
pynest/nest/tests/test_urbanczik_synapse.py
14
9912
# -*- coding: utf-8 -*- # # test_urbanczik_synapse.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 2 of the ...
gpl-2.0
skirsdeda/django
tests/test_discovery_sample/doctests.py
471
1245
""" Doctest example from the official Python documentation. https://docs.python.org/3/library/doctest.html """ def factorial(n): """Return the factorial of n, an exact integer >= 0. >>> [factorial(n) for n in range(6)] [1, 1, 2, 6, 24, 120] >>> factorial(30) # doctest: +ELLIPSIS 2652528598121910...
bsd-3-clause
CopeX/odoo
addons/website_twitter/models/twitter_config.py
377
2095
import logging from openerp.osv import fields, osv from openerp.tools.translate import _ _logger = logging.getLogger(__name__) class twitter_config_settings(osv.osv_memory): _inherit = 'website.config.settings' _columns = { 'twitter_api_key': fields.related( 'website_id', 'twitter_a...
agpl-3.0
TriOptima/tri.form
tests/test_compat.py
1
3336
import pytest from tri_struct import merged from tri_form import Field, Form from tri_form.compat import render_to_string, format_html, field_defaults_factory, render_template, Template from .compat import RequestFactory, SafeText def test_render_to_string(): assert render_to_string( template_name='tri_f...
bsd-3-clause
ceb8/astroquery
astroquery/imcce/tests/test_miriade.py
2
4481
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import os import astropy.units as u from ...utils.testing_tools import MockResponse from .. import Miriade, MiriadeClass # files in data/ for different query types def data_path(filename): data_dir = os.path.join(os.path.dirname(__...
bsd-3-clause
TiddlySpace/tiddlywebplugins.jsondispatcher
setup.py
1
1099
AUTHOR = 'Chris Dent' AUTHOR_EMAIL = 'cdent@peermore.com' MAINTAINER = 'Ben Paddock' MAINTAINER_EMAIL = 'pads@thisispads.me.uk' NAME = 'tiddlywebplugins.jsondispatcher' DESCRIPTION = 'A TiddlyWeb plugin to allow the dispatching of tiddlers to non-Python handlers by serialising tiddler data to JSON' VERSION = '0.1.4' i...
bsd-3-clause
yannrouillard/weboob
modules/parolesmania/test.py
4
1700
# -*- coding: utf-8 -*- # Copyright(C) 2013 Julien Veyssier # # 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 op...
agpl-3.0
vdods/fabric
bddtests/devops_pb2.py
46
23887
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: devops.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflec...
apache-2.0
digimarc/django
django/http/__init__.py
98
1186
from django.http.cookie import SimpleCookie, parse_cookie from django.http.request import (HttpRequest, QueryDict, RawPostDataException, UnreadablePostError, build_request_repr) from django.http.response import ( HttpResponse, StreamingHttpResponse, FileResponse, HttpResponseRedirect, HttpResponsePermanentR...
bsd-3-clause
brodyberg/autorest
AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/models/sawshark.py
4
1804
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
bouncestorage/swift
swift/obj/ssync_sender.py
6
16006
# Copyright (c) 2013 OpenStack Foundation # # 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 ...
apache-2.0
maurerpe/FreeCAD
src/Mod/Ship/shipAreasCurve/__init__.py
60
1809
#*************************************************************************** #* * #* Copyright (c) 2011, 2016 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* ...
lgpl-2.1
cctaylor/googleads-python-lib
examples/dfp/v201408/custom_field_service/create_custom_fields.py
4
2145
#!/usr/bin/python # # Copyright 2014 Google 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...
apache-2.0
bdero/edx-platform
cms/djangoapps/contentstore/features/course-export.py
11
2452
# pylint: disable=C0111 # pylint: disable=W0621 # pylint: disable=W0613 from lettuce import world, step from component_settings_editor_helpers import enter_xml_in_advanced_problem from nose.tools import assert_true, assert_equal from opaque_keys.edx.locations import SlashSeparatedCourseKey from contentstore.utils impo...
agpl-3.0
camptocamp/ngo-addons-backport
addons/l10n_es/__init__.py
100
1273
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2007 ACYSOS S.L. (http://acysos.com) All Rights Reserved. # Pedro Tarrafeta (pedro@acysos.com) # Copyright (c) 2008-2010 Zikz...
agpl-3.0
vincentchoqueuse/parametrix
parametrix/bayesian_linear_model/signal_models.py
1
1666
from parametrix.core.signal_models import BaseSignalModel import numpy as np import scipy.linalg as lg from scipy.stats import multivariate_normal class M_Bayesian_L(BaseSignalModel): """ Bayesian Linear Signal Model (Eq 10.26)[KAY93]_ .. math:: \\textbf{y}=\\textbf{H}\\textbf{x}...
bsd-3-clause
vipul-sharma20/oh-mainline
vendor/packages/celery/celery/worker/buckets.py
18
11077
# -*- coding: utf-8 -*- """ celery.worker.buckets ~~~~~~~~~~~~~~~~~~~~~ This module implements the rate limiting of tasks, by having a token bucket queue for each task type. When a task is allowed to be processed it's moved over the the ``ready_queue`` The :mod:`celery.worker.mediator` is ...
agpl-3.0
benfinke/ns_python
build/lib/nssrc/com/citrix/netscaler/nitro/resource/config/lb/lbmonbindings_binding.py
3
3899
# # Copyright (c) 2008-2015 Citrix Systems, Inc. # # 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 l...
apache-2.0
espadrine/opera
chromium/src/tools/grit/grit/tool/postprocess_unittest.py
61
1851
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Unit test that checks postprocessing of files. Tests postprocessing by having the postprocessor modify the grd data tree, ...
bsd-3-clause
milwaukeegdi/milwaukeegdi.github.io
intro/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py
1361
45045
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. r"""Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. Th...
mit
Glf9832/AjkSpider
AjkSpider/spiders/AjkZsSpider.py
1
2002
# -*- coding: utf-8 -*- import scrapy from AjkSpider.items import AjkZsspiderItem class AjkzsspiderSpider(scrapy.Spider): name = "AjkZsSpider" allowed_domains = ["zs.fang.anjuke.com"] start_urls = ['http://zs.fang.anjuke.com/'] def parse(self, response): subSelector = response.xpath('//div[@cl...
gpl-3.0
NightKev/fireplace
fireplace/managers.py
2
7529
from hearthstone.enums import GameTag from . import enums class Manager(object): def __init__(self, obj): self.obj = obj self.observers = [] def __getitem__(self, tag): if self.map.get(tag): return getattr(self.obj, self.map[tag], 0) raise KeyError def __setitem__(self, tag, value): setattr(self.obj...
agpl-3.0
MKuranowski/WarsawGTFS
static/downloader.py
1
11293
from dataclasses import dataclass from datetime import date, datetime, timedelta from operator import itemgetter from typing import Dict, List, Optional, Set, Tuple from pytz import timezone import libarchive.public import logging import ftplib import json import re import os from .const import DIR_DOWNLOAD, DIR_CONVE...
mit
nextgis/nextgisweb
nextgisweb/vector_layer/test/test_source_error.py
1
6886
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function, unicode_literals from uuid import uuid4 import six import pytest from osgeo import ogr from nextgisweb.models import DBSession from nextgisweb.auth import User from nextgisweb.compat import Path from nextgisweb.core.exception im...
gpl-3.0
glogiotatidis/compose
compose/container.py
39
5882
from __future__ import unicode_literals from __future__ import absolute_import import six from functools import reduce from .const import LABEL_CONTAINER_NUMBER, LABEL_SERVICE class Container(object): """ Represents a Docker container, constructed from the output of GET /containers/:id:/json. """ ...
apache-2.0
dsapandora/die_hard
diehard.py
1
1608
#!/usr/bin/env python import roslib; roslib.load_manifest('DroneInteractiveEnviroment') import rospy import json import requests from std_msgs.msg import String from geometry_msgs.msg import Twist from ardrone_autonomy.msg import Navdata class DieHard(object): def __init__(self): self.twist = Twist() ...
gpl-3.0
AndrewPeelMV/Blender2.78c
2.78/scripts/addons/rigify/rigs/pitchipoy/limbs/super_arm.py
2
47129
import bpy, re from ..super_widgets import create_hand_widget from .ui import create_script from .limb_utils import * from mathutils import Vector from ....utils import copy_bone, flip_bone, put_bone, create_cube_widget from ....utils import strip_org, make_deformer_name, cre...
gpl-2.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/werkzeug/script.py
84
11666
# -*- coding: utf-8 -*- r''' werkzeug.script ~~~~~~~~~~~~~~~ .. admonition:: Deprecated Functionality ``werkzeug.script`` is deprecated without replacement functionality. Python's command line support improved greatly with :mod:`argparse` and a bunch of alternative modules. Most ...
bsd-2-clause
r-icarus/openstack_microserver
openstack_dashboard/openstack/common/rpc/zmq_receiver.py
19
1254
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # # 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.apa...
apache-2.0
bmanojlovic/ansible
test/units/module_utils/gcp/test_utils.py
15
1408
#!/usr/bin/env python # -*- coding: utf-8 -*- # (c) 2016, Tom Melendez <tom@supertom.com> # # This file is part of Ansible # # Ansible 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 Li...
gpl-3.0
vFense/vFenseAgent-nix
agent/deps/rpm/Python-2.7.5/lib/python2.7/test/test_md5.py
194
1790
# Testing md5 module import warnings warnings.filterwarnings("ignore", "the md5 module is deprecated.*", DeprecationWarning) import unittest from md5 import md5 from test import test_support def hexstr(s): import string h = string.hexdigits r = '' for c in s: i = ord(c)...
lgpl-3.0
xxxVxxx/troposphere
troposphere/openstack/heat.py
29
1115
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org> # Copyright (c) 2014, Andy Botting <andy.botting@theguardian.com> # All rights reserved. # # See LICENSE file for full license. from troposphere import AWSObject from troposphere.validators import integer # Due to the strange nature of the OpenStack compatability ...
bsd-2-clause
gauthierm/bedrock
tests/functional/firefox/os/test_tv.py
2
1615
# 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 pytest from pages.firefox.os.tv import TVPage @pytest.mark.sanity @pytest.mark.nondestructive def test_next_pr...
mpl-2.0
mitya57/debian-buildbot
buildbot/test/fake/pbmanager.py
2
1843
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
paulscottrobson/fred
__old/Processor/process.py
2
2081
# # Process 1801.def # import re def process(txt,opc): txt = txt.replace("@X","{0:x}".format(opc & 15)) txt = txt.replace("@R","{0}".format(opc & 15)) txt = txt.replace("@F","{0:x}".format((opc & 3)+1)) return txt src = open("1801.def","r").readlines() # read file src = [x if x.find("//") < 0 else x[...
mit
nuncjo/odoo
addons/l10n_mx/__openerp__.py
379
2559
# -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # All Rights Reserved ###############Credits###################################################### # Coded by: Alejandro Negrin anegrin@vauxoo.com, #...
agpl-3.0
caphrim007/ansible
lib/ansible/modules/storage/netapp/na_ontap_net_port.py
6
8182
#!/usr/bin/python # (c) 2018, NetApp, Inc # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0