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 |
|---|---|---|---|---|---|
dlazz/ansible | docs/bin/find-plugin-refs.py | 106 | 3338 | #!/usr/bin/env python
# To run this script, first make webdocs in the toplevel of the checkout. This will generate all
# rst files from their sources. Then run this script ./docs/bin/find-plugin-refs.py
#
# No output means that there are no longer any bare module and plugin names referenced via :ref:
#
# For my list... | gpl-3.0 |
jelugbo/hebs_repo | pavelib/utils/test/suites/suite.py | 45 | 3934 | """
A class used for defining and running test suites
"""
import sys
import subprocess
from pavelib.utils.process import kill_process
try:
from pygments.console import colorize
except ImportError:
colorize = lambda color, text: text # pylint: disable-msg=invalid-name
__test__ = False # do not collect
clas... | agpl-3.0 |
RobertABT/heightmap | build/matplotlib/examples/pylab_examples/newscalarformatter_demo.py | 13 | 3313 | #!/usr/bin/env python
# Demonstrating the improvements and options of the proposed new ScalarFormatter
from pylab import *
from matplotlib.ticker import OldScalarFormatter
x=frange(0,1,.01)
f=figure(figsize=(6,6))
f.text(0.5,0.975,'The old formatter',horizontalalignment='center',verticalalignment='top')
subplot(221)
p... | mit |
deepsrijit1105/edx-platform | lms/djangoapps/teams/management/commands/tests/test_reindex_course_team.py | 30 | 3080 | """ Tests for course_team reindex command """
import ddt
from mock import patch
from django.core.management import call_command, CommandError
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from opaque_keys.edx.keys import CourseKey
from ....tests.factories import CourseTeamFactory
from .... | agpl-3.0 |
alxgu/ansible | lib/ansible/plugins/doc_fragments/aireos.py | 44 | 2241 | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, James Mighion <@jmighion>
# 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:
provider:
description:
- A ... | gpl-3.0 |
cauchycui/scikit-learn | examples/feature_stacker.py | 246 | 1906 | """
=================================================
Concatenating multiple feature extraction methods
=================================================
In many real-world examples, there are many ways to extract features from a
dataset. Often it is beneficial to combine several methods to obtain good
performance. Th... | bsd-3-clause |
kiseok7/namebench | nb_third_party/dns/rdtypes/IN/WKS.py | 248 | 4116 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
BeDjango/intef-openedx | common/lib/calc/calc/tests/test_preview.py | 257 | 8723 | # -*- coding: utf-8 -*-
"""
Unit tests for preview.py
"""
import unittest
from calc import preview
import pyparsing
class LatexRenderedTest(unittest.TestCase):
"""
Test the initializing code for LatexRendered.
Specifically that it stores the correct data and handles parens well.
"""
def test_sim... | agpl-3.0 |
rismalrv/learntesting | learntesting/user/models.py | 1 | 1869 | # -*- coding: utf-8 -*-
import datetime as dt
from flask_login import UserMixin
from learntesting.extensions import bcrypt
from learntesting.database import (
Column,
db,
Model,
ReferenceCol,
relationship,
SurrogatePK,
)
class Role(SurrogatePK, Model):
__tablename__ = 'roles'
name = ... | gpl-2.0 |
RydrDojo/Ridr | pylotVenv/lib/python2.7/site-packages/flask/testsuite/testing.py | 561 | 7411 | # -*- coding: utf-8 -*-
"""
flask.testsuite.testing
~~~~~~~~~~~~~~~~~~~~~~~
Test client and more.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase
from flask._compat import text_type
c... | mit |
deepsrijit1105/edx-platform | lms/djangoapps/course_wiki/editors.py | 63 | 2245 | from django import forms
from django.forms.utils import flatatt
from django.utils.encoding import force_unicode
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
from wiki.editors.base import BaseEditor
from wiki.editors.... | agpl-3.0 |
utkbansal/kuma | kuma/core/tests/test_urlresolvers.py | 21 | 2581 | from nose.tools import eq_
from nose.plugins.skip import SkipTest
from kuma.core.tests import KumaTestCase
from ..urlresolvers import get_best_language
class BestLanguageTests(KumaTestCase):
def test_english_only(self):
"""Any way you slice it, this should be 'en-US'."""
best = get_best_language(... | mpl-2.0 |
Ramalus/kivy | kivy/core/audio/audio_gstplayer.py | 40 | 2636 | '''
Audio Gstplayer
===============
.. versionadded:: 1.8.0
Implementation of a VideoBase with Kivy :class:`~kivy.lib.gstplayer.GstPlayer`
This player is the prefered player, using Gstreamer 1.0, working on both Python
2 and 3.
'''
from kivy.lib.gstplayer import GstPlayer, get_gst_version
from kivy.core.audio import... | mit |
alown/mypaint | gui/picker.py | 4 | 19347 | # This file is part of MyPaint.
# -*- coding: utf-8 -*-
# Copyright (C) 2015 by Andrew Chadwick <a.t.chadwick@gmail.com>
#
# 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... | gpl-2.0 |
amb/blender-texture-tools | image_ops.py | 1 | 6314 | # -*- coding:utf-8 -*-
# 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 that... | gpl-2.0 |
zihua/scikit-learn | sklearn/preprocessing/tests/test_label.py | 34 | 18227 | import numpy as np
from scipy.sparse import issparse
from scipy.sparse import coo_matrix
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sparse import dok_matrix
from scipy.sparse import lil_matrix
from sklearn.utils.multiclass import type_of_target
from sklearn.utils.testing impor... | bsd-3-clause |
tmpgit/intellij-community | python/helpers/docutils/readers/pep.py | 61 | 1554 | # $Id: pep.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Python Enhancement Proposal (PEP) Reader.
"""
__docformat__ = 'reStructuredText'
from docutils.readers import standalone
from docutils.transforms import p... | apache-2.0 |
pvtodorov/indra | indra/util/kappa_util.py | 3 | 3776 | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from networkx import MultiDiGraph
from pygraphviz import AGraph
def im_json_to_graph(im_json):
"""Return networkx graph from Kappy's influence map JSON.
Parameters
----------
im_json : dict
... | bsd-2-clause |
Mapotempo/mapotempo-qgis-plugin | urllib3/util/retry.py | 1 | 9532 | import time
import logging
from ..exceptions import (
ProtocolError,
ConnectTimeoutError,
ReadTimeoutError,
MaxRetryError,
)
import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
Each retry attempt will create a new Retry object with updated values, so
... | gpl-2.0 |
mdsitton/fofix | win32/makedefs.py | 10 | 4648 | #!/usr/bin/env python
# Script to create .defs from a folder of MinGW implibs and a folder of DLLs.
# Copyright (C) 2010 John Stumpo
#
# 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 vers... | gpl-2.0 |
JorgeCoock/django | django/views/decorators/clickjacking.py | 335 | 1744 | from functools import wraps
from django.utils.decorators import available_attrs
def xframe_options_deny(view_func):
"""
Modifies a view function so its response has the X-Frame-Options HTTP
header set to 'DENY' as long as the response doesn't already have that
header set.
e.g.
@xframe_optio... | bsd-3-clause |
brdfdr/trading-with-python | sandbox/spreadCalculations.py | 78 | 1496 | '''
Created on 28 okt 2011
@author: jev
'''
from tradingWithPython import estimateBeta, Spread, returns, Portfolio, readBiggerScreener
from tradingWithPython.lib import yahooFinance
from pandas import DataFrame, Series
import numpy as np
import matplotlib.pyplot as plt
import os
symbols = ['SPY','... | bsd-3-clause |
csgxy123/Dato-Core | cxxtest/python/setup.py | 17 | 1389 | """
Script to generate the installer for cxxtest.
"""
classifiers = """\
Development Status :: 4 - Beta
Intended Audience :: End Users/Desktop
License :: OSI Approved :: LGPL License
Natural Language :: English
Operating System :: Microsoft :: Windows
Operating System :: Unix
Programming Language :: Python
Topic :: So... | agpl-3.0 |
couchbase/perfrunner | cbagent/collectors/kvstore_stats.py | 1 | 7686 | import json
from cbagent.collectors.collector import Collector
from perfrunner.helpers.local import extract_cb_any, get_cbstats
class KVStoreStats(Collector):
COLLECTOR = "kvstore_stats"
CB_STATS_PORT = 11209
METRICS_ACROSS_SHARDS = (
"BlockCacheQuota",
"WriteCacheQuota",
"BlockCa... | apache-2.0 |
platinummonkey/trolliusgremlin | aiogremlin/subprotocol.py | 1 | 3099 | """Implements the Gremlin Server subprotocol."""
import collections
import uuid
try:
import ujson as json
except ImportError:
import json
from aiogremlin.exceptions import RequestError, GremlinServerError
__all__ = ("GremlinWriter", "gremlin_response_parser", "Message")
Message = collections.namedtuple(
... | mit |
valiantljk/graph-partition | algorithms/operators/binary.py | 2 | 9920 | """
Operations on graphs including union, intersection, difference.
"""
# Copyright (C) 2004-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils import is_string_lik... | gpl-2.0 |
davisein/jitsudone | 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 |
percipient/django_migration_testcase | tests/test_second_app/south_migrations/0003_auto__add_field_mymodel_my_model.py | 3 | 1948 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'MyModel.my_model'
db.add_column(u'test_second_app_mymodel', 'my_model',
self.gf('django.db.models.fields.related.Fo... | mit |
thundernet8/WRGameVideos-Server | venv/lib/python2.7/site-packages/pip/_vendor/distlib/version.py | 426 | 23711 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Implementation of a flexible versioning scheme providing support for PEP-386,
distribute-compatible and semantic versioning.
"""
import logging
import re
from .compat import string_types
... | gpl-2.0 |
laurent-george/weboob | modules/phpbb/pages/forum.py | 7 | 8111 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# 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 you... | agpl-3.0 |
niasand/cool-config | algorithm/algo.py | 1 | 1426 | # -*- coding: utf-8 -*-
# @Time : 2020/5/24 18:15
# @Author : Zhiwei Yang
import time
def display_time(func):
def wrapper(*args):
t1 = time.time()
req = func(*args) # 这里的func()代表下面的prime_nums函数
t2 = time.time()
run_time = t2 - t1
print('Total time {:.4}s'... | mit |
qgis/QGIS | python/plugins/processing/algs/qgis/MeanAndStdDevPlot.py | 15 | 4354 | # -*- coding: utf-8 -*-
"""
***************************************************************************
MeanAndStdDevPlot.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
********************... | gpl-2.0 |
linjoahow/cd0505 | static/Brython3.1.1-20150328-091302/Lib/_io.py | 629 | 72610 | """
Python implementation of the io module.
"""
import os
import abc
import codecs
import errno
# Import _thread instead of threading to reduce startup cost
try:
from _thread import allocate_lock as Lock
except ImportError:
from _dummy_thread import allocate_lock as Lock
import io
#brython fix me
#from io imp... | agpl-3.0 |
arlenebatada/python_script_to_generate_sql_queries_using_regular_expressions | python_script_to_generate_sql_queries_using_regular_expressions.py | 1 | 7700 | import re
arrayoflocations=[] #not for colleges, but for front end
def addToList(self, str_to_add):
if str_to_add not in self:
self.append(str_to_add)
branches=['','Aeronotical','Automobile', 'Automobile', 'BioMedical', 'BioTechnology', 'Chemical', 'Civil', 'Computer', 'ElectricalAndElectronics', 'Elec... | mit |
podhmo/boto | boto/support/layer1.py | 151 | 29434 | # 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 |
52ai/django-ccsds | django/contrib/postgres/fields/hstore.py | 62 | 2947 | import json
from django.contrib.postgres import forms, lookups
from django.contrib.postgres.fields.array import ArrayField
from django.core import exceptions
from django.db.models import Field, TextField, Transform
from django.utils import six
from django.utils.translation import ugettext_lazy as _
__all__ = ['HStore... | bsd-3-clause |
paulproteus/django | tests/modeltests/many_to_many/tests.py | 17 | 17873 | from __future__ import absolute_import
from django.test import TestCase
from .models import Article, Publication
class ManyToManyTests(TestCase):
def setUp(self):
# Create a couple of Publications.
self.p1 = Publication.objects.create(id=None, title='The Python Journal')
self.p2 = Publi... | bsd-3-clause |
zhangxujinsh/keras | keras/layers/convolutional.py | 14 | 9714 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import theano
import theano.tensor as T
from .. import activations, initializations, regularizers, constraints
from ..utils.theano_utils import shared_zeros
from ..layers.core import Layer
class Convolution1D(Layer):
def __init__(self, input_dim, nb... | mit |
gangadharkadam/v4_erp | erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py | 24 | 9707 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# ERPNext - web based ERP (http://erpnext.com)
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, unittest
from frappe.utils import fl... | agpl-3.0 |
desarrollosimagos/svidb | administrativo/settings.py | 1 | 6566 | # Django settings for administrativo project.
#!/usr/bin/python -u
# -*- coding: utf-8 -*-
import os
import glob
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
SESSION_ENGINE="django.contrib.sessions.backends.cache"
#SESION_ENGINE="django.contrib.sessions.backends.db"
#SESION_ENGINE=... | gpl-3.0 |
trishnaguha/ansible | lib/ansible/modules/cloud/online/online_user_facts.py | 50 | 1707 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
scrapinghub/keystone | keystone/tests/default_fixtures.py | 10 | 3067 | # 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 |
naparuba/shinken | shinken/objects/schedulingitem.py | 2 | 81199 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
# Thibault Cohen, thibault.cohen@savoirfairelinux.com
# Francois Mikus,... | agpl-3.0 |
pioupus/KicadSolderTool | query_footprints.py | 1 | 2490 | #!/usr/bin/env python
import pcbnew
import sys
def test_of_module_exists_on_other_side(first_side, other_side):
for modul_first in first_side:
val = modul_first['val']
for modul_other in other_side:
if val == modul_other['val']:
modul_first['other_side'] = True
... | lgpl-3.0 |
alexandru-g/kernel_htc_m8_gpe | 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 |
shanemcd/ansible | lib/ansible/modules/monitoring/logicmonitor.py | 29 | 74683 | #!/usr/bin/python
# LogicMonitor Ansible module for managing Collectors, Hosts and Hostgroups
# Copyright (C) 2015 LogicMonitor
# 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
RETURN =... | gpl-3.0 |
altstation/-tg-station | bot/C_eightball.py | 67 | 1231 | from random import choice as fsample #Yay for added speed!
global responses
responses = ['Yes','Too bad','Will you turn me off if I tell you?','Absolutely',
"Not at all", "Nope", "It does", "No", "All the time",
"I don't really know", "Could be","Possibly","You're still here?",# Chaoticag
... | agpl-3.0 |
SummerLW/Perf-Insight-Report | third_party/apiclient/googleapiclient/model.py | 77 | 11830 | # 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 ... | bsd-3-clause |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.7.2/Lib/test/test_univnewlines.py | 134 | 4079 | # Tests universal newline support for both reading and parsing files.
# NOTE: this file tests the new `io` library backported from Python 3.x.
# Similar tests for the builtin file object can be found in test_univnewlines2k.py.
from __future__ import print_function
from __future__ import unicode_literals
import io
im... | mit |
proppy/protobuf-debian | gtest/test/gtest_xml_test_utils.py | 306 | 7622 | #!/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... | bsd-3-clause |
silenci/neutron | neutron/tests/common/machine_fixtures.py | 21 | 3948 | # Copyright (c) 2015 Thales Services SAS
#
# 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 l... | apache-2.0 |
southpawtech/TACTIC-DEV | src/tactic/ui/chart/sobject_chart_wdg.py | 1 | 25895 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
denys-duchier/django | tests/model_options/test_default_related_name.py | 133 | 1577 | from django.core.exceptions import FieldError
from django.test import TestCase
from .models.default_related_name import Author, Book, Editor
class DefaultRelatedNameTests(TestCase):
@classmethod
def setUpTestData(cls):
cls.author = Author.objects.create(first_name='Dave', last_name='Loper')
... | bsd-3-clause |
lakshmi-kannan/matra | matra/storage/impl_cass.py | 1 | 2213 | # -*- encoding: utf-8 -*-
#
# 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... | apache-2.0 |
dennisfrancis/PacketManipulator | umit/pm/core/logger.py | 2 | 3439 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008, 2009 Adriano Monteiro Marques
#
# Author: Francesco Piccinno <stack.box@gmail.com>
#
# 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 Found... | gpl-2.0 |
Vishluck/sympy | sympy/core/trace.py | 82 | 6108 | from __future__ import print_function, division
from sympy import Expr, Add, Mul, Pow, sympify, Matrix, Tuple
from sympy.core.compatibility import range
from sympy.utilities import default_sort_key
def _is_scalar(e):
""" Helper method used in Tr"""
# sympify to set proper attributes
e = sympify(e)
i... | bsd-3-clause |
torufuru/OFPatchPanel | ryu/ofproto/ofproto_v1_0.py | 11 | 28910 | # Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
... | apache-2.0 |
johannesrohrer/lilypond | scripts/build/makesnippets.py | 8 | 1338 | #!@PYTHON@
# makesnippets.py
'''USAGE: makesnippets.py INPUT_DIR OUTPUT_DIR DOC_DIR
Read all .ly files from INPUT_DIR, insert translations from .texidoc
files found in DOC_DIR/LANG/texdiocs, and write ther result to OUTPUT_DIR.'''
import glob
import sys
import os.path
import re
import langdefs
(input_dir, output_d... | gpl-3.0 |
chaoallsome/pip | pip/_vendor/requests/packages/urllib3/util/timeout.py | 1004 | 9544 | # 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
# urllib3
_Default = object()
def current... | mit |
kerr-huang/SL4A | python/gdata/tests/gdata_tests/books_test.py | 87 | 2277 | #!/usr/bin/python
__author__ = "James Sams <sams.james@gmail.com>"
import unittest
from gdata import test_data
import gdata.books
import atom
class BookEntryTest(unittest.TestCase):
def testBookEntryFromString(self):
entry = gdata.books.Book.FromString(test_data.BOOK_ENTRY)
self.assert_(isins... | apache-2.0 |
Kast0rTr0y/ansible | lib/ansible/module_utils/f5_utils.py | 1 | 9678 | #
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# An... | gpl-3.0 |
lbishal/scikit-learn | sklearn/metrics/cluster/unsupervised.py | 230 | 8281 | """ Unsupervised evaluation metrics. """
# Authors: Robert Layton <robertlayton@gmail.com>
#
# License: BSD 3 clause
import numpy as np
from ...utils import check_random_state
from ..pairwise import pairwise_distances
def silhouette_score(X, labels, metric='euclidean', sample_size=None,
random... | bsd-3-clause |
actmd/Diamond | src/collectors/eventstoreprojections/eventstoreprojections.py | 16 | 4414 | # coding=utf-8
"""
A Simple collector which calls the Eventstore API for
the status of projections and parses this to flat metrics.
String values are ignored, except for the name and status.
Name is used for the metric path, status is translated to
an integer (running = 1, stopped = 0).
Note: "$" are replaced by under... | mit |
nharraud/b2share | invenio/modules/jsonalchemy/jsonext/engines/mongodb_pymongo.py | 14 | 4008 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014 CERN.
#
# Invenio 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... | gpl-2.0 |
oztalha/Islamicity | islamicity.py | 1 | 1051 | # by Talha Oz
# @tozCSS
import pandas as pd
from countrycode import countrycode
#Extracted the table using Tabula from Rehman, Scheherazade S., and Hossein Askari.
# “How Islamic Are Islamic Countries?” Global Economy Journal 10, no. 2 (May 21, 2010)
# http://www.degruyter.com/abstract/j/gej.2010.10.2/gej.201... | mit |
netmanchris/PYHPEIMC | build/lib/pyhpeimc/plat/groups.py | 3 | 9544 | #!/usr/bin/env python3
# author: @netmanchris
# This section imports required libraries
import requests
import json
from pyhpeimc.plat.device import *
HEADERS = {'Accept': 'application/json', 'Content-Type':
'application/json', 'Accept-encoding': 'application/json'}
"""
This section deals with HPE IMC Custom ... | apache-2.0 |
Journey316/candidate-test | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py | 896 | 91092 | # Copyright (c) 2013 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.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... | mit |
KaranToor/MA450 | google-cloud-sdk/platform/gsutil/third_party/oauth2client/oauth2client/contrib/_appengine_ndb.py | 25 | 5444 | # Copyright 2016 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 ... | apache-2.0 |
ZHAW-INES/rioxo-uClinux-dist | user/python/python-2.4.4/Mac/Modules/ae/aescan.py | 5 | 3511 | # Scan AppleEvents.h header file, generate aegen.py and AppleEvents.py files.
# Then run aesupport to generate AEmodule.c.
# (Should learn how to tell the compiler to compile it as well.)
import sys
import os
import string
import MacOS
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scant... | gpl-2.0 |
duoduo369/python-social-auth | social/apps/flask_me_app/models.py | 79 | 1384 | """Flask SQLAlchemy ORM models for Social Auth"""
from mongoengine import ReferenceField
from social.utils import setting_name, module_member
from social.storage.mongoengine_orm import MongoengineUserMixin, \
MongoengineAssociationMixin, \
... | bsd-3-clause |
pixelrebel/st2 | st2common/tests/unit/test_actionchain_schema.py | 13 | 2837 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
product-owner/2015scrum | static/Brython3.1.1-20150328-091302/Lib/xml/dom/minidom.py | 727 | 66854 | """Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
... | gpl-3.0 |
kntem/webdeposit | modules/bibindex/lib/bibindex_engine_stopwords.py | 16 | 1967 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN.
##
## Invenio 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 ... | gpl-2.0 |
Naoya-Horiguchi/stgit | stgit/commands/goto.py | 4 | 2595 | __copyright__ = """
Copyright (C) 2006, Catalin Marinas <catalin.marinas@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be ... | gpl-2.0 |
andersonresende/django | django/conf/locale/en_GB/formats.py | 117 | 2117 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j M Y' # '25 Oc... | bsd-3-clause |
steppobeck/rgbd-recon | external/glbinding-2.0.0/codegeneration/scripts/gen_functions.py | 3 | 1341 | from binding import *
from context import Context
def typeContext(typeString, namespace=None):
#TODO-LW reliably split typeString into its logical components
noNamespace = " void" in typeString or typeString.startswith("void")
hasModifier = typeString.startswith("const ")
return {"modifiers": typeStr... | mit |
MartynShaw/audacity | lib-src/lv2/sord/waflib/Tools/intltool.py | 330 | 2949 | #! /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,re
from waflib import Configure,TaskGen,Task,Utils,Runner,Options,Build,Logs
import waflib.Tools.ccroot
from waflib.TaskGen import feature,before_method
from waflib.... | gpl-2.0 |
jamespcole/home-assistant | homeassistant/components/hassio/ingress.py | 1 | 7080 | """Hass.io Add-on ingress service."""
import asyncio
import logging
import os
from ipaddress import ip_address
from typing import Dict, Union
import aiohttp
from aiohttp import hdrs, web
from aiohttp.web_exceptions import HTTPBadGateway
from multidict import CIMultiDict
from homeassistant.components.http import HomeA... | apache-2.0 |
srm912/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_util.py | 449 | 7538 | #!/usr/bin/env python
#
# Copyright 2011, 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... | mpl-2.0 |
andykimpe/chromium-test-npapi | build/android/gyp/jar_toc.py | 10 | 3101 | #!/usr/bin/env python
#
# 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.
"""Creates a TOC file from a Java jar.
The TOC file contains the non-package API of the jar. This includes all
public/protected/pack... | bsd-3-clause |
x111ong/odoo | addons/account_check_writing/account.py | 379 | 2032 | # -*- 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 |
nikolas/readthedocs.org | readthedocs/restapi/views/footer_views.py | 6 | 4195 | from django.shortcuts import get_object_or_404
from django.template import Context, loader as template_loader
from django.conf import settings
from django.core.context_processors import csrf
from rest_framework import decorators, permissions
from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAP... | mit |
adusia/pox | pox/openflow/libopenflow_01.py | 34 | 130464 | # Copyright 2011,2012 James McCauley
#
# 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 |
sajeeshcs/nested_quota_latest | nova/tests/unit/virt/libvirt/test_rbd.py | 21 | 11227 | # 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
# d... | apache-2.0 |
vermouthmjl/scikit-learn | sklearn/neighbors/tests/test_approximate.py | 55 | 19053 | """
Testing for the approximate neighbor search using
Locality Sensitive Hashing Forest module
(sklearn.neighbors.LSHForest).
"""
# Author: Maheshakya Wijewardena, Joel Nothman
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
hanlind/nova | nova/notifications/objects/base.py | 1 | 6906 | # 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 agreed to in... | apache-2.0 |
xen0l/ansible | lib/ansible/modules/cloud/ovirt/ovirt_storage_domains.py | 2 | 26757 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | gpl-3.0 |
andreadean5/python-hpOneView | hpOneView/uncategorized.py | 2 | 2049 | # -*- coding: utf-8 -*-
"""
uncategorized.py
~~~~~~~~~~~~
This module implements settings HPE OneView REST API
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library... | mit |
unigent/OpenWrt-Firefly-SDK | staging_dir/host/lib/scons-2.3.1/SCons/Tool/packaging/rpm.py | 8 | 13225 | """SCons.Tool.Packaging.rpm
The rpm packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Sof... | gpl-2.0 |
nipil/jcdecaux_stats_batch | jcdstats.py | 1 | 29575 | #! /usr/bin/env python
import sys
import sqlite3
import argparse
import jcd.common
import jcd.dao
class MinMax(object):
StationsDayTable = "minmax_stations_day"
ContractsDayTable = "minmax_contracts_day"
GlobalsDayTable = "minmax_global_day"
def __init__(self, db, sample_schema, arguments):
... | mit |
patmcb/odoo | addons/hr_attendance/report/attendance_errors.py | 377 | 3669 | # -*- 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 |
olivierverdier/homogint | homogint/homogint.py | 1 | 1957 | #!/usr/bin/env python
# coding: UTF-8
from __future__ import division
import numpy as np
def left_multiplication(g, x):
"""
Multiplication action of a group and a vector.
"""
return np.dot(g, x)
def trans_adjoint(g, x):
return np.dot(np.dot(g,x),g.T)
class RungeKutta(object):
def __init__(... | mit |
adazey/Muzez | libs/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 4 | 5859 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
import sys
# ipaddress has been backported to 2.6+ in pypi. If it is installed on the
# s... | gpl-3.0 |
Blauschirm/rgbMatrix-with-Webcontrol | Main/LED.py | 1 | 7516 | #!/usr/bin/python
import array, time, serial, os.path, os, sys
from random import randint
from subprocess import call
from math import *
#from graphics import *
from timeit import default_timer as timer
from PIL import Image
from sys import platform
debug=True
Preview=False
if platform == "linux" or platform == "linu... | gpl-3.0 |
jusjusjus/Motiftoolbox | Fitzhugh_3-cell/traces.py | 2 | 2657 | #!/usr/bin/env python
import time
import sys
sys.path.insert(0, '../Tools')
import fitzhugh as fh
import tools as tl
import window as win
import numpy as np
import pylab as pl
class traces(win.window):
title = 'Voltage Traces'
figsize = (13, 2)
def __init__(self, system, network, info=None, position=None):
wi... | gpl-2.0 |
owaspjocur/servo | src/components/script/dom/bindings/codegen/parser/runtests.py | 107 | 2450 | # 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, sys
import glob
import optparse
import traceback
import WebIDL
class TestHarness(object):
def __init__(s... | mpl-2.0 |
gborri/SickRage | sickrage/__init__.py | 1 | 10810 | # Author: echel0n <echel0n@sickrage.ca>
# URL: https://sickrage.ca
#
# This file is part of SickRage.
#
# SickRage 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... | gpl-3.0 |
elimelec/pjproject | pjsip-apps/src/py_pjsua/pjsua_app.py | 33 | 21600 | # $Id$
#
# Sample and simple Python script to make and receive calls, and do
# presence and instant messaging/IM using PJSUA-API binding for Python.
#
# Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
#
import py_pjsua
import sys
import thread
#
# Configurations
#
THIS_FILE = "pjsua_app.py"
C_QUIT = 0
C_LOG_... | gpl-2.0 |
crepererum/invenio-demosite | invenio_demosite/testsuite/regression/test_batchuploader.py | 7 | 12763 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio Demosite.
# Copyright (C) 2012 CERN.
#
# Invenio Demosite 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... | gpl-2.0 |
jroyal/plexpy | lib/unidecode/x007.py | 252 | 4122 | data = (
'//', # 0x00
'/', # 0x01
',', # 0x02
'!', # 0x03
'!', # 0x04
'-', # 0x05
',', # 0x06
',', # 0x07
';', # 0x08
'?', # 0x09
'~', # 0x0a
'{', # 0x0b
'}', # 0x0c
'*', # 0x0d
'[?]', # 0x0e
'', # 0x0f
'\'', # 0x10
'', # 0x11
'b', # 0x12
'g', # 0x13
'g', #... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.