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
shlee322/opencampus
opencampus/endpoint/developer/console/login.py
2
2899
# -*- coding: utf-8 -*- # Copyright (C) 2015 opencampus.kr # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
agpl-3.0
suhe/odoo
openerp/addons/base/__openerp__.py
18
2781
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Base', 'version': '1.3', 'category': 'Hidden', 'description': """ The kernel of OpenERP, needed for all installation. =================================================== """, 'website': 'h...
gpl-3.0
SnappleCap/oh-mainline
vendor/packages/sphinx/sphinx/websupport/storage/sqlalchemy_db.py
16
7477
# -*- coding: utf-8 -*- """ sphinx.websupport.storage.sqlalchemy_db ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SQLAlchemy table and mapper definitions used by the :class:`sphinx.websupport.storage.sqlalchemystorage.SQLAlchemyStorage`. :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. ...
agpl-3.0
emlid/ardupilot
Tools/LogAnalyzer/tests/TestMotorBalance.py
215
2265
from LogAnalyzer import Test,TestResult import DataflashLog class TestBalanceTwist(Test): '''test for badly unbalanced copter, including yaw twist''' def __init__(self): Test.__init__(self) self.name = "Motor Balance" def run(self, logdata, verbose): self.result = TestResult() ...
gpl-3.0
john-parton/django-oscar
tests/functional/stock_alert_tests.py
46
2937
from decimal import Decimal as D from django.test import TestCase from oscar.apps.partner.models import StockAlert from oscar.test.basket import add_product from oscar.test import factories from tests._site.apps.partner.models import StockRecord class TestPlacingAnOrder(TestCase): def setUp(self): sel...
bsd-3-clause
blazek/QGIS
tests/src/python/test_qgsmargins.py
45
4148
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsMargins. .. 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __auth...
gpl-2.0
szbesting/backup
software/rt-thread/components/external/freetype/src/tools/cordic.py
401
1588
# compute arctangent table for CORDIC computations in fttrigon.c import sys, math #units = 64*65536.0 # don't change !! units = 256 scale = units/math.pi shrink = 1.0 comma = "" def calc_val( x ): global units, shrink angle = math.atan(x) shrink = shrink * math.cos(angle) return angle/math.pi *...
gpl-2.0
DailyActie/Surrogate-Model
surrogate/selection/selRoulette.py
1
2509
# MIT License # # Copyright (c) 2016 Daily Actie # # 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 # to use, copy, modify, merge, ...
mit
YavorIvanov/javascript-paginator
node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
1534
3426
# 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. import collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
mit
yongshengwang/hue
desktop/core/ext-py/pycrypto-2.6.1/build/lib.linux-x86_64-2.7/Crypto/SelfTest/Cipher/test_pkcs1_15.py
118
7342
# -*- coding: utf-8 -*- # # SelfTest/Cipher/test_pkcs1_15.py: Self-test for PKCS#1 v1.5 encryption # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone i...
apache-2.0
joshbohde/scikit-learn
sklearn/svm/tests/test_sparse.py
2
6699
import numpy as np import scipy.sparse from sklearn import datasets, svm, linear_model from numpy.testing import assert_array_almost_equal, \ assert_array_equal, assert_equal from nose.tools import assert_raises from sklearn.datasets.samples_generator import make_classification from . import test_svm # test samp...
bsd-3-clause
ukanga/SickRage
lib/hachoir_core/field/vector.py
95
1356
from hachoir_core.field import Field, FieldSet, ParserError class GenericVector(FieldSet): def __init__(self, parent, name, nb_items, item_class, item_name="item", description=None): # Sanity checks assert issubclass(item_class, Field) assert isinstance(item_class.static_size, (int, long)) ...
gpl-3.0
wemanuel/smry
smry/Crypto/SelfTest/Protocol/test_rfc1751.py
132
2208
# # Test script for Crypto.Util.RFC1751. # # Part of the Python Cryptography Toolkit # # Written by Andrew Kuchling and others # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is ...
apache-2.0
jasondunsmore/heat
heat/tests/aws/test_user.py
3
17196
# # 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, software # ...
apache-2.0
luofei98/qgis
python/plugins/processing/algs/otb/OTBAlgorithmProvider.py
2
3958
# -*- coding: utf-8 -*- """ *************************************************************************** OTBAlgorithmProvider.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya (C) 2013 by CS Systemes d'information E...
gpl-2.0
Edraak/circleci-edx-platform
cms/djangoapps/contentstore/views/tests/test_library.py
114
9392
""" Unit tests for contentstore.views.library More important high-level tests are in contentstore/tests/test_libraries.py """ from contentstore.tests.utils import AjaxEnabledTestClient, parse_json from contentstore.utils import reverse_course_url, reverse_library_url from contentstore.views.component import get_compon...
agpl-3.0
M8s-dev/kernel_htc_msm8939
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
rmk135/objects
examples/miniapps/factory-patterns/chained_factories.py
2
1448
"""`Chained Factories` pattern.""" from dependency_injector import containers, providers class SqlAlchemyDatabaseService: def __init__(self, session, base_class): self.session = session self.base_class = base_class class TokensService: def __init__(self, id_generator, database): s...
bsd-3-clause
eneldoserrata/marcos_openerp
openerp/tools/pdf_utils.py
456
3659
# -*- 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...
agpl-3.0
Jusedawg/SickRage
lib/rtorrent/tracker.py
173
5212
# Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com> # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, ...
gpl-3.0
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/sphinx/ext/refcounting.py
5
3193
# -*- coding: utf-8 -*- """ sphinx.ext.refcounting ~~~~~~~~~~~~~~~~~~~~~~ Supports reference count annotations for C API functions. Based on refcount.py and anno-api.py in the old Python documentation tools. Usage: Set the `refcount_file` config value to the path to the reference count data f...
agpl-3.0
anbangr/trusted-nova
nova/tests/test_db_api.py
3
35339
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 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 # not use this file except in compli...
apache-2.0
accraze/bitcoin
qa/pull-tester/rpc-tests.py
1
8302
#!/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. """ Run Regression Test Suite This module calls down into individual test cases via subprocess. It will ...
mit
isyippee/nova
nova/tests/unit/objects/test_compute_node.py
1
25221
# Copyright 2013 IBM Corp. # # 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 agree...
apache-2.0
PaulStoffregen/Arduino-1.6.5r4-Teensyduino
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/__init__.py
309
1692
# urllib3/__init__.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (a...
lgpl-2.1
josephsuh/extra-specs
nova/tests/test_volume_types.py
2
7507
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 Zadara Storage Inc. # Copyright (c) 2011 OpenStack LLC. # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ht...
apache-2.0
joshbruning/selenium
py/test/selenium/webdriver/common/webserver.py
24
5153
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
heeraj123/oh-mainline
vendor/packages/Django/django/contrib/localflavor/jp/forms.py
194
1257
""" JP-specific Form helpers """ from __future__ import absolute_import from django.contrib.localflavor.jp.jp_prefectures import JP_PREFECTURES from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ class JPPostalCodeField(RegexField): """ A form field tha...
agpl-3.0
aroth-arsoft/arsoft-web-crashupload
app/crashdump/utils.py
1
24246
#!/usr/bin/python # -*- coding: utf-8 -*- # kate: space-indent on; indent-width 4; mixedindent off; indent-mode python; crashdump_use_jinja2 = False def _(msg): return msg def tag_a(name, title=None, href=None, alt=None): from xml.etree.ElementTree import Element, tostring a = Element('a') a.text = n...
gpl-3.0
mach0/QGIS
python/plugins/grassprovider/ext/r_li_shannon.py
45
1296
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_shannon.py ---------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ***************************...
gpl-2.0
zubair-arbi/edx-platform
common/djangoapps/student/management/tests/test_transfer_students.py
122
6240
""" Tests the transfer student management command """ from django.conf import settings from mock import patch, call from opaque_keys.edx import locator import unittest import ddt from shoppingcart.models import Order, CertificateItem # pylint: disable=import-error from course_modes.models import CourseMode from stude...
agpl-3.0
40223117cda/2015_w11
static/Brython3.1.0-20150301-090019/Lib/jqueryui/__init__.py
603
3671
"""Wrapper around the jQuery UI library Exposes a single object, jq, to manipulate the widgets designed in the library This object supports : - subscription : js[elt_id] returns an object matching the element with the specified id - a method get(**kw). The only keyword currently supported is "selector". The metho...
gpl-3.0
libicocco/poser-hand-generator
createGraspICRA09.py
1
3429
# creatGraspICRA09.py - script for creating a hand poses database # # Copyright (c) 2009 Javier Romero # # Author: Javier Romero <jrgn@kth.se> # # 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 Found...
gpl-2.0
greenoaktree/MissionPlanner
Lib/site-packages/numpy/lib/benchmarks/bench_arraysetops.py
65
1615
import numpy as np import time from numpy.lib.arraysetops import * def bench_unique1d( plot_results = False ): exponents = np.linspace( 2, 7, 9 ) ratios = [] nItems = [] dt1s = [] dt2s = [] for ii in exponents: nItem = 10 ** ii print 'using %d items:' % nItem a = np.fix...
gpl-3.0
paulfitz/phantomjs
src/breakpad/src/tools/gyp/test/variables/gyptest-commands-repeated.py
138
1476
#!/usr/bin/env python # Copyright (c) 2009 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. """ Test variable expansion of '<!()' syntax commands where they are evaluated more then once.. """ import os import TestGyp test = TestG...
bsd-3-clause
greguu/linux-4.9-rc3-c3x00
scripts/gdb/linux/dmesg.py
249
2059
# # gdb helper commands and functions for Linux kernel debugging # # kernel log buffer dump # # Copyright (c) Siemens AG, 2011, 2012 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import utils class LxDmesg(gdb.Command...
gpl-2.0
EasyPost/easypost-python
tests/test_pickup.py
1
4491
# Unit tests related to 'Pickups' (https://www.easypost.com/docs/api#pickups). import time import datetime import easypost import pytest import pytz ONE_DAY = datetime.timedelta(days=1) @pytest.fixture def noon_on_next_monday(): today = datetime.date.today() next_monday = today + datetime.timedelta(days=(7 ...
mit
evansd/django
tests/many_to_one/tests.py
15
30584
import datetime from copy import deepcopy from django.core.exceptions import FieldError, MultipleObjectsReturned from django.db import models, transaction from django.db.utils import IntegrityError from django.test import TestCase from django.utils.translation import gettext_lazy from .models import ( Article, Ca...
bsd-3-clause
babbage/zulip
zerver/management/commands/create_stream.py
115
1107
from __future__ import absolute_import from django.core.management.base import BaseCommand from zerver.lib.actions import do_create_stream from zerver.models import Realm, get_realm import sys class Command(BaseCommand): help = """Create a stream, and subscribe all active users (excluding bots). This should be...
apache-2.0
unicornis/suds-uis
tests/__init__.py
6
9890
# -*- coding: utf-8 -*- # This program is free software; you can redistribute it and/or modify it under # the terms of the (LGPL) GNU Lesser General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # This program is distributed i...
lgpl-3.0
HaoZeke/kernel
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
mahak/spark
python/pyspark/streaming/kinesis.py
23
5436
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
sunlianqiang/kbengine
kbe/res/scripts/common/Lib/asyncore.py
77
20998
# -*- Mode: Python -*- # Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp # Author: Sam Rushing <rushing@nightmare.com> # ====================================================================== # Copyright 1996 by Sam Rushing # # All Rights Reserved # # Permission to use, copy, modify,...
lgpl-3.0
stympy/ansible-modules-extras
cloud/amazon/ec2_vol_facts.py
67
4071
#!/usr/bin/python # # This is a 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 Ansible library is distributed in the hope that i...
gpl-3.0
tejaswi2492/pmip6ns3.13new
src/wimax/bindings/callbacks_list.py
149
1064
callback_classes = [ ['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ptr<ns3::PacketBurst const>', 'ns3::empty', 'ns3::empty', 'ns3::empty',...
gpl-2.0
Belxjander/Kirito
Python-3.5.0-Amiga/Lib/test/test_dummy_thread.py
123
7157
"""Generic thread tests. Meant to be used by dummy_thread and thread. To allow for different modules to be used, test_main() can be called with the module to use as the thread implementation as its sole argument. """ import _dummy_thread as _thread import time import queue import random import unittest from test imp...
gpl-3.0
evaschalde/odoo
addons/account/report/__init__.py
381
1513
# -*- 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
Mozta/pagina-diagnostijuego
venv/lib/python2.7/site-packages/django/core/files/move.py
554
2794
""" Move a file in the safest way possible:: >>> from django.core.files.move import file_move_safe >>> file_move_safe("/tmp/old_file", "/tmp/new_file") """ import os from shutil import copystat from django.core.files import locks __all__ = ['file_move_safe'] def _samefile(src, dst): # Macintosh, Unix....
gpl-3.0
stacycoin/stacycoin
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
burnash/skype4py
Skype4Py/lang/ru.py
23
19299
apiAttachAvailable = u'\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0418\u041f\u041f' apiAttachNotAvailable = u'\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d' apiAttachPendingAuthorization = u'\u041e\u0436\u...
bsd-3-clause
yencarnacion/jaikuengine
.google_appengine/google/appengine/ext/appstats/sample_appengine_config.py
13
9468
#!/usr/bin/env python # # Copyright 2007 Google 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 law o...
apache-2.0
ryfeus/lambda-packs
Keras_tensorflow_nightly/source2.7/tensorflow/contrib/boosted_trees/python/ops/prediction_ops.py
23
1185
# Copyright 2017 The TensorFlow 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 of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
mit
VasuAgrawal/tartanHacks2015
site/flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py
2919
3678
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
DavidLP/home-assistant
homeassistant/components/sisyphus/media_player.py
6
5531
"""Support for track controls on the Sisyphus Kinetic Art Table.""" import logging from homeassistant.components.media_player import MediaPlayerDevice from homeassistant.components.media_player.const import ( SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PLAY, SUPPORT_PREVIOUS_TRACK, SUPPORT_SHUFFLE_SET, SUPPORT_...
apache-2.0
RKD314/yumstat
simple/oauth2client/util.py
174
5670
#!/usr/bin/env python # # Copyright 2010 Google 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 law o...
mit
graetzer/arangodb
3rdParty/V8/v5.7.0.0/tools/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py
242
1463
#!/usr/bin/env python # Copyright (c) 2013 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. """ Test that the generator output can be written to a different drive on Windows. """ import os import TestGyp import string import subpro...
apache-2.0
marcel-dancak/QGIS
python/plugins/processing/algs/qgis/DeleteDuplicateGeometries.py
7
6137
# -*- coding: utf-8 -*- """ *************************************************************************** DeleteDuplicateGeometries.py --------------------- Date : May 2010 Copyright : (C) 2010 by Michael Minn Email : pyqgis at michaelminn dot com ***********...
gpl-2.0
huguesv/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/cffi/pkgconfig.py
14
4374
# pkg-config, https://www.freedesktop.org/wiki/Software/pkg-config/ integration for cffi import sys, os, subprocess from .error import PkgConfigError def merge_flags(cfg1, cfg2): """Merge values from cffi config flags cfg2 to cf1 Example: merge_flags({"libraries": ["one"]}, {"libraries": ["two"]}) ...
apache-2.0
mdworks2016/work_development
Python/20_Third_Certification/venv/lib/python3.7/site-packages/django/db/backends/dummy/base.py
125
2244
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raise ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends.base.base import BaseDatabase...
apache-2.0
Data-Mechanics/dml
dml/dml.py
1
7488
############################################################################### ## ## dml.py ## ## Python library providing common functionalities for building Data ## Mechanics platform components. ## ## Web: datamechanics.org ## Version: 0.0.16.0 ## ## import sys # To parse command line arguments. i...
mit
nikhilprathapani/python-for-android
python3-alpha/python3-src/Lib/re.py
45
14082
# # Secret Labs' Regular Expression Engine # # re-compatible interface for the sre matching engine # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # This version of the SRE library can be redistributed under CNRI's # Python 1.6 license. For any other use, please contact Secret Labs # AB (info@py...
apache-2.0
zhjunlang/kbengine
kbe/res/scripts/common/Lib/lib2to3/tests/data/py3_test_grammar.py
266
30362
# Python test set -- part 1, grammar. # This just tests whether the parser accepts them all. # NOTE: When you run this test as a script from the command line, you # get warnings about certain hex/oct constants. Since those are # issued by the parser, you can't suppress them by adding a # filterwarnings() call to this...
lgpl-3.0
madongfly/grpc
src/python/grpcio/grpc/framework/common/__init__.py
1496
1530
# Copyright 2015, 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...
bsd-3-clause
HuimingCheng/AutoGrading
sample/autoUpload.py
2
2901
# coding=utf-8 import requests import os import time import platform import atexit # global variable for exit function global FILENUMBER # print the number of files uplaod in this time, and give a reminder for user that the # the file will be deleted after Monday before exit the script. '''把时间戳转化为时间: 1479264792 t...
mit
DirectlineDev/django-robokassa-merchant
robokassa_merchant/conf.py
1
1761
# -*- coding: utf-8 -*- from django.conf import settings class Conf: """ Класс конфигурации для робокассы, берёт настройки из settings.ROBOKASSA_CONF """ # todo: в большинстве случаев 1 магазин на 1 сайт - сделать необязательным параметр token # обязательные параметры - реквизиты магазина LOGIN ...
mit
alexlo03/ansible
lib/ansible/modules/clustering/consul_session.py
58
8927
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Steve Gargan <steve.gargan@gmail.com> # 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_versi...
gpl-3.0
dekkyy1/onex_3.1.10_kernel
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
XiaJieCom/change
stu103151/days22/project/bbs/comment_hander.py
5
1628
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Alex Li def add_node(tree_dic,comment): if comment.parent_comment is None: #如果我是顶层,那我放在这 tree_dic[comment] ={} else: #循环当前整个dict,直到找到为止 for k,v in tree_dic.items(): if k == comment.parent_comment: #找到了你爸 ...
lgpl-2.1
jeffmacinnes/pyneal
pyneal_scanner/utils/Siemens_utils.py
1
30222
""" Set of classes and methods specific to Siemens scanning environments """ from __future__ import print_function from __future__ import division import os from os.path import join import sys import time import re import json import glob import logging from threading import Thread from queue import Queue import num...
mit
jgoppert/px4_ros
integrationtests/python_src/px4_it/util/manual_input.py
10
5846
#!/usr/bin/env python #*************************************************************************** # # Copyright (c) 2015 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # ...
bsd-3-clause
ccnmtl/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/templates/filters.py
54
29875
# coding: utf-8 """ Tests for template filters (as opposed to template tags). The tests are hidden inside a function so that things like timestamps and timezones are only evaluated at the moment of execution and will therefore be consistent. """ from datetime import date, datetime, timedelta from django.utils.tzinfo...
gpl-3.0
xujun10110/weevely3
modules/net/ifconfig.py
16
2345
from core.vectors import PhpCode, ShellCmd, ModuleExec, Os from core.module import Module from core import modules from core import messages from core.loggers import log from utils.ipaddr import IPNetwork import re class Ifconfig(Module): """Get network interfaces addresses.""" aliases = [ 'ifconfig' ] ...
gpl-3.0
s20121035/rk3288_android5.1_repo
external/chromium_org/tools/telemetry/telemetry/core/gpu_device_unittest.py
33
1491
# Copyright 2013 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. import unittest from telemetry.core import gpu_device class TestGPUDevice(unittest.TestCase): def testConstruction(self): device = gpu_device.GPUDevi...
gpl-3.0
newsteinking/docker
pip/_vendor/html5lib/filters/inject_meta_charset.py
1730
2746
from __future__ import absolute_import, division, unicode_literals from . import _base class Filter(_base.Filter): def __init__(self, source, encoding): _base.Filter.__init__(self, source) self.encoding = encoding def __iter__(self): state = "pre_head" meta_found = (self.enco...
mit
KDB2/OpenReliability
veusz/document/selftest_export.py
6
2368
# Copyright (C) 2010 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # 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 # ...
gpl-2.0
KarimAllah/nova
nova/tests/api/openstack/compute/contrib/test_security_groups.py
2
40540
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
apache-2.0
sffjunkie/home-assistant
homeassistant/components/alarm_control_panel/alarmdotcom.py
12
3911
""" Interfaces with Alarm.com alarm control panels. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/alarm_control_panel.alarmdotcom/ """ import logging import homeassistant.components.alarm_control_panel as alarm from homeassistant.const import ( CON...
mit
djo938/supershell
pyshell/register/profile/test/internal_test.py
3
2799
#!/usr/bin/env python -t # -*- coding: utf-8 -*- # Copyright (C) 2016 Jonathan Delvaux <pyshell@djoproject.net> # 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...
gpl-3.0
jendap/tensorflow
tensorflow/contrib/distributions/python/ops/bijectors/affine.py
21
14980
# Copyright 2016 The TensorFlow 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 of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
pepetreshere/odoo
addons/website_slides/tests/test_ui_wslides.py
4
6887
# Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 from dateutil.relativedelta import relativedelta from odoo import tests from odoo.fields import Datetime from odoo.modules.module import get_module_resource from odoo.addons.base.tests.common import HttpCaseWithUserDemo, HttpCase...
agpl-3.0
OAkyildiz/walrus
prototyping/thigh_teleop/scripts/teleop.py
2
2326
#!/usr/bin/env python import rospy from std_msgs.msg import UInt16 from sensor_msgs.msg import Joy import math from operator import add def joystick_callback(data): print data global last_update global front_left_pub global front_right_pub global back_left_pub global bac...
bsd-3-clause
Jgarcia-IAS/SITE
addons/account/wizard/account_reconcile.py
226
7567
# -*- 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
drjeep/django
django/utils/text.py
308
14923
from __future__ import unicode_literals import re import unicodedata from gzip import GzipFile from io import BytesIO from django.utils import six from django.utils.encoding import force_text from django.utils.functional import SimpleLazyObject, allow_lazy from django.utils.safestring import SafeText, mark_safe from ...
bsd-3-clause
bohlian/erpnext
erpnext/projects/utils.py
44
1067
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe @frappe.whitelist() def query_task(doctype, txt, searchfield, start, page_len, filters...
gpl-3.0
Kazade/NeHe-Website
google_appengine/lib/yaml-3.10/yaml/loader.py
671
1132
__all__ = ['BaseLoader', 'SafeLoader', 'Loader'] from reader import * from scanner import * from parser import * from composer import * from constructor import * from resolver import * class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): def __init__(self, stream): Reader....
bsd-3-clause
Tesora/tesora-tempest
tempest/lib/services/compute/base_compute_client.py
7
3831
# Copyright 2015 NEC Corporation. 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
AltSchool/django
tests/forms_tests/widget_tests/test_nullbooleanselect.py
179
2142
from django.forms import NullBooleanSelect from django.test import override_settings from django.utils import translation from .base import WidgetTest class NullBooleanSelectTest(WidgetTest): widget = NullBooleanSelect() def test_render_true(self): self.check_html(self.widget, 'is_cool', True, html=...
bsd-3-clause
rnelson/adventofcode
advent2015/day08.py
1
2659
#!/usr/bin/env python """ http://adventofcode.com/day/8 Part 1 ------ Space on the sleigh is limited this year, and so Santa will be bringing his list as a digital copy. He needs to know how much space it will take up when stored. It is common in many programming languages to provide a way to escape special character...
mit
bfollinprm/Nquintessence
cosmoslik/cosmoslik_plugins/likelihoods/wmap/wmap.py
1
2594
from numpy import zeros from cosmoslik import Likelihood, SubprocessExtension import os class wmap(Likelihood): """ =============== WMAP Likelihood =============== - Written by WMAP team (see `<http://lambda.gsfc.nasa.gov/>`_) - CosmoSlik module by Marius Millea - Updated July 1, 2012 ...
mit
xxsergzzxx/python-for-android
python3-alpha/python3-src/Lib/test/test_unpack_ex.py
183
4137
# Tests for extended unpacking, starred expressions. doctests = """ Unpack tuple >>> t = (1, 2, 3) >>> a, *b, c = t >>> a == 1 and b == [2] and c == 3 True Unpack list >>> l = [4, 5, 6] >>> a, *b = l >>> a == 4 and b == [5, 6] True Unpack implied tuple >>> *a, = 7, 8, 9 >>...
apache-2.0
RIPE-NCC/ripe-atlas-tools
ripe/atlas/tools/renderers/http.py
4
2303
# Copyright (c) 2016 RIPE NCC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the h...
gpl-3.0
kasioumis/invenio
invenio/modules/messages/upgrades/messages_2014_08_25_initial.py
17
1455
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 later...
gpl-2.0
Ever-Never/androguard
elsim/tests/androapptodb.py
35
2920
#!/usr/bin/env python # This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard 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,...
apache-2.0
i-DAT-Qualia/Qualia-AC
qualia/accounts/migrations/0001_initial.py
2
1054
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='QualiaUser', fields=[ ('id', models.AutoField(v...
gpl-3.0
yaricom/brainhash
src/experiment_cA7_dt_th_al_ah_bl_bh_gl.py
1
2069
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ The experiment with 10 Hz/5Hz, wisp, attention, 70, cA 7, delta, theta, alpha low, alpha high, beta low, beta high, gamm low, batch size = 5 and balanced data set @author: yaric """ import experiment as ex import config from time import time n_hidden = 7 batch_size...
gpl-3.0
pbanaszkiewicz/amy
amy/extrequests/filters.py
1
7324
import re from django.db.models import Q from django.forms import widgets import django_filters from extrequests.models import SelfOrganisedSubmission, WorkshopInquiryRequest from workshops.fields import Select2Widget from workshops.filters import ( AllCountriesFilter, AMYFilterSet, ContinentFilter, F...
mit
zzmjohn/blaze
blaze/io/scidb/tests/test_scidb.py
6
1572
from __future__ import print_function, division, absolute_import import unittest from datashape import dshape from blaze import add, multiply, eval, py2help from blaze.io.scidb import zeros, ones from blaze.io.scidb.tests.mock import MockedConn try: import scidbpy from scidbpy import interface, SciDBQueryErr...
bsd-3-clause
vauxoo-dev/server-tools
inactive_session_timeout/__openerp__.py
15
1484
# -*- coding: utf-8 -*- ############################################################################## # This file is part of inactive_session_timeout, an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # inactive_session_timeout is free software: you can redistribute it # and/o...
agpl-3.0
jmcanterafonseca/fiware-cygnus
test/acceptance/tools/ckan_utils.py
1
14123
# -*- coding: utf-8 -*- # # Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U # # This file is part of fiware-cygnus (FI-WARE project). # # fiware-cygnus 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 Foun...
agpl-3.0
cloudera/hue
desktop/core/ext-py/kombu-4.3.0/kombu/transport/azurestoragequeues.py
4
4676
"""Azure Storage Queues transport. The transport can be enabled by setting the CELERY_BROKER_URL to: ``` azurestoragequeues://:{Storage Account Access Key}@{Storage Account Name} ``` Note that if the access key for the storage account contains a slash, it will have to be regenerated before it can be used in the conn...
apache-2.0