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
balloob/home-assistant
homeassistant/components/flume/const.py
16
1051
"""The Flume component.""" DOMAIN = "flume" PLATFORMS = ["sensor"] DEFAULT_NAME = "Flume Sensor" FLUME_TYPE_SENSOR = 2 FLUME_QUERIES_SENSOR = { "current_interval": {"friendly_name": "Current", "unit_of_measurement": "gal/m"}, "month_to_date": {"friendly_name": "Current Month", "unit_of_measurement": "gal"}, ...
apache-2.0
tony/django-docutils
django_docutils/lib/fixtures/tests/conftest.py
1
3497
import shutil import sys import py import pytest import factory from django.apps import apps from django.contrib.auth import get_user_model from pytest_factoryboy import register from django_docutils.favicon.tests.conftest import RSTPost, favicon_app # NOQA class UserFactory(factory.django.DjangoModelFactory): ...
mit
40223151/2015cd0505
static/Brython3.1.1-20150328-091302/Lib/jqueryui/__init__.py
603
3671
"""Wrapper around the jQuery UI library Exposes a single object, jq, to manipulate the widgets designed in the library This object supports : - subscription : js[elt_id] returns an object matching the element with the specified id - a method get(**kw). The only keyword currently supported is "selector". The metho...
agpl-3.0
liamgh/liamgreenhughes-sl4a-tf101
python/src/Misc/find_recursionlimit.py
68
3474
#! /usr/bin/env python """Find the maximum recursion limit that prevents interpreter termination. This script finds the maximum safe recursion limit on a particular platform. If you need to change the recursion limit on your system, this script will tell you a safe upper bound. To use the new limit, call sys.setrecu...
apache-2.0
luca76/QGIS
python/ext-libs/pygments/lexers/hdl.py
363
16209
# -*- coding: utf-8 -*- """ pygments.lexers.hdl ~~~~~~~~~~~~~~~~~~~ Lexers for hardware descriptor languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, include, using, t...
gpl-2.0
devopservices/ansible
v2/ansible/playbook/taggable.py
10
2847
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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) an...
gpl-3.0
highweb-project/highweb-webcl-html5spec
native_client_sdk/src/tools/tests/create_nmf_test.py
23
24098
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import os import posixpath import shutil import subprocess import sys import tempfile import unittest SCRIPT_DIR = os.p...
bsd-3-clause
tangfeixiong/nova
nova/api/openstack/compute/contrib/security_groups.py
59
20722
# Copyright 2011 OpenStack Foundation # Copyright 2012 Justin Santa Barbara # 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/l...
apache-2.0
Intel-Corporation/tensorflow
tensorflow/python/kernel_tests/decode_jpeg_op_test.py
18
7593
# 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
arenadata/ambari
ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/slider.py
4
3465
""" 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 this ...
apache-2.0
gabrielfalcao/lettuce
tests/integration/lib/Django-1.3/django/views/generic/date_based.py
246
14025
import datetime import time from django.template import loader, RequestContext from django.core.exceptions import ObjectDoesNotExist from django.core.xheaders import populate_xheaders from django.db.models.fields import DateTimeField from django.http import Http404, HttpResponse import warnings warnings.warn( 'Fu...
gpl-3.0
BonexGu/Blik2D-SDK
Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py
75
29377
# 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...
mit
mburakergenc/Malware-Detection-using-Machine-Learning
cuckoo/modules/reporting/mattermost.py
1
2561
# Copyright (C) 2010-2013 Claudio Guarnieri. # Copyright (C) 2014-2016 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import json import hashlib try: import requests HAVE_REQUESTS = True except ImportError: HAVE...
mit
BeiLuoShiMen/nupic
nupic/regions/extra/GaborNode2.py
17
136574
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions...
agpl-3.0
jieyu/maple
script/maple/benchmark/aget.py
1
2062
"""Copyright 2011 The University of Michigan 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 writi...
apache-2.0
mariosky/evo-drawings
venv/lib/python2.7/site-packages/numpy/polynomial/tests/test_chebyshev.py
123
18026
"""Tests for chebyshev module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.chebyshev as cheb from numpy.polynomial.polynomial import polyval from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_...
agpl-3.0
pronix/spark
python/pyspark/streaming/mqtt.py
4
2950
# # 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
tunneln/CarnotKE
jyhton/lib-python/2.7/pprint.py
147
11932
# Author: Fred L. Drake, Jr. # fdrake@acm.org # # This is a simple little module I wrote to make life easier. I didn't # see anything quite like it in the library, though I may have overlooked # something. I wrote this when I was trying to read some heavily nested # tuples with fairly non-desc...
apache-2.0
abloomston/sympy
sympy/core/tests/test_facts.py
59
12072
from sympy.core.facts import (deduce_alpha_implications, apply_beta_to_alpha_route, rules_2prereq, FactRules, FactKB) from sympy.core.logic import And, Not from sympy.utilities.pytest import raises T = True F = False U = None def test_deduce_alpha_implications(): def D(i): I = deduce_alpha_implic...
bsd-3-clause
geosolutions-it/geonode
geonode/geoserver/tests/test_server.py
2
51967
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2019 OSGeo # # 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 ...
gpl-3.0
AOSPU/external_chromium_org_tools_gyp
test/make_global_settings/env-wrapper/gyptest-wrapper.py
229
1353
#!/usr/bin/env python # Copyright (c) 2013 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 *_wrapper in environment. """ import os import sys import TestGyp test_format = ['ninja'] os.environ['CC_wrapper'] = 'distcc...
bsd-3-clause
wtsi-hgi/hgi-cookie-monster-setup
hgicookiemonster/rules/not_ignored_rule.py
2
4231
import json import os from collections import UserDict from os.path import dirname, normpath, realpath, join from typing import Dict, List, Any, Iterable from urllib.parse import quote from urllib.request import urlopen, Request from cookiemonster.common.helpers import EnrichmentJSONDecoder from cookiemonster.common.m...
gpl-3.0
uki1/Print
printcore.py
2
2494
#!/usr/bin/env python # This file is part of the Printrun suite. # # Printrun 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. # # Prin...
gpl-3.0
easmetz/inasafe
safe/common/resource_parameter.py
10
2166
# coding=utf-8 """Docstring for this file.""" __author__ = 'Christian Christelis' __project_name = 'parameters' __filename = 'resource_parameter' __date__ = '11/11/14' __copyright__ = 'kartoza.com' import os import sys PARAMETERS_DIR = os.path.abspath( os.path.join( os.path.dirname(__file__), '..', '..', '...
gpl-3.0
tel8618217223380/gaeproxy
assets/goagent.py
8
62180
#!/usr/bin/env python # coding:utf-8 # Based on GAppProxy 2.0.0 by Du XiaoGang <dugang@188.com> # Based on WallProxy 0.4.0 by hexieshe <www.ehust@gmail.com> from __future__ import with_statement __version__ = '1.8.11' __author__ = "{phus.lu,hewigovens}@gmail.com (Phus Lu and Hewig Xu)" __config__ = 'proxy.ini' try...
gpl-3.0
emetsger/osf.io
tests/framework_tests/test_url_mapping.py
73
2153
# -*- coding: utf-8 -*- import unittest from nose.tools import * # PEP8 asserts from flask import Flask, url_for from framework.routing import Rule, json_renderer, process_rules class RuleTestCase(unittest.TestCase): def setUp(self): # create a new app for every test self.app = Flask(__name__)...
apache-2.0
jendap/tensorflow
tensorflow/python/util/protobuf/compare.py
21
9132
# 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
sysadminmatmoz/pmis
analytic_resource_plan_task/task.py
2
15892
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Eficent (<http://www.eficent.com/>) # <contact@eficent.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
agpl-3.0
jvacca/Danvic
node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
1509
17165
# Copyright (c) 2013 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. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
mit
chriskmanx/qmole
QMOLEDEV/clang-3.1.src/utils/ABITest/TypeGen.py
31
14833
"""Flexible enumeration of C types.""" from Enumeration import * # TODO: # - struct improvements (flexible arrays, packed & # unpacked, alignment) # - objective-c qualified id # - anonymous / transparent unions # - VLAs # - block types # - K&R functions # - pass arguments of different types (test extension...
gpl-3.0
snuffkingit/pycroservices
pycroservices.py
1
5457
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2016 Satoyuki Tsukano 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 U...
apache-2.0
sn1k/app_mundial
lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/adapter.py
143
1558
""" This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. """ from __future__ import unicode_literals from psycopg2 import Binary from psycopg2.extensions import ISQLQuote class PostGISAdapter(object): def __init__(self, geom): "Initializes on the geometry." # Getting the WKB...
gpl-2.0
UXE/local-edx
cms/djangoapps/course_creators/admin.py
232
4470
""" django admin page for the course creators table """ from course_creators.models import CourseCreator, update_creator_state, send_user_notification, send_admin_notification from course_creators.views import update_course_creator_group from ratelimitbackend import admin from django.conf import settings from django....
agpl-3.0
swarna-k/MyDiary
flask/lib/python2.7/site-packages/pip/vcs/git.py
280
7608
from __future__ import absolute_import import logging import tempfile import os.path from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._vendor.six.moves.urllib import request as urllib_request from pip.utils import display_path, rmtree from pip.vcs import vcs, VersionControl urlsplit = urllib...
bsd-3-clause
hyperized/ansible
lib/ansible/modules/monitoring/zabbix/zabbix_hostmacro.py
13
8437
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013-2014, Epic Games, Inc. # 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', ...
gpl-3.0
Jgarcia-IAS/SAT
openerp/addons-extra/odoo-pruebas/odoo-server/addons/l10n_br/__init__.py
430
1403
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009 Renato Lima - Akretion # # ...
agpl-3.0
unsiloai/syntaxnet-ops-hack
tensorflow/python/debug/wrappers/dumping_wrapper.py
26
5198
# 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
okeer/android_kernel_semc_msm7x30
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
bigblindbais/pytk
src/pytk/factory/model/softmax.py
1
5711
from .model import Model import numpy as np import numpy.random as rnd from scipy.misc import logsumexp import string class Softmax(Model): def __init__(self, *yfactories, cond=None): super().__init__(*yfactories, cond=cond) self.xshape = tuple(f.nitems for f in self.xfactories) self.ysh...
mit
larsmans/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
milafrerichs/geonode
geonode/documents/autocomplete_light_registry.py
4
1249
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
DepthDeluxe/ansible
lib/ansible/modules/packaging/language/composer.py
29
9125
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Dimitrios Tydeas Mengidis <tydeas.dr@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...
gpl-3.0
yujikato/DIRAC
src/DIRAC/WorkloadManagementSystem/Service/OptimizationMindHandler.py
1
7994
from __future__ import absolute_import from __future__ import division from __future__ import print_function __RCSID__ = "$Id$" from past.builtins import long from DIRAC import S_OK, S_ERROR, gLogger from DIRAC.Core.Utilities import ThreadScheduler from DIRAC.Core.Base.ExecutorMindHandler import ExecutorMindHandler fr...
gpl-3.0
ToxicFrog/lancow
contrib/django-memebot/gruntle/memebot/feeds/__init__.py
5
6351
"""Feed generation core""" from urlparse import urljoin import datetime import os from django.conf import settings from django.core.urlresolvers import reverse from gruntle.memebot.models import SerializedData, Link from gruntle.memebot.decorators import logged, locked from gruntle.memebot.utils import AtomicWrite, ...
gpl-3.0
diox/olympia
src/olympia/devhub/tests/test_permissions.py
4
3749
from django.test import RequestFactory from olympia.amo.tests import TestCase, user_factory from olympia.devhub.permissions import IsSubmissionAllowedFor from olympia.users.models import ( DisposableEmailDomainRestriction, EmailUserRestriction, IPNetworkUserRestriction, ) class TestIsSubmissionAllowedFor...
bsd-3-clause
rubikloud/scikit-learn
sklearn/datasets/samples_generator.py
20
56502
""" Generate samples of synthetic data sets. """ # Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel, # G. Louppe, J. Nothman # License: BSD 3 clause import numbers import array import numpy as np from scipy import linalg import scipy.sparse as sp from ..preprocessing import MultiLabelBin...
bsd-3-clause
bearstech/ansible
lib/ansible/playbook/conditional.py
68
10410
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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) an...
gpl-3.0
kouaw/CouchPotatoServer
couchpotato/core/media/movie/suggestion/main.py
30
3782
from couchpotato.api import addApiView from couchpotato.core.event import fireEvent from couchpotato.core.helpers.variable import splitString, removeDuplicate, getIdentifier from couchpotato.core.plugins.base import Plugin from couchpotato.environment import Env autoload = 'Suggestion' class Suggestion(Plugin): ...
gpl-3.0
kouaw/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/naver.py
9
2801
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( compat_urllib_parse, ExtractorError, ) class NaverIE(InfoExtractor): _VALID_URL = r'https?://(?:m\.)?tvcast\.naver\.com/v/(?P<id>\d+)' _TEST = { 'url': 'http://tvcast....
gpl-3.0
Aegeaner/spark
examples/src/main/python/mllib/stratified_sampling_example.py
128
1368
# # 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
benosteen/RDFDatabank
rdfdatabank/controllers/searching.py
2
1277
# -*- coding: utf-8 -*- """ Copyright (c) 2012 University of Oxford Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modif...
mit
Fantomas42/django-blog-zinnia
zinnia/management/commands/count_discussions.py
3
2056
""" Management command for re-counting the discussions on Entry. """ import sys from django.core.management.base import BaseCommand from django.utils.encoding import smart_str from zinnia.models.entry import Entry from zinnia.signals import disconnect_entry_signals class Command(BaseCommand): """ Command fo...
bsd-3-clause
leighpauls/k2cro4
third_party/webpagereplay/replayspdyserver.py
9
4181
#!/usr/bin/env python # Copyright 2010 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...
bsd-3-clause
botherder/volatility
volatility/plugins/mac/lsmod_iokit.py
1
2776
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
gpl-2.0
171121130/SWI
venv/Lib/site-packages/xlwt/Bitmap.py
6
10930
# -*- coding: windows-1251 -*- # Portions are Copyright (C) 2005 Roman V. Kiseliov # Portions are Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net> # Portions are Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel) from .BIFFRecords import BiffRecord from struct import pack, unpack ...
mit
nikpap/inspire-next
tests/unit/utils/test_utils_record.py
1
2298
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2016 CERN. # # INSPIRE 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...
gpl-2.0
yhoshino11/GuestBook
.venv/lib/python2.7/site-packages/setuptools/tests/test_upload_docs.py
151
1338
import os import zipfile import contextlib import pytest from setuptools.command.upload_docs import upload_docs from setuptools.dist import Distribution from .textwrap import DALS from . import contexts SETUP_PY = DALS( """ from setuptools import setup setup(name='foo') """) @pytest.fixture def ...
mit
jacroe/spynot
cherrypy/_cptools.py
82
19396
"""CherryPy tools. A "tool" is any helper, adapted to CP. Tools are usually designed to be used in a variety of ways (although some may only offer one if they choose): Library calls All tools are callables that can be used wherever needed. The arguments are straightforward and should be detail...
lgpl-3.0
stspyder/servo
tests/wpt/css-tests/css-text-decor-3_dev/xhtml1/support/generate-text-emphasis-line-height-tests.py
829
3431
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-line-height-001 ~ 004 except 001z. They test the line height expansion in different directions. This script outputs a list of all tests it generated in the format of Mozilla reftest.list to the stdout. """ from __future__ ...
mpl-2.0
Vitallium/qtwebkit
Tools/QueueStatusServer/model/queuestatus.py
121
2109
# Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
gpl-2.0
jjhuff/fcc-comments
lib/nltk/parse/nonprojectivedependencyparser.py
5
26669
# Natural Language Toolkit: Dependency Grammars # # Copyright (C) 2001-2012 NLTK Project # Author: Jason Narad <jason.narad@gmail.com> # # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT # from __future__ import print_function import math from nltk.grammar import parse_dependency_grammar from ...
apache-2.0
Cinntax/home-assistant
tests/helpers/test_deprecation.py
4
2286
"""Test deprecation helpers.""" from homeassistant.helpers.deprecation import deprecated_substitute, get_deprecated from unittest.mock import patch, MagicMock class MockBaseClass: """Mock base class for deprecated testing.""" @property @deprecated_substitute("old_property") def new_property(self): ...
apache-2.0
eestay/edx-platform
common/test/acceptance/pages/lms/progress.py
182
3827
""" Student progress page """ from .course_page import CoursePage class ProgressPage(CoursePage): """ Student progress page. """ url_path = "progress" def is_browser_on_page(self): is_present = ( self.q(css='div.course-info').present and self.q(css='div#grade-deta...
agpl-3.0
nijel/kolikdluzi
dluhy/models.py
1
2284
from __future__ import unicode_literals from django.db import models from django.utils.safestring import mark_safe class Strana(models.Model): jmeno = models.CharField(max_length = 100) slug = models.SlugField(unique=True, max_length=100) wikipedia = models.URLField(null = True, blank = True) url = mod...
gpl-3.0
jmchen-g/models
inception/inception/data/process_bounding_boxes.py
17
8792
#!/usr/bin/python # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
apache-2.0
jon-choi/hillsbarber
venv/lib/python2.7/site-packages/pip/exceptions.py
280
1257
"""Exceptions used throughout package""" from __future__ import absolute_import class PipError(Exception): """Base pip exception""" class InstallationError(PipError): """General exception during installation""" class UninstallationError(PipError): """General exception during uninstallation""" class ...
apache-2.0
pedrobaeza/odoo
openerp/tools/view_validation.py
65
2536
""" View validation code (using assertions, not the RNG schema). """ import logging _logger = logging.getLogger(__name__) def valid_page_in_book(arch): """A `page` node must be below a `book` node.""" return not arch.xpath('//page[not(ancestor::notebook)]') def valid_field_in_graph(arch): """A `graph`...
agpl-3.0
caseyc37/pygame_cffi
test/base_test.py
2
25011
if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path.split(parent_dir)[1] == 'pygame') if not is_pygame_pkg: sys.path.inser...
lgpl-2.1
diegocortassa/TACTIC
3rd_party/site-packages/cherrypy/process/plugins.py
2
26429
"""Site services for use with a Web Site Process Bus.""" import os import re import signal as _signal import sys import time import threading from six.moves import _thread from cherrypy._cpcompat import text_or_bytes from cherrypy._cpcompat import ntob, Timer # _module__file__base is used by Autoreload to make # ab...
epl-1.0
notriddle/servo
etc/ci/chaos_monkey_test.py
140
1676
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
gamechanger/dusty
tests/unit/systems/docker/testing_images_test.py
1
5529
from mock import Mock, patch, call import docker from nose.tools import nottest from ....fixtures import premade_app from ....testcases import DustyTestCase from dusty.systems.docker.testing_image import (_ensure_base_image, _create_tagged_image, _get_split_volumes, _get_create_container_volumes, ...
mit
dvliman/jaikuengine
.google_appengine/lib/django-1.2/django/contrib/localflavor/no/forms.py
309
2761
""" Norwegian-specific Form helpers """ import re, datetime from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.translation import ugettext_lazy as _ class NOZipCodeField(RegexField): default_error_mes...
apache-2.0
dana-i2cat/felix
ofam/src/src/ext/sfa/trust/gid.py
3
9265
#---------------------------------------------------------------------- # Copyright (c) 2008 Board of Trustees, Princeton University # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without restriction, i...
apache-2.0
Scarygami/mirror-api-examples
hangout-comment-tracker/lib/oauth2client/file.py
253
3160
# Copyright (C) 2010 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 writ...
apache-2.0
renhaoqi/gem5-stable
ext/ply/example/newclasscalc/calc.py
151
4125
#!/usr/bin/env python # ----------------------------------------------------------------------------- # calc.py # # A simple calculator with variables. This is from O'Reilly's # "Lex and Yacc", p. 63. # # Class-based example contributed to PLY by David McNab. # # Modified to use new-style classes. Test case. # ---...
bsd-3-clause
TsinghuaX/edx-platform
cms/djangoapps/contentstore/views/item.py
1
15860
"""Views for items (modules).""" import logging from uuid import uuid4 from functools import partial from static_replace import replace_static_urls from xmodule_modifiers import wrap_xblock from django.core.exceptions import PermissionDenied from django.contrib.auth.decorators import login_required from xmodule.mod...
agpl-3.0
qharley/BotQueue
bumblebee/drivers/makerbot_driver/GcodeProcessors/BundleProcessor.py
1
1917
import re import inspect from .LineTransformProcessor import LineTransformProcessor from .ProgressProcessor import ProgressProcessor class BundleProcessor(LineTransformProcessor): def __init__(self): super(BundleProcessor, self).__init__() self.processors = [] self.code_map = {} ...
gpl-3.0
lightrabbit/PyBitmessage
src/bitmessagecli.py
3
72454
#!/usr/bin/env python2.7.x # Created by Adam Melton (.dok) referenceing https://bitmessage.org/wiki/API_Reference for API documentation # Distributed under the MIT/X11 software license. See http://www.opensource.org/licenses/mit-license.php. # This is an example of a daemon client for PyBitmessage 0.4.2, by .dok (Vers...
mit
teury/django-friendship
friendship/models.py
1
15450
from __future__ import unicode_literals from django.db import models from django.conf import settings from django.db.models import Q from django.core.cache import cache from django.core.exceptions import ValidationError from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from djan...
bsd-3-clause
dalf/searx-stats2
searxstats/fetcher/dnssec.py
1
2797
# pylint: disable=invalid-name # /!\ not functionnal import dns.name import dns.query import dns.dnssec import dns.message import dns.resolver import dns.rdatatype from searxstats.model import create_fetch from searxstats.common.http import get_host, NetworkType class DnsSecError(Exception): pass def get_nsa...
agpl-3.0
yishinli/emc2
src/emc/usr_intf/axis/makeicon.py
40
1144
# Copyright 2005 Jeff Epler # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, provided that # the above copyright notice appear in all copies and that both that copyright # notice and this permission notice...
lgpl-2.1
msmbuilder/osprey
osprey/tests/test_dataset_loader.py
2
6459
from __future__ import print_function, absolute_import, division import os import shutil import tempfile from nose.plugins.skip import SkipTest import numpy as np import sklearn.datasets from sklearn.externals.joblib import dump from numpy.testing.decorators import skipif from osprey.dataset_loaders import (DSVDatase...
apache-2.0
jiachenning/odoo
openerp/cli/deploy.py
369
3947
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import requests import sys import tempfile import zipfile from . import Command class Deploy(Command): """Deploy a module on an Odoo instance""" def __init__(self): super(Deploy, self).__init__() self.session = requests.se...
agpl-3.0
NunoEdgarGub1/nupic
nupic/swarming/HypersearchV2.py
4
169321
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gpl-3.0
qianqians/Screw
3rdparty/blender2ogre/io_ogre/shader.py
1
4375
def on_change_parent_material(mat,context): print(mat,context) print('callback', mat.ogre_parent_material) def get_subnodes(mat, type='TEXTURE'): d = {} for node in mat.nodes: if node.type==type: d[node.name] = node keys = list(d.keys()) keys.sort() r = [] for key in keys: r.ap...
lgpl-2.1
mgit-at/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
Azure/azure-sdk-for-python
sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_02_01/models/_models.py
1
224911
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
Superjom/NeuralNetworks
apps/paper/syntax_tree/parse_tree.py
1
9852
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on March 6, 2014 @author: Chunwei Yan @ PKU @mail: yanchunwei@outlook.com parse the syntax tree ''' from __future__ import division import re import numpy as np import sys sys.path.append('../../..') from models.recursive_autoencoder.tree import BinaryNode ...
apache-2.0
meletakis/collato
esn/userprofiles/forms.py
1
8108
# -*- coding: utf-8 -*- import uuid from django import forms from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from django.forms import ModelForm, Textarea, TextInput, DateInput,RadioSelect,CheckboxInput from userprofiles.models import UserProfile, Activities from regi...
gpl-2.0
owers19856/django-cms
cms/extensions/extension_pool.py
26
5091
from cms.exceptions import SubClassNeededError from .models import PageExtension, TitleExtension class ExtensionPool(object): def __init__(self): self.page_extensions = set() self.title_extensions = set() self.signaling_activated = False def register(self, extension): """ ...
bsd-3-clause
fayf/pyload
module/plugins/hoster/Xdcc.py
13
6747
# -*- coding: utf-8 -*- import re import socket import struct import sys import time from select import select from module.plugins.internal.Hoster import Hoster # from module.utils import decode from module.utils import save_join as fs_join class Xdcc(Hoster): __name__ = "Xdcc" __type__ = "hoster" ...
gpl-3.0
PhysikOnline-FFM/sagenb
sagenb/misc/worksheet2rst.py
6
6010
#!/usr/bin/python # -*- coding: utf-8 -*- r""" Convert worksheet.html files into ReStructuredText documents This is called by 'sage -sws2rst'. Can also be used as a commandline script (if BeautifulSoup is installed): ``python worksheet2rst.py worksheet.html`` or ``cat worksheet.html | python worksheet2rst.py`` AU...
gpl-3.0
ToontownUprising/src
toontown/coghq/BossbotCogHQLoader.py
1
5759
from direct.directnotify import DirectNotifyGlobal from direct.fsm import StateData import CogHQLoader from toontown.toonbase import ToontownGlobals from direct.gui import DirectGui from toontown.toonbase import TTLocalizer from toontown.toon import Toon from direct.fsm import State from toontown.coghq import BossbotHQ...
mit
egalpin/YouCompleteMe
python/ycm/syntax_parse.py
48
5812
#!/usr/bin/env python # # Copyright (C) 2013 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 you...
gpl-3.0
edusegzy/pychemqt
lib/eos.py
1
24336
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################### # Library to add EoS common functionality ############################################################################### from scipy import exp, log, log10, tan, sinh, tanh, arctan, sqrt from scip...
gpl-3.0
bearstech/ansible
test/runner/lib/pytar.py
72
1710
"""Python native TGZ creation.""" from __future__ import absolute_import, print_function import tarfile import os from lib.util import ( display, ) # improve performance by disabling uid/gid lookups tarfile.pwd = None tarfile.grp = None # To reduce archive time and size, ignore non-versioned files which are la...
gpl-3.0
sjperkins/tensorflow
tensorflow/contrib/keras/python/keras/layers/serialization_test.py
55
1592
# 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
lz1988/company-site
django/contrib/messages/tests/cookie.py
97
6122
import json from django.contrib.messages import constants from django.contrib.messages.tests.base import BaseTest from django.contrib.messages.storage.cookie import (CookieStorage, MessageEncoder, MessageDecoder) from django.contrib.messages.storage.base import Message from django.test.utils import override_settin...
bsd-3-clause
fillycheezstake/MissionPlanner
Lib/site-packages/scipy/misc/doccer.py
55
3935
''' Utilities to allow inserting docstring fragments for common parameters into function and method docstrings''' import sys def docformat(docstring, docdict=None): ''' Fill a function docstring from variables in dictionary Adapt the indent of the inserted docs Parameters ---------- docstring : ...
gpl-3.0
ibotty/ansible-modules-core
cloud/amazon/ec2_facts.py
110
6444
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0