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
Aristocles/CouchPotatoServer
libs/chardet/latin1prober.py
191
5108
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
abagh0703/RetailTrail
flask/lib/python2.7/site-packages/sqlalchemy/testing/engines.py
55
9359
# testing/engines.py # Copyright (C) 2005-2016 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 from __future__ import absolute_import import weakref from . import config from ...
mit
morsdatum/ArangoDB
3rdParty/V8/tools/testrunner/server/signatures.py
123
2816
# Copyright 2012 the V8 project authors. 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 conditi...
apache-2.0
jmavis/GovernmentBudgetVisualization
CityBudgetVisualization/CityBudgetVisualization/settings.py
1
2689
""" Django settings for CityBudgetVisualization project. Generated by 'django-admin startproject' using Django 1.8.4. 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/ "...
mit
dahool/vertaal
app/auth.py
2
1520
# -*- coding: utf-8 -*- """Copyright (c) 2013, Sergio Gabriel Teves All rights reserved. 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...
gpl-3.0
mxOBS/deb-pkg_trusty_chromium-browser
third_party/libvpx/source/libvpx/tools/cpplint.py
104
182862
#!/usr/bin/python # # Copyright (c) 2009 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 ...
bsd-3-clause
NL66278/odoo
addons/account/res_config.py
42
24393
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
joeyt83/androguard
androguard/core/binaries/idawrapper.py
38
5555
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # 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...
apache-2.0
mmnelemane/neutron
neutron/tests/unit/extensions/test_extra_dhcp_opt.py
40
13242
# Copyright (c) 2013 OpenStack Foundation. # # 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...
apache-2.0
beni55/django
tests/resolve_url/tests.py
32
3153
from __future__ import unicode_literals from django.contrib.auth.views import logout from django.core.urlresolvers import NoReverseMatch, reverse_lazy from django.shortcuts import resolve_url from django.test import TestCase, ignore_warnings, override_settings from django.utils import six from django.utils.deprecation...
bsd-3-clause
teriyakichild/ansible-modules-extras
cloud/amazon/ec2_remote_facts.py
42
5671
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that i...
gpl-3.0
veger/ansible
test/integration/targets/module_utils/library/test.py
172
2948
#!/usr/bin/python # Most of these names are only available via PluginLoader so pylint doesn't # know they exist # pylint: disable=no-name-in-module results = {} # Test import with no from import ansible.module_utils.foo0 results['foo0'] = ansible.module_utils.foo0.data # Test depthful import with no from import ansib...
gpl-3.0
harikishen/addons-server
src/olympia/amo/cache_nuggets.py
2
3801
import functools import hashlib import itertools import re import uuid from django.conf import settings from django.core.cache import cache def memoize_key(prefix, *args, **kwargs): """ For a prefix and arguments returns a key suitable for use in memcache. Used by memoize. :param prefix: a prefix fo...
bsd-3-clause
jiangzhonglian/MachineLearning
src/py2.x/ml/5.Logistic/sklearn_logisticRegression_demo.py
1
7834
#!/usr/bin/python # coding: utf8 ''' Created on Oct 27, 2010 Update on 2017-05-18 Logistic Regression Working Module Author: 小瑶 GitHub: https://github.com/apachecn/AiLearning scikit-learn的例子地址:http://scikit-learn.org/stable/modules/linear_model.html#logistic-regression ''' # 逻辑回归中的 L1 惩罚和稀缺性 L1 Penalty and Sparsity ...
gpl-3.0
suncycheng/intellij-community
python/lib/Lib/site-packages/django/db/__init__.py
94
4251
from django.conf import settings from django.core import signals from django.core.exceptions import ImproperlyConfigured from django.db.utils import ConnectionHandler, ConnectionRouter, load_backend, DEFAULT_DB_ALIAS, \ DatabaseError, IntegrityError from django.utils.functional import curry ...
apache-2.0
ingadhoc/odoo
addons/website_hr_recruitment/controllers/main.py
78
6112
# -*- coding: utf-8 -*- import base64 from openerp import SUPERUSER_ID from openerp import http from openerp.tools.translate import _ from openerp.http import request from openerp.addons.website.models.website import slug class website_hr_recruitment(http.Controller): @http.route([ '/jobs', '/job...
agpl-3.0
Ziqi-Li/bknqgis
pandas/doc/sphinxext/numpydoc/phantom_import.py
6
5851
""" ============== phantom_import ============== Sphinx extension to make directives from ``sphinx.ext.autodoc`` and similar extensions to use docstrings loaded from an XML file. This extension loads an XML file in the Pydocweb format [1] and creates a dummy module that contains the specified docstrings. This can be ...
gpl-2.0
Azure/azure-sdk-for-python
sdk/translation/azure-ai-translation-document/setup.py
1
2331
from setuptools import setup, find_packages import os from io import open import re PACKAGE_NAME = "azure-ai-translation-document" PACKAGE_PPRINT_NAME = "Document Translation" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace('-', '/') # a-b-c => a.b.c namespace_name = PACKAGE_NAME.replace('-', '.') # Vers...
mit
okwow123/djangol2
example/env/lib/python2.7/site-packages/PIL/XbmImagePlugin.py
17
2504
# # The Python Imaging Library. # $Id$ # # XBM File handling # # History: # 1995-09-08 fl Created # 1996-11-01 fl Added save support # 1997-07-07 fl Made header parser more tolerant # 1997-07-22 fl Fixed yet another parser bug # 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.4) # 2001-05-13 fl Ad...
mit
openstack/monasca-api
monasca_api/conf/repositories.py
2
2241
# Copyright 2014 IBM Corp. # Copyright 2016-2017 FUJITSU LIMITED # (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP # # 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:/...
apache-2.0
DiamondLightSource/ispyb-api
tests/test_em_structures.py
1
3686
def test_insert_movie(testdb): emacquisition = testdb.em_acquisition group_params = emacquisition.get_data_collection_group_params() group_params["parentid"] = 55168 group_id = emacquisition.insert_data_collection_group(list(group_params.values())) collection_params = emacquisition.get_data_collecti...
apache-2.0
valexandersaulys/airbnb_kaggle_contest
prototype_alpha/gradientBoost_take3.py
1
2967
""" Take 2 on the GradientBoost, predicting for country_destinations. Use labels in confusion_matrix(y_true,y_preds,labels=[]) to order the labels in the confusion matrix to see whats overrepresented in the target files for the Airbnb contest. http://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusio...
gpl-2.0
keithroe/vtkoptix
ThirdParty/Twisted/twisted/internet/test/test_posixprocess.py
28
10894
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for POSIX-based L{IReactorProcess} implementations. """ import errno, os, sys try: import fcntl except ImportError: platformSkip = "non-POSIX platform" else: from twisted.internet import process platformSkip = None fro...
bsd-3-clause
blablack/midimsg-lv2
waflib/extras/fc_pgfortran.py
55
1780
#! /usr/bin/env python # encoding: utf-8 # harald at klimachs.de import re from waflib.Tools import fc, fc_config, fc_scan from waflib.Configure import conf from waflib.Tools.compiler_fc import fc_compiler fc_compiler['linux'].append('fc_pgfortran') @conf def find_pgfortran(conf): """Find the PGI fortran compiler (...
gpl-3.0
RobinCPC/algorithm-practice
HashTable/ValidWordAbbr.py
1
2388
""" #: 288 Title: Unique Word Abbreviation Description: ------ An abbreviation of a word follows the form <first letter><number><last letter>. Below are some examples of word abbreviations: ``` a) it --> it (no abbreviation) 1 b) d|o|g --> d1g 1 1 1 ...
mit
tempbottle/ironpython3
Src/StdLib/Lib/lib2to3/pgen2/driver.py
89
5153
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Modifications: # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Parser driver. This provides a high-level interface to parse a file into a synta...
apache-2.0
VNGIoTLab/vbluno
code_examples/mbed/ex4_ibeacon/VBLUno51_BLE_Beacon/mbed-os/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sdk/script/pick_nrf51_files.py
77
4918
#!/usr/bin/env python # Copyright (c) 2015-2016 ARM Limited # SPDX-License-Identifier: Apache-2.0 # # 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/LICEN...
gpl-3.0
ClearCorp/account-consolidation
account_parallel_currency/account.py
3
26829
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012-2013 Agile Business Group sagl # (<http://www.agilebg.com>) # Copyright (C) 2012 Domsense srl (<http://www.domsense.com>) # # This program is free software: you can redistribute ...
agpl-3.0
byronvhughey/django_local_library
catalog/urls.py
1
1606
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^books/$', views.BookListView.as_view(), name='books'), url(r'^book/(?P<pk>\d+)$', views.BookDetailView.as_view(), name='book-detail'), url(r'^authors/$', views.AuthorListView.as_view(), nam...
mit
jlegendary/Dato-Core
cxxtest/python/python3/cxxtest/cxxtest_fog.py
17
3857
#------------------------------------------------------------------------- # CxxTest: A lightweight C++ unit testing library. # Copyright (c) 2008 Sandia Corporation. # This software is distributed under the LGPL License v2.1 # For more information, see the COPYING file in the top CxxTest directory. # Under the terms o...
agpl-3.0
rhdedgar/openshift-tools
openshift/installer/vendored/openshift-ansible-3.6.173/roles/lib_utils/src/class/yedit.py
10
23092
# flake8: noqa # pylint: skip-file class YeditException(Exception): ''' Exception class for Yedit ''' pass # pylint: disable=too-many-public-methods class Yedit(object): ''' Class to modify yaml files ''' re_valid_key = r"(((\[-?\d+\])|([0-9a-zA-Z%s/_-]+)).?)+$" re_key = r"(?:\[(-?\d+)\])|([0-9a...
apache-2.0
crowdhackathon-transport/optimizers
crowdstance-api/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py
650
1701
# urllib3/__init__.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ urllib3 - Thread-safe connection pooling and re-using. """ __author__ = 'Andrey Petrov (a...
mit
AlexTMjugador/mtasa-blue
vendor/google-breakpad/src/tools/gyp/pylib/gyp/MSVSSettings_test.py
96
65937
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the MSVSSettings.py file.""" import StringIO import unittest import gyp.MSVSSettings as MSVSSettings class TestSequence...
gpl-3.0
s-macke/jor1k-sysroot
fs/usr/lib/python2.7/LWPCookieJar.py
109
6555
"""Load / save to libwww-perl (LWP) format files. Actually, the format is slightly extended from that used by LWP's (libwww-perl's) HTTP::Cookies, to avoid losing some RFC 2965 information not recorded by LWP. It uses the version string "2.0", though really there isn't an LWP Cookies 2.0 format. This indicates that ...
mit
ZeitOnline/zeit.website
bootstrap.py
299
5686
############################################################################## # # Copyright (c) 2006 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
bsd-3-clause
Mj258/weiboapi
srapyDemo/envs/Lib/site-packages/twisted/internet/test/test_baseprocess.py
51
2613
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.internet._baseprocess} which implements process-related functionality that is useful in all platforms supporting L{IReactorProcess}. """ __metaclass__ = type from twisted.python.deprecate import getWarningMethod, setWarni...
mit
tsarnowski/hamster
src/hamster/overview_activities.py
2
6443
# - coding: utf-8 - # Copyright (C) 2008-2010 Toms Bauģis <toms.baugis at gmail.com> # This file is part of Project Hamster. # Project Hamster 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 ...
gpl-3.0
codepantry/django
tests/auth_tests/test_tokens.py
297
2551
import unittest from datetime import date, timedelta from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.test import TestCase from django.utils.six import PY3 class TokenGeneratorTest(TestCase): def test_make...
bsd-3-clause
zlpmichelle/crackingtensorflow
save_restore_model/tf/restore_model.py
1
1486
with self.graph.as_default():####默认图与自定义图的关系 ckpt = tf.train.get_checkpoint_state(self.savefile) if ckpt and ckpt.model_checkpoint_path: print(''.join([ckpt.model_checkpoint_path,'.meta'])) self.saver = tf.train.import_meta_graph(''.join([ckpt.model_checkpoint_path,'.meta'])) ...
apache-2.0
k-vinogradov/noclite
reports/admin.py
1
1481
from django.contrib import admin from models import * class SimpleAdmin(admin.ModelAdmin): list_display = ['__unicode__', 'is_active'] list_filter = ['is_active', ] class NAKindCategoryMapAdmin(admin.StackedInline): model = NAKindCategoryMap filter_horizontal = ['kinds', 'categories', 'ignore_kinds...
bsd-3-clause
aml-development/ozp-backend
tests/ozpcenter_model_access/test_agency.py
1
1285
""" Agency tests """ from django.test import override_settings from django.test import TestCase from ozpcenter.scripts import sample_data_generator as data_gen import ozpcenter.api.agency.model_access as model_access from ozpcenter import errors import ozpcenter.model_access as generic_model_access from ozpcenter impo...
apache-2.0
marcocaccin/scikit-learn
sklearn/neighbors/graph.py
208
7031
"""Nearest Neighbors graph functions""" # Author: Jake Vanderplas <vanderplas@astro.washington.edu> # # License: BSD 3 clause (C) INRIA, University of Amsterdam import warnings from .base import KNeighborsMixin, RadiusNeighborsMixin from .unsupervised import NearestNeighbors def _check_params(X, metric, p, metric_...
bsd-3-clause
xiaokuangkuang/kuangjingxiangmu
flink-libraries/flink-python/src/main/python/org/apache/flink/python/api/flink/plan/DataSet.py
22
47697
# ############################################################################### # 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 thi...
apache-2.0
android-ia/platform_external_chromium_org
tools/cr/cr/commands/debug.py
113
1238
# 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. """A module for the run command.""" import cr class DebugCommand(cr.Command): """The implementation of the debug command. This is much like the run c...
bsd-3-clause
Opshun/API
venv/lib/python2.7/site-packages/werkzeug/debug/repr.py
280
9350
# -*- coding: utf-8 -*- """ werkzeug.debug.repr ~~~~~~~~~~~~~~~~~~~ This module implements object representations for debugging purposes. Unlike the default repr these reprs expose a lot more information and produce HTML instead of ASCII. Together with the CSS and JavaScript files of the debug...
mit
gauribhoite/personfinder
env/site-packages/sphinx/util/osutil.py
4
5151
# -*- coding: utf-8 -*- """ sphinx.util.osutil ~~~~~~~~~~~~~~~~~~ Operating system-related utility functions for Sphinx. :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_function import os import re import sy...
apache-2.0
uniteddiversity/mediadrop
mediadrop/model/util.py
10
1663
# This file is a part of MediaDrop (http://www.mediadrop.net), # Copyright 2009-2015 MediaDrop contributors # For the exact contribution history, see the git revision log. __all__ = ['JSONType'] # copied straight from the SQLAlchemy 0.8.1 manual: # ORM Extensions > Mutation Tracking > Establishing Mutability on Scal...
gpl-3.0
CLPeters/DeFFNetIzer
openanything.py
1
4000
'''OpenAnything: a kind and thoughtful library for HTTP web services This program is part of 'Dive Into Python', a free Python book for experienced programmers. Visit http://diveintopython.org/ for the latest version. ''' __author__ = 'Mark Pilgrim (mark@diveintopython.org)' __version__ = '$Revision: 1.6 $'[11:-2] _...
apache-2.0
manisandro/QGIS
tests/code_layout/test_qgssipcoverage.py
13
5096
# -*- coding: utf-8 -*- """QGIS Unit tests for SIP binding coverage. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ...
gpl-2.0
adrienbrault/home-assistant
homeassistant/components/no_ip/__init__.py
21
3170
"""Integrate with NO-IP Dynamic DNS service.""" import asyncio import base64 from datetime import timedelta import logging import aiohttp from aiohttp.hdrs import AUTHORIZATION, USER_AGENT import async_timeout import voluptuous as vol from homeassistant.const import CONF_DOMAIN, CONF_PASSWORD, CONF_TIMEOUT, CONF_USER...
mit
libos-nuse/net-next-nuse
Documentation/target/tcm_mod_builder.py
497
22865
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
ucrawler/cp-uc
libs/pyutil/humanreadable.py
106
4483
# Copyright (c) 2001 Autonomous Zone Industries # Copyright (c) 2002-2009 Zooko "Zooko" Wilcox-O'Hearn # This file is part of pyutil; see README.rst for licensing terms. import exceptions, os from repr import Repr class BetterRepr(Repr): def __init__(self): Repr.__init__(self) # Note: These le...
gpl-3.0
JKatzwinkel/mps-youtube
setup.py
8
2747
#!/usr/bin/python3 """ setup.py for mps-youtube. https://np1.github.com/mps-youtube python setup.py sdist bdist_wheel """ import sys import os if sys.version_info < (3,0): sys.exit("Mps-youtube requires python 3.") from setuptools import setup options = dict( name="mps-youtube", version="0.2.5", ...
gpl-3.0
leeseulstack/openstack
neutron/tests/unit/ml2/drivers/test_ofagent_mech.py
8
3375
# Copyright (c) 2014 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
derekmarcotte/node_exporter
text_collector_examples/storcli.py
1
10262
#!/usr/bin/env python3 """ Script to parse StorCLI's JSON output and expose MegaRAID health as Prometheus metrics. Tested against StorCLI 'Ver 1.14.12 Nov 25, 2014'. StorCLI reference manual: http://docs.avagotech.com/docs/12352476 Advanced Software Options (ASO) not exposed as metrics currently. JSON key abbreviat...
apache-2.0
akolpakov/paynova-api-python-client
setup.py
1
2029
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of paynova-api-python-client. # https://github.com/akolpakov/paynova-api-python-client # Licensed under the MIT license: # http://www.opensource.org/licenses/MIT-license # Copyright (c) 2015, Andrey Kolpakov <aakolpakov@gmail.com> from setuptools impo...
mit
poldrosky/alternar
wind/windRoseGeneral.py
1
2130
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # windRoseGeneral.py # # Copyright 2015 Omar Ernesto Cabrera Rosero <omarcabrera@udenar.edu.co> # # 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 Fo...
agpl-3.0
heeraj123/oh-mainline
vendor/packages/typecheck/setup.py
16
1701
try: import ez_setup ez_setup.use_setuptools() from setuptools import setup except ImportError: from distuils.core import setup setup( name = 'typecheck', version = '0.3.5', description = 'A runtime type-checking module for Python', long_description = """A runtime type-checking mo...
agpl-3.0
korrosivesec/crits
fabfile.py
13
2000
"""Management utilities. Example Usage: - fab vagrant create_admin_user - fab vagrant runserver """ from fabric.api import cd, prompt, run, task from fabtools.vagrant import vagrant APP_ROOT = "/vagrant" @task def create_admin_user(username=None, firstname=None, lastname=None, emai...
mit
drufat/vispy
vispy/visuals/collections/array_list.py
21
14102
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier. All rights reserved. # Distributed under the terms of the new BSD License. # ----------------------------------------------------------------------------- """ An ArrayList is...
bsd-3-clause
shakamunyi/nova
nova/scheduler/weights/metrics.py
38
4448
# 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
sahiljain/catapult
third_party/google-endpoints/apitools/base/py/testing/testclient/fusiontables_v1_client.py
15
5332
# # Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
bsd-3-clause
h2oai/h2o
py/testdir_kevin/test_rf_covtype_train_oobe_fvec.py
9
9239
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_rf as h2o_rf, h2o_import as h2i, h2o_exec, h2o_util, h2o_browse as h2b # we can pass ntree thru kwargs if we don't use the "trees" parameter in runRF # only classes 1-7 in the 55th col # this sucks! ALLOWED_DELTA=40 D...
apache-2.0
sebalix/odoorpc
odoorpc/tests/test_field_boolean.py
5
1203
# -*- coding: UTF-8 -*- from odoorpc.tests import LoginTestCase class TestFieldBoolean(LoginTestCase): def test_field_boolean_read(self): self.assertTrue(self.user.active) def test_field_boolean_write(self): # TODO: split in several unit tests partner = self.user.partner_id ...
lgpl-3.0
IMCG/iMapReduce
src/contrib/hod/hodlib/Common/types.py
182
43056
#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 use thi...
apache-2.0
joopert/home-assistant
homeassistant/components/nuimo_controller/__init__.py
3
5352
"""Support for Nuimo device over Bluetooth LE.""" import logging import threading import time import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.const import CONF_MAC, CONF_NAME, EVENT_HOMEASSISTANT_STOP _LOGGER = logging.getLogger(__name__) DOMAIN = "nuimo_controller" ...
apache-2.0
arborh/tensorflow
tensorflow/python/ops/ragged/ragged_size_op_test.py
23
1886
# 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
Honzin/ccs
tests/testAdapter/testOkcoincn/testOrder.py
1
1862
import unittest import ccs import time #################################################################################################################### # OKCOINCN # ##############################################...
agpl-3.0
masaori335/hyper
tasks.py
7
1936
import json import os from binascii import hexlify from invoke import task from hyper.http20.hpack import Encoder @task def hpack(): """ This task generates HPACK test data suitable for use with https://github.com/http2jp/hpack-test-case The current format defines a JSON object with three keys: 'draf...
mit
sahildua2305/eden
languages/ko.py
14
272720
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '\ " update\ " \ " field1=\'newvalue\'\ " 와 같은 선택적 표현식입니다. 갱신하거나 조인의 결과를 삭제할 수 없습니다.', '# of International Staff': '# 국제 직원', '# of National Staff': '# 자국 인력을', '# of Vehicles': '# v...
mit
ojengwa/talk
venv/lib/python2.7/site-packages/django/conf/locale/lt/formats.py
82
1834
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'Y \m. E j \d.' TIME_FORMAT = 'H:...
mit
facelessuser/sublime-markdown-popups
st3/mdpopups/st_mapping.py
2
3642
"""Sublime Text language mapping.""" lang_map = { # `'name': (('mapping_alias',), ('tmLanguage_or_sublime-syntax file',))` 'actionscript': (('as', 'actionscript',), ('ActionScript/ActionScript',)), 'applescript': (('applescript',), ('AppleScript/AppleScript',)), 'asp': (('asp',), ('ASP/ASP',)), 'ba...
mit
kimjaejoong/nova
nova/network/ldapdns.py
68
13225
# Copyright 2012 Andrew Bogott for the Wikimedia Foundation # # 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
osrg/ryu
ryu/ofproto/ofproto_v1_5.py
4
76212
# Copyright (C) 2012,2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2012 Isaku Yamahata <yamahata at valinux co jp> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ht...
apache-2.0
KitKatXperience/platform_external_chromium_org
third_party/protobuf/python/ez_setup.py
454
10334
#!python # This file was obtained from: # http://peak.telecommunity.com/dist/ez_setup.py # on 2011/1/21. """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup...
bsd-3-clause
Workday/OpenFrame
tools/telemetry/third_party/mox3/mox3/fixture.py
28
1161
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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://...
bsd-3-clause
bluevoda/BloggyBlog
lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py
2929
13359
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
gpl-3.0
ikaee/bfr-attendant
facerecognitionlibrary/jni-build/jni/include/tensorflow/contrib/learn/python/learn/monitored_session.py
145
1269
# pylint: disable=g-bad-file-header # Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENS...
apache-2.0
lwr20/calico
release-scripts/tests/test_openstack_artifacts.py
3
1117
import os import re import requests import yaml DOCS_PATH = os.environ.get("CALICO_DOCS_PATH") or "/docs" RELEASE_STREAM = os.environ.get("RELEASE_STREAM") PPA_VER = RELEASE_STREAM.replace("v", "calico-") with open("%s/_data/versions.yml" % DOCS_PATH) as f: versions = yaml.safe_load(f) NETWORKING_VER = versi...
apache-2.0
denisff/python-for-android
python3-alpha/python3-src/Lib/test/test_opcodes.py
175
2675
# Python test set -- part 2, opcodes from test.support import run_unittest import unittest class OpcodeTest(unittest.TestCase): def test_try_inside_for_loop(self): n = 0 for i in range(10): n = n+i try: 1/0 except NameError: pass except ZeroDivision...
apache-2.0
jamesbulpin/xcp-xen-4.1
tools/xm-test/tests/create/06_create_mem_neg.py
42
1145
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2005 # Author: Li Ge <lge@us.ibm.com> # Test Description: # Negative Tests: # Test 1: Test for creating domain with mem=0. Verify fail # Test 2: Test for creating domain with mem>sys_mem. Verify fail import sys import re import time from XmTes...
gpl-2.0
odoousers2014/odoo
addons/hr_payroll/hr_payroll.py
2
49633
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
TeamEOS/external_chromium_org_third_party_skia
gm/gm_json.py
17
7820
#!/usr/bin/env python # Copyright (c) 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. """Schema of the JSON summary file written out by the GM tool. This must be kept in sync with the kJsonKey_ constants in gm_expect...
bsd-3-clause
spadae22/odoo
addons/hw_posbox_homepage/__openerp__.py
313
1691
# -*- 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
janusnic/dj-21v
unit_13/mysite/common/arrayfields.py
5
1484
import json from abc import abstractproperty from django.db import models from django.utils.translation import ugettext_lazy as _ class ArrayFieldBase(models.Field): def get_prep_value(self, value): if value == '': value = '{}' return value def value_to_string(self, obj): ...
mit
multatronic/blockbuster
renderer.py
1
11693
import pygame from globals import * from math import ceil from random import randrange, random class Renderer: def __init__(self, logger, config): self.config = config self.background_block_grid = [] self.colors = [ (255, 0, 0), (0, 255, 0), (0, 0, 255) ...
mit
openmb/stb-gui
lib/python/Tools/FuzzyDate.py
15
1050
from time import localtime, time def FuzzyTime(t, inPast = False): d = localtime(t) nt = time() n = localtime() dayOfWeek = (_("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat"), _("Sun")) if d[:3] == n[:3]: # same day date = _("Today") elif d[0] == n[0] and d[7] == n[7] - 1 and inPast: # won't wor...
gpl-2.0
Tokyo-Buffalo/tokyosouth
env/lib/python3.6/site-packages/setuptools/command/build_py.py
231
9596
from glob import glob from distutils.util import convert_path import distutils.command.build_py as orig import os import fnmatch import textwrap import io import distutils.errors import itertools from setuptools.extern import six from setuptools.extern.six.moves import map, filter, filterfalse try: from setuptool...
mit
efortuna/AndroidSDKClone
ndk/prebuilt/linux-x86_64/lib/python2.7/test/test_sort.py
115
9463
from test import test_support import random import sys import unittest verbose = test_support.verbose nerrors = 0 def check(tag, expected, raw, compare=None): global nerrors if verbose: print " checking", tag orig = raw[:] # save input in case of error if compare: raw.sort(compa...
apache-2.0
chfw/pyexcel-io
tests/test_service.py
2
3960
from datetime import time, datetime, timedelta from pyexcel_io.service import ( date_value, time_value, float_value, boolean_value, ods_bool_value, ods_date_value, ods_time_value, ods_float_value, throw_exception, detect_int_value, detect_float_value, ods_timedelta_value...
bsd-3-clause
Yasumoto/commons
src/python/twitter/thrift/text/thrift_json_decoder.py
16
3534
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
mortada/tensorflow
tensorflow/tools/dist_test/server/parse_cluster_spec_test.py
147
3420
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
dpassante/ansible
lib/ansible/modules/include.py
7
2791
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: 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 = r''' --- author: Ansible Core Team (@ansible) mod...
gpl-3.0
nvoron23/hue
desktop/core/ext-py/parquet-python/test/test_read_support.py
27
4532
import csv import json import os import StringIO import tempfile import unittest import parquet class TestFileFormat(unittest.TestCase): def test_header_magic_bytes(self): with tempfile.NamedTemporaryFile() as t: t.write("PAR1_some_bogus_data") t.flush() self.assertTru...
apache-2.0
40223219/2015_midterm
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_break.py
785
8138
import gc import io import os import sys import signal import weakref import unittest @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on freebsd6 " "if threa...
gpl-3.0
Sidney84/pa-chromium
chrome/common/extensions/docs/server2/converter_html_parser.py
165
1723
# 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. from HTMLParser import HTMLParser from StringIO import StringIO class _ConverterHTMLParser(HTMLParser): def __init__(self, io): HTMLParser.__init_...
bsd-3-clause
abhishekkrthakur/scikit-learn
sklearn/linear_model/tests/test_perceptron.py
378
1815
import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_true from sklearn.utils.testing import assert_raises from sklearn.utils import check_random_state from sklearn.datasets import load_iris from sklearn.linear_model import Pe...
bsd-3-clause
4022321818/2015cd_midterm
wsgi.py
1
40440
#@+leo-ver=5-thin #@+node:2014fall.20141212095015.1775: * @file wsgi.py # coding=utf-8 # 上面的程式內容編碼必須在程式的第一或者第二行才會有作用 ################# (1) 模組導入區 # 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝 #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:2014fall.20141212095015.1776: ** <<declar...
gpl-3.0
WGBH/django-textplusstuff
textplusstuff/migrations/0001_initial.py
1
2579
# -*- coding: utf-8 -*- # flake8: noqa from django.conf import settings from django.db import models, migrations import django.db.models.deletion import textplusstuff.fields class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MOD...
mit
mfcabrera/luigi
test/contrib/hadoop_jar_test.py
16
3737
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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...
apache-2.0