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
tdtrask/ansible
test/units/modules/network/eos/test_eos_eapi.py
57
6622
# (c) 2016 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
SuperDARNCanada/placeholderOS
experiments/twofsound.py
2
2335
#!/usr/bin/python # write an experiment that creates a new control program. import os import sys import copy BOREALISPATH = os.environ['BOREALISPATH'] sys.path.append(BOREALISPATH) from experiment_prototype.experiment_prototype import ExperimentPrototype import experiments.superdarn_common_fields as scf class Twof...
gpl-3.0
monetate/sqlalchemy
lib/sqlalchemy/sql/dml.py
3
51269
# sql/dml.py # Copyright (C) 2009-2021 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php """ Provide :class:`_expression.Insert`, :class:`_expression.Update` and :class:`_express...
mit
doheekim/chuizonetest
lib/alembic/migration.py
5
13465
import io import logging import sys from contextlib import contextmanager from sqlalchemy import MetaData, Table, Column, String, literal_column from sqlalchemy import create_engine from sqlalchemy.engine import url as sqla_url from .compat import callable, EncodedIO from . import ddl, util log = logging.getLogger(...
apache-2.0
bd9142/campuscoin
contrib/bitrpc/bitrpc.py
2348
7835
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8332") else: access = Ser...
mit
cshallue/models
research/delf/delf/python/examples/match_images.py
3
4296
# 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 applicab...
apache-2.0
AutorestCI/azure-sdk-for-python
azure-batch/azure/batch/models/pool_stop_resize_options.py
1
3078
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
mindis/Keen-Importer
importer/lib/__init__.py
1
1186
# -*- coding: utf-8 -*- ''' importer libs ~~~~~~~~~~~~~ pre-installed libraries (for override). :author: Sam Gammon <sam@keen.io> :license: This software follows the MIT (OSI-approved) license for open source software. A truncated version is included here; for full li...
mit
HybridF5/hybrid-jacket
wormhole/volumes.py
1
6320
import webob from wormhole import exception from wormhole import wsgi from wormhole.tasks import addtask from wormhole.common import utils from wormhole.common import units from oslo.config import cfg from wormhole.common import log import functools import uuid import os CONF = cfg.CONF LOG = log.getLogger(__name__...
apache-2.0
cooperra/antlr4
runtime/Python3/src/antlr4/tree/ParseTreePattern.py
17
4090
# # [The "BSD license"] # Copyright (c) 2013 Terence Parr # Copyright (c) 2013 Sam Harwell # Copyright (c) 2014 Eric Vergnaud # 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. Redistributio...
bsd-3-clause
idrogeno/enigma2
lib/python/Plugins/Extensions/Infopanel/CamCheck.py
19
8804
from twisted.internet import threads from Components.config import config from enigma import eTimer, eConsoleAppContainer from os import system, listdir, path, popen from datetime import datetime isBusy = None CFG = "/usr/keys/CCcam.cfg" def CamCheck(): global campoller, POLLTIME POLLTIME = int(config.plugins...
gpl-2.0
rogerscristo/BotFWD
env/lib/python3.6/site-packages/libpasteurize/fixes/fix_kwargs.py
61
6008
u""" Fixer for Python 3 function parameter syntax This fixer is rather sensitive to incorrect py3k syntax. """ # Note: "relevant" parameters are parameters following the first STAR in the list. from lib2to3 import fixer_base from lib2to3.fixer_util import token, String, Newline, Comma, Name from libfuturize.fixer_uti...
mit
Hasimir/letsencrypt
letsencrypt/tests/cli_test.py
12
8446
"""Tests for letsencrypt.cli.""" import itertools import os import shutil import traceback import tempfile import unittest import mock from letsencrypt import account from letsencrypt import configuration from letsencrypt import errors from letsencrypt.tests import renewer_test from letsencrypt.tests import test_uti...
apache-2.0
matzman666/PyPipboy
examples/stimpak.py
1
2087
# -*- coding: utf-8 -*- # # Runs in an infinite loop and watches the current health of the player # When the health falls below 50.0, a stimpak is automatically applied # from pypipboy.datamanager import PipboyDataManager pipboy = PipboyDataManager() def currHpListener(caller, pipvalue, pathObjs): print('Cu...
gpl-3.0
cutoutsy/leetcode
medium/problem142/solution.py
1
1031
#!/usr/bin/python # -*- coding: utf-8 -*- class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def detectCycle(self, head): """ :type head: ListNode :rtype: ListNode """ if head is None: return None ...
apache-2.0
normanmaurer/autobahntestsuite-maven-plugin
src/main/resources/twisted/trial/__init__.py
60
2053
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # # Maintainer: Jonathan Lange """ Asynchronous unit testing framework. Trial extends Python's builtin C{unittest} to provide support for asynchronous tests. Maintainer: Jonathan Lange Trial strives to be compatible with other Python xUnit test...
apache-2.0
chukong/sdkbox-facebook-sample-v2
external/emscripten/third_party/ply/test/yacc_error1.py
174
1530
# ----------------------------------------------------------------------------- # yacc_error1.py # # Bad p_error() function # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tokens # ...
mit
matrixise/odoo
doc/_themes/odoodoc/odoo_pygments.py
129
1723
# -*- coding: utf-8 -*- import imp import sys from pygments.style import Style from pygments.token import * # extracted from getbootstrap.com class OdooStyle(Style): background_color = '#ffffcc' highlight_color = '#fcf8e3' styles = { Whitespace: '#BBB', Error: 'bg:#FAA #A00', Key...
agpl-3.0
Kalyzee/edx-platform
lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py
114
6426
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CourseAuthorization' db.create_table('bulk_email_courseauthorization', ( ('id', ...
agpl-3.0
halvertoluke/edx-platform
common/test/acceptance/tests/studio/test_studio_acid_xblock.py
130
6909
""" Acceptance tests for Studio related to the acid xblock. """ from bok_choy.web_app_test import WebAppTest from ...pages.studio.auto_auth import AutoAuthPage from ...pages.studio.overview import CourseOutlinePage from ...pages.xblock.acid import AcidView from ...fixtures.course import CourseFixture, XBlockFixtureDes...
agpl-3.0
digwanderlust/pants
src/python/pants/cache/artifact_cache.py
1
5543
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
apache-2.0
saulshanabrook/qsturng-py
qsturng.py
2
54002
# Copyright (c) 2011, Roger Lew [see LICENSE.txt] # This software is funded in part by NIH Grant P20 RR016454. """ Implementation of Gleason's (1999) non-iterative upper quantile studentized range approximation. According to Gleason this method should be more accurate than the AS190 FORTRAN algorithm of Lund ...
bsd-3-clause
carnotweat/cpupimp
couchpotato/core/notifications/xmpp_.py
96
2910
from time import sleep import traceback from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification import xmpp log = CPLog(__name__) autoload = 'Xmpp' class Xmpp(Notification): def notify(self, message = '', data = None, listener = None): if not data: data ...
gpl-3.0
NielsZeilemaker/incubator-airflow
airflow/utils/db.py
6
11786
# -*- coding: utf-8 -*- # # 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
asen6/amartyasenguptadotcom
django/db/backends/creation.py
47
22033
import sys import time from django.conf import settings # The prefix to put on the default database name when creating # the test database. TEST_DATABASE_PREFIX = 'test_' class BaseDatabaseCreation(object): """ This class encapsulates all backend-specific differences that pertain to database *creation*, ...
bsd-3-clause
kaiyou/docker-py
docs/conf.py
6
10352
# -*- coding: utf-8 -*- # # docker-sdk-python documentation build configuration file, created by # sphinx-quickstart on Wed Sep 14 15:48:58 2016. # # 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 f...
apache-2.0
moreati/django
tests/gis_tests/gdal_tests/test_ds.py
273
11450
import os import unittest from unittest import skipUnless from django.contrib.gis.gdal import HAS_GDAL from ..test_data import TEST_DATA, TestDS, get_ds_file if HAS_GDAL: from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, GDALException, OGRIndexError, GDAL_VERSION from django.contrib.gis....
bsd-3-clause
tommytarts/QuantumKernelM8-GPe-5.0.1
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
gurghet/matrixled
PIGPIO/x_pigpio.py
3
19743
#!/usr/bin/env python #*** WARNING ************************************************ #* * #* All the tests make extensive use of gpio 4 (pin P1-7). * #* Ensure that either nothing or just a LED is connected to * #* gpio 4 before running any of the tests. ...
mit
wdzhou/mantid
Testing/SystemTests/scripts/performance/xunit_to_sql.py
3
4482
#!/usr/bin/env python """ Module to convert XUnit XML to SQL database of test results of the same type used by python system tests """ import argparse import sys import os import sqlresults from testresult import TestResult, envAsString from xml.dom.minidom import parse, parseString import re import time import dateti...
gpl-3.0
xuxiao19910803/edx-platform
cms/djangoapps/contentstore/views/tests/test_user.py
48
12444
""" Tests for contentstore/views/user.py. """ import json from contentstore.tests.utils import CourseTestCase from contentstore.utils import reverse_course_url from django.contrib.auth.models import User from student.models import CourseEnrollment from student.roles import CourseStaffRole, CourseInstructorRole from st...
agpl-3.0
lhilt/scipy
scipy/fft/_backend.py
4
4814
import scipy._lib.uarray as ua from . import _pocketfft class _ScipyBackend: """The default backend for fft calculations Notes ----- We use the domain ``numpy.scipy`` rather than ``scipy`` because in the future ``uarray`` will treat the domain as a hierarchy. This means the user can install a...
bsd-3-clause
toanalien/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/message_pool.py
129
12235
# Copyright (C) 2011 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 ...
bsd-3-clause
mariusvniekerk/ibis
ibis/_version.py
5
15759
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
apache-2.0
nugget/home-assistant
homeassistant/components/sensor/neurio_energy.py
1
5516
""" Support for monitoring a Neurio energy sensor. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.neurio_energy/ """ import logging from datetime import timedelta import requests.exceptions import voluptuous as vol from homeassistant.components....
apache-2.0
huanpc/IoT-1
gui/controller/controller/utils/kubernetes_tmpl.py
1
89549
OPENHAB_CONFIG = ''' # This is the default configuration file, which comes with every openHAB distribution. # You should do a copy of it with the name 'openhab.cfg' and configure your personal # settings in there. This way you can be sure that they are not overwritten, if you # update openHAB one day. ###############...
mit
praneethkumarpidugu/matchmaking
lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py
3132
36011
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
mit
mozilla/mozilla-ignite
apps/users/urls.py
1
1260
from django.conf import settings from django.conf.urls.defaults import patterns, url urlpatterns = patterns('', url(r'^signout/$', 'users.views.signout', name='users_signout'), url(r'^profile/edit/$', 'users.views.edit', name='users_edit'), url(r'^profile/edit/links/$', 'users.views.links', name='...
bsd-3-clause
morissette/devopsdays-hackathon-2016
venv/lib/python2.7/site-packages/botocore/vendored/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 ...
gpl-3.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/comtypes-1.1.3-py2.7.egg/comtypes/tools/tlbparser.py
4
31063
import sys from comtypes import automation, typeinfo, COMError from comtypes.tools import typedesc from ctypes import c_void_p, sizeof, alignment try: set except NameError: from sets import Set as set # Is the process 64-bit? is_64bits = sys.maxsize > 2**32 ################################ def PTR(typ): ...
gpl-3.0
gao-feng/net
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
socrateslee/ynm3k
ynm3k/ynm3k.py
1
5524
import sys import os import signal import argparse import importlib import six import time from .contrib import bottle from .util import GlobCheckerThread def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("--port", default=8080, help="Port to bind on.") parse...
mit
openstack/tacker
tacker/db/migration/alembic_migrations/versions/3adac34764da_add_column_to_vnf_lcm_op_occs.py
1
1170
# 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
baspijhor/paparazzi
sw/tools/process_exif/process_exif.py
84
7106
#!/usr/bin/python # # <message NAME="DC_SHOT" ID="110"> # <field TYPE="int16" NAME="photo_nr"/> # <field UNIT="cm" TYPE="int32" NAME="utm_east"/> # <field UNIT="cm" TYPE="int32" NAME="utm_north"/> # <field UNIT="m" TYPE="float" NAME="z"/> # <field TYPE="uint8" NAME="utm_zone"/> ...
gpl-2.0
johankaito/fufuka
microblog/old-flask/venv/lib/python2.7/site-packages/pip/index.py
237
47847
"""Routines related to PyPI, indexes""" from __future__ import absolute_import import logging import cgi from collections import namedtuple import itertools import sys import os import re import mimetypes import posixpath import warnings from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor....
apache-2.0
openstack/heat-translator
translator/hot/tosca/etsi_nfv/scalingaspect/tosca_policies_nfv_scalingaspect.py
1
9312
# # 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 under the ...
apache-2.0
ProfessionalIT/maxigenios-website
sdk/google_appengine/lib/django-1.4/django/contrib/localflavor/hr/hr_choices.py
91
2810
# -*- coding: utf-8 -*- """ Sources: Croatian Counties: http://en.wikipedia.org/wiki/ISO_3166-2:HR Croatia doesn't have official abbreviations for counties. The ones provided are in common use. """ from django.utils.translation import ugettext_lazy as _ HR_COUNTY_CHOICES = ( ('GZG', _('Grad Zagreb')),...
mit
jing-bao/pa-chromium
chrome/common/extensions/docs/server2/subversion_file_system_test.py
7
3209
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import os import sys import unittest from fake_url_fetcher import FakeUrlFetcher from file_system import StatInfo from...
bsd-3-clause
heke123/chromium-crosswalk
third_party/python_gflags/setup.py
376
1991
#!/usr/bin/env python # Copyright (c) 2007, 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 l...
bsd-3-clause
rgreinho/craigomatic
craigomatic/apps/craigmine/tests/tests_craigslist.py
1
3717
from datetime import datetime from django.utils import timezone from django.test import TestCase from lxml import html from craigmine.craigslist import Craigslist from craigmine.craigslist import CraigslistItem from craigmine.craigslist import querystring_to_dict from craigmine.tests.ad_samples import FULL_RESULT_PAG...
mit
andrewpaulreeves/soapy
soapy/pyqtgraph/exporters/tests/test_csv.py
30
1665
""" SVG export test """ from __future__ import division, print_function, absolute_import import pyqtgraph as pg import csv import os import tempfile app = pg.mkQApp() def approxeq(a, b): return (a-b) <= ((a + b) * 1e-6) def test_CSVExporter(): tempfilename = tempfile.NamedTemporaryFile(suffix='.csv').name ...
gpl-3.0
yanheven/nova
nova/scheduler/weights/__init__.py
95
1386
# Copyright (c) 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
scrapinghub/dateparser
dateparser/data/date_translation_data/lo.py
1
4922
info = { "name": "lo", "date_order": "DMY", "january": [ "ມກ", "ມັງກອນ" ], "february": [ "ກພ", "ກຸມພາ" ], "march": [ "ມນ", "ມີນາ" ], "april": [ "ມສ", "ເມສາ" ], "may": [ "ພພ", "ພຶດສະພາ" ], ...
bsd-3-clause
mmnelemane/nova
nova/virt/block_device.py
25
18903
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pygments-2.0.2/pygments/lexers/snobol.py
72
2756
# -*- coding: utf-8 -*- """ pygments.lexers.snobol ~~~~~~~~~~~~~~~~~~~~~~ Lexers for the SNOBOL language. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, bygroups from pygments.token import Text,...
mit
mumuwoyou/vnpy-master
sonnet/python/modules/residual_test.py
10
7618
# Copyright 2017 The Sonnet 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 applicable l...
mit
hgl888/chromium-crosswalk
chrome/common/extensions/docs/server2/timer.py
122
1702
# 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 time class Timer(object): '''A simple timer which starts when constructed and stops when Stop is called. ''' def __init__(self): self._st...
bsd-3-clause
ibmsoe/tensorflow
tensorflow/python/framework/sparse_tensor_test.py
56
3371
# 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
dunkhong/grr
grr/server/grr_response_server/databases/db_flows_test.py
2
86479
#!/usr/bin/env python # -*- encoding: utf-8 -*- """Tests for the flow database api.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import random import time from future.builtins import range from future.utils import iteritems import mock import queue ...
apache-2.0
Dino0631/RedRain-Bot
cogs/lib/youtube_dl/extractor/adn.py
11
5532
# coding: utf-8 from __future__ import unicode_literals import base64 import json import os from .common import InfoExtractor from ..aes import aes_cbc_decrypt from ..compat import compat_ord from ..utils import ( bytes_to_intlist, ExtractorError, float_or_none, intlist_to_bytes, srt_subtitles_tim...
gpl-3.0
mimadl3a/stat_excel
vendor/doctrine/orm/docs/en/_exts/configurationblock.py
2577
3506
#Copyright (c) 2010 Fabien Potencier # #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, publish, distrib...
mit
Salat-Cx65/python-for-android
python3-alpha/python3-src/Lib/distutils/tests/test_bdist_wininst.py
53
1038
"""Tests for distutils.command.bdist_wininst.""" import unittest from test.support import run_unittest from distutils.command.bdist_wininst import bdist_wininst from distutils.tests import support class BuildWinInstTestCase(support.TempdirManager, support.LoggingSilencer, ...
apache-2.0
djgagne/scikit-learn
benchmarks/bench_plot_neighbors.py
287
6433
""" Plot the scaling of the nearest neighbors algorithms with k, D, and N """ from time import time import numpy as np import pylab as pl from matplotlib import ticker from sklearn import neighbors, datasets def get_data(N, D, dataset='dense'): if dataset == 'dense': np.random.seed(0) return np....
bsd-3-clause
tdtrask/ansible
lib/ansible/plugins/lookup/first_found.py
20
4304
# (c) 2013, seth vidal <skvidal@fedoraproject.org> red hat, inc # (c) 2017 Ansible Project # 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 DOCUMENTATION = """ lookup: first_found ...
gpl-3.0
abrahamnunes/fitr
fitr/environments/igt.py
2
1233
# -*- coding: utf-8 -*- import numpy as np from fitr.environments.graph import Graph class IGT(Graph): """ Iowa Gambling Task """ def __init__(self,rng=np.random.RandomState()): T = np.zeros((4, 7, 7)) T[0,1,0] = 0.9 # Deck A Reward 100 (9/10) T[0,3,0] = 0.1 # Deck A Reward 100 + Loss -...
gpl-3.0
w1ll1am23/home-assistant
tests/components/locative/test_init.py
6
9200
"""The tests the for Locative device tracker platform.""" from unittest.mock import patch import pytest from homeassistant import data_entry_flow from homeassistant.components import locative from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER_DOMAIN from homeassistant.components.locative imp...
apache-2.0
mandeepdhami/neutron
neutron/plugins/bigswitch/db/consistency_db.py
47
1096
# Copyright 2014, Big Switch Networks # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
aaabhilash97/google-python-exercises
basic/solution/wordcount.py
211
3529
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ """Wordcount exercise Google's Python class The main() below is already defined and comp...
apache-2.0
shootstar/novatest
nova/api/openstack/compute/contrib/migrations.py
3
2622
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
apache-2.0
Hybrid-Cloud/cinder
cinder/volume/drivers/emc/emc_vmax_iscsi.py
5
16261
# Copyright (c) 2012 - 2015 EMC 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 # # Unle...
apache-2.0
danfairs/django-simpledb
simpledb/base.py
1
3672
from djangotoolbox.db.base import NonrelDatabaseFeatures, \ NonrelDatabaseOperations, NonrelDatabaseWrapper, NonrelDatabaseClient, \ NonrelDatabaseValidation, NonrelDatabaseIntrospection, \ NonrelDatabaseCreation # We don't use this, but `model` needs to be imported first due to a # relative import in boto...
bsd-3-clause
joopert/home-assistant
homeassistant/components/x10/light.py
4
2886
"""Support for X10 lights.""" import logging from subprocess import check_output, CalledProcessError, STDOUT import voluptuous as vol from homeassistant.const import CONF_NAME, CONF_ID, CONF_DEVICES from homeassistant.components.light import ( ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light, PLATFORM_SCHEM...
apache-2.0
poljeff/odoo
openerp/report/preprocess.py
443
4700
# -*- 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 GNU...
agpl-3.0
blois/AndroidSDKCloneMin
ndk/prebuilt/linux-x86_64/lib/python2.7/lib2to3/pgen2/conv.py
325
9627
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Convert graminit.[ch] spit out by pgen to Python code. Pgen is the Python parser generator. It is useful to quickly create a parser from a grammar file in Python's grammar notation. But I don't wa...
apache-2.0
houzhenggang/openwrt-hc5661
tools/b43-tools/files/b43-fwsquash.py
494
4767
#!/usr/bin/env python # # b43 firmware file squasher # Removes unnecessary firmware files # # Copyright (c) 2009 Michael Buesch <mb@bu3sch.de> # # Licensed under the GNU/GPL version 2 or (at your option) any later version. # import sys import os def usage(): print("Usage: %s PHYTYPES COREREVS /path/to/extracted/firm...
gpl-2.0
ojii/sandlib
lib/lib-python/2.7/distutils/tests/test_sdist.py
19
16940
"""Tests for distutils.command.sdist.""" import os import tarfile import unittest import warnings import zipfile from os.path import join from textwrap import dedent # zlib is not used here, but if it's not available # the tests that use zipfile may fail try: import zlib except ImportError: zlib = None try: ...
bsd-3-clause
saleemjaveds/https-github.com-openstack-nova
nova/openstack/common/memorycache.py
13
2838
# 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 compliance with the License. You may obtain # a ...
apache-2.0
kjung/scikit-learn
examples/plot_johnson_lindenstrauss_bound.py
127
7477
r""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected i...
bsd-3-clause
louisepb/TexGenScripts
cotton.py
1
2460
# ============================================================================= # TexGen: Geometric textile modeller. # Copyright (C) 2015 Louise Brown # 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
ehfeng/pipet
pipet/sources/stripe/views.py
2
1548
from flask import Blueprint, redirect, request, Response, render_template, url_for from flask_login import current_user, login_required import stripe from pipet.models import db from pipet.sources.stripe import StripeAccount from pipet.sources.stripe.forms import CreateAccountForm from pipet.sources.stripe.models impo...
mit
lihui7115/ChromiumGStreamerBackend
tools/telemetry/build/update_docs.py
103
4616
# 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 logging import optparse import os import pkgutil import pydoc import re import sys import telemetry from telemetry.core import util telemetry_dir = u...
bsd-3-clause
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v3_4_0/cli_credential_broker.py
6
56135
from ..broker import Broker class CLICredentialBroker(Broker): controller = "cli_credentials" def index(self, **kwargs): """Lists the available cli credentials. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this met...
apache-2.0
DolphinDream/sverchok
nodes/curve/curve_frame_on_surface.py
2
4838
import numpy as np from mathutils import Matrix, Vector import bpy from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode, zip_long_repeat, ensure_nesting_level from sverchok.utils.curve import SvC...
gpl-3.0
weidongxu84/info-gatherer
django/core/mail/message.py
83
13091
import mimetypes import os import random import time from email import charset as Charset, encoders as Encoders from email.generator import Generator from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email.header import Header from email.utils ...
mit
zwpaper/shadowsocks
shadowsocks/common.py
945
8921
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013-2015 clowwindy # # 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 requi...
apache-2.0
vitaly-krugl/nupic
src/nupic/encoders/scalar.py
4
25257
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This p...
agpl-3.0
okolisny/integration_tests
cfme/tests/control/test_alerts.py
1
14560
# -*- coding: utf-8 -*- import fauxfactory import pytest from datetime import datetime, timedelta from cfme import test_requirements from cfme.common.vm import VM from cfme.control.explorer import alert_profiles, policies from cfme.infrastructure.provider import InfraProvider from cfme.infrastructure.provider.scvmm im...
gpl-2.0
skoolkid/pyskool
pyskool/image.py
1
10147
# -*- coding: utf-8 -*- # Copyright 2010, 2012-2014 Richard Dymond (rjdymond@gmail.com) # # This file is part of Pyskool. # # Pyskool is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the Li...
gpl-3.0
jimmyye/django-devserver
devserver/modules/request.py
13
2777
import urllib from devserver.modules import DevServerModule class SessionInfoModule(DevServerModule): """ Displays information about the currently authenticated user and session. """ logger_name = 'session' def process_request(self, request): self.has_session = bool(getattr(request, 'se...
bsd-3-clause
mjfarmer/scada_py
env/lib/python2.7/site-packages/pip/baseparser.py
45
8124
"""Base option parser setup""" import sys import optparse import os import textwrap from distutils.util import strtobool from pip.backwardcompat import ConfigParser, string_types from pip.locations import default_config_file from pip.util import get_terminal_size, get_prog class PrettyHelpFormatter(optparse.Indente...
gpl-3.0
chenjun0210/tensorflow
tensorflow/python/kernel_tests/sparse_concat_op_test.py
138
13011
# 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
draugiskisprendimai/odoo
addons/website_blog/wizard/document_page_show_diff.py
372
2184
# -*- 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
localwiki/localwiki-backend-server
localwiki/utils/urlresolvers.py
3
1091
from django.core.urlresolvers import reverse as django_reverse from django.core.urlresolvers import get_urlconf, NoReverseMatch from django.conf import settings from django_hosts.reverse import reverse_full def reverse(viewname, urlconf=None, args=None, kwargs=None, prefix=None, current_app=None): original_kwarg...
gpl-2.0
chrislyon/dj_ds1
static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_charmapcodec.py
175
1794
""" Python character mapping codec test This uses the test codec in testcodec.py and thus also tests the encodings package lookup scheme. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright 2000 Guido van Rossum. """#" import test.support, unittest import codecs # Register a search function which know...
gpl-2.0
NERC-CEH/jules-jasmin
majic/joj/tests/unit/test_driving_data_helper.py
1
8411
""" # Majic # Copyright (C) 2014 CEH # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This pr...
gpl-2.0
SWENG500-Team1/FitnessForSplunk
fitness_for_splunk/bin/pyasn1_modules/rfc2314.py
127
1170
# # PKCS#10 syntax # # ASN.1 source from: # http://tools.ietf.org/html/rfc2314 # # Sample captures could be obtained with "openssl req" command # from pyasn1.type import tag, namedtype, namedval, univ, constraint from pyasn1_modules.rfc2459 import * class Attributes(univ.SetOf): componentType = Attribute() class ...
mit
denisenkom/django
tests/migrate_signals/tests.py
11
2627
from django.db.models import signals from django.test import TestCase from django.core import management from django.utils import six from . import models PRE_MIGRATE_ARGS = ['app', 'create_models', 'verbosity', 'interactive', 'db'] MIGRATE_DATABASE = 'default' MIGRATE_VERBOSITY = 1 MIGRATE_INTERACTIVE = False cla...
bsd-3-clause
pycoin/pycoin
pycoin/services/chain_so.py
3
1632
import io import json try: from urllib2 import urlopen except ImportError: from urllib.request import urlopen from pycoin.networks.default import get_current_netcode from pycoin.serialize import b2h_rev, h2b, h2b_rev from pycoin.tx import Spendable, Tx class ChainSoProvider(object): def __init__(self, n...
mit
jshiv/turntable
test/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py
69
2285
import calendar from email.utils import formatdate, parsedate from datetime import datetime, timedelta def expire_after(delta, date=None): date = date or datetime.now() return date + delta def datetime_to_header(dt): return formatdate(calendar.timegm(dt.timetuple())) class BaseHeuristic(object): ...
mit
guillermooo-forks/Vintageous
ex/parser/scanner_command_write_and_quit_command.py
9
1715
from .state import EOF from .tokens import TokenEof from .tokens_base import TOKEN_COMMAND_WRITE_AND_QUIT_COMMAND from .tokens_base import TokenOfCommand from Vintageous import ex plus_plus_translations = { 'ff': 'fileformat', 'bin': 'binary', 'enc': 'fileencoding', 'nobin': 'nobinary', } @ex.comman...
mit