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
slaporte/qualityvis
orange_scripts/factor_analysis_derp.py
1
1472
from data_utils import cast_table from mdp.nodes import FANode from Orange.data import Table, Domain import Orange fa_node = FANode(max_cycles=500, verbose=True) dom_data = cast_table(in_data, attr_selector='d_') dom_stats = Orange.statistics.basic.Domain(dom_data) new_attrs = [] for attr in dom_data.domain.features:...
gpl-3.0
liamgh/liamgreenhughes-sl4a-tf101
python-build/python-libs/xmpppy/xmpp/roster.py
203
9163
## roster.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later version. ...
apache-2.0
yuzhu/mysql-server
storage/ndb/mcc/request_handler.py
31
23297
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. # # 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; version 2 of the License. # # This program is distributed in the ...
gpl-2.0
MakeHer/edx-platform
openedx/core/djangoapps/user_api/tests/test_partition_schemes.py
72
5606
""" Test the user api's partition extensions. """ from collections import defaultdict from mock import patch from unittest import TestCase from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme, UserPartitionError from student.tests.factories import UserFactory from xmodule.partitions...
agpl-3.0
dneg/cortex
test/IECore/ClassVectorParameterTest.py
12
13112
########################################################################## # # Copyright (c) 2010, Image Engine Design 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: # # * Redistribu...
bsd-3-clause
abaditsegay/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/ctypes/test/test_pickling.py
48
2062
import unittest import pickle from ctypes import * import _ctypes_test dll = CDLL(_ctypes_test.__file__) class X(Structure): _fields_ = [("a", c_int), ("b", c_double)] init_called = 0 def __init__(self, *args, **kw): X.init_called += 1 self.x = 42 class Y(X): _fields_ = [("str", c_char...
apache-2.0
ghedsouza/django
django/db/migrations/operations/fields.py
18
12979
from django.db.models.fields import NOT_PROVIDED from django.utils.functional import cached_property from .base import Operation class FieldOperation(Operation): def __init__(self, model_name, name): self.model_name = model_name self.name = name @cached_property def model_name_lower(self...
bsd-3-clause
Nihn/Diamond-1
src/collectors/puppetdashboard/puppetdashboard.py
62
1698
# coding=utf-8 """ Collect metrics from Puppet Dashboard #### Dependencies * urllib2 """ import urllib2 import re import diamond.collector class PuppetDashboardCollector(diamond.collector.Collector): def get_default_config_help(self): config_help = super(PuppetDashboardCollector, ...
mit
yawnosnorous/python-for-android
python3-alpha/python3-src/Lib/test/test_structmembers.py
88
4796
from _testcapi import _test_structmembersType, \ CHAR_MAX, CHAR_MIN, UCHAR_MAX, \ SHRT_MAX, SHRT_MIN, USHRT_MAX, \ INT_MAX, INT_MIN, UINT_MAX, \ LONG_MAX, LONG_MIN, ULONG_MAX, \ LLONG_MAX, LLONG_MIN, ULLONG_MAX, \ PY_SSIZE_T_MAX, PY_SSIZE_T_MIN import unittest from test import support ts=_test...
apache-2.0
EmmanuelJohnson/ssquiz
flask/lib/python2.7/site-packages/werkzeug/debug/__init__.py
280
7800
# -*- coding: utf-8 -*- """ werkzeug.debug ~~~~~~~~~~~~~~ WSGI application traceback debugger. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import json import mimetypes from os.path import join, dirname, basename, isfile ...
bsd-3-clause
goliveirab/odoo
addons/account/account_analytic_line.py
304
7914
# -*- 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
zhjunlang/kbengine
kbe/res/scripts/common/Lib/tkinter/commondialog.py
153
1412
# base class for tk common dialogues # # this module provides a base class for accessing the common # dialogues available in Tk 4.2 and newer. use filedialog, # colorchooser, and messagebox to access the individual # dialogs. # # written by Fredrik Lundh, May 1997 # from tkinter import * class Dialog: command ...
lgpl-3.0
ataylor32/django
django/contrib/contenttypes/management.py
476
2521
from django.apps import apps from django.db import DEFAULT_DB_ALIAS, router from django.utils import six from django.utils.six.moves import input def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT_DB_ALIAS, **kwargs): """ Creates content types for models in the given app, removin...
bsd-3-clause
mikeckennedy/asq
asq/test/test_zip.py
5
2182
import unittest from asq.queryables import Queryable from asq.test.test_queryable import TracingGenerator, infinite __author__ = "Robert Smallshire" class TestZip(unittest.TestCase): def test_zip(self): a = [1, 2, 3] b = [4, 5, 6] c = Queryable(a).zip(b).to_list() self.assertEqual...
mit
slohse/ansible
lib/ansible/modules/cloud/vultr/vultr_startup_script_facts.py
27
3440
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2018, Yanis Guenane <yanis+ansible@guenane.org> # 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':...
gpl-3.0
mekkablue/Glyphs-Scripts
Hinting/Transfer Hints to First Master.py
1
3444
#MenuTitle: Transfer Hints to First Master # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Moves PostScript (stem and ghost) hints from the current layer to the first master layer, provided the paths are compatible. """ from GlyphsApp import TOPGHOST, BOTTOMGHOST, ...
apache-2.0
jehine-MSFT/azure-storage-python
tests/test_get_blob.py
1
19096
# coding: utf-8 #------------------------------------------------------------------------- # Copyright (c) Microsoft. 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 #...
apache-2.0
jicruz/heroku-bot
lib/youtube_dl/extractor/moviezine.py
64
1400
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class MoviezineIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?moviezine\.se/video/(?P<id>[^?#]+)' _TEST = { 'url': 'http://www.moviezine.se/video/205866', 'info_dict': { 'id...
gpl-3.0
dannykopping/mysql-utilities
mysql/utilities/command/dbexport.py
1
26361
# # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. # # 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; version 2 of the License. # # This program is distributed in th...
gpl-2.0
horance-liu/tensorflow
tensorflow/python/debug/lib/session_debug_file_test.py
20
5464
# 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
DXCanas/content-curation
contentcuration/contentcuration/tests/test_rest_framework.py
1
5835
from __future__ import absolute_import import json import pytest from django.core.urlresolvers import reverse_lazy from le_utils.constants import content_kinds from le_utils.constants import exercises from .base import BaseAPITestCase from contentcuration.models import AssessmentItem from contentcuration.models impo...
mit
SerCeMan/intellij-community
python/helpers/pydev/pydevd_import_class.py
57
1833
#Note: code gotten from _pydev_imports_tipper. import sys def _imp(name, log=None): try: return __import__(name) except: if '.' in name: sub = name[0:name.rfind('.')] if log is not None: log.AddContent('Unable to import', name, 'trying with'...
apache-2.0
dd00/commandergenius
project/jni/python/src/Demo/tix/samples/PopMenu.py
37
2151
# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- # # $Id: PopMenu.py 36560 2004-07-18 06:16:08Z tim_one $ # # Tix Demostration Program # # This sample program is structured in such a way so that it can be # executed from the Tix demo program "tixwidgets.py": it must have a # procedur...
lgpl-2.1
nvoron23/hue
apps/pig/src/pig/tests.py
5
17259
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
mancoast/CPythonPyc_test
cpython/251_test_float.py
3
4490
import unittest, struct from test import test_support class FormatFunctionsTestCase(unittest.TestCase): def setUp(self): self.save_formats = {'double':float.__getformat__('double'), 'float':float.__getformat__('float')} def tearDown(self): float.__setformat__('do...
gpl-3.0
jaingaurav/ansible
lib/ansible/plugins/connections/jail.py
131
7291
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # (c) 2013, Michael Scherer <misc@zarb.org> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it...
gpl-3.0
liosha2007/temporary-groupdocs-python-sdk
groupdocs/models/GetImageUrlsResponse.py
1
1154
#!/usr/bin/env python """ Copyright 2012 GroupDocs. 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
GaetanCambier/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/myspass.py
40
2670
from __future__ import unicode_literals import os.path from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlparse, ) from ..utils import ( ExtractorError, ) class MySpassIE(InfoExtractor): _VALID_URL = r'http://www\.myspass\.de/.*' _TEST = { 'url': 'http://www.myspa...
gpl-3.0
foursquare/commons-old
src/python/twitter/pants/tasks/console_task.py
2
1777
# ================================================================================================== # Copyright 2012 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
stratosk/samsung-kernel-aries
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
stevehof/location-ninja
lib/sqlalchemy/ext/declarative/api.py
23
17787
# ext/declarative/api.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Public API functions and helpers for declarative.""" from ...schema impor...
gpl-3.0
ZhangXinNan/tensorflow
tensorflow/python/training/session_manager.py
5
21240
# 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
tjanez/ansible
lib/ansible/modules/files/unarchive.py
10
34709
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2013, Dylan Martin <dmartin@seattlecentral.edu> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # (c) 2016, Dag Wieers <dag@wieers.com> # # This file is part of Ansible # # Ansible is free software: you can redist...
gpl-3.0
ononeor12/python-social-auth
social/backends/bitbucket.py
53
3679
""" Bitbucket OAuth2 and OAuth1 backends, docs at: http://psa.matiasaguirre.net/docs/backends/bitbucket.html """ from social.exceptions import AuthForbidden from social.backends.oauth import BaseOAuth1, BaseOAuth2 class BitbucketOAuthBase(object): ID_KEY = 'uuid' def get_user_id(self, details, response):...
bsd-3-clause
openvstorage/arakoon
src/client/python/ArakoonExceptions.py
5
4396
""" Copyright (2010-2014) INCUBAID BVBA 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
shishkander/recipes-py
recipe_engine/third_party/google/protobuf/internal/type_checkers.py
527
12163
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
BenzoPlayer/kernel_asus_fugu
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
ddamiani/pyqtgraph
examples/GLVolumeItem.py
28
1968
# -*- coding: utf-8 -*- """ Demonstrates GLVolumeItem for displaying volumetric data. """ ## Add path to library (just for examples; you do not need this) import initExample from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph.opengl as gl app = QtGui.QApplication([]) w = gl.GLViewWidget() w.opts['distance'] = 2...
mit
atsuyim/theHarvester
discovery/DNS/Base.py
23
11674
""" $Id: Base.py,v 1.12.2.4 2007/05/22 20:28:31 customdesigned Exp $ This file is part of the pydns project. Homepage: http://pydns.sourceforge.net This code is covered by the standard Python License. Base functionality. Request and Response classes, that sort of thing. """ import socket import string import ty...
gpl-2.0
mcgachey/edx-platform
lms/envs/bok_choy.py
11
6630
""" Settings for Bok Choy tests that are used when running LMS. Bok Choy uses two different settings files: 1. test_static_optimized is used when invoking collectstatic 2. bok_choy is used when running the tests Note: it isn't possible to have a single settings file, because Django doesn't support both generating sta...
agpl-3.0
ukanga/SickRage
sickbeard/providers/archetorrent.py
3
7624
# coding=utf-8 # Author: ellmout <ellmout@ellmout.net> # Inspired from : adaur <adaur.underground@gmail.com> (ABNormal) # # URL: https://sickrage.github.io # # 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 pu...
gpl-3.0
GNOME/istanbul
istanbul/main/main.py
1
3151
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # # Istanbul - A desktop recorder # Copyright (C) 2005 Zaheer Abbas Merali (zaheerabbas at merali dot org) # Portions Copyright (C) 2004,2005 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the...
gpl-2.0
gandarez/wakatime
wakatime/packages/pygments_py2/pygments/lexers/dylan.py
72
10421
# -*- coding: utf-8 -*- """ pygments.lexers.dylan ~~~~~~~~~~~~~~~~~~~~~ Lexers for the Dylan language. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, bygroups, do_insertions, d...
bsd-3-clause
gautam1858/tensorflow
tensorflow/contrib/ignite/python/ops/igfs_op_loader.py
15
1057
# Copyright 2018 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
jschovan/ACSIS
acsis/acsisweb/services/serializers.py
1
1063
from django.db import models from rest_framework import serializers from .models import Service class ServiceSerializer(serializers.ModelSerializer): class Meta: model = Service compulsory_fields = ['service'] fields = ('service', 'contacts', 'description', 'parents', 'doccard', \ '...
apache-2.0
vorvor/lattam
sites/all/modules/proj4js/lib/proj4js/tools/mergejs.py
161
7973
#!/usr/bin/env python # # Merge multiple JavaScript source code files into one. # # Usage: # This script requires source files to have dependencies specified in them. # # Dependencies are specified with a comment of the form: # # // @requires <file path> # # e.g. # # // @requires Geo/DataSource.js # # or (idea...
gpl-2.0
ademmers/ansible
lib/ansible/executor/interpreter_discovery.py
25
9872
# Copyright: (c) 2018 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 import bisect import json import pkgutil import re from ansible import constants as C from ansible...
gpl-3.0
benschmaus/catapult
third_party/gsutil/third_party/boto/boto/vpc/internetgateway.py
170
2585
# Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.org/ # # 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, modi...
bsd-3-clause
grnet/synnefo
snf-astakos-app/astakos/im/tests/management/user_activation_send.py
10
2091
# Copyright (C) 2010-2014 GRNET S.A. # # 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 i...
gpl-3.0
mathematician/terraform
vendor/github.com/ugorji/go/codec/test.py
1516
4019
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
mpl-2.0
kwailamchan/programming-languages
javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/core/servers/basehttp.py
76
8894
""" HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21). Based on wsgiref.simple_server which is part of the standard library since 2.5. This is a simple server for use in testing or debugging Django apps. It hasn't been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE! """ import o...
mit
pllim/ginga
ginga/rv/plugins/Histogram.py
3
24097
# This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. """ ``Histogram`` plots a histogram for a region drawn in the image, or for the entire image. **Plugin Type: Local** ``Histogram`` is a local plugin, which means it is associated with a channel. An instance can...
bsd-3-clause
yxl/emscripten-calligra-mobile
3rdparty/google-breakpad/src/tools/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py
180
1272
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure paths are normalized with VS macros properly expanded on Windows. """ import TestGyp import sys if sys.platform == 'win32':...
gpl-2.0
cfg2015/EPT-2015-2
addons/account_anglo_saxon/invoice.py
85
13420
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) # 2004-2010 Tiny SPRL (<http://tiny.be>). # 2009-2010 Veritos (http://veritos.nl). # All Rights Reserved # # This program is free software: you can redistri...
agpl-3.0
infra-structure/pinball
pinball/workflow/inspector.py
6
4929
# Copyright 2015, Pinterest, 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 writ...
apache-2.0
cindyyu/kuma
vendor/packages/translate/storage/ts2.py
23
17838
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2011 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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; e...
mpl-2.0
g-vidal/upm
examples/python/mpu9250.py
6
2718
#!/usr/bin/env python # Author: Jon Trulson <jtrulson@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 # witho...
mit
gitprouser/appengine-bottle-skeleton
lib/simplejson/tests/test_iterable.py
57
1390
import unittest from simplejson.compat import StringIO import simplejson as json def iter_dumps(obj, **kw): return ''.join(json.JSONEncoder(**kw).iterencode(obj)) def sio_dump(obj, **kw): sio = StringIO() json.dumps(obj, **kw) return sio.getvalue() class TestIterable(unittest.TestCase): def test...
apache-2.0
bitprophet/etcaetera
docs/conf.py
2
8457
#!/usr/bin/env python # -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # au...
mit
davidfraser/sqlalchemy
lib/sqlalchemy/testing/config.py
58
2469
# testing/config.py # Copyright (C) 2005-2015 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 import collections requirements = None db = None db_url = None db_opts = None fil...
mit
xuanhan863/zulip
zerver/lib/rate_limiter.py
115
7145
from __future__ import absolute_import from django.conf import settings from zerver.lib.redis_utils import get_redis_client import redis import time import logging from itertools import izip # Implement a rate-limiting scheme inspired by the one described here, but heavily modified # http://blog.domaintools.com/201...
apache-2.0
gylian/sickrage
lib/guessit/transfo/guess_episode_info_from_position.py
21
6169
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free...
gpl-3.0
xkcd1253/Mimi
flask/lib/python2.7/site-packages/jinja2/visitor.py
1401
3316
# -*- coding: utf-8 -*- """ jinja2.visitor ~~~~~~~~~~~~~~ This module implements a visitor for the nodes. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from jinja2.nodes import Node class NodeVisitor(object): """Walks the abstract syntax tree and call visitor functions for every...
gpl-2.0
7shurik/phoenix
bin/phoenix_sandbox.py
13
2116
#!/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 A...
apache-2.0
ironbox360/django
django/core/management/commands/startproject.py
503
1359
from importlib import import_module from django.core.management.base import CommandError from django.core.management.templates import TemplateCommand from django.utils.crypto import get_random_string class Command(TemplateCommand): help = ("Creates a Django project directory structure for the given " ...
bsd-3-clause
asacamano/keyczar
cpp/src/tools/swtoolkit/bin/runtest.py
9
11270
#!/usr/bin/python2.4 # # 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
marshall007/rethinkdb
external/v8_3.30.33.16/build/gyp/test/ninja/normalize-paths-win/gyptest-normalize-paths.py
180
1272
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure paths are normalized with VS macros properly expanded on Windows. """ import TestGyp import sys if sys.platform == 'win32':...
agpl-3.0
ukBaz/python-bluezero
tests/test_async_tools.py
1
1103
import unittest from unittest.mock import MagicMock from unittest.mock import patch import tests.obj_data from bluezero import constants class TestDbusModuleCalls(unittest.TestCase): """ Testing things that use the Dbus module """ def setUp(self): """ Patch the DBus module :ret...
mit
zhaodylan/shadowsocks-1
shadowsocks/daemon.py
386
5602
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # 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 requi...
apache-2.0
econchick/heroku-buildpack-python
vendor/pip-1.2.1/tests/test_proxy.py
12
1545
""" Tests for the proxy support in pip. TODO shouldn't need to hack sys.path in here. """ import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) import os import pip import getpass from pip.basecommand import get_proxy from tests.test_pip import here def new_getpass(prompt, answer='pa...
mit
adit-chandra/tensorflow
tensorflow/python/data/experimental/kernel_tests/model_dataset_test.py
3
1923
# Copyright 2018 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
masayukig/tempest
tempest/api/image/v2/test_images_negative.py
3
4637
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # Copyright 2013 IBM Corp. # # 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/LIC...
apache-2.0
SaptakS/open-event-orga-server
migrations/versions/abda2e67f7c3_.py
10
1202
"""empty message Revision ID: abda2e67f7c3 Revises: 17881794fc87 Create Date: 2016-06-24 14:25:27.481072 """ # revision identifiers, used by Alembic. revision = 'abda2e67f7c3' down_revision = '17881794fc87' from alembic import op import sqlalchemy as sa import sqlalchemy_utils def upgrade(): ### commands auto...
gpl-3.0
titusfortner/selenium
py/test/selenium/webdriver/common/window_switching_tests.py
1
7319
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
icomms/wqmanager
apps/reports/custom/shared.py
4
18632
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from django.utils.translation import ugettext as _ from django.http import HttpResponse from django.template.loader import render_to_string from datetime import datetime, date, timedelta """Shared report methods. These are for domains that share forms (or have ve...
bsd-3-clause
rrrene/django
django/db/models/fields/related.py
38
67398
from __future__ import unicode_literals import warnings from functools import partial from django import forms from django.apps import apps from django.core import checks, exceptions from django.db import connection, router from django.db.backends import utils from django.db.models.deletion import CASCADE, SET_DEFAUL...
bsd-3-clause
gerddie/nipype
nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py
9
1294
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.ants.utils import AverageAffineTransform def test_AverageAffineTransform_inputs(): input_map = dict(args=dict(argstr='%s', ), dimension=dict(argstr='%d', mandatory=True, position=0, ...
bsd-3-clause
tumbl3w33d/ansible
lib/ansible/modules/cloud/amazon/lambda_event.py
3
15145
#!/usr/bin/python # (c) 2016, Pierre Jodouin <pjodouin@virtualcomputing.solutions> # 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
kennethreitz/pipenv
pipenv/patched/yaml3/emitter.py
20
43006
# Emitter expects events obeying the following grammar: # stream ::= STREAM-START document* STREAM-END # document ::= DOCUMENT-START node DOCUMENT-END # node ::= SCALAR | sequence | mapping # sequence ::= SEQUENCE-START node* SEQUENCE-END # mapping ::= MAPPING-START (node node)* MAPPING-END __all__ = ['Emitter', 'Emi...
mit
joshrabinowitz/bitcoin
test/functional/feature_fee_estimation.py
10
11249
#!/usr/bin/env python3 # Copyright (c) 2014-2017 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 fee estimation code.""" from decimal import Decimal import random from test_framework.mininode im...
mit
jsoref/django
tests/generic_inline_admin/models.py
281
1708
from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible class Episode(models.Model): name = models.CharField(max_length=100) ...
bsd-3-clause
CollabQ/CollabQ
.google_appengine/google/appengine/tools/appcfg.py
1
88766
#!/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...
apache-2.0
hellofreedom/ansible
contrib/inventory/ec2.py
20
54413
#!/usr/bin/env python ''' EC2 external inventory script ================================= Generates inventory that Ansible can understand by making API request to AWS EC2 using the Boto library. NOTE: This script assumes Ansible is being executed where the environment variables needed for Boto have already been set:...
gpl-3.0
okeefem2/rhodesiderelics
frontend/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py
1361
45045
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. r"""Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. Th...
mit
jiocloudservices/jcsclient
src/jcsclient/compute_api/snapshot.py
1
2738
# Copyright (c) 2016 Jiocloud.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 right...
apache-2.0
MartynShaw/audacity
lib-src/lv2/sord/waflib/Tools/winres.py
331
2807
#! /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 re,traceback from waflib import Task,Logs,Utils from waflib.TaskGen import extension from waflib.Tools import c_preproc @extension('.rc') def rc_file(self,node): obj_e...
gpl-2.0
vladikoff/fxa-mochitest
tests/venv/lib/python2.7/site-packages/setuptools/command/setopt.py
125
5068
import os import distutils from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename of the distutils, loca...
mpl-2.0
OpenUpgrade-dev/OpenUpgrade
addons/base_setup/base_setup.py
382
5430
# -*- 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
BizzCloud/PosBox
addons/sale_crm/__openerp__.py
52
2121
# -*- 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
robol/lum
src/lum/interface/treeviews.py
1
6910
# # -*- coding: utf-8 -*- # # Implementation of treeviews to manage # users and groups import gtk from utilities import _, package_dir from menu_item import lumUserTreeViewMenu, lumGroupTreeViewMenu import os class UserTreeView(gtk.TreeView): def __init__(self, model, parent): """ Create the new ...
gpl-3.0
NeCTAR-RC/ceilometer
ceilometer/tests/api/v2/test_acl_scenarios.py
1
9667
# -*- encoding: utf-8 -*- # # Copyright © 2012 New Dream Network, LLC (DreamHost) # # Author: Julien Danjou <julien@danjou.info> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http:...
apache-2.0
BeerTheorySociety/timetable
timetable/course.py
1
1052
"""Module for managing course objects """ from .handlers import ContainerHandler from .people import Instructor class Course(ContainerHandler): """Course object. Holds all the information about Arguments --------- subject : str subject of course teacher : str instructors name ...
bsd-3-clause
EmreAtes/spack
lib/spack/external/_pytest/setuponly.py
28
2560
from __future__ import absolute_import, division, print_function import pytest import sys def pytest_addoption(parser): group = parser.getgroup("debugconfig") group.addoption('--setuponly', '--setup-only', action="store_true", help="only setup fixtures, do not execute tests.") group.a...
lgpl-2.1
gylian/sickbeard
lib/hachoir_parser/misc/ttf.py
90
9433
""" TrueType Font parser. Documents: - "An Introduction to TrueType Fonts: A look inside the TTF format" written by "NRSI: Computers & Writing Systems" http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=IWS-Chapter08 Author: Victor Stinner Creation date: 2007-02-08 """ from lib.hachoir_parser im...
gpl-3.0
thientu/scikit-learn
examples/svm/plot_svm_regression.py
249
1451
""" =================================================================== Support Vector Regression (SVR) using linear and non-linear kernels =================================================================== Toy example of 1D regression using linear, polynomial and RBF kernels. """ print(__doc__) import numpy as np ...
bsd-3-clause
wangxd18/ultisnips
pythonx/UltiSnips/text_objects/_python_code.py
12
7683
#!/usr/bin/env python # encoding: utf-8 """Implements `!p ` interpolation.""" import os from collections import namedtuple from UltiSnips import _vim from UltiSnips.compatibility import as_unicode from UltiSnips.indent_util import IndentUtil from UltiSnips.text_objects._base import NoneditableTextObject import UltiS...
gpl-3.0
aestrivex/mne-python
mne/realtime/epochs.py
6
16646
# Authors: Christoph Dinh <chdinh@nmr.mgh.harvard.edu> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # Matti Hamalainen <msh@nmr.mgh.harvard.edu> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) imp...
bsd-3-clause
Ch00k/ansible
lib/ansible/parsing/yaml/dumper.py
61
1322
# (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
coinkeeper/2015-06-22_18-31_bitcoin
qa/rpc-tests/test_framework/script.py
91
23849
# # script.py # # This file is modified from python-bitcoinlib. # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # """Scripts Functionality to build scripts, as well as SignatureHash(). """ from __future__ import absolute_i...
mit
SM-G920P-MM/G920P-MM
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0