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 |
|---|---|---|---|---|---|
anaran/olympia | lib/misc/tests/test_log.py | 8 | 3836 | import logging
from django.conf import settings
from nose.tools import eq_
from heka.config import client_from_dict_config
import amo.tests
import commonware.log
from lib.log_settings_base import error_fmt
cfg = {
'version': 1,
'formatters': {
'error': {
'()': commonware.log.Formatter,
... | bsd-3-clause |
sloanyang/android_external_webkit | Tools/Scripts/webkitpy/common/net/testoutputset_unittest.py | 15 | 6278 | #!/usr/bin/env python
# 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:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this lis... | gpl-2.0 |
mmnelemane/neutron | neutron/plugins/ml2/drivers/openvswitch/agent/main.py | 13 | 1564 | # Copyright (C) 2014,2015 VA Linux Systems Japan K.K.
# Copyright (C) 2014 Fumihiko Kakuma <kakuma at valinux co jp>
# Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except ... | apache-2.0 |
wilsonxiao/machinekit | configs/sim/axis/orphans/pysubs/customtask.py | 28 | 20532 | import os
import sys
import signal
import traceback
import emctask
import emccanon
import interpreter
import hal
import emc # ini only
try:
import cPickle as pickle
except ImportError:
import pickle
try:
from userfuncs import UserFuncs
except ImportError:
from nulluserfuncs import UserFuncs
def de... | gpl-3.0 |
gavoski/audacity | lib-src/lv2/lv2/plugins/eg04-sampler.lv2/waflib/Tools/suncc.py | 134 | 1378 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Utils
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_scc(conf):
v=conf.env
cc=None
if v['CC']:cc=v['CC']
... | gpl-2.0 |
Gadal/sympy | sympy/liealgebras/root_system.py | 76 | 6884 | # -*- coding: utf-8 -*-
from .cartan_type import CartanType
from sympy.core import Basic
from sympy.core.compatibility import range
class RootSystem(Basic):
"""Represent the root system of a simple Lie algebra
Every simple Lie algebra has a unique root system. To find the root
system, we first consider t... | bsd-3-clause |
gangadharkadam/letzbench | bench/app.py | 10 | 3179 | import os
from .utils import exec_cmd, get_frappe, check_git_for_shallow_clone, get_config, build_assets, restart_supervisor_processes, get_cmd_output
import logging
import requests
import json
logger = logging.getLogger(__name__)
def get_apps(bench='.'):
try:
with open(os.path.join(bench, 'sites', 'apps.txt')) a... | gpl-3.0 |
CIBC-Internal/itk | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/container_traits.py | 2 | 23629 | # Copyright 2014-2015 Insight Software Consortium.
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
"""
Define a few algorithms that deal with different properties of std containers.
"""
import string
from . import cpptypes... | apache-2.0 |
DavidAlphaFox/mysql-router | mysql_harness/ext/gtest/scripts/gen_gtest_pred_impl.py | 2538 | 21986 | #!/usr/bin/env python
#
# Copyright 2006, 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... | gpl-2.0 |
pgonda/servo | tests/wpt/harness/wptrunner/browsers/base.py | 195 | 4635 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import platform
import socket
from abc import ABCMeta, abstractmethod
from ..wptcommandline import require_ar... | mpl-2.0 |
hyOzd/cadquery | examples/FreeCAD/Ex007_Using_Point_Lists.py | 5 | 1658 | #File: Ex007_Using_Point_Lists.py
#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD"
#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad
#You run this example by typing the following in the FreeCAD python console, making sur... | lgpl-3.0 |
HybridF5/tempest | tempest/api/object_storage/test_object_formpost.py | 21 | 4499 | # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | apache-2.0 |
ibinti/intellij-community | python/lib/Lib/site-packages/django/contrib/formtools/tests/__init__.py | 71 | 13996 | import os
from django import forms, http
from django.conf import settings
from django.contrib.formtools import preview, wizard, utils
from django.test import TestCase
from django.utils import unittest
success_string = "Done was called!"
class TestFormPreview(preview.FormPreview):
def get_context(self, request, ... | apache-2.0 |
arleincho/python-oauth2 | example/server.py | 375 | 7669 | """
The MIT License
Copyright (c) 2007 Leah Culver
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, publis... | mit |
RedbackThomson/LoLShadow | sleekxmpp/plugins/google/nosave/stanza.py | 10 | 1467 | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2013 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.jid import JID
from sleekxmpp.xmlstream import ElementBase, register_stanza_plugin
class NoSave(ElementBase):
... | mit |
TeutoNet-Netzdienste/ansible | lib/ansible/runner/poller.py | 132 | 4480 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
malayaleecoder/servo | tests/wpt/web-platform-tests/tools/pytest/testing/test_assertion.py | 170 | 19078 | # -*- coding: utf-8 -*-
import sys
import textwrap
import _pytest.assertion as plugin
import _pytest._code
import py
import pytest
from _pytest.assertion import reinterpret
from _pytest.assertion import util
PY3 = sys.version_info >= (3, 0)
@pytest.fixture
def mock_config():
class Config(object):
verbos... | mpl-2.0 |
JazzeYoung/VeryDeepAutoEncoder | theano/gpuarray/opt.py | 1 | 39678 | from __future__ import absolute_import, print_function, division
import copy
import numpy
import logging
import pdb
from six.moves import xrange
import theano
from theano import tensor, scalar, gof, config
from theano.compile import optdb
from theano.compile.ops import shape_i
from theano.gof import (local_optimizer, ... | bsd-3-clause |
phil65/script.tvshow.nextaired | dateutil/rrule.py | 254 | 40402 | """
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
import itertools
import datetime
import calendar
import thread
import sys
__all__ = ["... | gpl-2.0 |
sgraham/nope | testing/gmock/scripts/generator/cpp/utils.py | 1158 | 1153 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google 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... | bsd-3-clause |
azurestandard/django | tests/urls.py | 91 | 1189 | from django.conf.urls import patterns, include
urlpatterns = patterns('',
# test_client modeltest urls
(r'^test_client/', include('modeltests.test_client.urls')),
(r'^test_client_regress/', include('regressiontests.test_client_regress.urls')),
# File upload test views
(r'^file_uploads/', include('... | bsd-3-clause |
eugenejen/AutobahnPython | autobahn/autobahn/util.py | 3 | 4969 | ###############################################################################
##
## Copyright 2011-2013 Tavendo GmbH
##
## 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 |
yetu/repotools | scm.py | 7 | 41039 | # 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.
"""SCM-specific utility classes."""
import cStringIO
import glob
import logging
import os
import re
import sys
import tempfile
import time
from xml.etre... | bsd-3-clause |
gae-init/gae-init-docs | main/cache.py | 25 | 1092 | # coding: utf-8
from google.appengine.api import memcache
import flask
import config
###############################################################################
# Helpers
###############################################################################
def bump_counter(key, time=3600, limit=4):
client = memcach... | mit |
gaddman/ansible | lib/ansible/utils/module_docs_fragments/lxca_common.py | 4 | 2411 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by
# Ansible still belong to the author of the module, and may assign their
# own license to the complete wo... | gpl-3.0 |
varunr047/homefile | homeassistant/components/switch/digital_ocean.py | 16 | 3005 | """
Support for interacting with Digital Ocean droplets.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/switch.digital_ocean/
"""
import logging
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from ... | mit |
alfa-addon/addon | mediaserver/lib/html5lib/treeadapters/sax.py | 1835 | 1661 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... | gpl-3.0 |
aexeagmbh/django-allauth | allauth/socialaccount/providers/foursquare/views.py | 71 | 1366 | import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import FoursquareProvider
class FoursquareOAuth2Adapter(OAu... | mit |
vaas-krish/openthread | tools/harness-automation/autothreadharness/open_thread_controller.py | 16 | 10545 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | bsd-3-clause |
ArtsiomCh/tensorflow | tensorflow/contrib/grid_rnn/__init__.py | 179 | 1060 | # 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 |
philanthropy-u/edx-platform | common/lib/xmodule/xmodule/tests/test_poll.py | 13 | 2371 | # -*- coding: utf-8 -*-
"""Test for Poll Xmodule functional logic."""
from mock import Mock
from xmodule.poll_module import PollDescriptor
from . import LogicTest
from .test_import import DummySystem
class PollModuleTest(LogicTest):
"""Logic tests for Poll Xmodule."""
shard = 1
descriptor_class = PollDes... | agpl-3.0 |
golismero/golismero-devel | thirdparty_libs/nltk/corpus/reader/chunked.py | 17 | 8145 | # Natural Language Toolkit: Chunked Corpus Reader
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
A reader for corpora that contain chunked (and optiona... | gpl-2.0 |
pkreissl/espresso | testsuite/scripts/samples/test_visualization_elc.py | 4 | 1698 | # Copyright (C) 2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... | gpl-3.0 |
yongju-hong/thrift | test/features/util.py | 41 | 1256 | import argparse
import socket
from local_thrift import thrift # noqa
from thrift.transport.TSocket import TSocket
from thrift.transport.TTransport import TBufferedTransport, TFramedTransport
from thrift.transport.THttpClient import THttpClient
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
from thrift.pr... | apache-2.0 |
sharmaking/DataApi | DataApi_Linux/dataProcess.py | 7 | 1215 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#dataProcess
import multiprocessing
import dataApi
class CDataProcess(object):
def __init__(self, HOST, PORT, isAllMarket, subStocks, requestType, flag, startTime, endTime):
super(CDataProcess, self).__init__()
self.name = "Socket Data Process"
self.bufferStack = { #每个合... | mit |
mattskone/garage_alarm | run.py | 2 | 1439 | import logging
import os
import shutil
import alerts
import camera
import config
import features
import models
logging.basicConfig(filename=os.path.join(config.INSTALL_DIR, 'app.log'),
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
logger = l... | mit |
materialsproject/pymatgen | pymatgen/analysis/chemenv/utils/tests/test_chemenv_config.py | 4 | 2031 | #!/usr/bin/env python
__author__ = "waroquiers"
import os
import shutil
import unittest
from monty.tempfile import ScratchDir
from pymatgen.core import SETTINGS
from pymatgen.analysis.chemenv.utils.chemenv_config import ChemEnvConfig
config_file_dir = os.path.join(
os.path.dirname(__file__),
"..",
"..... | mit |
subins2000/TorrentBro | torrentbro/lib/tpb/constants.py | 1 | 3066 | import sys
if sys.version_info >= (3, 0):
class_type = type
else:
from new import classobj
class_type = classobj
class ConstantType(type):
"""
Tree representation metaclass for class attributes. Metaclass is extended
to all child classes too.
"""
def __new__(cls, clsname, bases, dct):... | gpl-3.0 |
hashworks/CouchPotatoServer | libs/pyutil/humanreadable.py | 106 | 4483 | # Copyright (c) 2001 Autonomous Zone Industries
# Copyright (c) 2002-2009 Zooko "Zooko" Wilcox-O'Hearn
# This file is part of pyutil; see README.rst for licensing terms.
import exceptions, os
from repr import Repr
class BetterRepr(Repr):
def __init__(self):
Repr.__init__(self)
# Note: These le... | gpl-3.0 |
multipath-tcp/mptcp_3.0.x | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
spallavolu/scikit-learn | sklearn/cluster/setup.py | 263 | 1449 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
import os
from os.path import join
import numpy
from sklearn._build_utils import get_blas_info
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
cblas_libs, blas_info = ... | bsd-3-clause |
jbedorf/tensorflow | tensorflow/python/training/momentum_test.py | 18 | 27623 | # 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 |
ilya-epifanov/ansible | contrib/inventory/ssh_config.py | 41 | 3977 | #!/usr/bin/env python
# (c) 2014, Tomas Karasek <tomas.karasek@digile.fi>
#
# 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
# (a... | gpl-3.0 |
mynext/svgedit | build/tools/ship.py | 62 | 4264 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ship.py
#
# Licensed under the Apache 2 License as is the rest of the project
# Copyright (c) 2011 Jeff Schiller
#
# This script has very little real-world application. It is only used in our pure-client web app
# served on GoogleCode so we can have one HTML file, run a... | mit |
jackylee0424/dfr | tornado/test/simple_httpclient_test.py | 1 | 16087 | from __future__ import absolute_import, division, print_function, with_statement
import collections
from contextlib import closing
import errno
import gzip
import logging
import os
import re
import socket
import sys
from tornado.httpclient import AsyncHTTPClient
from tornado.httputil import HTTPHeaders
from tornado.i... | mit |
asgard-lab/neutron | neutron/agent/l3/link_local_allocator.py | 23 | 2237 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 requir... | apache-2.0 |
zouyapeng/horizon-newtouch | openstack_dashboard/dashboards/project/instances/urls.py | 7 | 1896 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
dparlevliet/zelenka-report-storage | server-db/twisted/trial/_asynctest.py | 8 | 14387 | # -*- test-case-name: twisted.trial.test -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Things likely to be used by writers of unit tests.
Maintainer: Jonathan Lange
"""
from __future__ import division, absolute_import
import warnings
from zope.interface import implementer
# We ca... | lgpl-3.0 |
Mellthas/quodlibet | quodlibet/tests/test_player_gst.py | 2 | 9002 | # 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.
import os
import sys
import contextlib
try:
from gi.repository imp... | gpl-2.0 |
golding/Josefin | python/byteport/integration_tests.py | 2 | 15865 | # -*- coding: utf-8 -*-
import unittest
from http_clients import *
'''
NOTE: All tests here need a Byteport instance to communicate with
'''
class TestHttpClients(unittest.TestCase):
PRODUCTION = ('api.byteport.se', 'd8a26587463268f88fea6aec')
ACCEPTANCE = ('acc.byteport.se', 'd74f48f8375a32ca632fa49a')
... | bsd-2-clause |
errx/django | django/core/management/commands/syncdb.py | 11 | 1145 | import warnings
from optparse import make_option
from django.db import DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCommand
from django.utils.deprecation import RemovedInDjango19Warning
class Command(NoArgsCommand):
option_list = NoArgsCommand.opt... | bsd-3-clause |
CERNDocumentServer/cds-videos | tests/unit/test_keyword.py | 3 | 3414 | # -*- coding: utf-8 -*-
#
# This file is part of CDS.
# Copyright (C) 2017 CERN.
#
# CDS 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... | gpl-2.0 |
wikimedia/user_metrics | user_metrics/api/run.py | 1 | 4196 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This module defines the entry point for flask_ web server implementation
of the Wikimedia User Metrics API. This module is consumable
by the Apache web server via WSGI interface via mod_wsgi. An Apache
server can be pointed to api.wsgi such that Apache ma... | bsd-3-clause |
FrankBian/kuma | vendor/packages/ipython/IPython/frontend/wx/console_widget.py | 7 | 23141 | # encoding: utf-8
"""
A Wx widget to act as a console and input commands.
This widget deals with prompts and provides an edit buffer
restricted to after the last prompt.
"""
__docformat__ = "restructuredtext en"
#-------------------------------------------------------------------------------
# Copyright (C) 2008 T... | mpl-2.0 |
adelina-t/neutron | neutron/tests/unit/agent/l3/test_legacy_router.py | 17 | 2991 | # Copyright (c) 2015 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 ... | apache-2.0 |
cristiana214/cristianachavez214-cristianachavez | python/src/Lib/encodings/base64_codec.py | 528 | 2338 | """ Python 'base64_codec' Codec - base64 content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs, base64
### Codec APIs
def base64_encode(i... | apache-2.0 |
ralphm/wokkel | wokkel/test/test_iwokkel.py | 1 | 1676 | # Copyright (c) Ralph Meijer.
# See LICENSE for details.
"""
Tests for L{wokkel.iwokkel}
"""
from __future__ import division, absolute_import
from twisted.trial import unittest
class DeprecationTest(unittest.TestCase):
"""
Deprecation test for L{wokkel.subprotocols}.
"""
def lookForDeprecationWarni... | mit |
benosteen/mypaint | gui/brushcreationwidget.py | 1 | 9333 | # This file is part of MyPaint.
# Copyright (C) 2009 by Martin Renold <martinxyz@gmx.ch>
#
# 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) ... | gpl-2.0 |
teixas/js.bootstrap_wysihtml5 | bootstrap.py | 40 | 10525 | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | bsd-3-clause |
sestrella/ansible | lib/ansible/modules/network/onyx/onyx_buffer_pool.py | 37 | 4908 | #!/usr/bin/python
#
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
zhjunlang/kbengine | kbe/res/scripts/common/Lib/test/test_logging.py | 60 | 145919 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | lgpl-3.0 |
michalkurka/h2o-3 | h2o-py/tests_rest_smoke/h2o_print.py | 2 | 1663 | import getpass
# some fun to match michal's use of green in his messaging in ec2_cmd.py
# generalize like http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
class bcolors:
PURPLE = ''
BLUE = ''
GREEN = ''
YELLOW = ''
RED = ''
ENDC = ''
def enable(self):
... | apache-2.0 |
pinterb/st2contrib | packs/elasticsearch/actions/lib/static_metagen.py | 12 | 4319 | import yaml
class StaticMetagen(object):
action_meta = {
"name": "",
"parameters": {
"action": {
"type": "string",
"immutable": True,
"default": ""
},
"host": {
"description": "Elasticsearch host."... | apache-2.0 |
missionpinball/mpf | mpf/tests/test_CarouselMode.py | 1 | 10205 | from mpf.tests.MpfTestCase import MpfTestCase, MagicMock
class TestCarouselMode(MpfTestCase):
def get_config_file(self):
return 'config.yaml'
def get_machine_path(self):
return 'tests/machine_files/carousel/'
def _start_game(self):
self.machine.playfield.add_ball = MagicMock()
... | mit |
jyt109/SimpleCV | SimpleCV/examples/kinect/kinect-coloring.py | 13 | 2150 | #!/usr/bin/python
import time, webbrowser
from operator import add
from SimpleCV import Color, ColorCurve, Kinect, Image, pg, np
from SimpleCV.Display import Display
d = Display(flags = pg.FULLSCREEN)
#create video streams
cam = Kinect()
#initialize the camera
compositeframe = Image((640, 480))
#populate the compos... | bsd-3-clause |
SebastianLloret/Clever-Bot | libfuturize/fixes/fix_absolute_import.py | 62 | 3141 | """
Fixer for import statements, with a __future__ import line.
Based on lib2to3/fixes/fix_import.py, but extended slightly so it also
supports Cython modules.
If spam is being imported from the local directory, this import:
from spam import eggs
becomes:
from __future__ import absolute_import
from .spam ... | gpl-3.0 |
mukashi/solarized | utils/tests/python.py | 79 | 2613 | # test python (sample from offlineimap)
class ExitNotifyThread(Thread):
"""This class is designed to alert a "monitor" to the fact that a thread has
exited and to provide for the ability for it to find out why."""
def run(self):
global exitthreads, profiledir
self.threadid = thread.get_iden... | mit |
bop/hybrid | lib/python2.6/site-packages/django/contrib/localflavor/hr/forms.py | 100 | 9127 | # -*- coding: utf-8 -*-
"""
HR-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import datetime
import re
from django.contrib.localflavor.hr.hr_choices import (
HR_LICENSE_PLATE_PREFIX_CHOICES, HR_COUNTY_CHOICES,
HR_PHONE_NUMBER_PREFIX_CHOICES)
from django.core.validators imp... | gpl-2.0 |
dietrichc/streamline-ppc-reports | examples/dfp/v201405/label_service/get_labels_by_statement.py | 1 | 1743 | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
talhajaved/nyuadmarket | flask/lib/python2.7/site-packages/pip/_vendor/packaging/__about__.py | 257 | 1073 | # Copyright 2014 Donald Stufft
#
# 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, so... | mit |
abinit/abinit | scripts/deprecated/class_ScrolledWidgetList.py | 4 | 2295 | from Tkinter import *
class ScrolledWidgetList(Frame):
def __init__(self,master=None,width=100,height=100,bg='white',pady=10,topspace=0,bottomspace=0):
self.width = width
self.height = height
self.pady = pady
self.topspace = topspace
self.bottomspace ... | gpl-3.0 |
ryfeus/lambda-packs | Pandas_numpy/source/numpy/core/_internal.py | 3 | 21639 | """
A place for code to be called from core C-code.
Some things are more easily handled Python.
"""
from __future__ import division, absolute_import, print_function
import re
import sys
from numpy.compat import basestring
from .multiarray import dtype, array, ndarray
try:
import ctypes
except ImportError:
c... | mit |
Taifxx/xxtrep | context.addtolib/resources/lib/ext/base/tags.py | 1 | 15746 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2014 Martijn Kaijser
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... | gpl-3.0 |
Tset-Noitamotua/_learnpython | google-python-class/lesson_123_list_methods.py | 1 | 1755 | # -*- coding: utf-8 -*-
# filename: lesson_122_list_methods.py
# Life is short, use Python!
# LIST METHODS
# usage: LIST.METHOD(ARGUMENTs)
# L.append(ELEMENT) ---> append ELEMENT as is at the end of list L
# L.extend('LIST') ---> add elements of LIST at the end of L
# L.insert(INDEX, 'ELEMENT') -... | gpl-2.0 |
lipingxue/docker-volume-vsphere | esx_service/vmdk_ops.py | 3 | 83534 | #!/usr/bin/env python
# Copyright 2016 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
stutivarshney/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/psycopg2/tests/test_replication.py | 8 | 7747 | #!/usr/bin/env python
# test_replication.py - unit test for replication protocol
#
# Copyright (C) 2015 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 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 F... | gpl-3.0 |
natea/Miro-Community | localtv/inline_edit/urls.py | 1 | 2444 | # Copyright 2009 - Participatory Culture Foundation
#
# This file is part of Miro Community.
#
# Miro Community 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 ... | agpl-3.0 |
nhicher/ansible | lib/ansible/module_utils/mysql.py | 29 | 3484 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
andrewcmyers/tensorflow | tensorflow/__init__.py | 81 | 1481 | # 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 |
meredith-digops/ansible | lib/ansible/modules/system/cron.py | 24 | 25581 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2012, Dane Summers <dsummers@pinedesk.biz>
# (c) 2013, Mike Grozak <mike.grozak@gmail.com>
# (c) 2013, Patrick Callahan <pmc@patrickcallahan.com>
# (c) 2015, Evan Kaufman <evan@digitalflophouse.com>
# (c) 2015, Luca Berruti <nadirio@gmail.com>
#
# This file is part of ... | gpl-3.0 |
mindnervestech/mnrp | openerp/__init__.py | 100 | 3416 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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... | agpl-3.0 |
songmonit/CTTMSONLINE | addons/base_report_designer/__init__.py | 421 | 1136 | # -*- 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... | agpl-3.0 |
yingcuhk/LeetCode | Algorithms/#303 Range Sum Query - Immutable/PythonCode.py | 1 | 1082 | """
Given an integer array nums, find the sum of the elements between indices i and j (i ¡Ü j), inclusive.
Example:
Given nums = [-2, 0, 3, -5, 2, -1]
sumRange(0, 2) -> 1
sumRange(2, 5) -> -1
sumRange(0, 5) -> -3
Note:
You may assume that the array does not change.
There are many calls to sumRange function.
"""
cl... | mit |
geeknoid/api | python/istio_api/mesh/v1alpha1/operator_pb2.py | 1 | 14150 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mesh/v1alpha1/operator.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from goog... | apache-2.0 |
vascotenner/holoviews | holoviews/plotting/mpl/annotation.py | 1 | 3913 | import matplotlib
from matplotlib import patches as patches
from ...core.util import match_spec
from ...core.options import abbreviated_exception
from .element import ElementPlot
class AnnotationPlot(ElementPlot):
"""
AnnotationPlot handles the display of all annotation elements.
"""
def __init__(se... | bsd-3-clause |
petebachant/pyqtgraph | pyqtgraph/tests/test_ref_cycles.py | 25 | 2499 | """
Test for unwanted reference cycles
"""
import pyqtgraph as pg
import numpy as np
import gc, weakref
import six
import pytest
app = pg.mkQApp()
skipreason = ('unclear why test is failing on python 3. skipping until someone '
'has time to fix it. Or pyside is being used. This test is '
'... | mit |
gerald-yang/ubuntu-iotivity-demo | snappy/grovepi/python-env/lib/python2.7/encodings/euc_jisx0213.py | 816 | 1051 | #
# euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('euc_jisx0213')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(m... | apache-2.0 |
ronniehd/repository.ronniehd | plugin.video.TvGratis/vipracing.py | 42 | 18950 | import math
import urllib, urllib2
import re
def vip_unlockmeta(meta):
d=''
for i in range(0, len(meta)):
if (i % 3 == 0):
d += "%";
else:
d += meta[i];
return urllib.unquote(d);
def get_html(meta,data):
meta_un=vip_unlockmeta(meta)
# print meta_un;
# return
oo=''
x=data
l = len(x)
b = 1024.0
i, j,... | gpl-3.0 |
Dacelonid/gerrymander | gerrymander/reports.py | 1 | 49794 | #
# Copyright (C) 2014 Red Hat, 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... | apache-2.0 |
GkAntonius/feynman | examples/Solid_State_Physics/plot_eph.py | 2 | 1265 | """
Electron-phonon coupling self-energy
====================================
A diagram containing loopy lines.
"""
from feynman import Diagram
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(8,2))
ax = fig.add_axes([0,0,1,1], frameon=False)
ax.set_xlim(0, fig.get_size_inches()[0])
ax.set_ylim(0, fig.get_s... | gpl-3.0 |
albertomurillo/ansible | test/units/modules/network/f5/test_bigip_provision.py | 15 | 4548 | # -*- 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 pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
BitFunnel/BitFunnel | googletest/googletest/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/usr/bin/env python
#
# Copyright 2008, 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... | mit |
wakatime/vim-wakatime | packages/wakatime/packages/pygments/lexers/dsls.py | 25 | 33336 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dsls
~~~~~~~~~~~~~~~~~~~~
Lexers for various domain-specific languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import ExtendedRegexLexer, RegexLexer, ... | bsd-3-clause |
aaronzink/tensorflow-visual-inspection | models/object_detection/utils/np_box_list.py | 18 | 4547 | # 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... | apache-2.0 |
ebrensi/registry-frontend | ff.py | 1 | 1240 | #! usr/bin/env python
# This script is for testing without having to host the flask app.
import folium
import pandas as pd
import os
from sqlalchemy import create_engine
import geojson
DATABASE_URL = os.environ["DATABASE_URL"]
STATES_GEOJSON_PATH = "static/us-states.json"
engine = create_engine(DATABASE_URL)
with e... | mit |
yohn89/pythoner.net | pythoner/pm/urls.py | 3 | 1035 | #encoding:utf-8
"""
pythoner.net
Copyright (C) 2013 PYTHONER.ORG
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Th... | gpl-3.0 |
cattleio/stampede | docs/do-demo/deploy.py | 1 | 6809 | #!/usr/bin/env python
import cattle
import sys
ZK_NODES = 3
REDIS_NODES = 3
API_SERVER_NODES = 3
PROCESS_SERVER_NODES = 3
AGENT_SERVER_NODES = 3
MYSQL_COMPUTE = 1
# Set if you want to override the cattle.jar in the Docker image with a custom one
URL = ''
TAG = 'latest'
client = cattle.from_env()
def wait(c):
re... | apache-2.0 |
Aydarkhan/cca | automata.py | 1 | 5250 | """Copyright 2010 Aydarkhanov Ruslan, Kurochkin Ilya, Rusinov Ivan
This file is part of CCA.
CCA 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 ver... | gpl-2.0 |
jayceyxc/hue | desktop/core/ext-py/rsa-3.4.2/rsa/randnum.py | 82 | 2643 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Un... | apache-2.0 |
wreckJ/intellij-community | python/lib/Lib/site-packages/django/utils/_threading_local.py | 343 | 6655 | """Thread-local objects
(Note that this module provides a Python version of thread
threading.local class. Depending on the version of Python you're
using, there may be a faster one available. You should always import
the local class from threading.)
Thread-local objects support the management of thread-local dat... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.