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
gg7/diamond
src/collectors/dseopscenter/test/testdseopscenter.py
31
1852
#!/usr/bin/python # coding=utf-8 ########################################################################## from test import CollectorTestCase from test import get_collector_config from mock import Mock from mock import patch from diamond.collector import Collector from dseopscenter import DseOpsCenterCollector ###...
mit
Bourneer/scrapy
tests/test_closespider.py
140
2413
from twisted.internet import defer from twisted.trial.unittest import TestCase from scrapy.utils.test import get_crawler from tests.spiders import FollowAllSpider, ItemSpider, ErrorSpider from tests.mockserver import MockServer class TestCloseSpider(TestCase): def setUp(self): self.mockserver = MockServe...
bsd-3-clause
pilou-/ansible
contrib/inventory/nsot.py
14
9857
#!/usr/bin/env python ''' nsot ==== Ansible Dynamic Inventory to pull hosts from NSoT, a flexible CMDB by Dropbox Features -------- * Define host groups in form of NSoT device attribute criteria * All parameters defined by the spec as of 2015-09-05 are supported. + ``--list``: Returns JSON hash of host groups -...
gpl-3.0
stargaser/astropy
examples/io/split-jpeg-to-fits.py
3
2472
# -*- coding: utf-8 -*- """ ===================================================== Convert a 3-color image (JPG) to separate FITS images ===================================================== This example opens an RGB JPEG image and writes out each channel as a separate FITS (image) file. This example uses `pillow <htt...
bsd-3-clause
indictranstech/reciphergroup-frappe
frappe/translate.py
14
17396
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ frappe.translate ~~~~~~~~~~~~~~~~ Translation tools for frappe """ import frappe, os, re, codecs, json from frappe.utils.jinja import render_include from jinja2 import T...
mit
glaubitz/fs-uae-debian
launcher/OpenGL/GLES2/EXT/occlusion_query_boolean.py
8
1111
'''OpenGL extension EXT.occlusion_query_boolean This module customises the behaviour of the OpenGL.raw.GLES2.EXT.occlusion_query_boolean to provide a more Python-friendly API The official definition of this extension is available here: http://www.opengl.org/registry/specs/EXT/occlusion_query_boolean.txt ''' from Op...
gpl-2.0
pongem/python-bot-project
appengine/standard/botapp/env/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/genshi.py
508
2309
from __future__ import absolute_import, division, unicode_literals from genshi.core import QName from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT from . import base from ..constants import voidElements, namespaces class T...
apache-2.0
guewen/stock-logistics-tracking
__unported__/stock_inventory_sequence/inventory.py
4
1324
# -*- coding: utf-8 -*- ################################################################################# # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr> # # This program is free software: you can redistribute it and/or modify # it under t...
agpl-3.0
cewood/ansible
lib/ansible/compat/tests/mock.py
258
1241
# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.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 your option) any later...
gpl-3.0
dahlstrom-g/intellij-community
python/helpers/py2only/docutils/writers/xetex/__init__.py
86
5230
#!/usr/bin/env python # -*- coding: utf-8 -*- # :Author: Günter Milde <milde@users.sourceforge.net> # :Revision: $Revision: 7668 $ # :Date: $Date: 2013-06-04 14:46:30 +0200 (Die, 04. Jun 2013) $ # :Copyright: © 2010 Günter Milde. # :License: Released under the terms of the `2-Clause BSD license`_, in short: # # Co...
apache-2.0
milaq/android_kernel_htc_kovsky
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
802
2710
# Core.py - Python extension for perf trace, core functions # # 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. from collections import defaultdict def auto...
gpl-2.0
ashishnitinpatil/django_appengine_project_template
django/conf/urls/__init__.py
107
2601
from django.core.urlresolvers import (RegexURLPattern, RegexURLResolver, LocaleRegexURLResolver) from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module from django.utils import six __all__ = ['handler400', 'handler403', 'handler404', 'handler500', 'include', 'patt...
bsd-2-clause
cxysteven/Paddle
demo/quick_start/trainer_config.emb.py
13
1802
# edit-mode: -*- python -*- # Copyright (c) 2016 PaddlePaddle 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 ...
apache-2.0
Averroes/statsmodels
statsmodels/tsa/statespace/tests/test_tools.py
19
4268
""" Tests for tools Author: Chad Fulton License: Simplified-BSD """ from __future__ import division, absolute_import, print_function import numpy as np import pandas as pd from statsmodels.tsa.statespace import tools # from .results import results_sarimax from numpy.testing import ( assert_equal, assert_array_eq...
bsd-3-clause
aroche/django
tests/model_formsets/models.py
143
7751
from __future__ import unicode_literals import datetime import uuid from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Model): name = models.CharField(max_length=100) class Meta: or...
bsd-3-clause
mrkm4ntr/incubator-airflow
tests/providers/microsoft/azure/transfers/test_file_to_wasb.py
7
2577
# # 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...
apache-2.0
krunal3103/servo
tests/wpt/web-platform-tests/tools/pytest/testing/python/raises.py
171
2572
import pytest class TestRaises: def test_raises(self): source = "int('qwe')" excinfo = pytest.raises(ValueError, source) code = excinfo.traceback[-1].frame.code s = str(code.fullsource) assert s == source def test_raises_exec(self): pytest.raises(ValueError, "a,...
mpl-2.0
Danielhiversen/home-assistant
homeassistant/components/sensor/starlingbank.py
5
3333
""" Support for balance data via the Starling Bank API. For more details about this platform, please refer to the documentation at https://www.home-assistant.io/components/sensor.starlingbank/ """ import logging import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from...
mit
badreddinetahir/pwn_plug_sources
src/fasttrack/bin/menu/sqlinjector.py
16
1116
#!/usr/bin/env python import os,sys,time definepath=os.getcwd() sys.path.append("%s/bin/ftsrc/" % (definepath)) import include while 1==1: include.print_banner() menu=raw_input(""" Enter which SQL Injector you want to use: 1. SQL Injector - Query String Parameter Attack 2. SQL Injector - POST Parameter A...
gpl-3.0
peterhenderson/python-enunciate-samples
familytree.py
1
5994
try: import json except ImportError: import simplejson as json def parse(input): """Parse specified file or string and return a FamilyTree object created from it.""" if hasattr(input, "read"): data = json.load(input) else: data = json.loads(input) return FamilyTree(data) clas...
apache-2.0
handroissuazo/tensorflow
tensorflow/contrib/rnn/python/kernel_tests/rnn_cell_test.py
3
43457
# Copyright 2015 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
shhui/nova
nova/tests/api/openstack/compute/plugins/v3/test_consoles.py
27
10477
# Copyright 2010-2011 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, 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-2.0
chazu/ASCIIWar
dep/pyenet/Cython/Cython/Tempita/_looper.py
136
4168
""" Helper for looping over sequences, particular in templates. Often in a loop in a template it's handy to know what's next up, previously up, if this is the first or last item in the sequence, etc. These can be awkward to manage in a normal Python loop, but using the looper you can get a better sense of the context....
bsd-3-clause
kiith-sa/QGIS
python/plugins/processing/gdal/polygonize.py
4
2948
# -*- coding: utf-8 -*- """ *************************************************************************** polygonize.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ****************************...
gpl-2.0
anthrotype/nototools
nototools/emoji_ordering.py
1
16038
#!/usr/bin/env python # # Copyright 2016 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 require...
apache-2.0
alihalabyah/grab
test/grab_proxy.py
12
6038
# coding: utf-8 from test.util import build_grab, TMP_FILE from test.util import (BaseGrabTestCase, TEST_SERVER_PORT, EXTRA_PORT1, EXTRA_PORT2) from test_server import TestServer import six from grab.proxylist import BaseProxySource ADDRESS = '127.0.0.1' PROXY1 = '%s:%d' % (ADDRESS, TEST_SERVER_...
mit
peckhams/topoflow
topoflow/components/met_base.py
1
111479
## Does "land_surface_air__latent_heat_flux" make sense? (2/5/13) # Copyright (c) 2001-2014, Scott D. Peckham # # Sep 2014. Fixed sign error in update_bulk_richardson_number(). # Ability to compute separate P_snow and P_rain. # Aug 2014. New CSDMS Standard Names and clean up. # Nov 2013. Con...
mit
savoirfairelinux/django
tests/custom_columns/tests.py
31
3892
from django.core.exceptions import FieldError from django.test import TestCase from .models import Article, Author class CustomColumnsTests(TestCase): def setUp(self): self.a1 = Author.objects.create(first_name="John", last_name="Smith") self.a2 = Author.objects.create(first_name="Peter", last_n...
bsd-3-clause
gibiansky/tensorflow
tensorflow/python/ops/nn.py
2
11979
# Copyright 2015 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
synety-jdebp/rtpproxy
python/sippy_lite/sippy/Rtp_proxy_client_local.py
6
2202
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. # Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistrib...
bsd-2-clause
EvenStrangest/tensorflow
tensorflow/python/kernel_tests/trace_op_test.py
9
2204
# Copyright 2015 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
gokuale/weblate
weblate/trans/specialchars.py
11
9743
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
gpl-3.0
wsmith323/django
tests/flatpages_tests/test_middleware.py
290
8134
from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import TestCase, modify_settings, override_settings from .settings import FLATPAGES_TEMPLATES class TestDataMixin(object): ...
bsd-3-clause
liebermeister/flux-enzyme-cost-minimization
scripts/monod_curve.py
1
6430
# -*- coding: utf-8 -*- """ Created on Wed Oct 1 2015 @author: noore """ import os import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec from scipy.optimize import curve_fit import definitions as D import pandas as pd #LOW_GLUCOSE = D.LOW_CONC['glucoseExt'] LOW_GLUCOSE = 1e-3 # in mM, i...
gpl-2.0
archman/phantasy
phantasy/__init__.py
1
1546
import logging # from phantasy.library.model import flame as flameutils # from phantasy.library import channelfinder from phantasy.library import lattice from phantasy.library import layout from phantasy.library import misc from phantasy.library import model from phantasy.library import operation from phantasy.librar...
bsd-3-clause
itmanagerro/tresting
qa/rpc-tests/test_framework/address.py
96
2272
#!/usr/bin/env python3 # Copyright (c) 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. # # address.py # # This file encodes and decodes BASE58 P2PKH and P2SH addresses # from .script import hash25...
mit
LinkHS/incubator-mxnet
example/neural-style/end_to_end/model_vgg19.py
43
6553
# 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
CydarLtd/ansible
test/units/modules/network/junos/junos_module.py
31
3268
# (c) 2017 Red Hat Inc. # # 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 your option) any later version. # # Ansible is dis...
gpl-3.0
dpassante/ansible
test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/config/lldp_interfaces/lldp_interfaces.py
47
15951
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The vyos_lldp_interfaces class It is in this file where the current configuration (as dict) is compared to the provided configuration (as dict) and the command set necess...
gpl-3.0
spcui/virt-test
qemu/tests/rv_fullscreen.py
3
3380
""" rv_fullscreen.py - remote-viewer full screen Testing the remote-viewer --full-screen option If successful, the resolution of the guest will take the resolution of the client. Requires: connected binaries remote-viewer, Xorg, gnome session """ import logging...
gpl-2.0
alimony/django
tests/gis_tests/geoadmin/tests.py
35
4277
from django.contrib.gis import admin from django.contrib.gis.geos import Point from django.test import TestCase, override_settings from django.test.utils import patch_logger from .admin import UnmodifiableAdmin from .models import City, site @override_settings(ROOT_URLCONF='django.contrib.gis.tests.geoadmin.urls') c...
bsd-3-clause
undoware/neutron-drive
google_appengine/google/appengine/_internal/antlr3/recognizers.py
28
51703
"""ANTLR3 runtime package""" # begin[licence] # # [The "BSD licence"] # Copyright (c) 2005-2008 Terence Parr # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code ...
bsd-3-clause
frankyrumple/ope
libs/gluon/contenttype.py
33
30533
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) CONTENT_TYPE dictionary created against freedesktop.org's shared mime info database version 1.1. Dev...
mit
ccellis/WHACK2016
flask/lib/python2.7/site-packages/whoosh/lang/snowball/russian.py
95
20904
from whoosh.compat import u class RussianStemmer(object): """ The Russian Snowball stemmer. :cvar __perfective_gerund_suffixes: Suffixes to be deleted. :type __perfective_gerund_suffixes: tuple :cvar __adjectival_suffixes: Suffixes to be deleted. :type __adjectival_suffixes: tuple :cvar __...
bsd-3-clause
djbaldey/django
tests/signals/tests.py
311
10273
from __future__ import unicode_literals from django.db import models from django.db.models import signals from django.dispatch import receiver from django.test import TestCase from django.utils import six from .models import Author, Book, Car, Person class BaseSignalTest(TestCase): def setUp(self): # Sa...
bsd-3-clause
cathyyul/sumo-0.18
tools/turn-defs/generateTurnDefs.py
6
1634
#!/usr/bin/python # -*- encoding: utf8 -*- """ Generates turn definitions XML file based on connections XML file. """ import connections import turndefinitions import logging import optparse LOGGER = logging.getLogger(__name__) if __name__ == "__main__": # pylint: disable-msg=C0103 logging.basicConfig...
gpl-3.0
CodeMonkeyJan/hyperspy
hyperspy/tests/io/test_dm3.py
2
11636
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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
ioanpocol/superdesk-core
apps/ldap/commands.py
1
3036
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import loggi...
agpl-3.0
bonitadecker77/python-for-android
python-modules/twisted/twisted/words/im/ircsupport.py
49
9263
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ IRC support for Instance Messenger. """ import string from twisted.words.protocols import irc from twisted.words.im.locals import ONLINE from twisted.internet import defer, reactor, protocol from twisted.internet.defer import succe...
apache-2.0
joeythesaint/yocto-autobuilder
lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/buildslave/base.py
4
42257
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
wuzhy/autotest
server/autotest.py
1
42871
# Copyright 2007 Google Inc. Released under the GPL v2 import re, os, sys, traceback, subprocess, time, pickle, glob, tempfile import logging, getpass from autotest_lib.server import installable_object, prebuild, utils from autotest_lib.client.common_lib import base_job, log, error, autotemp from autotest_lib.client.c...
gpl-2.0
knxd/PyKNyX
pyknyx/core/dptXlator/dptXlator4ByteSigned.py
2
4124
# -*- coding: utf-8 -*- """ Python KNX framework License ======= - B{PyKNyX} (U{https://github.com/knxd/pyknyx}) is Copyright: - © 2016-2017 Matthias Urlichs - PyKNyX is a fork of pKNyX - © 2013-2015 Frédéric Mantegazza This program is free software; you can redistribute it and/or modify it under the terms ...
gpl-3.0
pacifica/pacifica-archiveinterface
tests/cherrypy_test.py
2
3915
#!/usr/bin/python # -*- coding: utf-8 -*- """Test the example module.""" import requests import cherrypy from cherrypy.test import helper from pacifica.archiveinterface.globals import CHERRYPY_CONFIG from pacifica.archiveinterface.archive_utils import bytes_type from pacifica.archiveinterface.rest_generator import Arch...
lgpl-3.0
CCharlieLi/StaffManagmentSystem
rest_framework/tests/test_routers.py
21
7115
from __future__ import unicode_literals from django.db import models from django.test import TestCase from django.core.exceptions import ImproperlyConfigured from rest_framework import serializers, viewsets, permissions from rest_framework.compat import include, patterns, url from rest_framework.decorators import link,...
gpl-2.0
mosbasik/buzhug
javasrc/lib/Jython/Lib/distutils/tests/test_install.py
155
1861
"""Tests for distutils.command.install.""" import os import unittest from distutils.command.install import install from distutils.core import Distribution from distutils.tests import support class InstallTestCase(support.TempdirManager, unittest.TestCase): def test_home_installation_scheme(self): # Th...
bsd-3-clause
gauribhoite/personfinder
env/google_appengine/lib/django-1.5/django/contrib/gis/db/backends/oracle/introspection.py
119
1779
import cx_Oracle from django.db.backends.oracle.introspection import DatabaseIntrospection class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY, # but it is the only o...
apache-2.0
aminert/scikit-learn
sklearn/linear_model/logistic.py
105
56686
""" Logistic Regression """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Fabian Pedregosa <f@bianp.net> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Manoj Kumar <manojkumarsivaraj334@gmail.com> # Lars Buitinck # Simon Wu <s8wu@uwaterloo.ca> imp...
bsd-3-clause
jamesleesaunders/pi-hive
tests/test_zbsmartplug.py
2
4411
#! /usr/bin/python """ test_zbsmartplug.py By James Saunders, 2017 Tests PyAlertMe Module. """ import sys sys.path.insert(0, '../') from pyalertme import * import unittest from mock_serial import Serial class TestZBSmartPlug(unittest.TestCase): """ Test PyAlertMe ZBSmartPlug Class. """ def setUp(sel...
mit
frnhr/django-cms
cms/south_migrations/0035_auto__add_field_globalpagepermission_can_view__add_field_pagepermissio.py
1680
20032
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
ashhher3/invenio
modules/websubmit/lib/functions/Get_Info.py
33
4960
## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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...
gpl-2.0
flodolo/bedrock
bedrock/firefox/firefox_details.py
2
19519
# coding=utf-8 import re from collections import OrderedDict from operator import itemgetter from urllib.parse import urlencode from django.conf import settings from everett.manager import ListOf from product_details import ProductDetails from bedrock.base.waffle import config from lib.l10n_utils.dotlang import _la...
mpl-2.0
sanghinitin/golismero
thirdparty_libs/django/db/models/loading.py
104
10633
"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 fro...
gpl-2.0
Dhivyap/ansible
test/units/modules/network/fortios/test_fortios_switch_controller_vlan.py
21
10989
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
Lightmatter/django-inlineformfield
.tox/py27/lib/python2.7/site-packages/IPython/html/services/notebooks/tests/test_notebooks_api.py
8
13601
# coding: utf-8 """Test the notebooks webservice API.""" import io import json import os import shutil from unicodedata import normalize pjoin = os.path.join import requests from IPython.html.utils import url_path_join, url_escape from IPython.html.tests.launchnotebook import NotebookTestBase, assert_http_error fro...
mit
Vimos/scikit-learn
sklearn/kernel_approximation.py
7
18505
""" The :mod:`sklearn.kernel_approximation` module implements several approximate kernel feature maps base on Fourier transforms. """ # Author: Andreas Mueller <amueller@ais.uni-bonn.de> # # License: BSD 3 clause import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import svd from .base im...
bsd-3-clause
FederatedAI/FATE
examples/pipeline/hetero_feature_selection/pipeline-hetero-feature-selection-select-cols.py
1
3581
# # Copyright 2019 The FATE 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 appli...
apache-2.0
saimn/glue
glue/core/tests/test_simpleforms.py
5
1401
from __future__ import absolute_import, division, print_function import pytest from ..simpleforms import IntOption, FloatOption, BoolOption class Stub(object): int_opt = IntOption(min=0, max=10, default=3) float_opt = FloatOption(min=1, max=2, default=1.5) bool_opt = BoolOption() class TestSimpleForms...
bsd-3-clause
s0undt3ch/cookiecutter-pytest-plugin
pytest-{{cookiecutter.plugin_name}}/tests/test_{{cookiecutter.plugin_name}}.py
1
1500
# -*- coding: utf-8 -*- def test_bar_fixture(testdir): """Make sure that pytest accepts our fixture.""" # create a temporary pytest test module testdir.makepyfile(""" def test_sth(bar): assert bar == "europython2015" """) # run pytest with the following cmd args result = ...
mit
pforret/python-for-android
python3-alpha/python-libs/bs4/tests/test_tree.py
46
59853
# -*- coding: utf-8 -*- """Tests for Beautiful Soup's tree traversal methods. The tree traversal methods are the main advantage of using Beautiful Soup over just using a parser. Different parsers will build different Beautiful Soup trees given the same markup, but all Beautiful Soup trees can be traversed with the me...
apache-2.0
makersauce/ConstructSecur
Overlord/newAdmin.py
1
1055
#!/usr/bin/env python from dblayer import DBlayer import getpass db = DBlayer(DEBUG=True) print 'so you want to add an admin, eh?' name = raw_input("full name: ") usern = raw_input("user name: ") trys = 0 while True: pw = getpass.getpass("password: ") pw2 = getpass.getpass("re-type password: ") if pw == ...
mit
Yukarumya/Yukarum-Redfoxes
testing/talos/talos/mainthreadio.py
1
5541
# -*- Mode: python; tab-width: 8; indent-tabs-mode: nil -*- # vim: set ts=8 sts=4 et sw=4 tw=80: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import utils ...
mpl-2.0
nvie/python-mode
pymode/libs/pylama/core.py
13
5335
""" Pylama's core functionality. Prepare params, check a modeline and run the checkers. """ import re import logging from collections import defaultdict from .config import process_value, LOGGER from .lint.extensions import LINTERS from .errors import DUPLICATES, Error #: The skip pattern SKIP_PATTERN = re.compil...
lgpl-3.0
bliti/django-nonrel-1.5
django/contrib/staticfiles/handlers.py
106
2513
try: from urllib.parse import urlparse from urllib.request import url2pathname except ImportError: # Python 2 from urllib import url2pathname from urlparse import urlparse from django.conf import settings from django.core.handlers.base import get_path_info from django.core.handlers.wsgi import WSGI...
bsd-3-clause
Hybrid-Cloud/cinder
cinder/tests/unit/test_coprhd.py
5
41455
# Copyright (c) 2012 - 2016 EMC Corporation, 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 # # ...
apache-2.0
jesramirez/odoo
addons/account_followup/wizard/__init__.py
437
1076
# -*- 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
songmonit/CTTMSONLINE_V8
addons/purchase/partner.py
53
2711
# -*- 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
HybridF5/tempest
tempest/api/hybrid_cloud/volume/test_extensions.py
2
1836
# Copyright 2013 IBM Corp. # 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 app...
apache-2.0
jelugbo/ddi
cms/djangoapps/contentstore/views/tests/test_group_configurations.py
6
23032
""" Group Configuration Tests. """ import json from mock import patch from contentstore.utils import reverse_course_url, reverse_usage_url from contentstore.views.component import SPLIT_TEST_COMPONENT_TYPE from contentstore.views.course import GroupConfiguration from contentstore.tests.utils import CourseTestCase from ...
agpl-3.0
Unow/edx-platform
lms/djangoapps/certificates/queue.py
44
10443
from certificates.models import GeneratedCertificate from certificates.models import certificate_status_for_student from certificates.models import CertificateStatuses as status from certificates.models import CertificateWhitelist from courseware import grades, courses from django.test.client import RequestFactory fro...
agpl-3.0
elbeardmorez/quodlibet
quodlibet/quodlibet/ext/events/iradiolog.py
1
1277
# -*- coding: utf-8 -*- # Copyright 2006 Joe Wreschnig # # 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. from quodlibet...
gpl-2.0
icoxfog417/pykintone
pykintone/application_settings/general_settings.py
1
1816
import pykintone.structure as ps from pykintone.application_settings.base_administration_api import BaseAdministrationAPI import pykintone.application_settings.setting_result as sr class GeneralSettingsAPI(BaseAdministrationAPI): API_ROOT = "https://{0}.cybozu.com/k/v1{1}/app/settings.json" def __init__(self...
apache-2.0
cloudbase/nova-virtualbox
nova/api/openstack/compute/plugins/v3/servers.py
1
49282
# Copyright 2010 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, 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.apach...
apache-2.0
zyantific/IDASkins
plugins/idaskins/themeselector.py
1
3976
from __future__ import absolute_import, division, print_function import json import os import idaapi from idaskins import THEMES_DIR, UI_DIR from idaskins.objectinspector import ObjectInspector from idaskins.thememanifest import ManifestError, ThemeManifest from PyQt5 import uic from PyQt5.QtCore import Qt from PyQt5...
mit
likaiwalkman/phantomjs
src/breakpad/src/tools/gyp/pylib/gyp/generator/gypd.py
151
3320
#!/usr/bin/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. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp f...
bsd-3-clause
TQRG/physalia
physalia/utils/monsoon.py
1
1143
"""Module with util functions to use with Monsoon.""" import usb.core from math import isclose from Monsoon import Operations import click def _device_matcher(device): """Check if device is monsoon. Method copied from official Monsoon API. """ # pylint: disable=bare-except try: return dev...
mit
umitanuki/chainer
cupy/io/text.py
4
1166
import numpy def loadtxt(fname, dtype=numpy.float64, comments='#', delimiter=None, converters=None, skiprows=0, usecols=None, unpack=False, ndmin=0): # TODO(beam2d): Implement it raise NotImplementedError def savetxt(fname, X, fmt='%.18e', delimiter=' ', newline='\n', header='', foot...
mit
st0ne/smarthome
plugins/dwd/__init__.py
6
9570
#!/usr/bin/env python3 # vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab ######################################################################### # Copyright 2012-2013 Marcus Popp marcus@popp.mx ######################################################################### # ...
gpl-3.0
alephnullplex/mmdb
mmdb/settings.py
1
3188
""" Django settings for mmdb project. Generated by 'django-admin startproject' using Django 1.8.1. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths i...
mit
florianpirchner/nndesigner
org.eclipse.athene.nn.model/python/test_nodes_mergeNodes.py
1
1106
from tensorflow.contrib.keras.api.keras.layers import Conv2D, MaxPooling2D, Flatten from tensorflow.contrib.keras.api.keras.layers import Input, LSTM, Embedding, Dense, concatenate from tensorflow.contrib.keras.api.keras.layers import Input, LSTM, Embedding, Dense, concatenate, Add #from keras.layers import Conv2D, Max...
epl-1.0
wheybags/freeablo
extern/fmt/doc/conf.py
16
8122
# -*- coding: utf-8 -*- # # format documentation build configuration file, created by # sphinx-quickstart on Tue Dec 18 06:46:16 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
gpl-3.0
beigenmann/WebIOPi
python/build/lib.linux-armv6l-3.4/webiopi/devices/digital/gpio.py
4
6350
# Copyright 2012-2013 Eric Ptak - trouch.com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
gpl-3.0
lakshayg/tensorflow
tensorflow/python/tools/freeze_graph.py
25
13000
# Copyright 2015 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
xen0l/ansible
lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py
12
22222
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
dtaht/ns-3-codel-dev
doc/models/source/conf.py
21
7002
# -*- coding: utf-8 -*- # # ns-3 documentation build configuration file, created by # sphinx-quickstart on Tue Dec 14 09:00:39 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
gpl-2.0
hguemar/cinder
cinder/db/sqlalchemy/migrate_repo/versions/032_add_volume_type_projects.py
5
2576
# 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 # d...
apache-2.0
jruiperezv/ANALYSE
lms/djangoapps/instructor_task/api_helper.py
28
13664
""" Helper lib for instructor_tasks API. Includes methods to check args for rescoring task, encoding student input, and task submission logic, including handling the Celery backend. """ import hashlib import json import logging from celery.result import AsyncResult from celery.states import READY_STATES, SUCCESS, FAI...
agpl-3.0
houst0nn/android_kernel_lge_geeb
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
gcodetogit/depot_tools
third_party/logilab/common/__init__.py
64
5103
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
bsd-3-clause
codeofdusk/ProjectMagenta
tools/pygettext.py
86
22104
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # Originally written by Barry Warsaw <barry@zope.com> # # Minimally patched to make it even more xgettext compatible # by Peter Funk <pf@artcom-gmbh.de> # # 2002-11-22 Jürgen Hermann <jh@web.de> # Added checks that _() only contains string literals, and # command line...
gpl-2.0
ageron/tensorflow
tensorflow/python/keras/estimator/__init__.py
10
2884
# Copyright 2018 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