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
stephen-soltesz/operator
plsync/mlabconfig_test.py
1
26936
"""Tests for mlabconfig.""" import contextlib import json import logging import mlabconfig import mock import optparse import os from planetlab import model import StringIO import textwrap import time import unittest @contextlib.contextmanager def OpenStringIO(sio): """Creates a StringIO object that is context a...
apache-2.0
jimsimon/sky_engine
sky/tools/webkitpy/common/net/buildbot/buildbot.py
27
18749
# Copyright (c) 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 of conditions and the...
bsd-3-clause
kholidfu/django
tests/fixtures_regress/models.py
281
8611
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Animal(models.Model): name = models.CharField(max_length=150) latin_na...
bsd-3-clause
benpatterson/edx-platform
lms/djangoapps/shoppingcart/tests/test_views.py
10
94652
""" Tests for Shopping Cart views """ from collections import OrderedDict import pytz from urlparse import urlparse from decimal import Decimal import json from django.http import HttpRequest from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from django.c...
agpl-3.0
kalessin/scrapy
scrapy/core/scraper.py
52
9950
"""This module implements the Scraper component which parses responses and extracts information from them""" import logging from collections import deque from twisted.python.failure import Failure from twisted.internet import defer from scrapy.utils.defer import defer_result, defer_succeed, parallel, iter_errback fr...
bsd-3-clause
jtk54/spinnaker
pylib/spinnaker/import_export.py
4
5307
#!/usr/bin/python ''' # Spinnaker Import/Export Tool Python cli tool that imports and exports the following Spinnaker items: * Applications * Pipelines * Deployment Strategies * Task Logs * Echo * Triggers * Executions This is helpful for performing a Spinnaker upgrade. Simply export your items, shut dow...
apache-2.0
geminateCoder/Character-Archive-Website
Lib/site-packages/setuptools/ssl_support.py
100
8119
import os import socket import atexit import re from setuptools.extern.six.moves import urllib, http_client, map import pkg_resources from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_avail...
cc0-1.0
agconti/njode
env/lib/python2.7/site-packages/docutils/parsers/rst/directives/misc.py
106
22888
# $Id: misc.py 7487 2012-07-22 21:20:28Z milde $ # Authors: David Goodger <goodger@python.org>; Dethe Elza # Copyright: This module has been placed in the public domain. """Miscellaneous directives.""" __docformat__ = 'reStructuredText' import sys import os.path import re import time from docutils import io, nodes, ...
bsd-3-clause
sunshinelover/chanlun
vn.ctp/pyscript/generate_td_functions.py
22
10497
# encoding: UTF-8 __author__ = 'CHENXY' from string import join from ctp_struct import structDict def processCallBack(line): orignalLine = line line = line.replace('\tvirtual void ', '') # 删除行首的无效内容 line = line.replace('{};\n', '') # 删除行尾的无效内容 content = line.split('(') cbNa...
mit
mutirri/bokeh
bokeh/plot_object.py
4
10840
from __future__ import absolute_import, print_function import logging logger = logging.getLogger(__file__) from six import add_metaclass, iteritems from .properties import Any, HasProps, List, MetaHasProps, Instance, String from .query import find from .exceptions import DataIntegrityException from .util.serializati...
bsd-3-clause
davibe/cerbero
cerbero/packages/linux.py
21
7888
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General ...
lgpl-2.1
aldariz/Sick-Beard
lib/guessit/containers.py
10
23369
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # Copyright (c) 2013 Rémi Alvergnat <toilal.dev@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Le...
gpl-3.0
jetty840/ReplicatorG
skein_engines/skeinforge-35/fabmetheus_utilities/geometry/geometry_utilities/evaluate_fundamentals/_math.py
8
2348
""" Boolean geometry utilities. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities import euclidean import math __author__ ...
gpl-2.0
jriguera/Diamond
src/collectors/proc/test/testproc.py
30
2218
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch try: from cStringIO import StringIO except ImportError: ...
mit
qrealka/skia-hc
third_party/externals/shaderc2/glslc/test/option_dash_M.py
3
32631
# Copyright 2015 The Shaderc 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 applicable...
apache-2.0
zeded/bitcurrency
contrib/linearize/linearize-data.py
123
5826
#!/usr/bin/python # # linearize-data.py: Construct a linear, no-fork version of the chain. # # Copyright (c) 2013 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import json import struct import re imp...
mit
ezequielpereira/Time-Line
libs/wx/lib/mixins/gridlabelrenderer.py
2
8289
#---------------------------------------------------------------------- # Name: wx.lib.mixins.gridlabelrenderer # Purpose: A Grid mixin that enables renderers to be plugged in # for drawing the row and col labels, similar to how the # cell renderers work. # # Author: Robin Dunn...
gpl-3.0
ArcherCraftStore/ArcherVMPeridot
Python/Lib/unittest/test/support.py
81
3872
import unittest class TestEquality(object): """Used as a mixin for TestCase""" # Check for a valid __eq__ implementation def test_eq(self): for obj_1, obj_2 in self.eq_pairs: self.assertEqual(obj_1, obj_2) self.assertEqual(obj_2, obj_1) # Check for a valid __ne__ impl...
apache-2.0
OBA-code/tgstation
tools/minibot/minibot.py
107
5089
#!/usr/bin/env python3 # This bot was made by tkdrg. # Ask #coderbus@irc.rizon.net if this breaks. # See LICENSE-bot_folder.txt for the license of the files in this folder. from config import * import collections import time import pickle import socket import sys import threading import logging import logging.handlers ...
agpl-3.0
ubuntu-touchCAF/android_kernel_motorola_msm8226
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
patacca/nyx
nyx/panel/header.py
1
16138
# Copyright 2009-2016, Damian Johnson and The Tor Project # See LICENSE for licensing information """ Top panel for every page, containing basic system and tor related information. This expands the information it presents to two columns if there's room available. """ import os import time import stem import stem.con...
gpl-3.0
bblacey/FreeCAD-MacOS-CI
src/Mod/Fem/PyObjects/_FemResultMechanical.py
2
4984
#*************************************************************************** #* * #* Copyright (c) 2016 - Qingfeng Xia <qingfeng.xia()eng.ox.ac.uk> * #* * #* This program i...
lgpl-2.1
Haynie-Research-and-Development/jarvis
stt/plugins/tts/defaulttts/defaulttts.py
1
1246
#********************************************************** #* CATEGORY JARVIS HOME AUTOMTION #* GROUP SPEECH TO TEXT #* AUTHOR LANCE HAYNIE <LANCE@HAYNIEMAIL.COM> #********************************************************** #Jarvis Home Automation #Copyright (C) 2017 Haynie Research & Development #This ...
gpl-2.0
nthall/pip
pip/_vendor/requests/adapters.py
175
17495
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import os.path import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib...
mit
guorendong/iridium-browser-ubuntu
third_party/chromite/lib/process_util.py
2
1676
# Copyright 2014 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Process related utilities.""" from __future__ import print_function import errno import os import signal import sys import time def GetExitStatus(s...
bsd-3-clause
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/lib2to3/fixer_base.py
100
6706
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Base class for fixers (optional, but recommended).""" # Python imports import logging import itertools # Local imports from .patcomp import PatternCompiler from . import pygram from .fixer_util import does_tree_imp...
gpl-2.0
40223211/w16b_test
static/Brython3.1.1-20150328-091302/Lib/sys.py
408
4998
# hack to return special attributes from _sys import * from javascript import JSObject has_local_storage=__BRYTHON__.has_local_storage has_session_storage = __BRYTHON__.has_session_storage has_json=__BRYTHON__.has_json brython_debug_mode = __BRYTHON__.debug argv = ['__main__'] base_exec_prefix = __BRYTHON__.brython_...
agpl-3.0
vmora/QGIS
python/plugins/processing/core/Processing.py
6
8196
# -*- coding: utf-8 -*- """ *************************************************************************** Processing.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ****************************...
gpl-2.0
adrianmoisey/s3cmd
S3/S3Uri.py
9
6715
# -*- coding: utf-8 -*- ## Amazon S3 manager ## Author: Michal Ludvig <michal@logix.cz> ## http://www.logix.cz/michal ## License: GPL Version 2 ## Copyright: TGRMN Software and contributors import os import re import sys from Utils import unicodise, deunicodise, check_bucket_name_dns_support import Config cl...
gpl-2.0
Duoxilian/home-assistant
homeassistant/components/switch/fritzdect.py
17
5303
""" Support for FRITZ!DECT Switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.fritzdect/ """ import logging import voluptuous as vol from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA) from homeassistant.const impor...
mit
eamoncaddigan/fivethirthyeight-data
buster-posey-mvp/baseball_imgcap_for_release.py
32
1077
from PIL import ImageFile from PIL import ImageGrab from PIL import * import time import sys import glob import math import os import gc from multiprocessing import Process import win32ui import win32gui import win32con def piccap(i, w=300, h=300): hwnd = win32gui.GetDesktopWindow() wDC = win32gui.GetWindowDC(...
mit
CredoReference/edx-platform
common/test/acceptance/fixtures/base.py
24
5915
""" Common code shared by course and library fixtures. """ import json import requests from lazy import lazy from common.test.acceptance.fixtures import STUDIO_BASE_URL class StudioApiLoginError(Exception): """ Error occurred while logging in to the Studio API. """ pass class StudioApiFixture(obje...
agpl-3.0
ArcticWarriors/scouting-app-2016
ScoutingWebsite/BaseScouting/views/standard_views/base_match.py
2
2424
from django.views.generic.base import TemplateView from django.shortcuts import get_object_or_404 import operator class BaseSingleMatchView(TemplateView): """ This page will display any requested match. This page can be accessed through many places, such as the list of all matches, or when viewing any tea...
mit
lanen/youtube-dl
youtube_dl/extractor/echomsk.py
130
1315
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class EchoMskIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?echo\.msk\.ru/sounds/(?P<id>\d+)' _TEST = { 'url': 'http://www.echo.msk.ru/sounds/1464134.html', 'md5': '2e44b3b78daff5b458e4dbc...
unlicense
nathanielvarona/airflow
airflow/providers/google/cloud/example_dags/example_functions.py
10
5116
# # 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
blackbliss/medity-expo-2014
remote-api/flask/lib/python2.7/site-packages/jinja2/testsuite/api.py
402
10381
# -*- coding: utf-8 -*- """ jinja2.testsuite.api ~~~~~~~~~~~~~~~~~~~~ Tests the public API and related stuff. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest import os import tempfile import shutil from jinja2.testsuite import JinjaTestCase...
mit
nicfit/eyed3
eyed3/plugins/display.py
1
41205
################################################################################ # Copyright (C) 2014-2016 Sebastian Patschorke <physicspatschi@gmx.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software...
gpl-2.0
WarrenWeckesser/scikits-image
skimage/restoration/unwrap.py
23
4720
import numpy as np import warnings from six import string_types from ._unwrap_1d import unwrap_1d from ._unwrap_2d import unwrap_2d from ._unwrap_3d import unwrap_3d def unwrap_phase(image, wrap_around=False, seed=None): '''Recover the original from a wrapped phase image. From an image wrapped to lie in the...
bsd-3-clause
fabiangreffrath/MINGW-packages
mingw-w64-gdk-pixbuf2/test-format-support.py
13
36934
#!/usr/bin/env python3 """This script make sure that all gdk-pixbuf loaders are present and working. This only works when the package is installed (with the module cache in the right position). """ import os import tempfile import gi gi.require_version('GdkPixbuf', '2.0') from gi.repository import GdkPixbuf def ma...
bsd-3-clause
debugger22/sympy
sympy/vector/tests/test_dyadic.py
94
4076
from sympy import sin, cos, symbols, pi, ImmutableMatrix as Matrix, \ simplify from sympy.vector import (CoordSysCartesian, Vector, Dyadic, DyadicAdd, DyadicMul, DyadicZero, BaseDyadic, express) A = CoordSysCartesian('A') def test_dyadic(): a, b = symbols...
bsd-3-clause
opensourcechipspark/platform_external_chromium_org
chrome/tools/webforms_aggregator_tests.py
185
1970
#!/usr/bin/env python # Copyright (c) 2011 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 tempfile import unittest import webforms_aggregator class WebformsAggregatorTest(unittest.TestCase): """Unit ...
bsd-3-clause
wwj718/edx-platform
openedx/core/djangoapps/user_api/accounts/tests/test_api.py
31
18401
# -*- coding: utf-8 -*- """ Unit tests for behavior that is specific to the api methods (vs. the view methods). Most of the functionality is covered in test_views.py. """ import re import ddt from dateutil.parser import parse as parse_datetime from mock import Mock, patch from django.test import TestCase from nose.too...
agpl-3.0
samatdav/zulip
zerver/lib/i18n.py
18
2638
# -*- coding: utf-8 -*- from __future__ import absolute_import import operator from django.conf import settings from django.utils import translation from django.utils.translation import ugettext as _ from six.moves import urllib, zip_longest, zip, range from typing import Any, List, Dict, Optional, Text import os im...
apache-2.0
apollo13/ansible
test/support/integration/plugins/modules/postgresql_user.py
51
34084
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': [...
gpl-3.0
Technaesthetic/ua-tools
node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 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. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
mit
BirkbeckCTP/janeway
src/identifiers/management/commands/poll_crossref.py
1
2578
from django.core.management.base import BaseCommand from django.core.management import call_command from django.db.models import Q from identifiers import models from utils.logger import get_logger logger = get_logger(__name__) MAX_POLLING_ATTEMPTS = 20 class Command(BaseCommand): """ Executes all of Janewa...
agpl-3.0
mitodl/open-discussions
search/api.py
1
18625
"""API for general search-related functionality""" from base64 import urlsafe_b64encode from collections import Counter, defaultdict from elasticsearch_dsl import Q, Search from elasticsearch_dsl.query import MoreLikeThis from django.conf import settings from channels.constants import ( CHANNEL_TYPE_PUBLIC, C...
bsd-3-clause
CTXz/android_kernel_samsung_degaswifi
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
ygol/odoo
openerp/addons/base/res/res_partner.py
36
41228
# -*- 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
stevenmizuno/QGIS
python/plugins/processing/algs/qgis/RasterLayerStatistics.py
5
5322
# -*- coding: utf-8 -*- """ *************************************************************************** RasterLayerStatistics.py --------------------- Date : January 2013 Copyright : (C) 2013 by Victor Olaya Email : volayaf at gmail dot com ****************...
gpl-2.0
junmin-zhu/chromium-rivertrail
third_party/tlslite/tlslite/utils/ASN1Parser.py
80
1038
"""Class for parsing ASN.1""" from compat import * from codec import * #Takes a byte array which has a DER TLV field at its head class ASN1Parser: def __init__(self, bytes): p = Parser(bytes) p.get(1) #skip Type #Get Length self.length = self._getASN1Length(p) #Get Value ...
bsd-3-clause
jmargeta/scikit-learn
examples/plot_multilabel.py
4
4168
# Authors: Vlad Niculae, Mathieu Blondel # License: BSD """ ========================= Multilabel classification ========================= This example simulates a multi-label document classification problem. The dataset is generated randomly based on the following process: - pick the number of labels: n ~ Poisson...
bsd-3-clause
ActiveState/code
recipes/Python/501151_Generating_combinations/recipe-501151.py
1
3546
from itertools import islice, repeat, izip, cycle # If PEP 3102 is accepted, the signature would be #def iterCombinations(*iterables, blocksize=1): def iterCombinations(*iterables, **kwds): '''Generates the combinations of the given iterables. @returns: An iterator over all combinations of the C{iterables...
mit
GiovanniConserva/TestDeploy
venv/Lib/site-packages/pip/_vendor/lockfile/sqlitelockfile.py
536
5506
from __future__ import absolute_import, division import time import os try: unicode except NameError: unicode = str from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked class SQLiteLockFile(LockBase): "Demonstrate SQL-based locking." testdb = None def __init__(self, path, ...
bsd-3-clause
darkopevec/kivy
kivy/input/providers/hidinput.py
2
26630
# coding utf-8 ''' Native support for HID input from the linux kernel ================================================== Support starts from 2.6.32-ubuntu, or 2.6.34. To configure HIDInput, add this to your configuration:: [input] # devicename = hidinput,/dev/input/eventXX # example with Stantum MTP4.3" ...
mit
Esquive/kafka
tests/kafkatest/tests/core/zookeeper_security_upgrade_test.py
15
4561
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
petermat/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/queuecharts.py
122
6724
# Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
certik/sympy-oldcore
sympy/core/tests/test_eval_power.py
1
1302
from sympy.core import * def test_rational(): a = Rational(1, 5) assert a**Rational(1, 2) == a**Rational(1, 2) assert 2 * a**Rational(1, 2) == 2 * a**Rational(1, 2) assert a**Rational(3, 2) == a * a**Rational(1, 2) assert 2 * a**Rational(3, 2) == 2*a * a**Rational(1, 2) assert a**Rational(17...
bsd-3-clause
alex/paramiko
paramiko/sftp_server.py
7
17825
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
lgpl-2.1
UnrememberMe/pants
contrib/scrooge/src/python/pants/contrib/scrooge/tasks/thrift_util.py
31
2554
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import re ...
apache-2.0
laosiaudi/tensorflow
tensorflow/contrib/learn/python/learn/tests/dataframe/reader_source_test.py
14
3170
# 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
limdauto/django-social-auth
social_auth/tests/client.py
1
5170
import urllib.request, urllib.parse, urllib.error try: import json as simplejson except ImportError: try: import simplejson except ImportError: from django.utils import simplejson from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.test.client ...
bsd-3-clause
Just-D/chromium-1
tools/auto_bisect/bisect_perf_regression_test.py
8
28883
# Copyright 2014 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 re import shutil import sys import unittest SRC = os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir) sys.path.append(o...
bsd-3-clause
nhenezi/kuma
vendor/packages/nose/nose/plugins/deprecated.py
107
1551
""" This plugin installs a DEPRECATED error class for the :class:`DeprecatedTest` exception. When :class:`DeprecatedTest` is raised, the exception will be logged in the deprecated attribute of the result, ``D`` or ``DEPRECATED`` (verbose) will be output, and the exception will not be counted as an error or failure. It ...
mpl-2.0
freedesktop-unofficial-mirror/telepathy__telepathy-farstream
examples/python/callchannel.py
1
6658
#!/usr/bin/env python # # callchannel.py # Copyright (C) 2008-2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option...
lgpl-2.1
arvinsingla/CouchPotatoServer
couchpotato/core/notifications/toasty.py
62
1740
import traceback from couchpotato.core.helpers.encoding import toUnicode, tryUrlencode from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification log = CPLog(__name__) autoload = 'Toasty' class Toasty(Notification): urls = { 'api': 'http://api.supertoasty.c...
gpl-3.0
saluspot/ecce-homo
eccehomo/utils.py
2
1473
from PIL import Image from six.moves.urllib.parse import urlparse from resizeimage import resizeimage from .settings import DEFAULT_METHOD def get_resize_arguments(**kwargs): width = kwargs.get('w') height = kwargs.get('h') method = kwargs.get('t') if not method: if width: metho...
mit
mojeto/django
django/templatetags/tz.py
129
5400
from datetime import datetime, tzinfo import pytz from django.template import Library, Node, TemplateSyntaxError from django.utils import timezone register = Library() # HACK: datetime instances cannot be assigned new attributes. Define a subclass # in order to define new attributes in do_timezone(). class datetim...
bsd-3-clause
ice9js/servo
tests/wpt/harness/wptrunner/executors/executorselenium.py
61
9570
# 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 import socket import sys import threading import time import traceback import urlparse import uuid from .base...
mpl-2.0
dxxb/micropython
tests/basics/int_small.py
111
1520
# This tests small int range for 32-bit machine # Small ints are variable-length encoded in MicroPython, so first # test that encoding works as expected. print(0) print(1) print(-1) # Value is split in 7-bit "subwords", and taking into account that all # ints in Python are signed, there're 6 bits of magnitude. So, ar...
mit
Iwan-Zotow/Fiducial
import_cup.py
1
10959
# coding: utf-8 import sys import logging import math from functools import partial import OCC.TopoDS import OCC.Display.SimpleGui import aocutils.display.topology import aocutils.display.backends import aocxchange.step import aocxchange.utils from XcMath import utils from point2d import point2d fro...
mit
Osndok/zim-desktop-wiki
zim/gui/propertiesdialog.py
1
1032
# -*- coding: utf-8 -*- # Copyright 2008 Jaap Karssenberg <jaap.karssenberg@gmail.com> import gtk from zim.gui.widgets import Dialog class PropertiesDialog(Dialog): def __init__(self, ui): Dialog.__init__(self, ui, _('Properties'), help='Help:Properties') # T: Dialog title label = gtk.Label() label.set_marku...
gpl-2.0
tivaliy/python-gerritclient
gerritclient/tests/utils/fake_group.py
1
1967
# # Copyright 2017 Vitalii Kulanov # # 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 ...
apache-2.0
supersonicninja/HW01EKERNEL
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
pombredanne/taskflow-1
taskflow/patterns/linear_flow.py
2
2821
# -*- coding: utf-8 -*- # Copyright (C) 2012 Yahoo! 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...
apache-2.0
0k/odoo
addons/hr_attendance/res_config.py
434
1406
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
mkaay/SerienJunkiesBrowser
__main__.py
1
15916
# -*- coding: utf-8 -*- """ SerienJunkies-eXtended Browser Copyright (C) 2009 mkaay <mkaay@mkaay.de> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the Licen...
gpl-3.0
natanielruiz/android-yolo
jni-build/jni/include/tensorflow/contrib/framework/python/ops/prettyprint_ops.py
15
6195
# 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
xke/nash
app/utils.py
3
1277
def subjective_graph_nodes(nodes): rv = [] for node in nodes: print node.keys() rv.append(dict(index=node[u'index'], id=node[u'id'], truth=node.get(u'truth', False), self_cause_weird=node.get(u'self_cause_weird', '3'), ...
bsd-2-clause
Sonicbids/django
tests/str/models.py
409
1300
# -*- coding: utf-8 -*- """ Adding __str__() or __unicode__() to models Although it's not a strict requirement, each model should have a ``_str__()`` or ``__unicode__()`` method to return a "human-readable" representation of the object. Do this not only for your own sanity when dealing with the interactive prompt, but...
bsd-3-clause
mkuron/espresso
doc/tutorials/02-charged_system/scripts/nacl_units.py
1
5816
# # Copyright (C) 2010-2018 The ESPResSo project # Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 # Max-Planck-Institute for Polymer Research, Theory Group # # This file is part of ESPResSo. # # ESPResSo is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public...
gpl-3.0
ryangallen/django
django/forms/forms.py
75
27667
""" Form classes """ from __future__ import unicode_literals import copy import datetime from collections import OrderedDict from django.core.exceptions import NON_FIELD_ERRORS, ValidationError from django.forms.fields import Field, FileField from django.forms.utils import ErrorDict, ErrorList, flatatt from django.f...
bsd-3-clause
nomadcube/scikit-learn
examples/applications/plot_prediction_latency.py
234
11277
""" ================== Prediction Latency ================== This is an example showing the prediction latency of various scikit-learn estimators. The goal is to measure the latency one can expect when doing predictions either in bulk or atomic (i.e. one by one) mode. The plots represent the distribution of the pred...
bsd-3-clause
ghosthamlet/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Script/Interactive.py
61
14083
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without li...
apache-2.0
xiaoyuanW/gem5
src/arch/x86/isa/insts/simd64/integer/shift/left_logical_shift.py
91
3272
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
bankonme/www.freedomsponsors.org
djangoproject/frespo_currencies/migrations/0003_auto__del_field_rates_google_data.py
3
1103
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Rates.google_data' db.delete_column('frespo_currencies_rates', 'google_data') def ba...
agpl-3.0
linuskendall/py-duplicity-backup
ez_setup.py
276
10240
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
gpl-2.0
CoDEmanX/ArangoDB
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/pydocfodder.py
194
6329
"""Something just to look at via pydoc.""" import types class A_classic: "A classic class." def A_method(self): "Method defined in A." def AB_method(self): "Method defined in A and B." def AC_method(self): "Method defined in A and C." def AD_method(self): "Method de...
apache-2.0
emersonsoftware/ansiblefork
lib/ansible/modules/cloud/openstack/os_ironic_inspect.py
6
5898
#!/usr/bin/python # coding: utf-8 -*- # (c) 2015-2016, Hewlett Packard Enterprise Development Company LP # # This module 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
rubencabrera/odoo
addons/account/report/account_general_ledger.py
155
15158
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2005-2006 CamptoCamp # Copyright (c) 2006-2010 OpenERP S.A # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsibility of assessing all po...
agpl-3.0
yuruofeifei/mms
mxnet_model_server.py
1
2393
from mms.arg_parser import ArgParser from mms.log import get_logger from mms.serving_frontend import ServingFrontend from mms.client_sdk_generator import ClientSDKGenerator logger = get_logger(__name__) class MMS(object): '''MXNet Model Serving ''' def __init__(self, app_name='mms'): # Initializ...
apache-2.0
abdoosh00/edx-platform
common/djangoapps/student/tests/test_bulk_email_settings.py
30
5718
""" Unit tests for email feature flag in student dashboard. Additionally tests that bulk email is always disabled for non-Mongo backed courses, regardless of email feature flag, and that the view is conditionally available when Course Auth is turned on. """ from django.test.utils import override_settings from django.c...
agpl-3.0
leoliujie/odoo
addons/google_calendar/google_calendar.py
9
51365
# -*- coding: utf-8 -*- import operator import simplejson import urllib2 import openerp from openerp import tools from openerp import SUPERUSER_ID from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, exception_to_unicode from openerp.tools.translate import _ from openerp.http import ...
agpl-3.0
sublime1809/django
tests/select_related/models.py
38
2285
""" 41. Tests for select_related() ``select_related()`` follows all relationships and pre-caches any foreign key values so that complex trees can be fetched in a single query. However, this isn't always a good idea, so the ``depth`` argument control how many "levels" the select-related behavior will traverse. """ fro...
bsd-3-clause
collective/collective.subsitebehaviors
src/collective/subsitebehaviors/browser/cssviewlet.py
1
2489
import re from plone import api from plone.app.layout.viewlets.common import ViewletBase from plone.app.layout.navigation.root import getNavigationRoot #from ftw.subsite.interfaces import ISubsite from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from ..behaviors import ISubSite from ..utils impo...
gpl-2.0
gangliao/Paddle
python/paddle/trainer_config_helpers/tests/configs/test_cost_layers.py
9
1271
from paddle.trainer_config_helpers import * settings(learning_rate=1e-4, batch_size=1000) seq_in = data_layer(name='input', size=200) labels = data_layer(name='labels', size=5000) probs = data_layer(name='probs', size=10) xe_label = data_layer(name='xe-label', size=10) hidden = fc_layer(input=seq_in, size=4) output...
apache-2.0
petermat/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/statusbubble_unittest.py
128
2482
# Copyright (C) 2010 Google, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
wholmgren/pvlib-python
pvlib/solarposition.py
1
48876
""" Calculate the solar position using a variety of methods/packages. """ # Contributors: # Rob Andrews (@Calama-Consulting), Calama Consulting, 2014 # Will Holmgren (@wholmgren), University of Arizona, 2014 # Tony Lorenzo (@alorenzo175), University of Arizona, 2015 # Cliff hansen (@cwhanse), Sandia National Laborator...
bsd-3-clause
jhg/django
django/contrib/auth/tokens.py
433
2803
from datetime import date from django.conf import settings from django.utils import six from django.utils.crypto import constant_time_compare, salted_hmac from django.utils.http import base36_to_int, int_to_base36 class PasswordResetTokenGenerator(object): """ Strategy object used to generate and check token...
bsd-3-clause
mark-me/Pi-Jukebox
venv/Lib/site-packages/pygame/examples/arraydemo.py
5
3721
#!/usr/bin/env python import os import pygame from pygame import surfarray from pygame.locals import * main_dir = os.path.split(os.path.abspath(__file__))[0] def surfdemo_show(array_img, name): "displays a surface, waits for user to continue" screen = pygame.display.set_mode(array_img.shape[:2], 0, 32) ...
agpl-3.0