repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
ghislainp/iris
lib/iris/analysis/maths.py
2
26124
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
duhzecca/cinder
cinder/volume/drivers/san/hp/hpmsa_iscsi.py
13
1383
# Copyright 2014 Objectif Libre # Copyright 2015 DotHill Systems # # 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
houshengbo/nova_vmware_compute_driver
nova/tests/matchers.py
1
14525
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2012 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not ...
apache-2.0
shubhdev/edx-platform
lms/djangoapps/django_comment_client/tests/utils.py
47
1961
""" Utilities for tests within the django_comment_client module. """ from mock import patch from openedx.core.djangoapps.course_groups.tests.helpers import CohortFactory from django_comment_common.models import Role from django_comment_common.utils import seed_permissions_roles from student.tests.factories import Cour...
agpl-3.0
sertac/django
django/contrib/auth/urls.py
568
1036
# The views used below are normally mapped in django.contrib.admin.urls.py # This URLs file is used to provide a reliable view deployment for test purposes. # It is also provided as a convenience to those who want to deploy these URLs # elsewhere. from django.conf.urls import url from django.contrib.auth import views ...
bsd-3-clause
mrquim/repository.mrquim
script.module.youtube.dl/lib/youtube_dl/extractor/roosterteeth.py
34
5648
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, strip_or_none, unescapeHTML, urlencode_postdata, ) class RoosterTeethIE(InfoExtractor): _VALID_URL = r'https?://(?:.+?\.)?roosterteeth\.com/e...
gpl-2.0
VerifiableRobotics/controller-arena
src/controllerarena/controllers/refVec.py
1
4049
# code for python reference dipole vector field controller # these functions require stuff #from mathFuns import * from numpy import * from math import * class refVec: # define the constructor def __init__(self, q_0, controller_flag): # Initialize controller state self.phi_prev = None sel...
bsd-3-clause
tensorflow/datasets
tensorflow_datasets/summarization/newsroom.py
1
4417
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets 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 appl...
apache-2.0
eyeye/yotta
yotta/init.py
2
7036
# Copyright 2014 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , from __future__ import print_function import os import logging import re # Component, , represents an installed component, internal from .lib import component # version, , re...
apache-2.0
LingxiaoJIA/gem5
src/python/m5/internal/__init__.py
66
1575
# Copyright (c) 2006 The Regents of The University of Michigan # 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 ...
bsd-3-clause
kingvuplus/New
lib/python/Components/About.py
12
1415
from Tools.Directories import resolveFilename, SCOPE_SYSETC from enigma import getEnigmaVersionString from os import popen class About: def __init__(self): pass def getVersionString(self): return self.getImageVersionString() def getImageVersionString(self): try: file = open(resolveFilename(SCOPE_SYSETC, ...
gpl-2.0
badloop/SickRage
lib/sqlalchemy/orm/descriptor_props.py
78
24571
# orm/descriptor_props.py # Copyright (C) 2005-2014 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 """Descriptor properties are more "auxiliary" properties that exist as configu...
gpl-3.0
acsis-project/emissions
emissions/python/periodic_1960/regrid_OC_biomass_emissions_n96e_360d_1960.py
1
7191
#!/usr/bin/env python ############################################################################################## # # # regrid_emissions_N96e.py # # # Requirements: # Iris 1.10, cf_units, numpy # # # This Python script has been written by N.L. Abraham as part of the UKCA Tutorials: # http://www.ukca.ac.uk/wiki...
gpl-3.0
Azure/azure-sdk-for-python
sdk/servicebus/azure-servicebus/tests/livetest/test_errors.py
1
1336
import logging from uamqp import errors as AMQPErrors, constants as AMQPConstants from azure.servicebus.exceptions import ( _create_servicebus_exception, ServiceBusConnectionError, ServiceBusError ) def test_link_idle_timeout(): logger = logging.getLogger("testlogger") amqp_error = AMQPErrors.Lin...
mit
pannal/Subliminal.bundle
Contents/Libraries/Shared/urllib3/_collections.py
63
10746
from __future__ import absolute_import try: from collections.abc import Mapping, MutableMapping except ImportError: from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available class RLock: def __enter__(self): ...
mit
eadgarchen/tensorflow
tensorflow/python/ops/rnn_cell_impl.py
5
50321
# 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
vitaly4uk/django
django/views/generic/edit.py
225
11226
import inspect import re import warnings from django.core.exceptions import ImproperlyConfigured from django.forms import models as model_forms from django.http import HttpResponseRedirect from django.utils import six from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import forc...
bsd-3-clause
ystk/sched-deadline
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
gashac03/ubuntu
playbooks/edx-east/lifecycle_inventory.py
47
2776
#!/usr/bin/env python """ Build an ansible inventory based on autoscaling group instance lifecycle state. Outputs JSON to stdout with keys for each state and combination of autoscaling group and state. { "InService": [ "10.0.47.127", "10.0.46.174" ], "Terminating:Wait": [ "10.0.48.104" ], "e-d-...
agpl-3.0
codywilbourn/streamparse
streamparse/run.py
1
1924
""" Helper script for starting up bolts and spouts. """ import argparse import importlib import os import sys from pystorm.component import _SERIALIZERS RESOURCES_PATH = 'resources' def main(): """main entry point for Python bolts and spouts""" parser = argparse.ArgumentParser(description='Run a bolt/spout ...
apache-2.0
geerlingguy/ansible-modules-extras
cloud/rackspace/rax_clb_ssl.py
134
9462
#!/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
dgw/znc
translation_pot.py
7
3528
#!/usr/bin/env python3 # # Copyright (C) 2004-2016 ZNC, see the NOTICE file for details. # # 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 # #...
apache-2.0
seadsystem/ShR2
ESP8266/ESP8266_SDK/tools/gen_appbin.py
26
6999
#!/usr/bin/python # # File : gen_appbin.py # This file is part of Espressif's generate bin script. # Copyright (C) 2013 - 2016, Espressif Systems # # This program is free software: you can redistribute it and/or modify # it under the terms of version 3 of the GNU General Public License as # published by the Free Softwa...
mit
mhaessig/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/pdb.py
176
3491
""" interactive debugging with PDB, the Python Debugger. """ from __future__ import absolute_import import pdb import sys import pytest def pytest_addoption(parser): group = parser.getgroup("general") group._addoption('--pdb', action="store_true", dest="usepdb", default=False, h...
mpl-2.0
uni2u/neutron
neutron/db/metering/metering_db.py
1
10691
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # 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 applicabl...
apache-2.0
wkeeling/ansible
lib/ansible/utils/module_docs_fragments/cloudstack.py
175
2631
# -*- coding: utf-8 -*- # Copyright (c) 2015 René Moser <mail@renemoser.net> # # 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 # (...
gpl-3.0
crawfordsm/pysalt
saltfp/fpsafeio.py
2
5014
################################# LICENSE ################################## # Copyright (c) 2009, South African Astronomical Observatory (SAAO) # # All rights reserved. # # # # Redistribu...
bsd-3-clause
getnikola/heroku-buildpack-nikola
vendor/pip-1.3.1/pip/exceptions.py
63
2192
"""Exceptions used throughout package""" import textwrap class PipError(Exception): """Base pip exception""" class InstallationError(PipError): """General exception during installation""" class UninstallationError(PipError): """General exception during uninstallation""" class DistributionNotFound(In...
mit
psychopy/psychopy
psychopy/tests/test_misc/test_microphone.py
1
7457
from __future__ import division from builtins import object from past.utils import old_div import pytest import shutil, os, glob from tempfile import mkdtemp from os.path import abspath, dirname, join from psychopy import microphone from psychopy.microphone import _getFlacPath from psychopy import core from psychopy....
gpl-3.0
luxnovalabs/enjigo_door
web_interface/django/contrib/localflavor/ca/forms.py
100
4953
""" Canada-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, CharField, Select from django.utils.encoding import smart_text from django.utils.tran...
unlicense
kalebhartje/schoolboost
lms/djangoapps/courseware/features/login.py
3
1639
#pylint: disable=C0111 #pylint: disable=W0621 from lettuce import step, world from django.contrib.auth.models import User from nose.tools import assert_true @step('I am an unactivated user$') def i_am_an_unactivated_user(step): user_is_an_unactivated_user('robot') @step('I am an activated user$') def i_am_an_a...
agpl-3.0
Tejeshwarabm/Westwood
src/config-store/bindings/modulegen__gcc_LP64.py
66
76481
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
atopuzov/nitro-python
nssrc/com/citrix/netscaler/nitro/resource/config/audit/auditsyslogpolicy_tmglobal_binding.py
3
5173
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
trabacus-softapps/openerp-8.0-cc
openerp/addons/mail/report/__init__.py
438
1057
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
shawnadelic/shuup
shuup/core/utils/price_display.py
2
5685
# This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. """ Utilities for displaying prices correctly. Contents: * Class `PriceDisplayOptions` for stori...
agpl-3.0
Martin456/eve
eve/render.py
1
15213
# -*- coding: utf-8 -*- """ eve.render ~~~~~~~~~~ Implements proper, automated rendering for Eve responses. :copyright: (c) 2017 by Nicola Iarocci. :license: BSD, see LICENSE for more details. """ import re import time import datetime import simplejson as json from werkzeug import utils from fun...
bsd-3-clause
tximikel/kuma
vendor/packages/pygments/lexers/algebra.py
72
6167
# -*- coding: utf-8 -*- """ pygments.lexers.algebra ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for computer algebra systems. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, words from py...
mpl-2.0
nwspeete-ibm/openwhisk
core/pythonAction/cli/wskrule.py
1
5355
# # Copyright 2015-2016 IBM Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
michaelld/gnuradio
gr-blocks/python/blocks/stream_to_vector_decimator.py
6
3246
from __future__ import unicode_literals # # Copyright 2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (...
gpl-3.0
erudit/zenon
tests/unit/apps/public/search/test_utils.py
1
3018
import pytest from django.http.request import QueryDict from apps.public.search.forms import SearchForm from apps.public.search.utils import get_search_elements class FakeSolrData: def get_search_form_facets(self): return { 'disciplines': [], 'languages': [ ('fr',...
gpl-3.0
wemanuel/smry
Crypto/SelfTest/Hash/test_RIPEMD160.py
5
2685
# -*- coding: utf-8 -*- # # SelfTest/Hash/test_RIPEMD160.py: Self-test for the RIPEMD-160 hash function # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the exten...
apache-2.0
KonstaT/android_kernel_nokia_msm8x25
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
takeshineshiro/django-cms
cms/forms/utils.py
21
3092
# -*- coding: utf-8 -*- from collections import defaultdict from django.contrib.sites.models import Site from django.db.models.signals import post_save, post_delete from django.utils.datastructures import SortedDict from django.utils.safestring import mark_safe from cms.cache.choices import (clean_site_choices_cache,...
bsd-3-clause
MarcosCommunity/odoo
addons/stock_account/wizard/stock_invoice_onshipping.py
217
6918
# -*- 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
psf/black
tests/data/cantfit.py
1
4107
# long variable name this_is_a_ridiculously_long_name_and_nobody_in_their_right_mind_would_use_one_like_it = 0 this_is_a_ridiculously_long_name_and_nobody_in_their_right_mind_would_use_one_like_it = 1 # with a comment this_is_a_ridiculously_long_name_and_nobody_in_their_right_mind_would_use_one_like_it = [ 1, 2, 3...
mit
vied12/superdesk
server/superdesk/utc_tests.py
2
2433
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from dateti...
agpl-3.0
zielmicha/upwork-podatki
process.py
2
4979
from __future__ import print_function import csv import collections import datetime import glob import dateutil.parser import decimal from decimal import Decimal from exchange import exchange incomes = {} Income = collections.namedtuple('Income', 'date amount amount_before_fee client type') def parse_income(line): ...
gpl-3.0
JulyKikuAkita/PythonPrac
cs15211/SwapAdjacentinLRString.py
1
5766
__source__ = 'https://leetcode.com/problems/swap-adjacent-in-lr-string/' # Time: O(N) # Space: O(1) # # Description: Leetcode # 777. Swap Adjacent in LR String # # In a string composed of 'L', 'R', and 'X' characters, like "RXXLRXRXL", # a move consists of either replacing one occurrence of "XL" with "LX", # or replac...
apache-2.0
siusoon/Python_SPEEDSHOW
checkinactivity.py
1
1953
# logic: detect idle time from mac os (mouse and keyboard) and force to go to a specific website # to run the program, administrator needs to set the sleeptime, temp_idle_value and url # Firefox should be the default browser, hide all other applications and docking on the screen # set no screensaver # install fullscre...
unlicense
duramato/CouchPotatoServer
libs/suds/xsd/sxbasic.py
197
22829
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 distributed in the hope that it will ...
gpl-3.0
elektroll/etaimp
plug-ins/pygimp/plug-ins/file-openraster.py
5
9558
#!/usr/bin/env python # GIMP Plug-in for the OpenRaster file format # http://create.freedesktop.org/wiki/OpenRaster # Copyright (C) 2009 by Jon Nordby <jononor@gmail.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 # t...
gpl-3.0
justyns/home-assistant
homeassistant/components/thermostat/proliphix.py
7
2392
""" Support for Proliphix NT10e Thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/thermostat.proliphix/ """ from homeassistant.components.thermostat import ( STATE_COOL, STATE_HEAT, STATE_IDLE, ThermostatDevice) from homeassistant.const imp...
mit
almeidapaulopt/frappe
frappe/utils/boilerplate.py
1
9260
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function from six.moves import input import frappe, os, re from frappe.utils import touch_file, encode, cstr def make_boilerplate(dest, app_name): if not os.path.exists...
mit
chenjun0210/tensorflow
tensorflow/python/training/adagrad_da.py
45
7669
# 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
mrakitin/coding
route_tables_update/add_route.py
1
1944
__author__ = 'mrakitin' import os import socket import subprocess address_to_route = None qsh_ip = '192.12.90.0' qsh_ip_mask = '255.255.255.0' # Find IP address provided by SBU VPN: ips_dict = {} for i in socket.getaddrinfo(socket.gethostname(), None): ip = i[4][0] try: socket.inet_aton(ip) ...
gpl-2.0
willingc/oh-mainline
vendor/packages/docutils/docutils/parsers/rst/languages/gl.py
130
3711
# -*- coding: utf-8 -*- # Author: David Goodger # Contact: goodger@users.sourceforge.net # Revision: $Revision: 4229 $ # Date: $Date: 2005-12-23 00:46:16 +0100 (Fri, 23 Dec 2005) $ # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, pleas...
agpl-3.0
moio/spacewalk
backend/server/rhnServer/server_wrapper.py
1
3967
# # Copyright (c) 2008--2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
SalesforceEng/Providence
Empire/cloudservices/github/GithubAPI.py
1
5227
''' Copyright (c) 2015, Salesforce.com, 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 foll...
bsd-3-clause
robertmattmueller/sdac-compiler
sympy/matrices/expressions/hadamard.py
24
2455
from __future__ import print_function, division from sympy.core import Mul, Basic, sympify from sympy.strategies import unpack, flatten, sort, condition, exhaust, do_one from sympy.matrices.expressions.matexpr import MatrixExpr, ShapeError def hadamard_product(*matrices): """ Return the elementwise (aka Hada...
gpl-3.0
rahul67/hue
desktop/core/ext-py/guppy-0.1.10/guppy/etc/RE.py
37
18932
#._cv_part guppy.etc.RE from guppy.etc.RE_Rect import chooserects from guppy.etc.IterPermute import iterpermute class InfiniteError(Exception): pass class WordsMemo: def __init__(self, re, ch): self.re = re self.ch = ch self.xs = {} self.N = 0 def get_words_of_length(self, N): # Return a list of wo...
apache-2.0
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/AuthKit-0.4.0-py2.5.egg/authkit/authenticate/__init__.py
1
19006
"""Authentication middleware This module provides one piece of middleware named ``authkit.authenticate.middleware`` which is used to intercept responses with a specified status code, present a user with a means of authenticating themselves and handle the sign in process. Each of the authentication methods supported...
bsd-3-clause
Gillingham/evething
import.py
2
29714
#!/usr/bin/env python # ------------------------------------------------------------------------------ # Copyright (c) 2010-2013, EVEthing team # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # ...
bsd-2-clause
noahbenson/neuropythy
neuropythy/graphics/__init__.py
1
1109
#################################################################################################### # neuropythy/graphics/__init__.py # Simple tools for making matplotlib/pyplot graphics with neuropythy. # By Noah C. Benson ''' The neuropythy.graphics package contains definitions of the various tools for making plots...
agpl-3.0
turbokongen/home-assistant
homeassistant/components/spc/binary_sensor.py
14
2162
"""Support for Vanderbilt (formerly Siemens) SPC alarm systems.""" from pyspcwebgw.const import ZoneInput, ZoneType from homeassistant.components.binary_sensor import ( DEVICE_CLASS_MOTION, DEVICE_CLASS_OPENING, DEVICE_CLASS_SMOKE, BinarySensorEntity, ) from homeassistant.core import callback from home...
apache-2.0
mancoast/CPythonPyc_test
fail/311_test_memoryview.py
2
10981
"""Unit tests for the memoryview XXX We need more tests! Some tests are in test_bytes """ import unittest import test.support import sys import gc import weakref import array class AbstractMemoryTests: source_bytes = b"abcdef" @property def _source(self): return self.source_bytes @property...
gpl-3.0
wong2/sentry
src/sentry/migrations/0184_auto__del_field_group_checksum__del_unique_group_project_checksum__del.py
32
38374
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'Group', fields ['project', 'checksum'] d...
bsd-3-clause
NMisko/monkalot
bot/commands/speech_cleverbot.py
1
1114
"""Commands: "@[botname] XXXXX".""" from cleverwrap import CleverWrap from bot.commands.abstract.speech import Speech, Chatbot class CleverbotSpeech(Speech): """Natural language by using cleverbot.""" def __init__(self, bot): """Initialize variables.""" if "cleverbot_key" in bot.config and b...
mit
qianwenming/mapnik
scons/scons-local-2.3.1/SCons/Tool/packaging/src_targz.py
8
1764
"""SCons.Tool.Packaging.targz The targz SRC packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (th...
lgpl-2.1
SukkoPera/audiotrans
AudioTrans/Encoder.py
1
2300
#!/usr/bin/env python ########################################################################### # Copyright (C) 2008-2016 by SukkoPera # # software@sukkology.net # # ...
gpl-3.0
zzicewind/nova
nova/tests/unit/scheduler/test_scheduler_options.py
45
5307
# Copyright 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 requ...
apache-2.0
elena/django
tests/cache/tests.py
9
104310
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import sys import tempfile import threading import time import unittest import warnings from pathlib import Path from unittest import mock, skipIf from ...
bsd-3-clause
abhattad4/Digi-Menu
digimenu2/django/middleware/locale.py
85
3156
"This is the locale selecting middleware that will look at accept headers" from django.conf import settings from django.core.urlresolvers import ( LocaleRegexURLResolver, get_resolver, get_script_prefix, is_valid_path, ) from django.http import HttpResponseRedirect from django.utils import translation from django....
bsd-3-clause
Hellowlol/HTPC-Manager
libs/cherrypy/test/test_httplib.py
41
1287
"""Tests for cherrypy/lib/httputil.py.""" import unittest from cherrypy.lib import httputil class UtilityTests(unittest.TestCase): def test_urljoin(self): # Test all slash+atom combinations for SCRIPT_NAME and PATH_INFO self.assertEqual(httputil.urljoin("/sn/", "/pi/"), "/sn/pi/") self.a...
mit
OpenPymeMx/bank-statement-reconcile
__unported__/account_advanced_reconcile/easy_reconcile.py
15
1386
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
clones/django-command-extensions
django_extensions/templatetags/syntax_color.py
17
2309
r""" Template filter for rendering a string with syntax highlighting. It relies on Pygments to accomplish this. Some standard usage examples (from within Django templates). Coloring a string with the Python lexer: {% load syntax_color %} {{ code_string|colorize:"python" }} You may use any lexer in Pygments. ...
mit
kittiu/odoo
addons/account_voucher/__openerp__.py
260
3232
# -*- 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
raphaelmerx/django
django/contrib/gis/db/backends/spatialite/introspection.py
391
3131
from django.contrib.gis.gdal import OGRGeomType from django.db.backends.sqlite3.introspection import ( DatabaseIntrospection, FlexibleFieldLookupDict, ) from django.utils import six class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict): """ Sublcass that includes updates the `base_data_types_reverse` ...
bsd-3-clause
pattisdr/osf.io
api_tests/nodes/views/test_node_exceptions.py
14
5341
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import ( ProjectFactory, AuthUserFactory ) from rest_framework import exceptions @pytest.fixture() def user(): return AuthUserFactory() @pytest.mark.django_db class TestExceptionFormatting: @pytest.fixture() ...
apache-2.0
vineodd/PIMSim
GEM5Simulation/gem5/ext/ply/test/yacc_badprec.py
174
1446
# ----------------------------------------------------------------------------- # yacc_badprec.py # # Bad precedence specifier # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import tokens ...
gpl-3.0
pkill-nine/qutebrowser
qutebrowser/browser/urlmarks.py
3
9062
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # Copyright 2015-2017 Antoni Boucher <bouanto@zoho.com> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the...
gpl-3.0
rapilabs/django
django/contrib/admindocs/views.py
187
16552
import inspect import os import re from importlib import import_module from django.apps import apps from django.conf import settings from django.contrib import admin from django.contrib.admin.views.decorators import staff_member_required from django.contrib.admindocs import utils from django.core import urlresolvers f...
bsd-3-clause
sarathsreedharan/simoorg
src/simoorg/plugins/common/ZKUtil.py
8
7374
# # Copyright 2015 LinkedIn Corp. 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 ...
apache-2.0
hlmnrmr/superdesk-content-api
features/steps/steps.py
3
9108
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from r...
agpl-3.0
oppo-source/N3-4.4-kernel-source
scripts/gcc-wrapper.py
1276
3382
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
gpl-2.0
QUANTAXIS/QUANTAXIS
QUANTAXIS/QAUtil/QACode.py
2
4514
#coding :utf-8 # # The MIT License (MIT) # # Copyright (c) 2016-2021 yutiansut/QUANTAXIS # # 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 th...
mit
yosshy/nova
nova/virt/xenapi/agent.py
17
18768
# Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2010-2012 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/LICENS...
apache-2.0
tejasapatil/spark
python/pyspark/streaming/kafka.py
17
19940
# # 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
mdavid/horizon
openstack_dashboard/dashboards/admin/volumes/tabs.py
42
6374
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
ingadhoc/website
payment_todopago/todopago/test/GetCredentialsTest.py
1
3238
# pylint: disable-all # flake8: noqa import sys sys.path.append("..") from todopagoconnector import TodoPagoConnector from CredentialsData import CredentialsData import unittest from unittest import TestCase if sys.version_info[0] >= 3: from unittest.mock import patch, Mock else: from mock import patch, Mock, M...
agpl-3.0
ltilve/ChromiumGStreamerBackend
tools/telemetry/third_party/webpagereplay/third_party/dns/query.py
215
15983
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
bsd-3-clause
Gadal/sympy
sympy/matrices/expressions/tests/test_matpow.py
41
3323
from sympy.utilities.pytest import raises from sympy.core import symbols, pi, S from sympy.matrices import Identity, MatrixSymbol, ImmutableMatrix from sympy.matrices.expressions import MatPow, MatAdd, MatMul from sympy.matrices.expressions.matexpr import ShapeError n, m, l, k = symbols('n m l k', integer=True) A = Ma...
bsd-3-clause
ivan-fedorov/intellij-community
python/helpers/pydev/pydevd_trace_api.py
88
1048
def add_line_breakpoint(plugin, pydb, type, file, line, condition, expression, func_name): return None def add_exception_breakpoint(plugin, pydb, type, exception): return False def remove_exception_breakpoint(plugin, pydb, type, exception): return False def get_breakpoints(plugin, pydb): return None ...
apache-2.0
Argon-Zhou/django
django/conf/locale/hu/formats.py
504
1117
# -*- 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. F j.' TIME_FORMAT = 'G.i' DATE...
bsd-3-clause
google/autocjk
src/model.py
1
14838
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
kaixinjxq/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_ro_media-src_corss-origin_audio_blocked_ext.py
23
2318
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "media-src http://www....
bsd-3-clause
dorant/home-assistant
homeassistant/components/switch/transmission.py
10
3463
""" homeassistant.components.switch.transmission ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Enable or disable Transmission BitTorrent client Turtle Mode. Configuration: To use the Transmission switch you will need to add something like the following to your configuration.yaml file. switch: platform: transmission...
mit
akarca/magpie
magpie/handler/search.py
5
1638
from os import path from re import sub from sh import find, grep, ErrorReturnCode_1 from urllib2 import unquote from tornado.web import authenticated from base import BaseHandler class SearchHandler(BaseHandler): @authenticated def get(self): query = unquote(self.get_argument('q', '')) if que...
mit
joeyjojo/django_offline
src/django/contrib/gis/gdal/prototypes/geom.py
91
4762
from ctypes import c_char_p, c_double, c_int, c_void_p, POINTER from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope from django.contrib.gis.gdal.prototypes.generation import...
mit
solashirai/edx-platform
lms/envs/devplus.py
33
2417
""" This config file tries to mimic the production environment more closely than the normal dev.py. It assumes you're running a local instance of MySQL 5.1 and that you're running memcached. You'll want to use this to test caching and database migrations. Assumptions: * MySQL 5.1 (version important? (askbot breaks on...
agpl-3.0
alexus37/AugmentedRealityChess
pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/GL/NV/shader_storage_buffer_object.py
9
1287
'''OpenGL extension NV.shader_storage_buffer_object This module customises the behaviour of the OpenGL.raw.GL.NV.shader_storage_buffer_object to provide a more Python-friendly API Overview (from the spec) This extension provides assembly language support for shader storage buffers (from the ARB_shader_storage_b...
mit