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
kalefranz/auxlib
tests/test_path.py
1
2148
# # -*- coding: utf-8 -*- # import logging # from unittest import TestCase # # from auxlib import logz # from auxlib.path import PackageFile, find_file_in_site_packages, open_package_file # # log = logging.getLogger(__name__) # # # class PackageFileTests(TestCase): # # @classmethod # def setUpClass(cls): # ...
isc
cwelton/incubator-hawq
tools/bin/lib/gpgetconfig.py
12
3572
#!/usr/bin/env python # 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 # "L...
apache-2.0
marco-lancini/Showcase
django/db/models/loading.py
308
8745
"Utilities for loading models and the modules that contain them." from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.datastructures import SortedDict from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule im...
mit
AMOSus/amos-ss16-proj6
DataProcessing/test_dataProcessing.py
1
3169
#!/usr/bin/env python # This file is part of Rogue Vision. # # Copyright (C) 2016 Daniel Reischl, Rene Rathmann, Peter Tan, # Tobias Dorsch, Shefali Shukla, Vignesh Govindarajulu, # Aleksander Penew, Abhinav Puri # # Rogue Vision is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
1844144/django-blog-zinnia
zinnia/migrations/0009_change_mptt_field.py
4
8003
from south.db import db from south.v2 import SchemaMigration from zinnia.migrations import user_name from zinnia.migrations import user_table from zinnia.migrations import user_orm_label from zinnia.migrations import user_model_label class Migration(SchemaMigration): def forwards(self, orm): # Changing ...
bsd-3-clause
Lezval/horizon
django-openstack/django_openstack/tests/view_tests/dash/security_groups_tests.py
5
13975
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
usersource/anno
tools/copytool3/oauth2client/django_orm.py
261
3833
# Copyright (C) 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 or agreed to in writ...
mpl-2.0
listamilton/supermilton.repository
plugin.video.traquinas/resources/lib/libraries/f4mproxy/utils/openssl_tripledes.py
202
1788
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """OpenSSL/M2Crypto 3DES implementation.""" from .cryptomath import * from .tripledes import * if m2cryptoLoaded: def new(key, mode, IV): return OpenSSL_TripleDES(key, mode, IV) class OpenSSL_TripleDES(...
gpl-2.0
zooniverse/aggregation
experimental/penguins/newCluster.py
2
11987
#!/usr/bin/env python __author__ = 'greg' from sklearn.cluster import DBSCAN from sklearn.cluster import AffinityPropagation import numpy as np import matplotlib.pyplot as plt import csv import sys import os import pymongo import matplotlib.cbook as cbook import cPickle as pickle import shutil import urllib import math...
apache-2.0
stadtgestalten/stadtgestalten
docs/deployment/settings.py
1
2052
# grouprise settings file # see https://docs.djangoproject.com/en/2.1/ref/settings/ import os import subprocess from stadt.settings.default import * from grouprise.core.assets import add_javascript_reference, add_javascript_inline, add_csp_directive, add_meta # see https://www.miniwebtool.com/django-secret-key-genera...
agpl-3.0
shl198/Pipeline
Modules/PacBioEDA/PacBio_Productivity.py
3
2900
#!/usr/bin/env python # Copyright (C) 2011 Genome Research Limited -- See full notice at end # of module. # Create a plot of ZMW productivity by x/y position on the # SMRTcell. First parameter is input .bas.h5 file. Output png file is # optional command line parameter, defaulting to productivity.png. import sys impo...
mit
chbrown/pi
pi/commands/publish.py
1
1402
import os from subprocess import check_call from pi.dist import read_script def publish(execute=True, verbose=False, script_name='setup.py'): dist = read_script(script_name) name = dist.get_name() version = dist.get_version() if os.path.exists('README.md'): print 'Converting README.md to reSt...
mit
zfrenchee/pandas
doc/sphinxext/ipython_sphinxext/ipython_directive.py
1
37812
# -*- coding: utf-8 -*- """ Sphinx directive to support embedded IPython code. This directive allows pasting of entire interactive IPython sessions, prompts and all, and their code will actually get re-executed at doc build time, with all prompts renumbered sequentially. It also allows you to input code as a pure pyth...
bsd-3-clause
Alwnikrotikz/jythonconsole
tip.py
9
1701
from java.awt import Color, Dimension from javax.swing import JWindow, JTextArea, JScrollPane __author__ = "Don Coleman <dcoleman@chariotsolutions.com>" __cvsid__ = "$Id: tip.py,v 1.3 2003/05/01 03:43:53 dcoleman Exp $" class Tip(JWindow): """ Window which provides the user with information about the method. ...
lgpl-2.1
coursemdetw/2015cdb
static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/pkgdata.py
603
2146
"""pkgdata is a simple, extensible way for a package to acquire data file resources. The getResource function is equivalent to the standard idioms, such as the following minimal implementation:: import sys, os def getResource(identifier, pkgname=__name__): pkgpath = os.path.dirname(sys.modules[p...
gpl-3.0
sdague/home-assistant
homeassistant/components/scsgate/light.py
12
3131
"""Support for SCSGate lights.""" import logging from scsgate.tasks import ToggleStatusTask import voluptuous as vol from homeassistant.components.light import PLATFORM_SCHEMA, LightEntity from homeassistant.const import ATTR_ENTITY_ID, ATTR_STATE, CONF_DEVICES, CONF_NAME import homeassistant.helpers.config_validatio...
apache-2.0
amanikamail/flexx
docs/scripts/genexamples.py
19
3162
""" Generate docs for examples. """ import os from types import ModuleType from flexx import ui, app THIS_DIR = os.path.dirname(os.path.abspath(__file__)) DOC_DIR = os.path.abspath(os.path.join(THIS_DIR, '..')) EXAMPLES_DIR = os.path.abspath(os.path.join(DOC_DIR, '..', 'examples')) OUTPUT_DIR = os.path.join(DOC_DIR,...
bsd-2-clause
tengqm/senlin-container
senlin/tests/unit/api/common/test_util.py
1
3858
# 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 # distributed unde...
apache-2.0
TeslaProject/external_chromium_org
tools/telemetry/telemetry/core/backends/chrome/tab_list_backend.py
46
2790
# 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 urllib2 from telemetry.core import tab from telemetry.core import util from telemetry.core.backends.chrome import inspector_backend_list class TabL...
bsd-3-clause
jgsogo/neutron
webapp/synthetic/forms.py
1
1384
#!/usr/bin/env python # -*- coding: utf-8 -*- from django import forms from neutron.models import Word from .models import AlternateData class AlternateDataForm(forms.ModelForm): word = forms.CharField() class Meta: model = AlternateData fields = '__all__' def __init__(self, *args, **...
gpl-2.0
shurihell/testasia
lms/djangoapps/certificates/tests/factories.py
16
3695
# Factories are self documenting # pylint: disable=missing-docstring import factory from uuid import uuid4 from django.core.files.base import ContentFile from factory.django import DjangoModelFactory, ImageField from student.models import LinkedInAddToProfileConfiguration from certificates.models import ( Generat...
agpl-3.0
viz-dev/viz
qa/rpc-tests/importprunedfunds.py
55
5061
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class ...
mit
nadley/Sick-Beard
sickbeard/search_queue.py
29
9175
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
bihealth/vcfpy
tests/test_header.py
1
13943
# -*- coding: utf-8 -*- """Tests for vcfpy.header """ import sys import vcfpy from vcfpy import header import pytest def test_header_field_info(): """Test the builtin functions of the FieldInfo class""" info1 = header.FieldInfo("Integer", 1, "Some description") info2 = header.FieldInfo("Integer", 1, "S...
mit
Tehsmash/ironic
ironic/drivers/modules/snmp.py
2
24149
# Copyright 2013,2014 Cray Inc # # Authors: David Hewson <dhewson@cray.com> # Stig Telfer <stelfer@cray.com> # Mark Goddard <mgoddard@cray.com> # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the L...
apache-2.0
lamby/pkg-rst2pdf
rst2pdf/tests/input/sphinx-issue172/conf.py
9
7199
# -*- coding: utf-8 -*- # # Sphinx markup documentation build configuration file, created by # sphinx-quickstart on Tue Aug 18 22:54:33 2009. # # 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. #...
mit
brainelectronics/towerdefense
tests/text/EMPTY.py
28
1136
#!/usr/bin/env python '''Test that an empty document doesn't break. ''' __docformat__ = 'restructuredtext' __noninteractive = True import unittest from pyglet import gl from pyglet import graphics from pyglet.text import document from pyglet.text import layout from pyglet import window class TestWindow(window.Win...
bsd-3-clause
benesch/adspygoogle.dfp
adspygoogle/common/Client.py
3
10125
#!/usr/bin/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 b...
apache-2.0
mszewczy/odoo
addons/portal/tests/test_portal.py
198
14169
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
hackerkid/zulip
zerver/management/commands/merge_streams.py
3
3556
from argparse import ArgumentParser from typing import Any, List from zerver.lib.actions import ( bulk_add_subscriptions, bulk_remove_subscriptions, do_deactivate_stream, ) from zerver.lib.cache import cache_delete_many, to_dict_cache_key_id from zerver.lib.management import ZulipBaseCommand from zerver.mo...
apache-2.0
QianBIG/odoo
openerp/addons/base/tests/test_ir_values.py
462
6705
import unittest2 import openerp.tests.common as common class test_ir_values(common.TransactionCase): def test_00(self): # Create some default value for some (non-existing) model, for all users. ir_values = self.registry('ir.values') # use the old API ir_values.set(self.cr, self.u...
agpl-3.0
orezpraw/partycrasher
partycrasher/more_like_this_response.py
2
5735
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (C) 2016, 2017 Joshua Charles Campbell # 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 ...
gpl-3.0
tareqalayan/ansible
lib/ansible/modules/network/cumulus/_cl_img_install.py
25
3558
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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_versio...
gpl-3.0
rdeheele/odoo
addons/event/wizard/event_confirm.py
339
1387
# -*- 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
dorileo/soletta
data/scripts/template.py
9
5158
#!/usr/bin/env python3 # This file is part of the Soletta (TM) Project # # Copyright (C) 2015 Intel 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 # # ...
apache-2.0
calfonso/ansible
lib/ansible/modules/cloud/amazon/ec2_elb_facts.py
24
8629
#!/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
xuewei4d/scikit-learn
asv_benchmarks/benchmarks/decomposition.py
12
2754
from sklearn.decomposition import (PCA, DictionaryLearning, MiniBatchDictionaryLearning) from .common import Benchmark, Estimator, Transformer from .datasets import _olivetti_faces_dataset, _mnist_dataset from .utils import make_pca_scorers, make_dict_learning_scorers class PCABenc...
bsd-3-clause
DeltaEpsilon-HackFMI2/FMICalendar-REST
venv/lib/python2.7/site-packages/rest_framework/tests/test_relations_pk.py
21
22294
from __future__ import unicode_literals from django.db import models from django.test import TestCase from rest_framework import serializers from rest_framework.tests.models import ( BlogPost, ManyToManyTarget, ManyToManySource, ForeignKeyTarget, ForeignKeySource, NullableForeignKeySource, OneToOneTarget, Nulla...
mit
lbdreyer/iris
lib/iris/tests/unit/aux_factory/test_AuxCoordFactory.py
5
6412
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Unit tests for `iris.aux_factory.AuxCoordFactory`. """ # Import iris.tests first so that some things can be initialised b...
lgpl-3.0
gymnasium/edx-platform
openedx/core/djangoapps/catalog/management/commands/tests/test_create_catalog_integrations.py
13
4190
""" Test cases for catalog_integrations command. """ from django.test import TestCase from django.core.management import call_command, CommandError from openedx.core.djangoapps.catalog.models import CatalogIntegration from openedx.core.djangoapps.catalog.tests.mixins import CatalogIntegrationMixin class TestCreateCa...
agpl-3.0
Seklfreak/Robyul-Red-DiscordBot
cogs/mirror.py
2
6343
import discord from discord.ext import commands from __main__ import send_cmd_help import os from .utils.dataIO import dataIO from .utils import checks import re import aiohttp import json from .utils.chat_formatting import pagify import asyncio __author__ = "Sebastian Winkler <sekl@slmn.de>" __version__ = "1.0" clas...
gpl-3.0
ZhangXinNan/tensorflow
tensorflow/contrib/kfac/examples/convnet_mnist_multi_tower_main.py
15
1573
# 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...
apache-2.0
maximus0/thrift
test/py/TestSyntax.py
99
1318
#!/usr/bin/env python # # 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 # "L...
apache-2.0
neumerance/cloudloon2
openstack_dashboard/dashboards/admin/images/forms.py
10
1025
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
PercyLau/oonSIM
NFD/.waf-tools/websocket.py
18
3039
# encoding: utf-8 from waflib import Options, Logs, Errors from waflib.Configure import conf import re def addWebsocketOptions(self, opt): opt.add_option('--without-websocket', action='store_false', default=True, dest='with_websocket', help='Disable WebSocket face support') ...
gpl-3.0
joshpelkey/cmap-parse
cmap_parse.py
1
11702
## # # cmap_parse.py # An attempt to parse concept maps, exported from cmap tools...take one # # Copyright 2016 Josh Pelkey # # 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...
apache-2.0
loop1024/pymo-global
android/pgs4a-0.9.6/python-install/lib/python2.7/zipfile.py
4
54030
""" Read and write ZIP files. """ import struct, os, time, sys, shutil import binascii, cStringIO, stat import io import re try: import zlib # We may need its compression method crc32 = zlib.crc32 except ImportError: zlib = None crc32 = binascii.crc32 __all__ = ["BadZipfile", "error", "ZIP_STORED", "Z...
mit
nazo/ansible
lib/ansible/modules/windows/win_robocopy.py
72
4833
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Corwin Brown <blakfeld@gmail.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 Lic...
gpl-3.0
bis12/pushmanager
tests/test_template_push.py
3
7070
import time import testing as T class PushTemplateTest(T.TemplateTestCase): authenticated = True push_page = 'push.html' push_status_page = 'push-status.html' accepting_push_sections = ['blessed', 'verified', 'staged', 'added', 'pickme', 'requested'] now = time.time() basic_push = { ...
apache-2.0
t794104/ansible
lib/ansible/modules/network/f5/bigip_gtm_virtual_server.py
38
40714
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks 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', ...
gpl-3.0
dischinator/pyload
module/plugins/hoster/PornhubCom.py
5
2547
# -*- coding: utf-8 -*- import re from module.plugins.internal.Hoster import Hoster class PornhubCom(Hoster): __name__ = "PornhubCom" __type__ = "hoster" __version__ = "0.55" __status__ = "testing" __pattern__ = r'http://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=\w+' __config__...
gpl-3.0
happyleavesaoc/home-assistant
homeassistant/helpers/event.py
4
11145
"""Helpers for listening to events.""" import functools as ft from homeassistant.helpers.sun import get_astral_event_next from ..core import HomeAssistant, callback from ..const import ( ATTR_NOW, EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_ALL) from ..util import dt as dt_util from ..util.async import run_call...
apache-2.0
pywikibot-catfiles/file-metadata
setupdeps.py
2
16766
# -*- coding: utf-8 -*- """ Various dependencies that are required for file-metadata which need some special handling. """ from __future__ import (division, absolute_import, unicode_literals, print_function) import ctypes.util import hashlib import os import subprocess import sys from distutil...
mit
elektito/pybtracker
pybtracker/client.py
1
13320
import asyncio import os import struct import logging import random import cmd import argparse from urllib.parse import urlparse from collections import defaultdict from ipaddress import ip_address from datetime import datetime, timedelta from version import __version__ class ServerError(Exception): pass class Ud...
mit
bmhatfield/Diamond
src/collectors/openstackswift/openstackswift.py
31
3996
# coding=utf-8 """ Openstack swift collector. #### Dependencies * swift-dispersion-report commandline tool (for dispersion report) if using this, make sure swift.conf and dispersion.conf are readable by diamond also get an idea of the runtime of a swift-dispersion-report call and make sure the collect inte...
mit
haad/ansible
lib/ansible/modules/network/f5/bigip_monitor_http.py
3
18788
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks 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', ...
gpl-3.0
flavour/cedarbluff
modules/s3/fontmap/SazanamiMincho.py
58
68515
#!/usr/bin/env python SazanamiMincho_map = [ (0, 1), (32, 127), (160, 384), (402, 403), (461, 477), (501, 502), (506, 512), (592, 681), (710, 712), (713, 716), (728, 734), (884, 886), (890, 891), (894, 895), (900, 907), (908, 909), (910, 930), (931, 975), (976, 978), (981, 982), (1013, 1014), (1025, 1037), (1038, 1104)...
mit
drammock/mne-python
mne/preprocessing/realign.py
7
3982
# -*- coding: utf-8 -*- # Authors: Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) import numpy as np from ..io import BaseRaw from ..utils import _validate_type, warn, logger, verbose @verbose def realign_raw(raw, other, t_raw, t_other, verbose=None): """Realign two simultaneous recordings. ...
bsd-3-clause
hef/samba
lib/testtools/testtools/tests/matchers/helpers.py
14
1643
# Copyright (c) 2008-2012 testtools developers. See LICENSE for details. from testtools.tests.helpers import FullStackRunTest class TestMatchersInterface(object): run_tests_with = FullStackRunTest def test_matches_match(self): matcher = self.matches_matcher matches = self.matches_matches ...
gpl-3.0
apple/swift-lldb
packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vCont.py
5
5722
from __future__ import print_function import gdbremote_testcase from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestGdbRemote_vCont(gdbremote_testcase.GdbRemoteTestCaseBase): mydir = TestBase.compute_mydir(__file__) def vCont_supports_...
apache-2.0
brianwoo/django-tutorial
build/Django/tests/model_meta/results.py
23
26393
from .models import AbstractPerson, BasePerson, Person, Relating, Relation TEST_RESULTS = { 'get_all_field_names': { Person: [ 'baseperson_ptr', 'baseperson_ptr_id', 'content_type_abstract', 'content_type_abstract_id', 'content_type_base', ...
gpl-3.0
indhub/mxnet
example/speech_recognition/stt_layer_batchnorm.py
52
1994
# 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 u...
apache-2.0
MatteoNardi/dyanote-server
api/views.py
1
1637
from django.contrib.auth.models import User from rest_framework import mixins from rest_framework import generics from rest_framework import renderers from rest_framework import permissions from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from...
mit
flwh/KK_mt6589_iq451
prebuilts/python/darwin-x86/2.7.5/lib/python2.7/test/test_linecache.py
96
4079
""" Tests for the linecache module """ import linecache import unittest import os.path from test import test_support as support FILENAME = linecache.__file__ INVALID_NAME = '!@$)(!@#_1' EMPTY = '' TESTS = 'inspect_fodder inspect_fodder2 mapping_tests' TESTS = TESTS.split() TEST_PATH = os.path.dirname(support.__file_...
gpl-2.0
eonpatapon/nova
nova/api/openstack/compute/views/flavors.py
49
3452
# Copyright 2010-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...
apache-2.0
tobiasgehring/qudi
hardware/awg/tektronix_awg70k.py
1
63429
# -*- coding: utf-8 -*- """ This file contains the Qudi hardware module for AWG70000 Series. Qudi 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 ve...
gpl-3.0
sdague/home-assistant
homeassistant/components/smhi/__init__.py
26
1025
"""Support for the Swedish weather institute weather service.""" from homeassistant.config_entries import ConfigEntry from homeassistant.core import Config, HomeAssistant # Have to import for config_flow to work even if they are not used here from .config_flow import smhi_locations # noqa: F401 from .const import DOM...
apache-2.0
OCA/l10n-brazil
l10n_br_purchase_stock/wizards/stock_invocing_onshipping.py
1
2256
# @ 2021 Akretion - www.akretion.com.br - # Magno Costa <magno.costa@akretion.com.br> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import fields, models class StockInvoiceOnshipping(models.TransientModel): _inherit = "stock.invoice.onshipping" def _build_invoice_values_fr...
agpl-3.0
cloudera/recordservice
thirdparty/thrift-0.9.0/test/py/TestServer.py
30
7232
#!/usr/bin/env python # # 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 # "L...
apache-2.0
fmacias64/deap
examples/pso/speciation.py
12
6672
# This file is part of DEAP. # # DEAP is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
lgpl-3.0
RedHatQE/cfme_tests
cfme/scripting/conf.py
1
3763
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """Script to encrypt config files. Usage: scripts/encrypt_conf.py confname1 confname2 ... confnameN scripts/encrypt_conf.py credentials """ import io import click import yaycl_crypt from . import link_config from cfme.utils import conf @click.group(help='Functi...
gpl-2.0
40223232/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/formatter.py
751
14930
"""Generic output formatting. Formatter objects transform an abstract flow of formatting events into specific output events on writer objects. Formatters manage several stack structures to allow various properties of a writer object to be changed and restored; writers need not be able to handle relative changes nor an...
gpl-3.0
hippyk/pix2code
model/convert_imgs_to_arrays.py
2
1160
#!/usr/bin/env python from __future__ import print_function from __future__ import absolute_import __author__ = 'Tony Beltramelli - www.tonybeltramelli.com' import os import sys import shutil from classes.Utils import * from classes.model.Config import * argv = sys.argv[1:] if len(argv) < 2: print("Error: not e...
apache-2.0
jvkops/titanium_mobile
support/android/tilogger.py
37
1757
from __future__ import with_statement import os, sys class TiLogger: ERROR = 0 WARN = 1 INFO = 2 DEBUG = 3 TRACE = 4 def __init__(self, logfile, level=TRACE, output_stream=sys.stdout): self.level = level self.output_stream = output_stream global _logfile _logfile = logfile if _logfile is not None: l...
apache-2.0
subhacom/moose-core
tests/python/test_function.py
2
2728
# test_function.py --- # # Filename: test_function.py # Description: # Author: subha # Maintainer: # Created: Sat Mar 28 19:34:20 2015 (-0400) # Version: # Last-Updated: # By: # Update #: 0 # URL: # Keywords: # Compatibility: # # # Commentary: # # # # # Change log: # # # # # This pr...
gpl-3.0
remybaranx/qtaste
demo/Testbeds/ControlScripts/controlscript_addon.py
1
2642
## # Control script Addon jython module. # # This module contains extention of the ControlScript class: # - VirtualBox: this extention class is to be used to control Sun VirtualBox images. ## from controlscript import * import time class ControlScriptAddon(ControlScript): """ Control script Addon""" def __init__(s...
gpl-3.0
colbyga/pychess
lib/pychess/Utils/Piece.py
22
1197
from pychess.Utils.const import KING, QUEEN, ROOK, BISHOP, KNIGHT, PAWN from pychess.Utils.repr import reprSign, reprColor, reprPiece class Piece: def __init__ (self, color, piece, captured=False): self.color = color self.piece = piece self.captured = captured # in crazyho...
gpl-3.0
mmt/deeprl22
hw2/frozen_lake.py
7
4392
import numpy as np import sys from six import StringIO, b from gym import utils import discrete_env LEFT = 0 DOWN = 1 RIGHT = 2 UP = 3 MAPS = { "4x4": [ "SFFF", "FHFH", "FFFH", "HFFG" ], "8x8": [ "SFFFFFFF", "FFFFFFFF", "FFFHFFFF", "FFFFFHFF...
mit
felipenaselva/felipe.repository
plugin.video.mrpiracy/resources/lib/AADecoder.py
14
8517
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector for openload.io # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # by DrZ3r0 # ------------------------------------------------------------ # Modified by Shani import re class AADec...
gpl-2.0
pedrobaeza/project-service
project_baseuser/__openerp__.py
2
3592
# -*- coding: utf-8 -*- ############################################################################## # # Daniel Reis, 2013 # # 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, eith...
agpl-3.0
40123237/w17test
static/Brython3.1.0-20150301-090019/Lib/unittest/test/test_setups.py
791
16440
import io import sys import unittest def resultFactory(*_): return unittest.TestResult() class TestSetups(unittest.TestCase): def getRunner(self): return unittest.TextTestRunner(resultclass=resultFactory, stream=io.StringIO()) def runTests(self, *cases...
gpl-3.0
tpaszkowski/quantum
quantum/openstack/common/uuidutils.py
159
1106
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 Intel 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.apa...
apache-2.0
Urvik08/ns3-gpcr
src/bridge/bindings/modulegen__gcc_ILP32.py
28
168219
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
SUSE/kiwi
test/unit/package_manager/init_test.py
1
1854
from mock import ( patch, Mock ) from pytest import raises from kiwi.package_manager import PackageManager from kiwi.exceptions import KiwiPackageManagerSetupError class TestPackageManager: def test_package_manager_not_implemented(self): with raises(KiwiPackageManagerSetupError): Package...
gpl-3.0
mxrrow/zaicoin
src/deps/boost/libs/python/pyste/dist/create_build.py
54
1668
# Copyright Bruno da Silva de Oliveira 2006. 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) import os import sys import shutil import fnmatch from zipfile import ZipFile, ZIP_DEFLATED def findfiles(directory, mask)...
mit
alibbaba/plugin.video.live.streamspro
plugin.video.live.streamspro/resources/lib/resolvers/cloudtime.py
2
1502
# -*- coding: utf-8 -*- ''' Genesis Add-on Copyright (C) 2015 lambda 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 opt...
gpl-2.0
solintegra/addons
email_template/__init__.py
381
1144
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
AIFDR/inasafe
safe/metadata35/property/boolean_property.py
6
1694
# -*- coding: utf-8 -*- """ InaSAFE Disaster risk assessment tool developed by AusAid - **metadata module.** 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 the Free Sof...
gpl-3.0
ales-erjavec/scipy
benchmarks/benchmarks/fftpack_basic.py
46
2646
""" Test functions for fftpack.basic module """ from __future__ import division, absolute_import, print_function from numpy import arange, asarray, zeros, dot, exp, pi, double, cdouble import numpy.fft from numpy.random import rand try: from scipy.fftpack import ifft, fft, fftn, irfft, rfft except ImportError: ...
bsd-3-clause
morenopc/edx-platform
cms/djangoapps/contentstore/views/assets.py
3
11648
import logging from functools import partial import math import json from django.http import HttpResponseBadRequest from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_http_methods from django_future.csrf import ensure_csrf_cookie from django.views.decorators.http...
agpl-3.0
seanandrews/diskpop
phot/priors.py
1
1143
# # # import numpy as np import pandas as pd from scipy.interpolate import interp1d import matplotlib.pyplot as plt import sys # effective temperature prior # inputs Sbar = 60. eSbar = 1. Tinput = 8700. # load spectral type |-> temperature conversion file dt = {'ST': np.str, 'STix': np.float64, 'Teff':np.float64,...
mit
liama482/Picture
ggame/sysdeps.py
227
1916
def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: return True if module_exists('browser') and module_exists('javascript'): from browser import window, document from javascript import JSObject, JSConstructor GFX = JSObject(w...
mit
youprofit/NewsBlur
utils/munin/newsblur_feed_counts.py
10
2628
#!/usr/bin/env python from utils.munin.base import MuninGraph import redis class NBMuninGraph(MuninGraph): @property def graph_config(self): return { 'graph_category' : 'NewsBlur', 'graph_title' : 'NewsBlur Feed Counts', 'graph_vlabel' : 'Feeds Feed Counts', ...
mit
gabrielfalcao/lettuce
tests/integration/lib/Django-1.3/django/contrib/flatpages/admin.py
250
1089
from django import forms from django.contrib import admin from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', help_text = _("Example: ...
gpl-3.0
lcgong/alchemy
redbean/test/security/serv/secure.py
2
2092
import logging logger = logging.getLogger(__name__) from redbean.secure.identity import SessionIdentity from redbean.secure.keeper import UserIdentityKeeper from redbean.asyncid import AsyncID64 from test.security.app import rest, etcd_endpoint user_id_generator = AsyncID64('/asyncid/user_sn', etcd_endpoint) keeper ...
gpl-3.0
Panos512/invenio
modules/bibauthorid/lib/bibauthorid_regression_tests.py
5
8601
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 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...
gpl-2.0
PyroShark/namebench
libnamebench/nameserver_test.py
175
7015
#!/usr/bin/env python # Copyright 2009 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
messi2050/android_kernel_huawei_msm8610
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
soldag/home-assistant
tests/components/rfxtrx/test_light.py
14
6854
"""The tests for the Rfxtrx light platform.""" from unittest.mock import call import pytest from homeassistant.components.light import ATTR_BRIGHTNESS from homeassistant.components.rfxtrx import DOMAIN from homeassistant.core import State from tests.common import MockConfigEntry, mock_restore_cache from tests.compon...
apache-2.0
KenKundert/quantiphy
tests/test_unit_conversion.py
1
13490
# encoding: utf8 from quantiphy import ( Quantity, UnitConversion, QuantiPhyError, IncompatibleUnits, UnknownPreference, UnknownConversion, UnknownUnitSystem, InvalidRecognizer, UnknownFormatKey, UnknownScaleFactor, InvalidNumber, ExpectedQuantity, MissingName, ) Quantity.reset_prefs() import math impo...
gpl-3.0