repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
rwl/openpowersystem
refs/heads/master
cpsm/load_model/non_conform_load_schedule.py
1
#------------------------------------------------------------------------------ # Copyright (C) 2009 Richard Lincoln # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation; version 2 dated June...
degs098/python-social-auth
refs/heads/master
examples/django_me_example/manage.py
126
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'example.settings') from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
roopali8/tempest
refs/heads/master
tempest/api/messaging/test_claims.py
11
# Copyright (c) 2014 Rackspace, 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 wr...
amith01994/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/gis/tests/utils.py
397
from django.conf import settings from django.db import DEFAULT_DB_ALIAS # function that will pass a test. def pass_test(*args): return def no_backend(test_func, backend): "Use this decorator to disable test on specified backend." if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend: ...
MartinEnder/erpnext-de
refs/heads/develop
erpnext/controllers/item_variant.py
10
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import cstr, flt import json class ItemVariantExistsError(frappe.ValidationError): pass class Inva...
AndyKrivovjas/notes
refs/heads/master
app/category/serializers.py
1
from datetime import datetime from app.users.models import User from .models import Category from rest_framework import serializers class CategorySerializer(serializers.ModelSerializer): def __init__(self, *args, **kwargs): super(serializers.ModelSerializer, self).__init__(*args, **kwargs) @staticme...
SnappleCap/oh-mainline
refs/heads/master
vendor/packages/south/south/tests/otherfakeapp/migrations/0002_second.py
176
from south.db import db from django.db import models class Migration: def forwards(self): pass def backwards(self): pass
Jgarcia-IAS/localizacion
refs/heads/master
openerp/addons-extra/odoo-pruebas/odoo-server/addons/hr/res_users.py
303
from openerp import api from openerp.osv import fields, osv class res_users(osv.Model): """ Update of res.users class - if adding groups to an user, check if base.group_user is in it (member of 'Employee'), create an employee form linked to it. """ _name = 'res.users' _inherit = ['res....
mlsecproject/gglsbl-rest
refs/heads/master
config.py
1
from os import environ import logging.config from apscheduler.schedulers.background import BackgroundScheduler from multiprocessing import cpu_count from subprocess import Popen logging.config.fileConfig('logging.conf') bind = "0.0.0.0:5000" workers = int(environ.get('WORKERS', cpu_count() * 8 + 1)) timeout = int(en...
ms-iot/python
refs/heads/develop
cpython/Doc/includes/sqlite3/executescript.py
140
import sqlite3 con = sqlite3.connect(":memory:") cur = con.cursor() cur.executescript(""" create table person( firstname, lastname, age ); create table book( title, author, published ); insert into book(title, author, published) values ( ...
Farthen/OTFBot
refs/heads/v1.0
otfbot/plugins/ircClient/url.py
1
# This file is part of OtfBot. # -*- coding: utf-8 -*- # # OtfBot is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # OtfBot is distrib...
IsaacHaze/tweepy
refs/heads/master
tests/test_streaming.py
37
from __future__ import absolute_import, print_function from .config import tape import six if six.PY3: import unittest from unittest.case import skip else: import unittest2 as unittest from unittest2.case import skip from tweepy.api import API from tweepy.auth import OAuthHandler from tweepy.models i...
randynobx/ansible
refs/heads/devel
lib/ansible/module_utils/facts/hardware/netbsd.py
223
# 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 in the hope that ...
coxm/djangocms-cascade
refs/heads/master
tests/test_base.py
5
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from django.contrib.auth.models import User from cms.api import create_page from cms.admin.pageadmin import PageAdmin from cms.models.placeholdermodel import Placeholder from cms.test_utils.testcases import CMSTestCase cl...
andrewnc/scikit-learn
refs/heads/master
benchmarks/bench_tree.py
297
""" To run this, you'll need to have installed. * scikit-learn Does two benchmarks First, we fix a training set, increase the number of samples to classify and plot number of classified samples as a function of time. In the second benchmark, we increase the number of dimensions of the training set, classify a sam...
makerbot/s3g
refs/heads/master
technician_tests/techtest_BotFactory.py
1
from __future__ import (absolute_import, print_function, unicode_literals) from __future__ import (absolute_import, print_function, unicode_literals) import os import sys import uuid lib_path = os.path.abspath('../') sys.path.append(lib_path) try: import unittest2 as unittest except ImportError: import unit...
ubiar/odoo
refs/heads/8.0
openerp/addons/test_workflow/models.py
337
# -*- coding: utf-8 -*- import openerp.osv.orm class m(openerp.osv.orm.Model): """ A model for which we will define a workflow (see data.xml). """ _name = 'test.workflow.model' def print_(self, cr, uid, ids, s, context=None): print ' Running activity `%s` for record %s' % (s, ids) return ...
denverdino/compose
refs/heads/master
tests/unit/cli/formatter_test.py
16
from __future__ import absolute_import from __future__ import unicode_literals import logging from compose.cli import colors from compose.cli.formatter import ConsoleWarningFormatter from tests import unittest MESSAGE = 'this is the message' def makeLogRecord(level): return logging.LogRecord('name', level, 'p...
adityaduggal/erpnext
refs/heads/develop
erpnext/agriculture/doctype/detected_disease/detected_disease.py
23
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class DetectedDisease(Document): pass
chris48s/UK-Polling-Stations
refs/heads/master
polling_stations/apps/data_collection/management/commands/import_gateshead.py
1
from data_collection.management.commands import BaseXpressDCCsvInconsistentPostcodesImporter class Command(BaseXpressDCCsvInconsistentPostcodesImporter): council_id = 'E08000037' addresses_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017 (6).tsv' stations_name = 'parl.2017-06-08/Version 1/Democ...
d120/pyofahrt
refs/heads/master
faq/migrations/0001_initial.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-19 22:40 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateMode...
VaibhavAgarwalVA/sympy
refs/heads/master
sympy/physics/quantum/tests/test_shor.py
99
from sympy.utilities.pytest import XFAIL from sympy.physics.quantum.qapply import qapply from sympy.physics.quantum.qubit import Qubit from sympy.physics.quantum.shor import CMod, getr @XFAIL def test_CMod(): assert qapply(CMod(4, 2, 2)*Qubit(0, 0, 1, 0, 0, 0, 0, 0)) == \ Qubit(0, 0, 1, 0, 0, 0, 0, 0) ...
lipari/flux-core
refs/heads/master
src/bindings/python/flux/kz.py
1
import errno import os import sys from flux._kz import ffi, lib from flux.wrapper import Wrapper, WrapperPimpl class KZWrapper(Wrapper): # This empty class accepts new methods, preventing accidental overloading # across wrappers pass RAW = KZWrapper(ffi, lib, prefixes=['kz_', ]) # override error check b...
F5Networks/f5-ansible-modules
refs/heads/doc-update
ansible_collections/f5networks/f5_modules/plugins/modules/bigip_message_routing_router.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2019, F5 Networks 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 DOCUMENTATION = r''' --- module: bigip_message_routing_r...
RangerWolf/wxFan
refs/heads/master
client/bot.py
1
# -*- coding:utf-8 -*- import sys, os, json import platform import schedule import thread from datetime import datetime import itchat, time from itchat.content import * sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) reload(sys) sys.setdefaultencoding('utf-8') @itchat.msg_register([TE...
cloudbase/neutron-virtualbox
refs/heads/virtualbox_agent
neutron/db/migration/alembic_migrations/versions/27cc183af192_ml2_vnic_type.py
17
# 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 law ...
muraliselva10/designate
refs/heads/master
designate/tests/test_schema/test_format.py
5
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Kiall Mac Innes <[email protected]> # # 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/...
harihpr/tweetclickers
refs/heads/master
pybossa/auth/category.py
5
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
MTG/sms-tools
refs/heads/master
software/transformations_interface/hpsMorph_GUI_frame.py
2
# GUI frame for the hpsMorph_function.py try: # for Python2 from Tkinter import * ## notice capitalized T in Tkinter import tkFileDialog, tkMessageBox except ImportError: # for Python3 from tkinter import * ## notice lowercase 't' in tkinter here from tkinter import filedialog as tkFileDial...
goddardl/cortex
refs/heads/master
test/IECoreRI/MultipleContextsTest.py
7
########################################################################## # # Copyright (c) 2008-2013, Image Engine Design 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: # # * Redis...
crypto101/merlyn
refs/heads/master
merlyn/test/test_auth.py
1
from axiom.store import Store from merlyn import auth from OpenSSL.crypto import FILETYPE_PEM, load_certificate, load_privatekey from twisted.python.log import ILogObserver, addObserver, removeObserver from twisted.test.proto_helpers import StringTransport from twisted.trial.unittest import SynchronousTestCase from zop...
blacklin/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/test_contains.py
173
from collections import deque from test.support import run_unittest import unittest class base_set: def __init__(self, el): self.el = el class myset(base_set): def __contains__(self, el): return self.el == el class seq(base_set): def __getitem__(self, n): return [self.el][n] cla...
pschmitt/home-assistant
refs/heads/dev
tests/components/google/conftest.py
13
"""Test configuration and mocks for the google integration.""" import pytest from tests.async_mock import patch TEST_CALENDAR = { "id": "[email protected]", "etag": '"3584134138943410"', "timeZone": "UTC", "accessRole": "reader", "foregroundColor": "#000000", ...
Spleen64/Sick-Beard
refs/heads/master
lib/imdb/_compat.py
128
""" _compat module (imdb package). This module provides compatibility functions used by the imdb package to deal with unusual environments. Copyright 2008-2010 Davide Alberani <[email protected]> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License...
royosherove/bitcoinxt
refs/heads/master
contrib/seeds/generate-seeds.py
115
#!/usr/bin/python # Copyright (c) 2014 Wladmir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the directory that...
yakovenkodenis/rethinkdb
refs/heads/next
test/rql_test/connections/http_support/httpbin/helpers.py
49
# -*- coding: utf-8 -*- """ httpbin.helpers ~~~~~~~~~~~~~~~ This module provides helper functions for httpbin. """ import json import base64 from hashlib import md5 from werkzeug.http import parse_authorization_header from flask import request, make_response try: from urlparse import urlparse, urlunparse excep...
frankosan/pypers
refs/heads/master
pypers/steps/gatk/__init__.py
18
from os.path import realpath, dirname from pypers import import_all # Import all Steps in this directory. import_all(namespace=globals(), dir=dirname(realpath(__file__)))
agry/NGECore2
refs/heads/master
scripts/mobiles/generic/faction/imperial/imp_stormrifle_79.py
2
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from resources.datatables import FactionStatus from java.util import Vector def addTemplate(co...
kod3r/splash
refs/heads/master
splash/tests/test_har.py
4
# -*- coding: utf-8 -*- from __future__ import absolute_import import unittest import warnings from splash.har import schema from splash.har.utils import entries2pages from splash.tests import test_redirects from splash.tests.utils import NON_EXISTING_RESOLVABLE from .test_render import BaseRenderTest class BaseHarR...
avanov/django
refs/heads/master
tests/migrations/test_optimizer.py
11
# -*- coding: utf-8 -*- from django.db import migrations, models from django.db.migrations.optimizer import MigrationOptimizer from django.test import SimpleTestCase from .models import CustomModelBase, EmptyManager class OptimizerTests(SimpleTestCase): """ Tests the migration autodetector. """ def...
qiankunshe/sky_engine
refs/heads/master
build/android/pylib/utils/proguard.py
51
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import re import tempfile from pylib import constants from pylib import cmd_helper _PROGUARD_CLASS_RE = re.compile(r'\s*?- Program class:\s*([\S...
spnow/grr
refs/heads/master
executables/python_hacks/shutdown_host.py
16
#!/usr/bin/env python """Shut down windows hosts.""" import platform tested_versions = ['xp', 'vista', '2008', '2003'] cmd = 'cmd' args = ['/c', '%SystemRoot%\\System32\\shutdown.exe', '/s', '/f'] os_version = platform.platform().lower() # pylint: disable=undefined-variable if 'time_in_seconds' in py_args: args.ex...
shaufi10/odoo
refs/heads/8.0
addons/l10n_be_hr_payroll/__init__.py
438
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
benoitsteiner/tensorflow-opencl
refs/heads/master
tensorflow/contrib/ndlstm/python/lstm1d_test.py
94
# 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 applicable ...
hlieberman/ansible-modules-core
refs/heads/devel
network/eos/eos_template.py
28
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
getopenmono/mbed
refs/heads/master
workspace_tools/host_tests/udp_link_layer_auto.py
124
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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...
Hydrosys4/Master
refs/heads/master
photomod.py
1
from __future__ import print_function import time from time import sleep import datetime import os import sys import subprocess from PIL import Image # to make thumbnail from subprocess import call from shutil import copyfile def videodevlist(): folderpath="/dev" videolist=[] filelist=os.listdir(folderpath) for...
SteveS84/Galaxy-Player-4.0-Kernel
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
802
# Core.py - Python extension for perf trace, core functions # # Copyright (C) 2010 by Tom Zanussi <[email protected]> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def auto...
xubenben/scikit-learn
refs/heads/master
examples/decomposition/plot_pca_vs_fa_model_selection.py
142
""" =============================================================== Model selection with Probabilistic PCA and Factor Analysis (FA) =============================================================== Probabilistic PCA and Factor Analysis are probabilistic models. The consequence is that the likelihood of new data can be u...
keedio/hue
refs/heads/master
desktop/core/ext-py/tablib-0.10.0/tablib/packages/xlwt3/Row.py
46
# -*- coding: windows-1252 -*- from . import BIFFRecords from . import Style from .Cell import StrCell, BlankCell, NumberCell, FormulaCell, MulBlankCell, BooleanCell, ErrorCell, \ _get_cells_biff_data_mul from . import ExcelFormula import datetime as dt try: from decimal import Decimal except ImportE...
AsgerPetersen/QGIS
refs/heads/master
python/ext-libs/pygments/lexers/_scilab_builtins.py
364
# -*- coding: utf-8 -*- """ pygments.lexers._scilab_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Builtin list for the ScilabLexer. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ # These lists are generated automatically. # Run the follo...
webspinner/webspinner-gae-cms
refs/heads/master
appengine_utilities/cache.py
26
# -*- coding: utf-8 -*- """ Copyright (c) 2008, appengine-utilities project 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 ...
sergecodd/FireFox-OS
refs/heads/master
B2G/gecko/config/JarMaker.py
2
# 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/. '''jarmaker.py provides a python class to package up chrome content by processing jar.mn files. See the documentation f...
proxysh/Safejumper-for-Desktop
refs/heads/master
buildlinux/env32/local/lib/python2.7/encodings/mac_roman.py
593
""" Python Character Mapping Codec mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.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,err...
jason-weirather/IDP
refs/heads/master
bin/novel_genephed.py
2
#!/usr/bin/python import sys import os if len(sys.argv) >= 3: ref_refFlat_filename = sys.argv[1] tag_refFlat_filename = sys.argv[2] output_filename = sys.argv[3] else: print ("usage: python novel_genephed.py ref_refFlat_filename tag_refFlat_filename output_filename") print ("or ./novel_genephed.p...
stephaneAG/PengPod700
refs/heads/master
QtEsrc/backup_qt/qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/ThirdParty/gyp/test/generator-output/gyptest-relocate.py
151
#!/usr/bin/env python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that a project hierarchy created with the --generator-output= option can be built even when it's relocated to a different path....
streamlio/heron
refs/heads/master
third_party/pex/pex/crawler.py
13
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). """Support for webpage parsing and crawling.""" import os import re import threading import traceback from .compatibility import PY3 from .http import Context from .link import Link from...
2014c2g4/2015cda_g7
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/warnings.py
752
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys __all__ = ["warn", "showwarning", "formatwarning", "filterwarnings", "resetwarnings", "catch_warnings"] def...
ocefpaf/cartopy
refs/heads/master
lib/cartopy/tests/crs/test_utm.py
2
# (C) British Crown Copyright 2018, Met Office # # This file is part of cartopy. # # cartopy 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 la...
ewdurbin/sentry
refs/heads/master
tests/sentry/utils/http/tests.py
12
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock from django.conf import settings from exam import fixture from sentry.models import Project from sentry.testutils import TestCase from sentry.utils.http import ( is_same_domain, is_valid_origin, get_origins, absolute_uri) class Absolut...
dongguangming/python-phonenumbers
refs/heads/dev
python/phonenumbers/shortdata/region_FJ.py
11
"""Auto-generated file, do not edit by hand. FJ metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_FJ = PhoneMetadata(id='FJ', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='[0-579]\\d{1,4}', possible_number_patte...
authmillenon/RIOT
refs/heads/master
dist/tools/stm32loader/stm32loader.py
32
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # vim: sw=4:ts=4:si:et:enc=utf-8 # Author: Ivan A-R <[email protected]> # With hacky error recovery by Gordon Williams <[email protected]> # Project page: http://tuxotronic.org/wiki/projects/stm32loader # # This file is part of stm32loader. # # stm32loader is free software...
hanicker/odoo
refs/heads/8.0
openerp/cli/deploy.py
369
#!/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...
lwthatcher/Compass
refs/heads/master
web/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py
2542
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the common.py file.""" import gyp.common import unittest import sys class TestTopologicallySorted(unittest.TestCase): ...
thijstriemstra/Pi-GPIO-Server
refs/heads/master
pi_gpio/events.py
1
from pi_gpio import socketio from config.pins import PinManager class PinEventManager(PinManager): def __init__(self): super(PinEventManager, self).__init__() self.socketio = socketio self.edge = { 'RISING': self.gpio.RISING, 'FALLING': self.gpio.FALLING, ...
albertz/music-player
refs/heads/master
src/TaskSystem.py
1
""" Here are all subprocess, threading etc related utilities, most of them quite low level. """ from __future__ import print_function from utils import * from threading import Condition, Thread, RLock, Lock, currentThread import Logging import sys import os try: from StringIO import StringIO except ImportError: fro...
Edu-Glez/Bank_sentiment_analysis
refs/heads/master
env/lib/python3.6/site-packages/nbconvert/tests/files/override.py
29
c = get_config() #Export all the notebooks in the current directory to the sphinx_howto format. c.NbConvertApp.notebooks = ['notebook2.ipynb'] c.NbConvertApp.export_format = 'python'
Ca2Patton/PythonStuff
refs/heads/master
parseArgs.py
1
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python import argparse parser = argparse.ArgumentParser() parser.add_argument("square", help="Display a square of a given number", type=int) args = parser.parse_args() parser.add_argument("-v", "--verbose", action="count", default=0, help="increase output verbo...
quake0day/oj
refs/heads/master
aa.py
1
import heapq class Solution: def __init__(self): self.heap_min = [] self.heap_max = [] def insert(self, num): if not self.heap_min or num>self.heap_min[0]: heapq.heappush(self.heap_min, num) else: heapq.heappush(self.heap_max, -num) self.balance()...
ostcar/OpenSlides
refs/heads/master
server/openslides/core/migrations/0016_projector_reference_projector.py
8
# Generated by Django 2.1.5 on 2019-01-31 10:24 from django.db import migrations, models import openslides.utils.models class Migration(migrations.Migration): dependencies = [("core", "0015_auto_20190122_1216")] operations = [ migrations.AddField( model_name="projector", na...
duramato/SickRage
refs/heads/master
lib/unidecode/x05b.py
252
data = ( 'Gui ', # 0x00 'Deng ', # 0x01 'Zhi ', # 0x02 'Xu ', # 0x03 'Yi ', # 0x04 'Hua ', # 0x05 'Xi ', # 0x06 'Hui ', # 0x07 'Rao ', # 0x08 'Xi ', # 0x09 'Yan ', # 0x0a 'Chan ', # 0x0b 'Jiao ', # 0x0c 'Mei ', # 0x0d 'Fan ', # 0x0e 'Fan ', # 0x0f 'Xian ', # 0x10 'Yi '...
zasdfgbnm/tensorflow
refs/heads/master
tensorflow/contrib/tpu/python/tpu/tpu_infeed_test.py
85
# 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...
mph-/lcapy
refs/heads/master
doc/examples/functions/tri.py
1
from matplotlib.pyplot import savefig, style from lcapy import * style.use('function.mplstyle') tri(t).plot((-2, 2), title='tri(t)') savefig(__file__.replace('.py', '.png'))
savoirfairelinux/OpenUpgrade
refs/heads/master
addons/web_tests/tests/__init__.py
385
# -*- coding: utf-8 -*- import test_ui
Evegen55/sequences-and-series
refs/heads/master
quizzes/applyRatioTestWithFactorials/__init__.py
3
from questions import * class Question(RandomizedQuestion): module = __file__ video = 'ratio-test-statement' forum = 10116 title = 'apply the ratio test on a series involving factorials' textbook = 'example:ratio-test-factorials' def good_enough(self): return self.ell != 1 def per...
virt-manager/virt-bootstrap
refs/heads/master
src/virtBootstrap/sources/docker_source.py
1
# -*- coding: utf-8 -*- # Authors: Cedric Bosdonnat <[email protected]> # # Copyright (C) 2017 SUSE, Inc. # # 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 ...
nickjj/flask-webpack
refs/heads/master
flask_webpack/tests/test_app/app.py
4
from flask import Flask, render_template from werkzeug.serving import run_simple from flask_webpack import Webpack webpack = Webpack() def create_app(settings_override=None): """ Create a test application. :param settings_override: Override settings :type settings_override: dict :return: Flask a...
epri-dev/PT2
refs/heads/master
res/scripts/arp_poison_hosts.py
1
#!/usr/bin/env python import os import sys import subprocess import signal interface = sys.argv[1] host1 = sys.argv[2] host2 = sys.argv[3] if interface.strip() == "": c1 = "arpspoof -t %s -r %s" % (host1, host2) else: c1 = "arpspoof -i %s -t %s -r %s" % (interface, host1, host2) p1 = subprocess.Popen(c1.spli...
eadgarchen/tensorflow
refs/heads/master
tensorflow/contrib/ffmpeg/encode_audio_op_test.py
54
# 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...
gearslam/v20j-geeb
refs/heads/master
scripts/gcc-wrapper.py
2
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, Code Aurora Forum. 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 a...
testiddd/ShaniXBMCWork
refs/heads/master
legacy/temp/test.py
12
import urllib2,re url="http://www.hdarabic.com/" req = urllib2.Request(url) req.add_header('User-Agent', 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10') response = urllib2.urlopen(req) link=response.read() resp...
pinkavaj/rstt
refs/heads/master
rstt_cli/calibration.py
1
import struct class CalibrationCollector(object): """Collect calibration data from fragments.""" def __init__(self): self._missing = [True, ] * 32 self._fragments = [None, ] * 32 self._data = None def addFragment(self, idx, data): """Process one subframe, with calibration...
tsabi/Odoo-tsabi-fixes
refs/heads/master
addons/event/report/__init__.py
435
# -*- 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...
jgcaaprom/android_external_chromium_org
refs/heads/cm-12.1
third_party/closure_compiler/processor.py
32
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Process Chrome resources (HTML/CSS/JS) to handle <include> and <if> tags.""" from collections import defaultdict import re import os class LineNumber(o...
3nids/QGIS
refs/heads/master
tests/src/python/test_authmanager_proxy.py
30
# -*- coding: utf-8 -*- """ Tests for auth manager Basic configuration update proxy From build dir, run from test directory: LC_ALL=en_US.UTF-8 ctest -R PyQgsAuthManagerProxy -V .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publi...
fast90/youtube-dl
refs/heads/master
youtube_dl/extractor/photobucket.py
90
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote class PhotobucketIE(InfoExtractor): _VALID_URL = r'https?://(?:[a-z0-9]+\.)?photobucket\.com/.*(([\?\&]current=)|_)(?P<id>.*)\.(?P<ext>(flv)|(mp4))' _TEST = { ...
Jai-Chaudhary/termite-data-server
refs/heads/master
web2py/gluon/contrib/gae_memcache.py
9
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Developed by Robin Bhattacharyya (memecache for GAE) Released under the web2py license (LGPL) from gluon.contrib.gae_memcache import MemcacheClient cache.ram=cache.disk=MemcacheClient(request) """ import time from google.appengine.api.memcache import Client class M...
mkudlej/usmqe-tests
refs/heads/master
usmqe_tests/rpm/test_rpm.py
2
# -*- coding: utf8 -*- import subprocess import tempfile import pytest from packagelist import list_packages, tendrl_packages LOGGER = pytest.get_logger(__name__, module=True) def test_repoclosure(tendrl_repos, centos_repos): cmd = ["repoclosure", "--newest"] # configure systemd default repositories ...
MounirMesselmeni/django
refs/heads/master
tests/auth_tests/backend_alias.py
512
# For testing that auth backends can be referenced using a convenience import from .test_auth_backends import ImportedModelBackend __all__ = ['ImportedModelBackend']
cdegroc/scikit-learn
refs/heads/master
examples/semi_supervised/plot_label_propagation_structure.py
1
""" ============================================== Label Propagation learning a complex structure ============================================== Example of LabelPropagation learning a complex internal structure to demonstrate "manifold learning". The outer circle should be labeled "red" and the inner circle "blue". Be...
vitan/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/csrf_tests/models.py
754
# models.py file for tests to run.
vqw/frappe
refs/heads/develop
frappe/tests/test_permissions.py
8
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """Use blog post test to test user permissions logic""" import frappe import frappe.defaults import unittest import json import frappe.model.meta from frappe.core.page.user_permi...
zding5/Microblog-Flask
refs/heads/master
flask/lib/python2.7/site-packages/werkzeug/contrib/lint.py
295
# -*- coding: utf-8 -*- """ werkzeug.contrib.lint ~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module provides a middleware that performs sanity checks of the WSGI application. It checks that :pep:`333` is properly implemented and warns on some common HTTP errors such as non-empty respons...
DigitalCampus/django-oppia
refs/heads/master
tests/api/v2/test_activitylog.py
1
import json from django.contrib.auth.models import User from django.test import TestCase from oppia.models import Tracker from quiz.models import QuizAttemptResponse, QuizAttempt from tastypie.test import ResourceTestCaseMixin from tests.utils import get_api_key class UploadAPIActivityLogTest(ResourceTestCaseMixin,...
ayoubg/gem5-graphics
refs/heads/master
gem5/src/arch/x86/isa/insts/simd128/floating_point/arithmetic/reciprocal_estimation.py
62
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
truongdq/chainer
refs/heads/master
cupy/creation/basic.py
19
import cupy def empty(shape, dtype=float): """Returns an array without initializing the elements. This function currently does not support ``order`` option. Args: shape (tuple of ints): Dimensionalities of the array. dtype: Data type specifier. Returns: cupy.ndarray: A new a...
Akagi201/learning-python
refs/heads/master
pyglet/image_viewer.py
1
#!/usr/bin/env python import pyglet window = pyglet.window.Window() image = pyglet.resource.image('kitten.jpg') @window.event def on_draw(): window.clear() image.blit(0, 0) pyglet.app.run()
kkragenbrink/node-gyp
refs/heads/master
gyp/pylib/gyp/generator/scons.py
231
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import gyp import gyp.common import gyp.SCons as SCons import os.path import pprint import re import subprocess # TODO: remove when we delete the last WriteList...
snbway/flask-rest-framework
refs/heads/master
rest_framework_flask/api_setting.py
1
# encoding:utf-8 # Version DEFAULT_VERSION = '1.0' ALLOWED_VERSION = ['1.0', '1.1'] VERSION_PARAM = 'v' PAGE_SIZE = 10
Itxaka/st2
refs/heads/master
st2common/st2common/util/loader.py
5
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...