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 |
|---|---|---|---|---|---|
kirsty-tortoise/mathsmap | mathsmap/new_map.py | 1 | 2417 | """
Contains classes controlling wizards for making new maps
"""
import tkinter as tk
import mathsmap.colours as colours
class Wizard:
"""
A base class for all wizards in this project
"""
def clear(self):
"""
Remove all current widgets from top level of wizard
"""
for c... | mit |
jorik041/scikit-learn | sklearn/decomposition/pca.py | 192 | 23117 | """ Principal Component Analysis
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
# Michael Eickenberg <michael.eickenberg@inria.fr>
#
# Lice... | bsd-3-clause |
yongshengwang/hue | build/env/lib/python2.7/site-packages/pysaml2-2.4.0-py2.7.egg/saml2/ecp_client.py | 32 | 11142 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""
Contains a class that can do SAML ECP Authentication for other python
programs.
"""
import cookielib
import logging
from saml2 import soap
from saml2 import saml
from saml2 import samlp
from saml2 import SAMLError
from saml2 import BINDING_SOAP
from saml2.client_ba... | apache-2.0 |
tiagocoutinho/bliss | bliss/controllers/emulators/keithley.py | 1 | 2009 | # -*- coding: utf-8 -*-
#
# This file is part of the bliss project
#
# Copyright (c) 2016 Beamline Control Unit, ESRF
# Distributed under the GNU LGPLv3. See LICENSE for more info.
import time
import random
import gevent
from bliss.comm.scpi import Commands
from bliss.controllers.keithley_scpi_mapping import COMMAND... | lgpl-3.0 |
ppapadeas/wprevents | vendor-local/lib/python/unidecode/x0ae.py | 253 | 4875 | data = (
'geul', # 0x00
'geulg', # 0x01
'geulm', # 0x02
'geulb', # 0x03
'geuls', # 0x04
'geult', # 0x05
'geulp', # 0x06
'geulh', # 0x07
'geum', # 0x08
'geub', # 0x09
'geubs', # 0x0a
'geus', # 0x0b
'geuss', # 0x0c
'geung', # 0x0d
'geuj', # 0x0e
'geuc', # 0x0f
'geuk', # ... | bsd-3-clause |
r-rathi/error-control-coding | perf/plot-pegd.py | 1 | 1496 | import numpy as np
import matplotlib.pyplot as plt
from errsim import *
def label(d, pe, pb, n):
if pb is None:
pb = pe
label = 'd={} pe={} n={} BSC'.format(d, pe, n)
else:
label = 'd={} pe={} n={} pb={}'.format(d, pe, n, pb)
return label
def plot(pe, fpath=None):
fig, ax = pl... | mit |
stevehof/location-ninja | lib/jinja2/defaults.py | 659 | 1068 | # -*- coding: utf-8 -*-
"""
jinja2.defaults
~~~~~~~~~~~~~~~
Jinja default filters and tags.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import range_type
from jinja2.utils import generate_lorem_ipsum, Cycler, Joiner
# defaults for ... | gpl-3.0 |
nikhilraog/boto | boto/opsworks/__init__.py | 135 | 1657 | # Copyright (c) 2014 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 |
zentner-kyle/servo | tests/wpt/css-tests/tools/html5lib/html5lib/treebuilders/__init__.py | 1730 | 3405 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | mpl-2.0 |
grimli/life-game | life_thread.py | 1 | 3242 | #!/usr/bin/python3
import random
from tkinter import *
import threading
import queue
class Evolver( threading.Thread ):
""" this thread calculate next status
The result is maid available to the shower trough a queue """
def __init__(self, queue):
threading.Thread.__init__(self)
self.queue = queue
... | gpl-3.0 |
mdsafwan/Deal-My-Stuff | Lib/site-packages/django/utils/inspect.py | 15 | 2502 | from __future__ import absolute_import
import inspect
import sys
HAS_INSPECT_SIGNATURE = sys.version_info >= (3, 3)
def getargspec(func):
if not HAS_INSPECT_SIGNATURE:
return inspect.getargspec(func)
sig = inspect.signature(func)
args = [
p.name for p in sig.parameters.values()
... | apache-2.0 |
Serag8/Bachelor | google_appengine/lib/PyAMF-0.6.1/pyamf/tests/test_flex_messaging.py | 26 | 6744 | # -*- coding: utf-8 -*-
#
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Flex Messaging compatibility tests.
@since: 0.3.2
"""
import unittest
import datetime
import uuid
import pyamf
from pyamf.flex import messaging
class AbstractMessageTestCase(unittest.TestCase):
def test_repr(self):... | mit |
chajadan/dragonfly | dragonfly/engines/backend_natlink/recobs.py | 5 | 2646 | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly 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 ... | lgpl-3.0 |
Shanec132006/lab3 | lib/flask/testsuite/signals.py | 554 | 4807 | # -*- coding: utf-8 -*-
"""
flask.testsuite.signals
~~~~~~~~~~~~~~~~~~~~~~~
Signalling.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase
class SignalsTestCase(FlaskTestCase):
def ... | apache-2.0 |
benoitsteiner/tensorflow-xsmm | tensorflow/contrib/tensor_forest/hybrid/python/models/hard_decisions_to_data_then_nn.py | 189 | 2852 | # 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 |
menardorama/ReadyNAS-Add-ons | headphones-1.0.0/debian/headphones/apps/headphones/lib/requests/packages/chardet/mbcssm.py | 1783 | 19590 | ######################## 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... | gpl-2.0 |
vmindru/ansible | lib/ansible/modules/cloud/scaleway/scaleway_security_group_rule.py | 28 | 7313 | #!/usr/bin/python
#
# Scaleway Security Group Rule management module
#
# Copyright (C) 2018 Antoine Barbare (antoinebarbare@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... | gpl-3.0 |
tareqalayan/ansible | lib/ansible/modules/cloud/amazon/aws_s3_bucket_facts.py | 48 | 2664 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['prev... | gpl-3.0 |
simcity4242/python-bitcoinlib | bitcoin/core/serialize.py | 7 | 9557 | # Copyright (C) 2012-2014 The python-bitcoinlib developers
#
# This file is part of python-bitcoinlib.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-bitcoinlib, including this file, may be copied, modified,
# propagated, or dist... | lgpl-3.0 |
alxgu/ansible | lib/ansible/modules/monitoring/statusio_maintenance.py | 92 | 16873 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Benjamin Copeland (@bhcopeland) <ben@copeland.me.uk>
# 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_... | gpl-3.0 |
RamonGuiuGou/l10n-spain | l10n_es_account_balance_report/__openerp__.py | 1 | 1064 | # -*- coding: utf-8 -*-
# Copyright 2004-2011 Pexego Sistemas Informáticos
# Copyright 2013 Zikzakmedia
# Copyright 2014 Juanjo Algaz
# Copyright 2014 Joaquín Gutierrez <joaquing.pedrosa@gmail.com>
# Copyright 2014-2016 Tecnativa - Pedro M. Baeza
# Copyright 2016 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (... | agpl-3.0 |
veestr/sjsu-298-experiment | main.py | 1 | 9053 | #!/usr/bin/env python
#
# 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
#
# Unless required by applicable law o... | mit |
CiscoSystems/horizon | openstack_dashboard/dashboards/admin/metering/views.py | 51 | 6870 | # 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, software
# distributed under t... | apache-2.0 |
xodus7/tensorflow | tensorflow/python/autograph/converters/continue_statements.py | 11 | 5281 | # 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 |
gxx/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/views/models.py | 144 | 1202 | """
Regression tests for Django built-in views.
"""
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=100)
def __unicode__(self):
return self.name
def get_absolute_url(self):
return '/views/authors/%s/' % self.id
class BaseArticle(models.Model):... | gpl-3.0 |
gnowxilef/youtube-dl | youtube_dl/extractor/varzesh3.py | 64 | 3238 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
compat_parse_qs,
)
from ..utils import (
clean_html,
remove_start,
)
class Varzesh3IE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?video\.varzesh3\.c... | unlicense |
xiangke/pycopia | mibs/pycopia/mibs/SNMPv2_TM.py | 1 | 2645 | # python
# This file is generated by a program (mib2py). Any edits will be lost.
from pycopia.aid import Enum
import pycopia.SMI.Basetypes
Range = pycopia.SMI.Basetypes.Range
Ranges = pycopia.SMI.Basetypes.Ranges
from pycopia.SMI.Objects import ColumnObject, MacroObject, NotificationObject, RowObject, ScalarObject, N... | lgpl-2.1 |
Glottotopia/aagd | moin/local/moin/MoinMoin/macro/WantedPages.py | 2 | 3445 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - WantedPages Macro
@copyright: 2001 Juergen Hermann <jh@web.de>
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin import wikiutil
Dependencies = ["pages"]
def macro_WantedPages(macro):
request = macro.request
_ = request.getTex... | mit |
w1r0x/ansible | lib/ansible/playbook/helpers.py | 66 | 4255 | # (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 |
webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/numpy/f2py/common_rules.py | 176 | 5030 | #!/usr/bin/env python
"""
Build common block mechanism for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: ... | gpl-2.0 |
zzcclp/spark | python/pyspark/tests/test_install_spark.py | 23 | 4345 | #
# 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 us... | apache-2.0 |
alexryndin/ambari | ambari-common/src/main/python/resource_management/libraries/functions/packages_analyzer.py | 1 | 10470 | #!/usr/bin/env python
"""
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")... | apache-2.0 |
abhijo89/Django-facebook | docs/docs_env/Lib/encodings/hex_codec.py | 528 | 2309 | """ Python 'hex_codec' Codec - 2-digit hex 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, binascii
### Codec APIs
def hex_encode(... | bsd-3-clause |
c0hen/django-venv | lib/python3.4/site-packages/django/core/management/commands/dumpdata.py | 48 | 9116 | import warnings
from collections import OrderedDict
from django.apps import apps
from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, router
class ProxyModelWarning(Warning):
pass
class Command(BaseCommand):
help = (
... | gpl-3.0 |
GabrielFortin/ansible-module-f5bigip | library/f5bigip_sys_httpd.py | 2 | 9725 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018, Eric Jacob <erjac77@gmail.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/LICENS... | apache-2.0 |
jettisonjoe/openhtf | openhtf/util/timeouts.py | 2 | 16019 | # 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 by applicable law or agre... | apache-2.0 |
glorizen/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/dviread.py | 69 | 29920 | """
An experimental module for reading dvi files output by TeX. Several
limitations make this not (currently) useful as a general-purpose dvi
preprocessor.
Interface::
dvi = Dvi(filename, 72)
for page in dvi: # iterate over pages
w, h, d = page.width, page.height, page.descent
for x,y,font,gl... | agpl-3.0 |
lihui7115/ChromiumGStreamerBackend | third_party/cython/src/Cython/Compiler/AnalysedTreeTransforms.py | 87 | 3774 | from Visitor import ScopeTrackingTransform
from Nodes import StatListNode, SingleAssignmentNode, CFuncDefNode, DefNode
from ExprNodes import DictNode, DictItemNode, NameNode, UnicodeNode
from PyrexTypes import py_object_type
from StringEncoding import EncodedString
import Symtab
class AutoTestDictTransform(ScopeTracki... | bsd-3-clause |
baylabs/grpc | src/python/grpcio_tests/tests/interop/_intraop_test_case.py | 23 | 2869 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
openpli-arm/enigma2-arm | lib/python/Components/PluginComponent.py | 1 | 4036 | from os import path as os_path, listdir as os_listdir
from traceback import print_exc
from sys import stdout
from Tools.Directories import fileExists
from Tools.Import import my_import
from Plugins.Plugin import PluginDescriptor
import keymapparser
class PluginComponent:
firstRun = True
restartRequired = False
d... | gpl-2.0 |
sundapeng/kafka | tests/kafkatest/services/verifiable_producer.py | 34 | 3924 | # 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 |
pipermerriam/django | tests/managers_regress/tests.py | 264 | 8342 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.template import Context, Template
from django.test import TestCase, override_settings
from django.utils.encoding import force_text
from .models import (
AbstractBase1, AbstractBase2, AbstractBase3, Child1... | bsd-3-clause |
kabracity/Flexget | flexget/plugins/metainfo/tmdb_lookup.py | 5 | 2871 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
from flexget.utils import imdb
from flexget.utils.log import log_once
try:
# TODO: Fix this after api_tmdb has module level functions
from flexget.plugins.api_tmdb impor... | mit |
analyseuc3m/ANALYSE-v1 | common/djangoapps/auth_exchange/tests/test_forms.py | 113 | 2792 | # pylint: disable=no-member
"""
Tests for OAuth token exchange forms
"""
import unittest
from django.conf import settings
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase
from django.test.client import RequestFactory
import httpretty
from provider import scope
import so... | agpl-3.0 |
SydneyUniLibrary/auto-holds | patron/migrations/0007_auto_20160316_0257.py | 1 | 1269 | # Copyright 2016 Susan Bennett, David Mitchell, Jim Nicholls
#
# This file is part of AutoHolds.
#
# AutoHolds 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 opt... | gpl-3.0 |
aabbox/kbengine | kbe/src/lib/python/Lib/test/test_re.py | 60 | 68082 | from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
cpython_only, captured_stdout
import io
import re
from re import Scanner
import sre_compile
import sre_constants
import sys
import string
import traceback
import unittest
from weakref import proxy
# Misc tests from Tim Peters' re.do... | lgpl-3.0 |
kingvuplus/xrd-alliance | lib/python/Plugins/SystemPlugins/Satfinder/plugin.py | 9 | 20104 | from enigma import eDVBResourceManager,\
eDVBFrontendParametersSatellite, eDVBFrontendParametersTerrestrial
from Screens.ScanSetup import ScanSetup, buildTerTransponder
from Screens.ServiceScan import ServiceScan
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
from Components.So... | gpl-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/docutils/parsers/__init__.py | 126 | 1657 | # $Id: __init__.py 7646 2013-04-17 14:17:37Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This package contains Docutils parser modules.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import Component
if sys.version_info < (2... | agpl-3.0 |
lokirius/python-for-android | python-build/python-libs/gdata/src/gdata/blogger/data.py | 136 | 4030 | #!/usr/bin/env python
#
# Copyright (C) 2009 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
#
# Unless required by applicable ... | apache-2.0 |
anirudhvenkats/clowdflows | workflows/crossbee/library_gen.py | 6 | 7383 | # -----------------------------------------------------------------------------------------------------
# WARNING: THIS IS AUTOMATICALLY GENERATED FILE, DO NOT EDIT IT MANUALLY AS YOU MAY LOOSE YOUR CHANGES!
# -----------------------------------------------------------------------------------------------------
from im... | gpl-3.0 |
davidzchen/tensorflow | tensorflow/python/training/tracking/util_test.py | 8 | 40799 | # 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 |
xen0n/gingerprawn | gingerprawn/shrimp/academic/academic_curricula_frame.py | 1 | 8581 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# JNMaster / academic / curriculum querier interface
# the original code was contributed by Chen Huayue, later almost entirely
# rewritten by Wang Xuerui.
# Copyright (C) 2011 Chen Huayue <489412949@qq.com>
# Copyright (C) 2011 Wang Xuerui <idontknw.wang@gmail.com>
#
# This... | gpl-3.0 |
PulsePod/old-www-do-not-use | lib/python2.7/site-packages/pip/commands/__init__.py | 476 | 2236 | """
Package containing all pip commands
"""
from pip.commands.bundle import BundleCommand
from pip.commands.completion import CompletionCommand
from pip.commands.freeze import FreezeCommand
from pip.commands.help import HelpCommand
from pip.commands.list import ListCommand
from pip.commands.search import SearchComman... | mit |
AnotherIvan/calibre | src/calibre/ebooks/epub/cfi/parse.py | 14 | 7366 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import regex, sys
from future_builtins import map, zip
is_narrow_build = sy... | gpl-3.0 |
ddico/account-analytic | account_analytic_plan_required/account.py | 11 | 4623 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account analytic plan required module for OpenERP
# Copyright (C) 2014 Acsone (http://acsone.eu).
# @author Stéphane Bidoul <stephane.bidoul@acsone.eu>
#
# This program is free software: you can redi... | agpl-3.0 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.4/django/utils/unittest/case.py | 103 | 42486 | """Test case implementation"""
import sys
import difflib
import pprint
import re
import unittest
import warnings
from django.utils.unittest import result
from django.utils.unittest.util import\
safe_repr, safe_str, strclass,\
unorderable_list_difference
from django.utils.unittest.compatibility import wraps
... | bsd-3-clause |
theoryno3/scikit-learn | examples/linear_model/plot_bayesian_ridge.py | 248 | 2588 | """
=========================
Bayesian Ridge Regression
=========================
Computes a Bayesian Ridge Regression on a synthetic dataset.
See :ref:`bayesian_ridge_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the coefficient
weights are slightly shift... | bsd-3-clause |
mikepea/fullerite | src/diamond/collectors/mysqlstat/mysql55.py | 24 | 8260 | # coding=utf-8
"""
Diamond collector that monitors relevant MySQL performance_schema values
For now only monitors replication load
[Blog](http://bit.ly/PbSkbN) announcement.
[Snippet](http://bit.ly/SHwYhT) to build example graph.
#### Dependencies
* MySQLdb
* MySQL 5.5.3+
"""
from __future__ import division
... | apache-2.0 |
openatv/enigma2 | lib/python/Plugins/SystemPlugins/ConfigurationBackup/plugin.py | 42 | 8494 | from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.Console import Console
from Components.ActionMap import ActionMap, NumberActionMap
from Components.Pixmap import Pixmap
from Components.Label import Label
from Components.MenuList import MenuList
from Components.config import Confi... | gpl-2.0 |
timqian/sms-tools | lectures/8-Sound-transformations/plots-code/sineModelFreqScale-orchestra.py | 21 | 2666 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, hanning, triang, blackmanharris, resample
import math
import sys, os, functools, time
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
sys.path.append(os.path.join(os.path.dirname... | agpl-3.0 |
MediffRobotics/DeepRobotics | DeepLearnMaterials/lstm_tfl.py | 1 | 1796 | # -*- coding: utf-8 -*-
"""
Simple example using LSTM recurrent neural network to classify IMDB
sentiment dataset.
References:
- Long Short Term Memory, Sepp Hochreiter & Jurgen Schmidhuber, Neural
Computation 9(8): 1735-1780, 1997.
- Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng,... | gpl-3.0 |
shubhdev/edxOnBaadal | openedx/core/djangoapps/profile_images/views.py | 23 | 6206 | """
This module implements the upload and remove endpoints of the profile image api.
"""
from contextlib import closing
import datetime
import logging
from django.utils.translation import ugettext as _
from django.utils.timezone import utc
from rest_framework import permissions, status
from rest_framework.parsers impo... | agpl-3.0 |
AOKP/kernel_samsung_jf | 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 |
MrLoick/python-for-android | python3-alpha/python3-src/Lib/wsgiref/headers.py | 145 | 6682 | """Manage HTTP Response Headers
Much of this module is red-handedly pilfered from email.message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
"""
# Regular expression that matches `special' characters in parameters, the
# existence of which force ... | apache-2.0 |
franek/weboob | modules/bnporc/perso/messages.py | 8 | 3353 | # -*- coding: utf-8 -*-
# Copyright(C) 2012 Laurent Bachelier
#
# This file is part of weboob.
#
# weboob 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 ... | agpl-3.0 |
sclabs/sitestatus-nonrel | django/contrib/comments/admin.py | 361 | 3299 | from django.contrib import admin
from django.contrib.comments.models import Comment
from django.utils.translation import ugettext_lazy as _, ungettext
from django.contrib.comments import get_model
from django.contrib.comments.views.moderation import perform_flag, perform_approve, perform_delete
class CommentsAdmin(adm... | bsd-3-clause |
SeattleTestbed/repy_v2 | namespace.py | 1 | 39911 | """
<Program>
namespace.py
<Started>
September 2009
<Author>
Justin Samuel
<Purpose>
This is the namespace layer that ensures separation of the namespaces of
untrusted code and our code. It provides a single public function to be
used to setup the context in which untrusted code is exec'd (that is, the
... | mit |
tsg-/pyeclib | pyeclib/utils.py | 1 | 3062 | # Copyright (c) 2013, 2014, Kevin Greenan (kmgreen2@gmail.com)
# Copyright (c) 2014, Tushar Gohad (tusharsg@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:
#
# Redistributions of source... | bsd-2-clause |
ssh0/growing-string | triangular_lattice/diecutting/result_count_on_edge.py | 1 | 9360 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# written by Shotaro Fujimoto
# 2016-12-16
import matplotlib.pyplot as plt
# from mpl_toolkits.mplot3d.axes3d import Axes3D
import matplotlib.cm as cm
import numpy as np
import set_data_path
class Visualizer(object):
def __init__(self, subjects):
self.data_... | mit |
grantcolasurdo/geras | fifth_edition/alignment.py | 1 | 3115 | """Alignment object class"""
__author__ = "Grant Colasurdo"
class Alignment:
SHORT_TO_LONG = {
'N': 'Neutral',
'G': 'Good',
'E': 'Evil',
'C': 'Chaotic',
'L': 'Lawful',
'': ''
}
def __init__(self, short_string: str=""):
if "L" in short_string:
... | gpl-2.0 |
geekboxzone/lollipop_external_chromium_org_third_party_WebKit | Source/devtools/scripts/jsdoc-validator/build_jsdoc_validator_jar.py | 66 | 5099 | #!/usr/bin/python
import hashlib
import operator
import os
import shutil
import stat
import subprocess
import sys
import tempfile
def rel_to_abs(rel_path):
return os.path.join(script_path, rel_path)
java_bin_path = os.getenv('JAVA_HOME', '')
if java_bin_path:
java_bin_path = os.path.join(java_bin_path, 'bi... | bsd-3-clause |
jonnary/keystone | keystone/token/provider.py | 5 | 22802 | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
anryko/ansible | test/units/module_utils/facts/hardware/test_linux.py | 93 | 7748 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
PJB3005/MoMMI | MoMMI/Modules/chance.py | 1 | 3714 | import asyncio
import random
from typing import Match
from discord import Message
from MoMMI import command, MChannel
@command("pick", r"(?:pick|choose)\s*\((.*?)\)")
async def pick_command(channel: MChannel, match: Match, message: Message) -> None:
choices = [x.strip() for x in match.group(1).split(",")]
if ... | mit |
kevinthesun/mxnet | example/speech_recognition/stt_layer_fc.py | 52 | 6097 | # 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 u... | apache-2.0 |
ntuecon/server | pyenv/Lib/site-packages/django/templatetags/cache.py | 471 | 3389 | from __future__ import unicode_literals
from django.core.cache import InvalidCacheBackendError, caches
from django.core.cache.utils import make_template_fragment_key
from django.template import (
Library, Node, TemplateSyntaxError, VariableDoesNotExist,
)
register = Library()
class CacheNode(Node):
def __in... | bsd-3-clause |
accraze/bitcoin | qa/rpc-tests/test_framework/authproxy.py | 46 | 6096 |
"""
Copyright 2011 Jeff Garzik
AuthServiceProxy has the following improvements over python-jsonrpc's
ServiceProxy class:
- HTTP connections persist for the life of the AuthServiceProxy object
(if server supports HTTP/1.1)
- sends protocol 'version', per JSON-RPC 1.1
- sends proper, incrementing 'id'
... | mit |
openqt/algorithms | leetcode/python/lc919-complete-binary-tree-inserter.py | 1 | 2138 | # coding=utf-8
import unittest
"""919. Complete Binary Tree Inserter
https://leetcode.com/problems/complete-binary-tree-inserter/description/
A _complete_ binary tree is a binary tree in which every level, except
possibly the last, is completely filled, and all nodes are as far left as
possible.
Write a data structu... | gpl-3.0 |
ReganBell/QReview | build/lib/networkx/algorithms/flow/edmondskarp.py | 8 | 8222 | # -*- coding: utf-8 -*-
"""
Edmonds-Karp algorithm for maximum flow problems.
"""
__author__ = """ysitu <ysitu@users.noreply.github.com>"""
# Copyright (C) 2014 ysitu <ysitu@users.noreply.github.com>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.algorithms.flow.utils import *
__all__ = ['... | bsd-3-clause |
icomms/rapidsms | apps/schools/tests.py | 3 | 14361 | from __future__ import absolute_import
import os, random, re
from datetime import datetime, timedelta
from xml.etree import ElementTree
from django.core.management.commands.dumpdata import Command
from rapidsms.tests.scripted import TestScript
from schools.app import App
from schools.models import *
from blaster.mo... | lgpl-3.0 |
joshal/behave | behave4cmd0/command_util.py | 13 | 3803 | # -*- coding -*-
"""
Provides some command utility functions.
TODO:
matcher that ignores empty lines and whitespace and has contains comparison
"""
from __future__ import absolute_import
from behave4cmd0 import pathutil
from behave4cmd0.__setup import TOP, TOPA
import os.path
import shutil
from fnmatch import fnmat... | bsd-2-clause |
Fidge123/league-unlock-challenge | src/UpdateHallOfFame.py | 1 | 1936 | #!/usr/bin/env python3
"""Take match and player data, get champ and save it to the database"""
from os import environ
import psycopg2
# with open("db_config") as file:
# HOST = file.readline().strip()
# DBNAME = file.readline().strip()
# USER = file.readline().strip()
# PASS = file.readline().strip()
... | gpl-3.0 |
mspark93/VTK | ThirdParty/Twisted/twisted/application/strports.py | 48 | 3139 | # -*- test-case-name: twisted.test.test_strports -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Construct listening port services from a simple string description.
@see: L{twisted.internet.endpoints.serverFromString}
@see: L{twisted.internet.endpoints.clientFromString}
"""
import war... | bsd-3-clause |
master-g/vogenerator | google/protobuf/map_unittest_pb2.py | 30 | 122481 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/map_unittest.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf... | mit |
johnwlockwood/appengine-mapreduce | python/src/mapreduce/lib/pipeline/status_ui.py | 4 | 5903 | #!/usr/bin/env python
#
# Copyright 2010 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
#
# Unless required by applicable law o... | apache-2.0 |
smarterclayton/origin | cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog/vendor/k8s.io/kubernetes/hack/lookup_pull.py | 246 | 1299 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
urandu/rethinkdb | external/v8_3.30.33.16/tools/run-deopt-fuzzer.py | 36 | 16911 | #!/usr/bin/env python
#
# 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
# noti... | agpl-3.0 |
alikins/ansible | lib/ansible/modules/network/a10/a10_service_group.py | 16 | 13386 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Mischa Peters <mpeters@a10networks.com>,
# Eric Chou <ericc@a10networks.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__ = t... | gpl-3.0 |
hfp/tensorflow-xsmm | tensorflow/contrib/gan/python/estimator/python/tpu_gan_estimator.py | 11 | 1229 | # 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 |
zooba/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/setuptools/msvc.py | 40 | 40838 | """
Improved support for Microsoft Visual C++ compilers.
Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
Microsoft Windows SDK 6.1 (x86, x64, ia64)
Microsoft Windows SDK 7.0 (x86, x64, ia64)
Microsoft Visual C++ 10.0... | apache-2.0 |
grantdelozier/TextGWR | GWRMain.py | 1 | 14380 | import sys
if len(sys.argv) >= 3:
#try:
print sys.argv
args = sys.argv
mode_arg = args[args.index("-mode")+1]
print mode_arg
#############Build Reference File Mode###############
if mode_arg.lower() == "build_ref_files":
import BuildRef
print "Building Reference Files"
... | apache-2.0 |
klenks/jobsportal | env/lib/python2.7/site-packages/pip/vcs/__init__.py | 344 | 12374 | """Handles all VCS (version control) support"""
from __future__ import absolute_import
import errno
import logging
import os
import shutil
import sys
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.exceptions import BadCommand
from pip.utils import (display_path, backup_dir, call_subprocess,
... | mit |
shivaenigma/electrum | plugins/email_requests.py | 5 | 7044 | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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 y... | gpl-3.0 |
thaim/ansible | lib/ansible/modules/notification/twilio.py | 75 | 5583 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Matt Makai <matthew.makai@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
ANSIBLE_METADATA = {'metadata_version': '1.1',... | mit |
razvanphp/arangodb | 3rdParty/V8-3.31.74.1/third_party/python_26/Lib/distutils/tests/test_sysconfig.py | 17 | 1593 | """Tests for distutils.dist."""
from distutils import sysconfig
import os
import unittest
from test.test_support import TESTFN
class SysconfigTestCase(unittest.TestCase):
def test_get_config_h_filename(self):
config_h = sysconfig.get_config_h_filename()
self.assert_(os.path.isfile(config_h), con... | apache-2.0 |
sanjayankur31/nest-simulator | pynest/nest/tests/test_threads.py | 15 | 3654 | # -*- coding: utf-8 -*-
#
# test_threads.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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, o... | gpl-2.0 |
cloudera/Impala | tests/util/filesystem_base.py | 2 | 2221 | # 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 u... | apache-2.0 |
HKUST-SING/tensorflow | tensorflow/python/kernel_tests/summary_audio_op_test.py | 134 | 2594 | # 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 |
willthames/ansible | lib/ansible/module_utils/mysql.py | 114 | 3293 | # 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 |
libscie/liberator | liberator/lib/python3.6/site-packages/chardet/mbcharsetprober.py | 289 | 3413 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | cc0-1.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.