repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
wanglei828/apollo
modules/tools/navigation/config/navi_config.py
4
5419
#!/usr/bin/env python ############################################################################### # Copyright 2018 The Apollo Authors. 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 ...
apache-2.0
rkarpuzov/Aurumcoin-0.12
qa/rpc-tests/disablewallet.py
27
1156
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Exercise API with -disablewallet. # from test_framework.test_framework import BitcoinTestFramework f...
mit
Bibibiibi/sscc
shadowsocks/ordereddict.py
22
7771
import collections ################################################################################ ### OrderedDict ################################################################################ class OrderedDict(dict): 'Dictionary that remembers insertion order' # An inherited dict maps keys to values. ...
apache-2.0
bigswitch/horizon
openstack_dashboard/test/integration_tests/tests/test_floatingips.py
8
4543
# Copyright 2015 Hewlett-Packard Development Company, L.P # 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....
apache-2.0
hackbuteer59/sakai
reference/library/src/webapp/editor/FCKeditor/editor/filemanager/connectors/py/fckoutput.py
131
4042
#!/usr/bin/env python """ FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2010 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http:...
apache-2.0
Jgarcia-IAS/SITE
addons/product/partner.py
385
1696
# -*- 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...
agpl-3.0
krismcfarlin/gae_endpoints_aloha
bp_includes/external/httplib2/test/functional/test_proxies.py
305
2965
import unittest import errno import os import signal import subprocess import tempfile import nose import httplib2 from httplib2 import socks from httplib2.test import miniserver tinyproxy_cfg = """ User "%(user)s" Port %(port)s Listen 127.0.0.1 PidFile "%(pidfile)s" LogFile "%(logfile)s" MaxClients 2 StartServers 1...
lgpl-3.0
nanolearningllc/edx-platform-cypress-2
lms/djangoapps/class_dashboard/tests/test_views.py
133
4061
""" Tests for class dashboard (Metrics tab in instructor dashboard) """ import json from django.test.client import RequestFactory from mock import patch from nose.plugins.attrib import attr from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestC...
agpl-3.0
PuchatekwSzortach/face_detection
face/models.py
1
3451
""" Module with definitions of prediction models """ import keras import keras.applications def get_pretrained_vgg_model(image_shape): """ Builds a model based on pretrained VGG net :param image_shape: image shape :return: keras model """ expected_image_shape = (64, 64, 3) if image_shap...
mit
balloob/home-assistant
homeassistant/components/tasmota/light.py
2
7489
"""Support for Tasmota lights.""" from hatasmota.light import ( LIGHT_TYPE_COLDWARM, LIGHT_TYPE_NONE, LIGHT_TYPE_RGB, LIGHT_TYPE_RGBCW, LIGHT_TYPE_RGBW, ) from homeassistant.components import light from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFEC...
apache-2.0
meletakis/collato
lib/python2.7/site-packages/django/contrib/localflavor/fr/fr_department.py
109
3687
# -*- coding: utf-8 -*- # See the "Code officiel géographique" on the INSEE website <www.insee.fr>. from __future__ import unicode_literals DEPARTMENT_CHOICES = ( # Metropolitan departments ('01', '01 - Ain'), ('02', '02 - Aisne'), ('03', '03 - Allier'), ('04', '04 - Alpes-de-Haute-Provence'), ...
gpl-2.0
kemalakyol48/python-for-android
python3-alpha/python3-src/Lib/test/test_shutil.py
49
35276
# Copyright (C) 2003 Python Software Foundation import unittest import shutil import tempfile import sys import stat import os import os.path import functools from test import support from test.support import TESTFN from os.path import splitdrive from distutils.spawn import find_executable, spawn from shutil import (_...
apache-2.0
sergecodd/FireFox-OS
B2G/gecko/media/webrtc/trunk/testing/gtest/scripts/upload_gtest.py
1963
2851
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
apache-2.0
SamiHiltunen/invenio-upgrader
invenio_upgrader/logging.py
20
2014
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014 CERN. # # Invenio 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 optio...
gpl-2.0
romain-dartigues/ansible
lib/ansible/modules/network/radware/vdirect_file.py
27
9278
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2017 Radware LTD. # # 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 License, or # (at...
gpl-3.0
JimTheMan/Ngrx-Effect-Chaining-Example
NgrxEffectChaining/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
1417
12751
#!/usr/bin/env python # 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. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os impor...
gpl-3.0
capooti/geonode
geonode/middleware.py
6
1576
from django.conf import settings from django.utils import simplejson as json from geonode.security.enumerations import AUTHENTICATED_USERS, ANONYMOUS_USERS from geonode.utils import ogc_server_settings class PrintProxyMiddleware(object): def process_request(self, request): if request.method == 'POST': ...
gpl-3.0
wd5/jangr
compressor/templatetags/compress.py
3
5680
from django import template from django.core.exceptions import ImproperlyConfigured from compressor.cache import (cache_get, cache_set, get_offline_hexdigest, get_offline_manifest, get_templatetag_cachekey) from compressor.conf import settings from compressor.exceptions import OfflineGene...
bsd-3-clause
piqoni/onadata
onadata/apps/logger/management/commands/import_instances.py
13
2293
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 coding=utf-8 import os from django.contrib.auth.models import User from django.core.management.base import BaseCommand, CommandError from django.utils.translation import ugettext as _, ugettext_lazy from onadata.libs.logger.import_tools import import_instances_from_z...
bsd-2-clause
SavinaRoja/challenges
Rosalind/Text_Mining/PBMD.py
2
5276
#!/usr/bin/env python # -*- coding: utf-8 -*- """PubMed Search Usage: PBMD.py <input> <email> PBMD.py (--help | --version) Arguments: <input> A file containing two lines, author name first, year second. <email> An email address for the submission of requests to Entrez. Options: -h --help ...
unlicense
razrichter/namebench
nb_third_party/dns/name.py
228
21898
# Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
40423139/2017springcd_hw
plugin/liquid_tags/test_audio.py
273
1456
from . import audio import pytest import re @pytest.mark.parametrize('input,expected', [ ('http://foo.bar https://bar.foo', ('http://foo.bar', 'https://bar.foo', None)), ('http://test.foo', ('http://test.foo', None, None)), ('https://test.foo', ('https://test.foo', None, None)), ('http:...
agpl-3.0
h2educ/scikit-learn
sklearn/covariance/outlier_detection.py
208
6917
""" Class for outlier detection. This class provides a framework for outlier detection. It consists in several methods that can be added to a covariance estimator in order to assess the outlying-ness of the observations of a data set. Such a "outlier detector" object is proposed constructed from a robust covariance es...
bsd-3-clause
arnoldlu/lisa
libs/utils/perf_analysis.py
3
6952
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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 # # ...
apache-2.0
gsobczyk/hamster
waflib/extras/pep8.py
56
3476
#! /usr/bin/env python # encoding: utf-8 # # written by Sylvain Rouquette, 2011 ''' Install pep8 module: $ easy_install pep8 or $ pip install pep8 To add the pep8 tool to the waf file: $ ./waf-light --tools=compat15,pep8 or, if you have waf >= 1.6.2 $ ./waf update --files=pep8 Then add this to your wscript: [at]...
gpl-3.0
pLeBlanc93/ArcREST
src/arcrest/manageorg/_oauth2.py
6
4424
from __future__ import absolute_import from __future__ import print_function from .._abstract.abstract import BaseAGOLClass ######################################################################## class oauth2(BaseAGOLClass): """ The root of all OAuth2 resources and operations. """ _url = None _sec...
apache-2.0
ycaihua/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/distlib/compat.py
357
38875
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import sys if sys.version_info[0] < 3: from StringIO import StringIO stri...
lgpl-3.0
BeyondTheClouds/nova
nova/scheduler/ironic_host_manager.py
6
3546
# Copyright (c) 2012 NTT DOCOMO, INC. # Copyright (c) 2011-2014 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.apa...
apache-2.0
benjaminjkraft/django
tests/messages_tests/urls.py
56
2556
from django import forms from django.conf.urls import url from django.contrib import messages from django.contrib.messages.views import SuccessMessageMixin from django.http import HttpResponse, HttpResponseRedirect from django.template import engines from django.template.response import TemplateResponse from django.url...
bsd-3-clause
zploskey/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/hookspec.py
173
11069
""" hook specifications for pytest plugins, invoked from main.py and builtin plugins. """ from _pytest._pluggy import HookspecMarker hookspec = HookspecMarker("pytest") # ------------------------------------------------------------------------- # Initialization hooks called for every plugin # ----------------------...
mpl-2.0
numb3r3/kombu
kombu/tests/utils/test_utils.py
8
10795
from __future__ import absolute_import from __future__ import unicode_literals import pickle import sys from functools import wraps from io import StringIO, BytesIO from kombu import version_info_t from kombu import utils from kombu.utils.text import version_string_as_tuple from kombu.five import string_t from komb...
bsd-3-clause
EvolutionClip/pyload
module/plugins/hooks/Captcha9kw.py
1
10396
# -*- coding: utf-8 -*- from __future__ import with_statement import re from base64 import b64encode from time import sleep from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getURL from module.plugins.Hook import Hook, threaded class Captcha9Kw(Hook): __name__ = "C...
gpl-3.0
robclark/chromium
tools/json_schema_compiler/cpp_type_generator.py
1
11081
# 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. from code import Code from model import PropertyType import any_helper import cpp_util import schema_util import string class CppTypeGenerator(object): ...
bsd-3-clause
carnell69/kuma
vendor/packages/pygments/filter.py
135
2071
# -*- coding: utf-8 -*- """ pygments.filter ~~~~~~~~~~~~~~~ Module that implements the default filter. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ def apply_filters(stream, filters, lexer=None): """ Use this method to app...
mpl-2.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/contrib/auth/tokens.py
103
2667
from datetime import date from django.conf import settings from django.utils import six from django.utils.crypto import constant_time_compare, salted_hmac from django.utils.http import base36_to_int, int_to_base36 class PasswordResetTokenGenerator(object): """ Strategy object used to generate and check token...
mit
RockySteveJobs/python-for-android
python-modules/twisted/twisted/persisted/dirdbm.py
61
10317
# -*- test-case-name: twisted.test.test_dirdbm -*- # # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ DBM-style interface to a directory. Each key is stored as a single file. This is not expected to be very fast or efficient, but it's good for easy debugging. DirDBMs are *not*...
apache-2.0
abhisg/scikit-learn
examples/calibration/plot_compare_calibration.py
241
5008
""" ======================================== Comparison of Calibration of Classifiers ======================================== Well calibrated classifiers are probabilistic classifiers for which the output of the predict_proba method can be directly interpreted as a confidence level. For instance a well calibrated (bi...
bsd-3-clause
kylerbrown/bark
tests/test_datsegment.py
2
2772
import numpy as np from bark.tools import datsegment def test_first_pass1(): amp_stream = [(0, 0), (1, 1), (2, 1), (3, 1), (4, 0), (5, 0), (6, 11), (7, 0)] thresh = 0.5 starts, stops = datsegment.first_pass(amp_stream, thresh) assert starts == [1, 6] assert stops == [4, 7] def ...
gpl-2.0
markgw/jazzparser
bin/documents/latex_tonal_space.py
1
6084
""" Outputs latex code to draw a segment of the Longuet-Higgins tonal space to stdout. Example usage: ./jazzshell latex_tonal_space.py -f n9,n6 -t 9,6 -s 1.5 -p 340x240 >tonalspace.tex produces a huge tonal space on a big page. @note: I have also developed a Latex package called C{tonalspace} for doing all of thi...
gpl-3.0
nschloe/quadpy
src/quadpy/c1/_clenshaw_curtis.py
1
1190
import numpy as np from ..helpers import article from ._helpers import C1Scheme source = article( authors=["J. Waldvogel"], title="Fast Construction of the Fejér and Clenshaw–Curtis Quadrature Rules", journal="BIT Numerical Mathematics", month="mar", year="2006", volume="46", number="1", ...
mit
gwiedeman/eadmachine
source/GUI/panelTwo.py
1
8457
import wx from resource_path import resource_path from EADtoSpreadsheet import EADtoSpreadsheet import xml.etree.cElementTree as ET from EADtoSpreadsheet.func.encoding import strip_non_ascii from threading import Thread from wx.lib.pubsub import pub import sys ##########################################################...
unlicense
nharraud/b2share
invenio/modules/jsonalchemy/validator.py
17
5385
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2014 CERN. # # Invenio 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...
gpl-2.0
40423105/2016fallcadp_hw
course/solvespace.py
39
7420
# http://solvespace.com/ # 為何使用 Solvespace? 自由開源的 Solvespace # 請問您離開學校時, 能隨身攜帶一套 Creo Parametric, Solidworks 或 AutoDesk Inventor 離開嗎? # Solvespace 有那些功能? ''' Solvespace 是一套輕薄短小的電腦輔助 3D 機械參數繪圖套件, 支援簡單外型零件的繪製與組立, 從 2013 年 7 月之後已經採 GPL 模式釋出, 各方用戶可以免費使用. Solvespace 之所以轉為 GPL 並免費釋出原始碼的動機, 相信是在昭告全球面對 3D 印表機普及化時代的到來, 爾後任何人只要...
agpl-3.0
yubinbai/leetcode
src/partitionPainter/partitionPainter.py
2
1388
# You have to paint N boards of length {A0, A1, A2 ... AN-1}. There are K # painters available and you are also given how much time a painter takes # to paint 1 unit of board. You have to get this job done as soon as # possible under the constraints that any painter will only paint # continuous sections of board, say b...
gpl-3.0
AirOne70/android_kernel_asus_grouper
Documentation/target/tcm_mod_builder.py
3119
42754
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
rosihorrorshow/askbot-devel
askbot/tests/page_load_tests.py
1
16809
from django.test import TestCase from django.test import signals from django.template import defaultfilters from django.conf import settings from django.core.urlresolvers import reverse import coffin import coffin.template from askbot import models from askbot.utils.slug import slugify from askbot.deployment import pac...
gpl-3.0
brainelectronics/towerdefense
_build/lib/pyglet/com.py
39
5591
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
bsd-3-clause
CredoReference/edx-platform
common/djangoapps/xblock_django/models.py
22
2342
""" Models. """ from config_models.models import ConfigurationModel from django.db import models from django.utils.translation import ugettext_lazy as _ class XBlockConfiguration(ConfigurationModel): """ XBlock configuration used by both LMS and Studio, and not specific to a particular template. """ ...
agpl-3.0
ssjssh/algorithm
src/ssj/sort/heap_sort.py
1
4341
#!/usr/bin/env python # -*- coding:utf-8 -*- from math import * import copy class Heap(object): """最大二叉堆实现""" def __init__(self, *arg): super(Heap, self).__init__() self.__array = list(arg) self.length = len(arg) self.height = int(log(self.length)) self.__build_heap()...
gpl-2.0
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/nbformat/v1/rwbase.py
31
1479
"""Base classes and function for readers and writers. Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, ...
mit
bcheung92/Paperproject
gem5/configs/common/Simulation.py
8
28526
# Copyright (c) 2012-2013 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 functional...
mit
tscohen/chainer
cupy/cuda/compiler.py
9
3443
import hashlib import os import re import subprocess import sys import tempfile import filelock import six from cupy.cuda import device from cupy.cuda import module def _get_arch(): cc = device.Device().compute_capability return 'sm_%s' % cc class TemporaryDirectory(object): def __enter__(self): ...
mit
jessekl/flixr
venv/lib/python2.7/site-packages/werkzeug/exceptions.py
146
17799
# -*- coding: utf-8 -*- """ werkzeug.exceptions ~~~~~~~~~~~~~~~~~~~ This module implements a number of Python exceptions you can raise from within your views to trigger a standard non-200 response. Usage Example ------------- :: from werkzeug.wrappers import BaseRequest ...
mit
mlperf/training_results_v0.7
NVIDIA/benchmarks/bert/implementations/pytorch/mha.py
1
7152
import torch import torch.nn as nn import torch.nn.functional as F from apex.contrib.multihead_attn import fast_mask_softmax_dropout_func from bmm1 import * from bmm2 import * from padding import * from softmax import * class FastUnpadBertSelfAttention(nn.Module): def __init__(self, config, enable_stream=True, e...
apache-2.0
domenicosolazzo/practice-django
venv/bin/activate_this.py
669
1129
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
mit
stevekuznetsov/ansible
contrib/inventory/mdt_dynamic_inventory.py
52
4540
#!/usr/bin/env python # (c) 2016, Julian Barnett <jbarnett@tableau.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 License, or # (at ...
gpl-3.0
toogad/PooPyLab_Project
PooPyLab/utils/pfd.py
1
9441
# This file is part of PooPyLab. # # PooPyLab is a simulation software for biological wastewater treatment # processes using International Water Association Activated Sludge Models. # # Copyright (C) Kai Zhang # # PooPyLab is free software: you can redistribute it and/or modify # it under the terms of the ...
gpl-3.0
smarkwell/asuswrt-merlin
release/src/router/samba36/lib/testtools/testtools/tests/test_testsuite.py
20
1408
# Copyright (c) 2009 Jonathan M. Lange. See LICENSE for details. """Test ConcurrentTestSuite and related things.""" __metaclass__ = type import datetime import unittest from testtools import ( ConcurrentTestSuite, iterate_tests, TestCase, ) from testtools.matchers import ( Equals, ) from tes...
gpl-2.0
openstack/vitrage
vitrage/datasources/kubernetes/driver.py
1
2671
# Copyright 2018 - Nokia # # 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, sof...
apache-2.0
sergiopasra/django-megaraetc
etc/justcalc.py
1
71790
import math from StringIO import StringIO import pkgutil import numpy from .numeric import mag2flux, sclspect, specpar, signal, dark from .numeric import darknoisesq, readoutnoise, flux2mag, specparline from .numeric import linesignal from .models import PhotometricFilter from .models import SpectralTemplate, VPHSetu...
gpl-3.0
spinlock99/wordio
lib/twilio-php-master/docs/conf.py
4
7385
# -*- coding: utf-8 -*- # # Services_Twilio documentation build configuration file, created by # sphinx-quickstart on Tue Mar 8 04:02:01 2011. # # 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....
gpl-2.0
rvianello/rdkit
rdkit/sping/TK/pidTK.py
1
16537
""" A Tkinter based backend for piddle. Perry A. Stoll Created: February 15, 1999 Requires PIL for rotated string support. Known Problems: - Doesn't handle the interactive commands yet. - PIL based canvas inherits lack of underlining strings from piddlePIL You can find the latest version ...
bsd-3-clause
tjsavage/djangononrel-starter
djangoappengine/boot.py
14
7691
import logging import os import sys PROJECT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) # Overrides for os.environ env_ext = {'DJANGO_SETTINGS_MODULE': 'settings'} def setup_env(): """Configures app engine environment for command-line apps.""" # Try to import the appengine code from the...
bsd-3-clause
CXQERP/ODOOERP
addons/account_payment/report/__init__.py
436
1066
# -*- 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
pforret/python-for-android
python-modules/twisted/twisted/test/test_monkey.py
61
5600
# Copyright (c) 2007 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.monkey}. """ from twisted.trial import unittest from twisted.python.monkey import MonkeyPatcher class TestObj: def __init__(self): self.foo = 'foo value' self.bar = 'bar value' sel...
apache-2.0
bbangert/routes
docs/conf.py
2
5709
# -*- coding: utf-8 -*- # # Routes documentation build configuration file, created by # sphinx-quickstart on Sun Apr 20 19:13:41 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
mit
gptech/ansible
lib/ansible/modules/monitoring/datadog_monitor.py
26
13449
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Sebastian Kornehl <sebastian.kornehl@asideas.de> # # 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 versi...
gpl-3.0
wonder-sk/inasafe
safe/impact_functions/inundation/flood_polygon_population/parameter_definitions.py
10
2338
# coding=utf-8 """InaSAFE Disaster risk tool by Australian Aid - Parameter definition for Flood Vector on Building QGIS IF Contact : ole.moller.nielsen@gmail.com .. note:: 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 ...
gpl-3.0
aitormf/JdeRobot
src/tools/colorTuner_py/gui/GUI.py
5
2606
# # Copyright (C) 1997-2016 JDE Developers Team # # 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...
gpl-3.0
quoclieu/codebrew17-starving
env/lib/python3.5/site-packages/gcloud/bigquery/test_connection.py
15
1715
# Copyright 2015 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 by applicable law or a...
mit
DenisMinich/parabox
parabox/tests/test_behaviour/test_bitmap_collidable/test_bitmap_collidable.py
1
1131
import os import testscenarios from parabox.behaviour import BitmapCollidable class TestBitmapCollidable(testscenarios.TestWithScenarios): def setUp(self): filename = 'temp_bitmap.csv' with open(filename, 'w+') as file: file.write(''.join([ " 0, 0, 0, 0, ...
mit
KayaBaber/Computational-Physics
Assignment_2_nbody_simulator/Pre-GitHub-Versions/phys440_ps2_euler_circular (1).py
1
7117
import math import numpy as np import matplotlib.pyplot as plt from datetime import datetime startTime = datetime.now() def pythag_pos_diff(objPosArray1,objPosArray2): #calculates the pythagorian position difference between two n-dimensional position arrays pythagSum=0 for l in range(len(objPosArray1)...
mit
MrYsLab/python_banyan
python_banyan/performance_comparison/banyan_pub.py
1
1496
""" Copyright (c) 2016-2019 Alan Yorinks All right reserved. Python Banyan is free software; you can redistribute it and/or modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 as published by the Free Software Foundation; either or (at your option) any later version. This library is dist...
agpl-3.0
Foxfanmedium/python_training
OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/chardet/cli/chardetect.py
198
2738
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ from...
apache-2.0
oVirt/vdsm
tests/hostdev_test.py
2
10768
# # Copyright 2014-2020 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 distributed ...
gpl-2.0
Pablo126/SSBW
Tarea1y2/flask_1/flask1/lib/python3.5/site-packages/packaging/specifiers.py
1107
28025
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import functools import itertools import re from ._compat impo...
gpl-3.0
two9seven/geopy
geopy/geocoders/baidu.py
13
6565
""" :class:`.Baidu` is the Baidu Maps geocoder. """ from geopy.compat import urlencode from geopy.geocoders.base import Geocoder, DEFAULT_TIMEOUT from geopy.exc import ( GeocoderQueryError, GeocoderQuotaExceeded, GeocoderAuthenticationFailure, ) from geopy.location import Location from geopy.util import lo...
mit
Dziolas/inspire-next
inspire/base/mixer/knowledge.py
1
1312
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014, 2015 CERN. # # INSPIRE 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...
gpl-2.0
piotroxp/scibibscan
scib/lib/python3.5/site-packages/astropy/io/fits/tests/util.py
1
1497
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test utility functions.""" import functools import warnings from ....tests.helper import catch_warnings class ignore_warnings(catch_warnings): """ This can be used either as a context manager or function decorator to ignore all warnings ...
mit
laurimyllari/xbmc
lib/libUPnP/Neptune/Extras/Scripts/CodeScanner.py
264
4286
#! /usr/bin/python import os import os.path import re import sys ErrorPattern = re.compile('([A-Z]{3}_ERROR_[A-Z_0-9]+)\s+=?\s*\(?([A-Z_0-9-][A-Z_0-9-+ ]+[A-Z_0-9])') LoggerPattern = re.compile('NPT_SET_LOCAL_LOGGER\s*\([ "]*(\S+)[ "]*\)') NakedErrorPattern = re.compile('return.*[ \(]..._FAILURE') FilePatternH = re.c...
gpl-2.0
cth103/ardour-cth103
tools/bug_tool/ClientCookie/_MSIECookieJar.py
11
14110
"""Mozilla / Netscape cookie loading / saving. Copyright 1997-1999 Gisle Aas (libwww-perl) Copyright 2002-2003 Johnny Lee <typo_pl@hotmail.com> (MSIE Perl code) Copyright 2002-2003 John J Lee <jjl@pobox.com> (The Python port) This code is free software; you can redistribute it and/or modify it under the terms of the ...
gpl-2.0
yrizk/django-blog
blogvenv/lib/python3.4/site-packages/django/db/backends/sqlite3/introspection.py
13
10883
import re from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$') def get_field_size(name): """ Extract the size number from a "varchar(11)" type name """ m = field_size_re.search(name) ...
apache-2.0
espadrine/opera
chromium/src/third_party/scons-2.0.1/engine/SCons/Tool/sgilink.py
61
2219
"""SCons.Tool.sgilink Tool-specific initialization for the SGI MIPSPro linker on SGI. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2...
bsd-3-clause
mdietrichc2c/OCB
addons/l10n_br/__init__.py
430
1403
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # # ...
agpl-3.0
nju520/django
tests/model_fields/tests.py
68
38433
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import unittest from decimal import Decimal from django import forms, test from django.apps import apps from django.core import checks, validators from django.core.exceptions import ValidationError from django.db import IntegrityError, co...
bsd-3-clause
ResolveWang/algrithm_qa
basic_algrithms/sort_algrithms/shellsort.py
1
1054
""" shell排序 """ from basic_algrithms.sort_algrithms.benchmark import Comparator class ShellSort: @classmethod def shell_sort(cls, arr): if len(arr) < 1: return arr arr_len = len(arr) gap = arr_len // 2 while gap > 0: for i in range(gap, arr_len): ...
mit
suutari/shoop
shuup_tests/core/test_order_customer_name.py
1
2028
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import pytest from shuup.testing.factories import ( create_emp...
agpl-3.0
nhr/origin
vendor/github.com/google/certificate-transparency/python/ct/cert_analysis/algorithm.py
23
4326
import calendar import time from ct.crypto import cert from ct.crypto.asn1 import oid from ct.cert_analysis.observation import Observation class AlgorithmObservation(Observation): def __init__(self, description, *args, **kwargs): super(AlgorithmObservation, self).__init__( "Signature algor...
apache-2.0
dfalt974/SickRage
lib/hachoir_core/field/bit_field.py
95
1777
""" Bit sized classes: - Bit: Single bit, value is False or True ; - Bits: Integer with a size in bits ; - RawBits: unknown content with a size in bits. """ from hachoir_core.field import Field from hachoir_core.i18n import _ from hachoir_core import config class RawBits(Field): """ Unknown content with a siz...
gpl-3.0
loli/sklearn-ensembletrees
sklearn/decomposition/tests/test_factor_analysis.py
20
3128
# Author: Christian Osendorfer <osendorf@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Licence: BSD3 import numpy as np from sklearn.utils.testing import assert_warns from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_greater from sklearn.utils.testing im...
bsd-3-clause
cauchycui/scikit-learn
sklearn/preprocessing/__init__.py
31
1235
""" The :mod:`sklearn.preprocessing` module includes scaling, centering, normalization, binarization and imputation methods. """ from .data import Binarizer from .data import KernelCenterer from .data import MinMaxScaler from .data import MaxAbsScaler from .data import Normalizer from .data import RobustScaler from .d...
bsd-3-clause
bjwbell/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py
499
1854
# Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
mpl-2.0
bsavelev/django-userena
userena/contrib/umessages/tests/test_forms.py
9
1688
#encoding:utf-8 from __future__ import unicode_literals from django.test import TestCase from userena.contrib.umessages.forms import ComposeForm from userena.utils import get_user_model class ComposeFormTests(TestCase): """ Test the compose form. """ fixtures = ['users'] def test_invalid_data(self): ...
bsd-3-clause
drbild/boto
tests/integration/ec2containerservice/test_ec2containerservice.py
99
1749
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
woobe/h2o
py/testdir_single_jvm/test_GBMGrid_basic_class.py
1
3199
import unittest, time, sys sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_glm, h2o_hosts, h2o_import as h2i, h2o_jobs, h2o_gbm DO_CLASSIFICATION = True class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): global lo...
apache-2.0
hmcmooc/muddx-platform
lms/djangoapps/courseware/features/gst.py
56
2414
from lettuce import world, steps from nose.tools import assert_in, assert_equals, assert_true from common import i_am_registered_for_the_course, visit_scenario_item from problems_setup import add_problem_to_course, answer_problem DEFAULT_DATA = """\ <render> <p>Test of the graphical slider tool</p> <div cla...
agpl-3.0
egoitzro/poedit
deps/boost/libs/python/test/calling_conventions.py
44
1638
# Copyright Nicolas Lelong, 2010. Distributed under the Boost # Software License, Version 1.0 (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) """ >>> from calling_conventions_ext import * >>> f_0__cdecl() 17041 >>> f_1__cdecl(1) 1 >>> f_2__cdecl(1, 2) 21 >>> f_3__cdecl(1, 2,...
mit
merantix/picasso
picasso/examples/keras-vgg16/model.py
1
2147
############################################################################### # Copyright (c) 2017 Merantix GmbH # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http:...
epl-1.0
qpython-android/QPYPI
docs/2x/scripts/consolesnake.py
1
2697
# -*- coding: UTF-8 -*- __doc__ = """ Draw a controllable snake on the console @Version: 0.1 @Author: LinYuChen """ import platform import time import os from threading import Thread class Screen(object): WIDTH = 30 HEIGHT = 20 screen = [] hit = "input (w | s | a | d) the...
apache-2.0
metamer/ion
website/migrations/0002_auto_20181110_1327.py
1
1153
# Generated by Django 2.1.2 on 2018-11-10 18:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('website', '0001_squashed_0027_auto_20181110_1235'), ] operations = [ migrations.AlterField( model_name='pagecategory', ...
gpl-3.0