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
tboyce021/home-assistant
homeassistant/components/starline/__init__.py
16
2877
"""The StarLine component.""" import voluptuous as vol from homeassistant.config_entries import ConfigEntry from homeassistant.core import Config, HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from .account import StarlineAccount from .const import ( CONF_SCAN_INTERVAL, DEFAULT_SCAN_I...
apache-2.0
clarkperkins/readthedocs.org
readthedocs/builds/migrations/0002_build_command_initial.py
27
1323
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import readthedocs.builds.models class Migration(migrations.Migration): dependencies = [ ('builds', '0001_initial'), ] operations = [ migrations.CreateModel( name='BuildC...
mit
Manojkumar91/odoo_inresto
openerp/addons/test_new_api/tests/test_new_fields.py
5
14846
# # test cases for new-style fields # from datetime import date, datetime from openerp.tests import common class TestNewFields(common.TransactionCase): def test_00_basics(self): """ test accessing new fields """ # find a discussion discussion = self.env.ref('test_new_api.discussion_0') ...
agpl-3.0
nash-x/hws
nova/api/openstack/compute/plugins/v3/remote_consoles.py
12
6024
# Copyright 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/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
Sergiojimenez/criticas_del_doctor_Mabuse
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/gyptest.py
1752
8019
#!/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. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse import subprocess import sys class CommandRunner(obje...
mit
dragondjf/PFramer
objbrowser/app.py
1
7811
""" Module for IPython event loop integration. Two things are handled by this module . 1) Creating the QApplication instance (or getting the singleton if it already exists). Also no difference between IPython and the regular Python. 2) Starting the event loop. If IPython is not running, qApp.exec_() is ca...
gpl-3.0
singularityhub/sregistry
shub/apps/logs/mixins.py
1
4621
""" Adopted from drf-tracking https://github.com/aschn/drf-tracking """ from django.utils.timezone import now from shub.apps.logs.models import APIRequestLog from shub.apps.logs.utils import clean_data from rest_framework.authtoken.models import Token import traceback class BaseLoggingMixin(object): logging_me...
mpl-2.0
gatoravi/regtools
tests/integration-test/test_cis_splice_effects_main.py
2
1561
#!/usr/bin/env python ''' test_cis_splice_effects_main.py -- Integration test for `regtools cis-splice-effects` Copyright (c) 2015, The Griffith Lab Author: Avinash Ramu <aramu@genome.wustl.edu> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated docu...
mit
AndrewGrossman/django
tests/custom_pk/models.py
99
1256
# -*- coding: utf-8 -*- """ Using a custom primary key By default, Django adds an ``"id"`` field to each model. But you can override this behavior by explicitly adding ``primary_key=True`` to a field. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_...
bsd-3-clause
widowild/messcripts
exercice/python3/solutions_exercices/exercice_6_11.py
1
1686
#! /usr/bin/env python # -*- coding:Utf8 -*- # Calculs de triangles from sys import exit # module contenant des fonctions système print(""" Veuillez entrer les longueurs des 3 côtés (en séparant ces valeurs à l'aide de virgules) :""") a, b, c = eval(input()) # Il n'est possible de construire un triangle que si ...
gpl-3.0
soulteary/electron
tools/coffee2c.py
145
1507
#!/usr/bin/env python import contextlib import os import subprocess import sys SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def main(): natives = os.path.abspath(sys.argv[1]) coffee_source_files = sys.argv[2:] output_dir = os.path.dirname(natives) js_source_files = compile_cof...
mit
GeyerA/android_external_chromium_org
build/android/pylib/utils/test_options_parser.py
54
3471
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Parses options for the instrumentation tests.""" import os # TODO(gkanwar): Some downstream scripts current rely on these functions # existing. Thi...
bsd-3-clause
guijomatos/SickRage
lib/hachoir_parser/audio/mpeg_audio.py
86
13752
""" MPEG audio file parser. Creation: 12 decembre 2005 Author: Victor Stinner """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, MissingField, ParserError, createOrphanField, Bit, Bits, Enum, PaddingBits, PaddingBytes, RawBytes) from hachoir_parser.audio.id3 import ID3v1, ...
gpl-3.0
sbillaudelle/labbook
labbook/cli.py
1
2486
#!/usr/bin/python2 # -*- coding: utf-8 -*- __all__ = ['Interface', 'main'] import os import datetime from .exceptions import * from .labbook import LabBook class Interface(object): def __init__(self): pass def create(self, args): path = os.path.abspath(args.path) try: la...
gpl-2.0
frhumanes/consulting
web/deploy/wtdeploy/wtdeploy/modules/fab_mysql.py
1
2073
#!/usr/bin/python # -*- encoding: utf-8 -*- # # author: javi santana from fabric.api import * def install_mysql(): """ ripped from http://www.muhuk.com/2010/05/how-to-install-mysql-with-fabric/ """ with settings(hide('warnings', 'stderr'), warn_only=True): result = sudo('dpkg-query --show mysql-se...
apache-2.0
jkburges/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/statusbubble.py
125
3746
# Copyright (C) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
bsd-3-clause
sogelink/ansible
lib/ansible/plugins/lookup/env.py
20
1239
# (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com> # (c) 2017 Ansible Project # 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 = """ lookup: env author: Jan-Piet Mens (...
gpl-3.0
Hackplayers/Empire-mod-Hpys-tests
lib/modules/powershell/management/enable_multi_rdp.py
2
2179
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-Mimikatz Multirdp', 'Author': ['@gentilkiwi', '@JosephBialek'], 'Description': ("[!] WARNING: Experimental! Runs PowerSploit's Invoke-Mimikatz " ...
bsd-3-clause
pombredanne/ctypesgen
ctypesgencore/messages.py
13
1380
#!/usr/bin/env python """ ctypesgencore.messages contains functions to display status, error, or warning messages to the user. Warning and error messages are also associated with a "message class", which is a string, which currently has no effect. Error classes are: 'usage' - there was something funny about the comma...
bsd-3-clause
skg-net/ansible
lib/ansible/utils/module_docs_fragments/azure.py
36
5440
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eit...
gpl-3.0
martyngigg/pyqt-msvc
doc/sphinx/conf.py
1
6425
# -*- coding: utf-8 -*- # # PyQt documentation build configuration file, created by # sphinx-quickstart on Sat May 30 14:28:55 2009. # # 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. # # All co...
gpl-3.0
Proggie02/TestRepo
django/contrib/gis/tests/layermap/tests.py
4
14047
# coding: utf-8 from __future__ import absolute_import, unicode_literals import os from copy import copy from decimal import Decimal from django.contrib.gis.gdal import DataSource from django.contrib.gis.tests.utils import mysql from django.contrib.gis.utils.layermapping import (LayerMapping, LayerMapError, Inval...
bsd-3-clause
Fedik/gramps
gramps/gen/plug/menu/_destination.py
11
3185
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2007-2008 Brian G. Matherly # Copyright (C) 2008 Gary Burton # # 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 v...
gpl-2.0
GehenHe/Recognize-Face-on-Android
tensorflow/contrib/tensor_forest/python/kernel_tests/grow_tree_op_test.py
22
4476
# 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
jwren/intellij-community
python/testData/inspections/PyTypeCheckerInspection/ParametrizedBuiltinCollectionsAndTheirTypingAliasesAreEquivalent.py
10
2016
from typing import Dict, FrozenSet, List, Set, Tuple def expects_builtin_list(xs: list[int]): expects_typing_List(xs) expects_typing_List(<warning descr="Expected type 'list[int]', got 'list[str]' instead">['a']</warning>) def expects_typing_List(xs: List[int]): expects_builtin_list(xs) expects_buil...
apache-2.0
abaditsegay/arangodb
3rdParty/V8-4.3.61/build/gyp/test/generator-output/gyptest-copies.py
121
1824
#!/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. """ Verifies file copies with --generator-output using an explicit build target of 'all'. """ import TestGyp # Android doesn't support --g...
apache-2.0
fujunwei/chromium-crosswalk
third_party/pycoverage/coverage/templite.py
160
6868
"""A simple Python template renderer, for a nano-subset of Django syntax.""" # Coincidentally named the same as http://code.activestate.com/recipes/496702/ import re from coverage.backward import set # pylint: disable=W0622 class CodeBuilder(object): """Build source code conveniently.""" ...
bsd-3-clause
limitemp/ROPgadget
ropgadget/loaders/pe.py
8
10851
## -*- coding: utf-8 -*- ## ## Jonathan Salwan - 2014-05-12 - ROPgadget tool ## ## http://twitter.com/JonathanSalwan ## http://shell-storm.org/project/ROPgadget/ ## ## 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 ## ...
gpl-2.0
lokirius/python-for-android
python3-alpha/python3-src/Lib/distutils/file_util.py
54
7810
"""distutils.file_util Utility functions for operating on single files. """ import os from distutils.errors import DistutilsFileError from distutils import log # for generating verbose output in 'copy_file()' _copy_action = { None: 'copying', 'hard': 'hard linking', 'sym': 'symbo...
apache-2.0
Netflix/security_monkey
security_monkey/tests/__init__.py
3
1182
# Copyright 2014 Netflix, 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...
apache-2.0
rananda/cfme_tests
cfme/middleware/provider/hawkular.py
1
6288
import re from cfme.common import TopologyMixin, TimelinesMixin from . import MiddlewareProvider from utils.appliance import Navigatable from utils.db import cfmedb from utils.varmeth import variable from . import _get_providers_page, _db_select_query from . import download, MiddlewareBase, auth_btn, mon_btn from util...
gpl-2.0
Bismarrck/tensorflow
tensorflow/contrib/estimator/python/estimator/rnn.py
19
1285
# Copyright 2018 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
manojpandey/hackenvision16
tinybank/tinybank/venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py
152
12996
""" The httplib2 algorithms ported for use with requests. """ import logging import re import calendar import time from email.utils import parsedate_tz from pip._vendor.requests.structures import CaseInsensitiveDict from .cache import DictCache from .serialize import Serializer logger = logging.getLogger(__name__) ...
mit
jmesteve/openerpseda
openerp/addons/account_payment/wizard/account_payment_order.py
39
5884
# -*- 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
toolforger/sympy
sympy/assumptions/tests/test_refine.py
23
5792
from sympy import (Abs, exp, Expr, I, pi, Q, Rational, refine, S, sqrt, atan, atan2) from sympy.abc import x, y, z from sympy.core.relational import Eq, Ne from sympy.functions.elementary.piecewise import Piecewise def test_Abs(): assert refine(Abs(x), Q.positive(x)) == x assert refine(1 + ...
bsd-3-clause
damngamerz/coala
tests/collecting/DependenciesTest.py
23
1473
import unittest from coalib.bears.Bear import Bear from coalib.collecting import Dependencies from coalib.core.CircularDependencyError import CircularDependencyError class ResolvableBear1(Bear): BEAR_DEPS = {Bear} class ResolvableBear2(Bear): BEAR_DEPS = {ResolvableBear1, Bear} class UnresolvableBear1(...
agpl-3.0
jaggu303619/asylum
openerp/addons/sale/edi/__init__.py
454
1065
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
jimmy201602/webterminal
permission/forms.py
1
4283
from django import forms from django.contrib.auth.models import User from django.contrib.auth.models import Permission as AuthPermission from permission.models import Permission from django.contrib.contenttypes.models import ContentType from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, ...
gpl-3.0
ltelg/kernel_lge_geeb-cm10.1
scripts/gcc-wrapper.py
501
3410
#! /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...
gpl-2.0
blablack/ams-lv2
waflib/Tools/compiler_cxx.py
55
3204
#!/usr/bin/env python # encoding: utf-8 # Matthias Jahn jahn dôt matthias ât freenet dôt de 2007 (pmarat) """ Try to detect a C++ compiler from the list of supported compilers (g++, msvc, etc):: def options(opt): opt.load('compiler_cxx') def configure(cnf): cnf.load('compiler_cxx') def build(bld): bld.progra...
gpl-2.0
franekp/ankidict
ankidict/thirdparty/cherrypy/test/checkerdemo.py
29
1860
"""Demonstration app for cherrypy.checker. This application is intentionally broken and badly designed. To demonstrate the output of the CherryPy Checker, simply execute this module. """ import os import cherrypy thisdir = os.path.dirname(os.path.abspath(__file__)) class Root: pass if __name__ == '__main__': ...
agpl-3.0
sbc100/native_client
tests/gdb/stack_trace.py
12
1073
# -*- python -*- # Copyright (c) 2012 The Native Client 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 gdb_test class StackTraceTest(gdb_test.GdbTest): def test_stack_trace(self): self.gdb.Command('break leaf_call') ...
bsd-3-clause
fyu1/test
tools/perf/scripts/python/sctop.py
1996
2102
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
Deepakpatle/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/prettypatch_unittest.py
122
3458
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
dreamsxin/kbengine
kbe/res/scripts/common/Lib/encodings/shift_jis_2004.py
816
1059
# # shift_jis_2004.py: Python Unicode Codec for SHIFT_JIS_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jis_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEnc...
lgpl-3.0
haeihaiehaei/Python-Projects
vmware/op5_vcsa_plugin/check_vcsa.py
1
4239
#!/usr/bin/python """ Op5 check to get the health of the VCenter Appliance via REST API. Copyright 2017 Martin Persson 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, includi...
gpl-3.0
ubuntu-touchCAF/android_kernel_motorola_msm8226
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
openhatch/oh-mainline
vendor/packages/oauthlib/oauthlib/oauth2/rfc6749/endpoints/revocation.py
35
5424
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749.endpoint.revocation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ An implementation of the OAuth 2 `Token Revocation`_ spec (draft 11). .. _`Token Revocation`: http://tools.ietf.org/html/draft-ietf-oauth-revocation-11 """ from __future__ import absolute_import, unicod...
agpl-3.0
asampat3090/keras
examples/cifar10_cnn.py
35
4479
from __future__ import absolute_import from __future__ import print_function from keras.datasets import cifar10 from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional import Convolutio...
mit
htzy/bigfour
cms/djangoapps/contentstore/management/commands/export_all_courses.py
91
2323
""" Script for exporting all courseware from Mongo to a directory and listing the courses which failed to export """ from django.core.management.base import BaseCommand, CommandError from xmodule.modulestore.xml_exporter import export_course_to_xml from xmodule.modulestore.django import modulestore from xmodule.content...
agpl-3.0
indico/indico-plugins
livesync/indico_livesync/models/agents.py
2
1764
# This file is part of the Indico plugins. # Copyright (C) 2002 - 2021 CERN # # The Indico plugins are free software; you can redistribute # them and/or modify them under the terms of the MIT License; # see the LICENSE file for more details. from sqlalchemy.dialects.postgresql import JSON from indico.core.db.sqlalche...
mit
QinerTech/QinerApps
openerp/addons/website_blog/models/website_blog.py
2
12097
# -*- coding: utf-8 -*- from datetime import datetime import lxml import random from openerp import tools from openerp import SUPERUSER_ID from openerp.addons.website.models.website import slug from openerp.osv import osv, fields from openerp.tools.translate import _ from openerp.tools.translate import html_translate...
gpl-3.0
nhuntwalker/rational_whimsy
rational_whimsy/blog/models.py
1
2123
"""The Blog Post model.""" from django.db import models from django.dispatch import receiver from django.db.models.signals import post_save from redactor.fields import RedactorField from taggit.managers import TaggableManager # Create your models here. PUBLICATION_STATUS = ( ("published", "Published"), ("draf...
mit
0xCCD/mitro
browser-ext/login/makejsresource.py
26
1921
#!/usr/bin/env python # ***************************************************************************** # Copyright (c) 2012, 2013, 2014 Lectorius, Inc. # Authors: # Vijay Pandurangan (vijayp@mitro.co) # Evan Jones (ej@mitro.co) # Adam Hilss (ahilss@mitro.co) # # # This program is free software: you can redistribute...
gpl-3.0
home-assistant/home-assistant
tests/components/stream/test_recorder.py
1
9139
"""The tests for hls streams.""" from __future__ import annotations import asyncio from collections import deque from datetime import timedelta from io import BytesIO import logging import os import threading from unittest.mock import patch import async_timeout import av import pytest from homeassistant.components.s...
apache-2.0
saurvs/servo
tests/wpt/web-platform-tests/tools/py/py/_code/assertion.py
218
3287
import sys import py BuiltinAssertionError = py.builtin.builtins.AssertionError _reprcompare = None # if set, will be called by assert reinterp for comparison ops def _format_explanation(explanation): """This formats an explanation Normally all embedded newlines are escaped, however there are three exce...
mpl-2.0
nihilus/epanos
pyc_fmtstr_parser/printf_parse.py
1
12979
# ported from gnulib rev be7d73709d2b3bceb987f1be00a049bb7021bf87 # # Copyright (C) 2014, Mark Laws. # Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2014 Free Software # Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public Lice...
mit
ktarrant/options_csv
journal/trades/migrations/0001_initial.py
1
1392
# Generated by Django 2.1 on 2018-08-28 05:10 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Leg', fields=[ ('id', models.AutoField(auto_c...
mit
rodo/django-extensions
django_extensions/management/commands/create_template_tags.py
27
2817
import os import sys from optparse import make_option from django.core.management.base import AppCommand from django_extensions.management.utils import _make_writeable, signalcommand class Command(AppCommand): option_list = AppCommand.option_list + ( make_option('--name', '-n', action='store', dest='tag...
mit
carlos-ferras/Sequence-ToolKit
pyqtgraph/flowchart/library/Display.py
52
10343
# -*- coding: utf-8 -*- from ..Node import Node import weakref from ...Qt import QtCore, QtGui from ...graphicsItems.ScatterPlotItem import ScatterPlotItem from ...graphicsItems.PlotCurveItem import PlotCurveItem from ... import PlotDataItem, ComboBox from .common import * import numpy as np class PlotWidgetNode(Node...
gpl-3.0
sda2b/youtube-dl
youtube_dl/extractor/ministrygrid.py
154
2084
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import ( ExtractorError, smuggle_url, ) class MinistryGridIE(InfoExtractor): _VALID_URL = r'https?://www\.ministrygrid.com/([^/?#]*/)*(?P<id>[^/#?]+)/?(?:$|[?#])' _TEST = { 'url': 'h...
unlicense
abarbanell/docker-grafana-graphite
graphite/local_settings.py
42
1617
# Edit this file to override the default graphite settings, do not edit settings.py # Turn on debugging and restart apache if you ever see an "Internal Server Error" page #DEBUG = True # Set your local timezone (django will try to figure this out automatically) TIME_ZONE = 'UTC' # Setting MEMCACHE_HOSTS to be empty ...
apache-2.0
open-pli/enigma2
e2reactor.py
56
5249
# enigma2 reactor: based on pollreactor, which is # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ Maintainer: U{Felix Domke<mailto:tmbinc@elitedvb.net>} """ # System imports import select, errno, sys # Twisted imports from twisted.python import log, failure from twisted.interne...
gpl-2.0
cwyark/micropython
tests/wipy/uart.py
6
3950
''' UART test for the CC3200 based boards. UART0 and UART1 must be connected together for this test to pass. ''' from machine import UART from machine import Pin import os import time mch = os.uname().machine if 'LaunchPad' in mch: uart_id_range = range(0, 2) uart_pins = [[('GP12', 'GP13'), ('GP12', 'GP13', ...
mit
mmottahedi/neuralnilm_prototype
scripts/e58c.py
2
3452
from __future__ import print_function, division from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer from lasagne.nonlinearities import sigmoid from lasagne.objectives import crossentropy from lasagne.init import Uniform, Normal from lasagne.layers import LSTMLayer, DenseLayer, C...
mit
boomsbloom/dtm-fmri
DTM/for_gensim/lib/python2.7/site-packages/boto/glacier/__init__.py
22
1712
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without ...
mit
rajalokan/glance
glance/db/sqlalchemy/migrate_repo/versions/012_id_to_uuid.py
3
12799
# Copyright 2013 IBM Corp. # 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/LIC...
apache-2.0
fluentpython/example-code
attic/interfaces/dict_subclass.py
7
1392
# Code and text by BitBucket user "enigmacurry" posted to # https://bitbucket.org/pypy/pypy/issue/708/discrepancy-in-dict-subclass-__getitem__ # Adapted by Luciano Ramalho: # - changed comments to docstring to run with doctest; # - added test for Test class raising exception # - and added () to print. """ This is a te...
mit
vmax-feihu/hue
desktop/core/ext-py/pysqlite/pysqlite2/test/py25tests.py
45
2757
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/regression.py: pysqlite regression tests # # Copyright (C) 2007 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages #...
apache-2.0
hryamzik/ansible
lib/ansible/plugins/action/aruba_config.py
29
4212
# # (c) 2017, Red Hat, Inc. # # 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...
gpl-3.0
rschnapka/partner-contact
base_partner_merge/validate_email.py
1
4573
# -*- coding: utf-8 -*- # RFC 2822 - style email validation for Python # (c) 2012 Syrus Akbary <me@syrusakbary.com> # Extended from (c) 2011 Noel Bush <noel@aitools.org> # for support of mx and user check # This code is made available to you under the GNU LGPL v3. # # This module provides a single method, valid_email_a...
agpl-3.0
GeekTrainer/Flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/setuptools/command/install.py
206
4052
import setuptools import sys import glob from distutils.command.install import install as _install from distutils.errors import DistutilsArgError class install(_install): """Use easy_install to install the package, w/dependencies""" user_options = _install.user_options + [ ('old-and-unmanageable', Non...
apache-2.0
wichmann/UpLoad
languages/zh-cn.py
142
10465
# coding: utf8 { '!langcode!': 'zh-cn', '!langname!': '中文', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" 应为选择表达式, 格式如 "field1=\'value\'". 但是对 JOIN 的结果不可以使用 update 或者 delete"', '%s %%{row} deleted': '已删除 %s 笔', '%s %%{row} updated': '已更新 %s...
gpl-2.0
eblume/tf-idf
tfidf/preprocess.py
1
9539
#!/usr/bin/env python3 """Pre processing step for text. Example: pp = Preprocesses() """ from __future__ import absolute_import, with_statement import re from collections import namedtuple from cachetools import LRUCache, cached # python2 support from nltk.stem import SnowballStemmer from six.moves.html_parser...
mit
wongkaiweng/LTLMoP
src/lib/handlers/share/MotionControl/BugControllerHandler.py
8
39771
#!/usr/bin/env python # -*- coding: utf-8 -*- """ =================================================================== BugController.py - Bug Algorithm Motion Controller =================================================================== This motion controller uses the Bug 2 algorithm developed by V. Lumelsky and A. St...
gpl-3.0
keshavramaswamy/ThinkStats2
code/chap06soln.py
66
3389
"""This file contains code used in "Think Stats", by Allen B. Downey, available from greenteapress.com Copyright 2014 Allen B. Downey License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html """ from __future__ import print_function import numpy as np import density import hinc import thinkplot import thinkstats2 "...
gpl-3.0
an4967/TizenRT
os/tools/memstats_xtensa.py
10
12676
#!/usr/bin/env python ########################################################################### # # Copyright 2019 Samsung Electronics 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 ...
apache-2.0
asis92/kernel_lge_d802
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
Drakulix/knex
tests/api/test_security.py
1
3177
import requests import os class TestPOST(object): def test_main_page(self, flask_api_url): response = requests.get(flask_api_url + '/') assert response.status_code == 404 def test_login_fake_user(self, flask_api_url): session = requests.Session() response = session.post(flask_...
mit
jmerkow/VTK
ThirdParty/Twisted/twisted/names/test/test_rootresolve.py
22
29140
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for Twisted.names' root resolver. """ from random import randrange from zope.interface import implementer from zope.interface.verify import verifyClass from twisted.python.log import msg from twisted.trial import util from twiste...
bsd-3-clause
Microvellum/Fluid-Designer
win64-vc/2.78/Python/lib/site-packages/PIL/PcfFontFile.py
72
6194
# # THIS IS WORK IN PROGRESS # # The Python Imaging Library # $Id$ # # portable compiled font file parser # # history: # 1997-08-19 fl created # 2003-09-13 fl fixed loading of unicode fonts # # Copyright (c) 1997-2003 by Secret Labs AB. # Copyright (c) 1997-2003 by Fredrik Lundh. # # See the README file for informa...
gpl-3.0
Kleptobismol/scikit-bio
skbio/tree/_majority_rule.py
2
11013
from __future__ import absolute_import, division, print_function # ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed ...
bsd-3-clause
sudheesh001/oh-mainline
vendor/packages/twisted/twisted/web/test/test_web.py
18
33841
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for various parts of L{twisted.web}. """ from cStringIO import StringIO from zope.interface import implements from zope.interface.verify import verifyObject from twisted.trial import unittest from twisted.internet import reactor from ...
agpl-3.0
industrydive/fileflow
fileflow/operators/dive_python_operator.py
1
1096
""" .. module:: operators.dive_operator :synopsis: DivePythonOperator for use with TaskRunner .. moduleauthor:: Laura Lorenz <llorenz@industrydive.com> .. moduleauthor:: Miriam Sexton <miriam@industrydive.com> """ from airflow.operators import PythonOperator from .dive_operator import DiveOperator class DivePy...
apache-2.0
jroltgen/aqua-gesture-framework
samples/SampleEvent/scons-local-1.3.0/SCons/Tool/__init__.py
5
26423
"""SCons.Tool SCons tool selection. This looks for modules that define a callable object that can modify a construction environment as appropriate for a given tool (or tool chain). Note that because this subsystem just *selects* a callable that can modify a construction environment, it's possible for people to defin...
gpl-3.0
watonyweng/nova
nova/tests/unit/objects/test_pci_device_pool.py
47
4458
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # 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/LICEN...
apache-2.0
awni/tensorflow
tensorflow/contrib/skflow/python/skflow/tests/test_multioutput.py
1
1502
# Copyright 2015-present The Scikit Flow 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 require...
apache-2.0
nishad-jobsglobal/odoo-marriot
addons/claim_from_delivery/__openerp__.py
261
1517
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
CiscoSystems/nova
nova/api/openstack/compute/contrib/server_start_stop.py
3
3326
# Copyright 2012 Midokura Japan K.K. # # 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 o...
apache-2.0
mgruben/morse-code
python/MorseCodeDecoder.py
1
16481
import re import matplotlib.pyplot as plt import seaborn as sns MORSE_CODE = { ".-": "A", "-...": "B", "-.-.": "C", "-..": "D", ".": "E", "..-.": "F", "--.": "G", "....": "H", "..": "I", ".---": "J", "-.-": "K", ".-..": "L", "--": "M", "-.": "N", "---": "O",...
gpl-3.0
dracos/django
tests/shortcuts/views.py
114
1930
from django.shortcuts import render, render_to_response def render_to_response_view(request): return render_to_response('shortcuts/render_test.html', { 'foo': 'FOO', 'bar': 'BAR', }) def render_to_response_view_with_multiple_templates(request): return render_to_response([ 'shortc...
bsd-3-clause
magcius/sweettooth
sweettooth/extensions/migrations/0008_new_icon_default.py
1
6118
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." new_default = orm.Extension._meta.get_field_by_name('icon')[0].default for ...
agpl-3.0
noba3/KoTos
addons/plugin.video.phstreams/resources/lib/libraries/f4mproxy/utils/python_rsakey.py
136
4374
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """Pure-Python RSA implementation.""" from .cryptomath import * from .asn1parser import ASN1Parser from .rsakey import * from .pem import * class Python_RSAKey(RSAKey): def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=...
gpl-2.0
googleads/google-ads-python
google/ads/googleads/v8/services/services/search_term_view_service/transports/__init__.py
2
1069
# -*- coding: utf-8 -*- # Copyright 2020 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...
apache-2.0
Freso/picard
picard/file.py
2
25332
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (C) 2004 Robert Kaye # Copyright (C) 2006 Lukáš Lalinský # # 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; ...
gpl-2.0
Jadaw1n/letsencrypt
letsencrypt/proof_of_possession.py
37
3643
"""Proof of Possession Identifier Validation Challenge.""" import logging import os from cryptography import x509 from cryptography.hazmat.backends import default_backend import zope.component from acme import challenges from acme import jose from acme import other from letsencrypt import interfaces from letsencrypt...
apache-2.0
tarballs-are-good/sympy
sympy/thirdparty/pyglet/pyglet/lib.py
5
10361
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
bsd-3-clause
nagyistoce/odoo-dev-odoo
openerp/tools/func.py
276
3622
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010, 2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you c...
agpl-3.0
snorfalorpagus/pytest-qt
tests/test_logging.py
1
12411
import datetime import pytest from pytestqt.qt_compat import qDebug, qWarning, qCritical, QtDebugMsg, \ QtWarningMsg, QtCriticalMsg, QT_API @pytest.mark.parametrize('test_succeeds', [True, False]) @pytest.mark.parametrize('qt_log', [True, False]) def test_basic_logging(testdir, test_succeeds, qt_log): """ ...
lgpl-3.0
ATIX-AG/ansible
test/units/modules/network/f5/test_bigip_monitor_https.py
26
13827
# -*- coding: utf-8 -*- # # Copyright (c) 2017 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 import os import json import sys import pytest from nose.plugins.skip imp...
gpl-3.0