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 |
|---|---|---|---|---|---|
grlee77/scipy | benchmarks/benchmarks/cluster.py | 13 | 1796 | import numpy as np
from numpy.testing import suppress_warnings
from .common import Benchmark, safe_import
with safe_import():
from scipy.cluster.hierarchy import linkage
from scipy.cluster.vq import kmeans, kmeans2, vq
class HierarchyLinkage(Benchmark):
params = ['single', 'complete', 'average', 'weight... | bsd-3-clause |
mangosR2/mangos | dep/ACE_wrappers/bin/svn_props.py | 95 | 1292 | #!/usr/bin/python
import sys
import re
import os
import string
print """WARNING: this script is dumb. I mean, really, really dumb. Every file is treated
as a text file, so if you are checking in any binary files, YOU MUST set a non-text
MIME type by hand, otherwise it WILL be corrupted by the checkout process.
A b... | gpl-2.0 |
ipaoTAT/python-cloudfoundry | cloudfoundry/routes.py | 2 | 1172 | __author__ = 'mcowger'
import logging
from pprint import pformat, pprint
class CloudFoundryRoute(object):
@classmethod
def get_class_name(cls):
return cls.__name__
def __str__(self):
# to show include all variables in sorted order
return "<{}>@0x{}:\n".format(self.get_class_name(... | mit |
zeinsteinz/tacker | tacker/tests/functional/vnfm/test_vnfm_param.py | 1 | 5503 | # Copyright 2015 Brocade Communications System, 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 ... | apache-2.0 |
mohamedhagag/dvit-odoo8 | account_financial_report_webkit/wizard/partner_balance_wizard.py | 8 | 1737 | # -*- coding: utf-8 -*-
# Author: Guewen Baconnier, Leonardo Pistone
# © 2011-2016 Camptocamp
from openerp import fields, models, api
class AccountPartnerBalanceWizard(models.TransientModel):
"""Will launch partner balance report and pass required args"""
_inherit = "account.common.balance.report"
_nam... | agpl-3.0 |
abadger/ansible | test/integration/targets/ansible-test/ansible_collections/ns/col/plugins/filter/check_pylint.py | 18 | 1239 | """
These test cases verify ansible-test version constraints for pylint and its dependencies across Python versions.
The initial test cases were discovered while testing various Python versions against ansible/ansible.
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# Python 3... | gpl-3.0 |
702nADOS/sumo | tools/contributed/sumopy/agilepy/lib_wx/test_app.py | 1 | 7648 | import os
import sys
import wx
from wx.lib.wordwrap import wordwrap
if __name__ == '__main__':
try:
APPDIR = os.path.dirname(os.path.abspath(__file__))
except:
APPDIR = os.path.dirname(os.path.abspath(sys.argv[0]))
AGILEDIR = os.path.join(APPDIR, '..')
print 'APPDIR,AGILEDIR', APPDIR,... | gpl-3.0 |
snowdream1314/scrapy | scrapy/extensions/closespider.py | 150 | 2462 | """CloseSpider is an extension that forces spiders to be closed after certain
conditions are met.
See documentation in docs/topics/extensions.rst
"""
from collections import defaultdict
from twisted.internet import reactor
from scrapy import signals
class CloseSpider(object):
def __init__(self, crawler):
... | bsd-3-clause |
offbyone/Flexget | tests/test_exists_movie.py | 12 | 7586 | from __future__ import unicode_literals, division, absolute_import
import os
from tests import FlexGetBase, build_parser_function, use_vcr
from tests.util import maketemp
class BaseExistsMovie(FlexGetBase):
__yaml__ = """
tasks:
test_dirs:
mock:
- {title: 'Existence.2... | mit |
sunzuolei/youtube-dl | youtube_dl/extractor/letv.py | 78 | 7096 | # coding: utf-8
from __future__ import unicode_literals
import datetime
import re
import time
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
determine_ext,
ExtractorError,
parse_iso8601,
int_or_n... | unlicense |
endlessm/chromium-browser | chrome/installer/mac/signing/commands.py | 2 | 3822 | # Copyright 2019 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.
"""
The commands module wraps operations that have side-effects.
"""
import os
import plistlib
import shutil
import stat
import subprocess
import tempfile
f... | bsd-3-clause |
jamesthechamp/zamboni | mkt/users/migrations/0001_initial.py | 13 | 2691 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import mkt.site.models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
... | bsd-3-clause |
infosec-au/CaptchaJackingPoC | failed_attempts/poc.py | 3 | 1494 | import requests
import cherrypy
import re
from random import choice
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtWebKit import *
class Render(QWebPage):
def __init__(self, url):
self.app = QApplication(sys.argv)
QWebPage.__init__(self)
self.loadFinished.co... | mit |
arista-eosplus/ansible | lib/ansible/modules/network/net_system.py | 13 | 3476 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... | gpl-3.0 |
fernandog/Medusa | ext/sqlalchemy/event/attr.py | 1 | 12905 | # event/attr.py
# Copyright (C) 2005-2018 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
"""Attribute implementation for _Dispatch classes.
The various listener targets for a... | gpl-3.0 |
frangucc/gamify | www/sandbox/pals/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | 217 | 5286 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | mit |
nubark/odoo | addons/fetchmail/fetchmail.py | 38 | 14937 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import poplib
import time
from imaplib import IMAP4
from imaplib import IMAP4_SSL
from poplib import POP3
from poplib import POP3_SSL
try:
import cStringIO as StringIO
except ImportError:
import St... | gpl-3.0 |
toddpalino/kafka-tools | kafka/tools/protocol/requests/describe_acls_v0.py | 1 | 1408 | # 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 |
jusjusjus/pyedf | pyedf/recording/edf_param_struct.py | 1 | 1026 | #!/usr/bin/python
import ctypes as ct
class edf_param_struct(ct.Structure): # this structure contains all the relevant EDF-signal parameters of one signal
_fields_ = [("label_b", ct.c_char*17), # label (name) of the signal, null-terminated string
("smp_in_file", ct.c_longlong), ... | gpl-3.0 |
BTCGPU/BTCGPU | test/functional/wallet_resendwallettransactions.py | 19 | 1410 | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test resendwallettransactions RPC."""
from test_framework.test_framework import BitcoinTestFramework
f... | mit |
brkrishna/freelance | bolly_reviews/process_data.py | 1 | 5263 | #-------------------------------------------------------------------------------
# Name: process_data
# Purpose:
#
# Author: Ramakrishna
#
# Created: 17/04/2014
# Copyright: (c) Ramakrishna 2014
# Licence: <your licence>
#----------------------------------------------------------------------------... | gpl-2.0 |
RoboCupULaval/StrategyIA | tests/Util/test_path.py | 1 | 2516 |
import unittest
from Util import Path, Position
__author__ = 'Simon Bouchard'
A_START = Position(100, 200)
A_TARGET = Position(123, -456)
A_PATH = Path(start=A_START, target=A_TARGET)
A_START_ARRAY = A_START.array
A_TARGET_ARRAY = A_TARGET.array
A_LIST_OF_POSITION = [Position(0, 0),
Position... | mit |
abloomston/sympy | sympy/functions/elementary/tests/test_trigonometric.py | 18 | 50521 | from sympy import (symbols, Symbol, nan, oo, zoo, I, sinh, sin, pi, atan,
acos, Rational, sqrt, asin, acot, coth, E, S, tan, tanh, cos,
cosh, atan2, exp, log, asinh, acoth, atanh, O, cancel, Matrix, re, im,
Float, Pow, gcd, sec, csc, cot, diff, simplify, Heaviside, arg,
conjugate, series... | bsd-3-clause |
madelynfreed/rlundo | venv/lib/python2.7/site-packages/IPython/nbformat/v3/nbpy.py | 28 | 7561 | """Read and write notebooks as regular .py files.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, dist... | gpl-3.0 |
aureooms/networkx | networkx/algorithms/operators/all.py | 53 | 4220 | """Operations on many graphs.
"""
# Copyright (C) 2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
try:
from itertools import izip_longest as zip_longest
except ImportError: # Python3 has zip_longest... | bsd-3-clause |
Arable/evepod | lib/python2.7/site-packages/newrelic-2.12.0.10/newrelic/samplers/data_sampler.py | 4 | 2640 | """This module implements a higher level data sampler which sits atop and
manages the consumption of data from a data source.
"""
import logging
from ..common.object_names import callable_name
_logger = logging.getLogger(__name__)
class DataSampler(object):
def __init__(self, consumer, source, name, settings,... | apache-2.0 |
tkf/neo | neo/io/micromedio.py | 1 | 5751 | # encoding: utf-8
"""
Class for reading/writing data from micromed (.trc).
Inspired by the Matlab code for EEGLAB from Rami K. Niazy.
Supported : Read
Author: sgarcia
"""
from .baseio import BaseIO
from ..core import *
from .tools import create_many_to_one_relationship
import numpy as np
import quantities as pq
... | bsd-3-clause |
pgonda/servo | tests/wpt/css-tests/css21_dev/xhtml1print/support/fonts/makegsubfonts.py | 820 | 14309 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
keen99/SickRage | lib/requests/packages/chardet/charsetprober.py | 3127 | 1902 | ######################## 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... | gpl-3.0 |
xiaozhuchacha/OpenBottle | action_earley_srv/scripts/nltk/stem/regexp.py | 7 | 1648 | # Natural Language Toolkit: Stemmers
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import unicode_literals
i... | mit |
ThinkingBridge/platform_external_chromium_org | chrome/test/functional/chromeos_login.py | 29 | 13674 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
import pyauto_functional # Must be imported before pyauto
import pyauto
import pyauto_erro... | bsd-3-clause |
tzewangdorje/SIPserv | Twisted-13.1.0/twisted/internet/test/test_inotify.py | 42 | 16494 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the inotify wrapper in L{twisted.internet.inotify}.
"""
from twisted.internet import defer, reactor
from twisted.python import filepath, runtime
from twisted.trial import unittest
try:
from twisted.python import _inotify
except... | gpl-3.0 |
martinbuc/missionplanner | packages/IronPython.StdLib.2.7.4/content/Lib/py_compile.py | 53 | 6100 | """Routine to "compile" a .py file to a .pyc (or .pyo) file.
This module has intimate knowledge of the format of .pyc files.
"""
import __builtin__
import imp
import marshal
import os
import sys
import traceback
MAGIC = imp.get_magic()
__all__ = ["compile", "main", "PyCompileError"]
class PyCompi... | gpl-3.0 |
alviano/aspino | tests/sat/Models/c415.100.UNSAT.dimacs.test.py | 5 | 5236 | input = """
c num blocks = 1
c num vars = 100
c minblockids[0] = 1
c maxblockids[0] = 100
p cnf 100 415
-71 -62 -94 0
-33 -74 93 0
16 -58 -2 0
-65 -69 56 0
12 -46 -68 0
6 14 7 0
-39 -31 -87 0
-47 -71 75 0
11 -85 -8 0
-49 -64 63 0
-8 -1 15 0
-21 -60 -40 0
-68 -71 -85 0
-68 49 -55 0
51 17 -40 0
-51 -82 -59 0
-53 45 -41 0... | apache-2.0 |
listyque/TACTIC-Handler | thlib/side/natsort/utils.py | 1 | 15239 | # -*- coding: utf-8 -*-
"""
Utilities and definitions for natsort, mostly all used to define
the _natsort_key function.
"""
from __future__ import (
print_function,
division,
unicode_literals,
absolute_import
)
# Std. lib imports.
import re
from math import isnan
from warnings import warn
from os impor... | epl-1.0 |
ngokevin/zamboni | mkt/developers/api_payments.py | 1 | 11477 | from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
import commonware
from curling.lib import HttpClientError, HttpServerError
from rest_framework import status
from rest_framework.mixins import (CreateModelMixin, DestroyModelMixin,
ListMo... | bsd-3-clause |
bright-sparks/titanium_mobile | support/android/builder.py | 30 | 97623 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Appcelerator Titanium Mobile
# Copyright (c) 2011-2012 by Appcelerator, Inc. All Rights Reserved.
# Licensed under the terms of the Apache Public License
# Please see the LICENSE included with this distribution for details.
#
# General builder script for staging, packag... | apache-2.0 |
deeplearning4j/libnd4j | tests_cpu/lib/googletest-release-1.8.0/googlemock/scripts/fuse_gmock_files.py | 242 | 8631 | #!/usr/bin/env python
#
# Copyright 2009, 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... | apache-2.0 |
pschmitt/home-assistant | tests/components/openerz/test_sensor.py | 13 | 1108 | """Tests for OpenERZ component."""
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.setup import async_setup_component
from tests.async_mock import MagicMock, patch
MOCK_CONFIG = {
"sensor": {
"platform": "openerz",
"name": "test_name",
"zip": 1234,
... | apache-2.0 |
75651/kbengine_cloud | kbe/res/scripts/common/Lib/xml/dom/expatbuilder.py | 91 | 35755 | """Facility to use the Expat parser to load a minidom instance
from a string or file.
This avoids all the overhead of SAX and pulldom to gain performance.
"""
# Warning!
#
# This module is tightly bound to the implementation details of the
# minidom DOM and can't be used with other DOM implementations. This
# is due... | lgpl-3.0 |
stefanaspect/browserresearch | cookietesting.py | 2 | 1175 | #!/usr/bin/env python
""" A simple web server to test how IE deals with cookie paths.
Usage:
`python cookietesting.py`
and then, from within your browser go to: http://localhost:8082/gateway
and the other URLs.
"""
from bottle import route, run, response, request
tmpl = None
@route('/gateway')
def ... | isc |
mitchsmith/qd_screener | questionnaire/admin.py | 1 | 7839 | from django.contrib import admin
from django.forms import ModelChoiceField, ModelForm, Textarea
from questionnaire.models import *
from django.core.exceptions import ValidationError
from django.forms.models import BaseInlineFormSet
from questionnaire import admin_helper
############################################### ... | mit |
mattnenterprise/servo | tests/wpt/web-platform-tests/css/tools/travis/vcs.py | 46 | 1115 | import subprocess
import sys
from functools import partial
def vcs(bin_name):
def inner(command, *args, **kwargs):
repo = kwargs.pop("repo", None)
log_error = kwargs.pop("log_error", True)
quiet = kwargs.pop("quiet", False)
if kwargs:
raise TypeError, kwargs
arg... | mpl-2.0 |
DanteOnline/free-art | venv/lib/python3.4/site-packages/pip/_vendor/progress/bar.py | 510 | 2685 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software 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 P... | gpl-3.0 |
mcenirm/sorl-thumbnail | sorl/thumbnail/management/commands/thumbnail.py | 15 | 2272 | # encoding=utf-8
from __future__ import unicode_literals, print_function
import sys
from django.core.management.base import LabelCommand, CommandError
from sorl.thumbnail import default
from sorl.thumbnail.images import delete_all_thumbnails
class Command(LabelCommand):
help = (
'Handles thumbnails an... | bsd-3-clause |
mtrgroup/django-mtr-utils | tests/app/settings.py | 1 | 3204 | import os
import django
# placeholder for gettext
def _(s):
return s
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 'j#zwt2c!*(7(jz!m(tr$+jq^1d(+)e(^059f^nd_(*zj!gv0x)'
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = (
'modeltranslation',
'django.contr... | mit |
stefanseefeld/numba | numba/typing/setdecl.py | 2 | 5933 | from __future__ import absolute_import, print_function
from .. import types
from .templates import (ConcreteTemplate, AbstractTemplate, AttributeTemplate,
CallableTemplate, Registry, signature, bound_function,
make_callable_template)
# Ensure set is typed as a collectio... | bsd-2-clause |
lsk112233/Clone-test-repo | events/search_indexes.py | 14 | 2169 | from django.template.defaultfilters import truncatewords_html, striptags
from haystack import indexes
from .models import Event, Calendar
class CalendarIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
name = indexes.CharField(model_attr='name')
de... | apache-2.0 |
huangkuan/hack | lib/oauth2client/contrib/devshell.py | 27 | 5011 | # 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 by applicable law or ... | apache-2.0 |
hamzehd/edx-platform | openedx/core/djangoapps/course_groups/management/commands/post_cohort_membership_fix.py | 18 | 3740 | """
Intended to fix any inconsistencies that may arise during the rollout of the CohortMembership model.
Illustration: https://gist.github.com/efischer19/d62f8ee42b7fbfbc6c9a
"""
from django.core.management.base import BaseCommand
from django.db import IntegrityError
from openedx.core.djangoapps.course_groups.models i... | agpl-3.0 |
USGSDenverPychron/pychron | pychron/hardware/actuators/iactuator.py | 1 | 1276 | # ===============================================================================
# Copyright 2014 Jake Ross
#
# 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/licens... | apache-2.0 |
fatihzkaratana/AutobahnPython | autobahn/autobahn/pbkdf2.py | 18 | 4869 | # -*- coding: utf-8 -*-
"""
pbkdf2
~~~~~~
This module implements pbkdf2 for Python. It also has some basic
tests that ensure that it works. The implementation is straightforward
and uses stdlib only stuff and can be easily be copy/pasted into
your favourite application.
Use this as repla... | apache-2.0 |
sestrella/ansible | lib/ansible/modules/cloud/amazon/aws_inspector_target.py | 7 | 7966 | #!/usr/bin/python
# Copyright (c) 2018 Dennis Conrad for Sainsbury's
# 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',
'... | gpl-3.0 |
ojengwa/sympy | sympy/functions/special/tests/test_bsplines.py | 27 | 3059 | from sympy.functions import bspline_basis, bspline_basis_set
from sympy import Piecewise, Interval
from sympy import symbols, Rational
x, y = symbols('x,y')
def test_basic_degree_0():
d = 0
knots = range(5)
splines = bspline_basis_set(d, knots, x)
for i in range(len(splines)):
assert splines[... | bsd-3-clause |
MaxWayne/Beginning-Game-Development-with-Python-and-Pygame | Chapter 10/10-4.py | 6 | 4150 | import pygame
from pygame.locals import *
from random import randint
from gameobjects.vector2 import Vector2
SCREEN_SIZE = (640, 480)
# In pixels per second, per second
GRAVITY = 250.0
# Increase for more bounciness, but don't go over 1!
BOUNCINESS = 0.7
def stero_pan(x_coord, screen_width):
right_volume = floa... | mit |
ms-iot/python | cpython/Lib/smtplib.py | 3 | 42361 | #! /usr/bin/env python3
'''SMTP/ESMTP client class.
This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).
Notes:
Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the R... | bsd-3-clause |
projectbuendia/server-status | libraries/Adafruit_Python_GPIO/Adafruit_GPIO/PCF8574.py | 15 | 3412 | '''
Adafruit compatible using BaseGPIO class to represent a PCF8574/A IO expander
Copyright (C) 2015 Sylvan Butler
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 wi... | apache-2.0 |
aravindk1992/Data-Structure-Zoo | 1-Algorithm Analysis/algorithms.py | 6 | 2193 | """ 2: Algorithms
thomas moll 2015
"""
import time, random
def find_sequentially(arr, item):
""" Sequential Search
Complexity: O(n)
"""
for value, i in enumerate(arr):
# Check each item in the list
if item == value: #Runs N number of times
... | mit |
htcondor/htcondor | src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/sendAll.py | 10 | 1950 | #! /usr/bin/python
#
# Starts a Skype File Transfer.
# The open file dialog is set to the current directory.
# The users to send to are searched through their Skype name and their
# full name (display name actually).
#
# Requires at least Skype 2.0.0.27.
#
# (c) Copyright 2007, Vincent Oberle, vincent@oberle.org
#
# Th... | apache-2.0 |
commtrack/temp-aquatest | reportlab/graphics/charts/lineplots.py | 1 | 46569 | #Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/lineplots.py
__version__=''' $Id: lineplots.py 3631 2010-01-13 10:54:24Z meitham $ '''
__doc__="""This module defines a very prel... | bsd-3-clause |
ddico/odoomrp-wip | mrp_bom_sale_pack/models/mrp_bom_sale_pack.py | 16 | 4558 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api, _
class MrpBomS... | agpl-3.0 |
OshynSong/scikit-learn | sklearn/utils/tests/test_fixes.py | 281 | 1829 | # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Justin Vincent
# Lars Buitinck
# License: BSD 3 clause
import numpy as np
from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_true
from numpy.testing import (assert_almost_equal,
... | bsd-3-clause |
TinajaLabs/tinajagate | downloads/pyserial-2.5/serial/rfc2217.py | 10 | 58059 | #! python
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# see __init__.py
#
# This module implements a RFC2217 compatible client. RF2217 descibes a
# protocol to access serial ports over TCP/IP and allows setting the baud rate,
# modem control lines etc.
#
# (C) 2001-2009 Chris Liechti <cliechti@gmx.ne... | mit |
pinterb/st2 | contrib/packs/actions/pack_mgmt/delete.py | 2 | 1549 | import os
import shutil
from oslo.config import cfg
from st2actions.runners.pythonrunner import Action
from st2common.constants.pack import SYSTEM_PACK_NAMES
from st2common.util.shell import quote_unix
BLOCKED_PACKS = frozenset(SYSTEM_PACK_NAMES)
class UninstallPackAction(Action):
def __init__(self, config=Non... | apache-2.0 |
dhalleine/tensorflow | tensorflow/tools/docs/gen_cc_md.py | 5 | 8299 | # 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 |
ctuning/ck-env | package/imagenet-2012-val-lmdb-256/custom.py | 5 | 5860 | #!/usr/bin/python
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
import sys
import json
##############################################################################
# customize installation
def pre_path(i):
"""
Input: {
cfg - meta of th... | bsd-3-clause |
wistoch/meego-app-browser | tools/grit/grit/shortcuts_unittests.py | 7 | 3061 | #!/usr/bin/python2.4
# Copyright (c) 2006-2008 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 grit.shortcuts
'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.di... | bsd-3-clause |
dhenyjarasandy/scrapy | tests/test_http_cookies.py | 38 | 2178 | from six.moves.urllib.parse import urlparse
from unittest import TestCase
from scrapy.http import Request, Response
from scrapy.http.cookies import WrappedRequest, WrappedResponse
class WrappedRequestTest(TestCase):
def setUp(self):
self.request = Request("http://www.example.com/page.html", \
... | bsd-3-clause |
leeon/annotated-django | django/contrib/gis/db/backends/oracle/models.py | 6 | 2204 | """
The GeometryColumns and SpatialRefSys models for the Oracle spatial
backend.
It should be noted that Oracle Spatial does not have database tables
named according to the OGC standard, so the closest analogs are used.
For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns
model and the `SDO_... | bsd-3-clause |
joelpinheiro/safebox-smartcard-auth | Server/veserver/lib/python2.7/site-packages/cherrypy/test/test_httpauth.py | 17 | 6334 | import cherrypy
from cherrypy._cpcompat import md5, sha, ntob
from cherrypy.lib import httpauth
from cherrypy.test import helper
class HTTPAuthTest(helper.CPWebCase):
def setup_server():
class Root:
def index(self):
return "This is public."
index.exposed = True
... | gpl-2.0 |
glennyonemitsu/MarkupHiveSDK | flask/module.py | 850 | 1363 | # -*- coding: utf-8 -*-
"""
flask.module
~~~~~~~~~~~~
Implements a class that represents module blueprints.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
from .blueprints import Blueprint
def blueprint_is_module(bp):
"""Used to figure ou... | mit |
CasparLi/calibre | src/calibre/ebooks/pdf/render/serialize.py | 13 | 18336 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | gpl-3.0 |
dmitry-sobolev/ansible | lib/ansible/plugins/strategy/__init__.py | 13 | 44724 | # (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 |
Thor77/youtube-dl | youtube_dl/extractor/streetvoice.py | 23 | 1614 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import unified_strdate
class StreetVoiceIE(InfoExtractor):
_VALID_URL = r'https?://(?:.+?\.)?streetvoice\.com/[^/]+/songs/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'http://s... | unlicense |
mdanielwork/intellij-community | python/lib/Lib/site-packages/django/utils/_os.py | 71 | 2011 | import os
from os.path import join, normcase, normpath, abspath, isabs, sep
from django.utils.encoding import force_unicode
# Define our own abspath function that can handle joining
# unicode paths to a current working directory that has non-ASCII
# characters in it. This isn't necessary on Windows since the
# Wind... | apache-2.0 |
kevclarx/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_nacl_facts.py | 10 | 6644 | #!/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 distributed... | gpl-3.0 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/sympy/physics/tests/test_qho_1d.py | 28 | 1172 | from sympy import exp, integrate, oo, Rational, pi, S, simplify, sqrt
from sympy.abc import omega, m, x
from sympy.physics.qho_1d import psi_n, E_n
from sympy.physics.quantum.constants import hbar
nu = m * omega / hbar
def test_wavefunction():
Psi = {
0: (nu/pi)**(S(1)/4) * exp(-nu * x**2 /2),
1:... | mit |
Telestream/telestream-cloud-python-sdk | telestream_cloud_qc_sdk/test/test_container_type.py | 1 | 1326 | # coding: utf-8
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import telestream_cloud_qc
from telestream_cl... | mit |
daniel-j/lutris | lutris/services/service_game.py | 1 | 1672 | """Communicates between third party services games and Lutris games"""
from lutris import pga
class ServiceGame:
"""Representation of a game from a 3rd party service"""
store = NotImplemented
installer_slug = NotImplemented
def __init__(self):
self.appid = None # External ID of the game on t... | gpl-3.0 |
credativUK/OCB | addons/account/project/project.py | 38 | 2477 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
Mindwerks/worldengine | worldengine/drawing_functions.py | 2 | 18176 | """
This file should contain only functions that operates on pixels, not on images,
so no references to PIL are necessary and the module can be used also through
Jython
"""
import numpy
import sys
import time
from worldengine.common import get_verbose, count_neighbours
from worldengine.common import anti_alias as anti... | mit |
kazemakase/scikit-learn | sklearn/feature_extraction/hashing.py | 183 | 6155 | # Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# License: BSD 3 clause
import numbers
import numpy as np
import scipy.sparse as sp
from . import _hashing
from ..base import BaseEstimator, TransformerMixin
def _iteritems(d):
"""Like d.iteritems, but accepts any collections.Mapping."""
return d.iteritems() if... | bsd-3-clause |
nginx/unit | test/test_asgi_websockets.py | 1 | 44158 | import struct
import time
from distutils.version import LooseVersion
import pytest
from unit.applications.lang.python import TestApplicationPython
from unit.applications.websockets import TestApplicationWebsocket
from unit.option import option
class TestASGIWebsockets(TestApplicationPython):
prerequisites = {
... | apache-2.0 |
OpenPTV/postptv | flowtracks/scene.py | 1 | 17778 | # -*- coding: utf-8 -*-
#Created on Sun Aug 10 11:28:42 2014
#
# Private references:
# [1] https://docs.python.org/2/library/itertools.html
"""
A module for manipulating PTV analyses saved as HDF5 files in the flowtracks
format. Allows reading the data by iterating over frames or over trajectories.
Main design goals:... | gpl-3.0 |
espadrine/opera | chromium/src/third_party/trace-viewer/third_party/closure_linter/closure_linter/full_test.py | 135 | 3464 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | bsd-3-clause |
nathanielvarona/airflow | airflow/sensors/s3_prefix_sensor.py | 1 | 1173 | #
# 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... | apache-2.0 |
crossbario/crossbarexamples | database/postgresql/caller/adder/__init__.py | 3 | 3892 | ###############################################################################
##
## Copyright (C) 2015, Tavendo GmbH and/or collaborators. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
##
... | apache-2.0 |
aflaxman/scikit-learn | examples/linear_model/plot_bayesian_ridge.py | 33 | 3875 | """
=========================
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 |
Peetz0r/micropython-esp32 | tests/basics/exceptpoly.py | 63 | 1769 | try:
raise ArithmeticError
except Exception:
print("Caught ArithmeticError via Exception")
try:
raise ArithmeticError
except ArithmeticError:
print("Caught ArithmeticError")
try:
raise AssertionError
except Exception:
print("Caught AssertionError via Exception")
try:
raise AssertionError
... | mit |
egelmex/ajenti | ajenti/daemon.py | 8 | 3705 | import sys
import os
import time
import atexit
from signal import SIGTERM
class Daemon:
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
"""
def __init__(self, pidfile, stdin='/dev/null',
stdout='/dev/null', stderr='/dev/null'):
... | lgpl-3.0 |
pivanof/vitess | test/cluster/vtctl_helper.py | 12 | 3923 | # Copyright 2017 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 or agreed to in writin... | apache-2.0 |
vdel/CoMFoRT | src/modules/themodule_Coord.py | 2 | 19824 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# CoMFoRT: a COntent Management system FOr Researchers and Teachers!
#
# Copyright (C) 2008 Projet2-L3IF ENS Lyon.
#
# Contributors:
# * Jean-Alexandre Angles d'Auriac
# * Gabriel Beaulieu
# * Valentin Blot
# * Pierre Boutillier
# * Nicolas Brunie
# * Aloï... | gpl-3.0 |
cekk/fantacalcio-react | fantacalcio/public/views.py | 1 | 7080 | # -*- coding: utf-8 -*-
'''Public section, including homepage and signup.'''
from flask import (Blueprint, request, render_template, flash, url_for,
redirect, session, make_response, jsonify, current_app)
from flask.ext.login import login_user, login_required, logout_user
from fantacalcio.extensions... | bsd-3-clause |
dheesbeen/Mage2Gen | mage2gen/snippets/plugin.py | 1 | 4340 | # A Magento 2 module generator library
# Copyright (C) 2016 Derrick Heesbeen
# Copyright (C) 2016 Maikel Martens Changed add API and refactor code
#
# This file is part of Mage2Gen.
#
# Mage2Gen is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... | gpl-3.0 |
xiaoyuanW/gem5 | src/mem/slicc/ast/StatementAST.py | 92 | 1756 | # Copyright (c) 2009 The Hewlett-Packard Development Company
# 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... | bsd-3-clause |
rwatson/chromium-capsicum | third_party/scons/scons-local/SCons/Tool/packaging/targz.py | 3 | 1683 | """SCons.Tool.Packaging.targz
The targz SRC packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in t... | bsd-3-clause |
Zhongqilong/kbengine | kbe/src/lib/python/Tools/scripts/fixdiv.py | 94 | 13938 | #! /usr/bin/env python3
"""fixdiv - tool to fix division operators.
To use this tool, first run `python -Qwarnall yourscript.py 2>warnings'.
This runs the script `yourscript.py' while writing warning messages
about all uses of the classic division operator to the file
`warnings'. The warnings look like this:
<fil... | lgpl-3.0 |
sendgrid/sendgrid-python | setup.py | 1 | 1257 | import io
import os
from distutils.file_util import copy_file
from setuptools import setup, find_packages
__version__ = None
with open('sendgrid/version.py') as f:
exec(f.read())
def getRequires():
deps = [
'python_http_client>=3.2.1',
'starkbank-ecdsa>=1.0.0'
]
return deps
dir_path... | mit |
MSEMJEJME/Get-Dumped | renpy/audio/__init__.py | 1 | 1154 | # Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
#
# 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, m... | gpl-2.0 |
twc-openstack/jenkins-job-builder | jenkins_jobs/config.py | 2 | 13153 | #!/usr/bin/env python
# Copyright (C) 2015 Wayne Warren
#
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.