repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
citrix-openstack-build/swift3
swift3/test/unit/test_swift3.py
2
32421
# Copyright (c) 2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
nickpandolfi/linereader
linereader/__init__.py
2
1727
__author__ = 'Nicholas C Pandolfi' #The MIT License (MIT) # #Copyright (c) 2014 Nicholas C Pandolfi # #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 lim...
mit
mbbill/shadowsocks
tests/nose_plugin.py
1072
1164
#!/usr/bin/env python # # Copyright 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 required by applicable law or ...
apache-2.0
otheng03/nbase-arc
redis-3.2.9/tests/nbase-arc/redis.py
3
3992
# # Copyright 2015 Naver Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
dellysunnymtech/sakoman-oe
contrib/sakoman/build/extras/autobuilder/ipkg-utils/arfile.py
2
3493
""" arfile - A module to parse GNU ar archives. Copyright (c) 2006-7 Paul Sokolovsky This file is released under the terms of GNU General Public License v2 or later. """ import sys import os import tarfile class FileSection: "A class which allows to treat portion of file as separate file object." def __in...
mit
twobob/buildroot-kindle
output/build/host-python-2.7.2/Lib/distutils/version.py
259
11433
# # distutils/version.py # # Implements multiple version numbering conventions for the # Python Module Distribution Utilities. # # $Id$ # """Provides classes to represent module version numbers (one class for each style of version numbering). There are currently two such classes implemented: StrictVersion and LooseVe...
gpl-2.0
Wang-OuYang/WarChess
cocos2d/plugin/tools/toolsForGame/modifyProject.py
255
1300
import sys, string, os from xml.etree import ElementTree as ET from xml.dom import minidom projFile = sys.argv[1] targetPath = sys.argv[2] def getLinkElement(): global targetPath ret = ET.Element('link') nameEle = ET.Element('name') nameEle.text = 'plugin-x' typeEle = ET.Element('type') typeEl...
gpl-2.0
insertnamehere1/maraschino
lib/sqlalchemy/util/deprecations.py
22
3906
# util/deprecations.py # Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Helpers related to deprecation of functions, methods, classes, other functiona...
mit
moonboots/tensorflow
tensorflow/python/tools/freeze_graph.py
15
5585
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
Cloudino/Cloudino-Arduino-IDE
libraries/PubSubClient/tests/testcases/mqtt_publish_in_callback.py
42
1938
import unittest import settings import time import mosquitto import serial def on_message(mosq, obj, msg): obj.message_queue.append(msg) class mqtt_publish_in_callback(unittest.TestCase): message_queue = [] @classmethod def setUpClass(self): self.client = mosquitto.Mosquitto("pubsubclient_ut", cle...
lgpl-2.1
smartforceplus/SmartForceplus
addons/email_template/wizard/mail_compose_message.py
27
11709
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
erickt/hue
desktop/core/ext-py/Django-1.6.10/django/db/models/fields/subclassing.py
227
1815
""" Convenience routines for creating non-trivial Field subclasses, as well as backwards compatibility utilities. Add SubfieldBase as the metaclass for your Field subclass, implement to_python() and the other necessary methods and everything will work seamlessly. """ class SubfieldBase(type): """ A metaclass ...
apache-2.0
chouseknecht/ansible
test/units/modules/cloud/amazon/test_redshift_cross_region_snapshots.py
42
1356
from ansible.modules.cloud.amazon import redshift_cross_region_snapshots as rcrs mock_status_enabled = { 'SnapshotCopyGrantName': 'snapshot-us-east-1-to-us-west-2', 'DestinationRegion': 'us-west-2', 'RetentionPeriod': 1, } mock_status_disabled = {} mock_request_illegal = { 'snapshot_copy_grant': 'cha...
gpl-3.0
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/OpenGL/GL/NV/framebuffer_multisample_coverage.py
4
1564
'''OpenGL extension NV.framebuffer_multisample_coverage This module customises the behaviour of the OpenGL.raw.GL.NV.framebuffer_multisample_coverage to provide a more Python-friendly API Overview (from the spec) This extension extends the EXT_framebuffer_multisample specification by providing a new function, ...
agpl-3.0
norrs/debian-tomahawk
thirdparty/breakpad/third_party/protobuf/protobuf/gtest/test/gtest_env_var_test.py
233
3509
#!/usr/bin/env python # # Copyright 2008, 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...
gpl-3.0
Frontier314/loftq-linux
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
lulandco/SickRage
lib/stevedore/driver.py
21
5496
from .exception import NoMatches, MultipleMatches from .named import NamedExtensionManager class DriverManager(NamedExtensionManager): """Load a single plugin with a given name from the namespace. :param namespace: The namespace for the entry points. :type namespace: str :param name: The name of the ...
gpl-3.0
Lilykos/invenio
invenio/modules/previewer/bundles.py
11
1881
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
samirasnoun/django_cms_gallery_image
cms/south_migrations/0064_staticplaceholder_site_change.py
63
17484
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): for sp in orm['cms.StaticPlaceholder'].objects.all(): sp.site = None ...
bsd-3-clause
hakonsbm/nest-simulator
pynest/nest/tests/test_connect_symmetric_pairwise_bernoulli.py
2
5160
# -*- coding: utf-8 -*- # # test_connect_symmetric_pairwise_bernoulli.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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-2.0
Edraak/circleci-edx-platform
lms/djangoapps/instructor/views/gradebook_api.py
28
4309
""" Grade book view for instructor and pagination work (for grade book) which is currently use by ccx and instructor apps. """ import math from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import transaction from django.views.decorators.cache import cache_control ...
agpl-3.0
shiminasai/ciat_plataforma
guias_cacao/models.py
2
153154
# -*- coding: utf-8 -*- from django.db import models from django.contrib.auth.models import User from mapeo.models import Persona from sorl.thumbnail import ImageField from multiselectfield import MultiSelectField # Create your models here. class FichaSombra(models.Model): productor = models.ForeignKey( Pe...
mit
mute/elasticsearch
dev-tools/build_release.py
27
34065
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
apache-2.0
kastriothaliti/techstitution
venv/lib/python3.5/site-packages/flask/config.py
781
6234
# -*- coding: utf-8 -*- """ flask.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import imp import os import errno from werkzeug.utils import import_string from ._compat import string_type...
gpl-3.0
isandlaTech/cohorte-demos
led/dump/led-demo-yun/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/requests/packages/chardet/langthaimodel.py
2930
11275
######################## 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...
apache-2.0
hojel/calibre
src/calibre/utils/opensearch/query.py
24
2570
# -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL 3' __copyright__ = '2006, Ed Summers <ehs@pobox.com>' __docformat__ = 'restructuredtext en' from urlparse import urlparse, urlunparse, parse_qs from urllib import urlencode class Query(obj...
gpl-3.0
clofresh/xbmc-vhx
resources/lib/requests/sessions.py
4
8911
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ from .defaults import defaults from .models import Request from .hooks import dispatch_hook from .utils import header_expand from .packages...
bsd-3-clause
m0ppers/arangodb
3rdParty/V8/V8-5.0.71.39/tools/perf-to-html.py
32
9164
#!/usr/bin/env python # Copyright 2015 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. ''' python %prog Convert a perf trybot JSON file into a pleasing HTML page. It can read from standard input or via the --filename opt...
apache-2.0
savoirfairelinux/OpenUpgrade
openerp/addons/base/module/wizard/base_module_upgrade.py
40
4914
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
savoirfairelinux/OpenUpgrade
openerp/tools/float_utils.py
151
9267
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
prutseltje/ansible
lib/ansible/modules/cloud/amazon/aws_caller_facts.py
12
2484
#!/usr/bin/python # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: aws_caller_facts short_de...
gpl-3.0
bankonmeOS/cjdns
node_build/dependencies/cnacl/crypto_sign/ed25519/ref10/base2.py
77
1231
b = 256 q = 2**255 - 19 l = 2**252 + 27742317777372353535851937790883648493 def expmod(b,e,m): if e == 0: return 1 t = expmod(b,e/2,m)**2 % m if e & 1: t = (t*b) % m return t def inv(x): return expmod(x,q-2,q) d = -121665 * inv(121666) I = expmod(2,(q-1)/4,q) def xrecover(y): xx = (y*y-1) * inv(d*y*y+1)...
gpl-3.0
orcasgit/django-template-field
setup.py
1
2109
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import templatefield try: from setuptools import setup except ImportError: from distutils.core import setup version = templatefield.__version__ if sys.argv[-1] == 'publish': try: import wheel except ImportError: prin...
bsd-3-clause
clemenshage/grslra
experiments/plot_lpnorms.py
1
1564
import matplotlib from matplotlib import pyplot as plt import numpy as np matplotlib.rcParams.update({'font.size': 24}) matplotlib.rcParams.update({'text.usetex': True}) def lpnorm_scaled(x, p, mu): return (lpnorm(x, p, mu) - lpnorm(0, p, mu)) / (lpnorm(1, p, mu) - lpnorm(0, p, mu)) def lpnorm(x, p, mu): r...
mit
simonwangw/googlemock
scripts/upload.py
2511
51024
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
bsd-3-clause
vladpopovici/WSItk
WSItk/tools/wsi_bot_apply.py
2
4768
# -*- coding: utf-8 -*- """ WSI_BOT_APPLY Assigns all patches in an image to one of the clusters in the codebook. @author: vlad """ from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * __author__ = 'Vlad Popovici' __version__ = 0.01 import argparse as opt from...
mit
Juniper/tempest
tempest/lib/api_schema/response/compute/v2_1/interfaces.py
13
2276
# Copyright 2014 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
naojsoft/qplan
qplan/plugins/AirMassChart.py
1
4344
# # AirMassChart.py -- AirMass chart plugin # # Eric Jeschke (eric@naoj.org) # from datetime import timedelta #from dateutil import tz from ginga.gw import Widgets, Plot from ginga.misc import Bunch from qplan.plugins import PlBase from qplan.plots.airmass import AirMassPlot class AirMassChart(PlBase.Plugin): ...
bsd-3-clause
skywin/p2pool
p2pool/test/bitcoin/test_data.py
272
4635
import unittest from p2pool.bitcoin import data, networks from p2pool.util import pack class Test(unittest.TestCase): def test_header_hash(self): assert data.hash256(data.block_header_type.pack(dict( version=1, previous_block=0x000000000000038a2a86b72387f93c51298298a732079b3b686df...
gpl-3.0
pre-commit/pre-commit
tests/languages/ruby_test.py
1
2645
import os.path import tarfile from unittest import mock import pytest import pre_commit.constants as C from pre_commit import parse_shebang from pre_commit.languages import ruby from pre_commit.prefix import Prefix from pre_commit.util import cmd_output from pre_commit.util import resource_bytesio from testing.util i...
mit
minixalpha/spark
python/pyspark/mllib/tree.py
46
24110
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
sxpert/ansible-modules-core
packaging/os/rhn_register.py
122
12900
#!/usr/bin/python # (c) James Laska # # 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. # # A...
gpl-3.0
denbedilov/ATTENDER
server/attender-mobile/lib/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 ...
mit
radianbaskoro/mathdoku-solver
mathdokusolver/Solver.py
1
13846
''' MathDoku solver module. @author: Radian Baskoro ''' import itertools from datetime import datetime from Utility import Utility class Solver: ''' Solver class used to solve the MathDoku problem. ''' __debugLevel = 0 __iterationCount = 0 __initFlag = False boardSize = 0 ...
apache-2.0
jhoos/django
django/contrib/admin/helpers.py
7
14344
from __future__ import unicode_literals import warnings from django import forms from django.conf import settings from django.contrib.admin.templatetags.admin_static import static from django.contrib.admin.utils import ( display_for_field, flatten_fieldsets, help_text_for_field, label_for_field, lookup_field,...
bsd-3-clause
WoLpH/EventGhost
lib27/site-packages/requests/packages/chardet/euctwfreq.py
3133
34872
######################## 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...
gpl-2.0
great-expectations/great_expectations
tests/execution_engine/test_sqlalchemy_execution_engine.py
1
23179
import logging import os import pandas as pd import pytest from great_expectations.core.batch_spec import ( RuntimeQueryBatchSpec, SqlAlchemyDatasourceBatchSpec, ) from great_expectations.data_context.util import file_relative_path from great_expectations.exceptions import GreatExpectationsError from great_ex...
apache-2.0
ThiefMaster/indico
indico/modules/designer/pdf.py
4
6842
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import re from collections import namedtuple from io import BytesIO from PIL import Image from reportlab....
mit
gurneyalex/odoo
doc/_extensions/odoo_ext/switcher.py
27
1543
from docutils import nodes, utils from docutils.parsers.rst import Directive from pygments.lexers import get_lexer_by_name, PythonLexer PythonLexer.name = 'Python 2' def setup(app): app.add_directive('switcher', SwitcherDirective) app.add_directive('case', CaseDirective) class SwitcherDirective(Directive): ...
agpl-3.0
thatchristoph/namebench
nb_third_party/httplib2/__init__.py
451
51082
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyrigh...
apache-2.0
paulmadore/Eric-IDE
6-6.0.9/eric/Helpviewer/UserAgent/UserAgentManager.py
2
7095
# -*- coding: utf-8 -*- # Copyright (c) 2012 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a user agent manager. """ from __future__ import unicode_literals import os from PyQt5.QtCore import pyqtSignal, QObject, QXmlStreamReader from E5Gui import E5MessageBox from Utilities.AutoSa...
gpl-3.0
xq262144/hue
desktop/core/ext-py/Django-1.6.10/django/db/backends/dummy/base.py
114
2198
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends import * from django.db.back...
apache-2.0
lintzc/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/filerep/Filerep_Resync/test_filerep_resync.py
9
4156
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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
apollo13/ansible
test/integration/targets/collections/collections/ansible_collections/testns/content_adj/plugins/inventory/statichost.py
44
2221
# Copyright (c) 2018 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 = ''' inventory: statichost short_description: Add a single host descripti...
gpl-3.0
csantoshc/Synapse-Detection
Tools/libsvm-3.12/libsvm-3.12/tools/easy.py
152
2699
#!/usr/bin/env python import sys import os from subprocess import * if len(sys.argv) <= 1: print('Usage: {0} training_file [testing_file]'.format(sys.argv[0])) raise SystemExit # svm, grid, and gnuplot executable files is_win32 = (sys.platform == 'win32') if not is_win32: svmscale_exe = "../svm-scale" svmtrain_...
mit
Bismarrck/pymatgen
pymatgen/alchemy/transmuters.py
1
16738
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import unicode_literals """ This module implements various transmuter classes. Transmuters are essentially classes that generate TransformedStructures from various data sources. They enable the...
mit
hrishioa/Aviato
flask/Lib/site-packages/setuptools/_backport/hashlib/_sha.py
77
9982
# -*- coding: iso-8859-1 -*- """A sample implementation of SHA-1 in pure Python. Framework adapted from Dinu Gherman's MD5 implementation by J. Hallén and L. Creighton. SHA-1 implementation based directly on the text of the NIST standard FIPS PUB 180-1. """ __date__ = '2004-11-17' __version__ = 0.91 # Mo...
gpl-2.0
rrooij/youtube-dl
youtube_dl/extractor/wdr.py
23
12523
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( determine_ext, ExtractorError, js_to_json, strip_jsonp, try_get, unified_strdate, update_url_query, ur...
unlicense
spectra-cluster/spectra-cluster-py
spectra_cluster/ui/clustering_stats.py
1
4988
"""clustering_stats Extracts basic statistics (ie. number of clusters, incorrectly clustered spectra) from .clustering files. This script only creates meaningful results if the .clustering file contains identification data which will be used to evaluate correctly and incorrectly clustered spectra. Usage: clusteri...
apache-2.0
benjaminrigaud/django
django/utils/numberformat.py
337
1775
from django.conf import settings from django.utils.safestring import mark_safe from django.utils import six def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='', force_grouping=False): """ Gets a number (as a number or string), and returns it as a string, using formats ...
bsd-3-clause
alon/servo
tests/wpt/web-platform-tests/cors/resources/status.py
220
1223
def main(request, response): response.headers.set("Access-Control-Allow-Origin", request.headers.get("origin") ) response.headers.set("Access-Control-Expose-Headers", "X-Request-Method") if request.method == 'OPTIONS': response.headers.set("Access-Control-Allow-Methods", "GET, CHICKEN, HEAD, POST,...
mpl-2.0
tdhopper/scikit-learn
examples/linear_model/plot_ols_ridge_variance.py
387
2060
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Ordinary Least Squares and Ridge Regression Variance ========================================================= Due to the few points in each dimension and the straight line that linear regression uses to follow thes...
bsd-3-clause
seanli9jan/tensorflow
tensorflow/python/kernel_tests/decode_bmp_op_test.py
8
3135
# 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
LinuxChristian/home-assistant
homeassistant/components/scene/__init__.py
10
3131
""" Allow users to set and activate scenes. For more details about this component, please refer to the documentation at https://home-assistant.io/components/scene/ """ import asyncio import logging import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, CONF_PLATFORM, SERVICE_TURN_ON) from hom...
apache-2.0
ScorpionResponse/freelancefinder
freelancefinder/notifications/models.py
1
5186
"""Define the notification type and track sent notifications.""" import logging from smtplib import SMTPException from future.utils import python_2_unicode_compatible from model_utils import Choices from model_utils.fields import MonitorField from model_utils.models import TimeStampedModel from django.conf import se...
bsd-3-clause
Shiroy/servo
tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
mpl-2.0
Jusedawg/SickRage
sickbeard/metadata/tivo.py
7
13573
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # Author: Gordon Turner <gordonturner@gordonturner.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publis...
gpl-3.0
OneRom/external_skia
tools/skp/page_sets/skia_ugamsolutions_desktop.py
30
1252
# Copyright 2014 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. # pylint: disable=W0401,W0614 from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class SkiaBuildbotDesk...
bsd-3-clause
BaichuanWu/Blog_on_django
site-packages/django/contrib/redirects/tests.py
112
3358
from django import http from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase, modify_settings, override_settings from django.utils import six from .middleware import RedirectFallbackMiddleware from .models...
mit
crafty78/ansible
lib/ansible/modules/utilities/logic/include_role.py
34
2684
#!/usr/bin/python # -*- mode: python -*- # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the...
gpl-3.0
gearbox/GAE
lib/flask/config.py
781
6234
# -*- coding: utf-8 -*- """ flask.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import imp import os import errno from werkzeug.utils import import_string from ._compat import string_type...
apache-2.0
samvarankashyap/linch-pin
linchpin/provision/roles/openshift/files/inventory.py
3
1896
#!/usr/bin/env python from __future__ import absolute_import from collections import OrderedDict from linchpin.InventoryFilters.InventoryFilter import InventoryFilter class Inventory(InventoryFilter): DEFAULT_HOSTNAMES = ['metadata.name'] def get_host_data(self, res, cfgs): """ Returns a d...
gpl-3.0
debkbanerji/super-mem
ocrtest/myenv/lib/python2.7/site-packages/pip/compat/__init__.py
342
4672
"""Stuff that differs in different Python versions and platform distributions.""" from __future__ import absolute_import, division import os import sys from pip._vendor.six import text_type try: from logging.config import dictConfig as logging_dictConfig except ImportError: from pip.compat.dictconfig import ...
mit
captiosus/treadmill
treadmill/sproc/appmonitor.py
1
6275
"""Syncronizes cell Zookeeper with LDAP data. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import collections import itertools import logging import math import time import click import six from treadmill im...
apache-2.0
kustodian/ansible
lib/ansible/module_utils/facts/system/platform.py
66
4075
# 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 distributed in the hope that ...
gpl-3.0
postlund/home-assistant
tests/components/zwave/test_switch.py
11
2347
"""Test Z-Wave switches.""" from unittest.mock import patch from homeassistant.components.zwave import switch from tests.mock.zwave import MockEntityValues, MockNode, MockValue, value_changed def test_get_device_detects_switch(mock_openzwave): """Test get_device returns a Z-Wave switch.""" node = MockNode()...
apache-2.0
leighpauls/k2cro4
third_party/webdriver/pylib/test/selenium/test_default_server.py
16
2107
""" Copyright 2011 Software Freedom Conservancy. 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...
bsd-3-clause
MuckRock/muckrock
muckrock/crowdsource/rules.py
1
2301
"""Rules based permissions for the crowdsource app""" # pylint: disable=missing-docstring, unused-argument, invalid-unary-operand-type # Third Party from rules import add_perm, always_deny, is_staff, predicate # MuckRock from muckrock.foia.rules import has_feature_level, skip_if_not_obj, user_authenticated @predic...
agpl-3.0
BaconPancakes/valor
lib/youtube_dl/extractor/metacritic.py
73
2675
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( fix_xml_ampersands, ) class MetacriticIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?metacritic\.com/.+?/trailers/(?P<id>\d+)' _TESTS = [{ 'url': 'http://www.metacritic.com/game/plays...
gpl-3.0
tzewangdorje/SIPserv
Twisted-13.1.0/twisted/names/test/test_common.py
9
4287
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.names.common}. """ from __future__ import division, absolute_import from zope.interface.verify import verifyClass from twisted.internet.interfaces import IResolver from twisted.trial.unittest import SynchronousTestCase f...
gpl-3.0
tumf/litecoin
contrib/testgen/base58.py
2139
2818
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
mit
ghostlines/ghostlines-robofont
src/lib/site-packages/requests/packages/idna/idnadata.py
155
35172
# This file is automatically generated by build-idnadata.py scripts = { 'Greek': ( (0x370, 0x374), (0x375, 0x378), (0x37a, 0x37e), (0x384, 0x385), (0x386, 0x387), (0x388, 0x38b), (0x38c, 0x38d), (0x38e, 0x3a2), (0x3a3, 0x3e2), (0x3f0, ...
mit
miaecle/deepchem
examples/hopv/hopv_graph_conv.py
4
1203
""" Script that trains graph-conv models on HOPV dataset. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import numpy as np from deepchem.models import GraphConvModel np.random.seed(123) import tensorflow as tf tf.random.set_seed(123) import deepchem...
mit
pulpocoders/pulpo-forms-examples
pulpo_example/fields.py
2
1110
from pulpo_forms.fieldtypes import ModelField from pulpo_forms.fieldtypes import FieldFactory from .models import PulpoUser, Club, Country class PulpoUserField(ModelField.ModelField): prp_template_name = "usuario/properties.html" model = PulpoUser name = "PulpoUser" def get_assets(): return [...
apache-2.0
chenc10/Spark-PAF
dist/ec2/lib/boto-2.34.0/tests/unit/sqs/test_connection.py
90
12763
#!/usr/bin/env python # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # ...
apache-2.0
eliran-stratoscale/inaugurator
inaugurator/pyudev/device.py
3
37036
# -*- coding: utf-8 -*- # Copyright (C) 2011, 2012 Sebastian Wiesner <lunaryorn@gmail.com> # This library 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 2.1 of the License, or (at your ...
apache-2.0
Mendeley/mendeley-python-sdk
mendeley/models/profiles.py
2
2355
import arrow from mendeley.models.common import Discipline, Photo, Location, Education, Employment from mendeley.response import SessionResponseObject class Profile(SessionResponseObject): """ A Mendeley profile. .. attribute:: id .. attribute:: first_name .. attribute:: last_name .. attribu...
apache-2.0
maliciamrg/xbmc-addon-tvtumbler
resources/lib/dns/message.py
28
42234
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-3.0
DennisDenuto/puppet-commonscripts
files/aws_cli/AWS-ElasticBeanstalk-CLI-2.6.3/eb/macosx/python2.7/lib/aws/http_client.py
11
1992
#!/usr/bin/env python #============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the...
mit
misttechnologies/selenium
py/test/selenium/webdriver/common/select_class_tests.py
19
15214
#!/usr/bin/python # Copyright 2011 Software Freedom Conservancy. # # 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
hsteinhaus/ardupilot
mk/PX4/Tools/genmsg/src/genmsg/__init__.py
215
2116
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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 ...
gpl-3.0
mfriesen/tentacle
src/tentacle/cthulhu/__init__.py
1
2464
#!python import json import os.path import cherrypy from cherrypy import tools from mako.lookup import TemplateLookup from tentacle.cthulhu.operation import CthulhuData from tentacle.cthulhu.datastore import * from tentacle.shared.screed import Screed from aetypes import end print '------------- CThulhu is alive' c...
apache-2.0
litvinchuck/python-scripts
daemon/daemon_builder.py
2
1062
import signal from .daemon import Daemon from .signal_handler import SignalHandler class DaemonBuilder: """Builder class for Daemon""" @staticmethod def build(main_function, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): """Builds the daemon and returns SignalHandler instanc...
mit
ouiliame/ps.py
xlwt/Row.py
30
11779
# -*- coding: windows-1252 -*- import BIFFRecords import Style from Cell import StrCell, BlankCell, NumberCell, FormulaCell, MulBlankCell, BooleanCell, ErrorCell, \ _get_cells_biff_data_mul import ExcelFormula import datetime as dt from Formatting import Font try: from decimal import Decimal except ImportErro...
mit
40223221/w16b_test
static/Brython3.1.1-20150328-091302/Lib/xml/dom/xmlbuilder.py
873
12377
"""Implementation of the DOM Level 3 'LS-Load' feature.""" import copy import xml.dom from xml.dom.NodeFilter import NodeFilter __all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"] class Options: """Features object that has variables set for each DOMBuilder feature. The DOMBuilder class uses a...
gpl-3.0
rahulunair/nova
nova/tests/unit/scheduler/client/test_report.py
1
174484
# 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
gram526/VTK
ThirdParty/Twisted/twisted/conch/test/test_scripts.py
41
1874
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the command-line interfaces to conch. """ try: import pyasn1 except ImportError: pyasn1Skip = "Cannot run without PyASN1" else: pyasn1Skip = None try: import Crypto except ImportError: cryptoSkip = "can't run w...
bsd-3-clause
mskrzypkows/servo
tests/wpt/css-tests/tools/wptserve/wptserve/handlers.py
86
12804
import cgi import json import os import traceback import urllib import urlparse from constants import content_types from pipes import Pipeline, template from ranges import RangeParser from request import Authentication from response import MultipartContent from utils import HTTPException __all__ = ["file_handler", "p...
mpl-2.0
dalegregory/odoo
addons/account/wizard/account_open_closed_fiscalyear.py
237
2537
# -*- 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
firstval/micropython
examples/SDdatalogger/datalogger.py
98
1168
# datalogger.py # Logs the data from the acceleromter to a file on the SD-card import pyb # creating objects accel = pyb.Accel() blue = pyb.LED(4) switch = pyb.Switch() # loop while True: # wait for interrupt # this reduces power consumption while waiting for switch press pyb.wfi() # start if switc...
mit