repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
gdementen/PyTables | bench/table-bench.py | 13 | 16167 | #!/usr/bin/env python
from __future__ import print_function
import numpy as NP
from tables import *
# This class is accessible only for the examples
class Small(IsDescription):
var1 = StringCol(itemsize=4, pos=2)
var2 = Int32Col(pos=1)
var3 = Float64Col(pos=0)
# Define a user record to characterize som... | bsd-3-clause |
amaozhao/blogular | allauth/socialaccount/providers/openid/migrations/0001_initial.py | 73 | 1384 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='OpenIDNonce',
fields=[
('id', models.AutoField(... | bsd-3-clause |
mice-software/maus | third_party/build/scons-2.0.1/lib/scons-2.0.1/SCons/Scanner/LaTeX.py | 61 | 15879 | """SCons.Scanner.LaTeX
This module implements the dependency scanner for LaTeX code.
"""
#
# 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 f... | gpl-3.0 |
lshain-android-source/external-chromium_org | tools/code_coverage/coverage_posix_unittest.py | 54 | 4782 | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""Unit tests for coverage_posix.py.
Run a single test with a command such as:
./coverage_posix_unittest.py CoveragePosixTest.te... | bsd-3-clause |
DataDog/moto | moto/elb/models.py | 2 | 6121 | from __future__ import unicode_literals
from moto.core import BaseBackend
class FakeHealthCheck(object):
def __init__(self, timeout, healthy_threshold, unhealthy_threshold,
interval, target):
self.timeout = timeout
self.healthy_threshold = healthy_threshold
self.unhealthy_... | apache-2.0 |
Lightmatter/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/IPython/kernel/channelsabc.py | 7 | 2584 | """Abstract base classes for kernel client channels"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this softwar... | mit |
quadcores/Full_Dedup_Liu | Documentation/target/tcm_mod_builder.py | 337 | 24391 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
andviro/ropevim-bundled | ftplugin/python/rope/contrib/findit.py | 91 | 4503 | import rope.base.codeanalyze
import rope.base.evaluate
import rope.base.pyobjects
from rope.base import taskhandle, exceptions, worder
from rope.contrib import fixsyntax
from rope.refactor import occurrences
def find_occurrences(project, resource, offset, unsure=False, resources=None,
in_hierarch... | gpl-2.0 |
acarmel/CouchPotatoServer | libs/tornado/tcpclient.py | 208 | 6802 | #!/usr/bin/env python
#
# Copyright 2014 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | gpl-3.0 |
2ndQuadrant/ansible | lib/ansible/plugins/doc_fragments/a10.py | 44 | 1356 | # -*- coding: utf-8 -*-
# Copyright: (c) 2016, John Barker <jobarker@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r'''
options:
host:
description:
... | gpl-3.0 |
agarciamontoro/root | tutorials/pyroot/na49view.py | 57 | 1317 | ## \file
## \ingroup tutorial_pyroot
## This macro generates two views of the NA49 detector.
##
## To have a better and dynamic view of any of these pads,
## you can click with the middle button of your mouse to select it.
## Then select "View with x3d" in the VIEW menu of the Canvas.
## Once in x3d, you are in wirefra... | lgpl-2.1 |
jmmartinez84/yowsup | yowsup/structs/protocoltreenode.py | 38 | 4491 | import binascii
import sys
class ProtocolTreeNode(object):
def __init__(self, tag, attributes = None, children = None, data = None):
self.tag = tag
self.attributes = attributes or {}
self.children = children or []
self.data = data
assert type(self.children) is list, "Childr... | gpl-3.0 |
bonitadecker77/python-for-android | python-modules/twisted/twisted/application/test/test_internet.py | 49 | 8537 | # Copyright (c) 2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for (new code in) L{twisted.application.internet}.
"""
from zope.interface import implements
from zope.interface.verify import verifyClass
from twisted.internet.protocol import Factory
from twisted.trial.unittest import TestCase
... | apache-2.0 |
normtown/SickRage | lib/github/GitTree.py | 74 | 3323 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
pcolmant/repanier | repanier/packages/openpyxl/reader/__init__.py | 2 | 1363 | # Copyright (c) 2010-2014 openpyxl
#
# 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, publish, distr... | gpl-3.0 |
lneves/FrameworkBenchmarks | toolset/utils/benchmark_config.py | 10 | 3383 | from toolset.utils.output_helper import QuietOutputStream
from toolset.test_types import test_types
import os
import time
class BenchmarkConfig:
def __init__(self, args):
'''
Configures this BenchmarkConfig given the arguments provided.
'''
# Map type strings to their objects
... | bsd-3-clause |
MisterTea/HyperNEAT | boost_1_57_0/libs/python/test/pickle1.py | 12 | 1230 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
r'''>>> import pickle1_ext
>>> import pickle
>>> pickle1_ext.world.__module__
'pickle1_ext'
>>> pickle1_ext.world... | bsd-3-clause |
Cazomino05/Test1 | vendor/google-breakpad/src/tools/gyp/test/sibling/gyptest-all.py | 137 | 1087 | #!/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.
"""
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('build/all.gyp', chdir='src')
test.build('build/all.gyp', test.ALL, chdir='... | gpl-3.0 |
giggsey/SickRage | lib/sqlalchemy/testing/engines.py | 75 | 13114 | # testing/engines.py
# Copyright (C) 2005-2014 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
from __future__ import absolute_import
import types
import weakref
from collection... | gpl-3.0 |
asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/numpy/testing/tests/test_utils.py | 25 | 36801 | from __future__ import division, absolute_import, print_function
import warnings
import sys
import os
import numpy as np
from numpy.testing import (
assert_equal, assert_array_equal, assert_almost_equal,
assert_array_almost_equal, assert_array_less, build_err_msg,
raises, assert_raises, assert_warns, asse... | mit |
pranavtbhat/EE219 | project1/task2a.py | 1 | 3417 | from sklearn.model_selection import KFold
from sklearn.model_selection import cross_val_predict, cross_val_score
from sklearn.ensemble import RandomForestRegressor
from sklearn import linear_model
from sklearn.neural_network import MLPRegressor
import statsmodels.formula.api as sm
import Functions
from OneHotEncode im... | unlicense |
ishay2b/tensorflow | tensorflow/contrib/boosted_trees/lib/learner/batch/ordinal_split_handler_test.py | 29 | 44613 | # 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 |
miguelparaiso/OdooAccessible | addons/account/product.py | 374 | 2897 | # -*- 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 |
Nitaco/ansible | test/units/module_utils/facts/test_collectors.py | 54 | 15761 | # unit tests for ansible fact collectors
# -*- coding: utf-8 -*-
#
# 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.
#
# Ansibl... | gpl-3.0 |
benschmaus/catapult | third_party/google-endpoints/Crypto/SelfTest/Random/OSRNG/test_winrandom.py | 131 | 1777 | # -*- coding: utf-8 -*-
#
# SelfTest/Util/test_winrandom.py: Self-test for the winrandom module
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that d... | bsd-3-clause |
ruuk/script.module.youtube.dl | lib/youtube_dl/extractor/megaphone.py | 30 | 1770 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import js_to_json
class MegaphoneIE(InfoExtractor):
IE_NAME = 'megaphone.fm'
IE_DESC = 'megaphone.fm embedded players'
_VALID_URL = r'https://player\.megaphone\.fm/(?P<id>[A-Z0-9]+)'
_TES... | gpl-2.0 |
trondhindenes/ansible | lib/ansible/plugins/inventory/openstack.py | 10 | 12531 | # Copyright (c) 2012, Marco Vito Moscaritolo <marco@agavee.com>
# Copyright (c) 2013, Jesse Keating <jesse.keating@rackspace.com>
# Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
# Copyright (c) 2016, Rackspace Australia
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING... | gpl-3.0 |
omkar062/linux-4.0.4 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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.
#
# This program i... | gpl-2.0 |
bitpay/cjdns | node_build/dependencies/libuv/build/gyp/test/mac/gyptest-infoplist-process.py | 303 | 1677 | #!/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 the Info.plist preprocessor functionality.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.TestG... | gpl-3.0 |
fusionbox/mezzanine | mezzanine/pages/defaults.py | 56 | 2645 | """
Default settings for the ``mezzanine.pages`` app. Each of these can be
overridden in your project's settings module, just like regular
Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.
Thought should be given to how a setting is actually used before
ma... | bsd-2-clause |
undoware/neutron-drive | neutron-drive/django/core/handlers/wsgi.py | 83 | 8644 | import sys
from threading import Lock
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django import http
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers import set_script_prefix
from django.utils import datastructure... | bsd-3-clause |
Oxygem/canaryd | canaryd_packages/requests/packages/urllib3/util/timeout.py | 713 | 9596 | from __future__ import absolute_import
# The default socket timeout, used by httplib to indicate that no timeout was
# specified by the user
from socket import _GLOBAL_DEFAULT_TIMEOUT
import time
from ..exceptions import TimeoutStateError
# A sentinel value to indicate that no timeout was specified by the user in
# u... | mit |
eyantrainternship/eYSIP_2015_Marker_based_Robot_Localisation | Task-6/Pose Estimation/src/Pose.py | 1 | 6078 | '''Pose estimation of a marker'''
import numpy as np
import cv2
import math
cap = cv2.VideoCapture(0)
#Press space when marker is in front of the camera
while True:
ret, img = cap.read()
cv2.imshow("img",img)
if cv2.waitKey(1) == 32:
cv2.imwrite("Marker_sample.jpg", img)
bre... | cc0-1.0 |
dacaiguoguo/ghost | ghost074/node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/token.py | 365 | 5662 | # -*- coding: utf-8 -*-
"""
pygments.token
~~~~~~~~~~~~~~
Basic token types and the standard tokens.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
class _TokenType(tuple):
parent = None
def split(self):
buf = []
... | mit |
cloudera/hue | desktop/core/ext-py/pycryptodomex-3.9.7/lib/Cryptodome/PublicKey/_openssh.py | 2 | 5146 | # ===================================================================
#
# Copyright (c) 2019, Helder Eijs <helderijs@gmail.com>
# 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. Redistribut... | apache-2.0 |
nysan/yocto-autobuilder | lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/words/protocols/jabber/sasl_mechanisms.py | 18 | 6884 | # -*- test-case-name: twisted.words.test.test_jabbersaslmechanisms -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Protocol agnostic implementations of SASL authentication mechanisms.
"""
import binascii, random, time, os
from zope.interface import Interface, Attribute, implements
... | gpl-2.0 |
finnigantime/python-suds | tests/__init__.py | 70 | 1163 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | lgpl-3.0 |
gnowledge/ISON | gstudio/tests/templatetags.py | 3 | 27380 | # Copyright (c) 2011, 2012 Free Software Foundation
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later vers... | agpl-3.0 |
pwoodworth/intellij-community | python/lib/Lib/distutils/command/build_clib.py | 138 | 8659 | """distutils.command.build_clib
Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: build_clib.py 37828 2004-11-10 22:23:15Z loewis $"
... | apache-2.0 |
zimeon/iiif | iiif/manipulator.py | 1 | 15198 | """Base/null IIIF image manipulator.
Provides a number of utility methods to extract information necessary
for doing the transformations once one has knowledge of the source
image size.
"""
import logging
import os
import os.path
import re
import shutil
import subprocess
from .error import IIIFError, IIIFZeroSizeErr... | gpl-3.0 |
dslomov/intellij-community | python/helpers/docutils/parsers/rst/roles.py | 54 | 13187 | # $Id: roles.py 6121 2009-09-10 12:05:04Z milde $
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Copyright: This module has been placed in the public domain.
"""
This module defines standard interpreted text role functions, a registry for
interpreted text roles, and an API for adding to and retrieving from ... | apache-2.0 |
DDelon/youtube-dl | youtube_dl/extractor/nationalgeographic.py | 99 | 1934 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
smuggle_url,
url_basename,
)
class NationalGeographicIE(InfoExtractor):
_VALID_URL = r'http://video\.nationalgeographic\.com/.*?'
_TESTS = [
{
'url': 'http://video.nationalgeographic.c... | unlicense |
rev2004/android2cloud.app-engine | google_appengine/lib/django/django/newforms/extras/widgets.py | 32 | 2008 | """
Extra HTML Widget classes
"""
from django.newforms.widgets import Widget, Select
from django.utils.dates import MONTHS
import datetime
__all__ = ('SelectDateWidget',)
class SelectDateWidget(Widget):
"""
A Widget that splits date input into three <select> boxes.
This also serves as an example of a Wi... | mit |
MjAbuz/watchdog | test/test_wyr.py | 3 | 1717 | import webtest
from loaddb import test_email, test_passwd
from test_petitions import fill_user_details, fill_captcha
class WYRTest(webtest.TestCase):
def _fill_wyr_form(self, f, subject, msg, captcha=False):
fill_user_details(f, to_congress=True, captcha=captcha)
f['ptitle'] = subject
f['ms... | agpl-3.0 |
UWPCE-PythonCert/IntroPython2016 | students/alextruo/Session3/mailroom.py | 3 | 3666 | #!/usr/bin/env python
#this is my list of donors, with each key as the name and value as a list of numbers.
donors = {"Alex Truong" : [30, 50], "Bob Jones": [50], "Sarah Green": [24, 1], "John Allen": [10, 2], "Laura Lee": [100, 120]}
#define the function for report: TO DO
def print_report():
print("This will pri... | unlicense |
CTSRD-SOAAP/chromium-42.0.2311.135 | build/android/pylib/utils/reraiser_thread.py | 51 | 4650 | # Copyright 2013 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.
"""Thread and ThreadGroup that reraise exceptions on the main thread."""
# pylint: disable=W0212
import logging
import sys
import threading
import traceback... | bsd-3-clause |
smurfix/HomEvenT | homevent/net.py | 1 | 12587 | # -*- coding: utf-8 -*-
##
## Copyright © 2007-2012, Matthias Urlichs <matthias@urlichs.de>
##
## 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... | gpl-3.0 |
SecurityCompass/libcloud | libcloud/test/dns/test_nfsn.py | 12 | 6029 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
kaichogami/sympy | sympy/matrices/tests/test_densearith.py | 80 | 1844 | from sympy.matrices.densetools import eye
from sympy.matrices.densearith import add, sub, mulmatmat, mulmatscaler
from sympy import ZZ
def test_add():
a = [[ZZ(3), ZZ(7), ZZ(4)], [ZZ(2), ZZ(4), ZZ(5)], [ZZ(6), ZZ(2), ZZ(3)]]
b = [[ZZ(5), ZZ(4), ZZ(9)], [ZZ(3), ZZ(7), ZZ(1)], [ZZ(12), ZZ(13), ZZ(14)]]
c = ... | bsd-3-clause |
AbhaySingh/pjproject | tests/pjsua/inc_cfg.py | 22 | 2961 | # $Id$
import random
import config_site
DEFAULT_ECHO = True
DEFAULT_TRACE = True
DEFAULT_START_SIP_PORT = 50000
# Shared vars
ARGS = [] # arguments containing script module & config
HAS_SND_DEV = config_site.HAS_SND_DEV
# Individual pjsua instance configuration class
class InstanceParam:
# Name to identify this pj... | gpl-2.0 |
mrquim/repository.mrquim | repo/script.module.youtube.dl/lib/youtube_dl/extractor/gamespot.py | 23 | 5490 | from __future__ import unicode_literals
import re
from .once import OnceIE
from ..compat import (
compat_urllib_parse_unquote,
)
from ..utils import (
unescapeHTML,
url_basename,
dict_get,
)
class GameSpotIE(OnceIE):
_VALID_URL = r'https?://(?:www\.)?gamespot\.com/.*-(?P<id>\d+)/?'
_TESTS = ... | gpl-2.0 |
bjolivot/ansible | lib/ansible/modules/network/sros/sros_rollback.py | 62 | 7323 | #!/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 |
hogarthj/ansible | lib/ansible/utils/module_docs_fragments/ipa.py | 27 | 2627 | # Copyright (c) 2017-18, Ansible Project
# Copyright (c) 2017-18, Abhijeet Kasurde (akasurde@redhat.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Parameters for FreeIPA/IPA modules
DOCUMENTATION = '''
options:
ipa_port:
... | gpl-3.0 |
google/oculi | Dataflow/pipeline/local_helpers/gcs_read_helper.py | 1 | 2962 | # Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
lepistone/odoo | addons/hr_recruitment/__init__.py | 433 | 1145 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
mnieber/shared-goals | django/goal/management/commands/yoga_bend.py | 2 | 4231 | # -*- coding: utf-8 -*-
text = """
It would be hard to imagine yoga without backbends—they’re invigorating, uplifting, and heart-opening. Backbends stimulate the proper functioning of the digestive system, help preserve the health of the vertebrae and spinal disks, and open the body to deep diaphragmatic breathing. It... | apache-2.0 |
vuntz/glance | glance/db/sqlalchemy/migrate_repo/versions/032_add_task_info_table.py | 8 | 3143 | # Copyright 2013 Rackspace
# 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 app... | apache-2.0 |
ActiveState/code | recipes/Python/475163_AWK_like_text_processing/recipe-475163.py | 1 | 1721 | import re
class AwkUnhandledLine( RuntimeError ):
pass
class Awk:
"""awk-like mapping from patterns to handlers."""
def __init__(self):
# Start without any patterns
self.pats=[]
def add(self,pattern,handler=None):
# Add a pattern and its handler,
# precompiling the patt... | mit |
UIKit0/Radicale | radicale/ical.py | 6 | 15163 | # -*- coding: utf-8 -*-
#
# This file is part of Radicale Server - Calendar Server
# Copyright © 2008 Nicolas Kandel
# Copyright © 2008 Pascal Halter
# Copyright © 2008-2015 Guillaume Ayoub
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | gpl-3.0 |
40223105/w16b_test | static/Brython3.1.1-20150328-091302/Lib/unittest/test/_test_warnings.py | 858 | 2304 | # helper module for test_runner.Test_TextTestRunner.test_warnings
"""
This module has a number of tests that raise different kinds of warnings.
When the tests are run, the warnings are caught and their messages are printed
to stdout. This module also accepts an arg that is then passed to
unittest.main to affect the b... | gpl-3.0 |
utecuy/edx-platform | common/djangoapps/terrain/steps.py | 104 | 7473 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# Disable the "wildcard import" warning so we can bring in all methods from
# course helpers and ui helpers
# pylint: disable=wildcard-import
# Disable the "Unused import %s from wildcard import" warning
# pylint: disable=unused-wildcard-impor... | agpl-3.0 |
Gab0/gekkoJaponicus | promoterz/sequence/world/parallel_world.py | 1 | 1508 | #!/bin/python
import random
import itertools
import math
import time
def execute(World):
# --APPLY MIGRATION BETWEEN LOCALES;
if len(World.locales):
S, D = False, False
LocalePairs = itertools.combinations(World.locales, 2)
for L in LocalePairs:
distance = World.calculateD... | mit |
keerts/home-assistant | tests/components/sensor/test_wunderground.py | 14 | 6144 | """The tests for the WUnderground platform."""
import unittest
from homeassistant.components.sensor import wunderground
from homeassistant.const import TEMP_CELSIUS
from tests.common import get_test_home_assistant
VALID_CONFIG_PWS = {
'platform': 'wunderground',
'api_key': 'foo',
'pws_id': 'bar',
'mo... | apache-2.0 |
noba3/KoTos | addons/plugin.video.mega/resources/lib/platform_libraries/Linux/arm/Crypto/Cipher/__init__.py | 134 | 3440 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | gpl-2.0 |
datalogics/scons | test/Repository/option-f.py | 2 | 3574 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | mit |
gerald-yang/ubuntu-iotivity-demo | snappy/grovepi/python-env/local/lib/python2.7/encodings/cp862.py | 593 | 33626 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | apache-2.0 |
isandlaTech/cohorte-demos | led/dump/led-demo-yun/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/sleekxmpp/plugins/xep_0249/stanza.py | 18 | 1146 | """
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2011 Nathanael C. Fritz, Dalek
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.xmlstream import ElementBase
class Invite(ElementBase):
"""
XMPP allows for an agent in an MUC room to directly ... | apache-2.0 |
jaggu303619/asylum-v2.0 | openerp/addons/l10n_in_hr_payroll/__openerp__.py | 51 | 2477 | # -*- encoding: 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 G... | agpl-3.0 |
mclois/iteexe | twisted/python/win32.py | 14 | 1485 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Win32 utilities.
See also twisted.python.shortcut.
"""
# system imports
import win32api, win32con, re
# sibling import
from runtime import platform
# XXX fix this to use python's builtin _winreg?
def getProgramsMenuPath():
... | gpl-2.0 |
hzy001/ansible | test/units/vars/test_variable_manager.py | 70 | 5534 | # (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 |
acquia/Diamond | src/collectors/nfsd/test/testnfsd.py | 31 | 4199 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
try:
from cStringIO import StringIO
except ImportError:
fr... | mit |
mikebenfield/scipy | scipy/ndimage/tests/test_ndimage.py | 30 | 201991 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# 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 list of conditions and the following d... | bsd-3-clause |
fusionpig/ansible | lib/ansible/plugins/connections/ssh.py | 33 | 21403 | # (c) 2012, 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) any lat... | gpl-3.0 |
superdesk/Live-Blog | plugins/livedesk/__plugin__/livedesk/populate_default_data.py | 1 | 12603 | '''
Created on May 3, 2012
@package: superdesk source
@copyright: 2012 Sourcefabric o.p.s.
@license: http://www.gnu.org/licenses/gpl-3.0.txt
@author: Gabriel Nistor
Populates sample data for the services.
'''
from ..superdesk.db_superdesk import alchemySessionCreator
from ..livedesk.populate import populateDefaultUs... | agpl-3.0 |
studywolf/blog | SymPy/test_timing.py | 1 | 3065 | '''
Copyright (C) 2016 Travis DeWolf
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.
This program is distributed in the hope t... | gpl-3.0 |
JamesGuthrie/libcloud | libcloud/test/loadbalancer/test_elb.py | 41 | 7690 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
jazkarta/edx-platform-for-isc | common/djangoapps/monitoring/signals.py | 172 | 4584 | """
Add receivers for django signals, and feed data into the monitoring system.
If a model has a class attribute 'METRIC_TAGS' that is a list of strings,
those fields will be retrieved from the model instance, and added as tags to
the recorded metrics.
"""
from django.db.models.signals import post_save, post_delete,... | agpl-3.0 |
typemytype/Mechanic | Mechanic.roboFontExt/lib/site-packages/requests/packages/chardet/gb2312prober.py | 2994 | 1681 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
ds-hwang/chromium-crosswalk | build/android/devil/utils/lsusb.py | 3 | 3081 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import re
from devil.utils import cmd_helper
_COULDNT_OPEN_ERROR_RE = re.compile(r'Couldn\'t open device.*')
_INDENTATION_RE = re.compile(r'... | bsd-3-clause |
minesense/VisTrails | vistrails/gui/graphics_view.py | 2 | 34146 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause |
stepos01/ns3-lr-wpan-mlme | src/olsr/bindings/modulegen__gcc_LP64.py | 2 | 449842 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
mandx/pyrax | samples/autoscale/create_scaling_group.py | 13 | 4714 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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.ap... | apache-2.0 |
kastnerkyle/kaggle-decmeg2014 | shift_to_energy_peak.py | 1 | 4209 | import numpy as np
from scipy.ndimage import gaussian_filter
from scipy.io import loadmat
from path import path
from sklearn.decomposition import PCA
import scipy.signal as sig
def notch(Wn, bandwidth):
"""
Notch filter to kill line-noise.
"""
f = Wn / 2.0
R = 1.0 - 3.0 * (bandwidth / 2.0)
num... | bsd-3-clause |
nesdis/djongo | tests/django_tests/tests/v21/tests/urlpatterns_reverse/middleware.py | 169 | 1144 | from django.http import HttpResponse, StreamingHttpResponse
from django.urls import reverse
from django.utils.deprecation import MiddlewareMixin
from . import urlconf_inner
class ChangeURLconfMiddleware(MiddlewareMixin):
def process_request(self, request):
request.urlconf = urlconf_inner.__name__
class... | agpl-3.0 |
homme/ansible | lib/ansible/playbook/play.py | 4 | 11415 | # (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 |
googleapis/python-vision | google/cloud/vision_v1p1beta1/types/web_detection.py | 1 | 5749 | # -*- 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 |
zenotech/StarCluster | starcluster/commands/completers.py | 19 | 4704 | # Copyright 2009-2014 Justin Riley
#
# This file is part of StarCluster.
#
# StarCluster is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later ... | gpl-3.0 |
TheMocheeze/HS13-Arctic-Station | bot/NanoTrasenBot.py | 6 | 69737 | # -*- coding: utf-8 -*-
# This script is shared under the
# Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0)
# Added clause to Attribution:
# - You may not remove or hide the '<Bot_name> who created you?' functionality
# and you may not modify the name given in the response.
#CREDITS
# Author: Skibi... | agpl-3.0 |
coxmediagroup/googleads-python-lib | examples/adwords/v201506/reporting/download_criteria_report.py | 3 | 2145 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
SophosBlitz/glacon | plugins/tell.py | 11 | 2905 | " tell.py: written by sklnd in July 2009"
" 2010.01.25 - modified by Scaevolus"
import time
from util import hook, timesince
def db_init(db):
"check to see that our db has the tell table and return a dbection."
db.execute("create table if not exists tell"
"(user_to, user_from, message, ... | unlicense |
Zord13appdesa/python-for-android | python3-alpha/extra_modules/gdata/tlslite/integration/XMLRPCTransport.py | 48 | 5828 | """TLS Lite + xmlrpclib."""
import xmlrpc.client
import http.client
from gdata.tlslite.integration.HTTPTLSConnection import HTTPTLSConnection
from gdata.tlslite.integration.ClientHelper import ClientHelper
class XMLRPCTransport(xmlrpc.client.Transport, ClientHelper):
"""Handles an HTTPS transaction to an XML-RPC... | apache-2.0 |
BuildingLink/sentry | src/sentry/api/endpoints/organization_teams.py | 6 | 4492 | from __future__ import absolute_import
from django.db import IntegrityError, transaction
from rest_framework import serializers, status
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.api.serializers import ... | bsd-3-clause |
pombredanne/Bookie | bookie/lib/tagcommands.py | 2 | 2461 | """Allow for tag based commands to act upon the bookmarks in the system
"""
import logging
from bookie.models import TagMgr
LOG = logging.getLogger(__name__)
COMMANDLIST = {}
class Commander(object):
def __init__(self, bmark):
self.commands = []
self.bmark = bmark
@staticmethod
def che... | agpl-3.0 |
ghber/My-Django-Nonrel | django/db/models/sql/datastructures.py | 396 | 1157 | """
Useful auxilliary data structures for query construction. Not useful outside
the SQL domain.
"""
class EmptyResultSet(Exception):
pass
class FullResultSet(Exception):
pass
class MultiJoin(Exception):
"""
Used by join construction code to indicate the point at which a
multi-valued join was att... | bsd-3-clause |
betoesquivel/fil2014 | build/django/tests/admin_changelist/tests.py | 52 | 29730 | from __future__ import absolute_import, unicode_literals
import datetime
from django.contrib import admin
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.templatetags.admin_list import pagination
from django.contrib.admin.views.main import ChangeList, SEARCH_VAR, ALL_VAR
f... | mit |
karyon/django | tests/flatpages_tests/test_middleware.py | 15 | 7780 | from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
class TestDataMixin(object):
... | bsd-3-clause |
aureooms/sak | lib/sak.py | 1 | 2835 |
import os.path
import inspect
import lib.check
import lib.pacman
import lib.args
import lib.fn
import lib.str
ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))
BIN = os.path.join(ROOT, "bin")
LIB = os.path.join(ROOT, "lib")
SAK = os.path.join(ROOT, "sak")
DATA = os.path.join(ROOT, "data")
def d... | agpl-3.0 |
holmes-app/holmes-api | tests/unit/facters/test_js.py | 2 | 7249 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import lxml.html
from mock import Mock, call
from preggy import expect
from holmes.config import Config
from holmes.reviewer import Reviewer
from holmes.facters.js import JSFacter
from tests.unit.base import FacterTestCase
from tests.fixtures import PageFactory
class TestJS... | mit |
Caseyftw/astronet | astronet/augmentations/normalize.py | 1 | 1531 | import numpy as np
import copy
class Normalize():
""" Calculates the batch mean and standard deviation. Then normalizes inputs by first
subtracting the mean, then dividing by the standard deviation. This prevents rounding
errors when dealing with large inputs and allows for easier learning of the network.... | gpl-2.0 |
joelddiaz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.7.42-1/roles/lib_openshift/src/ansible/oc_adm_manage_node.py | 86 | 1210 | # pylint: skip-file
# flake8: noqa
def main():
'''
ansible oadm module for manage-node
'''
module = AnsibleModule(
argument_spec=dict(
debug=dict(default=False, type='bool'),
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
node=d... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.