repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
opendroid-Team/enigma2-4.1
refs/heads/master
lib/python/Components/Renderer/WatchesNobile.py
5
## Now FTA-render ;) import math from Renderer import Renderer from skin import parseColor from enigma import eCanvas, eSize, gRGB, eRect from Components.VariableText import VariableText from Components.config import config class WatchesNobile(Renderer): def __init__(self): Renderer.__init__(self) ...
justajeffy/arsenalsuite
refs/heads/master
cpp/lib/PyQt4/examples/tools/regexp.py
20
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2010 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
emesene/emesene
refs/heads/master
emesene/e3/papylib/papyon/papyon/sip/extensions/ms_conversation_id.py
6
# -*- coding: utf-8 -*- # # papyon - a python client library for Msn # # Copyright (C) 2010 Collabora Ltd. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or #...
Daniel-CA/odoo-addons
refs/heads/8.0
account_analytic_analysis_recurring_day/models/sale_order.py
4
# -*- coding: utf-8 -*- # (c) 2016 Alfredo de la Fuente - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, api, exceptions, _ class SaleOrder(models.Model): _inherit = 'sale.order' @api.multi def action_button_confirm(self): res = super(SaleOrd...
madjam/mxnet
refs/heads/master
example/reinforcement-learning/parallel_actor_critic/config.py
52
# 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...
papouso/odoo
refs/heads/8.0
addons/account_followup/__openerp__.py
261
# -*- 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...
rahmalik/trafficserver
refs/heads/master
tests/tools/traffic-replay/SSLReplay.py
5
#!/bin/env python3 ''' ''' # 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 ...
beastwood/synctity
refs/heads/master
rsync.py
1
''' Copyright 2009, 2010 Brian S. Eastwood. This file is part of Synctus. Synctus 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. Synctus ...
JoelESvensson/json-schema-hack
refs/heads/master
docs/conf.py
74
# -*- coding: utf-8 -*- # # JsonSchema documentation build configuration file, created by # sphinx-quickstart on Sat Dec 10 15:34:44 2011. # # 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 file. # # ...
mikelikespie/bazel
refs/heads/master
third_party/py/gflags/tests/gflags_googletest.py
132
#!/usr/bin/env python # Copyright (c) 2011, 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 l...
foxichu/etherkeeper
refs/heads/master
etherkeeper/organize/tests.py
24123
from django.test import TestCase # Create your tests here.
sbalde/edxplatform
refs/heads/master
lms/djangoapps/instructor/tests/test_spoc_gradebook.py
29
""" Tests of the instructor dashboard spoc gradebook """ from django.core.urlresolvers import reverse from nose.plugins.attrib import attr from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from student.tests.factories import UserFactory, CourseEnrollmentFactory, AdminFactory from xmodule.modul...
opensvn/test
refs/heads/master
src/study/list2.py
1
#!/bin/env python x = raw_input('Enter some numbers: ') aList = x print aList
Andr3iC/juriscraper
refs/heads/master
opinions/united_states_backscrapers/state/nyappdiv_1st.py
2
# Back Scraper for New York Appellate Divisions 1st Dept. # CourtID: nyappdiv_1st # Court Short Name: NY # Author: Andrei Chelaru # Reviewer: # Date: 2015-10-30 from ny import Site as NySite class Site(NySite): def __init__(self, *args, **kwargs): super(Site, self).__init__(*args, **kwargs) self...
datenbetrieb/odoo
refs/heads/8.0
addons/l10n_uy/__init__.py
438
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 Openerp.uy <[email protected]> # Proyecto de Localización de OperERP para Uruguay # $Id$ # # This program i...
upsuper/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/pytest/setup.py
13
import os import sys import setuptools import pkg_resources from setuptools import setup, Command classifiers = [ 'Development Status :: 6 - Mature', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Operating System :: Microsoft :: Windows',...
pchauncey/ansible
refs/heads/devel
lib/ansible/module_utils/aos.py
28
# # Copyright (c) 2017 Apstra Inc, <[email protected]> # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the m...
beakman/droidlab
refs/heads/master
config/urls.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from django.views import defaults as default_views from r...
chris-chambers/llvm
refs/heads/sbbm
test/CodeGen/SystemZ/Large/branch-range-12.py
13
# Test 64-bit COMPARE LOGICAL IMMEDIATE AND BRANCH in cases where the sheer # number of instructions causes some branches to be out of range. # RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s # Construct: # # before0: # conditional branch to after0 # ... # beforeN: # conditional branch to after0 # m...
arannasousa/pagseguro_xml
refs/heads/master
pagseguro_xml/pagamento/v2/classes/erros.py
2
# coding=utf-8 # --------------------------------------------------------------- # Desenvolvedor: Arannã Sousa Santos # Mês: 12 # Ano: 2015 # Projeto: pagseguro_xml # e-mail: [email protected] # --------------------------------------------------------------- from __future...
turbulencia/tlab
refs/heads/master
scripts/python/NcReduceLevels.py
2
import netCDF4 as nc import numpy as np import sys # getting data from stdin if ( len(sys.argv) <= 1 ): print("Usage: python $0 [flow,scal,tower] list-of-files.") quit() filetype = sys.argv[1] setoffiles = sorted(sys.argv[2:]) # processing data if ( filetype == 'tower' ): # setoflevels = np.arange(0,...
frascoweb/frasco
refs/heads/master
frasco/users/otp.py
1
from flask import current_app from frasco.ext import get_extension_state from frasco.mail import send_mail import pyotp from .password import hash_password, generate_random_password def generate_otp_code(user): user.otp_code = pyotp.random_base32() return generate_otpauth_url(user) def enable_2fa(user, cod...
ArcherSys/ArcherSys
refs/heads/master
skulpt/test/run/t174.py
1
longvalue = 9999999999999L print "%3ld" % 42 print "%d" % 42 print "%d" % 42.0 print "%d" % longvalue print "%07.2f" % 42 print "%07.2F" % 42 print "%(foo)s" % { 'foo': 'bar' } #print "%((foo))s" % { '(foo)': 'bar' } print "%sx" % (103*'a')
postfix/androguard
refs/heads/master
demos/dad_print.py
61
#!/usr/bin/env python # This file is part of Androguard. # # Copyright (c) 2012 Geoffroy Gueguen <[email protected]> # All Rights Reserved. # # Androguard 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 Fo...
craynot/django
refs/heads/master
tests/shortcuts/tests.py
132
from django.test import SimpleTestCase, override_settings from django.test.utils import require_jinja2 @override_settings( ROOT_URLCONF='shortcuts.urls', ) class ShortcutTests(SimpleTestCase): def test_render_to_response(self): response = self.client.get('/render_to_response/') self.assertEqu...
semonte/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/listIndexedByUnknownType.py
30
def f(i): xs = [] xs[i].items() def g(index): x = [][index] x['foo']
minhphung171093/GreenERP
refs/heads/master
openerp/addons/website_hr_recruitment/models/__init__.py
44
import hr_job import hr_recruitment_source import hr_applicant
QianBIG/odoo
refs/heads/8.0
addons/document/__openerp__.py
260
# -*- 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...
kartikdhar/djangotest
refs/heads/master
virt1/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.py
915
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import re from . import _base from .. import ihatexml from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory tag_regexp = re.compile("{([^}]*)}(.*)") def getETreeBu...
stevemarple/Arduino-org
refs/heads/ide-org-1.6.1.x
arduino-core/src/processing/app/i18n/python/requests/packages/urllib3/poolmanager.py
168
# urllib3/poolmanager.py # Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging from ._collections import RecentlyUsedContainer from .connectionpool import...
sridevikoushik31/nova
refs/heads/port_id_in_vif_on_devide
nova/tests/conductor/test_conductor.py
1
# 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/LICENSE-2.0 # # Unless required by applicable law or agree...
erja-gp/openthread
refs/heads/master
tools/harness-automation/cases/leader_9_2_1.py
16
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
elky/django
refs/heads/master
django/core/cache/backends/locmem.py
11
"Thread-safe in-memory cache backend." import pickle import time from contextlib import contextmanager from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.utils.synch import RWLock # Global in-memory store of cache data. Keyed by name, to provide # multiple named local memory caches. _c...
cruzegoodin/TSC-ShippingDetails
refs/heads/master
flask/lib/python2.7/site-packages/pytz/tzfile.py
480
#!/usr/bin/env python ''' $Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $ ''' try: from cStringIO import StringIO except ImportError: from io import StringIO from datetime import datetime, timedelta from struct import unpack, calcsize from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo fro...
bgat/linux-multi-v7
refs/heads/master
tools/perf/scripts/python/check-perf-trace.py
1997
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <[email protected]> # 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. ...
zmallen/pygraylog
refs/heads/master
pygraylog/graylogapi.py
1
import base64 import requests from endpoints import endpoints from urlparse import urlparse class GraylogAPI(object): def __init__(self, url, username=None, password=None, api_key=None): # check if the username / password vs. api_key cannot be provided at same time if username is not None and api_k...
mne-tools/mne-tools.github.io
refs/heads/main
0.18/_downloads/8ec5aedda7e79549d1003f83773d85a3/plot_montage.py
2
# -*- coding: utf-8 -*- """ .. _plot_montage: Plotting sensor layouts of EEG Systems ====================================== This example illustrates how to load all the EEG system montages shipped in MNE-python, and display it on fsaverage template. """ # noqa: D205, D400 # Authors: Alexandre Gramfort <alexandre.gra...
vasekhodina/blivet_gv_visualization
refs/heads/master
tests/test_visualizer.py
1
#No test functions as visualizer doesn't have anything worth testing
bwhite/hadoopy
refs/heads/master
hadoopy/thirdparty/pyinstaller/PyInstaller/hooks/hook-PyQt4.QtGui.py
3
hiddenimports = ['sip', 'PyQt4.QtCore', 'PyQt4._qt'] from PyInstaller.hooks.hookutils import qt4_plugins_binaries def hook(mod): mod.binaries.extend(qt4_plugins_binaries('accessible')) mod.binaries.extend(qt4_plugins_binaries('iconengines')) mod.binaries.extend(qt4_plugins_binaries('imageformats')) m...
popazerty/openblackhole-SH4
refs/heads/master
lib/python/Components/Task.py
55
# A Job consists of many "Tasks". # A task is the run of an external tool, with proper methods for failure handling from Tools.CList import CList class Job(object): NOT_STARTED, IN_PROGRESS, FINISHED, FAILED = range(4) def __init__(self, name): self.tasks = [ ] self.resident_tasks = [ ] self.workspace = "/tmp...
TimYi/django
refs/heads/master
tests/m2m_through/tests.py
295
from __future__ import unicode_literals from datetime import datetime from operator import attrgetter from django.test import TestCase from .models import ( CustomMembership, Employee, Event, Friendship, Group, Ingredient, Invitation, Membership, Person, PersonSelfRefM2M, Recipe, RecipeIngredient, Relati...
prasen-ftech/pywinauto
refs/heads/master
examples/notepad_fast.py
20
# GUI Application automation and testing library # Copyright (C) 2006 Mark Mc Mahon # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the License, or (at your opti...
hujiajie/chromium-crosswalk
refs/heads/master
tools/android/loading/log_requests.py
7
#! /usr/bin/python # Copyright 2015 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. """Loads a URL on an Android device, logging all the requests made to do it to a JSON file using DevTools. """ import contextlib import h...
11craft/django-waffle
refs/heads/master
waffle/management/commands/switch.py
4
from optparse import make_option from django.core.management.base import BaseCommand, CommandError from waffle.models import Switch class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('-l', '--list', action='store_true', dest='list_switch', default=False, ...
slapec/bangoo
refs/heads/master
bangoo/theming/tests.py
24123
from django.test import TestCase # Create your tests here.
rapidhere/rpbtman_autosign
refs/heads/master
pytz/zoneinfo/MST.py
9
'''tzinfo timezone information for MST.''' from pytz.tzinfo import StaticTzInfo from pytz.tzinfo import memorized_timedelta as timedelta class MST(StaticTzInfo): '''MST timezone definition. See datetime.tzinfo for details''' zone = 'MST' _utcoffset = timedelta(seconds=-25200) _tzname = 'MST' MST = MST...
FractalBrew/GoogleMusicChannel.bundle
refs/heads/master
Contents/Libraries/Shared/lib2to3/tests/__init__.py
308
"""Make tests/ into a package. This allows us to "import tests" and have tests.all_tests be a TestSuite representing all test cases from all test_*.py files in tests/.""" # Author: Collin Winter import os import os.path import unittest import types from . import support all_tests = unittest.TestSuite() tests_dir = ...
RudoCris/horizon
refs/heads/master
openstack_dashboard/dashboards/admin/networks/agents/tables.py
61
# Copyright 2014 Kylincloud # # 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 ...
ArcherSys/ArcherSys
refs/heads/master
eclipse/plugins/org.python.pydev.jython_4.5.5.201603221110/Lib/encodings/iso8859_13.py
593
""" Python Character Mapping Codec iso8859_13 generated from 'MAPPINGS/ISO8859/8859-13.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
jk1/intellij-community
refs/heads/master
python/lib/Lib/compiler/misc.py
100
def flatten(tup): elts = [] for elt in tup: if isinstance(elt, tuple): elts = elts + flatten(elt) else: elts.append(elt) return elts class Set: def __init__(self): self.elts = {} def __len__(self): return len(self.elts) def __contains__(s...
dknlght/dkodi
refs/heads/master
src/script.module.urlresolver/lib/urlresolver/plugins/twitchtv.py
1
""" Plugin for UrlResolver Copyright (C) 2016 anxdpanic This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version....
anbangr/osci-project-config
refs/heads/develop
tools/ci2project.py
11
#! /usr/bin/env python # Copyright 2014 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
Barrog/C4-Datapack
refs/heads/master
data/jscript/quests/358_IllegitimateChildOfAGoddess/__init__.py
1
# Illegitimate Child Of A Goddess version 0.1 # by DrLecter print "importing quests:", import sys from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest #Quest info QUEST_NUMBER,QUEST_NAME,...
adambyram/bite-project-mod
refs/heads/master
tools/bugs/server/appengine/providers/services.py
17
# Copyright 2011 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...
gurneyalex/odoo
refs/heads/13.0-improve_sale_coupon_perf
addons/l10n_at/__manifest__.py
4
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (c) 2015 WT-IO-IT GmbH (https://www.wt-io-it.at) # Mag. Wolfgang Taferner <[email protected]> # List of contributors: # Mag. Wolfgang Taferner <[email protected]> #...
sgmap/openfisca-france
refs/heads/master
openfisca_france/model/revenus/remplacement/rente_accident_travail.py
1
# -*- coding: utf-8 -*- from openfisca_france.model.base import * class rente_accident_travail(Variable): value_type = float entity = Individu label = u"Montant mensuel de la rente d’accident du travail" reference = u"https://www.legifrance.gouv.fr/affichCodeArticle.do?cidTexte=LEGITEXT000006073189&i...
Bunkerbewohner/azurepython3
refs/heads/master
azurepython3/auth.py
1
import base64 import hashlib import hmac from urllib.parse import urlparse import itertools import requests class SharedKeyAuthentication: def __init__(self, account_name, account_key): """ Initializes the authenticator using credentials provided """ self.account_name = account_nam...
EricYangzhiHong/python-docs-samples
refs/heads/master
datastore/ndb/transactions/appengine_config.py
129
""" `appengine_config.py` is automatically loaded when Google App Engine starts a new instance of your application. This runs before any WSGI applications specified in app.yaml are loaded. """ from google.appengine.ext import vendor # Third-party libraries are stored in "lib", vendoring will make # sure that they are...
flgiordano/netcash
refs/heads/master
+/google-cloud-sdk/lib/surface/test/android/locales/list.py
1
# 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 ag...
baloan/mt-krpc
refs/heads/master
krpc/missions/__init__.py
12133432
DemocracyClub/Website
refs/heads/master
democracy_club/apps/report_2019_general_election/__init__.py
12133432
berinhard/newfies-dialer
refs/heads/master
newfies/dialer_campaign/templatetags/__init__.py
12133432
ybbaigo/deeptext
refs/heads/master
deeptext/models/__init__.py
12133432
okfish/django-oscar
refs/heads/master
src/oscar/apps/promotions/migrations/__init__.py
12133432
bikash/omg-monitor
refs/heads/master
monitor/streams/__init__.py
12133432
stephen144/odoo
refs/heads/9.0
addons/website_sale_digital/controllers/__init__.py
78
# -*- encoding: utf-8 -*- import main
vortex-ape/scikit-learn
refs/heads/master
examples/model_selection/plot_learning_curve.py
5
""" ======================== Plotting Learning Curves ======================== On the left side the learning curve of a naive Bayes classifier is shown for the digits dataset. Note that the training score and the cross-validation score are both not very good at the end. However, the shape of the curve can be found in ...
nanshihui/PocCollect
refs/heads/master
component/bash/t.py
22
#!/usr/bin/env python # encoding: utf-8 class T(object): def __init__(self): self.result = { 'type': None, 'version': None, } self.keywords = [] self.versions = [] def match_rule(self,head='',context='',ip='',port='',productname={},keywo...
Catch-up-TV-and-More/plugin.video.catchuptvandmore
refs/heads/master
resources/lib/channels/wo/qvc.py
1
# -*- coding: utf-8 -*- # Copyright: (c) 2018, SylvainCecchetto # GNU General Public License v2.0+ (see LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt) # This file is part of Catch-up TV & More from __future__ import unicode_literals import json import re from codequick import Resolver, Script import urlqui...
njvack/masterfile
refs/heads/main
masterfile/scripts/pretty.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the masterfile package: https://github.com/njvack/masterfile # Copyright (c) 2020 Board of Regents of the University of Wisconsin System # Written by Nate Vack <[email protected]> at the Center for Healthy Minds # at the University of Wisconsin-Madison. # Released ...
gautam1858/tensorflow
refs/heads/master
tensorflow/contrib/boosted_trees/python/utils/losses.py
6
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
sander76/home-assistant
refs/heads/dev
homeassistant/components/dte_energy_bridge/sensor.py
5
"""Support for monitoring energy usage using the DTE energy bridge.""" import logging import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import CONF_NAME, HTTP_OK import homeassistant.helpers.config_validation as cv _LOGGER = lo...
xu-c/flasky
refs/heads/master
app/main/errors.py
149
from flask import render_template, request, jsonify from . import main @main.app_errorhandler(403) def forbidden(e): if request.accept_mimetypes.accept_json and \ not request.accept_mimetypes.accept_html: response = jsonify({'error': 'forbidden'}) response.status_code = 403 ret...
bashu/django-uncharted
refs/heads/develop
uncharted/__init__.py
279
__version__ = '0.0.1'
livingbio/libsaas
refs/heads/master
libsaas/services/flurry/service.py
4
from libsaas.services import base from .resource import Application, Applications class Flurry(base.Resource): """ """ def __init__(self, api_access_code): """ Create a Flurry service. :var api_access_code: The API access code. :vartype api_access_code: str """ ...
jjmleiro/hue
refs/heads/master
desktop/core/ext-py/requests-2.10.0/requests/packages/chardet/chardistribution.py
2754
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
lundjordan/services
refs/heads/master
src/tooltool/api/tooltool_api/flask.py
2
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import tooltool_api app = tooltool_api.create_app()
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/conf/urls/i18n.py
113
import warnings from django.conf import settings from django.conf.urls import patterns, url from django.core.urlresolvers import LocaleRegexURLResolver from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning from django.views.i18n import set_language def i18n_patterns(prefix, *args...
ivanhorvath/openshift-tools
refs/heads/prod
openshift/installer/vendored/openshift-ansible-3.7.52-1/roles/lib_openshift/library/oc_volume.py
3
#!/usr/bin/env python # pylint: disable=missing-docstring # flake8: noqa: T001 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ ...
martijnthe/qemu_stm32
refs/heads/stm32-v1.4
scripts/qapi-commands.py
27
# # QAPI command marshaller generator # # Copyright IBM, Corp. 2011 # # Authors: # Anthony Liguori <[email protected]> # Michael Roth <[email protected]> # # This work is licensed under the terms of the GNU GPLv2. # See the COPYING.LIB file in the top-level directory. from ordereddict import OrderedDict...
pombredanne/grokmirror
refs/heads/master
grokmirror/fsck.py
1
#-*- coding: utf-8 -*- # Copyright (C) 2013 by The Linux Foundation and contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
quinot/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/execute_lambda.py
16
#!/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...
pmacosta/pexdoc
refs/heads/master
tests/pinspect.py
1
# pinspect.py # Copyright (c) 2013-2019 Pablo Acosta-Serafini # See LICENSE for details # pylint: disable=C0103,C0111,C0413,E0611,F0401 # pylint: disable=R0201,R0205,R0903,R0913,R0914,R0915 # pylint: disable=W0104,W0212,W0232,W0611,W0612,W0613,W0621 # Standard library imports from __future__ import print_function from...
swagner-de/irws_homeworks
refs/heads/master
word_embeddings/tfidf.py
1
import math def compute_idf(docs): idf = {} for doc in docs: for term in doc: try: idf[term] += 1 except KeyError: idf[term] = 1 for k in idf: idf[k] = len(docs)/idf[k] return idf def compute_tf(doc): tf = {} for term in d...
loco-odoo/localizacion_co
refs/heads/master
openerp/addons/web/doc/_themes/flask_theme_support.py
2228
# flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal class FlaskyStyle(Style): background_color = "#f8f8f8" default_style = "...
oudalab/phyllo
refs/heads/master
phyllo/extractors/lactantiusDB.py
1
import sqlite3 import urllib import re from urllib.request import urlopen from bs4 import BeautifulSoup from phyllo.phyllo_logger import logger # this is mostly good # books 2-7 are missing from the Latin Library def getBooks(soup): siteURL = 'http://www.thelatinlibrary.com' textsURL = [] # get links to b...
dezynetechnologies/odoo
refs/heads/8.0
openerp/addons/base/tests/__init__.py
286
import test_acl import test_api import test_base import test_basecase import test_db_cursor import test_expression import test_func import test_ir_actions import test_ir_attachment import test_ir_filters import test_ir_sequence import test_ir_values import test_mail import test_menu import test_orm import test_osv impo...
FrankHeimes/xbmc
refs/heads/master
addons/service.xbmc.versioncheck/lib/aptdeamonhandler.py
177
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Team-XBMC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later versio...
AlexanderSavelyev/rdkit
refs/heads/master
rdkit/test_list.py
6
tests=[ ("python","test_list.py",{'dir':'ML'}), ("python","test_list.py",{'dir':'Chem'}), ("python","test_list.py",{'dir':'DataStructs'}), ("python","test_list.py",{'dir':'Dbase'}), ("python","test_list.py",{'dir':'SimDivFilters'}), ("python","test_list.py",{'dir':'VLib'}), ] longTests=[ ] if __na...
ZENGXH/scikit-learn
refs/heads/master
sklearn/metrics/cluster/bicluster.py
359
from __future__ import division import numpy as np from sklearn.utils.linear_assignment_ import linear_assignment from sklearn.utils.validation import check_consistent_length, check_array __all__ = ["consensus_score"] def _check_rows_and_columns(a, b): """Unpacks the row and column arrays and checks their shap...
lowfatcomputing/pacman
refs/heads/master
test/pacman/tests/sync010.py
28
self.description = "Install a package from a sync db with cascaded dependencies" sp1 = pmpkg("dummy", "1.0-2") sp1.files = ["bin/dummy", "usr/man/man1/dummy.1"] sp1.depends = ["dep1"] sp2 = pmpkg("dep1") sp2.files = ["bin/dep1"] sp2.depends = ["dep2"] sp3 = pmpkg("dep2") sp3.files = ["bin/dep2"] for p ...
JamesShaeffer/QGIS
refs/heads/master
python/plugins/processing/algs/grass7/ext/r_li_dominance_ascii.py
45
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_dominance_ascii.py ----------------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ************...
theshadowx/enigma2
refs/heads/master
lib/python/SIFTeam/SoftwareManager/Rank.py
2
from enigma import * from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.ActionMap import ActionMap from Components.Button import Button from Components.Label import Label from Components.Pixmap import Pixmap from Components.Sources.List import List from Tools.Directories import ...
Zord13appdesa/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/queue.py
51
"""A multi-producer, multi-consumer queue.""" from time import time as _time try: import threading as _threading except ImportError: import dummy_threading as _threading from collections import deque import heapq __all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue'] class Empty(Exception): "...
cedricbonhomme/Stegano
refs/heads/master
bin/statistics.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # Stegano - Stegano is a pure Python steganography module. # Copyright (C) 2010-2021 Cédric Bonhomme - https://www.cedricbonhomme.org # # For more information : https://github.com/cedricbonhomme/Stegano # # This program is free software: you can redistribute it and/or modi...
yasoob/PythonRSSReader
refs/heads/master
venv/lib/python2.7/dist-packages/samba/dbchecker.py
1
# Samba4 AD database checker # # Copyright (C) Andrew Tridgell 2011 # Copyright (C) Matthieu Patou <[email protected]> 2011 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the ...
CLVsol/odoo_cl_addons
refs/heads/master
cl_place/category/__init__.py
1
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
pandeydivesh15/item_sharing_portal
refs/heads/master
src/post/views.py
1
from django.shortcuts import render, get_object_or_404, redirect from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import HttpResponseRedirect from django.contrib import messages # Create your views here. from .models import Post from User.models import User, check_if_auth_user i...
tximikel/kuma
refs/heads/master
vendor/packages/translate/storage/properties.py
24
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2014 Zuza Software Foundation # # This file is part of translate. # # translate 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...
Lujeni/ansible
refs/heads/devel
lib/ansible/modules/cloud/vultr/vultr_firewall_group_info.py
14
#!/usr/bin/python # # (c) 2018, Yanis Guenane <[email protected]> # 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', ...