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 |
|---|---|---|---|---|---|
rosmo/ansible | test/units/modules/network/fortimanager/fortimanager_module.py | 111 | 2107 | # (c) 2016 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 dis... | gpl-3.0 |
geminateCoder/Character-Archive-Website | Lib/site-packages/sqlalchemy/testing/config.py | 38 | 2469 | # testing/config.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import collections
requirements = None
db = None
db_url = None
db_opts = None
fil... | cc0-1.0 |
TheTypoMaster/my-vim-set-mac | .vim/bundle/YouCompleteMe/third_party/ycmd/third_party/jedi/test/static_analysis/star_arguments.py | 20 | 2237 | # -----------------
# *args
# -----------------
def simple(a):
return a
def nested(*args):
return simple(*args)
nested(1)
#! 6 type-error-too-few-arguments
nested()
def nested_no_call_to_function(*args):
return simple(1, *args)
def simple2(a, b, c):
return b
def nested(*args):
return simple... | gpl-2.0 |
meidli/yabgp | yabgp/tests/unit/message/attribute/nlri/labeled_unicast/test_ipv4_labeled_unicast.py | 2 | 2240 | # Copyright 2015-2016 Cisco Systems, 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 ... | apache-2.0 |
cyberark-bizdev/ansible | test/integration/targets/vault/faux-editor.py | 43 | 1211 | #!/usr/bin/env python
#
# 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 it will b... | gpl-3.0 |
18098924759/Wox | PythonHome/Lib/site-packages/requests/packages/urllib3/response.py | 328 | 10347 | # urllib3/response.py
# Copyright 2008-2013 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
import zlib
import io
from ._collections import HTTPHeaderDict
from .exceptio... | mit |
edwatt/REU2014 | usrp_info_and_test.py | 1 | 2853 | #!/usr/bin/env python
"""
Retrieve operating parameters of connected USRP and loop through the operating spectrum trasmitting a constant wave signal
"""
from gnuradio import gr
from gnuradio import analog
from gnuradio import uhd
from time import sleep
MAX_RATE = 1000e6
class build_block(gr.top_block):
def __init__... | gpl-3.0 |
maxfierke/android_kernel_samsung_aries | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
hogarthj/ansible | lib/ansible/modules/source_control/github_deploy_key.py | 50 | 10752 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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',
'status': ['preview'],
... | gpl-3.0 |
Dave667/service | plugin.video.serialu.net/resources/lib/XMLTreeBuilder.py | 12 | 3857 | #
# ElementTree
# $Id: XMLTreeBuilder.py 3225 2007-08-27 21:32:08Z fredrik $
#
# an XML tree builder
#
# history:
# 2001-10-20 fl created
# 2002-05-01 fl added namespace support for xmllib
# 2002-07-27 fl require expat (1.5.2 code can use SimpleXMLTreeBuilder)
# 2002-08-17 fl use tag/attribute name me... | gpl-2.0 |
paxos1977/QuickFixLogFixup | QuickFixLogViewer.py | 1 | 52083 | import sublime, sublime_plugin
import re
def multiple_replace(dict, text):
pattern = re.compile("^(%s)\=" % "|".join(map(re.escape, dict.keys())))
lines = text.split("\x01")
newLines = []
for line in lines:
new_line = pattern.sub(lambda match: dict[match.string[match.start():match.end()-1]] + "=", line)
new... | bsd-3-clause |
unsiloai/syntaxnet-ops-hack | tensorflow/python/util/deprecation.py | 30 | 15749 | # 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 |
4talesa/rethinkdb | external/v8_3.30.33.16/tools/testrunner/local/perfdata.py | 100 | 4212 | # Copyright 2012 the V8 project 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | agpl-3.0 |
onceuponatimeforever/oh-mainline | vendor/packages/scrapy/scrapy/webservice.py | 18 | 3191 | """
Scrapy web services extension
See docs/topics/webservice.rst
"""
from twisted.web import server, error
from scrapy.xlib.pydispatch import dispatcher
from scrapy.exceptions import NotConfigured
from scrapy import log, signals
from scrapy.utils.jsonrpc import jsonrpc_server_call
from scrapy.utils.serialize import ... | agpl-3.0 |
dxd214/TeamTalk | win-client/3rdParty/src/json/devtools/fixeol.py | 247 | 1941 | import os.path
def fix_source_eol( path, is_dry_run = True, verbose = True, eol = '\n' ):
"""Makes sure that all sources have the specified eol sequence (default: unix)."""
if not os.path.isfile( path ):
raise ValueError( 'Path "%s" is not a file' % path )
try:
f = open(path, 'rb')
exce... | apache-2.0 |
lesserwhirls/scipy-cwt | scipy/sparse/sparsetools/csr.py | 5 | 32360 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.1+capsulehack
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
# This file is compatible with both classic and new-style classes.
from sys import version_info
if versio... | bsd-3-clause |
Pretio/boto | boto/codedeploy/__init__.py | 113 | 1663 | # Copyright (c) 2015 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 restriction, including
# without limitation the rights ... | mit |
nebril/fuel-web | fuel_agent/fuel_agent/tests/test_md_utils.py | 2 | 10607 | # Copyright 2014 Mirantis, 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 writing... | apache-2.0 |
Dekken/tick | tick/prox/prox_l2sq.py | 2 | 2481 | # License: BSD 3 clause
# -*- coding: utf8 -*-
import numpy as np
from .base import Prox
from .build.prox import ProxL2SqDouble as _ProxL2sqDouble
from .build.prox import ProxL2SqFloat as _ProxL2sqFloat
__author__ = 'Stephane Gaiffas'
dtype_map = {
np.dtype("float64"): _ProxL2sqDouble,
np.dtype("float32"): ... | bsd-3-clause |
dimkal/mne-python | mne/io/bti/read.py | 10 | 3534 | # Authors: Denis A. Engemann <denis.engemann@gmail.com>
# simplified BSD-3 license
import struct
import numpy as np
from ...externals.six import b
def _unpack_matrix(fid, fmt, rows, cols, dtype):
""" Aux Function """
out = np.zeros((rows, cols), dtype=dtype)
bsize = struct.calcsize(fmt)
str... | bsd-3-clause |
kfwang/Glance-OVA-OVF | glance/registry/api/v1/__init__.py | 20 | 3478 | # Copyright 2010-2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
overtherain/scriptfile | software/googleAppEngine/lib/django_1_2/tests/modeltests/get_or_create/tests.py | 39 | 1929 | from datetime import date
from django.db import IntegrityError
from django.test import TransactionTestCase
from models import Person, ManualPrimaryKeyTest
class GetOrCreateTests(TransactionTestCase):
def test_get_or_create(self):
p = Person.objects.create(
first_name='John', last_name='Lenno... | mit |
ryanahall/django | django/views/generic/base.py | 281 | 7690 | from __future__ import unicode_literals
import logging
from functools import update_wrapper
from django import http
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import NoReverseMatch, reverse
from django.template.response import TemplateResponse
from django.utils import six
fr... | bsd-3-clause |
bmanojlovic/ansible | lib/ansible/modules/network/ios/ios_command.py | 3 | 7571 | #!/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... | gpl-3.0 |
mythos234/SimplKernel-5.1.1-G92x | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
a20012251/dd-agent | tests/checks/mock/test_system_core.py | 46 | 2489 | import mock
import psutil
from tests.checks.common import AgentCheckTest
from utils.platform import Platform
if Platform.is_mac():
CHECK_RATES = [
'system.core.idle',
'system.core.nice',
'system.core.system',
'system.core.user',
]
MOCK_PSUTIL_CPU_TIMES = [
psutil._p... | bsd-3-clause |
ekasitk/sahara | sahara/tests/unit/plugins/cdh/v5_3_0/test_edp_engine.py | 5 | 4231 | # Copyright (c) 2015 Intel 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 writing... | apache-2.0 |
vijayendrabvs/ssl-neutron | neutron/tests/unit/test_iptables_manager.py | 4 | 28075 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Locaweb.
# 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/license... | apache-2.0 |
santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/SQLAlchemy-0.4.0-py2.5.egg/sqlalchemy/databases/access.py | 1 | 15034 | # access.py
# Copyright (C) 2007 Paul Johnston, paj@pajhome.org.uk
# Portions derived from jet2sql.py by Matt Keranen, mksql@yahoo.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import random
from sqlalchemy import sql, schema, type... | bsd-3-clause |
sasukeh/cinder | cinder/volume/drivers/netapp/utils.py | 3 | 16796 | # Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2014 Navneet Singh. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2015 Tom Barron. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use ... | apache-2.0 |
jarped/QGIS | python/plugins/processing/gui/AutofillDialog.py | 17 | 2264 | # -*- coding: utf-8 -*-
"""
***************************************************************************
AutofillDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
************************... | gpl-2.0 |
Blitzen/oauthlib | tests/oauth1/rfc5849/endpoints/test_base.py | 27 | 16073 | from __future__ import unicode_literals, absolute_import
from mock import MagicMock
from re import sub
from ....unittest import TestCase
from oauthlib.common import safe_string_equals
from oauthlib.oauth1 import Client, RequestValidator
from oauthlib.oauth1.rfc5849 import errors, SIGNATURE_RSA, SIGNATURE_HMAC
from oa... | bsd-3-clause |
wscullin/spack | var/spack/repos/builtin/packages/tmuxinator/package.py | 3 | 1740 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
a-rank/cassandra-tools | cassandra_tools/ui.py | 1 | 3032 | # Copyright 2016 Allan Rank
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
Michaelhobo/ee149-final-project | Tools/autotest/common.py | 16 | 9395 | import util, pexpect, time, math
from pymavlink import mavwp
# a list of pexpect objects to read while waiting for
# messages. This keeps the output to stdout flowing
expect_list = []
def expect_list_clear():
'''clear the expect list'''
global expect_list
for p in expect_list[:]:
expect_list.remov... | gpl-3.0 |
Grumpy-Mike/Mikes-Pi-Bakery | CurveBall/curvedBall.py | 1 | 3415 | # Curved Ball - a game for the Pi Glow board
# By Mike Cook - March 2015
import time, random, sys
from smbus import SMBus
import wiringpi2 as io
# command register addresses for the SN3218 IC used in PiGlow
CMD_ENABLE_OUTPUT = 0x00
CMD_ENABLE_LEDS = 0x13
CMD_SET_PWM_VALUES = 0x01
CMD_UPDATE = 0x16
SN3218 = 0x54 # i2c ... | gpl-2.0 |
brchiu/tensorflow | tensorflow/python/training/device_setter_test.py | 97 | 7482 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
samba-team/samba | source4/torture/drs/python/getnc_unpriv.py | 2 | 14757 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Tests replication scenarios with different user privileges.
# We want to test every replication scenario we can think of against:
# - users with only GET_CHANGES privileges
# - users with only GET_ALL_CHANGES privileges
# - users with both GET_CHANGES and GET_ALL_CHANG... | gpl-3.0 |
jjenki11/blaze-chem-rendering | avogadro/avogadro-1.1.1/libavogadro/src/python/unittest/molecule.py | 9 | 10475 | import Avogadro
import unittest
from numpy import *
class TestMolecule(unittest.TestCase):
def setUp(self):
self.molecule = Avogadro.molecules.addMolecule()
def test_fileName(self):
self.molecule.fileName = "somefile.ext"
self.assertEqual(self.molecule.fileName, "somefile.ext")
def test_addAtom(sel... | mit |
gamajr/EZNCoder | engine/generator.py | 1 | 3020 | # -*- coding: utf-8 -*-
import string
from infoparser import MInfo
class MEGenerator():
"""Classe que gera linhas de comando para o MEncoder."""
def __init__(self):
self._cut_cmd = string.Template("")
self.info = MInfo()
self._supported_ops = ['sub','wmv2avi','avixvid']
de... | gpl-3.0 |
osynge/ceph-deploy | ceph_deploy/hosts/rhel/install.py | 8 | 1931 | from ceph_deploy.util import templates
def install(distro, version_kind, version, adjust_repos, **kw):
packages = kw.get('components', [])
distro.packager.clean()
distro.packager.install(packages)
def mirror_install(distro, repo_url,
gpg_url, adjust_repos, extra_installs=True, **kw):
... | mit |
jperon/musite | static/js/brython/Lib/time.py | 518 | 12346 | from browser import window
import javascript
# use Javascript Date constructor
date = javascript.JSConstructor(window.Date)
#daylight = 0 # fix me.. returns Non zero if DST timezone is defined
##############################################
# Added to pass some tests
# Are there timezone always in the browser?
# I'm ... | mit |
codekaki/odoo | addons/document_page/wizard/document_page_show_diff.py | 59 | 2212 | # -*- 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 |
City-of-Bloomington/green-rental | south/modelsinspector.py | 33 | 17469 | """
Like the old south.modelsparser, but using introspection where possible
rather than direct inspection of models.py.
"""
from __future__ import print_function
import datetime
import re
import decimal
from south.utils import get_attribute, auto_through
from south.utils.py3 import text_type
from django.db import m... | agpl-3.0 |
daviddoria/itkHoughTransform | Wrapping/WrapITK/Languages/Python/Tests/GradientMagnitudeRecursiveGaussianImageFilter.py | 13 | 1478 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | apache-2.0 |
andela-ooladayo/django | tests/middleware/test_security.py | 291 | 7781 | from django.http import HttpResponse
from django.test import RequestFactory, SimpleTestCase
from django.test.utils import override_settings
class SecurityMiddlewareTest(SimpleTestCase):
@property
def middleware(self):
from django.middleware.security import SecurityMiddleware
return SecurityMid... | bsd-3-clause |
DelazJ/QGIS | tests/src/python/test_qgseditwidgets.py | 16 | 6402 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for edit widgets.
.. note:: 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
(at your option) any later version.
"""
__au... | gpl-2.0 |
BrnoPCmaniak/Django_Megaparmeni | djangobb_forum/migrations/0001_initial.py | 13 | 26862 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Category'
db.create_table('djangobb_forum_category', (
('id', self.gf('django.... | bsd-3-clause |
gohin/django | django/db/models/lookups.py | 194 | 16328 | import inspect
from copy import copy
from django.utils.functional import cached_property
from django.utils.six.moves import range
from .query_utils import QueryWrapper
class RegisterLookupMixin(object):
def _get_lookup(self, lookup_name):
try:
return self.class_lookups[lookup_name]
e... | bsd-3-clause |
Kangmo/bitcoin | qa/rpc-tests/mempool_reorg.py | 5 | 4397 | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly)... | mit |
chiefspace/udemy-rest-api | udemy_rest_api_section4/env/lib/python3.4/site-packages/jinja2/constants.py | 220 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | gpl-2.0 |
glatard/nipype | nipype/interfaces/freesurfer/tests/test_auto_MRISPreproc.py | 9 | 2314 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.freesurfer.model import MRISPreproc
def test_MRISPreproc_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
fsgd_file=dict(argstr=... | bsd-3-clause |
BackupGGCode/python-for-android | python-build/python-libs/xmpppy/xmpp/session.py | 199 | 16899 | ##
## XMPP server
##
## Copyright (C) 2004 Alexey "Snake" Nezhdanov
##
## 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, or (at your option)
## any later version.
... | apache-2.0 |
FlorianLudwig/odoo | addons/report/controllers/main.py | 210 | 6943 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
350dotorg/Django | django/contrib/flatpages/tests/csrf.py | 47 | 3425 | import os
from django.conf import settings
from django.test import TestCase, Client
class FlatpageCSRFTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.tests.urls'
def setUp(self):
self.client = Client(enforce_csrf_checks=True)
self.old_MIDDLEWARE_CLASSES = ... | bsd-3-clause |
mobarski/sandbox | rsm/v4.py | 2 | 5658 | from common2 import *
# NAME IDEA -> pooling/random/sparse/distributed hebbian/horde/crowd/fragment/sample memory
# FEATURES:
# + boost -- neurons with empty mem slots learn faster
# + noise --
# + dropout -- temporal disabling of neurons
# + decay -- remove from mem
# + negatives -- learning to avoid detecting some... | mit |
blzr/enigma2 | lib/python/Screens/Opkg.py | 3 | 3749 | from Components.ActionMap import ActionMap
from Components.Opkg import OpkgComponent
from Components.Label import Label
from Components.Slider import Slider
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from enigma import eTimer
class Opkg(Screen):
def __init__(self, session, cmdList=[]... | gpl-2.0 |
theflofly/tensorflow | tensorflow/python/autograph/converters/side_effect_guards.py | 6 | 7527 | # 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 |
sinbazhou/odoo | addons/google_calendar/res_config.py | 256 | 1534 | from openerp.osv import fields, osv
class calendar_config_settings(osv.TransientModel):
_inherit = 'base.config.settings'
_columns = {
'google_cal_sync': fields.boolean("Show tutorial to know how to get my 'Client ID' and my 'Client Secret'"),
'cal_client_id': fields.char("Client_id"),
... | agpl-3.0 |
KhalidGit/flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/werkzeug/contrib/lint.py | 295 | 12282 | # -*- 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... | apache-2.0 |
SUSE/azure-sdk-for-python | azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_03_01/operations/registries_operations.py | 2 | 30708 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
ConsenSys/testrpc | tests/filters/test_filter_log_matching.py | 3 | 1927 | import pytest
from testrpc.client.utils import (
encode_number,
encode_data,
coerce_args_to_bytes,
)
from testrpc.client.filters import (
check_if_log_matches,
)
@coerce_args_to_bytes
def make_log_filter(from_block="latest", to_block="latest", addresses=None, topics=None):
if addresses is None:... | mit |
Tatsh-ansible/ansible | lib/ansible/modules/net_tools/ldap/ldap_entry.py | 9 | 9945 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Peter Sagerson <psagers@ignorare.net>
# (c) 2016, Jiri Tyr <jiri.tyr@gmail.com>
#
# 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
A... | gpl-3.0 |
mou4e/zirconium | tools/findit/svn_repository_parser.py | 74 | 9178 | # Copyright (c) 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 xml.dom.minidom as minidom
from xml.parsers.expat import ExpatError
import crash_utils
from repository_parser_interface import ParserInterface
... | bsd-3-clause |
andrejb/cloudant_bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Options/ListOption.py | 61 | 2003 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without li... | apache-2.0 |
googlearchive/appengine-flask-skeleton | lib/flask/logging.py | 838 | 1398 | # -*- coding: utf-8 -*-
"""
flask.logging
~~~~~~~~~~~~~
Implements the logging support for Flask.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from logging import getLogger, StreamHandler, Formatter, getLoggerClas... | apache-2.0 |
deepsrijit1105/edx-platform | common/lib/xmodule/xmodule/tests/test_annotator_token.py | 222 | 1060 | """
This test will run for annotator_token.py
"""
import unittest
from xmodule.annotator_token import retrieve_token
class TokenRetriever(unittest.TestCase):
"""
Tests to make sure that when passed in a username and secret token, that it will be encoded correctly
"""
def test_token(self):
"""... | agpl-3.0 |
indico/indico | indico/modules/events/sessions/operations.py | 1 | 6547 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask import session
from indico.core import signals
from indico.core.db import db
from indico.modul... | mit |
oinopion/django | django/template/context.py | 15 | 9233 | import warnings
from contextlib import contextmanager
from copy import copy
from django.utils.deprecation import RemovedInDjango20Warning
# Hard-coded processor for easier use of CSRF protection.
_builtin_context_processors = ('django.template.context_processors.csrf',)
_current_app_undefined = object()
class Cont... | bsd-3-clause |
piqoni/onadata | onadata/apps/logger/migrations/0029_auto__chg_field_attachment_mimetype__add_field_xform_encrypted__add_fi.py | 13 | 10462 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Attachment.mimetype'
db.alter_column(u'odk_logger_attachment', 'mimetype', self.gf('djang... | bsd-2-clause |
town-hall-pinball/project-omega | tests/machine/test_playfield.py | 1 | 2243 | # Copyright (c) 2014 - 2016 townhallpinball.org
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, p... | mit |
umlfri/umlfri2 | umlfri2/qtgui/base/contextmenu.py | 1 | 1680 | from functools import partial
from PyQt5.QtGui import QIcon, QKeySequence
from PyQt5.QtWidgets import QMenu, QAction
from umlfri2.application import Application
from umlfri2.qtgui.base import image_loader
class ContextMenu(QMenu):
def _add_menu_item(self, icon, label, shortcut, action=None, sub_menu=None):
... | gpl-3.0 |
gmarkall/numba | numba/pycc/__init__.py | 7 | 3612 | # -*- coding: utf-8 -*-
import os
import logging
import subprocess
import tempfile
import sys
# Public API
from .cc import CC
from .decorators import export, exportmany
def get_ending(args):
if args.llvm:
return ".bc"
elif args.olibs:
return ".o"
elif args.python:
return find_py... | bsd-2-clause |
nhicher/ansible | lib/ansible/modules/cloud/google/gcp_compute_ssl_certificate_facts.py | 8 | 6086 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
piotrmaslanka/satella | tests/test_coding/test_monitor.py | 1 | 5062 | import unittest
from queue import Queue
from threading import Thread
from time import sleep
from satella.coding import Monitor
class MonitorTest(unittest.TestCase):
def test_synchronize_on(self):
class TestedMasterClass(Monitor):
def __init__(self):
self.value = 0
... | bsd-3-clause |
JJMinton/conferenceTimer | file_change_handler.py | 1 | 2937 | import path
import asyncio
from datetime import datetime, timedelta
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
from read_schedule import read_schedule
import config
from config import logging
class FileChangeHandler(PatternMatchingEventHandler):
def __init__(s... | gpl-3.0 |
FNST-OpenStack/cloudkitty | cloudkitty/tenant_fetcher/__init__.py | 1 | 1212 | # -*- coding: utf-8 -*-
# !/usr/bin/env python
# Copyright 2015 Objectif Libre
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | apache-2.0 |
knehez/edx-platform | lms/djangoapps/instructor_task/api.py | 28 | 18655 | """
API for submitting background tasks by an instructor for a course.
Also includes methods for getting information about tasks that have
already been submitted, filtered either by running state or input
arguments.
"""
import hashlib
from celery.states import READY_STATES
from xmodule.modulestore.django import mod... | agpl-3.0 |
mrquim/mrquimrepo | repo/script.module.schism.common/lib/js2py/host/dom/constants.py | 97 | 1139 | from js2py.base import *
def _get_conts(idl):
def is_valid(c):
try:
exec(c)
return 1
except:
pass
return '\n'.join(filter(is_valid, (' '.join(e.strip(' ;').split()[-3:]) for e in idl.splitlines())))
default_attrs = {'writable':True, 'enumerable':True, 'conf... | gpl-2.0 |
AntidoteLabs/Antidote-DM | Antidotes DM/youtube_dl/extractor/tubitv.py | 18 | 2650 | # coding: utf-8
from __future__ import unicode_literals
import codecs
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse
from ..utils import (
ExtractorError,
int_or_none,
sanitized_Request,
)
class TubiTvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tubitv\.... | gpl-2.0 |
vickenty/ookoobah | pyglet-c9188efc2e30/experimental/mt_media/drivers/directsound/lib_dsound.py | 78 | 12874 | # ----------------------------------------------------------------------------
# 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... | mit |
c11/yatsm | yatsm/classification/__init__.py | 3 | 2042 | """ Module storing classifiers for YATSM
Contains utilities and helper classes for classifying timeseries generated
using YATSM change detection.
"""
import logging
from sklearn.ensemble import RandomForestClassifier
import yaml
from ..errors import AlgorithmNotFoundException
logger = logging.getLogger('yatsm')
_a... | mit |
makinacorpus/odoo | addons/auth_crypt/__openerp__.py | 310 | 2298 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP S.A. (<http://odoo.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
yufish/youtube-dl | youtube_dl/extractor/wdr.py | 110 | 10166 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import itertools
import re
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urlparse,
)
from ..utils import (
determine_ext,
unified_strdate,
)
class WDRIE(InfoExtractor):
_PLAYER_REGEX = '-(?:video|a... | unlicense |
eerimoq/asn1tools | tests/files/module_tags_explicit_pp.py | 1 | 9965 | EXPECTED = {'ModuleTagsExplicit': {'extensibility-implied': False,
'imports': {},
'object-classes': {},
'object-sets': {},
'types': {'A': {'tag': {'kind': 'EXPLICIT',
'number':... | mit |
sgraham/nope | tools/perf/page_sets/top_25_pages.py | 9 | 2200 | # 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.
from telemetry.page import page
from telemetry.page import page_set
from page_sets import top_pages
class Top25PageSet(page_set.PageSet):
""" Page set c... | bsd-3-clause |
hmoco/osf.io | api_tests/base/test_middleware.py | 3 | 4470 | # -*- coding: utf-8 -*-
import pytest
from django.http import HttpResponse
from tests.base import ApiTestCase, fake
from urlparse import urlparse
import mock
from nose.tools import * # flake8: noqa
from rest_framework.test import APIRequestFactory
from website.util import api_v2_url
from api.base import settings
fr... | apache-2.0 |
xxsergzzxx/python-for-android | python-modules/twisted/twisted/words/im/basesupport.py | 55 | 7900 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Instance Messenger base classes for protocol support.
You will find these useful if you're adding a new protocol to IM.
"""
# Abstract representation of chat "model" classes
from twisted.words.im.locals import ONLINE, OFFLINE, O... | apache-2.0 |
OrkoHunter/networkx | networkx/algorithms/triads.py | 2 | 5507 | # triads.py - functions for analyzing triads of a graph
#
# Copyright 2015 NetworkX developers.
# Copyright 2011 Reya Group <http://www.reyagroup.com>
# Copyright 2011 Alex Levenson <alex@isnotinvain.com>
# Copyright 2011 Diederik van Liere <diederik.vanliere@rotman.utoronto.ca>
#
# This file is part of NetworkX.
#
# N... | bsd-3-clause |
CentroGeo/geonode | geonode/geoapps/urls.py | 6 | 2478 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2020 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | gpl-3.0 |
jlobaton/namebench | nb_third_party/dns/rdtypes/IN/SRV.py | 248 | 3396 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
shanewholloway/werkzeug | examples/coolmagic/application.py | 50 | 2604 | # -*- coding: utf-8 -*-
"""
coolmagic.application
~~~~~~~~~~~~~~~~~~~~~
This module provides the WSGI application.
The WSGI middlewares are applied in the `make_app` factory function
that automatically wraps the application within the require
middlewares. Per default only the `SharedDataMiddl... | bsd-3-clause |
Maronato/aosalunos | misago/apps/profiles/warnings/urls.py | 3 | 1060 | from django.conf.urls import patterns, url
def register_profile_urls(first=False):
urlpatterns = []
if first:
urlpatterns += patterns('misago.apps.profiles.warnings.views',
url(r'^$', 'warnings', name="user"),
url(r'^$', 'warnings', name="user_warnings"),
url(r'^(?P<... | gpl-2.0 |
edx/lettuce | tests/integration/lib/Django-1.3/django/utils/simplejson/scanner.py | 928 | 2227 | """JSON token scanner
"""
import re
try:
from simplejson._speedups import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scan... | gpl-3.0 |
HPI-SWA-Lab/RSqueak | rsqueakvm/test/test_socket_primitives.py | 1 | 6424 | import py
import time
from rsqueakvm import constants
from rsqueakvm.model.compiled_methods import W_PreSpurCompiledMethod
from rsqueakvm.model.variable import W_BytesObject
from rsqueakvm.primitives import prim_table
from rsqueakvm.primitives.constants import EXTERNAL_CALL
from rsqueakvm.error import PrimitiveFailedE... | bsd-3-clause |
mlabru/ptracks | view/piloto/dlg_aproximacao_ui.py | 1 | 2854 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './dlg_aproximacao.ui'
#
# Created: Tue Dec 6 11:23:22 2016
# by: PyQt4 UI code generator 4.11.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
exc... | gpl-3.0 |
lexus42/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/sre_parse.py | 630 | 29657 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | agpl-3.0 |
Endika/hr | hr_expense_analytic_default/expense_analytic_default.py | 23 | 2312 | # -*- encoding: utf-8 -*-
##############################################################################
#
# HR Expense Analytic Default module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you... | agpl-3.0 |
matthieu-meaux/DLLM | examples/Wrapper_Multipoint/test_multipoint_analysis_AoA.py | 1 | 2570 | # -*-mode: python; py-indent-offset: 4; tab-width: 8; coding: iso-8859-1 -*-
# DLLM (non-linear Differentiated Lifting Line Model, open source software)
#
# Copyright (C) 2013-2015 Airbus Group SAS
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Pub... | gpl-2.0 |
sharad/calibre | src/calibre/gui2/dialogs/confirm_delete_location.py | 1 | 1511 | #!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' \
'2010, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
from functools import partial
from calibre.gui2.dialogs.confirm_delete_location_ui import Ui_Dialog
from PyQt5.Q... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.