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
axbaretto/beam
sdks/python/apache_beam/examples/snippets/transforms/elementwise/map_test.py
5
2481
# coding=utf-8 # # 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");...
apache-2.0
vaquer/FastReadingPy
FastReading/settings.py
1
2293
""" Django settings for FastReading project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ......
gpl-2.0
xinjiguaike/edx-platform
cms/envs/test.py
15
9245
# -*- coding: utf-8 -*- """ This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location of this repo /log # Where we're going to write log files """ # We ...
agpl-3.0
amyvmiwei/kbengine
kbe/src/lib/python/Lib/encodings/gb2312.py
816
1027
# # gb2312.py: Python Unicode Codec for GB2312 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gb2312') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
lgpl-3.0
resmo/ansible
lib/ansible/modules/network/cloudengine/ce_reboot.py
12
4188
#!/usr/bin/python # # 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 distribut...
gpl-3.0
WhireCrow/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_weakref.py
35
42138
import gc import sys import unittest import UserList import weakref import operator from test import test_support # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None class C: def method(self): pass class Callable: bar = None def __call__(self, x): self.bar ...
gpl-2.0
WhireCrow/openwrt-mt7620
staging_dir/host/lib/python2.7/xmllib.py
227
34865
"""A parser for XML, using the derived class as static DTD.""" # Author: Sjoerd Mullender. import re import string import warnings warnings.warn("The xmllib module is obsolete. Use xml.sax instead.", DeprecationWarning, 2) del warnings version = '0.3' class Error(RuntimeError): pass # Regular e...
gpl-2.0
excid3/python-apt
apt/cache.py
2
12982
# cache.py - apt cache abstraction # # Copyright (c) 2005 Canonical # # Author: Michael Vogt <michael.vogt@ubuntu.com> # # 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 versio...
gpl-2.0
SlimRemix/android_external_chromium_org
tools/telemetry/telemetry/core/platform/power_monitor/sysfs_power_monitor_unittest.py
25
5761
# 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. import unittest from telemetry.core.platform.power_monitor import sysfs_power_monitor class SysfsPowerMonitorMonitorTest(unittest.TestCase): initial_fre...
bsd-3-clause
isandlaTech/cohorte-demos
led/dump/led-demo-yun/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/requests/structures.py
1160
2977
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections class CaseInsensitiveDict(collections.MutableMapping): """ A case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableMapping...
apache-2.0
rdmorganiser/rdmo
rdmo/questions/migrations/0013_permissions.py
2
1665
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-02-28 12:34 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('questions', '0012_meta'), ] operations = [ migrations.AlterModelOptions( n...
apache-2.0
shadyueh/pyranking
env/lib/python2.7/site-packages/django/conf/__init__.py
135
7622
""" Settings and configuration for Django. Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global settings file for a list of all possible variables. """ import importlib import os import time import warnings from dj...
mit
reox/androguard
androguard/decompiler/dad/writer.py
2
26467
# This file is part of Androguard. # # Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://...
apache-2.0
Bulochkin/tensorflow_pack
tensorflow/contrib/bayesflow/python/kernel_tests/stochastic_variables_test.py
80
6132
# 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
devendermishrajio/nova
nova/api/openstack/compute/schemas/evacuate.py
83
1175
# 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
tiagocoutinho/bliss
tests/test_counters.py
1
2255
# -*- coding: utf-8 -*- # # This file is part of the bliss project # # Copyright (c) 2016 Beamline Control Unit, ESRF # Distributed under the GNU LGPLv3. See LICENSE for more info. import pytest import numpy from bliss.common.measurement import SamplingCounter, IntegratingCounter class Diode(SamplingCounter): de...
lgpl-3.0
kustodian/ansible
lib/ansible/modules/packaging/os/redhat_subscription.py
7
34577
#!/usr/bin/python # James Laska (jlaska@redhat.com) # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['prev...
gpl-3.0
jnobre/lxmls-toolkit-2017
lxmls/pos_tagging/all_train_pos_tag.py
2
3145
import sys import codecs from sequences.sequence import * from sequences.sequence_list import * import readers.pos_corpus as pcc import readers.brown_pos_corpus as bpc import sequences.extended_feature as exfc import sequences.structured_perceptron as spc import sequences.confusion_matrix as bcm MAX_SENT_SIZE = 1000 ...
mit
henaras/sahara
sahara/plugins/vanilla/utils.py
10
1562
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
sephii/django-cms
cms/signals/plugins.py
11
2026
# -*- coding: utf-8 -*- from cms.constants import PUBLISHER_STATE_DIRTY from cms.models import CMSPlugin, Title, Page, StaticPlaceholder, Placeholder def get_placeholder(plugin): if plugin.placeholder_id: try: return plugin.placeholder except Placeholder.DoesNotExist: retur...
bsd-3-clause
hefen1/chromium
tools/telemetry/telemetry/core/web_contents.py
2
6605
# Copyright 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 os from telemetry.core import util DEFAULT_WEB_CONTENTS_TIMEOUT = 90 # TODO(achuith, dtu, nduca): Add unit tests specifically for WebContents, # in...
bsd-3-clause
Designist/sympy
sympy/polys/specialpolys.py
87
9787
"""Functions for generating interesting polynomials, e.g. for benchmarking. """ from __future__ import print_function, division from sympy.core import Add, Mul, Symbol, sympify, Dummy, symbols from sympy.functions.elementary.miscellaneous import sqrt from sympy.core.singleton import S from sympy.polys.polytools impo...
bsd-3-clause
tboyce021/home-assistant
homeassistant/components/flexit/climate.py
16
5180
"""Platform for Flexit AC units with CI66 Modbus adapter.""" import logging from typing import List from pyflexit.pyflexit import pyflexit import voluptuous as vol from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity from homeassistant.components.climate.const import ( HVAC_MODE_COOL, S...
apache-2.0
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py
3
4150
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.hazmat.primitives.cipher...
bsd-3-clause
aYukiSekiguchi/ACCESS-Chromium
third_party/mesa/MesaLib/src/mapi/glapi/gen/glX_proto_size.py
33
18969
#!/usr/bin/env python # (C) Copyright IBM Corporation 2004, 2005 # All Rights Reserved. # # 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 # ...
bsd-3-clause
Jericho/deep-learning
image-classification/problem_unittests.py
91
7319
import os import numpy as np import tensorflow as tf import random from unittest.mock import MagicMock def _print_success_message(): print('Tests Passed') def test_folder_path(cifar10_dataset_folder_path): assert cifar10_dataset_folder_path is not None,\ 'Cifar-10 data folder not set.' assert ci...
mit
hoangminhitvn/flask
flask/lib/python2.7/site-packages/pip/_vendor/distlib/resources.py
210
9664
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import bisect import io import logging import os import pkgutil import shutil import sys import types...
bsd-3-clause
eeshangarg/zulip
zerver/webhooks/freshping/tests.py
1
1324
from zerver.lib.test_classes import WebhookTestCase class FreshpingHookTests(WebhookTestCase): STREAM_NAME = "freshping" URL_TEMPLATE = "/api/v1/external/freshping?api_key={api_key}&stream={stream}" FIXTURE_DIR_NAME = "freshping" def test_freshping_check_test(self) -> None: """ Tests ...
apache-2.0
davisein/jitsudone
django/django/contrib/comments/__init__.py
423
3333
from django.conf import settings from django.core import urlresolvers from django.core.exceptions import ImproperlyConfigured from django.contrib.comments.models import Comment from django.contrib.comments.forms import CommentForm from django.utils.importlib import import_module DEFAULT_COMMENTS_APP = 'django.contrib....
bsd-3-clause
rechner/Taxidi
notify/googlevoice/voice.py
1
11693
from conf import config from util import * import settings import base64 import os import re qpat = re.compile(r'\?') if settings.DEBUG: import logging logging.basicConfig() log = logging.getLogger('PyGoogleVoice') log.setLevel(logging.DEBUG) else: log = None class Voice(object): """ Main...
gpl-3.0
treejames/viewfinder
backend/www/test/facebook_utils.py
13
7256
#!/usr/bin/env python # # Copyright 2012 Viewfinder Inc. All Rights Reserved. """Facebook-specific test functions. Creating facebook test users should only need to be done once--they persist across unittest runs and are shared by all developers. Create the universe of test users with: % python -m viewfinder.backend....
apache-2.0
chokribr/invenio
invenio/legacy/websubmit/icon_creator.py
13
36867
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2008, 2009, 2010, 2011, 2012 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 (a...
gpl-2.0
SnappleCap/oh-mainline
vendor/packages/celery/celery/tests/test_app/test_routes.py
18
5437
from __future__ import absolute_import from __future__ import with_statement from functools import wraps from celery import routes from celery import current_app from celery.exceptions import QueueNotFound from celery.utils import maybe_promise from celery.tests.utils import unittest def E(queues): def expand(a...
agpl-3.0
aerickson/ansible
lib/ansible/modules/cloud/amazon/cloudtrail.py
27
8794
#!/usr/bin/python # 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...
gpl-3.0
CeltonMcGrath/TACTIC
3rd_party/CherryPy/cherrypy/test/sessiondemo.py
7
5376
#!/usr/bin/python """A session demonstration app.""" import calendar from datetime import datetime import sys import cherrypy from cherrypy.lib import sessions page = """ <html> <head> <style type='text/css'> table { border-collapse: collapse; border: 1px solid #663333; } th { text-align: right; background-color: #6...
epl-1.0
pschmitt/home-assistant
homeassistant/components/home_connect/entity.py
21
1999
"""Home Connect entity base class.""" import logging from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from .api import HomeConnectDevice from .const import DOMAIN, SIGNAL_UPDATE_ENTITIES _LOGGER = logging.ge...
apache-2.0
rizar/groundhog-private
doc/conf.py
28
6225
# -*- coding: utf-8 -*- # # pylearn2 documentation build configuration file # It is based on Theano documentation build # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module impo...
bsd-3-clause
sumedh123/debatify
venv/lib/python2.7/site-packages/pip/vcs/bazaar.py
514
3803
from __future__ import absolute_import import logging import os import tempfile # TODO: Get this into six.moves.urllib.parse try: from urllib import parse as urllib_parse except ImportError: import urlparse as urllib_parse from pip.utils import rmtree, display_path from pip.vcs import vcs, VersionControl fro...
mit
UWNetworksLab/metasync
metasync/mapping.py
1
7526
from params import * import dbg, util class DetMapInfo2: def __init__(self, config, hspace, replica, version): self.config = config self.replica = replica self.hspace = hspace self.version = version self._load(config) def _load(self, config): nspace = [] ...
mit
odootr/odoo
addons/account_followup/wizard/account_followup_print.py
217
16379
# -*- 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
adit-chandra/tensorflow
third_party/mlir/bindings/python/test/test_py2and3.py
3
19351
# Copyright 2019 The MLIR Authors. # # 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 wri...
apache-2.0
citrix-openstack-build/nova
nova/tests/servicegroup/test_zk_driver.py
42
2605
# Copyright (c) AT&T 2012-2013 Yun Mao <yunmao@gmail.com> # Copyright 2012 IBM 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/LICENS...
apache-2.0
unusedPhD/amoco
amoco/arch/arm/v7/asm.py
6
25084
# -*- coding: utf-8 -*- # This code is part of Amoco # Copyright (C) 2006-2011 Axel Tillequin (bdcht3@gmail.com) # published under GPLv2 license from .env import * #utilities: #---------- from .utils import * from amoco.cas.utils import * from amoco.arch.core import InstructionError from amoco.logger import Log log...
gpl-2.0
402231444/c2g16
w2/static/Brython2.0.0-20140209-164925/Lib/unittest/test/_test_warnings.py
858
2304
# helper module for test_runner.Test_TextTestRunner.test_warnings """ This module has a number of tests that raise different kinds of warnings. When the tests are run, the warnings are caught and their messages are printed to stdout. This module also accepts an arg that is then passed to unittest.main to affect the b...
gpl-2.0
rajashreer7/autotest-client-tests
linux-tools/pixman/pixman.py
4
1243
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error class pixman(test.test): """ Autotest module for testing basic functionality of pixman @author Kingsuk Deb, kingsdeb@linux.vnet.ibm.com ## """ ...
gpl-2.0
omarocegueda/dipy
doc/examples/viz_ui.py
1
3092
import numpy as np from dipy.data import read_viz_icons # Conditional import machinery for vtk. from dipy.utils.optpkg import optional_package # Allow import, but disable doctests if we don't have vtk. from dipy.viz import ui, window vtk, have_vtk, setup_module = optional_package('vtk') if have_vtk: vtkInterac...
bsd-3-clause
jaggu303619/asylum-v2.0
openerp/addons/purchase_double_validation/__init__.py
441
1090
# -*- 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
ian-r-rose/SHTOOLS
src/create_wrapper.py
2
5850
#!/usr/bin/env python """ Automatically creates python-wrapper subroutines from the interface file SHTOOLS.f95. Unfortunately all assumed array shapes have to be changed because their structure is only known by the Fortran compiler and can not be directly exposed to C. It is possible that newer f2py versions can handle...
bsd-3-clause
dasmarci/check_mk
a10/checks/a10_cpu.py
1
1914
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- factory_settings["a10_cpu_default_levels"] = {'cpu': (80.0, 90.0),} a10_cpus = { 0: "average", 1: "Control", 2: "Data" } def inventory_a10_cpu(info): if info: return [ (None, "a10_cpu_default_...
gpl-2.0
anirudhSK/chromium
build/android/screenshot.py
3
3317
#!/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. """Takes a screenshot or a screen video capture from an Android device.""" import logging import optparse import os import sys f...
bsd-3-clause
xavierwu/scikit-learn
doc/tutorial/text_analytics/skeletons/exercise_01_language_train_model.py
254
2005
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
rogst/datadogpy
tests/unit/api/helper.py
3
3033
# python import unittest # datadog from datadog import initialize, api from datadog.api.base import CreateableAPIResource, UpdatableAPIResource, DeletableAPIResource,\ GetableAPIResource, ListableAPIResource, ActionAPIResource from datadog.util.compat import iteritems, json # 3p import requests from mock import p...
bsd-3-clause
beni55/edx-platform
common/djangoapps/student/migrations/0032_add_field_UserProfile_country_add_field_UserProfile_city.py
114
10820
# -*- 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 field 'UserProfile.country' db.add_column('auth_userprofile', 'country', self...
agpl-3.0
auferack08/edx-platform
common/lib/xmodule/xmodule/tests/test_capa_module.py
15
74271
# -*- coding: utf-8 -*- """ Tests of the Capa XModule """ # pylint: disable=C0111 # pylint: disable=R0904 # pylint: disable=C0103 # pylint: disable=C0302 import datetime import json import random import os import textwrap import unittest from mock import Mock, patch import webob from webob.multidict import MultiDict ...
agpl-3.0
henriquegemignani/py-gocd
docs/conf.py
2
10117
# -*- coding: utf-8 -*- # # GoCD API Client documentation build configuration file, created by # sphinx-quickstart on Sun Aug 9 00:56:28 2015. # # 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 fil...
mit
rajiteh/taiga-back
tests/integration/resources_permissions/test_auth_resources.py
24
1111
from django.core.urlresolvers import reverse from taiga.base.utils import json from tests import factories as f from tests.utils import disconnect_signals, reconnect_signals import pytest pytestmark = pytest.mark.django_db def setup_module(module): disconnect_signals() def teardown_module(module): reconn...
agpl-3.0
EmanueleCannizzaro/scons
test/Docbook/basic/html/html.py
3
1724
#!/usr/bin/env python # # Copyright (c) 2001-2010 The SCons Foundation # # 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,...
mit
joberreiter/pyload
module/plugins/accounts/FastixRu.py
3
2037
# -*- coding: utf-8 -*- from module.plugins.internal.Account import Account from module.common.json_layer import json_loads class FastixRu(Account): __name__ = "FastixRu" __type__ = "account" __version__ = "0.08" __status__ = "testing" __config__ = [("mh_mode" , "all;listed;unlisted", ...
gpl-3.0
unioslo/cerebrum
Cerebrum/modules/bofhd/errors.py
1
2338
# -*- coding: utf-8 -*- # Copyright 2002-2014 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum 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 # (a...
gpl-2.0
Yukarumya/Yukarum-Redfoxes
media/webrtc/trunk/tools/gyp/test/mac/gyptest-postbuild-fail.py
88
2218
#!/usr/bin/env python # Copyright (c) 2011 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. """ Verifies that a failing postbuild step lets the build fail. """ import TestGyp import sys if sys.platform == 'darwin': # set |match...
mpl-2.0
kawamon/hue
desktop/core/ext-py/celery-4.2.1/t/unit/worker/test_request.py
2
36038
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import numbers import os import signal import socket import sys from datetime import datetime, timedelta from time import time import pytest from billiard.einfo import ExceptionInfo from case import Mock, patch from kombu.utils.encoding ...
apache-2.0
to266/hyperspy
hyperspy/models/model1D.py
1
32769
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
gpl-3.0
DrAA/avro
lang/py/src/avro/tether/tether_task.py
18
17523
""" * 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...
apache-2.0
civisanalytics/ansible
lib/ansible/modules/network/nxos/nxos_evpn_global.py
4
2899
#!/usr/bin/python # # 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 distribut...
gpl-3.0
mbareta/edx-platform-ft
lms/djangoapps/notification_prefs/tests.py
26
9892
import json from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.http import Http404 from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_setting...
agpl-3.0
HaroldMills/Vesper
scripts/create_clip_zip_files.py
1
1964
""" Script that creates zip files from Vesper archive clip directories. The script puts the zip files in a directory called "Clips (zipped)" that is a sibling of the archive's "Clips" directory. The "Clips (zipped)" directory has the same structure as the "Clips" directory, except that each grandchild directory of the...
mit
ttsubo/ryu
ryu/app/cbench.py
51
1787
# Copyright (C) 2012 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 # # http://...
apache-2.0
KlinkOnE/kyleopen-kernel
tools/perf/scripts/python/netdev-times.py
11271
15048
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
gpl-2.0
mlperf/training_results_v0.7
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/topi/tests/python/test_topi_reduce.py
2
6995
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
joonro/PyTables
tables/filters.py
6
14264
# -*- coding: utf-8 -*- ######################################################################## # # License: BSD # Created: 2007-02-23 # Author: Ivan Vilata i Balaguer - ivan at selidor dot net # # $Id$ # ######################################################################## """Functionality related with filters i...
bsd-3-clause
mizdebsk/javapackages
test/osgi_req_test.py
1
2463
import unittest from test_common import * class TestOSGiReq(unittest.TestCase): @osgireq(["basic/buildroot/usr/share/META-INF/MANIFEST.MF"]) def test_basic(self, stdout, stderr, return_value): self.assertEqual(return_value, 0, stderr) sout = [x for x in stdout.split('\n') if x] asser...
bsd-3-clause
olasitarska/django
django/conf/locale/zh_Hans/formats.py
634
1810
# -*- 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 = 'Y年n月j日' # 2016年9月5...
bsd-3-clause
debugger06/MiroX
windows/plat/config.py
2
8122
# Miro - an RSS based video player application # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 # Participatory Culture Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; eithe...
gpl-2.0
upndwn4par/android_external_skia
tools/generate_fir_coeff.py
198
4546
#!/usr/bin/python ''' Copyright 2013 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. ''' import math import pprint def withinStdDev(n): """Returns the percent of samples within n std deviations of the normal.""" return math.erf(n / math.sqrt(2)) def...
bsd-3-clause
ibmsoe/tensorflow
tensorflow/python/client/session_test.py
4
67123
# 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
mdaniel/intellij-community
python/helpers/py2only/docutils/languages/ru.py
128
2155
# -*- coding: utf-8 -*- # $Id: ru.py 7125 2011-09-16 18:36:18Z milde $ # Author: Roman Suzi <rnd@onego.ru> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be...
apache-2.0
Garrett-R/scikit-learn
sklearn/cross_decomposition/pls_.py
5
28683
""" The :mod:`sklearn.pls` module implements Partial Least Squares (PLS). """ # Author: Edouard Duchesnay <edouard.duchesnay@cea.fr> # License: BSD 3 clause from ..base import BaseEstimator, RegressorMixin, TransformerMixin from ..utils import check_array, check_consistent_length from ..externals import six import w...
bsd-3-clause
google/mirandum
alerts/twitchalerts/tests.py
1
1768
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
arnaudsj/pybrain
pybrain/tools/datasets/mnist.py
4
1906
import itertools import os import scipy import struct from pybrain.datasets import SupervisedDataSet def labels(filename): fp = file(filename) magicnumber, length = struct.unpack('>ii', fp.read(8)) assert magicnumber in (2049, 2051), ("Not an MNIST file: %i" % magicnumber) for _ in xrange(length): ...
bsd-3-clause
bitifirefly/edx-platform
common/djangoapps/student/tests/test_parental_controls.py
155
3850
"""Unit tests for parental controls.""" import datetime from django.test import TestCase from django.test.utils import override_settings from student.models import UserProfile from student.tests.factories import UserFactory class ProfileParentalControlsTest(TestCase): """Unit tests for requires_parental_consent...
agpl-3.0
jcobham/barebox
Documentation/gen_commands.py
10
5303
#!/usr/bin/python import errno import os import re import sys import hashlib from collections import defaultdict from pprint import pprint # TODO: handle commands with the same name in multiple files # TODO: handle #ifdefs HELP_START = re.compile(r"""^BAREBOX_CMD_HELP_START\s*\((\w+)\)?\s*$""") HELP_TEXT = re.comp...
gpl-2.0
fabianofranz/origin
Godeps/_workspace/src/k8s.io/kubernetes/examples/selenium/selenium-test.py
173
1109
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
lakiw/cripts
cripts/core/mongo_tools.py
1
14342
from django.conf import settings if settings.FILE_DB == settings.S3: from cripts.core.s3_tools import get_file_s3 import gridfs import pymongo import magic class MongoError(Exception): """ Generic MongoError exception. """ pass # TODO: mongo_connector() and gridfs_connector() can probably be com...
mit
danmar/cppcheck
tools/ci.py
8
2424
#!/usr/bin/env python # continuous integration # build daily reports (doxygen,coverage,etc) import datetime import time import subprocess import pexpect import glob import sys # Upload file to sourceforge web server using scp def upload(file_to_upload, destination): try: password = sys.argv[1] c...
gpl-3.0
jbarriosc/ACSUFRO
LGPL/CommonSoftware/acssim/src/Acssim/Servants/Representations/BaseRepresentation.py
4
4088
# @(#) $Id$ # # Copyright (C) 2001 # Associated Universities, Inc. Washington DC, USA. # # Produced for the ALMA project # # This library is free software; you can redistribute it and/or modify it under # the terms of the GNU Library General Public License as published by the Free # Software Foundation; either version ...
lgpl-2.1
zdw/xos
xos/tosca/resources/controller.py
4
1722
# note: this module named xossite.py instead of site.py due to conflict with # /usr/lib/python2.7/site.py import os import pdb import sys import tempfile sys.path.append("/opt/tosca") from translator.toscalib.tosca_template import ToscaTemplate from core.models import User,Controller,Deployment from xosresource i...
apache-2.0
fibbo/DIRAC
Interfaces/scripts/dirac-dms-pfn-accessURL.py
15
1415
#!/usr/bin/env python ######################################################################## # $HeadURL$ # File : dirac-dms-pfn-accessURL # Author : Stuart Paterson ######################################################################## """ Retrieve an access URL for a PFN given a valid DIRAC SE """ __RCSID__ ...
gpl-3.0
duyetdev/openerp-6.1.1
openerp/addons/stock_planning/stock_planning.py
9
47400
# -*- 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
piquadrat/django
tests/delete_regress/tests.py
17
13296
import datetime from django.db import connection, models, transaction from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from .models import ( Award, AwardNote, Book, Child, Eaten, Email, File, Food, FooFile, FooFileProxy, FooImage, FooPhoto, House, Image, Item, Location, Login, Or...
bsd-3-clause
AMOboxTV/AMOBox.LegoBuild
plugin.video.salts/salts_lib/url_dispatcher.py
21
3803
import log_utils class URL_Dispatcher: def __init__(self): self.func_registry = {} self.args_registry = {} self.kwargs_registry = {} def register(self, mode, args=None, kwargs=None): """ Decorator function to register a function as a plugin:// url endpoint mode...
gpl-2.0
azumimuo/family-xbmc-addon
script.module.youtube.dl/lib/youtube_dl/extractor/pyvideo.py
76
2764
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import int_or_none class PyvideoIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?pyvideo\.org/(?P<category>[^/]+)/(?P<id>[^/?#&.]+)' _TESTS = [{ 'url': 'http://pyvide...
gpl-2.0
kkampardi/Plinth
plinth/menu.py
8
3637
# # This file is part of Plinth. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
agpl-3.0
chancecoin/chancecoin
lib/exceptions.py
1
1314
#! /usr/bin/python3 class ConfigurationError (Exception): pass class DatabaseError (Exception): pass class VersionError (Exception): pass class ClientVersionError (VersionError): pass class DatabaseVersionError (VersionError): pass class TransactionError(Exception): pass class InputError(Excep...
mit
CraigHarris/gpdb
gpAux/extensions/gmock/test/gmock_leak_test.py
779
4384
#!/usr/bin/env python # # Copyright 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...
apache-2.0
petewarden/tensorflow_makefile
tensorflow/python/lib/io/python_io.py
9
1794
# 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
matrixise/odoo
addons/hr_holidays/tests/__init__.py
121
1159
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
gabfl/vault
setup.py
1
1471
from setuptools import setup try: import pypandoc long_description = pypandoc.convert('README.md', 'rst') except(IOError, ImportError): long_description = open('README.md').read() setup( name='pyvault', version='2.4', description='Python password manager', long_description=long_description...
mit
ptisserand/ansible
lib/ansible/modules/network/cloudengine/ce_evpn_global.py
65
6911
#!/usr/bin/python # # 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 distribut...
gpl-3.0
aerickson/ansible
lib/ansible/utils/plugin_docs.py
44
6418
# (c) 2012, Jan-Piet Mens <jpmens () gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
gpl-3.0
bird-house/twitcher
tests/functional/test_owsproxy_app.py
2
1589
""" Run tests OWSProxy tests with external WPS. Please start `Emu WPS <https://emu.readthedocs.io/en/latest/>`_ on port 5000: http://localhost:5000/wps """ import pytest from .base import FunctionalTest class OWSProxyAppTest(FunctionalTest): def setUp(self): super(OWSProxyAppTest, self).setUp() ...
apache-2.0